diff --git a/.gitignore b/.gitignore index 8f01f60bf9c979a098c81d1609cc176cab630a5c..0a116f850780386a9fe1010b22164f4c7dbf8228 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,7 @@ coverage.xml .pytest_cache/ .benchmarks/ cover/ +*_report.xml # Translations *.mo @@ -130,6 +131,9 @@ venv.bak/ # VSCode project settings .vscode/ +# Visual Studio project settings +/.vs + # Rope project settings .ropeproject @@ -155,3 +159,14 @@ cython_debug/ # Sqlite *.db + +# TeraFlowSDN-generated files +tfs_runtime_env_vars.sh +tfs_runtime_env_vars*.sh +tfs_bchain_runtime_env_vars.sh +delete_local_deployment.sh +local_docker_deployment.sh +local_k8s_deployment.sh + +# Other logs +**/logs/*.log.* diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bc746a53440e0b4dbf0accf53e934e54df9c7c75..713d893cffe4b88cb9b37d64a860f480c9669008 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,26 +1,44 @@ +# 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. + # stages of the cicd pipeline stages: - - dependencies + #- dependencies - build - - test - unit_test - - integ_test - - deploy - - funct_test + #- deploy + #- end2end_test # include the individual .gitlab-ci.yml of each micro-service include: - - local: '/manifests/.gitlab-ci.yml' + #- local: '/manifests/.gitlab-ci.yml' - local: '/src/monitoring/.gitlab-ci.yml' - local: '/src/compute/.gitlab-ci.yml' - local: '/src/context/.gitlab-ci.yml' - local: '/src/device/.gitlab-ci.yml' - local: '/src/service/.gitlab-ci.yml' - - local: '/src/dbscanserving/.gitlab-ci.yml' - - local: '/src/opticalattackmitigator/.gitlab-ci.yml' - - local: '/src/opticalcentralizedattackdetector/.gitlab-ci.yml' + #- local: '/src/dbscanserving/.gitlab-ci.yml' + #- local: '/src/opticalattackmitigator/.gitlab-ci.yml' + #- local: '/src/opticalcentralizedattackdetector/.gitlab-ci.yml' - local: '/src/automation/.gitlab-ci.yml' - - local: '/src/webui/.gitlab-ci.yml' - - local: '/src/l3_distributedattackdetector/.gitlab-ci.yml' - - local: '/src/l3_centralizedattackdetector/.gitlab-ci.yml' - - local: '/src/l3_attackmitigator/.gitlab-ci.yml' + - local: '/src/policy/.gitlab-ci.yml' + #- local: '/src/webui/.gitlab-ci.yml' + #- local: '/src/l3_distributedattackdetector/.gitlab-ci.yml' + #- local: '/src/l3_centralizedattackdetector/.gitlab-ci.yml' + #- local: '/src/l3_attackmitigator/.gitlab-ci.yml' + #- local: '/src/slice/.gitlab-ci.yml' + #- local: '/src/interdomain/.gitlab-ci.yml' + - local: '/src/pathcomp/.gitlab-ci.yml' + #- local: '/src/dlt/.gitlab-ci.yml' + - local: '/src/load_generator/.gitlab-ci.yml' diff --git a/INSTALL.md b/INSTALL.md deleted file mode 100644 index 670af487313498ad60f8c0fc89029218efe29405..0000000000000000000000000000000000000000 --- a/INSTALL.md +++ /dev/null @@ -1,4 +0,0 @@ -# TeraFlow OS SDN Controller Installation Instructions -Assuming you have a running Kubernetes deployment installed following the instructions provided in [Wiki: Installing Kubernetes on your Linux machine](https://gitlab.com/teraflow-h2020/controller/-/wikis/Installing-Kubernetes-on-your-Linux-machine), the following instructions will let you deploy TeraFlow OS SDN Controller in your local Kubernetes environment. - -Then, follow the instructions in [Wiki: Deploying a TeraFlow OS test instance](https://gitlab.com/teraflow-h2020/controller/-/wikis/Deploying-a-TeraFlow-OS-test-instance) to deploy your instance of TeraFlow OS. diff --git a/README.md b/README.md index ca386309d358387259775b34c22043c78db6762e..5bfb6d70d947f631e8694b3dcf6c872cf1248ea4 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,14 @@ # ETSI TeraFlowSDN Controller -[TeraFlow H2020 project](https://teraflow-h2020.eu/) - Secured autonomic traffic management for a Tera of SDN Flows - -[ETSI TeraFlowSDN OSG](https://tfs.etsi.org/) - ETSI Open Source Group for TeraFlowSDN +[ETSI OpenSource Group for TeraFlowSDN](https://tfs.etsi.org/) +Former, [Teraflow H2020 project](https://teraflow-h2020.eu/) - Secured autonomic traffic management for a Tera of SDN Flows Branch "master" : [![pipeline status](https://labs.etsi.org/rep/tfs/controller/badges/master/pipeline.svg)](https://labs.etsi.org/rep/tfs/controller/-/commits/master) [![coverage report](https://labs.etsi.org/rep/tfs/controller/badges/master/coverage.svg)](https://labs.etsi.org/rep/tfs/controller/-/commits/master) Branch "develop" : [![pipeline status](https://labs.etsi.org/rep/tfs/controller/badges/develop/pipeline.svg)](https://labs.etsi.org/rep/tfs/controller/-/commits/develop) [![coverage report](https://labs.etsi.org/rep/tfs/controller/badges/develop/coverage.svg)](https://labs.etsi.org/rep/tfs/controller/-/commits/develop) +# Installation Instructions and Functional Tests +The [TeraFlowSDN Wiki](https://labs.etsi.org/rep/tfs/controller/-/wikis/home) pages include details on using the ETSI TeraFlowSDN release 2.0. -# Installation Instructions -To install ETSI TeraFlowSDN Controller in your local Kubernetes deployment, we assume you deployed Kubernetes following the instructions provided in [Wiki: Installing Kubernetes on your Linux machine](https://gitlab.com/teraflow-h2020/controller/-/wikis/Installing-Kubernetes-on-your-Linux-machine). - -Then, follow the instructions in [Wiki: Deploying a TeraFlow OS test instance](https://gitlab.com/teraflow-h2020/controller/-/wikis/Deploying-a-TeraFlow-OS-test-instance) to deploy your instance of TeraFlow OS. - - -# Functional Tests -A number of functional tests have been defined to enable experimentation with the ETSI TeraFlowSDN Controller: - -__Important:__ The OpenConfigDriver, the P4Driver, and the TrandportApiDriver have to be considered as experimental. The configuration and monitoring capabilities they support are limited or partially implemented. Use them with care. - -[Demo at OFC'22 (Bootstrap devices, Manage L3VPN services, Monitor Device Endpoints)](./src/tests/ofc22) +The documentation, installation instructions, and description of the functional tests defined to enable experimentation with the ETSI TeraFlowSDN Controller can be found in the Wiki pages diff --git a/clean_testing_environment.sh b/clean_testing_environment.sh index 09bff95d82fe37a86d3a7c6569c6e3d0a00d64db..b9c502ade6f34e3a19ebeafa67c222b10ea3f99d 100755 --- a/clean_testing_environment.sh +++ b/clean_testing_environment.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/common/orm/backend/Tools.py b/common_requirements.in similarity index 64% rename from src/common/orm/backend/Tools.py rename to common_requirements.in index 30223feac8c98c4272e56de841c1abafb792c5a6..cb418f0197f1d18980654c8d00102efd191c67dd 100644 --- a/src/common/orm/backend/Tools.py +++ b/common_requirements.in @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,8 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import List, Union - -def key_to_str(key : Union[str, List[str]], separator : str = '/') -> str: - if isinstance(key, str): return key - return separator.join(map(str, key)) +coverage==6.3 +grpcio==1.47.* +grpcio-health-checking==1.47.* +grpcio-tools==1.47.* +prettytable==3.5.0 +prometheus-client==0.13.0 +protobuf==3.20.* +pytest==6.2.5 +pytest-benchmark==3.4.1 +python-dateutil==2.8.2 +pytest-depends==1.0.1 diff --git a/coverage/.coveragerc.template b/coverage/.coveragerc.template index e5e634c2c256103b1796d9309a3433ae9f248e70..4421399ca30027e3032001dae64e6fa0b7fa41cb 100644 --- a/coverage/.coveragerc.template +++ b/coverage/.coveragerc.template @@ -1,5 +1,19 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + [run] -data_file = ~/teraflow/controller/coverage/.coverage +data_file = ~/tfs-ctrl/coverage/.coverage source = . omit = */proto/* @@ -12,7 +26,7 @@ exclude_lines = raise\ NotImplementedError [html] -directory = ~/teraflow/controller/coverage/html_report +directory = ~/tfs-ctrl/coverage/html_report [xml] output = ~/teraflow/controller/coverage/report.xml diff --git a/data/.gitignore b/data/.gitignore index 5ca4d5198fe878058d83a415a3fed261375b42a3..4507f94635b46c4364e46fefee8974870f678245 100644 --- a/data/.gitignore +++ b/data/.gitignore @@ -1,2 +1,3 @@ +!.gitkeep *.dot *.xml diff --git a/deploy/all.sh b/deploy/all.sh new file mode 100755 index 0000000000000000000000000000000000000000..a99607f5b907c2bd1e1b4b889bef881874a63967 --- /dev/null +++ b/deploy/all.sh @@ -0,0 +1,156 @@ +#!/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. + + +######################################################################################################################## +# Read deployment settings +######################################################################################################################## + + +# ----- TeraFlowSDN ------------------------------------------------------------ + +# If not already set, set the URL of the Docker registry where the images will be uploaded to. +# By default, assume internal MicroK8s registry is used. +export TFS_REGISTRY_IMAGES=${TFS_REGISTRY_IMAGES:-"http://localhost:32000/tfs/"} + +# If not already set, set the list of components you want to build images for, and deploy. +# By default, only basic components are deployed +export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device monitoring service compute webui"} + +# If not already set, set the tag you want to use for your images. +export TFS_IMAGE_TAG=${TFS_IMAGE_TAG:-"dev"} + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +# If not already set, set additional manifest files to be applied after the deployment +export TFS_EXTRA_MANIFESTS=${TFS_EXTRA_MANIFESTS:-""} + +# If not already set, set the new Grafana admin password +export TFS_GRAFANA_PASSWORD=${TFS_GRAFANA_PASSWORD:-"admin123+"} + +# If not already set, disable skip-build flag. +# If TFS_SKIP_BUILD is "YES", the containers are not rebuilt-retagged-repushed and existing ones are used. +export TFS_SKIP_BUILD=${TFS_SKIP_BUILD:-""} + + +# ----- CockroachDB ------------------------------------------------------------ + +# If not already set, set the namespace where CockroackDB will be deployed. +export CRDB_NAMESPACE=${CRDB_NAMESPACE:-"crdb"} + +# If not already set, set the database username to be used by Context. +export CRDB_USERNAME=${CRDB_USERNAME:-"tfs"} + +# If not already set, set the database user's password to be used by Context. +export CRDB_PASSWORD=${CRDB_PASSWORD:-"tfs123"} + +# If not already set, set the database name to be used by Context. +export CRDB_DATABASE=${CRDB_DATABASE:-"tfs"} + +# If not already set, set the name of the secret where CockroachDB data and credentials will be stored. +export CRDB_SECRET_NAME=${CRDB_SECRET_NAME:-"crdb-data"} + +# If not already set, set the namespace where the secret containing CockroachDB data and credentials will be stored. +export CRDB_SECRET_NAMESPACE=${CRDB_SECRET_NAMESPACE:-${TFS_K8S_NAMESPACE}} + +# If not already set, set CockroachDB installation mode. Accepted values are: 'single' and 'cluster'. +# "YES", the database pointed by variable CRDB_NAMESPACE will be dropped while +# checking/deploying CockroachDB. +# - If CRDB_DEPLOY_MODE is "single", CockroachDB is deployed in single node mode. It is convenient for +# development and testing purposes and should fit in a VM. IT SHOULD NOT BE USED IN PRODUCTION ENVIRONMENTS. +# - If CRDB_DEPLOY_MODE is "cluster", CockroachDB is deployed in cluster mode, and an entire CockroachDB cluster +# with 3 replicas and version v22.2 (set by default) will be deployed. It is convenient for production and +# provides scalability features. If you are deploying for production, also read the following link providing +# details on deploying CockroachDB for production environments: +# Ref: https://www.cockroachlabs.com/docs/stable/recommended-production-settings.html +export CRDB_DEPLOY_MODE=${CRDB_DEPLOY_MODE:-"single"} + +# If not already set, disable flag for dropping database if exists. +# WARNING: ACTIVATING THIS FLAG IMPLIES LOOSING THE DATABASE INFORMATION! +# If CRDB_DROP_DATABASE_IF_EXISTS is "YES", the database pointed by variable CRDB_NAMESPACE will be dropped while +# checking/deploying CockroachDB. +export CRDB_DROP_DATABASE_IF_EXISTS=${CRDB_DROP_DATABASE_IF_EXISTS:-""} + +# If not already set, disable flag for re-deploying CockroachDB from scratch. +# WARNING: ACTIVATING THIS FLAG IMPLIES LOOSING THE DATABASE INFORMATION! +# WARNING: THE REDEPLOY MIGHT TAKE FEW MINUTES TO COMPLETE GRACEFULLY IN CLUSTER MODE +# If CRDB_REDEPLOY is "YES", the database will be dropped while checking/deploying CockroachDB. +export CRDB_REDEPLOY=${CRDB_REDEPLOY:-""} + + +# ----- NATS ------------------------------------------------------------------- + +# If not already set, set the namespace where NATS will be deployed. +export NATS_NAMESPACE=${NATS_NAMESPACE:-"nats"} + +# If not already set, set the name of the secret where NATS data and credentials will be stored. +export NATS_SECRET_NAME=${NATS_SECRET_NAME:-"nats-data"} + +# If not already set, set the namespace where the secret containing NATS data and credentials will be stored. +export NATS_SECRET_NAMESPACE=${NATS_SECRET_NAMESPACE:-${TFS_K8S_NAMESPACE}} + +# If not already set, disable flag for re-deploying NATS from scratch. +# WARNING: ACTIVATING THIS FLAG IMPLIES LOOSING THE MESSAGE BROKER INFORMATION! +# If NATS_REDEPLOY is "YES", the message broker will be dropped while checking/deploying NATS. +export NATS_REDEPLOY=${NATS_REDEPLOY:-""} + + +# ----- QuestDB ---------------------------------------------------------------- + +# If not already set, set the namespace where QuestDB will be deployed. +export QDB_NAMESPACE=${QDB_NAMESPACE:-"qdb"} + +# If not already set, set the database username to be used by Monitoring. +export QDB_USERNAME=${QDB_USERNAME:-"admin"} + +# If not already set, set the database user's password to be used by Monitoring. +export QDB_PASSWORD=${QDB_PASSWORD:-"quest"} + +# If not already set, set the table name to be used by Monitoring. +export QDB_TABLE=${QDB_TABLE:-"tfs_monitoring"} + +## If not already set, disable flag for dropping table if exists. +## WARNING: ACTIVATING THIS FLAG IMPLIES LOOSING THE TABLE INFORMATION! +## If QDB_DROP_TABLE_IF_EXISTS is "YES", the table pointed by variable QDB_TABLE will be dropped while +## checking/deploying QuestDB. +#export QDB_DROP_TABLE_IF_EXISTS=${QDB_DROP_TABLE_IF_EXISTS:-""} + +# If not already set, disable flag for re-deploying QuestDB from scratch. +# WARNING: ACTIVATING THIS FLAG IMPLIES LOOSING THE DATABASE INFORMATION! +# If QDB_REDEPLOY is "YES", the database will be dropped while checking/deploying QuestDB. +export QDB_REDEPLOY=${QDB_REDEPLOY:-""} + + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +# Deploy CockroachDB +./deploy/crdb.sh + +# Deploy NATS +./deploy/nats.sh + +# Deploy QuestDB +./deploy/qdb.sh + +# Deploy TeraFlowSDN +./deploy/tfs.sh + +# Show deploy summary +./deploy/show.sh + +echo "Done!" diff --git a/deploy/component.sh b/deploy/component.sh new file mode 100755 index 0000000000000000000000000000000000000000..922aa5e0ec77a2c6acd73db1195a9ec3d2b160fb --- /dev/null +++ b/deploy/component.sh @@ -0,0 +1,185 @@ +#!/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. + + +######################################################################################################################## +# Read deployment settings +######################################################################################################################## + +# If not already set, set the URL of the Docker registry where the images will be uploaded to. +# By default, assume internal MicroK8s registry is used. +export TFS_REGISTRY_IMAGES=${TFS_REGISTRY_IMAGES:-"http://localhost:32000/tfs/"} + +TFS_COMPONENTS=$1 + +# If not already set, set the tag you want to use for your images. +export TFS_IMAGE_TAG=${TFS_IMAGE_TAG:-"dev"} + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +# If not already set, set additional manifest files to be applied after the deployment +export TFS_EXTRA_MANIFESTS=${TFS_EXTRA_MANIFESTS:-""} + +# If not already set, set the neew Grafana admin password +export TFS_GRAFANA_PASSWORD=${TFS_GRAFANA_PASSWORD:-"admin123+"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +# Constants +GITLAB_REPO_URL="labs.etsi.org:5050/tfs/controller" +TMP_FOLDER="./tmp" + +# Create a tmp folder for files modified during the deployment +TMP_MANIFESTS_FOLDER="$TMP_FOLDER/manifests" +TMP_LOGS_FOLDER="$TMP_FOLDER/logs" + +echo "Deploying component and collecting environment variables..." +ENV_VARS_SCRIPT=tfs_runtime_env_vars.sh + +for COMPONENT in $TFS_COMPONENTS; do + echo "Processing '$COMPONENT' component..." + IMAGE_NAME="$COMPONENT:$TFS_IMAGE_TAG" + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$IMAGE_NAME" | sed 's,//,/,g' | sed 's,http:/,,g') + + echo " Building Docker image..." + BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log" + + if [ "$COMPONENT" == "automation" ] || [ "$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" + 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" + # next command is redundant, but helpful to keep cache updated between rebuilds + docker build -t "$COMPONENT-backend:$TFS_IMAGE_TAG-builder" --target builder -f ./src/"$COMPONENT"/backend/Dockerfile . >> "$BUILD_LOG" + else + docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile . > "$BUILD_LOG" + fi + + if [ -n "$TFS_REGISTRY_IMAGES" ]; then + echo " Pushing Docker image to '$TFS_REGISTRY_IMAGES'..." + + if [ "$COMPONENT" == "pathcomp" ]; then + TAG_LOG="$TMP_LOGS_FOLDER/tag_${COMPONENT}-frontend.log" + docker tag "$COMPONENT-frontend:$TFS_IMAGE_TAG" "$IMAGE_URL-frontend" > "$TAG_LOG" + + TAG_LOG="$TMP_LOGS_FOLDER/tag_${COMPONENT}-backend.log" + docker tag "$COMPONENT-backend:$TFS_IMAGE_TAG" "$IMAGE_URL-backend" > "$TAG_LOG" + + PUSH_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}-frontend.log" + docker push "$IMAGE_URL-frontend" > "$PUSH_LOG" + + PUSH_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}-backend.log" + docker push "$IMAGE_URL-backend" > "$PUSH_LOG" + else + TAG_LOG="$TMP_LOGS_FOLDER/tag_${COMPONENT}.log" + docker tag "$IMAGE_NAME" "$IMAGE_URL" > "$TAG_LOG" + + PUSH_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}.log" + docker push "$IMAGE_URL" > "$PUSH_LOG" + fi + fi + + echo " Adapting '$COMPONENT' manifest file..." + MANIFEST="$TMP_MANIFESTS_FOLDER/${COMPONENT}service.yaml" + cp ./manifests/"${COMPONENT}"service.yaml "$MANIFEST" + + if [ -n "$TFS_REGISTRY_IMAGES" ]; then + # Registry is set + if [ "$COMPONENT" == "pathcomp" ]; then + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}-frontend:" "$MANIFEST" | cut -d ":" -f3) + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT-frontend:${VERSION}#image: $IMAGE_URL-frontend#g" "$MANIFEST" + + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}-backend:" "$MANIFEST" | cut -d ":" -f3) + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT-backend:${VERSION}#image: $IMAGE_URL-backend#g" "$MANIFEST" + + sed -E -i "s#imagePullPolicy: .*#imagePullPolicy: Always#g" "$MANIFEST" + else + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}:" "$MANIFEST" | cut -d ":" -f3) + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT:${VERSION}#image: $IMAGE_URL#g" "$MANIFEST" + sed -E -i "s#imagePullPolicy: .*#imagePullPolicy: Always#g" "$MANIFEST" + fi + else + # Registry is not set + if [ "$COMPONENT" == "pathcomp" ]; then + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}-frontend:" "$MANIFEST" | cut -d ":" -f3) + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT-frontend:${VERSION}#image: $IMAGE_NAME-frontend#g" "$MANIFEST" + + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}-backend:" "$MANIFEST" | cut -d ":" -f3) + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT-backend:${VERSION}#image: $IMAGE_NAME-backend#g" "$MANIFEST" + + sed -E -i "s#imagePullPolicy: .*#imagePullPolicy: Never#g" "$MANIFEST" + else + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}:" "$MANIFEST" | cut -d ":" -f3) + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT:${VERSION}#image: $IMAGE_NAME#g" "$MANIFEST" + sed -E -i "s#imagePullPolicy: .*#imagePullPolicy: Never#g" "$MANIFEST" + fi + fi + + # TODO: harmonize names of the monitoring component + + echo " Deploying '$COMPONENT' component to Kubernetes..." + DEPLOY_LOG="$TMP_LOGS_FOLDER/deploy_${COMPONENT}.log" + kubectl --namespace $TFS_K8S_NAMESPACE delete -f "$MANIFEST" > "$DEPLOY_LOG" + kubectl --namespace $TFS_K8S_NAMESPACE apply -f "$MANIFEST" > "$DEPLOY_LOG" + COMPONENT_OBJNAME=$(echo "${COMPONENT}" | sed "s/\_/-/") + kubectl --namespace $TFS_K8S_NAMESPACE scale deployment --replicas=0 ${COMPONENT_OBJNAME}service >> "$DEPLOY_LOG" + kubectl --namespace $TFS_K8S_NAMESPACE scale deployment --replicas=1 ${COMPONENT_OBJNAME}service >> "$DEPLOY_LOG" + + echo " Collecting env-vars for '$COMPONENT' component..." + + SERVICE_DATA=$(kubectl get service ${COMPONENT}service --namespace $TFS_K8S_NAMESPACE -o json) + if [ -z "${SERVICE_DATA}" ]; then continue; fi + + # Env vars for service's host address + SERVICE_HOST=$(echo ${SERVICE_DATA} | jq -r '.spec.clusterIP') + if [ -z "${SERVICE_HOST}" ]; then continue; fi + # TODO: remove previous value from file + ENVVAR_HOST=$(echo "${COMPONENT}service_SERVICE_HOST" | tr '[:lower:]' '[:upper:]') + echo "export ${ENVVAR_HOST}=${SERVICE_HOST}" >> $ENV_VARS_SCRIPT + + # Env vars for service's 'grpc' port (if any) + SERVICE_PORT_GRPC=$(echo ${SERVICE_DATA} | jq -r '.spec.ports[] | select(.name=="grpc") | .port') + if [ -n "${SERVICE_PORT_GRPC}" ]; then + ENVVAR_PORT_GRPC=$(echo "${COMPONENT}service_SERVICE_PORT_GRPC" | tr '[:lower:]' '[:upper:]') + echo "export ${ENVVAR_PORT_GRPC}=${SERVICE_PORT_GRPC}" >> $ENV_VARS_SCRIPT + fi + + # Env vars for service's 'http' port (if any) + SERVICE_PORT_HTTP=$(echo ${SERVICE_DATA} | jq -r '.spec.ports[] | select(.name=="http") | .port') + if [ -n "${SERVICE_PORT_HTTP}" ]; then + ENVVAR_PORT_HTTP=$(echo "${COMPONENT}service_SERVICE_PORT_HTTP" | tr '[:lower:]' '[:upper:]') + echo "export ${ENVVAR_PORT_HTTP}=${SERVICE_PORT_HTTP}" >> $ENV_VARS_SCRIPT + fi + + printf "\n" +done + +# By now, leave this control here. Some component dependencies are not well handled +for COMPONENT in $TFS_COMPONENTS; do + echo "Waiting for '$COMPONENT' component..." + kubectl wait --namespace $TFS_K8S_NAMESPACE \ + --for='condition=available' --timeout=300s deployment/${COMPONENT}service + printf "\n" +done + +./show_deploy.sh + +echo "Done!" diff --git a/deploy/crdb.sh b/deploy/crdb.sh new file mode 100755 index 0000000000000000000000000000000000000000..98d011f190196b803be27200b8bc348b30c87055 --- /dev/null +++ b/deploy/crdb.sh @@ -0,0 +1,361 @@ +#!/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. + + +######################################################################################################################## +# Read deployment settings +######################################################################################################################## + +# If not already set, set the namespace where CockroackDB will be deployed. +export CRDB_NAMESPACE=${CRDB_NAMESPACE:-"crdb"} + +# If not already set, set the database username to be used by Context. +export CRDB_USERNAME=${CRDB_USERNAME:-"tfs"} + +# If not already set, set the database user's password to be used by Context. +export CRDB_PASSWORD=${CRDB_PASSWORD:-"tfs123"} + +# If not already set, set the database name to be used by Context. +export CRDB_DATABASE=${CRDB_DATABASE:-"tfs"} + +# If not already set, set CockroachDB installation mode. Accepted values are: 'single' and 'cluster'. +# "YES", the database pointed by variable CRDB_NAMESPACE will be dropped while +# checking/deploying CockroachDB. +# - If CRDB_DEPLOY_MODE is "single", CockroachDB is deployed in single node mode. It is convenient for +# development and testing purposes and should fit in a VM. IT SHOULD NOT BE USED IN PRODUCTION ENVIRONMENTS. +# - If CRDB_DEPLOY_MODE is "cluster", CockroachDB is deployed in cluster mode, and an entire CockroachDB cluster +# with 3 replicas and version v22.2 (set by default) will be deployed. It is convenient for production and +# provides scalability features. If you are deploying for production, also read the following link providing +# details on deploying CockroachDB for production environments: +# Ref: https://www.cockroachlabs.com/docs/stable/recommended-production-settings.html +export CRDB_DEPLOY_MODE=${CRDB_DEPLOY_MODE:-"single"} + +# If not already set, disable flag for dropping database if exists. +# WARNING: ACTIVATING THIS FLAG IMPLIES LOOSING THE DATABASE INFORMATION! +# If CRDB_DROP_DATABASE_IF_EXISTS is "YES", the database pointed by variable CRDB_DATABASE will be dropped while +# checking/deploying CockroachDB. +export CRDB_DROP_DATABASE_IF_EXISTS=${CRDB_DROP_DATABASE_IF_EXISTS:-""} + +# If not already set, disable flag for re-deploying CockroachDB from scratch. +# WARNING: ACTIVATING THIS FLAG IMPLIES LOOSING THE DATABASE INFORMATION! +# WARNING: THE REDEPLOY MIGHT TAKE FEW MINUTES TO COMPLETE GRACEFULLY IN CLUSTER MODE +# If CRDB_REDEPLOY is "YES", the database will be dropped while checking/deploying CockroachDB. +export CRDB_REDEPLOY=${CRDB_REDEPLOY:-""} + + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +# Constants +TMP_FOLDER="./tmp" +CRDB_MANIFESTS_PATH="manifests/cockroachdb" + +# Create a tmp folder for files modified during the deployment +TMP_MANIFESTS_FOLDER="$TMP_FOLDER/manifests" +mkdir -p $TMP_MANIFESTS_FOLDER +TMP_LOGS_FOLDER="$TMP_FOLDER/logs" +mkdir -p $TMP_LOGS_FOLDER +CRDB_LOG_FILE="$TMP_LOGS_FOLDER/crdb_deploy.log" + +function crdb_deploy_single() { + echo "CockroachDB Namespace" + echo ">>> Create CockroachDB Namespace (if missing)" + kubectl create namespace ${CRDB_NAMESPACE} + echo + + echo "CockroachDB (single-node)" + echo ">>> Checking if CockroachDB is deployed..." + if kubectl get --namespace ${CRDB_NAMESPACE} statefulset/cockroachdb &> /dev/null; then + echo ">>> CockroachDB is present; skipping step." + else + echo ">>> Deploy CockroachDB" + cp "${CRDB_MANIFESTS_PATH}/single-node.yaml" "${TMP_MANIFESTS_FOLDER}/crdb_single_node.yaml" + sed -i "s/%CRDB_DATABASE%/${CRDB_DATABASE}/g" "${TMP_MANIFESTS_FOLDER}/crdb_single_node.yaml" + sed -i "s/%CRDB_USERNAME%/${CRDB_USERNAME}/g" "${TMP_MANIFESTS_FOLDER}/crdb_single_node.yaml" + sed -i "s/%CRDB_PASSWORD%/${CRDB_PASSWORD}/g" "${TMP_MANIFESTS_FOLDER}/crdb_single_node.yaml" + kubectl apply --namespace ${CRDB_NAMESPACE} -f "${TMP_MANIFESTS_FOLDER}/crdb_single_node.yaml" + + echo ">>> Waiting CockroachDB statefulset to be created..." + while ! kubectl get --namespace ${CRDB_NAMESPACE} statefulset/cockroachdb &> /dev/null; do + printf "%c" "." + sleep 1 + done + + # Wait for statefulset condition "Available=True" does not work + # Wait for statefulset condition "jsonpath='{.status.readyReplicas}'=3" throws error: + # "error: readyReplicas is not found" + # Workaround: Check the pods are ready + #echo ">>> CockroachDB statefulset created. Waiting for readiness condition..." + #kubectl wait --namespace ${CRDB_NAMESPACE} --for=condition=Available=True --timeout=300s statefulset/cockroachdb + #kubectl wait --namespace ${CRDB_NAMESPACE} --for=jsonpath='{.status.readyReplicas}'=3 --timeout=300s \ + # statefulset/cockroachdb + echo ">>> CockroachDB statefulset created. Waiting CockroachDB pods to be created..." + while ! kubectl get --namespace ${CRDB_NAMESPACE} pod/cockroachdb-0 &> /dev/null; do + printf "%c" "." + sleep 1 + done + kubectl wait --namespace ${CRDB_NAMESPACE} --for=condition=Ready --timeout=300s pod/cockroachdb-0 + fi + echo + + echo "CockroachDB Port Mapping" + echo ">>> Expose CockroachDB SQL port (26257->26257)" + CRDB_SQL_PORT=$(kubectl --namespace ${CRDB_NAMESPACE} get service cockroachdb-public -o 'jsonpath={.spec.ports[?(@.name=="sql")].port}') + PATCH='{"data": {"'${CRDB_SQL_PORT}'": "'${CRDB_NAMESPACE}'/cockroachdb-public:'${CRDB_SQL_PORT}'"}}' + kubectl patch configmap nginx-ingress-tcp-microk8s-conf --namespace ingress --patch "${PATCH}" + + PORT_MAP='{"containerPort": '${CRDB_SQL_PORT}', "hostPort": '${CRDB_SQL_PORT}'}' + CONTAINER='{"name": "nginx-ingress-microk8s", "ports": ['${PORT_MAP}']}' + PATCH='{"spec": {"template": {"spec": {"containers": ['${CONTAINER}']}}}}' + kubectl patch daemonset nginx-ingress-microk8s-controller --namespace ingress --patch "${PATCH}" + echo + + echo ">>> Expose CockroachDB HTTP Mgmt GUI port (8080->8081)" + CRDB_GUI_PORT_EXT="8081" + CRDB_GUI_PORT=$(kubectl --namespace ${CRDB_NAMESPACE} get service cockroachdb-public -o 'jsonpath={.spec.ports[?(@.name=="http")].port}') + PATCH='{"data": {"'${CRDB_GUI_PORT_EXT}'": "'${CRDB_NAMESPACE}'/cockroachdb-public:'${CRDB_GUI_PORT}'"}}' + kubectl patch configmap nginx-ingress-tcp-microk8s-conf --namespace ingress --patch "${PATCH}" + + PORT_MAP='{"containerPort": '${CRDB_GUI_PORT_EXT}', "hostPort": '${CRDB_GUI_PORT_EXT}'}' + CONTAINER='{"name": "nginx-ingress-microk8s", "ports": ['${PORT_MAP}']}' + PATCH='{"spec": {"template": {"spec": {"containers": ['${CONTAINER}']}}}}' + kubectl patch daemonset nginx-ingress-microk8s-controller --namespace ingress --patch "${PATCH}" + echo +} + +function crdb_undeploy_single() { + echo "CockroachDB" + echo ">>> Checking if CockroachDB is deployed..." + if kubectl get --namespace ${CRDB_NAMESPACE} statefulset/cockroachdb &> /dev/null; then + echo ">>> Undeploy CockroachDB" + kubectl delete --namespace ${CRDB_NAMESPACE} -f "${TMP_MANIFESTS_FOLDER}/crdb_single_node.yaml" --ignore-not-found + else + echo ">>> CockroachDB is not present; skipping step." + fi + echo + + echo "CockroachDB Namespace" + echo ">>> Delete CockroachDB Namespace (if exists)" + echo "NOTE: this step might take few minutes to complete!" + kubectl delete namespace ${CRDB_NAMESPACE} --ignore-not-found + echo +} + +function crdb_drop_database_single() { + echo "Drop database if exists" + CRDB_CLIENT_URL="postgresql://${CRDB_USERNAME}:${CRDB_PASSWORD}@cockroachdb-0:${CRDB_SQL_PORT}/defaultdb?sslmode=require" + kubectl exec -it --namespace ${CRDB_NAMESPACE} cockroachdb-0 -- \ + ./cockroach sql --certs-dir=/cockroach/cockroach-certs --url=${CRDB_CLIENT_URL} \ + --execute "DROP DATABASE IF EXISTS ${CRDB_DATABASE};" + echo +} + +function crdb_deploy_cluster() { + echo "Cockroach Operator CRDs" + echo ">>> Apply Cockroach Operator CRDs (if they are missing)" + cp "${CRDB_MANIFESTS_PATH}/crds.yaml" "${TMP_MANIFESTS_FOLDER}/crdb_crds.yaml" + kubectl apply -f "${TMP_MANIFESTS_FOLDER}/crdb_crds.yaml" + echo + + echo "Cockroach Operator" + echo ">>> Checking if Cockroach Operator is deployed..." + if kubectl get --namespace cockroach-operator-system deployment/cockroach-operator-manager &> /dev/null; then + echo ">>> Cockroach Operator is present; skipping step." + else + echo ">>> Deploy Cockroach Operator" + sed "s/%TFS_CRDB_NAMESPACE%/${CRDB_NAMESPACE}/g" "${CRDB_MANIFESTS_PATH}/operator.yaml" \ + > "${TMP_MANIFESTS_FOLDER}/crdb_operator.yaml" + kubectl apply -f "${TMP_MANIFESTS_FOLDER}/crdb_operator.yaml" + kubectl wait --namespace cockroach-operator-system --for=condition=Available=True --timeout=300s \ + deployment/cockroach-operator-manager + #kubectl wait --namespace cockroach-operator-system --for=jsonpath='{.status.readyReplicas}'=1 --timeout=300s \ + # deployment/cockroach-operator-manager + + echo ">>> Waiting for Cockroach Operator Webhock service..." + while ! kubectl get service cockroach-operator-webhook-service --namespace cockroach-operator-system &> /dev/null; do + printf "%c" "." + sleep 1 + done + WEBHOOK_SERVICE_DATA=$(kubectl get service cockroach-operator-webhook-service --namespace cockroach-operator-system -o json) + WEBHOOK_SERVICE_HOST=$(echo ${WEBHOOK_SERVICE_DATA} | jq -r '.spec.clusterIP') + WEBHOOK_SERVICE_PORT=$(echo ${WEBHOOK_SERVICE_DATA} | jq -r '.spec.ports[] | select(.targetPort==9443) | .port') + WEBHOOK_URL="https://${WEBHOOK_SERVICE_HOST}:${WEBHOOK_SERVICE_PORT}/mutate-crdb-cockroachlabs-com-v1alpha1-crdbcluster?timeout=10s" + while ! curl --insecure --header 'Content-Type: application/json' ${WEBHOOK_URL} &> /dev/null; do + printf "%c" "." + sleep 1 + done + fi + echo + + echo "CockroachDB Namespace" + echo ">>> Create CockroachDB Namespace (if missing)" + kubectl create namespace ${CRDB_NAMESPACE} + echo + + echo "CockroachDB" + echo ">>> Checking if CockroachDB is deployed..." + if kubectl get --namespace ${CRDB_NAMESPACE} statefulset/cockroachdb &> /dev/null; then + echo ">>> CockroachDB is present; skipping step." + else + echo ">>> Deploy CockroachDB" + cp "${CRDB_MANIFESTS_PATH}/cluster.yaml" "${TMP_MANIFESTS_FOLDER}/crdb_cluster.yaml" + kubectl apply --namespace ${CRDB_NAMESPACE} -f "${TMP_MANIFESTS_FOLDER}/crdb_cluster.yaml" + + echo ">>> Waiting CockroachDB statefulset to be created..." + while ! kubectl get --namespace ${CRDB_NAMESPACE} statefulset/cockroachdb &> /dev/null; do + printf "%c" "." + sleep 1 + done + + # Wait for statefulset condition "Available=True" does not work + # Wait for statefulset condition "jsonpath='{.status.readyReplicas}'=3" throws error: + # "error: readyReplicas is not found" + # Workaround: Check the pods are ready + #echo ">>> CockroachDB statefulset created. Waiting for readiness condition..." + #kubectl wait --namespace ${CRDB_NAMESPACE} --for=condition=Available=True --timeout=300s statefulset/cockroachdb + #kubectl wait --namespace ${CRDB_NAMESPACE} --for=jsonpath='{.status.readyReplicas}'=3 --timeout=300s \ + # statefulset/cockroachdb + echo ">>> CockroachDB statefulset created. Waiting CockroachDB pods to be created..." + while ! kubectl get --namespace ${CRDB_NAMESPACE} pod/cockroachdb-0 &> /dev/null; do + printf "%c" "." + sleep 1 + done + while ! kubectl get --namespace ${CRDB_NAMESPACE} pod/cockroachdb-1 &> /dev/null; do + printf "%c" "." + sleep 1 + done + while ! kubectl get --namespace ${CRDB_NAMESPACE} pod/cockroachdb-2 &> /dev/null; do + printf "%c" "." + sleep 1 + done + kubectl wait --namespace ${CRDB_NAMESPACE} --for=condition=Ready --timeout=300s pod/cockroachdb-0 + kubectl wait --namespace ${CRDB_NAMESPACE} --for=condition=Ready --timeout=300s pod/cockroachdb-1 + kubectl wait --namespace ${CRDB_NAMESPACE} --for=condition=Ready --timeout=300s pod/cockroachdb-2 + fi + echo + + echo "CockroachDB Client" + echo ">>> Checking if CockroachDB Client is deployed..." + if kubectl get --namespace ${CRDB_NAMESPACE} pod/cockroachdb-client-secure &> /dev/null; then + echo ">>> CockroachDB Client is present; skipping step." + else + echo ">>> Deploy CockroachDB Client" + cp "${CRDB_MANIFESTS_PATH}/client-secure-operator.yaml" "${TMP_MANIFESTS_FOLDER}/crdb_client-secure-operator.yaml" + kubectl create --namespace ${CRDB_NAMESPACE} -f "${TMP_MANIFESTS_FOLDER}/crdb_client-secure-operator.yaml" + kubectl wait --namespace ${CRDB_NAMESPACE} --for=condition=Ready --timeout=300s pod/cockroachdb-client-secure + fi + echo + + echo "Add tfs user and grant admin rights" + kubectl exec -it cockroachdb-client-secure --namespace ${CRDB_NAMESPACE} -- \ + ./cockroach sql --certs-dir=/cockroach/cockroach-certs --host=cockroachdb-public --execute \ + "CREATE USER ${CRDB_USERNAME} WITH PASSWORD '${CRDB_PASSWORD}'; GRANT admin TO ${CRDB_USERNAME};" + echo + + echo "CockroachDB Port Mapping" + echo ">>> Expose CockroachDB SQL port (26257)" + CRDB_SQL_PORT=$(kubectl --namespace ${CRDB_NAMESPACE} get service cockroachdb-public -o 'jsonpath={.spec.ports[?(@.name=="sql")].port}') + PATCH='{"data": {"'${CRDB_SQL_PORT}'": "'${CRDB_NAMESPACE}'/cockroachdb-public:'${CRDB_SQL_PORT}'"}}' + kubectl patch configmap nginx-ingress-tcp-microk8s-conf --namespace ingress --patch "${PATCH}" + + PORT_MAP='{"containerPort": '${CRDB_SQL_PORT}', "hostPort": '${CRDB_SQL_PORT}'}' + CONTAINER='{"name": "nginx-ingress-microk8s", "ports": ['${PORT_MAP}']}' + PATCH='{"spec": {"template": {"spec": {"containers": ['${CONTAINER}']}}}}' + kubectl patch daemonset nginx-ingress-microk8s-controller --namespace ingress --patch "${PATCH}" + echo + + echo ">>> Expose CockroachDB HTTP Mgmt GUI port (8080->8081)" + CRDB_GUI_PORT_EXT="8081" + CRDB_GUI_PORT=$(kubectl --namespace ${CRDB_NAMESPACE} get service cockroachdb-public -o 'jsonpath={.spec.ports[?(@.name=="http")].port}') + PATCH='{"data": {"'${CRDB_GUI_PORT_EXT}'": "'${CRDB_NAMESPACE}'/cockroachdb-public:'${CRDB_GUI_PORT}'"}}' + kubectl patch configmap nginx-ingress-tcp-microk8s-conf --namespace ingress --patch "${PATCH}" + + PORT_MAP='{"containerPort": '${CRDB_GUI_PORT_EXT}', "hostPort": '${CRDB_GUI_PORT_EXT}'}' + CONTAINER='{"name": "nginx-ingress-microk8s", "ports": ['${PORT_MAP}']}' + PATCH='{"spec": {"template": {"spec": {"containers": ['${CONTAINER}']}}}}' + kubectl patch daemonset nginx-ingress-microk8s-controller --namespace ingress --patch "${PATCH}" + echo +} + +function crdb_undeploy_cluster() { + echo "CockroachDB Client" + echo ">>> Checking if CockroachDB Client is deployed..." + if kubectl get --namespace ${CRDB_NAMESPACE} pod/cockroachdb-client-secure &> /dev/null; then + echo ">>> Undeploy CockroachDB Client" + kubectl delete --namespace ${CRDB_NAMESPACE} -f "${TMP_MANIFESTS_FOLDER}/crdb_client-secure-operator.yaml" \ + --ignore-not-found + else + echo ">>> CockroachDB Client is not present; skipping step." + fi + echo + + echo "CockroachDB" + echo ">>> Checking if CockroachDB is deployed..." + if kubectl get --namespace ${CRDB_NAMESPACE} statefulset/cockroachdb &> /dev/null; then + echo ">>> Undeploy CockroachDB" + kubectl delete --namespace ${CRDB_NAMESPACE} -f "${TMP_MANIFESTS_FOLDER}/crdb_cluster.yaml" --ignore-not-found + else + echo ">>> CockroachDB is not present; skipping step." + fi + echo + + echo "CockroachDB Namespace" + echo ">>> Delete CockroachDB Namespace (if exists)" + echo "NOTE: this step might take few minutes to complete!" + kubectl delete namespace ${CRDB_NAMESPACE} --ignore-not-found + echo + + echo "CockroachDB Operator" + echo ">>> Checking if CockroachDB Operator is deployed..." + if kubectl get --namespace cockroach-operator-system deployment/cockroach-operator-manager &> /dev/null; then + echo ">>> Undeploy CockroachDB Operator" + kubectl delete -f "${TMP_MANIFESTS_FOLDER}/crdb_operator.yaml" --ignore-not-found + else + echo ">>> CockroachDB Operator is not present; skipping step." + fi + echo + + echo "CockroachDB Operator CRDs" + echo ">>> Delete CockroachDB Operator CRDs (if they exist)" + kubectl delete -f "${TMP_MANIFESTS_FOLDER}/crdb_crds.yaml" --ignore-not-found + echo +} + +function crdb_drop_database_cluster() { + echo "Drop database if exists" + kubectl exec -it --namespace ${CRDB_NAMESPACE} cockroachdb-client-secure -- \ + ./cockroach sql --certs-dir=/cockroach/cockroach-certs --host=cockroachdb-public --execute \ + "DROP DATABASE IF EXISTS ${CRDB_DATABASE};" + echo +} + +if [ "$CRDB_DEPLOY_MODE" == "single" ]; then + if [ "$CRDB_REDEPLOY" == "YES" ]; then + crdb_undeploy_single + elif [ "$CRDB_DROP_DATABASE_IF_EXISTS" == "YES" ]; then + crdb_drop_database_single + fi + crdb_deploy_single +elif [ "$CRDB_DEPLOY_MODE" == "cluster" ]; then + if [ "$CRDB_REDEPLOY" == "YES" ]; then + crdb_undeploy_cluster + elif [ "$CRDB_DROP_DATABASE_IF_EXISTS" == "YES" ]; then + crdb_drop_database_cluster + fi + crdb_deploy_cluster +else + echo "Unsupported value: CRDB_DEPLOY_MODE=$CRDB_DEPLOY_MODE" +fi diff --git a/deploy/mock_blockchain.sh b/deploy/mock_blockchain.sh new file mode 100755 index 0000000000000000000000000000000000000000..ef7811c87eabdcb7cf95db2e4cf1a6eee52ef6ca --- /dev/null +++ b/deploy/mock_blockchain.sh @@ -0,0 +1,121 @@ +#!/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. + + +######################################################################################################################## +# Read deployment settings +######################################################################################################################## + +# Set the URL of your local Docker registry where the images will be uploaded to. +REGISTRY_IMAGE="http://localhost:32000/tfs/" + +# Set the tag you want to use for your images. +IMAGE_TAG="dev" + +# Set the name of the Kubernetes namespace to deploy to. +K8S_NAMESPACE="tfs-bchain" + +COMPONENT="mock_blockchain" + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +# Constants +GITLAB_REPO_URL="labs.etsi.org:5050/tfs/controller" +TMP_FOLDER="./tmp" + +# Create a tmp folder for files modified during the deployment +TMP_MANIFESTS_FOLDER="$TMP_FOLDER/manifests" +mkdir -p $TMP_MANIFESTS_FOLDER +TMP_LOGS_FOLDER="$TMP_FOLDER/logs" +mkdir -p $TMP_LOGS_FOLDER + +echo "Deleting and Creating a new namespace..." +kubectl delete namespace $K8S_NAMESPACE +kubectl create namespace $K8S_NAMESPACE +printf "\n" + +echo "Deploying components and collecting environment variables..." +ENV_VARS_SCRIPT=tfs_bchain_runtime_env_vars.sh +echo "# Environment variables for TeraFlow Mock-Blockchain deployment" > $ENV_VARS_SCRIPT +PYTHONPATH=$(pwd)/src + +echo "Processing '$COMPONENT' component..." +IMAGE_NAME="$COMPONENT:$IMAGE_TAG" +IMAGE_URL=$(echo "$REGISTRY_IMAGE/$IMAGE_NAME" | sed 's,//,/,g' | sed 's,http:/,,g') + +echo " Building Docker image..." +BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log" +docker build -t "$IMAGE_NAME" -f ./src/dlt/mock_blockchain/Dockerfile . > "$BUILD_LOG" + +if [ -n "$REGISTRY_IMAGE" ]; then + echo " Pushing Docker image to '$REGISTRY_IMAGE'..." + + TAG_LOG="$TMP_LOGS_FOLDER/tag_${COMPONENT}.log" + docker tag "$IMAGE_NAME" "$IMAGE_URL" > "$TAG_LOG" + + PUSH_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}.log" + docker push "$IMAGE_URL" > "$PUSH_LOG" +fi + +echo " Adapting '$COMPONENT' manifest file..." +MANIFEST="$TMP_MANIFESTS_FOLDER/${COMPONENT}.yaml" +cp ./manifests/"${COMPONENT}".yaml "$MANIFEST" + +if [ -n "$REGISTRY_IMAGE" ]; then + # Registry is set + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}:" "$MANIFEST" | cut -d ":" -f3) + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT:${VERSION}#image: $IMAGE_URL#g" "$MANIFEST" + sed -E -i "s#imagePullPolicy: .*#imagePullPolicy: Always#g" "$MANIFEST" +else + # Registry is not set + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}:" "$MANIFEST" | cut -d ":" -f3) + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT:${VERSION}#image: $IMAGE_NAME#g" "$MANIFEST" + sed -E -i "s#imagePullPolicy: .*#imagePullPolicy: Never#g" "$MANIFEST" +fi + +echo " Deploying '$COMPONENT' component to Kubernetes..." +DEPLOY_LOG="$TMP_LOGS_FOLDER/deploy_${COMPONENT}.log" +kubectl --namespace $K8S_NAMESPACE apply -f "$MANIFEST" > "$DEPLOY_LOG" +COMPONENT_OBJNAME=$(echo "${COMPONENT}" | sed "s/\_/-/") +kubectl --namespace $K8S_NAMESPACE scale deployment --replicas=0 ${COMPONENT_OBJNAME} >> "$DEPLOY_LOG" +kubectl --namespace $K8S_NAMESPACE scale deployment --replicas=1 ${COMPONENT_OBJNAME} >> "$DEPLOY_LOG" + +echo " Collecting env-vars for '$COMPONENT' component..." +SERVICE_DATA=$(kubectl get service ${COMPONENT_OBJNAME} --namespace $K8S_NAMESPACE -o json) + +# Env vars for service's host address +SERVICE_HOST=$(echo ${SERVICE_DATA} | jq -r '.spec.clusterIP') +ENVVAR_HOST=$(echo "${COMPONENT}_SERVICE_HOST" | tr '[:lower:]' '[:upper:]') +echo "export ${ENVVAR_HOST}=${SERVICE_HOST}" >> $ENV_VARS_SCRIPT + +# Env vars for service's 'grpc' port +SERVICE_PORT_GRPC=$(echo ${SERVICE_DATA} | jq -r '.spec.ports[] | select(.name=="grpc") | .port') +ENVVAR_PORT_GRPC=$(echo "${COMPONENT}_SERVICE_PORT_GRPC" | tr '[:lower:]' '[:upper:]') +echo "export ${ENVVAR_PORT_GRPC}=${SERVICE_PORT_GRPC}" >> $ENV_VARS_SCRIPT + +printf "\n" + +echo "Waiting for '$COMPONENT' component..." +kubectl wait --namespace $K8S_NAMESPACE \ + --for='condition=available' --timeout=300s deployment/${COMPONENT_OBJNAME} +printf "\n" + +echo "Deployment Resources:" +kubectl --namespace $K8S_NAMESPACE get all +printf "\n" + +echo "Done!" diff --git a/deploy/nats.sh b/deploy/nats.sh new file mode 100755 index 0000000000000000000000000000000000000000..115a185302236b80db385212cd772100392329af --- /dev/null +++ b/deploy/nats.sh @@ -0,0 +1,128 @@ +#!/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. + + +######################################################################################################################## +# Read deployment settings +######################################################################################################################## + +# If not already set, set the namespace where NATS will be deployed. +export NATS_NAMESPACE=${NATS_NAMESPACE:-"nats"} + +# If not already set, disable flag for re-deploying NATS from scratch. +# WARNING: ACTIVATING THIS FLAG IMPLIES LOOSING THE MESSAGE BROKER INFORMATION! +# If NATS_REDEPLOY is "YES", the message broker will be dropped while checking/deploying NATS. +export NATS_REDEPLOY=${NATS_REDEPLOY:-""} + + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +# Constants +TMP_FOLDER="./tmp" +NATS_MANIFESTS_PATH="manifests/nats" + +# Create a tmp folder for files modified during the deployment +TMP_MANIFESTS_FOLDER="$TMP_FOLDER/manifests" +mkdir -p $TMP_MANIFESTS_FOLDER + +function nats_deploy_single() { + echo "NATS Namespace" + echo ">>> Create NATS Namespace (if missing)" + kubectl create namespace ${NATS_NAMESPACE} + echo + + echo "Add NATS Helm Chart" + helm3 repo add nats https://nats-io.github.io/k8s/helm/charts/ + echo + + echo "Install NATS (single-node)" + echo ">>> Checking if NATS is deployed..." + if kubectl get --namespace ${NATS_NAMESPACE} statefulset/nats &> /dev/null; then + echo ">>> NATS is present; skipping step." + else + echo ">>> Deploy NATS" + helm3 install nats nats/nats --namespace ${NATS_NAMESPACE} --set nats.image.tag=2.9-alpine + + echo ">>> Waiting NATS statefulset to be created..." + while ! kubectl get --namespace ${NATS_NAMESPACE} statefulset/nats &> /dev/null; do + printf "%c" "." + sleep 1 + done + + # Wait for statefulset condition "Available=True" does not work + # Wait for statefulset condition "jsonpath='{.status.readyReplicas}'=3" throws error: + # "error: readyReplicas is not found" + # Workaround: Check the pods are ready + #echo ">>> NATS statefulset created. Waiting for readiness condition..." + #kubectl wait --namespace ${NATS_NAMESPACE} --for=condition=Available=True --timeout=300s statefulset/nats + #kubectl wait --namespace ${NATS_NAMESPACE} --for=jsonpath='{.status.readyReplicas}'=3 --timeout=300s \ + # statefulset/nats + echo ">>> NATS statefulset created. Waiting NATS pods to be created..." + while ! kubectl get --namespace ${NATS_NAMESPACE} pod/nats-0 &> /dev/null; do + printf "%c" "." + sleep 1 + done + kubectl wait --namespace ${NATS_NAMESPACE} --for=condition=Ready --timeout=300s pod/nats-0 + fi + echo + + echo "NATS Port Mapping" + echo ">>> Expose NATS Client port (4222)" + NATS_CLIENT_PORT=$(kubectl --namespace ${NATS_NAMESPACE} get service nats -o 'jsonpath={.spec.ports[?(@.name=="client")].port}') + PATCH='{"data": {"'${NATS_CLIENT_PORT}'": "'${NATS_NAMESPACE}'/nats:'${NATS_CLIENT_PORT}'"}}' + kubectl patch configmap nginx-ingress-tcp-microk8s-conf --namespace ingress --patch "${PATCH}" + + PORT_MAP='{"containerPort": '${NATS_CLIENT_PORT}', "hostPort": '${NATS_CLIENT_PORT}'}' + CONTAINER='{"name": "nginx-ingress-microk8s", "ports": ['${PORT_MAP}']}' + PATCH='{"spec": {"template": {"spec": {"containers": ['${CONTAINER}']}}}}' + kubectl patch daemonset nginx-ingress-microk8s-controller --namespace ingress --patch "${PATCH}" + echo + + echo ">>> Expose NATS HTTP Mgmt GUI port (8222)" + NATS_GUI_PORT=$(kubectl --namespace ${NATS_NAMESPACE} get service nats -o 'jsonpath={.spec.ports[?(@.name=="monitor")].port}') + PATCH='{"data": {"'${NATS_GUI_PORT}'": "'${NATS_NAMESPACE}'/nats:'${NATS_GUI_PORT}'"}}' + kubectl patch configmap nginx-ingress-tcp-microk8s-conf --namespace ingress --patch "${PATCH}" + + PORT_MAP='{"containerPort": '${NATS_GUI_PORT}', "hostPort": '${NATS_GUI_PORT}'}' + CONTAINER='{"name": "nginx-ingress-microk8s", "ports": ['${PORT_MAP}']}' + PATCH='{"spec": {"template": {"spec": {"containers": ['${CONTAINER}']}}}}' + kubectl patch daemonset nginx-ingress-microk8s-controller --namespace ingress --patch "${PATCH}" + echo +} + +function nats_undeploy_single() { + echo "NATS" + echo ">>> Checking if NATS is deployed..." + if kubectl get --namespace ${NATS_NAMESPACE} statefulset/nats &> /dev/null; then + echo ">>> Undeploy NATS" + helm3 uninstall --namespace ${NATS_NAMESPACE} nats + else + echo ">>> NATS is not present; skipping step." + fi + echo + + echo "NATS Namespace" + echo ">>> Delete NATS Namespace (if exists)" + kubectl delete namespace ${NATS_NAMESPACE} --ignore-not-found + echo +} + +if [ "$NATS_REDEPLOY" == "YES" ]; then + nats_undeploy_single +fi + +nats_deploy_single diff --git a/deploy/qdb.sh b/deploy/qdb.sh new file mode 100755 index 0000000000000000000000000000000000000000..d9a4de353b3309ef0a8a34310089e9bff31589fa --- /dev/null +++ b/deploy/qdb.sh @@ -0,0 +1,165 @@ +#!/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. + + +######################################################################################################################## +# Read deployment settings +######################################################################################################################## + +# If not already set, set the namespace where QuestDB will be deployed. +export QDB_NAMESPACE=${QDB_NAMESPACE:-"qdb"} + +# If not already set, set the database username to be used by Monitoring. +export QDB_USERNAME=${QDB_USERNAME:-"admin"} + +# If not already set, set the database user's password to be used by Monitoring. +export QDB_PASSWORD=${QDB_PASSWORD:-"quest"} + +# If not already set, set the table name to be used by Monitoring. +export QDB_TABLE=${QDB_TABLE:-"tfs_monitoring"} + +## If not already set, disable flag for dropping table if exists. +## WARNING: ACTIVATING THIS FLAG IMPLIES LOOSING THE TABLE INFORMATION! +## If QDB_DROP_TABLE_IF_EXISTS is "YES", the table pointed by variable QDB_TABLE will be dropped while +## checking/deploying QuestDB. +#export QDB_DROP_TABLE_IF_EXISTS=${QDB_DROP_TABLE_IF_EXISTS:-""} + +# If not already set, disable flag for re-deploying QuestDB from scratch. +# WARNING: ACTIVATING THIS FLAG IMPLIES LOOSING THE DATABASE INFORMATION! +# If QDB_REDEPLOY is "YES", the database will be dropped while checking/deploying QuestDB. +export QDB_REDEPLOY=${QDB_REDEPLOY:-""} + + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +# Constants +TMP_FOLDER="./tmp" +QDB_MANIFESTS_PATH="manifests/questdb" + +# Create a tmp folder for files modified during the deployment +TMP_MANIFESTS_FOLDER="$TMP_FOLDER/manifests" +TMP_LOGS_FOLDER="$TMP_FOLDER/logs" +QDB_LOG_FILE="$TMP_LOGS_FOLDER/qdb_deploy.log" +mkdir -p $TMP_LOGS_FOLDER + +function qdb_deploy() { + echo "QuestDB Namespace" + echo ">>> Create QuestDB Namespace (if missing)" + kubectl create namespace ${QDB_NAMESPACE} + echo + + echo "QuestDB" + echo ">>> Checking if QuestDB is deployed..." + if kubectl get --namespace ${QDB_NAMESPACE} statefulset/questdb &> /dev/null; then + echo ">>> QuestDB is present; skipping step." + else + echo ">>> Deploy QuestDB" + cp "${QDB_MANIFESTS_PATH}/manifest.yaml" "${TMP_MANIFESTS_FOLDER}/qdb_manifest.yaml" + kubectl apply --namespace ${QDB_NAMESPACE} -f "${TMP_MANIFESTS_FOLDER}/qdb_manifest.yaml" + + echo ">>> Waiting QuestDB statefulset to be created..." + while ! kubectl get --namespace ${QDB_NAMESPACE} statefulset/questdb &> /dev/null; do + printf "%c" "." + sleep 1 + done + + # Wait for statefulset condition "Available=True" does not work + # Wait for statefulset condition "jsonpath='{.status.readyReplicas}'=3" throws error: + # "error: readyReplicas is not found" + # Workaround: Check the pods are ready + #echo ">>> QuestDB statefulset created. Waiting for readiness condition..." + #kubectl wait --namespace ${QDB_NAMESPACE} --for=condition=Available=True --timeout=300s statefulset/questdb + #kubectl wait --namespace ${QDB_NAMESPACE} --for=jsonpath='{.status.readyReplicas}'=3 --timeout=300s \ + # statefulset/questdb + echo ">>> QuestDB statefulset created. Waiting QuestDB pods to be created..." + while ! kubectl get --namespace ${QDB_NAMESPACE} pod/questdb-0 &> /dev/null; do + printf "%c" "." + sleep 1 + done + kubectl wait --namespace ${QDB_NAMESPACE} --for=condition=Ready --timeout=300s pod/questdb-0 + fi + echo + + echo "QuestDB Port Mapping" + echo ">>> Expose QuestDB SQL port (8812->8812)" + QDB_SQL_PORT=$(kubectl --namespace ${QDB_NAMESPACE} get service questdb-public -o 'jsonpath={.spec.ports[?(@.name=="sql")].port}') + PATCH='{"data": {"'${QDB_SQL_PORT}'": "'${QDB_NAMESPACE}'/questdb-public:'${QDB_SQL_PORT}'"}}' + kubectl patch configmap nginx-ingress-tcp-microk8s-conf --namespace ingress --patch "${PATCH}" + + PORT_MAP='{"containerPort": '${QDB_SQL_PORT}', "hostPort": '${QDB_SQL_PORT}'}' + CONTAINER='{"name": "nginx-ingress-microk8s", "ports": ['${PORT_MAP}']}' + PATCH='{"spec": {"template": {"spec": {"containers": ['${CONTAINER}']}}}}' + kubectl patch daemonset nginx-ingress-microk8s-controller --namespace ingress --patch "${PATCH}" + echo + + echo ">>> Expose QuestDB Influx Line Protocol port (9009->9009)" + QDB_ILP_PORT=$(kubectl --namespace ${QDB_NAMESPACE} get service questdb-public -o 'jsonpath={.spec.ports[?(@.name=="ilp")].port}') + PATCH='{"data": {"'${QDB_ILP_PORT}'": "'${QDB_NAMESPACE}'/questdb-public:'${QDB_ILP_PORT}'"}}' + kubectl patch configmap nginx-ingress-tcp-microk8s-conf --namespace ingress --patch "${PATCH}" + + PORT_MAP='{"containerPort": '${QDB_ILP_PORT}', "hostPort": '${QDB_ILP_PORT}'}' + CONTAINER='{"name": "nginx-ingress-microk8s", "ports": ['${PORT_MAP}']}' + PATCH='{"spec": {"template": {"spec": {"containers": ['${CONTAINER}']}}}}' + kubectl patch daemonset nginx-ingress-microk8s-controller --namespace ingress --patch "${PATCH}" + echo + + echo ">>> Expose QuestDB HTTP Mgmt GUI port (9000->9000)" + QDB_GUI_PORT=$(kubectl --namespace ${QDB_NAMESPACE} get service questdb-public -o 'jsonpath={.spec.ports[?(@.name=="http")].port}') + PATCH='{"data": {"'${QDB_GUI_PORT}'": "'${QDB_NAMESPACE}'/questdb-public:'${QDB_GUI_PORT}'"}}' + kubectl patch configmap nginx-ingress-tcp-microk8s-conf --namespace ingress --patch "${PATCH}" + + PORT_MAP='{"containerPort": '${QDB_GUI_PORT}', "hostPort": '${QDB_GUI_PORT}'}' + CONTAINER='{"name": "nginx-ingress-microk8s", "ports": ['${PORT_MAP}']}' + PATCH='{"spec": {"template": {"spec": {"containers": ['${CONTAINER}']}}}}' + kubectl patch daemonset nginx-ingress-microk8s-controller --namespace ingress --patch "${PATCH}" + echo +} + +function qdb_undeploy() { + echo "QuestDB" + echo ">>> Checking if QuestDB is deployed..." + if kubectl get --namespace ${QDB_NAMESPACE} statefulset/questdb &> /dev/null; then + echo ">>> Undeploy QuestDB" + kubectl delete --namespace ${QDB_NAMESPACE} -f "${TMP_MANIFESTS_FOLDER}/qdb_manifest.yaml" --ignore-not-found + else + echo ">>> QuestDB is not present; skipping step." + fi + echo + + echo "QuestDB Namespace" + echo ">>> Delete QuestDB Namespace (if exists)" + echo "NOTE: this step might take few minutes to complete!" + kubectl delete namespace ${QDB_NAMESPACE} --ignore-not-found + echo +} + +# TODO: implement method to drop table +#function qdb_drop_table() { +# echo "Drop table if exists" +# QDB_CLIENT_URL="postgresql://${QDB_USERNAME}:${QDB_PASSWORD}@questdb-0:${QDB_SQL_PORT}/defaultdb?sslmode=require" +# kubectl exec -it --namespace ${QDB_NAMESPACE} questdb-0 -- \ +# ./qdb sql --certs-dir=/qdb/qdb-certs --url=${QDB_CLIENT_URL} \ +# --execute "DROP TABLE IF EXISTS ${QDB_TABLE};" +# echo +#} + +if [ "$QDB_REDEPLOY" == "YES" ]; then + qdb_undeploy +#elif [ "$QDB_DROP_TABLE_IF_EXISTS" == "YES" ]; then +# qdb_drop_table +fi +qdb_deploy diff --git a/deploy/show.sh b/deploy/show.sh new file mode 100755 index 0000000000000000000000000000000000000000..a4084ac65402c7987504fbcacdf6aa5b44029fc4 --- /dev/null +++ b/deploy/show.sh @@ -0,0 +1,33 @@ +#!/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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +echo "Deployment Resources:" +kubectl --namespace $TFS_K8S_NAMESPACE get all +printf "\n" + +echo "Deployment Ingress:" +kubectl --namespace $TFS_K8S_NAMESPACE get ingress +printf "\n" diff --git a/deploy/tfs.sh b/deploy/tfs.sh new file mode 100755 index 0000000000000000000000000000000000000000..b9bcbab4d8084e30aae90be3cf669445d01c0dac --- /dev/null +++ b/deploy/tfs.sh @@ -0,0 +1,357 @@ +#!/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. + + +######################################################################################################################## +# Read deployment settings +######################################################################################################################## + +# If not already set, set the URL of the Docker registry where the images will be uploaded to. +# By default, assume internal MicroK8s registry is used. +export TFS_REGISTRY_IMAGES=${TFS_REGISTRY_IMAGES:-"http://localhost:32000/tfs/"} + +# If not already set, set the list of components you want to build images for, and deploy. +# By default, only basic components are deployed +export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device monitoring service compute webui"} + +# If not already set, set the tag you want to use for your images. +export TFS_IMAGE_TAG=${TFS_IMAGE_TAG:-"dev"} + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +# If not already set, set additional manifest files to be applied after the deployment +export TFS_EXTRA_MANIFESTS=${TFS_EXTRA_MANIFESTS:-""} + +# If not already set, set the new Grafana admin password +export TFS_GRAFANA_PASSWORD=${TFS_GRAFANA_PASSWORD:-"admin123+"} + +# If not already set, disable skip-build flag. +# If TFS_SKIP_BUILD is "YES", the containers are not rebuilt-retagged-repushed and existing ones are used. +export TFS_SKIP_BUILD=${TFS_SKIP_BUILD:-""} + +# If not already set, set the namespace where CockroackDB will be deployed. +export CRDB_NAMESPACE=${CRDB_NAMESPACE:-"crdb"} + +# If not already set, set the database username to be used by Context. +export CRDB_USERNAME=${CRDB_USERNAME:-"tfs"} + +# If not already set, set the database user's password to be used by Context. +export CRDB_PASSWORD=${CRDB_PASSWORD:-"tfs123"} + +# If not already set, set the database name to be used by Context. +export CRDB_DATABASE=${CRDB_DATABASE:-"tfs"} + +# If not already set, set the namespace where NATS will be deployed. +export NATS_NAMESPACE=${NATS_NAMESPACE:-"nats"} + +# If not already set, set the namespace where QuestDB will be deployed. +export QDB_NAMESPACE=${QDB_NAMESPACE:-"qdb"} + +# If not already set, set the database username to be used by Monitoring. +export QDB_USERNAME=${QDB_USERNAME:-"admin"} + +# If not already set, set the database user's password to be used by Monitoring. +export QDB_PASSWORD=${QDB_PASSWORD:-"quest"} + +# If not already set, set the table name to be used by Monitoring. +export QDB_TABLE=${QDB_TABLE:-"tfs_monitoring"} + + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +# Constants +GITLAB_REPO_URL="labs.etsi.org:5050/tfs/controller" +TMP_FOLDER="./tmp" + +# Create a tmp folder for files modified during the deployment +TMP_MANIFESTS_FOLDER="$TMP_FOLDER/manifests" +mkdir -p $TMP_MANIFESTS_FOLDER +TMP_LOGS_FOLDER="$TMP_FOLDER/logs" +mkdir -p $TMP_LOGS_FOLDER + +echo "Deleting and Creating a new namespace..." +kubectl delete namespace $TFS_K8S_NAMESPACE +kubectl create namespace $TFS_K8S_NAMESPACE +printf "\n" + +echo "Create secret with CockroachDB data" +CRDB_SQL_PORT=$(kubectl --namespace ${CRDB_NAMESPACE} get service cockroachdb-public -o 'jsonpath={.spec.ports[?(@.name=="sql")].port}') +kubectl create secret generic crdb-data --namespace ${TFS_K8S_NAMESPACE} --type='Opaque' \ + --from-literal=CRDB_NAMESPACE=${CRDB_NAMESPACE} \ + --from-literal=CRDB_SQL_PORT=${CRDB_SQL_PORT} \ + --from-literal=CRDB_DATABASE=${CRDB_DATABASE} \ + --from-literal=CRDB_USERNAME=${CRDB_USERNAME} \ + --from-literal=CRDB_PASSWORD=${CRDB_PASSWORD} \ + --from-literal=CRDB_SSLMODE=require +printf "\n" + +echo "Create secret with NATS data" +NATS_CLIENT_PORT=$(kubectl --namespace ${NATS_NAMESPACE} get service nats -o 'jsonpath={.spec.ports[?(@.name=="client")].port}') +kubectl create secret generic nats-data --namespace ${TFS_K8S_NAMESPACE} --type='Opaque' \ + --from-literal=NATS_NAMESPACE=${NATS_NAMESPACE} \ + --from-literal=NATS_CLIENT_PORT=${NATS_CLIENT_PORT} +printf "\n" + +echo "Create secret with QuestDB data" +QDB_HTTP_PORT=$(kubectl --namespace ${QDB_NAMESPACE} get service questdb-public -o 'jsonpath={.spec.ports[?(@.name=="http")].port}') +QDB_ILP_PORT=$(kubectl --namespace ${QDB_NAMESPACE} get service questdb-public -o 'jsonpath={.spec.ports[?(@.name=="ilp")].port}') +QDB_SQL_PORT=$(kubectl --namespace ${QDB_NAMESPACE} get service questdb-public -o 'jsonpath={.spec.ports[?(@.name=="sql")].port}') +METRICSDB_HOSTNAME="questdb-public.${QDB_NAMESPACE}.svc.cluster.local" +kubectl create secret generic qdb-data --namespace ${TFS_K8S_NAMESPACE} --type='Opaque' \ + --from-literal=QDB_NAMESPACE=${QDB_NAMESPACE} \ + --from-literal=METRICSDB_HOSTNAME=${METRICSDB_HOSTNAME} \ + --from-literal=METRICSDB_REST_PORT=${QDB_HTTP_PORT} \ + --from-literal=METRICSDB_ILP_PORT=${QDB_ILP_PORT} \ + --from-literal=METRICSDB_SQL_PORT=${QDB_SQL_PORT} \ + --from-literal=METRICSDB_TABLE=${QDB_TABLE} \ + --from-literal=METRICSDB_USERNAME=${QDB_USERNAME} \ + --from-literal=METRICSDB_PASSWORD=${QDB_PASSWORD} +printf "\n" + +echo "Deploying components and collecting environment variables..." +ENV_VARS_SCRIPT=tfs_runtime_env_vars.sh +echo "# Environment variables for TeraFlowSDN deployment" > $ENV_VARS_SCRIPT +PYTHONPATH=$(pwd)/src +echo "export PYTHONPATH=${PYTHONPATH}" >> $ENV_VARS_SCRIPT + +for COMPONENT in $TFS_COMPONENTS; do + echo "Processing '$COMPONENT' component..." + + if [ "$TFS_SKIP_BUILD" != "YES" ]; then + 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" + 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" + + BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-backend.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" + 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" + + BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-gateway.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" + fi + + echo " Pushing Docker image to '$TFS_REGISTRY_IMAGES'..." + + if [ "$COMPONENT" == "pathcomp" ]; then + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT-frontend:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g') + + TAG_LOG="$TMP_LOGS_FOLDER/tag_${COMPONENT}-frontend.log" + docker tag "$COMPONENT-frontend:$TFS_IMAGE_TAG" "$IMAGE_URL" > "$TAG_LOG" + + PUSH_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}-frontend.log" + docker push "$IMAGE_URL" > "$PUSH_LOG" + + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT-backend:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g') + + TAG_LOG="$TMP_LOGS_FOLDER/tag_${COMPONENT}-backend.log" + docker tag "$COMPONENT-backend:$TFS_IMAGE_TAG" "$IMAGE_URL" > "$TAG_LOG" + + PUSH_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}-backend.log" + docker push "$IMAGE_URL" > "$PUSH_LOG" + elif [ "$COMPONENT" == "dlt" ]; then + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT-connector:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g') + + TAG_LOG="$TMP_LOGS_FOLDER/tag_${COMPONENT}-connector.log" + docker tag "$COMPONENT-connector:$TFS_IMAGE_TAG" "$IMAGE_URL" > "$TAG_LOG" + + PUSH_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}-connector.log" + docker push "$IMAGE_URL" > "$PUSH_LOG" + + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT-gateway:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g') + + TAG_LOG="$TMP_LOGS_FOLDER/tag_${COMPONENT}-gateway.log" + docker tag "$COMPONENT-gateway:$TFS_IMAGE_TAG" "$IMAGE_URL" > "$TAG_LOG" + + PUSH_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}-gateway.log" + docker push "$IMAGE_URL" > "$PUSH_LOG" + else + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g') + + TAG_LOG="$TMP_LOGS_FOLDER/tag_${COMPONENT}.log" + docker tag "$COMPONENT:$TFS_IMAGE_TAG" "$IMAGE_URL" > "$TAG_LOG" + + PUSH_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}.log" + docker push "$IMAGE_URL" > "$PUSH_LOG" + fi + fi + + echo " Adapting '$COMPONENT' manifest file..." + MANIFEST="$TMP_MANIFESTS_FOLDER/${COMPONENT}service.yaml" + cp ./manifests/"${COMPONENT}"service.yaml "$MANIFEST" + + if [ "$COMPONENT" == "pathcomp" ]; then + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT-frontend:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g') + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}-frontend:" "$MANIFEST" | cut -d ":" -f4) + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT-frontend:${VERSION}#image: $IMAGE_URL#g" "$MANIFEST" + + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT-backend:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g') + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}-backend:" "$MANIFEST" | cut -d ":" -f4) + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT-backend:${VERSION}#image: $IMAGE_URL#g" "$MANIFEST" + elif [ "$COMPONENT" == "dlt" ]; then + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT-connector:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g') + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}-connector:" "$MANIFEST" | cut -d ":" -f4) + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT-connector:${VERSION}#image: $IMAGE_URL#g" "$MANIFEST" + + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT-gateway:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g') + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}-gateway:" "$MANIFEST" | cut -d ":" -f4) + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT-gateway:${VERSION}#image: $IMAGE_URL#g" "$MANIFEST" + else + IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g') + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}:" "$MANIFEST" | cut -d ":" -f4) + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT:${VERSION}#image: $IMAGE_URL#g" "$MANIFEST" + fi + + sed -E -i "s#imagePullPolicy: .*#imagePullPolicy: Always#g" "$MANIFEST" + + # TODO: harmonize names of the monitoring component + + echo " Deploying '$COMPONENT' component to Kubernetes..." + DEPLOY_LOG="$TMP_LOGS_FOLDER/deploy_${COMPONENT}.log" + kubectl --namespace $TFS_K8S_NAMESPACE apply -f "$MANIFEST" > "$DEPLOY_LOG" + COMPONENT_OBJNAME=$(echo "${COMPONENT}" | sed "s/\_/-/") + #kubectl --namespace $TFS_K8S_NAMESPACE scale deployment --replicas=0 ${COMPONENT_OBJNAME}service >> "$DEPLOY_LOG" + #kubectl --namespace $TFS_K8S_NAMESPACE scale deployment --replicas=1 ${COMPONENT_OBJNAME}service >> "$DEPLOY_LOG" + + echo " Collecting env-vars for '$COMPONENT' component..." + + SERVICE_DATA=$(kubectl get service ${COMPONENT_OBJNAME}service --namespace $TFS_K8S_NAMESPACE -o json) + if [ -z "${SERVICE_DATA}" ]; then continue; fi + + # Env vars for service's host address + SERVICE_HOST=$(echo ${SERVICE_DATA} | jq -r '.spec.clusterIP') + if [ -z "${SERVICE_HOST}" ]; then continue; fi + ENVVAR_HOST=$(echo "${COMPONENT}service_SERVICE_HOST" | tr '[:lower:]' '[:upper:]') + echo "export ${ENVVAR_HOST}=${SERVICE_HOST}" >> $ENV_VARS_SCRIPT + + # Env vars for service's 'grpc' port (if any) + SERVICE_PORT_GRPC=$(echo ${SERVICE_DATA} | jq -r '.spec.ports[] | select(.name=="grpc") | .port') + if [ -n "${SERVICE_PORT_GRPC}" ]; then + ENVVAR_PORT_GRPC=$(echo "${COMPONENT}service_SERVICE_PORT_GRPC" | tr '[:lower:]' '[:upper:]') + echo "export ${ENVVAR_PORT_GRPC}=${SERVICE_PORT_GRPC}" >> $ENV_VARS_SCRIPT + fi + + # Env vars for service's 'http' port (if any) + SERVICE_PORT_HTTP=$(echo ${SERVICE_DATA} | jq -r '.spec.ports[] | select(.name=="http") | .port') + if [ -n "${SERVICE_PORT_HTTP}" ]; then + ENVVAR_PORT_HTTP=$(echo "${COMPONENT}service_SERVICE_PORT_HTTP" | tr '[:lower:]' '[:upper:]') + echo "export ${ENVVAR_PORT_HTTP}=${SERVICE_PORT_HTTP}" >> $ENV_VARS_SCRIPT + fi + + printf "\n" +done + +echo "Deploying extra manifests..." +for EXTRA_MANIFEST in $TFS_EXTRA_MANIFESTS; do + echo "Processing manifest '$EXTRA_MANIFEST'..." + if [[ "$EXTRA_MANIFEST" == *"servicemonitor"* ]]; then + kubectl apply -f $EXTRA_MANIFEST + else + kubectl --namespace $TFS_K8S_NAMESPACE apply -f $EXTRA_MANIFEST + fi + printf "\n" +done +printf "\n" + +for COMPONENT in $TFS_COMPONENTS; do + echo "Waiting for '$COMPONENT' component..." + COMPONENT_OBJNAME=$(echo "${COMPONENT}" | sed "s/\_/-/") + kubectl wait --namespace $TFS_K8S_NAMESPACE \ + --for='condition=available' --timeout=300s deployment/${COMPONENT_OBJNAME}service + printf "\n" +done + +if [[ "$TFS_COMPONENTS" == *"webui"* ]] && [[ "$TFS_COMPONENTS" == *"monitoring"* ]]; then + echo "Configuring WebUI DataStores and Dashboards..." + sleep 5 + + # Exposed through the ingress controller "tfs-ingress" + GRAFANA_URL="127.0.0.1:80/grafana" + + # Default Grafana credentials + GRAFANA_USERNAME="admin" + GRAFANA_PASSWORD="admin" + + # Configure Grafana Admin Password + # Ref: https://grafana.com/docs/grafana/latest/http_api/user/#change-password + GRAFANA_URL_DEFAULT="http://${GRAFANA_USERNAME}:${GRAFANA_PASSWORD}@${GRAFANA_URL}" + echo "Connecting to grafana at URL: ${GRAFANA_URL_DEFAULT}..." + curl -X PUT -H "Content-Type: application/json" -d '{ + "oldPassword": "'${GRAFANA_PASSWORD}'", + "newPassword": "'${TFS_GRAFANA_PASSWORD}'", + "confirmNew" : "'${TFS_GRAFANA_PASSWORD}'" + }' ${GRAFANA_URL_DEFAULT}/api/user/password + echo + + # Updated Grafana API URL + GRAFANA_URL_UPDATED="http://${GRAFANA_USERNAME}:${TFS_GRAFANA_PASSWORD}@${GRAFANA_URL}" + echo "export GRAFANA_URL_UPDATED=${GRAFANA_URL_UPDATED}" >> $ENV_VARS_SCRIPT + + # Ref: https://grafana.com/docs/grafana/latest/http_api/data_source/ + # TODO: replace user, password and database by variables to be saved + QDB_HOST_PORT="${METRICSDB_HOSTNAME}:${QDB_SQL_PORT}" + echo "Creating a datasource..." + curl -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d '{ + "access" : "proxy", + "type" : "postgres", + "name" : "questdb", + "url" : "'${QDB_HOST_PORT}'", + "database" : "'${QDB_TABLE}'", + "user" : "'${QDB_USERNAME}'", + "basicAuth": false, + "isDefault": true, + "jsonData" : { + "sslmode" : "disable", + "postgresVersion" : 1100, + "maxOpenConns" : 0, + "maxIdleConns" : 2, + "connMaxLifetime" : 14400, + "tlsAuth" : false, + "tlsAuthWithCACert" : false, + "timescaledb" : false, + "tlsConfigurationMethod": "file-path", + "tlsSkipVerify" : true + }, + "secureJsonData": {"password": "'${QDB_PASSWORD}'"} + }' ${GRAFANA_URL_UPDATED}/api/datasources + echo + + # Create Monitoring Dashboard + # Ref: https://grafana.com/docs/grafana/latest/http_api/dashboard/ + curl -X POST -H "Content-Type: application/json" \ + -d '@src/webui/grafana_dashboard_psql.json' \ + ${GRAFANA_URL_UPDATED}/api/dashboards/db + echo + + DASHBOARD_URL="${GRAFANA_URL_UPDATED}/api/dashboards/uid/tf-l3-monit" + DASHBOARD_ID=$(curl -s "${DASHBOARD_URL}" | jq '.dashboard.id') + curl -X POST ${GRAFANA_URL_UPDATED}/api/user/stars/dashboard/${DASHBOARD_ID} + + printf "\n\n" +fi diff --git a/ecoc22 b/ecoc22 new file mode 120000 index 0000000000000000000000000000000000000000..3c61895e5ac62d0b38ce058ba5ff042442542320 --- /dev/null +++ b/ecoc22 @@ -0,0 +1 @@ +src/tests/ecoc22/ \ No newline at end of file diff --git a/expose_ingress_grpc.sh b/expose_ingress_grpc.sh new file mode 100755 index 0000000000000000000000000000000000000000..945641c1f3b6ae981685a2a257260b14ceb927b2 --- /dev/null +++ b/expose_ingress_grpc.sh @@ -0,0 +1,55 @@ +#!/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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +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 webui"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +echo "Exposing GRPC ports for components..." +for COMPONENT in $TFS_COMPONENTS; do + echo "Processing '$COMPONENT' component..." + + SERVICE_GRPC_PORT=$(kubectl get service ${COMPONENT}service --namespace $TFS_K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.name=="grpc")].port}') + echo " '$COMPONENT' service port: $SERVICE_GRPC_PORT" + if [ -z "${SERVICE_GRPC_PORT}" ]; then + printf "\n" + continue; + fi + + COMPONENT_OBJNAME=$(echo "${COMPONENT}" | sed "s/\_/-/") + PATCH='{"data": {"'${SERVICE_GRPC_PORT}'": "'$TFS_K8S_NAMESPACE'/'${COMPONENT_OBJNAME}service':'${SERVICE_GRPC_PORT}'"}}' + #echo "PATCH: ${PATCH}" + kubectl patch configmap nginx-ingress-tcp-microk8s-conf --namespace ingress --patch "${PATCH}" + + PORT_MAP='{"containerPort": '${SERVICE_GRPC_PORT}', "hostPort": '${SERVICE_GRPC_PORT}'}' + CONTAINER='{"name": "nginx-ingress-microk8s", "ports": ['${PORT_MAP}']}' + PATCH='{"spec": {"template": {"spec": {"containers": ['${CONTAINER}']}}}}' + #echo "PATCH: ${PATCH}" + kubectl patch daemonset nginx-ingress-microk8s-controller --namespace ingress --patch "${PATCH}" + + printf "\n" +done + +echo "Done!" diff --git a/hackfest/commands.txt b/hackfest/commands.txt new file mode 100644 index 0000000000000000000000000000000000000000..31558364d74aa1fec729c80c9fab50aa7e0c2313 --- /dev/null +++ b/hackfest/commands.txt @@ -0,0 +1,304 @@ +This is a quick guide for having fast access to the commands. + +################################################################################ +# Prepare environment +################################################################################ + +# (done) Create PyEnv virtual environment +cd ~/tfs-ctrl +pyenv virtualenv 3.9.13 tfs +pyenv local 3.9.13/envs/tfs +./install_requirements.sh + +# (done) Install Python dependencies +pip install pyang +pip install git+https://github.com/robshakir/pyangbind.git +pip install netconf + +# (done) Install PlantUML +# (done) Install dependencies to run PlantUML +sudo apt-get install -y graphviz openjdk-11-jre + +# (done) Download plantuml.7997.jar from http://sourceforge.net/projects/plantuml/files/plantuml.7997.jar/download +cp ~/Downloads/plantuml.7997.jar ~/tfs-ctrl/hackfest/yang/plantuml.jar + +# (done) Install WireShark +# When asked "allow non-root users to capture?" answer "yes" +sudo apt-get install -y wireshark +# Add current user to wireshark group to allow capturing as non-root (requires log-out & log-in, or reboot) +sudo usermod -a -G wireshark $USER + + + +################################################################################ +# YANG +################################################################################ + +## GUIDED + +# Convert Topology YANG to Text-based tree +pyang -f tree topology.yang +pyang -f tree topology.yang -o topology.tree + +# Report a sample message following Topology YANG data model +pyang -f sample-xml-skeleton --sample-xml-skeleton-annotations topology.yang +pyang -f sample-xml-skeleton --sample-xml-skeleton-annotations topology.yang -o topology-sample.xml + +# Convert Topology YANG to UML +pyang -f uml topology.yang -o topology.uml +java -jar plantuml.jar topology.uml + +# Convert Topology YANG to Python bindings +export PYBINDPLUGIN=`/usr/bin/env python -c \ +'import pyangbind; import os; print ("{}/plugin".format(os.path.dirname(pyangbind.__file__)))'` +echo $PYBINDPLUGIN +pyang -f pybind topology.yang --plugindir $PYBINDPLUGIN -o binding_topology.py + +# Test creation of JSON-/XML-encoded Topology messages +python topology.py + +## EXERCISE + +# Convert Connection YANG to Text-based tree +pyang -f tree connection.yang + +# Report a sample message following Connection YANG data model +pyang -f sample-xml-skeleton --sample-xml-skeleton-annotations connection.yang + +# Convert Connection YANG to UML +pyang -f uml connection.yang -o connection.uml +java -jar plantuml.jar connection.uml + +# Convert Connection YANG to Python bindings +export PYBINDPLUGIN=`/usr/bin/env python -c \ + 'import pyangbind; import os; print ("{}/plugin".format(os.path.dirname(pyangbind.__file__)))'` +pyang -f pybind connection.yang --plugindir $PYBINDPLUGIN -o binding_connection.py + +# Test creation of JSON-/XML-encoded Connection messages +python connection.py + + + +################################################################################ +# NETCONF +################################################################################ + +## GUIDED + +Run server: +cd ~/tfs-ctrl/hackfest/netconf +python3 server_topology.py + +In another window, run client: +cd ~/tfs-ctrl/hackfest/netconf +python3 client_topology.py + +## EXERCISE + +Run server: +cd ~/tfs-ctrl/hackfest/netconf/connection +python3 server_topology_connection.py + +In another window, run client: +cd ~/tfs-ctrl/hackfest/netconf/connection +python3 client_connection.py + + + +################################################################################ +# TAPI +################################################################################ + +## GUIDED + +# (done) Install dependencies +cd ~/tfs-ctrl/hackfest/tapi/server +pip install -r requirements.txt + +# (done) Build & Implement methods for the TAPI v2.1.3 server: +cd ~/tfs-ctrl/hackfest/tapi +wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.35/swagger-codegen-cli-3.0.35.jar +wget -O tapi-connectivity.yaml https://github.com/OpenNetworkingFoundation/TAPI/raw/v2.1.3/OAS/tapi-connectivity%402020-06-16.yaml +java -jar swagger-codegen-cli-3.0.35.jar generate --input-spec tapi-connectivity.yaml \ + --lang python-flask --output server --disable-examples --config codegen-config.json +pip install connexion==2.14.1 +cd ~/tfs-ctrl/hackfest/tapi/server +# Rename methods in "tapi_server/controllers/tapi_path_computation_controller.py" as follows: +# operations_tapi_path_computationcompute_p2_p_path_post => operations_tapi_path_computationcompute_p_2_p_path_post +# operations_tapi_path_computationdelete_p2_p_path_post => operations_tapi_path_computationdelete_p_2_p_path_post +# operations_tapi_path_computationoptimize_p2_ppath_post => operations_tapi_path_computationoptimize_p_2_ppath_post +# Implement database based on Reference Implementation [Ref-3] in tapi/server/Acknowledgements.txt + +# Run the TAPI server: +cd ~/tfs-ctrl/hackfest/tapi/server +python3 -m tapi_server 8080 database/mini-ols-context.json + +# Run TAPI client using cURL (In a new window): +$ cd ~/tfs-ctrl/hackfest/tapi/client + +# Interrogate Context and SIPs: +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/ +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/service-interface-point=node-4-port-16-output/ + +# Interrogate Topology, Nodes and Links: +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-topology:topology-context/ +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-topology:topology-context/topology=ols-topo/ +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-topology:topology-context/topology=ols-topo/node=node-4/ +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-topology:topology-context/topology=ols-topo/node=node-4/owned-node-edge-point=node-4-port-13/ +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-topology:topology-context/topology=ols-topo/node=node-4/owned-node-edge-point=node-4-port-13/tapi-connectivity:cep-list/ +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-topology:topology-context/topology=ols-topo/link=link-4:2-2:4/ + +# Create ConnectivityServices and Connections: +curl -X POST -H "Content-Type: application/json" \ + http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service/ \ + -d @/home/tfs/tfs-ctrl/hackfest/tapi/client/cs1.json + +# Interrogate ConnectivityServices and Connections: +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-connectivity:connectivity-context/ +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service=cs1/ +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-connectivity:connectivity-context/connection=cs1/ + +# Delete ConnectivityServices and Connections: +curl -X DELETE -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service=cs1/ + + +## EXERCISE +# Exercise: retrieve and draw the topology +# solution in folder tapi_app + +cd ~/tfs-ctrl/hackfest/tapi/tapi_app +python3 tapi_app.py + + + +################################################################################ +# Deploy TeraFlowSDN +################################################################################ + +# Check status of Kubernetes +microk8s.status --wait-ready + +# Check all resources in Kubernetes +microk8s.kubectl get all --all-namespaces + +# Deploy TeraFlowSDN +cd ~/tfs-ctrl +source my_deploy.sh +./deploy.sh + +# Show status of your deployment +(if new terminal) cd ~/tfs-ctrl && source my_deploy.sh +./show_deploy.sh + +# Show logs of a specific component +(if new terminal) cd ~/tfs-ctrl && source my_deploy.sh +scripts/show_logs_device.sh + + + +################################################################################ +# Programmable L3 routers +################################################################################ + +# (done) Build a Netconf server supporting basic OpenConfig data model + +# Start the Netconf/OpenConfig server +cd ~/tfs-ctrl/hackfest/netconf-oc +python3 server_openconfig.py 8300 + + + +################################################################################ +# Service requests +################################################################################ + +## L3VPN service from JSON descriptors + +# (in a new terminal) Start OLS TAPI server: +cd ~/tfs-ctrl/hackfest/tapi/server +python3 -m tapi_server 8080 database/mini-ols-context.json + +# (in a new terminal) Start the Netconf/OpenConfig server for R1 +cd ~/tfs-ctrl/hackfest/netconf-oc +python3 server_openconfig.py 8301 + +# (in a new terminal) Start the Netconf/OpenConfig server for R2 +cd ~/tfs-ctrl/hackfest/netconf-oc +python3 server_openconfig.py 8302 + +# (in a new terminal) Start the Netconf/OpenConfig server for R3 +cd ~/tfs-ctrl/hackfest/netconf-oc +python3 server_openconfig.py 8303 + +# (in a new terminal) Start the Netconf/OpenConfig server for R4 +cd ~/tfs-ctrl/hackfest/netconf-oc +python3 server_openconfig.py 8304 + + + +############ +# Mock OSM +############ + +$ cd ~/tfs-ctrl/hackfest/ +$ python -m mock_osm +Welcome to the MockOSM shell. +Type help or ? to list commands. + +(mock-osm) create +Service b8c99e2c-39d8-424d-9833-554634269555 created +# Service should be created in TFS. Check "Slice" and "Service" pages on WebUI. +# Check configuration rules in "Devices" + +(mock-osm) status +response.status_code=200 +Status of Service b8c99e2c-39d8-424d-9833-554634269555 is {'sdn_status': 'ACTIVE'} + +(mock-osm) delete +Service b8c99e2c-39d8-424d-9833-554634269555 deleted +# Service should be removed from TFS. Check "Slice" and "Service" pages on WebUI. +# Check configuration rules in "Devices" + +(mock-osm) exit +Bye! + +############ +# gNMI +############ + +## Download and install the latest release +$ sudo bash -c "$(curl -sL https://get.containerlab.dev)“ + +## Deploy proposed two SR node scenario +$ cd tfs-ctrl/hackfest/gnmi +$ sudo containerlab deploy -t srlinux.clab.yml + +## Access SR Bash +$ docker exec -it clab-srlinux-srl1 bash + +## Acess SR CLI +$ docker exec -it clab-srlinux-srl1 sr_cli + +## Destroy scenario +$ sudo containerlab destroy --topo srlinux.clab.yml + +## Install gNMIc +$ 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 + +## 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] + +## 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 + +(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 + +## Subscribe request +$ gnmic -a clab-srlinux-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf subscribe --path /interface[name=mgmt0]/statistics +(In another terminal, you can generate traffic) +$ssh admin@clab-srlinux-srl1 diff --git a/hackfest/gnmi/.gitkeep b/hackfest/gnmi/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/hackfest/gnmi/sonic.clab.yml b/hackfest/gnmi/sonic.clab.yml new file mode 100644 index 0000000000000000000000000000000000000000..47c1e64643a70e3e0caff12aff8a6796598cea1f --- /dev/null +++ b/hackfest/gnmi/sonic.clab.yml @@ -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. + +# file: sonic.clab.yml +name: sonic-vs + +topology: + nodes: + srl1: + kind: sonic-vs + image: docker-sonic-vs + srl2: + kind: sonic-vs + image: docker-sonic-vs + + links: + - endpoints: ["srl1:e1-1", "srl2:e1-1"] + diff --git a/hackfest/grpc/commands.txt b/hackfest/grpc/commands.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0148b180c03841098781563976467d980abc464 --- /dev/null +++ b/hackfest/grpc/commands.txt @@ -0,0 +1,36 @@ +== GRPC +$ cd ~/tfs-ctrl/hackfest/grpc + +COMPILE connection.proto: +$ python -m grpc_tools.protoc -I=. --python_out=connection/ connection.proto + +RUN CREATE AND LIST CONNECTION +$ cd ~/tfs-ctrl/hackfest/grpc/connection +$ python3 create.py connection.txt +$ python3 list.py connection.txt + +COMPILE connectionService.proto +$ python -m grpc_tools.protoc -I=. --python_out=connectionService/ --grpc_python_out=connectionService/ connectionService.proto + +RUN SERVER +$ cd ~/tfs-ctrl/hackfest/grpc/connectionService +$ python3 connectionService_server.py + +RUN CLIENT (in another window) +$ cd ~/tfs-ctrl/hackfest/grpc/connectionService +$ python3 connectionService_client.py + +### EXERCISE +COMPILE connectionServiceWithNotif.proto +$ cd ~/tfs-ctrl/hackfest/grpc/ +$ python -m grpc_tools.protoc -I=. --python_out=connectionServiceWithNotif/ --grpc_python_out=connectionServiceWithNotif/ connectionServiceWithNotif.proto + +RUN SERVER +$ cd ~/tfs-ctrl/hackfest/grpc/connectionServiceWithNotif +$ python3 connectionServiceWithNotif_server.py + +RUN CLIENT (in another window) +$ cd ~/tfs-ctrl/hackfest/grpc/connectionServiceWithNotif +$ python3 connectionServiceWithNotif_client.py + + diff --git a/hackfest/grpc/connection.proto b/hackfest/grpc/connection.proto new file mode 100644 index 0000000000000000000000000000000000000000..0e8522768614ec4c698b87647118101ae0479aaa --- /dev/null +++ b/hackfest/grpc/connection.proto @@ -0,0 +1,38 @@ +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//Example of connection +syntax = "proto3"; +package connection; + +message Connection { + string connectionId = 1; + string sourceNode = 2; + string targetNode = 3; + string sourcePort = 4; + string targetPort = 5; + uint32 bandwidth = 6; + + enum LayerProtocolName { + ETH = 0; + OPTICAL = 1; + } + + LayerProtocolName layerProtocolName = 7; + +} + +message ConnectionList { + repeated Connection connection = 1; +} diff --git a/hackfest/grpc/connection/connection_pb2.py b/hackfest/grpc/connection/connection_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..e66b665b22303fbf582de9ec378591fae4e09659 --- /dev/null +++ b/hackfest/grpc/connection/connection_pb2.py @@ -0,0 +1,176 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: connection.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='connection.proto', + package='connection', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\n\x10\x63onnection.proto\x12\nconnection\"\xf5\x01\n\nConnection\x12\x14\n\x0c\x63onnectionId\x18\x01 \x01(\t\x12\x12\n\nsourceNode\x18\x02 \x01(\t\x12\x12\n\ntargetNode\x18\x03 \x01(\t\x12\x12\n\nsourcePort\x18\x04 \x01(\t\x12\x12\n\ntargetPort\x18\x05 \x01(\t\x12\x11\n\tbandwidth\x18\x06 \x01(\r\x12\x43\n\x11layerProtocolName\x18\x07 \x01(\x0e\x32(.connection.Connection.LayerProtocolName\")\n\x11LayerProtocolName\x12\x07\n\x03\x45TH\x10\x00\x12\x0b\n\x07OPTICAL\x10\x01\"<\n\x0e\x43onnectionList\x12*\n\nconnection\x18\x01 \x03(\x0b\x32\x16.connection.Connectionb\x06proto3') +) + + + +_CONNECTION_LAYERPROTOCOLNAME = _descriptor.EnumDescriptor( + name='LayerProtocolName', + full_name='connection.Connection.LayerProtocolName', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='ETH', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='OPTICAL', index=1, number=1, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=237, + serialized_end=278, +) +_sym_db.RegisterEnumDescriptor(_CONNECTION_LAYERPROTOCOLNAME) + + +_CONNECTION = _descriptor.Descriptor( + name='Connection', + full_name='connection.Connection', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='connectionId', full_name='connection.Connection.connectionId', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='sourceNode', full_name='connection.Connection.sourceNode', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='targetNode', full_name='connection.Connection.targetNode', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='sourcePort', full_name='connection.Connection.sourcePort', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='targetPort', full_name='connection.Connection.targetPort', index=4, + number=5, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='bandwidth', full_name='connection.Connection.bandwidth', index=5, + number=6, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='layerProtocolName', full_name='connection.Connection.layerProtocolName', index=6, + number=7, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _CONNECTION_LAYERPROTOCOLNAME, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=33, + serialized_end=278, +) + + +_CONNECTIONLIST = _descriptor.Descriptor( + name='ConnectionList', + full_name='connection.ConnectionList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='connection', full_name='connection.ConnectionList.connection', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=280, + serialized_end=340, +) + +_CONNECTION.fields_by_name['layerProtocolName'].enum_type = _CONNECTION_LAYERPROTOCOLNAME +_CONNECTION_LAYERPROTOCOLNAME.containing_type = _CONNECTION +_CONNECTIONLIST.fields_by_name['connection'].message_type = _CONNECTION +DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION +DESCRIPTOR.message_types_by_name['ConnectionList'] = _CONNECTIONLIST +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Connection = _reflection.GeneratedProtocolMessageType('Connection', (_message.Message,), dict( + DESCRIPTOR = _CONNECTION, + __module__ = 'connection_pb2' + # @@protoc_insertion_point(class_scope:connection.Connection) + )) +_sym_db.RegisterMessage(Connection) + +ConnectionList = _reflection.GeneratedProtocolMessageType('ConnectionList', (_message.Message,), dict( + DESCRIPTOR = _CONNECTIONLIST, + __module__ = 'connection_pb2' + # @@protoc_insertion_point(class_scope:connection.ConnectionList) + )) +_sym_db.RegisterMessage(ConnectionList) + + +# @@protoc_insertion_point(module_scope) diff --git a/hackfest/grpc/connection/create.py b/hackfest/grpc/connection/create.py new file mode 100644 index 0000000000000000000000000000000000000000..7d134105d04b155abc2d3d4ad3e4efeef085c81a --- /dev/null +++ b/hackfest/grpc/connection/create.py @@ -0,0 +1,62 @@ +#! /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 connection_pb2 +import sys + +try: + raw_input # Python 2 +except NameError: + raw_input = input # Python 3 + + +# This function fills in a Connection message based on user input. +def PromptForConnection(connection): + connection.connectionId = raw_input("Enter connectionID: ") + connection.sourceNode = raw_input("Enter sourceNode: ") + connection.targetNode = raw_input("Enter targetNode: ") + connection.sourcePort = raw_input("Enter sourcePort: ") + connection.targetPort = raw_input("Enter targetPort: ") + connection.bandwidth = int( raw_input("Enter bandwidth: ") ) + + type = raw_input("Is this a eth or optical connection? ") + if type == "eth": + connection.layerProtocolName = connection_pb2.Connection.ETH + elif type == "optical": + connection.layerProtocolName = connection_pb2.Connection.OPTICAL + else: + print("Unknown layerProtocolName type; leaving as default value.") + + +if __name__ == '__main__': + if len(sys.argv) != 2: + print("Usage:", sys.argv[0], "CONNECTION_FILE") + sys.exit(-1) + + connectionList = connection_pb2.ConnectionList() + + # Read the existing address book. + try: + with open(sys.argv[1], "rb") as f: + connectionList.ParseFromString(f.read()) + except IOError: + print(sys.argv[1] + ": File not found. Creating a new file.") + + # Add an address. + PromptForConnection(connectionList.connection.add()) + + # Write the new address book back to disk. + with open(sys.argv[1], "wb") as f: + f.write(connectionList.SerializeToString()) diff --git a/hackfest/grpc/connection/list.py b/hackfest/grpc/connection/list.py new file mode 100644 index 0000000000000000000000000000000000000000..5b1926d3cac8dbdf00d889726b1638e0a70ad6b2 --- /dev/null +++ b/hackfest/grpc/connection/list.py @@ -0,0 +1,47 @@ +#! /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. + +from __future__ import print_function +import connection_pb2 +import sys + + +# Iterates though all connections in the ConnectionList and prints info about them. +def ListConnections(connectionList): + for connection in connectionList.connection: + print("connectionID:", connection.connectionId) + print(" sourceNode:", connection.sourceNode) + print(" targetNode:", connection.targetNode) + print(" sourcePort:", connection.sourcePort) + print(" targetPort:", connection.targetPort) + print(" bandwidth:", connection.bandwidth) + if connection.layerProtocolName == connection_pb2.Connection.ETH: + print(" layerProtocolName:ETH") + elif connection.layerProtocolName == connection_pb2.Connection.OPTICAL: + print(" layerProtocolName:OPTICAL") + + +if __name__ == '__main__': + if len(sys.argv) != 2: + print("Usage:", sys.argv[0], "CONNECTION_FILE") + sys.exit(-1) + + connectionList = connection_pb2.ConnectionList() + + # Read the existing address book. + with open(sys.argv[1], "rb") as f: + connectionList.ParseFromString(f.read()) + + ListConnections(connectionList) diff --git a/hackfest/grpc/connectionService.proto b/hackfest/grpc/connectionService.proto new file mode 100644 index 0000000000000000000000000000000000000000..8f6b5a6e781ba074239bfdbc2d05bea638b153a3 --- /dev/null +++ b/hackfest/grpc/connectionService.proto @@ -0,0 +1,46 @@ +// 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. + +//Example of connection +syntax = "proto3"; +package connection; + +import "google/protobuf/empty.proto"; + +service ConnectionService { + rpc CreateConnection (Connection) returns (google.protobuf.Empty) {} + rpc ListConnection (google.protobuf.Empty) returns (ConnectionList) {} +} + + +message Connection { + string connectionId = 1; + string sourceNode = 2; + string targetNode = 3; + string sourcePort = 4; + string targetPort = 5; + uint32 bandwidth = 6; + + enum LayerProtocolName { + ETH = 0; + OPTICAL = 1; + } + + LayerProtocolName layerProtocolName = 7; + +} + +message ConnectionList { + repeated Connection connection = 1; +} diff --git a/hackfest/grpc/connectionService/connectionService_client.py b/hackfest/grpc/connectionService/connectionService_client.py new file mode 100644 index 0000000000000000000000000000000000000000..e5c1bf48186b4c5e7e3425e3601e32642e7d2fcc --- /dev/null +++ b/hackfest/grpc/connectionService/connectionService_client.py @@ -0,0 +1,48 @@ +# 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 __future__ import print_function + +import grpc + +import connectionService_pb2 +import connectionService_pb2_grpc +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +try: + raw_input # Python 2 +except NameError: + raw_input = input # Python 3 + +def createConnection(): + with grpc.insecure_channel('localhost:50051') as channel: + connection=connectionService_pb2.Connection() + connection.connectionId = raw_input("Enter connectionID: ") + connection.sourceNode = raw_input("Enter sourceNode: ") + connection.targetNode = raw_input("Enter targetNode: ") + connection.sourcePort = raw_input("Enter sourcePort: ") + connection.targetPort = raw_input("Enter targetPort: ") + connection.bandwidth = int( raw_input("Enter bandwidth: ") ) + stub = connectionService_pb2_grpc.ConnectionServiceStub(channel) + response = stub.CreateConnection(connection) + print("ConnectionService client received: " + str(response) ) + +def listConnection(): + with grpc.insecure_channel('localhost:50051') as channel: + stub = connectionService_pb2_grpc.ConnectionServiceStub(channel) + response = stub.ListConnection(google_dot_protobuf_dot_empty__pb2.Empty()) + print("ConnectionService client received: " + str(response) ) + +if __name__ == '__main__': + createConnection() + listConnection() \ No newline at end of file diff --git a/hackfest/grpc/connectionService/connectionService_pb2.py b/hackfest/grpc/connectionService/connectionService_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..9f1951fa92a017baf4f44470e833aae8d74e0f3b --- /dev/null +++ b/hackfest/grpc/connectionService/connectionService_pb2.py @@ -0,0 +1,211 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: connectionService.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='connectionService.proto', + package='connection', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\n\x17\x63onnectionService.proto\x12\nconnection\x1a\x1bgoogle/protobuf/empty.proto\"\xf5\x01\n\nConnection\x12\x14\n\x0c\x63onnectionId\x18\x01 \x01(\t\x12\x12\n\nsourceNode\x18\x02 \x01(\t\x12\x12\n\ntargetNode\x18\x03 \x01(\t\x12\x12\n\nsourcePort\x18\x04 \x01(\t\x12\x12\n\ntargetPort\x18\x05 \x01(\t\x12\x11\n\tbandwidth\x18\x06 \x01(\r\x12\x43\n\x11layerProtocolName\x18\x07 \x01(\x0e\x32(.connection.Connection.LayerProtocolName\")\n\x11LayerProtocolName\x12\x07\n\x03\x45TH\x10\x00\x12\x0b\n\x07OPTICAL\x10\x01\"<\n\x0e\x43onnectionList\x12*\n\nconnection\x18\x01 \x03(\x0b\x32\x16.connection.Connection2\xa1\x01\n\x11\x43onnectionService\x12\x44\n\x10\x43reateConnection\x12\x16.connection.Connection\x1a\x16.google.protobuf.Empty\"\x00\x12\x46\n\x0eListConnection\x12\x16.google.protobuf.Empty\x1a\x1a.connection.ConnectionList\"\x00\x62\x06proto3') + , + dependencies=[google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,]) + + + +_CONNECTION_LAYERPROTOCOLNAME = _descriptor.EnumDescriptor( + name='LayerProtocolName', + full_name='connection.Connection.LayerProtocolName', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='ETH', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='OPTICAL', index=1, number=1, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=273, + serialized_end=314, +) +_sym_db.RegisterEnumDescriptor(_CONNECTION_LAYERPROTOCOLNAME) + + +_CONNECTION = _descriptor.Descriptor( + name='Connection', + full_name='connection.Connection', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='connectionId', full_name='connection.Connection.connectionId', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='sourceNode', full_name='connection.Connection.sourceNode', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='targetNode', full_name='connection.Connection.targetNode', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='sourcePort', full_name='connection.Connection.sourcePort', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='targetPort', full_name='connection.Connection.targetPort', index=4, + number=5, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='bandwidth', full_name='connection.Connection.bandwidth', index=5, + number=6, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='layerProtocolName', full_name='connection.Connection.layerProtocolName', index=6, + number=7, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _CONNECTION_LAYERPROTOCOLNAME, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=69, + serialized_end=314, +) + + +_CONNECTIONLIST = _descriptor.Descriptor( + name='ConnectionList', + full_name='connection.ConnectionList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='connection', full_name='connection.ConnectionList.connection', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=316, + serialized_end=376, +) + +_CONNECTION.fields_by_name['layerProtocolName'].enum_type = _CONNECTION_LAYERPROTOCOLNAME +_CONNECTION_LAYERPROTOCOLNAME.containing_type = _CONNECTION +_CONNECTIONLIST.fields_by_name['connection'].message_type = _CONNECTION +DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION +DESCRIPTOR.message_types_by_name['ConnectionList'] = _CONNECTIONLIST +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Connection = _reflection.GeneratedProtocolMessageType('Connection', (_message.Message,), dict( + DESCRIPTOR = _CONNECTION, + __module__ = 'connectionService_pb2' + # @@protoc_insertion_point(class_scope:connection.Connection) + )) +_sym_db.RegisterMessage(Connection) + +ConnectionList = _reflection.GeneratedProtocolMessageType('ConnectionList', (_message.Message,), dict( + DESCRIPTOR = _CONNECTIONLIST, + __module__ = 'connectionService_pb2' + # @@protoc_insertion_point(class_scope:connection.ConnectionList) + )) +_sym_db.RegisterMessage(ConnectionList) + + + +_CONNECTIONSERVICE = _descriptor.ServiceDescriptor( + name='ConnectionService', + full_name='connection.ConnectionService', + file=DESCRIPTOR, + index=0, + serialized_options=None, + serialized_start=379, + serialized_end=540, + methods=[ + _descriptor.MethodDescriptor( + name='CreateConnection', + full_name='connection.ConnectionService.CreateConnection', + index=0, + containing_service=None, + input_type=_CONNECTION, + output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + serialized_options=None, + ), + _descriptor.MethodDescriptor( + name='ListConnection', + full_name='connection.ConnectionService.ListConnection', + index=1, + containing_service=None, + input_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + output_type=_CONNECTIONLIST, + serialized_options=None, + ), +]) +_sym_db.RegisterServiceDescriptor(_CONNECTIONSERVICE) + +DESCRIPTOR.services_by_name['ConnectionService'] = _CONNECTIONSERVICE + +# @@protoc_insertion_point(module_scope) diff --git a/hackfest/grpc/connectionService/connectionService_pb2_grpc.py b/hackfest/grpc/connectionService/connectionService_pb2_grpc.py new file mode 100644 index 0000000000000000000000000000000000000000..94ffffbf7fd3c90b541f36bd1aac6f23e1b5913b --- /dev/null +++ b/hackfest/grpc/connectionService/connectionService_pb2_grpc.py @@ -0,0 +1,64 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + +import connectionService_pb2 as connectionService__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 + + +class ConnectionServiceStub(object): + # missing associated documentation comment in .proto file + pass + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.CreateConnection = channel.unary_unary( + '/connection.ConnectionService/CreateConnection', + request_serializer=connectionService__pb2.Connection.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + self.ListConnection = channel.unary_unary( + '/connection.ConnectionService/ListConnection', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=connectionService__pb2.ConnectionList.FromString, + ) + + +class ConnectionServiceServicer(object): + # missing associated documentation comment in .proto file + pass + + def CreateConnection(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListConnection(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_ConnectionServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'CreateConnection': grpc.unary_unary_rpc_method_handler( + servicer.CreateConnection, + request_deserializer=connectionService__pb2.Connection.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'ListConnection': grpc.unary_unary_rpc_method_handler( + servicer.ListConnection, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=connectionService__pb2.ConnectionList.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'connection.ConnectionService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/hackfest/grpc/connectionService/connectionService_server.py b/hackfest/grpc/connectionService/connectionService_server.py new file mode 100644 index 0000000000000000000000000000000000000000..f1632db90cd6d7dbfd186fe3c4bad9da32195b28 --- /dev/null +++ b/hackfest/grpc/connectionService/connectionService_server.py @@ -0,0 +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. + +from concurrent import futures +import time +import logging +import grpc + +import connectionService_pb2 +import connectionService_pb2_grpc +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 + +_ONE_DAY_IN_SECONDS = 60 * 60 * 24 + +class connectionService(connectionService_pb2_grpc.ConnectionServiceServicer): + def __init__(self): + self.connectionList = connectionService_pb2.ConnectionList() + + def CreateConnection(self, request, context): + logging.debug("Received Connection " + request.connectionId) + self.connectionList.connection.extend([request]) + return google_dot_protobuf_dot_empty__pb2.Empty() + + def ListConnection(self, request, context): + logging.debug("List Connections") + return self.connectionList + +def serve(): + server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) + connectionService_pb2_grpc.add_ConnectionServiceServicer_to_server(connectionService(), server) + server.add_insecure_port('[::]:50051') + logging.debug("Starting server") + server.start() + try: + while True: + time.sleep(_ONE_DAY_IN_SECONDS) + except KeyboardInterrupt: + server.stop(0) + +if __name__ == '__main__': + logging.basicConfig(level=logging.DEBUG) + serve() diff --git a/hackfest/grpc/connectionServiceWithNotif.proto b/hackfest/grpc/connectionServiceWithNotif.proto new file mode 100644 index 0000000000000000000000000000000000000000..f2f5b17e317cd5c15461979cf2cf20462d3d72de --- /dev/null +++ b/hackfest/grpc/connectionServiceWithNotif.proto @@ -0,0 +1,50 @@ +// 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. + +//Example of connection +syntax = "proto3"; +package connection; + +import "google/protobuf/empty.proto"; + +service ConnectionServiceWithNotif { + rpc CreateConnection (Connection) returns (google.protobuf.Empty) {} + rpc ListConnection (google.protobuf.Empty) returns (ConnectionList) {} + rpc GetBer(Connection) returns (stream Ber) {} +} + +message Ber { + double value = 1; +} + +message Connection { + string connectionId = 1; + string sourceNode = 2; + string targetNode = 3; + string sourcePort = 4; + string targetPort = 5; + uint32 bandwidth = 6; + + enum LayerProtocolName { + ETH = 0; + OPTICAL = 1; + } + + LayerProtocolName layerProtocolName = 7; + +} + +message ConnectionList { + repeated Connection connection = 1; +} diff --git a/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_client.py b/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_client.py new file mode 100644 index 0000000000000000000000000000000000000000..9518bf743221c0a2e2c1191be063aafff8eaccb5 --- /dev/null +++ b/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_client.py @@ -0,0 +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. + +from __future__ import print_function + +import grpc + +import connectionServiceWithNotif_pb2 +import connectionServiceWithNotif_pb2_grpc +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +try: + raw_input # Python 2 +except NameError: + raw_input = input # Python 3 + +def createConnection(stub): + connection=connectionServiceWithNotif_pb2.Connection() + connection.connectionId = raw_input("Enter connectionID: ") + connection.sourceNode = raw_input("Enter sourceNode: ") + connection.targetNode = raw_input("Enter targetNode: ") + connection.sourcePort = raw_input("Enter sourcePort: ") + connection.targetPort = raw_input("Enter targetPort: ") + connection.bandwidth = int( raw_input("Enter bandwidth: ") ) + + response = stub.CreateConnection(connection) + print("ConnectionService client received: " + str(response) ) + +def listConnection(stub): + response = stub.ListConnection(google_dot_protobuf_dot_empty__pb2.Empty()) + print("ConnectionService client received: " + str(response) ) + +def getBer(stub): + responses = stub.GetBer(connectionServiceWithNotif_pb2.Connection(connectionId="conn1")) + for response in responses: + print("Received Ber %s" % (response.value) ) + +if __name__ == '__main__': + with grpc.insecure_channel('localhost:50051') as channel: + stub = connectionServiceWithNotif_pb2_grpc.ConnectionServiceWithNotifStub(channel) + #createConnection(stub) + listConnection(stub) + getBer(stub) \ No newline at end of file diff --git a/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_pb2.py b/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..403dd0ce409700875e8fc80b011564d055c5c4cb --- /dev/null +++ b/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_pb2.py @@ -0,0 +1,259 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: connectionServiceWithNotif.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='connectionServiceWithNotif.proto', + package='connection', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\n connectionServiceWithNotif.proto\x12\nconnection\x1a\x1bgoogle/protobuf/empty.proto\"\x14\n\x03\x42\x65r\x12\r\n\x05value\x18\x01 \x01(\x01\"\xf5\x01\n\nConnection\x12\x14\n\x0c\x63onnectionId\x18\x01 \x01(\t\x12\x12\n\nsourceNode\x18\x02 \x01(\t\x12\x12\n\ntargetNode\x18\x03 \x01(\t\x12\x12\n\nsourcePort\x18\x04 \x01(\t\x12\x12\n\ntargetPort\x18\x05 \x01(\t\x12\x11\n\tbandwidth\x18\x06 \x01(\r\x12\x43\n\x11layerProtocolName\x18\x07 \x01(\x0e\x32(.connection.Connection.LayerProtocolName\")\n\x11LayerProtocolName\x12\x07\n\x03\x45TH\x10\x00\x12\x0b\n\x07OPTICAL\x10\x01\"<\n\x0e\x43onnectionList\x12*\n\nconnection\x18\x01 \x03(\x0b\x32\x16.connection.Connection2\xe1\x01\n\x1a\x43onnectionServiceWithNotif\x12\x44\n\x10\x43reateConnection\x12\x16.connection.Connection\x1a\x16.google.protobuf.Empty\"\x00\x12\x46\n\x0eListConnection\x12\x16.google.protobuf.Empty\x1a\x1a.connection.ConnectionList\"\x00\x12\x35\n\x06GetBer\x12\x16.connection.Connection\x1a\x0f.connection.Ber\"\x00\x30\x01\x62\x06proto3') + , + dependencies=[google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,]) + + + +_CONNECTION_LAYERPROTOCOLNAME = _descriptor.EnumDescriptor( + name='LayerProtocolName', + full_name='connection.Connection.LayerProtocolName', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='ETH', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='OPTICAL', index=1, number=1, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=304, + serialized_end=345, +) +_sym_db.RegisterEnumDescriptor(_CONNECTION_LAYERPROTOCOLNAME) + + +_BER = _descriptor.Descriptor( + name='Ber', + full_name='connection.Ber', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='connection.Ber.value', index=0, + number=1, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=77, + serialized_end=97, +) + + +_CONNECTION = _descriptor.Descriptor( + name='Connection', + full_name='connection.Connection', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='connectionId', full_name='connection.Connection.connectionId', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='sourceNode', full_name='connection.Connection.sourceNode', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='targetNode', full_name='connection.Connection.targetNode', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='sourcePort', full_name='connection.Connection.sourcePort', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='targetPort', full_name='connection.Connection.targetPort', index=4, + number=5, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='bandwidth', full_name='connection.Connection.bandwidth', index=5, + number=6, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='layerProtocolName', full_name='connection.Connection.layerProtocolName', index=6, + number=7, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _CONNECTION_LAYERPROTOCOLNAME, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=100, + serialized_end=345, +) + + +_CONNECTIONLIST = _descriptor.Descriptor( + name='ConnectionList', + full_name='connection.ConnectionList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='connection', full_name='connection.ConnectionList.connection', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=347, + serialized_end=407, +) + +_CONNECTION.fields_by_name['layerProtocolName'].enum_type = _CONNECTION_LAYERPROTOCOLNAME +_CONNECTION_LAYERPROTOCOLNAME.containing_type = _CONNECTION +_CONNECTIONLIST.fields_by_name['connection'].message_type = _CONNECTION +DESCRIPTOR.message_types_by_name['Ber'] = _BER +DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION +DESCRIPTOR.message_types_by_name['ConnectionList'] = _CONNECTIONLIST +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Ber = _reflection.GeneratedProtocolMessageType('Ber', (_message.Message,), dict( + DESCRIPTOR = _BER, + __module__ = 'connectionServiceWithNotif_pb2' + # @@protoc_insertion_point(class_scope:connection.Ber) + )) +_sym_db.RegisterMessage(Ber) + +Connection = _reflection.GeneratedProtocolMessageType('Connection', (_message.Message,), dict( + DESCRIPTOR = _CONNECTION, + __module__ = 'connectionServiceWithNotif_pb2' + # @@protoc_insertion_point(class_scope:connection.Connection) + )) +_sym_db.RegisterMessage(Connection) + +ConnectionList = _reflection.GeneratedProtocolMessageType('ConnectionList', (_message.Message,), dict( + DESCRIPTOR = _CONNECTIONLIST, + __module__ = 'connectionServiceWithNotif_pb2' + # @@protoc_insertion_point(class_scope:connection.ConnectionList) + )) +_sym_db.RegisterMessage(ConnectionList) + + + +_CONNECTIONSERVICEWITHNOTIF = _descriptor.ServiceDescriptor( + name='ConnectionServiceWithNotif', + full_name='connection.ConnectionServiceWithNotif', + file=DESCRIPTOR, + index=0, + serialized_options=None, + serialized_start=410, + serialized_end=635, + methods=[ + _descriptor.MethodDescriptor( + name='CreateConnection', + full_name='connection.ConnectionServiceWithNotif.CreateConnection', + index=0, + containing_service=None, + input_type=_CONNECTION, + output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + serialized_options=None, + ), + _descriptor.MethodDescriptor( + name='ListConnection', + full_name='connection.ConnectionServiceWithNotif.ListConnection', + index=1, + containing_service=None, + input_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + output_type=_CONNECTIONLIST, + serialized_options=None, + ), + _descriptor.MethodDescriptor( + name='GetBer', + full_name='connection.ConnectionServiceWithNotif.GetBer', + index=2, + containing_service=None, + input_type=_CONNECTION, + output_type=_BER, + serialized_options=None, + ), +]) +_sym_db.RegisterServiceDescriptor(_CONNECTIONSERVICEWITHNOTIF) + +DESCRIPTOR.services_by_name['ConnectionServiceWithNotif'] = _CONNECTIONSERVICEWITHNOTIF + +# @@protoc_insertion_point(module_scope) diff --git a/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_pb2_grpc.py b/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_pb2_grpc.py new file mode 100644 index 0000000000000000000000000000000000000000..9a88a22b4bd9055f1d2e905abaa2496faadb5533 --- /dev/null +++ b/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_pb2_grpc.py @@ -0,0 +1,81 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + +import connectionServiceWithNotif_pb2 as connectionServiceWithNotif__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 + + +class ConnectionServiceWithNotifStub(object): + # missing associated documentation comment in .proto file + pass + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.CreateConnection = channel.unary_unary( + '/connection.ConnectionServiceWithNotif/CreateConnection', + request_serializer=connectionServiceWithNotif__pb2.Connection.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + self.ListConnection = channel.unary_unary( + '/connection.ConnectionServiceWithNotif/ListConnection', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=connectionServiceWithNotif__pb2.ConnectionList.FromString, + ) + self.GetBer = channel.unary_stream( + '/connection.ConnectionServiceWithNotif/GetBer', + request_serializer=connectionServiceWithNotif__pb2.Connection.SerializeToString, + response_deserializer=connectionServiceWithNotif__pb2.Ber.FromString, + ) + + +class ConnectionServiceWithNotifServicer(object): + # missing associated documentation comment in .proto file + pass + + def CreateConnection(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListConnection(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetBer(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_ConnectionServiceWithNotifServicer_to_server(servicer, server): + rpc_method_handlers = { + 'CreateConnection': grpc.unary_unary_rpc_method_handler( + servicer.CreateConnection, + request_deserializer=connectionServiceWithNotif__pb2.Connection.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'ListConnection': grpc.unary_unary_rpc_method_handler( + servicer.ListConnection, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=connectionServiceWithNotif__pb2.ConnectionList.SerializeToString, + ), + 'GetBer': grpc.unary_stream_rpc_method_handler( + servicer.GetBer, + request_deserializer=connectionServiceWithNotif__pb2.Connection.FromString, + response_serializer=connectionServiceWithNotif__pb2.Ber.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'connection.ConnectionServiceWithNotif', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_server.py b/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_server.py new file mode 100644 index 0000000000000000000000000000000000000000..922f91837bc013f038985cbb0ef44aa234556696 --- /dev/null +++ b/hackfest/grpc/connectionServiceWithNotif/connectionServiceWithNotif_server.py @@ -0,0 +1,60 @@ +# 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 concurrent import futures +import time +import logging +import grpc + +import connectionServiceWithNotif_pb2 +import connectionServiceWithNotif_pb2_grpc +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 + +_ONE_DAY_IN_SECONDS = 60 * 60 * 24 + +class connectionServiceWithNotif(connectionServiceWithNotif_pb2_grpc.ConnectionServiceWithNotifServicer): + def __init__(self): + self.connectionList = connectionServiceWithNotif_pb2.ConnectionList() + + def CreateConnection(self, request, context): + logging.debug("Received Connection " + request.connectionId) + self.connectionList.connection.extend([request]) + return google_dot_protobuf_dot_empty__pb2.Empty() + + def ListConnection(self, request, context): + logging.debug("List Connections") + return self.connectionList + def GetBer (self, request, context): + logging.debug("Get Ber") + while True: + time.sleep(5) + ber=connectionServiceWithNotif_pb2.Ber(value=10) + yield ber + + +def serve(): + server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) + connectionServiceWithNotif_pb2_grpc.add_ConnectionServiceWithNotifServicer_to_server(connectionServiceWithNotif(), server) + server.add_insecure_port('[::]:50051') + logging.debug("Starting server") + server.start() + try: + while True: + time.sleep(_ONE_DAY_IN_SECONDS) + except KeyboardInterrupt: + server.stop(0) + +if __name__ == '__main__': + logging.basicConfig(level=logging.DEBUG) + serve() diff --git a/hackfest/grpc/topologyService.proto b/hackfest/grpc/topologyService.proto new file mode 100644 index 0000000000000000000000000000000000000000..775e45addedd8fd30c888ddcd7f3de92a9b66a4b --- /dev/null +++ b/hackfest/grpc/topologyService.proto @@ -0,0 +1,52 @@ +// 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. + +//Example of topology +syntax = "proto3"; +package topology; + +import "google/protobuf/empty.proto"; + +service TopologyService { + rpc GetTopology (google.protobuf.Empty) returns (Topology) {} +} + + +message Link { + string link_id = 1; + string source_node = 2; + string target_node = 3; + string source_port = 4; + string target_port = 5; +} + +message Node { + string node_id = 1; + repeated Port port = 2; +} + +message Port { + string port_id = 1; + enum LayerProtocolName { + ETH = 0; + OPTICAL = 1; + } + LayerProtocolName layerProtocolName = 2; +} + +message Topology { + repeated Node node = 1; + repeated Link link = 2; +} + diff --git a/hackfest/grpc/topologyService/topologyService_client.py b/hackfest/grpc/topologyService/topologyService_client.py new file mode 100644 index 0000000000000000000000000000000000000000..ef628183bed45452f191fc3be07a87db97ed6650 --- /dev/null +++ b/hackfest/grpc/topologyService/topologyService_client.py @@ -0,0 +1,35 @@ +# 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 __future__ import print_function + +import grpc + +import topologyService_pb2 +import topologyService_pb2_grpc +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +try: + raw_input # Python 2 +except NameError: + raw_input = input # Python 3 + + +def getTopology(): + with grpc.insecure_channel('localhost:50051') as channel: + stub = topologyService_pb2_grpc.TopologyServiceStub(channel) + response = stub.GetTopology(google_dot_protobuf_dot_empty__pb2.Empty()) + print("TopologyService client received: " + str(response) ) + +if __name__ == '__main__': + getTopology() diff --git a/hackfest/grpc/topologyService/topologyService_server.py b/hackfest/grpc/topologyService/topologyService_server.py new file mode 100644 index 0000000000000000000000000000000000000000..ff1c80e82a9bf3404c6e9da9b3c0f7c534d01889 --- /dev/null +++ b/hackfest/grpc/topologyService/topologyService_server.py @@ -0,0 +1,62 @@ +# 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 concurrent import futures +import time +import logging +import grpc + +import topologyService_pb2 +import topologyService_pb2_grpc +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 + +_ONE_DAY_IN_SECONDS = 60 * 60 * 24 + +class topologyService(topologyService_pb2_grpc.TopologyServiceServicer): + def __init__(self): + self.topology = topologyService_pb2.Topology() + node1=self.topology.node.add() + node1.node_id = "node1" + portA = node1.port.add() + portA.port_id = "node1portA" + node2=self.topology.node.add() + node2.node_id = "node2" + portB=node2.port.add() + portB.port_id = "node2portA" + link=self.topology.link.add() + link.link_id = "link1" + link.source_node = "node1" + link.target_node = "node2" + link.source_port = "node1portA" + link.target_port = "node2portA" + + def GetTopology(self, request, context): + logging.debug("Get Topology") + return self.topology + +def serve(): + server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) + topologyService_pb2_grpc.add_TopologyServiceServicer_to_server(topologyService(), server) + server.add_insecure_port('[::]:50051') + logging.debug("Starting server") + server.start() + try: + while True: + time.sleep(_ONE_DAY_IN_SECONDS) + except KeyboardInterrupt: + server.stop(0) + +if __name__ == '__main__': + logging.basicConfig(level=logging.DEBUG) + serve() diff --git a/hackfest/kafka/commands.txt b/hackfest/kafka/commands.txt new file mode 100644 index 0000000000000000000000000000000000000000..f29d6020b5fa044b1d60020b30075c763161f31f --- /dev/null +++ b/hackfest/kafka/commands.txt @@ -0,0 +1,27 @@ +== KAFKA +$ cd ~/tfs-ctrl/hackfest/kafka + +(INSTALL) +$ pip3 install kafka-python +$ wget https://ftp.cixug.es/apache/kafka/2.8.0/kafka_2.13-2.8.0.tgz +$ tar -xzf kafka_2.13-2.8.0.tgz +(RUN) +$ cd kafka_2.13-2.8.0 +$ bin/zookeeper-server-start.sh config/zookeeper.properties +(In new window) +$ cd ~/tfs-ctrl/hackfest/kafka/kafka_2.13-2.8.0 +$ bin/kafka-server-start.sh config/server.properties + +CREATE TOPIC +(In new window) +$ cd ~/tfs-ctrl/hackfest/kafka/kafka_2.13-2.8.0 +$ bin/kafka-topics.sh --create --topic my-topic --bootstrap-server localhost:9092 + +(In new window) +$ cd ~/tfs-ctrl/hackfest/kafka +$ python3 sub.py + +(In new window) +$ cd ~/tfs-ctrl/hackfest/kafka +$ python3 pub.py + diff --git a/hackfest/kafka/kafka_2.13-2.8.0.tgz b/hackfest/kafka/kafka_2.13-2.8.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..29538c5ea8fefb4d432e4b7e53d60316d0371629 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0.tgz differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/LICENSE b/hackfest/kafka/kafka_2.13-2.8.0/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..4d8e2c76a41c83859ea80f4e25be9892e98485c9 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/LICENSE @@ -0,0 +1,320 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +------------------------------------------------------------------------------- +This project bundles some components that are also licensed under the Apache +License Version 2.0: + +audience-annotations-0.5.0 +commons-cli-1.4 +commons-lang3-3.8.1 +jackson-annotations-2.10.5 +jackson-core-2.10.5 +jackson-databind-2.10.5.1 +jackson-dataformat-csv-2.10.5 +jackson-datatype-jdk8-2.10.5 +jackson-jaxrs-base-2.10.5 +jackson-jaxrs-json-provider-2.10.5 +jackson-module-jaxb-annotations-2.10.5 +jackson-module-paranamer-2.10.5 +jackson-module-scala_2.13-2.10.5 +jakarta.validation-api-2.0.2 +javassist-3.27.0-GA +jetty-client-9.4.38.v20210224 +jetty-continuation-9.4.38.v20210224 +jetty-http-9.4.38.v20210224 +jetty-io-9.4.38.v20210224 +jetty-security-9.4.38.v20210224 +jetty-server-9.4.38.v20210224 +jetty-servlet-9.4.38.v20210224 +jetty-servlets-9.4.38.v20210224 +jetty-util-9.4.38.v20210224 +jetty-util-ajax-9.4.38.v20210224 +jersey-common-2.31 +jersey-server-2.31 +log4j-1.2.17 +lz4-java-1.7.1 +maven-artifact-3.6.3 +metrics-core-2.2.0 +netty-buffer-4.1.59.Final +netty-codec-4.1.59.Final +netty-common-4.1.59.Final +netty-handler-4.1.59.Final +netty-resolver-4.1.59.Final +netty-transport-4.1.59.Final +netty-transport-native-epoll-4.1.59.Final +netty-transport-native-epoll-4.1.59.Final +netty-transport-native-unix-common-4.1.59.Final +plexus-utils-3.2.1 +rocksdbjni-5.18.4 +scala-collection-compat_2.13-2.3.0 +scala-library-2.13.5 +scala-logging_2.13-3.9.2 +scala-reflect-2.13.5 +scala-java8-compat_2.13-0.9.1 +snappy-java-1.1.8.1 +zookeeper-3.5.9 +zookeeper-jute-3.5.9 + +=============================================================================== +This product bundles various third-party components under other open source +licenses. This section summarizes those components and their licenses. +See licenses/ for text of these licenses. + +--------------------------------------- +Eclipse Distribution License - v 1.0 +see: licenses/eclipse-distribution-license-1.0 + +jakarta.activation-api-1.2.1 +jakarta.xml.bind-api-2.3.2 + +--------------------------------------- +Eclipse Public License - v 2.0 +see: licenses/eclipse-public-license-2.0 + +jakarta.annotation-api-1.3.5 +jakarta.ws.rs-api-2.1.6 +javax.ws.rs-api-2.1.1 +hk2-api-2.6.1 +hk2-locator-2.6.1 +hk2-utils-2.6.1 +osgi-resource-locator-1.0.3 +aopalliance-repackaged-2.6.1 +jakarta.inject-2.6.1 +jersey-container-servlet-2.31 +jersey-container-servlet-core-2.31 +jersey-client-2.31 +jersey-hk2-2.31 +jersey-media-jaxb-2.31 + +--------------------------------------- +CDDL 1.1 + GPLv2 with classpath exception +see: licenses/CDDL+GPL-1.1 + +javax.servlet-api-3.1.0 +jaxb-api-2.3.0 +activation-1.1.1 + +--------------------------------------- +MIT License + +argparse4j-0.7.0, see: licenses/argparse-MIT +jopt-simple-5.0.4, see: licenses/jopt-simple-MIT +slf4j-api-1.7.30, see: licenses/slf4j-MIT +slf4j-log4j12-1.7.30, see: licenses/slf4j-MIT + +--------------------------------------- +BSD 2-Clause + +zstd-jni-1.4.9-1, see: licenses/zstd-jni-BSD-2-clause + +--------------------------------------- +BSD 3-Clause + +paranamer-2.8, see: licenses/paranamer-BSD-3-clause + +--------------------------------------- +Do What The F*ck You Want To Public License +see: licenses/DWTFYWTPL + +reflections-0.9.12 \ No newline at end of file diff --git a/hackfest/kafka/kafka_2.13-2.8.0/NOTICE b/hackfest/kafka/kafka_2.13-2.8.0/NOTICE new file mode 100644 index 0000000000000000000000000000000000000000..674c942b127bb637d086bd9caadb5f152358518c --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/NOTICE @@ -0,0 +1,19 @@ +Apache Kafka +Copyright 2021 The Apache Software Foundation. + +This product includes software developed at +The Apache Software Foundation (https://www.apache.org/). + +This distribution has a binary dependency on jersey, which is available under the CDDL +License. The source code of jersey can be found at https://github.com/jersey/jersey/. + +The streams-scala (streams/streams-scala) module was donated by Lightbend and the original code was copyrighted by them: +Copyright (C) 2018 Lightbend Inc. +Copyright (C) 2017-2018 Alexis Seigneurin. + +This project contains the following code copied from Apache Hadoop: +clients/src/main/java/org/apache/kafka/common/utils/PureJavaCrc32C.java +Some portions of this file Copyright (c) 2004-2006 Intel Corporation and licensed under the BSD license. + +This project contains the following code copied from Apache Hive: +streams/src/main/java/org/apache/kafka/streams/state/internals/Murmur3.java diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/connect-distributed.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/connect-distributed.sh new file mode 100755 index 0000000000000000000000000000000000000000..b8088ad92345137d6861553619ba9843dce2fb5a --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/connect-distributed.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +if [ $# -lt 1 ]; +then + echo "USAGE: $0 [-daemon] connect-distributed.properties" + exit 1 +fi + +base_dir=$(dirname $0) + +if [ "x$KAFKA_LOG4J_OPTS" = "x" ]; then + export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../config/connect-log4j.properties" +fi + +if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then + export KAFKA_HEAP_OPTS="-Xms256M -Xmx2G" +fi + +EXTRA_ARGS=${EXTRA_ARGS-'-name connectDistributed'} + +COMMAND=$1 +case $COMMAND in + -daemon) + EXTRA_ARGS="-daemon "$EXTRA_ARGS + shift + ;; + *) + ;; +esac + +exec $(dirname $0)/kafka-run-class.sh $EXTRA_ARGS org.apache.kafka.connect.cli.ConnectDistributed "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/connect-mirror-maker.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/connect-mirror-maker.sh new file mode 100755 index 0000000000000000000000000000000000000000..8e2b2e162daac7e026c499da03f10ab1b08937a9 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/connect-mirror-maker.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +if [ $# -lt 1 ]; +then + echo "USAGE: $0 [-daemon] mm2.properties" + exit 1 +fi + +base_dir=$(dirname $0) + +if [ "x$KAFKA_LOG4J_OPTS" = "x" ]; then + export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../config/connect-log4j.properties" +fi + +if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then + export KAFKA_HEAP_OPTS="-Xms256M -Xmx2G" +fi + +EXTRA_ARGS=${EXTRA_ARGS-'-name mirrorMaker'} + +COMMAND=$1 +case $COMMAND in + -daemon) + EXTRA_ARGS="-daemon "$EXTRA_ARGS + shift + ;; + *) + ;; +esac + +exec $(dirname $0)/kafka-run-class.sh $EXTRA_ARGS org.apache.kafka.connect.mirror.MirrorMaker "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/connect-standalone.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/connect-standalone.sh new file mode 100755 index 0000000000000000000000000000000000000000..441069fed31393c8469778538e504171a73eb304 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/connect-standalone.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +if [ $# -lt 1 ]; +then + echo "USAGE: $0 [-daemon] connect-standalone.properties" + exit 1 +fi + +base_dir=$(dirname $0) + +if [ "x$KAFKA_LOG4J_OPTS" = "x" ]; then + export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../config/connect-log4j.properties" +fi + +if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then + export KAFKA_HEAP_OPTS="-Xms256M -Xmx2G" +fi + +EXTRA_ARGS=${EXTRA_ARGS-'-name connectStandalone'} + +COMMAND=$1 +case $COMMAND in + -daemon) + EXTRA_ARGS="-daemon "$EXTRA_ARGS + shift + ;; + *) + ;; +esac + +exec $(dirname $0)/kafka-run-class.sh $EXTRA_ARGS org.apache.kafka.connect.cli.ConnectStandalone "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-acls.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-acls.sh new file mode 100755 index 0000000000000000000000000000000000000000..8fa65542e10bfa32e3a9fea7e0ec0d3161d92e92 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-acls.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +exec $(dirname $0)/kafka-run-class.sh kafka.admin.AclCommand "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-broker-api-versions.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-broker-api-versions.sh new file mode 100755 index 0000000000000000000000000000000000000000..4f560a0a60cd599b6a66bc573167dee26d36c67d --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-broker-api-versions.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +exec $(dirname $0)/kafka-run-class.sh kafka.admin.BrokerApiVersionsCommand "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-cluster.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-cluster.sh new file mode 100755 index 0000000000000000000000000000000000000000..574007e9cd4b8ad540a3ab3918d52df195fd90a1 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-cluster.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +exec $(dirname $0)/kafka-run-class.sh kafka.tools.ClusterTool "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-configs.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-configs.sh new file mode 100755 index 0000000000000000000000000000000000000000..2f9eb8c239f596ec8d171f40ddec38a13177a2e8 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-configs.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +exec $(dirname $0)/kafka-run-class.sh kafka.admin.ConfigCommand "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-console-consumer.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-console-consumer.sh new file mode 100755 index 0000000000000000000000000000000000000000..dbaac2b83b1890eeeeb1a19c5831254fe408d788 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-console-consumer.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then + export KAFKA_HEAP_OPTS="-Xmx512M" +fi + +exec $(dirname $0)/kafka-run-class.sh kafka.tools.ConsoleConsumer "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-console-producer.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-console-producer.sh new file mode 100755 index 0000000000000000000000000000000000000000..e5187b8b5335fa2a688f9c18665266731ced0506 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-console-producer.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then + export KAFKA_HEAP_OPTS="-Xmx512M" +fi +exec $(dirname $0)/kafka-run-class.sh kafka.tools.ConsoleProducer "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-consumer-groups.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-consumer-groups.sh new file mode 100755 index 0000000000000000000000000000000000000000..feb063de75693b73d0f874a03d14ce87294df7c5 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-consumer-groups.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +exec $(dirname $0)/kafka-run-class.sh kafka.admin.ConsumerGroupCommand "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-consumer-perf-test.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-consumer-perf-test.sh new file mode 100755 index 0000000000000000000000000000000000000000..77cda721d6c5238d354f3f133bab93c5352edd6a --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-consumer-perf-test.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then + export KAFKA_HEAP_OPTS="-Xmx512M" +fi +exec $(dirname $0)/kafka-run-class.sh kafka.tools.ConsumerPerformance "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-delegation-tokens.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-delegation-tokens.sh new file mode 100755 index 0000000000000000000000000000000000000000..49cb276ab318289f690c6855a326804d2cf720ab --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-delegation-tokens.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +exec $(dirname $0)/kafka-run-class.sh kafka.admin.DelegationTokenCommand "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-delete-records.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-delete-records.sh new file mode 100755 index 0000000000000000000000000000000000000000..8726f919992329db81c4e1b8da6765e34184f1e0 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-delete-records.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +exec $(dirname $0)/kafka-run-class.sh kafka.admin.DeleteRecordsCommand "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-dump-log.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-dump-log.sh new file mode 100755 index 0000000000000000000000000000000000000000..a97ea7d3d9f8cf57b9ea41012ab8c9b92d389d8d --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-dump-log.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +exec $(dirname $0)/kafka-run-class.sh kafka.tools.DumpLogSegments "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-features.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-features.sh new file mode 100755 index 0000000000000000000000000000000000000000..9dd9f16fd1b05568db04418be9c0c99adf8f9324 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-features.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +exec $(dirname $0)/kafka-run-class.sh kafka.admin.FeatureCommand "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-leader-election.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-leader-election.sh new file mode 100755 index 0000000000000000000000000000000000000000..88baef398de95cd1cf737a6d8589d9fdd5a5ac3f --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-leader-election.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +exec $(dirname $0)/kafka-run-class.sh kafka.admin.LeaderElectionCommand "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-log-dirs.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-log-dirs.sh new file mode 100755 index 0000000000000000000000000000000000000000..dc16edcc7c5ebefff42ea3089472560427f25727 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-log-dirs.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +exec $(dirname $0)/kafka-run-class.sh kafka.admin.LogDirsCommand "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-metadata-shell.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-metadata-shell.sh new file mode 100755 index 0000000000000000000000000000000000000000..289f0c1b51f27cd6e93126bc51c81ab4357440db --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-metadata-shell.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +exec $(dirname $0)/kafka-run-class.sh org.apache.kafka.shell.MetadataShell "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-mirror-maker.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-mirror-maker.sh new file mode 100755 index 0000000000000000000000000000000000000000..981f2711af960be2dc2dc3ce2374c6db3303aa1a --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-mirror-maker.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +exec $(dirname $0)/kafka-run-class.sh kafka.tools.MirrorMaker "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-preferred-replica-election.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-preferred-replica-election.sh new file mode 100755 index 0000000000000000000000000000000000000000..638a92ad6e053092f95d0bedc8c6876b31b6bb97 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-preferred-replica-election.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +exec $(dirname $0)/kafka-run-class.sh kafka.admin.PreferredReplicaLeaderElectionCommand "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-producer-perf-test.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-producer-perf-test.sh new file mode 100755 index 0000000000000000000000000000000000000000..73a62888a13d547fe21fc89d41035c775f26026f --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-producer-perf-test.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then + export KAFKA_HEAP_OPTS="-Xmx512M" +fi +exec $(dirname $0)/kafka-run-class.sh org.apache.kafka.tools.ProducerPerformance "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-reassign-partitions.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-reassign-partitions.sh new file mode 100755 index 0000000000000000000000000000000000000000..4c7f1bc35e0a98b2ba978ce07ab9465c841d8b1b --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-reassign-partitions.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +exec $(dirname $0)/kafka-run-class.sh kafka.admin.ReassignPartitionsCommand "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-replica-verification.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-replica-verification.sh new file mode 100755 index 0000000000000000000000000000000000000000..4960836c0d034f338bec16fdb5e7dccc4fa18821 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-replica-verification.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +exec $(dirname $0)/kafka-run-class.sh kafka.tools.ReplicaVerificationTool "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-run-class.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-run-class.sh new file mode 100755 index 0000000000000000000000000000000000000000..3889be7e3e5f8d074cf94938ab9113c2fdb00df1 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-run-class.sh @@ -0,0 +1,331 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +if [ $# -lt 1 ]; +then + echo "USAGE: $0 [-daemon] [-name servicename] [-loggc] classname [opts]" + exit 1 +fi + +# CYGWIN == 1 if Cygwin is detected, else 0. +if [[ $(uname -a) =~ "CYGWIN" ]]; then + CYGWIN=1 +else + CYGWIN=0 +fi + +if [ -z "$INCLUDE_TEST_JARS" ]; then + INCLUDE_TEST_JARS=false +fi + +# Exclude jars not necessary for running commands. +regex="(-(test|test-sources|src|scaladoc|javadoc)\.jar|jar.asc)$" +should_include_file() { + if [ "$INCLUDE_TEST_JARS" = true ]; then + return 0 + fi + file=$1 + if [ -z "$(echo "$file" | egrep "$regex")" ] ; then + return 0 + else + return 1 + fi +} + +base_dir=$(dirname $0)/.. + +if [ -z "$SCALA_VERSION" ]; then + SCALA_VERSION=2.13.5 + if [[ -f "$base_dir/gradle.properties" ]]; then + SCALA_VERSION=`grep "^scalaVersion=" "$base_dir/gradle.properties" | cut -d= -f 2` + fi +fi + +if [ -z "$SCALA_BINARY_VERSION" ]; then + SCALA_BINARY_VERSION=$(echo $SCALA_VERSION | cut -f 1-2 -d '.') +fi + +# run ./gradlew copyDependantLibs to get all dependant jars in a local dir +shopt -s nullglob +if [ -z "$UPGRADE_KAFKA_STREAMS_TEST_VERSION" ]; then + for dir in "$base_dir"/core/build/dependant-libs-${SCALA_VERSION}*; + do + CLASSPATH="$CLASSPATH:$dir/*" + done +fi + +for file in "$base_dir"/examples/build/libs/kafka-examples*.jar; +do + if should_include_file "$file"; then + CLASSPATH="$CLASSPATH":"$file" + fi +done + +if [ -z "$UPGRADE_KAFKA_STREAMS_TEST_VERSION" ]; then + clients_lib_dir=$(dirname $0)/../clients/build/libs + streams_lib_dir=$(dirname $0)/../streams/build/libs + streams_dependant_clients_lib_dir=$(dirname $0)/../streams/build/dependant-libs-${SCALA_VERSION} +else + clients_lib_dir=/opt/kafka-$UPGRADE_KAFKA_STREAMS_TEST_VERSION/libs + streams_lib_dir=$clients_lib_dir + streams_dependant_clients_lib_dir=$streams_lib_dir +fi + + +for file in "$clients_lib_dir"/kafka-clients*.jar; +do + if should_include_file "$file"; then + CLASSPATH="$CLASSPATH":"$file" + fi +done + +for file in "$streams_lib_dir"/kafka-streams*.jar; +do + if should_include_file "$file"; then + CLASSPATH="$CLASSPATH":"$file" + fi +done + +if [ -z "$UPGRADE_KAFKA_STREAMS_TEST_VERSION" ]; then + for file in "$base_dir"/streams/examples/build/libs/kafka-streams-examples*.jar; + do + if should_include_file "$file"; then + CLASSPATH="$CLASSPATH":"$file" + fi + done +else + VERSION_NO_DOTS=`echo $UPGRADE_KAFKA_STREAMS_TEST_VERSION | sed 's/\.//g'` + SHORT_VERSION_NO_DOTS=${VERSION_NO_DOTS:0:((${#VERSION_NO_DOTS} - 1))} # remove last char, ie, bug-fix number + for file in "$base_dir"/streams/upgrade-system-tests-$SHORT_VERSION_NO_DOTS/build/libs/kafka-streams-upgrade-system-tests*.jar; + do + if should_include_file "$file"; then + CLASSPATH="$file":"$CLASSPATH" + fi + done + if [ "$SHORT_VERSION_NO_DOTS" = "0100" ]; then + CLASSPATH="/opt/kafka-$UPGRADE_KAFKA_STREAMS_TEST_VERSION/libs/zkclient-0.8.jar":"$CLASSPATH" + CLASSPATH="/opt/kafka-$UPGRADE_KAFKA_STREAMS_TEST_VERSION/libs/zookeeper-3.4.6.jar":"$CLASSPATH" + fi + if [ "$SHORT_VERSION_NO_DOTS" = "0101" ]; then + CLASSPATH="/opt/kafka-$UPGRADE_KAFKA_STREAMS_TEST_VERSION/libs/zkclient-0.9.jar":"$CLASSPATH" + CLASSPATH="/opt/kafka-$UPGRADE_KAFKA_STREAMS_TEST_VERSION/libs/zookeeper-3.4.8.jar":"$CLASSPATH" + fi +fi + +for file in "$streams_dependant_clients_lib_dir"/rocksdb*.jar; +do + CLASSPATH="$CLASSPATH":"$file" +done + +for file in "$streams_dependant_clients_lib_dir"/*hamcrest*.jar; +do + CLASSPATH="$CLASSPATH":"$file" +done + +for file in "$base_dir"/shell/build/libs/kafka-shell*.jar; +do + if should_include_file "$file"; then + CLASSPATH="$CLASSPATH":"$file" + fi +done + +for dir in "$base_dir"/shell/build/dependant-libs-${SCALA_VERSION}*; +do + CLASSPATH="$CLASSPATH:$dir/*" +done + +for file in "$base_dir"/tools/build/libs/kafka-tools*.jar; +do + if should_include_file "$file"; then + CLASSPATH="$CLASSPATH":"$file" + fi +done + +for dir in "$base_dir"/tools/build/dependant-libs-${SCALA_VERSION}*; +do + CLASSPATH="$CLASSPATH:$dir/*" +done + +for cc_pkg in "api" "transforms" "runtime" "file" "mirror" "mirror-client" "json" "tools" "basic-auth-extension" +do + for file in "$base_dir"/connect/${cc_pkg}/build/libs/connect-${cc_pkg}*.jar; + do + if should_include_file "$file"; then + CLASSPATH="$CLASSPATH":"$file" + fi + done + if [ -d "$base_dir/connect/${cc_pkg}/build/dependant-libs" ] ; then + CLASSPATH="$CLASSPATH:$base_dir/connect/${cc_pkg}/build/dependant-libs/*" + fi +done + +# classpath addition for release +for file in "$base_dir"/libs/*; +do + if should_include_file "$file"; then + CLASSPATH="$CLASSPATH":"$file" + fi +done + +for file in "$base_dir"/core/build/libs/kafka_${SCALA_BINARY_VERSION}*.jar; +do + if should_include_file "$file"; then + CLASSPATH="$CLASSPATH":"$file" + fi +done +shopt -u nullglob + +if [ -z "$CLASSPATH" ] ; then + echo "Classpath is empty. Please build the project first e.g. by running './gradlew jar -PscalaVersion=$SCALA_VERSION'" + exit 1 +fi + +# JMX settings +if [ -z "$KAFKA_JMX_OPTS" ]; then + KAFKA_JMX_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false " +fi + +# JMX port to use +if [ $JMX_PORT ]; then + KAFKA_JMX_OPTS="$KAFKA_JMX_OPTS -Dcom.sun.management.jmxremote.port=$JMX_PORT " +fi + +# Log directory to use +if [ "x$LOG_DIR" = "x" ]; then + LOG_DIR="$base_dir/logs" +fi + +# Log4j settings +if [ -z "$KAFKA_LOG4J_OPTS" ]; then + # Log to console. This is a tool. + LOG4J_DIR="$base_dir/config/tools-log4j.properties" + # If Cygwin is detected, LOG4J_DIR is converted to Windows format. + (( CYGWIN )) && LOG4J_DIR=$(cygpath --path --mixed "${LOG4J_DIR}") + KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:${LOG4J_DIR}" +else + # create logs directory + if [ ! -d "$LOG_DIR" ]; then + mkdir -p "$LOG_DIR" + fi +fi + +# If Cygwin is detected, LOG_DIR is converted to Windows format. +(( CYGWIN )) && LOG_DIR=$(cygpath --path --mixed "${LOG_DIR}") +KAFKA_LOG4J_OPTS="-Dkafka.logs.dir=$LOG_DIR $KAFKA_LOG4J_OPTS" + +# Generic jvm settings you want to add +if [ -z "$KAFKA_OPTS" ]; then + KAFKA_OPTS="" +fi + +# Set Debug options if enabled +if [ "x$KAFKA_DEBUG" != "x" ]; then + + # Use default ports + DEFAULT_JAVA_DEBUG_PORT="5005" + + if [ -z "$JAVA_DEBUG_PORT" ]; then + JAVA_DEBUG_PORT="$DEFAULT_JAVA_DEBUG_PORT" + fi + + # Use the defaults if JAVA_DEBUG_OPTS was not set + DEFAULT_JAVA_DEBUG_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=${DEBUG_SUSPEND_FLAG:-n},address=$JAVA_DEBUG_PORT" + if [ -z "$JAVA_DEBUG_OPTS" ]; then + JAVA_DEBUG_OPTS="$DEFAULT_JAVA_DEBUG_OPTS" + fi + + echo "Enabling Java debug options: $JAVA_DEBUG_OPTS" + KAFKA_OPTS="$JAVA_DEBUG_OPTS $KAFKA_OPTS" +fi + +# Which java to use +if [ -z "$JAVA_HOME" ]; then + JAVA="java" +else + JAVA="$JAVA_HOME/bin/java" +fi + +# Memory options +if [ -z "$KAFKA_HEAP_OPTS" ]; then + KAFKA_HEAP_OPTS="-Xmx256M" +fi + +# JVM performance options +# MaxInlineLevel=15 is the default since JDK 14 and can be removed once older JDKs are no longer supported +if [ -z "$KAFKA_JVM_PERFORMANCE_OPTS" ]; then + KAFKA_JVM_PERFORMANCE_OPTS="-server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+ExplicitGCInvokesConcurrent -XX:MaxInlineLevel=15 -Djava.awt.headless=true" +fi + +while [ $# -gt 0 ]; do + COMMAND=$1 + case $COMMAND in + -name) + DAEMON_NAME=$2 + CONSOLE_OUTPUT_FILE=$LOG_DIR/$DAEMON_NAME.out + shift 2 + ;; + -loggc) + if [ -z "$KAFKA_GC_LOG_OPTS" ]; then + GC_LOG_ENABLED="true" + fi + shift + ;; + -daemon) + DAEMON_MODE="true" + shift + ;; + *) + break + ;; + esac +done + +# GC options +GC_FILE_SUFFIX='-gc.log' +GC_LOG_FILE_NAME='' +if [ "x$GC_LOG_ENABLED" = "xtrue" ]; then + GC_LOG_FILE_NAME=$DAEMON_NAME$GC_FILE_SUFFIX + + # The first segment of the version number, which is '1' for releases before Java 9 + # it then becomes '9', '10', ... + # Some examples of the first line of `java --version`: + # 8 -> java version "1.8.0_152" + # 9.0.4 -> java version "9.0.4" + # 10 -> java version "10" 2018-03-20 + # 10.0.1 -> java version "10.0.1" 2018-04-17 + # We need to match to the end of the line to prevent sed from printing the characters that do not match + JAVA_MAJOR_VERSION=$("$JAVA" -version 2>&1 | sed -E -n 's/.* version "([0-9]*).*$/\1/p') + if [[ "$JAVA_MAJOR_VERSION" -ge "9" ]] ; then + KAFKA_GC_LOG_OPTS="-Xlog:gc*:file=$LOG_DIR/$GC_LOG_FILE_NAME:time,tags:filecount=10,filesize=100M" + else + KAFKA_GC_LOG_OPTS="-Xloggc:$LOG_DIR/$GC_LOG_FILE_NAME -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M" + fi +fi + +# Remove a possible colon prefix from the classpath (happens at lines like `CLASSPATH="$CLASSPATH:$file"` when CLASSPATH is blank) +# Syntax used on the right side is native Bash string manipulation; for more details see +# http://tldp.org/LDP/abs/html/string-manipulation.html, specifically the section titled "Substring Removal" +CLASSPATH=${CLASSPATH#:} + +# If Cygwin is detected, classpath is converted to Windows format. +(( CYGWIN )) && CLASSPATH=$(cygpath --path --mixed "${CLASSPATH}") + +# Launch mode +if [ "x$DAEMON_MODE" = "xtrue" ]; then + nohup "$JAVA" $KAFKA_HEAP_OPTS $KAFKA_JVM_PERFORMANCE_OPTS $KAFKA_GC_LOG_OPTS $KAFKA_JMX_OPTS $KAFKA_LOG4J_OPTS -cp "$CLASSPATH" $KAFKA_OPTS "$@" > "$CONSOLE_OUTPUT_FILE" 2>&1 < /dev/null & +else + exec "$JAVA" $KAFKA_HEAP_OPTS $KAFKA_JVM_PERFORMANCE_OPTS $KAFKA_GC_LOG_OPTS $KAFKA_JMX_OPTS $KAFKA_LOG4J_OPTS -cp "$CLASSPATH" $KAFKA_OPTS "$@" +fi diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-server-start.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-server-start.sh new file mode 100755 index 0000000000000000000000000000000000000000..5a53126172de9d024891942d9f4748b7fcd4592b --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-server-start.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +if [ $# -lt 1 ]; +then + echo "USAGE: $0 [-daemon] server.properties [--override property=value]*" + exit 1 +fi +base_dir=$(dirname $0) + +if [ "x$KAFKA_LOG4J_OPTS" = "x" ]; then + export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../config/log4j.properties" +fi + +if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then + export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G" +fi + +EXTRA_ARGS=${EXTRA_ARGS-'-name kafkaServer -loggc'} + +COMMAND=$1 +case $COMMAND in + -daemon) + EXTRA_ARGS="-daemon "$EXTRA_ARGS + shift + ;; + *) + ;; +esac + +exec $base_dir/kafka-run-class.sh $EXTRA_ARGS kafka.Kafka "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-server-stop.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-server-stop.sh new file mode 100755 index 0000000000000000000000000000000000000000..437189f4a5b4ca92579f5803762e392eb31bb6f7 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-server-stop.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. +SIGNAL=${SIGNAL:-TERM} + +OSNAME=$(uname -s) +if [[ "$OSNAME" == "OS/390" ]]; then + if [ -z $JOBNAME ]; then + JOBNAME="KAFKSTRT" + fi + PIDS=$(ps -A -o pid,jobname,comm | grep -i $JOBNAME | grep java | grep -v grep | awk '{print $1}') +elif [[ "$OSNAME" == "OS400" ]]; then + PIDS=$(ps -Af | grep -i 'kafka\.Kafka' | grep java | grep -v grep | awk '{print $2}') +else + PIDS=$(ps ax | grep ' kafka\.Kafka ' | grep java | grep -v grep | awk '{print $1}') +fi + +if [ -z "$PIDS" ]; then + echo "No kafka server to stop" + exit 1 +else + kill -s $SIGNAL $PIDS +fi diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-storage.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-storage.sh new file mode 100755 index 0000000000000000000000000000000000000000..eef93423877f02afe15e9a517f76d700baba522d --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-storage.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +exec $(dirname $0)/kafka-run-class.sh kafka.tools.StorageTool "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-streams-application-reset.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-streams-application-reset.sh new file mode 100755 index 0000000000000000000000000000000000000000..336373254004ea9b2027082b1efcedbf9ab8ddd4 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-streams-application-reset.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then + export KAFKA_HEAP_OPTS="-Xmx512M" +fi + +exec $(dirname $0)/kafka-run-class.sh kafka.tools.StreamsResetter "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-topics.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-topics.sh new file mode 100755 index 0000000000000000000000000000000000000000..ad6a2d4d2a0160c0fba70820a70a6f6d208b5ca7 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-topics.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +exec $(dirname $0)/kafka-run-class.sh kafka.admin.TopicCommand "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-verifiable-consumer.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-verifiable-consumer.sh new file mode 100755 index 0000000000000000000000000000000000000000..852847df03ba5cfe420d9337d5c76f810383092f --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-verifiable-consumer.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then + export KAFKA_HEAP_OPTS="-Xmx512M" +fi +exec $(dirname $0)/kafka-run-class.sh org.apache.kafka.tools.VerifiableConsumer "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-verifiable-producer.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-verifiable-producer.sh new file mode 100755 index 0000000000000000000000000000000000000000..b59bae7d2beae882715ce5b8cf83fe8ef3e3acf0 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/kafka-verifiable-producer.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then + export KAFKA_HEAP_OPTS="-Xmx512M" +fi +exec $(dirname $0)/kafka-run-class.sh org.apache.kafka.tools.VerifiableProducer "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/trogdor.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/trogdor.sh new file mode 100755 index 0000000000000000000000000000000000000000..3324c4ea8ec3e7ae8d687d67250d8bfd71ec98cf --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/trogdor.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +usage() { + cat <nul 2>&1 + IF NOT ERRORLEVEL 1 ( + rem 32-bit OS + set KAFKA_HEAP_OPTS=-Xmx512M -Xms512M + ) ELSE ( + rem 64-bit OS + set KAFKA_HEAP_OPTS=-Xmx1G -Xms1G + ) +) +"%~dp0kafka-run-class.bat" kafka.Kafka %* +EndLocal diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/windows/kafka-server-stop.bat b/hackfest/kafka/kafka_2.13-2.8.0/bin/windows/kafka-server-stop.bat new file mode 100644 index 0000000000000000000000000000000000000000..676577cf958645fde5ec95cb521f7e02f1616099 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/windows/kafka-server-stop.bat @@ -0,0 +1,18 @@ +@echo off +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +wmic process where (commandline like "%%kafka.Kafka%%" and not name="wmic.exe") delete +rem ps ax | grep -i 'kafka.Kafka' | grep -v grep | awk '{print $1}' | xargs kill -SIGTERM diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/windows/kafka-streams-application-reset.bat b/hackfest/kafka/kafka_2.13-2.8.0/bin/windows/kafka-streams-application-reset.bat new file mode 100644 index 0000000000000000000000000000000000000000..1cfb6f518c824e0e77db2272ef65ca0d49662e21 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/windows/kafka-streams-application-reset.bat @@ -0,0 +1,23 @@ +@echo off +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +SetLocal +IF ["%KAFKA_HEAP_OPTS%"] EQU [""] ( + set KAFKA_HEAP_OPTS=-Xmx512M +) + +"%~dp0kafka-run-class.bat" kafka.tools.StreamsResetter %* +EndLocal diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/windows/kafka-topics.bat b/hackfest/kafka/kafka_2.13-2.8.0/bin/windows/kafka-topics.bat new file mode 100644 index 0000000000000000000000000000000000000000..677b09d077d99691b8b1f0197f2e4a3676e4b27b --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/windows/kafka-topics.bat @@ -0,0 +1,17 @@ +@echo off +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +"%~dp0kafka-run-class.bat" kafka.admin.TopicCommand %* diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/windows/zookeeper-server-start.bat b/hackfest/kafka/kafka_2.13-2.8.0/bin/windows/zookeeper-server-start.bat new file mode 100644 index 0000000000000000000000000000000000000000..f201a585135d2db55a15d8e45004feb6a536fe7f --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/windows/zookeeper-server-start.bat @@ -0,0 +1,30 @@ +@echo off +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +IF [%1] EQU [] ( + echo USAGE: %0 zookeeper.properties + EXIT /B 1 +) + +SetLocal +IF ["%KAFKA_LOG4J_OPTS%"] EQU [""] ( + set KAFKA_LOG4J_OPTS=-Dlog4j.configuration=file:%~dp0../../config/log4j.properties +) +IF ["%KAFKA_HEAP_OPTS%"] EQU [""] ( + set KAFKA_HEAP_OPTS=-Xmx512M -Xms512M +) +"%~dp0kafka-run-class.bat" org.apache.zookeeper.server.quorum.QuorumPeerMain %* +EndLocal diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/windows/zookeeper-server-stop.bat b/hackfest/kafka/kafka_2.13-2.8.0/bin/windows/zookeeper-server-stop.bat new file mode 100644 index 0000000000000000000000000000000000000000..8b57dd8d63069ef579e7f41a60bba71f1018e29d --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/windows/zookeeper-server-stop.bat @@ -0,0 +1,17 @@ +@echo off +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +wmic process where (commandline like "%%zookeeper%%" and not name="wmic.exe") delete diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/windows/zookeeper-shell.bat b/hackfest/kafka/kafka_2.13-2.8.0/bin/windows/zookeeper-shell.bat new file mode 100644 index 0000000000000000000000000000000000000000..f1c86c430c1709744a0f31acbc70706dc27cfbec --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/windows/zookeeper-shell.bat @@ -0,0 +1,22 @@ +@echo off +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +IF [%1] EQU [] ( + echo USAGE: %0 zookeeper_host:port[/path] [-zk-tls-config-file file] [args...] + EXIT /B 1 +) + +"%~dp0kafka-run-class.bat" org.apache.zookeeper.ZooKeeperMainWithTlsSupportForKafka -server %* diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/zookeeper-security-migration.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/zookeeper-security-migration.sh new file mode 100755 index 0000000000000000000000000000000000000000..722bde7cc4c621cf8f7f7279397f7776fb66eff9 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/zookeeper-security-migration.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +exec $(dirname $0)/kafka-run-class.sh kafka.admin.ZkSecurityMigrator "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/zookeeper-server-start.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/zookeeper-server-start.sh new file mode 100755 index 0000000000000000000000000000000000000000..bd9c1142817c082b19b1c71cc39fb0149ed7dba1 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/zookeeper-server-start.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +if [ $# -lt 1 ]; +then + echo "USAGE: $0 [-daemon] zookeeper.properties" + exit 1 +fi +base_dir=$(dirname $0) + +if [ "x$KAFKA_LOG4J_OPTS" = "x" ]; then + export KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/../config/log4j.properties" +fi + +if [ "x$KAFKA_HEAP_OPTS" = "x" ]; then + export KAFKA_HEAP_OPTS="-Xmx512M -Xms512M" +fi + +EXTRA_ARGS=${EXTRA_ARGS-'-name zookeeper -loggc'} + +COMMAND=$1 +case $COMMAND in + -daemon) + EXTRA_ARGS="-daemon "$EXTRA_ARGS + shift + ;; + *) + ;; +esac + +exec $base_dir/kafka-run-class.sh $EXTRA_ARGS org.apache.zookeeper.server.quorum.QuorumPeerMain "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/zookeeper-server-stop.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/zookeeper-server-stop.sh new file mode 100755 index 0000000000000000000000000000000000000000..11665f32707f872698de907ea3580db83d427d14 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/zookeeper-server-stop.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. +SIGNAL=${SIGNAL:-TERM} + +OSNAME=$(uname -s) +if [[ "$OSNAME" == "OS/390" ]]; then + if [ -z $JOBNAME ]; then + JOBNAME="ZKEESTRT" + fi + PIDS=$(ps -A -o pid,jobname,comm | grep -i $JOBNAME | grep java | grep -v grep | awk '{print $1}') +elif [[ "$OSNAME" == "OS400" ]]; then + PIDS=$(ps -Af | grep java | grep -i QuorumPeerMain | grep -v grep | awk '{print $2}') +else + PIDS=$(ps ax | grep java | grep -i QuorumPeerMain | grep -v grep | awk '{print $1}') +fi + +if [ -z "$PIDS" ]; then + echo "No zookeeper server to stop" + exit 1 +else + kill -s $SIGNAL $PIDS +fi diff --git a/hackfest/kafka/kafka_2.13-2.8.0/bin/zookeeper-shell.sh b/hackfest/kafka/kafka_2.13-2.8.0/bin/zookeeper-shell.sh new file mode 100755 index 0000000000000000000000000000000000000000..2f1d0f2c61670a56f89cb62c52a1a3373fafeab1 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/bin/zookeeper-shell.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +if [ $# -lt 1 ]; +then + echo "USAGE: $0 zookeeper_host:port[/path] [-zk-tls-config-file file] [args...]" + exit 1 +fi + +exec $(dirname $0)/kafka-run-class.sh org.apache.zookeeper.ZooKeeperMainWithTlsSupportForKafka -server "$@" diff --git a/hackfest/kafka/kafka_2.13-2.8.0/config/connect-console-sink.properties b/hackfest/kafka/kafka_2.13-2.8.0/config/connect-console-sink.properties new file mode 100644 index 0000000000000000000000000000000000000000..e240a8f0dd8dd41b22c77fc80671e6ece995dba4 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/config/connect-console-sink.properties @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +name=local-console-sink +connector.class=org.apache.kafka.connect.file.FileStreamSinkConnector +tasks.max=1 +topics=connect-test \ No newline at end of file diff --git a/hackfest/kafka/kafka_2.13-2.8.0/config/connect-console-source.properties b/hackfest/kafka/kafka_2.13-2.8.0/config/connect-console-source.properties new file mode 100644 index 0000000000000000000000000000000000000000..d0e20690e7c6446c7a8e6de8d47b17148fb9a0cf --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/config/connect-console-source.properties @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +name=local-console-source +connector.class=org.apache.kafka.connect.file.FileStreamSourceConnector +tasks.max=1 +topic=connect-test \ No newline at end of file diff --git a/hackfest/kafka/kafka_2.13-2.8.0/config/connect-distributed.properties b/hackfest/kafka/kafka_2.13-2.8.0/config/connect-distributed.properties new file mode 100644 index 0000000000000000000000000000000000000000..72db145f3f892fb9eee72f94e2bee4b78f36a196 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/config/connect-distributed.properties @@ -0,0 +1,86 @@ +## +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## + +# This file contains some of the configurations for the Kafka Connect distributed worker. This file is intended +# to be used with the examples, and some settings may differ from those used in a production system, especially +# the `bootstrap.servers` and those specifying replication factors. + +# A list of host/port pairs to use for establishing the initial connection to the Kafka cluster. +bootstrap.servers=localhost:9092 + +# unique name for the cluster, used in forming the Connect cluster group. Note that this must not conflict with consumer group IDs +group.id=connect-cluster + +# The converters specify the format of data in Kafka and how to translate it into Connect data. Every Connect user will +# need to configure these based on the format they want their data in when loaded from or stored into Kafka +key.converter=org.apache.kafka.connect.json.JsonConverter +value.converter=org.apache.kafka.connect.json.JsonConverter +# Converter-specific settings can be passed in by prefixing the Converter's setting with the converter we want to apply +# it to +key.converter.schemas.enable=true +value.converter.schemas.enable=true + +# Topic to use for storing offsets. This topic should have many partitions and be replicated and compacted. +# Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create +# the topic before starting Kafka Connect if a specific topic configuration is needed. +# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value. +# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able +# to run this example on a single-broker cluster and so here we instead set the replication factor to 1. +offset.storage.topic=connect-offsets +offset.storage.replication.factor=1 +#offset.storage.partitions=25 + +# Topic to use for storing connector and task configurations; note that this should be a single partition, highly replicated, +# and compacted topic. Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create +# the topic before starting Kafka Connect if a specific topic configuration is needed. +# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value. +# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able +# to run this example on a single-broker cluster and so here we instead set the replication factor to 1. +config.storage.topic=connect-configs +config.storage.replication.factor=1 + +# Topic to use for storing statuses. This topic can have multiple partitions and should be replicated and compacted. +# Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create +# the topic before starting Kafka Connect if a specific topic configuration is needed. +# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value. +# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able +# to run this example on a single-broker cluster and so here we instead set the replication factor to 1. +status.storage.topic=connect-status +status.storage.replication.factor=1 +#status.storage.partitions=5 + +# Flush much faster than normal, which is useful for testing/debugging +offset.flush.interval.ms=10000 + +# These are provided to inform the user about the presence of the REST host and port configs +# Hostname & Port for the REST API to listen on. If this is set, it will bind to the interface used to listen to requests. +#rest.host.name= +#rest.port=8083 + +# The Hostname & Port that will be given out to other workers to connect to i.e. URLs that are routable from other servers. +#rest.advertised.host.name= +#rest.advertised.port= + +# Set to a list of filesystem paths separated by commas (,) to enable class loading isolation for plugins +# (connectors, converters, transformations). The list should consist of top level directories that include +# any combination of: +# a) directories immediately containing jars with plugins and their dependencies +# b) uber-jars with plugins and their dependencies +# c) directories immediately containing the package directory structure of classes of plugins and their dependencies +# Examples: +# plugin.path=/usr/local/share/java,/usr/local/share/kafka/plugins,/opt/connectors, +#plugin.path= diff --git a/hackfest/kafka/kafka_2.13-2.8.0/config/connect-file-sink.properties b/hackfest/kafka/kafka_2.13-2.8.0/config/connect-file-sink.properties new file mode 100644 index 0000000000000000000000000000000000000000..594ccc6e953c5494a9ac8958b848a267e1631dd8 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/config/connect-file-sink.properties @@ -0,0 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +name=local-file-sink +connector.class=FileStreamSink +tasks.max=1 +file=test.sink.txt +topics=connect-test \ No newline at end of file diff --git a/hackfest/kafka/kafka_2.13-2.8.0/config/connect-file-source.properties b/hackfest/kafka/kafka_2.13-2.8.0/config/connect-file-source.properties new file mode 100644 index 0000000000000000000000000000000000000000..599cf4cb2ac79e7c015f6e7b78fd8eb037cb2091 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/config/connect-file-source.properties @@ -0,0 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +name=local-file-source +connector.class=FileStreamSource +tasks.max=1 +file=test.txt +topic=connect-test \ No newline at end of file diff --git a/hackfest/kafka/kafka_2.13-2.8.0/config/connect-log4j.properties b/hackfest/kafka/kafka_2.13-2.8.0/config/connect-log4j.properties new file mode 100644 index 0000000000000000000000000000000000000000..f695e37eb348b6efa6752e28fbbe0ae67f4d68c5 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/config/connect-log4j.properties @@ -0,0 +1,43 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +log4j.rootLogger=INFO, stdout, connectAppender + +# Send the logs to the console. +# +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout + +# Send the logs to a file, rolling the file at midnight local time. For example, the `File` option specifies the +# location of the log files (e.g. ${kafka.logs.dir}/connect.log), and at midnight local time the file is closed +# and copied in the same directory but with a filename that ends in the `DatePattern` option. +# +log4j.appender.connectAppender=org.apache.log4j.DailyRollingFileAppender +log4j.appender.connectAppender.DatePattern='.'yyyy-MM-dd-HH +log4j.appender.connectAppender.File=${kafka.logs.dir}/connect.log +log4j.appender.connectAppender.layout=org.apache.log4j.PatternLayout + +# The `%X{connector.context}` parameter in the layout includes connector-specific and task-specific information +# in the log message, where appropriate. This makes it easier to identify those log messages that apply to a +# specific connector. Simply add this parameter to the log layout configuration below to include the contextual information. +# +connect.log.pattern=[%d] %p %m (%c:%L)%n +#connect.log.pattern=[%d] %p %X{connector.context}%m (%c:%L)%n + +log4j.appender.stdout.layout.ConversionPattern=${connect.log.pattern} +log4j.appender.connectAppender.layout.ConversionPattern=${connect.log.pattern} + +log4j.logger.org.apache.zookeeper=ERROR +log4j.logger.org.reflections=ERROR diff --git a/hackfest/kafka/kafka_2.13-2.8.0/config/connect-mirror-maker.properties b/hackfest/kafka/kafka_2.13-2.8.0/config/connect-mirror-maker.properties new file mode 100644 index 0000000000000000000000000000000000000000..40afda5e4ad68d3c76345d63b4b5bb1d4a4bf301 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/config/connect-mirror-maker.properties @@ -0,0 +1,59 @@ +# Licensed to the Apache Software Foundation (ASF) under A or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. +# see org.apache.kafka.clients.consumer.ConsumerConfig for more details + +# Sample MirrorMaker 2.0 top-level configuration file +# Run with ./bin/connect-mirror-maker.sh connect-mirror-maker.properties + +# specify any number of cluster aliases +clusters = A, B + +# connection information for each cluster +# This is a comma separated host:port pairs for each cluster +# for e.g. "A_host1:9092, A_host2:9092, A_host3:9092" +A.bootstrap.servers = A_host1:9092, A_host2:9092, A_host3:9092 +B.bootstrap.servers = B_host1:9092, B_host2:9092, B_host3:9092 + +# enable and configure individual replication flows +A->B.enabled = true + +# regex which defines which topics gets replicated. For eg "foo-.*" +A->B.topics = .* + +B->A.enabled = true +B->A.topics = .* + +# Setting replication factor of newly created remote topics +replication.factor=1 + +############################# Internal Topic Settings ############################# +# The replication factor for mm2 internal topics "heartbeats", "B.checkpoints.internal" and +# "mm2-offset-syncs.B.internal" +# For anything other than development testing, a value greater than 1 is recommended to ensure availability such as 3. +checkpoints.topic.replication.factor=1 +heartbeats.topic.replication.factor=1 +offset-syncs.topic.replication.factor=1 + +# The replication factor for connect internal topics "mm2-configs.B.internal", "mm2-offsets.B.internal" and +# "mm2-status.B.internal" +# For anything other than development testing, a value greater than 1 is recommended to ensure availability such as 3. +offset.storage.replication.factor=1 +status.storage.replication.factor=1 +config.storage.replication.factor=1 + +# customize as needed +# replication.policy.separator = _ +# sync.topic.acls.enabled = false +# emit.heartbeats.interval.seconds = 5 diff --git a/hackfest/kafka/kafka_2.13-2.8.0/config/connect-standalone.properties b/hackfest/kafka/kafka_2.13-2.8.0/config/connect-standalone.properties new file mode 100644 index 0000000000000000000000000000000000000000..a340a3bf315cc76d1bf5aae1e62932ebd5faf792 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/config/connect-standalone.properties @@ -0,0 +1,41 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +# These are defaults. This file just demonstrates how to override some settings. +bootstrap.servers=localhost:9092 + +# The converters specify the format of data in Kafka and how to translate it into Connect data. Every Connect user will +# need to configure these based on the format they want their data in when loaded from or stored into Kafka +key.converter=org.apache.kafka.connect.json.JsonConverter +value.converter=org.apache.kafka.connect.json.JsonConverter +# Converter-specific settings can be passed in by prefixing the Converter's setting with the converter we want to apply +# it to +key.converter.schemas.enable=true +value.converter.schemas.enable=true + +offset.storage.file.filename=/tmp/connect.offsets +# Flush much faster than normal, which is useful for testing/debugging +offset.flush.interval.ms=10000 + +# Set to a list of filesystem paths separated by commas (,) to enable class loading isolation for plugins +# (connectors, converters, transformations). The list should consist of top level directories that include +# any combination of: +# a) directories immediately containing jars with plugins and their dependencies +# b) uber-jars with plugins and their dependencies +# c) directories immediately containing the package directory structure of classes of plugins and their dependencies +# Note: symlinks will be followed to discover dependencies or plugins. +# Examples: +# plugin.path=/usr/local/share/java,/usr/local/share/kafka/plugins,/opt/connectors, +#plugin.path= diff --git a/hackfest/kafka/kafka_2.13-2.8.0/config/consumer.properties b/hackfest/kafka/kafka_2.13-2.8.0/config/consumer.properties new file mode 100644 index 0000000000000000000000000000000000000000..01bb12eb0899f43945307afeba09e6b96013defa --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/config/consumer.properties @@ -0,0 +1,26 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. +# see org.apache.kafka.clients.consumer.ConsumerConfig for more details + +# list of brokers used for bootstrapping knowledge about the rest of the cluster +# format: host1:port1,host2:port2 ... +bootstrap.servers=localhost:9092 + +# consumer group id +group.id=test-consumer-group + +# What to do when there is no initial offset in Kafka or if the current +# offset does not exist any more on the server: latest, earliest, none +#auto.offset.reset= diff --git a/hackfest/kafka/kafka_2.13-2.8.0/config/kraft/README.md b/hackfest/kafka/kafka_2.13-2.8.0/config/kraft/README.md new file mode 100644 index 0000000000000000000000000000000000000000..466dbe08e193c55e2c64d77fb6284e51fddb0fec --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/config/kraft/README.md @@ -0,0 +1,178 @@ +KRaft (aka KIP-500) mode Early Access Release +========================================================= + +# Introduction +It is now possible to run Apache Kafka without Apache ZooKeeper! We call this the [Kafka Raft metadata mode](https://cwiki.apache.org/confluence/display/KAFKA/KIP-500%3A+Replace+ZooKeeper+with+a+Self-Managed+Metadata+Quorum), typically shortened to `KRaft mode`. +`KRaft` is intended to be pronounced like `craft` (as in `craftsmanship`). It is currently *EARLY ACCESS AND SHOULD NOT BE USED IN PRODUCTION*, but it +is available for testing in the Kafka 2.8 release. + +When the Kafka cluster is in KRaft mode, it does not store its metadata in ZooKeeper. In fact, you do not have to run ZooKeeper at all, because it stores its metadata in a KRaft quorum of controller nodes. + +KRaft mode has many benefits -- some obvious, and some not so obvious. Clearly, it is nice to manage and configure one service rather than two services. In addition, you can now run a single process Kafka cluster. +Most important of all, KRaft mode is more scalable. We expect to be able to [support many more topics and partitions](https://www.confluent.io/kafka-summit-san-francisco-2019/kafka-needs-no-keeper/) in this mode. + +# Quickstart + +## Warning +KRaft mode in Kafka 2.8 is provided for testing only, *NOT* for production. We do not yet support upgrading existing ZooKeeper-based Kafka clusters into this mode. In fact, when Kafka 3.0 is released, +it will not be possible to upgrade your KRaft clusters from 2.8 to 3.0. There may be bugs, including serious ones. You should *assume that your data could be lost at any time* if you try the early access release of KRaft mode. + +## Generate a cluster ID +The first step is to generate an ID for your new cluster, using the kafka-storage tool: + +~~~~ +$ ./bin/kafka-storage.sh random-uuid +xtzWWN4bTjitpL3kfd9s5g +~~~~ + +## Format Storage Directories +The next step is to format your storage directories. If you are running in single-node mode, you can do this with one command: + +~~~~ +$ ./bin/kafka-storage.sh format -t -c ./config/kraft/server.properties +Formatting /tmp/kraft-combined-logs +~~~~ + +If you are using multiple nodes, then you should run the format command on each node. Be sure to use the same cluster ID for each one. + +## Start the Kafka Server +Finally, you are ready to start the Kafka server on each node. + +~~~~ +$ ./bin/kafka-server-start.sh ./config/kraft/server.properties +[2021-02-26 15:37:11,071] INFO Registered kafka:type=kafka.Log4jController MBean (kafka.utils.Log4jControllerRegistration$) +[2021-02-26 15:37:11,294] INFO Setting -D jdk.tls.rejectClientInitiatedRenegotiation=true to disable client-initiated TLS renegotiation (org.apache.zookeeper.common.X509Util) +[2021-02-26 15:37:11,466] INFO [Log partition=@metadata-0, dir=/tmp/kraft-combined-logs] Loading producer state till offset 0 with message format version 2 (kafka.log.Log) +[2021-02-26 15:37:11,509] INFO [raft-expiration-reaper]: Starting (kafka.raft.TimingWheelExpirationService$ExpiredOperationReaper) +[2021-02-26 15:37:11,640] INFO [RaftManager nodeId=1] Completed transition to Unattached(epoch=0, voters=[1], electionTimeoutMs=9037) (org.apache.kafka.raft.QuorumState) +... +~~~~ + +Just like with a ZooKeeper based broker, you can connect to port 9092 (or whatever port you configured) to perform administrative operations or produce or consume data. + +~~~~ +$ ./bin/kafka-topics.sh --create --topic foo --partitions 1 --replication-factor 1 --bootstrap-server localhost:9092 +Created topic foo. +~~~~ + +# Deployment + +## Controller Servers +In KRaft mode, only a small group of specially selected servers can act as controllers (unlike the ZooKeeper-based mode, where any server can become the +Controller). The specially selected controller servers will participate in the metadata quorum. Each controller server is either active, or a hot +standby for the current active controller server. + +You will typically select 3 or 5 servers for this role, depending on factors like cost and the number of concurrent failures your system should withstand +without availability impact. Just like with ZooKeeper, you must keep a majority of the controllers alive in order to maintain availability. So if you have 3 +controllers, you can tolerate 1 failure; with 5 controllers, you can tolerate 2 failures. + +## Process Roles +Each Kafka server now has a new configuration key called `process.roles` which can have the following values: + +* If `process.roles` is set to `broker`, the server acts as a broker in KRaft mode. +* If `process.roles` is set to `controller`, the server acts as a controller in KRaft mode. +* If `process.roles` is set to `broker,controller`, the server acts as both a broker and a controller in KRaft mode. +* If `process.roles` is not set at all then we are assumed to be in ZooKeeper mode. As mentioned earlier, you can't currently transition back and forth between ZooKeeper mode and KRaft mode without reformatting. + +Nodes that act as both brokers and controllers are referred to as "combined" nodes. Combined nodes are simpler to operate for simple use cases and allow you to avoid +some fixed memory overheads associated with JVMs. The key disadvantage is that the controller will be less isolated from the rest of the system. For example, if activity on the broker causes an out of +memory condition, the controller part of the server is not isolated from that OOM condition. + +## Quorum Voters +All nodes in the system must set the `controller.quorum.voters` configuration. This identifies the quorum controller servers that should be used. All the controllers must be enumerated. +This is similar to how, when using ZooKeeper, the `zookeeper.connect` configuration must contain all the ZooKeeper servers. Unlike with the ZooKeeper config, however, `controller.quorum.voters` +also has IDs for each node. The format is id1@host1:port1,id2@host2:port2, etc. + +So if you have 10 brokers and 3 controllers named controller1, controller2, controller3, you might have the following configuration on controller1: +``` +process.roles=controller +node.id=1 +listeners=CONTROLLER://controller1.example.com:9093 +controller.quorum.voters=1@controller1.example.com:9093,2@controller2.example.com:9093,3@controller3.example.com:9093 +``` + +Each broker and each controller must set `controller.quorum.voters`. Note that the node ID supplied in the `controller.quorum.voters` configuration must match that supplied to the server. +So on controller1, node.id must be set to 1, and so forth. Note that there is no requirement for controller IDs to start at 0 or 1. However, the easiest and least confusing way to allocate +node IDs is probably just to give each server a numeric ID, starting from 0. + +Note that clients never need to configure `controller.quorum.voters`; only servers do. + +## Kafka Storage Tool +As described above in the QuickStart section, you must use the `kafka-storage.sh` tool to generate a cluster ID for your new cluster, and then run the format command on each node before starting the node. + +This is different from how Kafka has operated in the past. Previously, Kafka would format blank storage directories automatically, and also generate a new cluster UUID automatically. One reason for the change +is that auto-formatting can sometimes obscure an error condition. For example, under UNIX, if a data directory can't be mounted, it may show up as blank. In this case, auto-formatting would be the wrong thing to do. + +This is particularly important for the metadata log maintained by the controller servers. If two controllers out of three controllers were able to start with blank logs, a leader might be able to be elected with +nothing in the log, which would cause all metadata to be lost. + +# Missing Features +We do not yet support generating or loading KIP-630 metadata snapshots. This means that after a while, the time required to restart a broker will become very large. This is a known issue and we are working on +completing snapshots for the next release. + +We also don't support any kind of upgrade right now, either to or from KRaft mode. This is another important gap that we are working on. + +Finally, the following Kafka features have not yet been fully implemented: + +* Support for certain security features: configuring an Authorizer, setting up SCRAM, delegation tokens, and so forth +* Support for transactions and exactly-once semantics +* Support for adding partitions to existing topics +* Support for partition reassignment +* Support for some configurations, like enabling unclean leader election by default or dynamically changing broker endpoints +* Support for KIP-112 "JBOD" modes +* Support for KIP-631 controller metrics + +We've tried to make it clear when a feature is not supported in the early access release, but you may encounter some rough edges. We will cover these feature gaps incrementally in the `trunk` branch. + +# Debugging +If you encounter an issue, you might want to take a look at the metadata log. + +## kafka-dump-log +One way to view the metadata log is with kafka-dump-log.sh tool, like so: + +~~~~ +$ ./bin/kafka-dump-log.sh --cluster-metadata-decoder --skip-record-metadata --files /tmp/kraft-combined-logs/\@metadata-0/*.log +Dumping /tmp/kraft-combined-logs/@metadata-0/00000000000000000000.log +Starting offset: 0 +baseOffset: 0 lastOffset: 0 count: 1 baseSequence: -1 lastSequence: -1 producerId: -1 producerEpoch: -1 partitionLeaderEpoch: 1 isTransactional: false isControl: true position: 0 CreateTime: 1614382631640 size: 89 magic: 2 compresscodec: NONE crc: 1438115474 isvalid: true + +baseOffset: 1 lastOffset: 1 count: 1 baseSequence: -1 lastSequence: -1 producerId: -1 producerEpoch: -1 partitionLeaderEpoch: 1 isTransactional: false isControl: false position: 89 CreateTime: 1614382632329 size: 137 magic: 2 compresscodec: NONE crc: 1095855865 isvalid: true + payload: {"type":"REGISTER_BROKER_RECORD","version":0,"data":{"brokerId":1,"incarnationId":"P3UFsWoNR-erL9PK98YLsA","brokerEpoch":0,"endPoints":[{"name":"PLAINTEXT","host":"localhost","port":9092,"securityProtocol":0}],"features":[],"rack":null}} +baseOffset: 2 lastOffset: 2 count: 1 baseSequence: -1 lastSequence: -1 producerId: -1 producerEpoch: -1 partitionLeaderEpoch: 1 isTransactional: false isControl: false position: 226 CreateTime: 1614382632453 size: 83 magic: 2 compresscodec: NONE crc: 455187130 isvalid: true + payload: {"type":"UNFENCE_BROKER_RECORD","version":0,"data":{"id":1,"epoch":0}} +baseOffset: 3 lastOffset: 3 count: 1 baseSequence: -1 lastSequence: -1 producerId: -1 producerEpoch: -1 partitionLeaderEpoch: 1 isTransactional: false isControl: false position: 309 CreateTime: 1614382634484 size: 83 magic: 2 compresscodec: NONE crc: 4055692847 isvalid: true + payload: {"type":"FENCE_BROKER_RECORD","version":0,"data":{"id":1,"epoch":0}} +baseOffset: 4 lastOffset: 4 count: 1 baseSequence: -1 lastSequence: -1 producerId: -1 producerEpoch: -1 partitionLeaderEpoch: 2 isTransactional: false isControl: true position: 392 CreateTime: 1614382671857 size: 89 magic: 2 compresscodec: NONE crc: 1318571838 isvalid: true + +baseOffset: 5 lastOffset: 5 count: 1 baseSequence: -1 lastSequence: -1 producerId: -1 producerEpoch: -1 partitionLeaderEpoch: 2 isTransactional: false isControl: false position: 481 CreateTime: 1614382672440 size: 137 magic: 2 compresscodec: NONE crc: 841144615 isvalid: true + payload: {"type":"REGISTER_BROKER_RECORD","version":0,"data":{"brokerId":1,"incarnationId":"RXRJu7cnScKRZOnWQGs86g","brokerEpoch":4,"endPoints":[{"name":"PLAINTEXT","host":"localhost","port":9092,"securityProtocol":0}],"features":[],"rack":null}} +baseOffset: 6 lastOffset: 6 count: 1 baseSequence: -1 lastSequence: -1 producerId: -1 producerEpoch: -1 partitionLeaderEpoch: 2 isTransactional: false isControl: false position: 618 CreateTime: 1614382672544 size: 83 magic: 2 compresscodec: NONE crc: 4155905922 isvalid: true + payload: {"type":"UNFENCE_BROKER_RECORD","version":0,"data":{"id":1,"epoch":4}} +baseOffset: 7 lastOffset: 8 count: 2 baseSequence: -1 lastSequence: -1 producerId: -1 producerEpoch: -1 partitionLeaderEpoch: 2 isTransactional: false isControl: false position: 701 CreateTime: 1614382712158 size: 159 magic: 2 compresscodec: NONE crc: 3726758683 isvalid: true + payload: {"type":"TOPIC_RECORD","version":0,"data":{"name":"foo","topicId":"5zoAlv-xEh9xRANKXt1Lbg"}} + payload: {"type":"PARTITION_RECORD","version":0,"data":{"partitionId":0,"topicId":"5zoAlv-xEh9xRANKXt1Lbg","replicas":[1],"isr":[1],"removingReplicas":null,"addingReplicas":null,"leader":1,"leaderEpoch":0,"partitionEpoch":0}} +~~~~ + +## The Metadata Shell +Another tool for examining the metadata logs is the Kafka metadata shell. Just like the ZooKeeper shell, this allows you to inspect the metadata of the cluster. + +~~~~ +$ ./bin/kafka-metadata-shell.sh --snapshot /tmp/kraft-combined-logs/\@metadata-0/00000000000000000000.log +>> ls / +brokers local metadataQuorum topicIds topics +>> ls /topics +foo +>> cat /topics/foo/0/data +{ + "partitionId" : 0, + "topicId" : "5zoAlv-xEh9xRANKXt1Lbg", + "replicas" : [ 1 ], + "isr" : [ 1 ], + "removingReplicas" : null, + "addingReplicas" : null, + "leader" : 1, + "leaderEpoch" : 0, + "partitionEpoch" : 0 +} +>> exit +~~~~ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/config/kraft/broker.properties b/hackfest/kafka/kafka_2.13-2.8.0/config/kraft/broker.properties new file mode 100644 index 0000000000000000000000000000000000000000..1b71803093acd9ca92e6aa0f1cd4b7984a4c2221 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/config/kraft/broker.properties @@ -0,0 +1,128 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# +# This configuration file is intended for use in KRaft mode, where +# Apache ZooKeeper is not present. See config/kraft/README.md for details. +# + +############################# Server Basics ############################# + +# The role of this server. Setting this puts us in KRaft mode +process.roles=broker + +# The node id associated with this instance's roles +node.id=1 + +# The connect string for the controller quorum +controller.quorum.voters=1@localhost:9093 + +############################# Socket Server Settings ############################# + +# The address the socket server listens on. It will get the value returned from +# java.net.InetAddress.getCanonicalHostName() if not configured. +# FORMAT: +# listeners = listener_name://host_name:port +# EXAMPLE: +# listeners = PLAINTEXT://your.host.name:9092 +listeners=PLAINTEXT://localhost:9092 +inter.broker.listener.name=PLAINTEXT + +# Hostname and port the broker will advertise to producers and consumers. If not set, +# it uses the value for "listeners" if configured. Otherwise, it will use the value +# returned from java.net.InetAddress.getCanonicalHostName(). +advertised.listeners=PLAINTEXT://localhost:9092 + +# Listener, host name, and port for the controller to advertise to the brokers. If +# this server is a controller, this listener must be configured. +controller.listener.names=CONTROLLER + +# Maps listener names to security protocols, the default is for them to be the same. See the config documentation for more details +listener.security.protocol.map=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL + +# The number of threads that the server uses for receiving requests from the network and sending responses to the network +num.network.threads=3 + +# The number of threads that the server uses for processing requests, which may include disk I/O +num.io.threads=8 + +# The send buffer (SO_SNDBUF) used by the socket server +socket.send.buffer.bytes=102400 + +# The receive buffer (SO_RCVBUF) used by the socket server +socket.receive.buffer.bytes=102400 + +# The maximum size of a request that the socket server will accept (protection against OOM) +socket.request.max.bytes=104857600 + + +############################# Log Basics ############################# + +# A comma separated list of directories under which to store log files +log.dirs=/tmp/kraft-broker-logs + +# The default number of log partitions per topic. More partitions allow greater +# parallelism for consumption, but this will also result in more files across +# the brokers. +num.partitions=1 + +# The number of threads per data directory to be used for log recovery at startup and flushing at shutdown. +# This value is recommended to be increased for installations with data dirs located in RAID array. +num.recovery.threads.per.data.dir=1 + +############################# Internal Topic Settings ############################# +# The replication factor for the group metadata internal topics "__consumer_offsets" and "__transaction_state" +# For anything other than development testing, a value greater than 1 is recommended to ensure availability such as 3. +offsets.topic.replication.factor=1 +transaction.state.log.replication.factor=1 +transaction.state.log.min.isr=1 + +############################# Log Flush Policy ############################# + +# Messages are immediately written to the filesystem but by default we only fsync() to sync +# the OS cache lazily. The following configurations control the flush of data to disk. +# There are a few important trade-offs here: +# 1. Durability: Unflushed data may be lost if you are not using replication. +# 2. Latency: Very large flush intervals may lead to latency spikes when the flush does occur as there will be a lot of data to flush. +# 3. Throughput: The flush is generally the most expensive operation, and a small flush interval may lead to excessive seeks. +# The settings below allow one to configure the flush policy to flush data after a period of time or +# every N messages (or both). This can be done globally and overridden on a per-topic basis. + +# The number of messages to accept before forcing a flush of data to disk +#log.flush.interval.messages=10000 + +# The maximum amount of time a message can sit in a log before we force a flush +#log.flush.interval.ms=1000 + +############################# Log Retention Policy ############################# + +# The following configurations control the disposal of log segments. The policy can +# be set to delete segments after a period of time, or after a given size has accumulated. +# A segment will be deleted whenever *either* of these criteria are met. Deletion always happens +# from the end of the log. + +# The minimum age of a log file to be eligible for deletion due to age +log.retention.hours=168 + +# A size-based retention policy for logs. Segments are pruned from the log unless the remaining +# segments drop below log.retention.bytes. Functions independently of log.retention.hours. +#log.retention.bytes=1073741824 + +# The maximum size of a log segment file. When this size is reached a new log segment will be created. +log.segment.bytes=1073741824 + +# The interval at which log segments are checked to see if they can be deleted according +# to the retention policies +log.retention.check.interval.ms=300000 diff --git a/hackfest/kafka/kafka_2.13-2.8.0/config/kraft/controller.properties b/hackfest/kafka/kafka_2.13-2.8.0/config/kraft/controller.properties new file mode 100644 index 0000000000000000000000000000000000000000..30fe3e78f3ad8e5c7e65c78e9d35cf5c0b4f7038 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/config/kraft/controller.properties @@ -0,0 +1,127 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# +# This configuration file is intended for use in KRaft mode, where +# Apache ZooKeeper is not present. See config/kraft/README.md for details. +# + +############################# Server Basics ############################# + +# The role of this server. Setting this puts us in KRaft mode +process.roles=controller + +# The node id associated with this instance's roles +node.id=1 + +# The connect string for the controller quorum +controller.quorum.voters=1@localhost:9093 + +############################# Socket Server Settings ############################# + +# The address the socket server listens on. It will get the value returned from +# java.net.InetAddress.getCanonicalHostName() if not configured. +# FORMAT: +# listeners = listener_name://host_name:port +# EXAMPLE: +# listeners = PLAINTEXT://your.host.name:9092 +listeners=PLAINTEXT://:9093 + +# Hostname and port the broker will advertise to producers and consumers. If not set, +# it uses the value for "listeners" if configured. Otherwise, it will use the value +# returned from java.net.InetAddress.getCanonicalHostName(). +#advertised.listeners=PLAINTEXT://your.host.name:9092 + +# Listener, host name, and port for the controller to advertise to the brokers. If +# this server is a controller, this listener must be configured. +controller.listener.names=PLAINTEXT + +# Maps listener names to security protocols, the default is for them to be the same. See the config documentation for more details +#listener.security.protocol.map=PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL + +# The number of threads that the server uses for receiving requests from the network and sending responses to the network +num.network.threads=3 + +# The number of threads that the server uses for processing requests, which may include disk I/O +num.io.threads=8 + +# The send buffer (SO_SNDBUF) used by the socket server +socket.send.buffer.bytes=102400 + +# The receive buffer (SO_RCVBUF) used by the socket server +socket.receive.buffer.bytes=102400 + +# The maximum size of a request that the socket server will accept (protection against OOM) +socket.request.max.bytes=104857600 + + +############################# Log Basics ############################# + +# A comma separated list of directories under which to store log files +log.dirs=/tmp/raft-controller-logs + +# The default number of log partitions per topic. More partitions allow greater +# parallelism for consumption, but this will also result in more files across +# the brokers. +num.partitions=1 + +# The number of threads per data directory to be used for log recovery at startup and flushing at shutdown. +# This value is recommended to be increased for installations with data dirs located in RAID array. +num.recovery.threads.per.data.dir=1 + +############################# Internal Topic Settings ############################# +# The replication factor for the group metadata internal topics "__consumer_offsets" and "__transaction_state" +# For anything other than development testing, a value greater than 1 is recommended to ensure availability such as 3. +offsets.topic.replication.factor=1 +transaction.state.log.replication.factor=1 +transaction.state.log.min.isr=1 + +############################# Log Flush Policy ############################# + +# Messages are immediately written to the filesystem but by default we only fsync() to sync +# the OS cache lazily. The following configurations control the flush of data to disk. +# There are a few important trade-offs here: +# 1. Durability: Unflushed data may be lost if you are not using replication. +# 2. Latency: Very large flush intervals may lead to latency spikes when the flush does occur as there will be a lot of data to flush. +# 3. Throughput: The flush is generally the most expensive operation, and a small flush interval may lead to excessive seeks. +# The settings below allow one to configure the flush policy to flush data after a period of time or +# every N messages (or both). This can be done globally and overridden on a per-topic basis. + +# The number of messages to accept before forcing a flush of data to disk +#log.flush.interval.messages=10000 + +# The maximum amount of time a message can sit in a log before we force a flush +#log.flush.interval.ms=1000 + +############################# Log Retention Policy ############################# + +# The following configurations control the disposal of log segments. The policy can +# be set to delete segments after a period of time, or after a given size has accumulated. +# A segment will be deleted whenever *either* of these criteria are met. Deletion always happens +# from the end of the log. + +# The minimum age of a log file to be eligible for deletion due to age +log.retention.hours=168 + +# A size-based retention policy for logs. Segments are pruned from the log unless the remaining +# segments drop below log.retention.bytes. Functions independently of log.retention.hours. +#log.retention.bytes=1073741824 + +# The maximum size of a log segment file. When this size is reached a new log segment will be created. +log.segment.bytes=1073741824 + +# The interval at which log segments are checked to see if they can be deleted according +# to the retention policies +log.retention.check.interval.ms=300000 diff --git a/hackfest/kafka/kafka_2.13-2.8.0/config/kraft/server.properties b/hackfest/kafka/kafka_2.13-2.8.0/config/kraft/server.properties new file mode 100644 index 0000000000000000000000000000000000000000..8e6406c3b43f2e14d2dcc30b828bbd997d8048ef --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/config/kraft/server.properties @@ -0,0 +1,128 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# +# This configuration file is intended for use in KRaft mode, where +# Apache ZooKeeper is not present. See config/kraft/README.md for details. +# + +############################# Server Basics ############################# + +# The role of this server. Setting this puts us in KRaft mode +process.roles=broker,controller + +# The node id associated with this instance's roles +node.id=1 + +# The connect string for the controller quorum +controller.quorum.voters=1@localhost:9093 + +############################# Socket Server Settings ############################# + +# The address the socket server listens on. It will get the value returned from +# java.net.InetAddress.getCanonicalHostName() if not configured. +# FORMAT: +# listeners = listener_name://host_name:port +# EXAMPLE: +# listeners = PLAINTEXT://your.host.name:9092 +listeners=PLAINTEXT://:9092,CONTROLLER://:9093 +inter.broker.listener.name=PLAINTEXT + +# Hostname and port the broker will advertise to producers and consumers. If not set, +# it uses the value for "listeners" if configured. Otherwise, it will use the value +# returned from java.net.InetAddress.getCanonicalHostName(). +advertised.listeners=PLAINTEXT://localhost:9092 + +# Listener, host name, and port for the controller to advertise to the brokers. If +# this server is a controller, this listener must be configured. +controller.listener.names=CONTROLLER + +# Maps listener names to security protocols, the default is for them to be the same. See the config documentation for more details +listener.security.protocol.map=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL + +# The number of threads that the server uses for receiving requests from the network and sending responses to the network +num.network.threads=3 + +# The number of threads that the server uses for processing requests, which may include disk I/O +num.io.threads=8 + +# The send buffer (SO_SNDBUF) used by the socket server +socket.send.buffer.bytes=102400 + +# The receive buffer (SO_RCVBUF) used by the socket server +socket.receive.buffer.bytes=102400 + +# The maximum size of a request that the socket server will accept (protection against OOM) +socket.request.max.bytes=104857600 + + +############################# Log Basics ############################# + +# A comma separated list of directories under which to store log files +log.dirs=/tmp/kraft-combined-logs + +# The default number of log partitions per topic. More partitions allow greater +# parallelism for consumption, but this will also result in more files across +# the brokers. +num.partitions=1 + +# The number of threads per data directory to be used for log recovery at startup and flushing at shutdown. +# This value is recommended to be increased for installations with data dirs located in RAID array. +num.recovery.threads.per.data.dir=1 + +############################# Internal Topic Settings ############################# +# The replication factor for the group metadata internal topics "__consumer_offsets" and "__transaction_state" +# For anything other than development testing, a value greater than 1 is recommended to ensure availability such as 3. +offsets.topic.replication.factor=1 +transaction.state.log.replication.factor=1 +transaction.state.log.min.isr=1 + +############################# Log Flush Policy ############################# + +# Messages are immediately written to the filesystem but by default we only fsync() to sync +# the OS cache lazily. The following configurations control the flush of data to disk. +# There are a few important trade-offs here: +# 1. Durability: Unflushed data may be lost if you are not using replication. +# 2. Latency: Very large flush intervals may lead to latency spikes when the flush does occur as there will be a lot of data to flush. +# 3. Throughput: The flush is generally the most expensive operation, and a small flush interval may lead to excessive seeks. +# The settings below allow one to configure the flush policy to flush data after a period of time or +# every N messages (or both). This can be done globally and overridden on a per-topic basis. + +# The number of messages to accept before forcing a flush of data to disk +#log.flush.interval.messages=10000 + +# The maximum amount of time a message can sit in a log before we force a flush +#log.flush.interval.ms=1000 + +############################# Log Retention Policy ############################# + +# The following configurations control the disposal of log segments. The policy can +# be set to delete segments after a period of time, or after a given size has accumulated. +# A segment will be deleted whenever *either* of these criteria are met. Deletion always happens +# from the end of the log. + +# The minimum age of a log file to be eligible for deletion due to age +log.retention.hours=168 + +# A size-based retention policy for logs. Segments are pruned from the log unless the remaining +# segments drop below log.retention.bytes. Functions independently of log.retention.hours. +#log.retention.bytes=1073741824 + +# The maximum size of a log segment file. When this size is reached a new log segment will be created. +log.segment.bytes=1073741824 + +# The interval at which log segments are checked to see if they can be deleted according +# to the retention policies +log.retention.check.interval.ms=300000 diff --git a/hackfest/kafka/kafka_2.13-2.8.0/config/log4j.properties b/hackfest/kafka/kafka_2.13-2.8.0/config/log4j.properties new file mode 100644 index 0000000000000000000000000000000000000000..4cbce9d104291fe0a8c6d6acb7e6fc67dde4ecc5 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/config/log4j.properties @@ -0,0 +1,91 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +# Unspecified loggers and loggers with additivity=true output to server.log and stdout +# Note that INFO only applies to unspecified loggers, the log level of the child logger is used otherwise +log4j.rootLogger=INFO, stdout, kafkaAppender + +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n + +log4j.appender.kafkaAppender=org.apache.log4j.DailyRollingFileAppender +log4j.appender.kafkaAppender.DatePattern='.'yyyy-MM-dd-HH +log4j.appender.kafkaAppender.File=${kafka.logs.dir}/server.log +log4j.appender.kafkaAppender.layout=org.apache.log4j.PatternLayout +log4j.appender.kafkaAppender.layout.ConversionPattern=[%d] %p %m (%c)%n + +log4j.appender.stateChangeAppender=org.apache.log4j.DailyRollingFileAppender +log4j.appender.stateChangeAppender.DatePattern='.'yyyy-MM-dd-HH +log4j.appender.stateChangeAppender.File=${kafka.logs.dir}/state-change.log +log4j.appender.stateChangeAppender.layout=org.apache.log4j.PatternLayout +log4j.appender.stateChangeAppender.layout.ConversionPattern=[%d] %p %m (%c)%n + +log4j.appender.requestAppender=org.apache.log4j.DailyRollingFileAppender +log4j.appender.requestAppender.DatePattern='.'yyyy-MM-dd-HH +log4j.appender.requestAppender.File=${kafka.logs.dir}/kafka-request.log +log4j.appender.requestAppender.layout=org.apache.log4j.PatternLayout +log4j.appender.requestAppender.layout.ConversionPattern=[%d] %p %m (%c)%n + +log4j.appender.cleanerAppender=org.apache.log4j.DailyRollingFileAppender +log4j.appender.cleanerAppender.DatePattern='.'yyyy-MM-dd-HH +log4j.appender.cleanerAppender.File=${kafka.logs.dir}/log-cleaner.log +log4j.appender.cleanerAppender.layout=org.apache.log4j.PatternLayout +log4j.appender.cleanerAppender.layout.ConversionPattern=[%d] %p %m (%c)%n + +log4j.appender.controllerAppender=org.apache.log4j.DailyRollingFileAppender +log4j.appender.controllerAppender.DatePattern='.'yyyy-MM-dd-HH +log4j.appender.controllerAppender.File=${kafka.logs.dir}/controller.log +log4j.appender.controllerAppender.layout=org.apache.log4j.PatternLayout +log4j.appender.controllerAppender.layout.ConversionPattern=[%d] %p %m (%c)%n + +log4j.appender.authorizerAppender=org.apache.log4j.DailyRollingFileAppender +log4j.appender.authorizerAppender.DatePattern='.'yyyy-MM-dd-HH +log4j.appender.authorizerAppender.File=${kafka.logs.dir}/kafka-authorizer.log +log4j.appender.authorizerAppender.layout=org.apache.log4j.PatternLayout +log4j.appender.authorizerAppender.layout.ConversionPattern=[%d] %p %m (%c)%n + +# Change the line below to adjust ZK client logging +log4j.logger.org.apache.zookeeper=INFO + +# Change the two lines below to adjust the general broker logging level (output to server.log and stdout) +log4j.logger.kafka=INFO +log4j.logger.org.apache.kafka=INFO + +# Change to DEBUG or TRACE to enable request logging +log4j.logger.kafka.request.logger=WARN, requestAppender +log4j.additivity.kafka.request.logger=false + +# Uncomment the lines below and change log4j.logger.kafka.network.RequestChannel$ to TRACE for additional output +# related to the handling of requests +#log4j.logger.kafka.network.Processor=TRACE, requestAppender +#log4j.logger.kafka.server.KafkaApis=TRACE, requestAppender +#log4j.additivity.kafka.server.KafkaApis=false +log4j.logger.kafka.network.RequestChannel$=WARN, requestAppender +log4j.additivity.kafka.network.RequestChannel$=false + +log4j.logger.kafka.controller=TRACE, controllerAppender +log4j.additivity.kafka.controller=false + +log4j.logger.kafka.log.LogCleaner=INFO, cleanerAppender +log4j.additivity.kafka.log.LogCleaner=false + +log4j.logger.state.change.logger=INFO, stateChangeAppender +log4j.additivity.state.change.logger=false + +# Access denials are logged at INFO level, change to DEBUG to also log allowed accesses +log4j.logger.kafka.authorizer.logger=INFO, authorizerAppender +log4j.additivity.kafka.authorizer.logger=false + diff --git a/hackfest/kafka/kafka_2.13-2.8.0/config/producer.properties b/hackfest/kafka/kafka_2.13-2.8.0/config/producer.properties new file mode 100644 index 0000000000000000000000000000000000000000..4786b988a29b84436280b361a4749aba8d9a02b1 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/config/producer.properties @@ -0,0 +1,45 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. +# see org.apache.kafka.clients.producer.ProducerConfig for more details + +############################# Producer Basics ############################# + +# list of brokers used for bootstrapping knowledge about the rest of the cluster +# format: host1:port1,host2:port2 ... +bootstrap.servers=localhost:9092 + +# specify the compression codec for all data generated: none, gzip, snappy, lz4, zstd +compression.type=none + +# name of the partitioner class for partitioning events; default partition spreads data randomly +#partitioner.class= + +# the maximum amount of time the client will wait for the response of a request +#request.timeout.ms= + +# how long `KafkaProducer.send` and `KafkaProducer.partitionsFor` will block for +#max.block.ms= + +# the producer will wait for up to the given delay to allow other records to be sent so that the sends can be batched together +#linger.ms= + +# the maximum size of a request in bytes +#max.request.size= + +# the default batch size in bytes when batching multiple records sent to a partition +#batch.size= + +# the total bytes of memory the producer can use to buffer records waiting to be sent to the server +#buffer.memory= diff --git a/hackfest/kafka/kafka_2.13-2.8.0/config/server.properties b/hackfest/kafka/kafka_2.13-2.8.0/config/server.properties new file mode 100644 index 0000000000000000000000000000000000000000..b1cf5c454169c2f08d56f4af09ef1726f622728d --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/config/server.properties @@ -0,0 +1,136 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +# see kafka.server.KafkaConfig for additional details and defaults + +############################# Server Basics ############################# + +# The id of the broker. This must be set to a unique integer for each broker. +broker.id=0 + +############################# Socket Server Settings ############################# + +# The address the socket server listens on. It will get the value returned from +# java.net.InetAddress.getCanonicalHostName() if not configured. +# FORMAT: +# listeners = listener_name://host_name:port +# EXAMPLE: +# listeners = PLAINTEXT://your.host.name:9092 +#listeners=PLAINTEXT://:9092 + +# Hostname and port the broker will advertise to producers and consumers. If not set, +# it uses the value for "listeners" if configured. Otherwise, it will use the value +# returned from java.net.InetAddress.getCanonicalHostName(). +#advertised.listeners=PLAINTEXT://your.host.name:9092 + +# Maps listener names to security protocols, the default is for them to be the same. See the config documentation for more details +#listener.security.protocol.map=PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL + +# The number of threads that the server uses for receiving requests from the network and sending responses to the network +num.network.threads=3 + +# The number of threads that the server uses for processing requests, which may include disk I/O +num.io.threads=8 + +# The send buffer (SO_SNDBUF) used by the socket server +socket.send.buffer.bytes=102400 + +# The receive buffer (SO_RCVBUF) used by the socket server +socket.receive.buffer.bytes=102400 + +# The maximum size of a request that the socket server will accept (protection against OOM) +socket.request.max.bytes=104857600 + + +############################# Log Basics ############################# + +# A comma separated list of directories under which to store log files +log.dirs=/tmp/kafka-logs + +# The default number of log partitions per topic. More partitions allow greater +# parallelism for consumption, but this will also result in more files across +# the brokers. +num.partitions=1 + +# The number of threads per data directory to be used for log recovery at startup and flushing at shutdown. +# This value is recommended to be increased for installations with data dirs located in RAID array. +num.recovery.threads.per.data.dir=1 + +############################# Internal Topic Settings ############################# +# The replication factor for the group metadata internal topics "__consumer_offsets" and "__transaction_state" +# For anything other than development testing, a value greater than 1 is recommended to ensure availability such as 3. +offsets.topic.replication.factor=1 +transaction.state.log.replication.factor=1 +transaction.state.log.min.isr=1 + +############################# Log Flush Policy ############################# + +# Messages are immediately written to the filesystem but by default we only fsync() to sync +# the OS cache lazily. The following configurations control the flush of data to disk. +# There are a few important trade-offs here: +# 1. Durability: Unflushed data may be lost if you are not using replication. +# 2. Latency: Very large flush intervals may lead to latency spikes when the flush does occur as there will be a lot of data to flush. +# 3. Throughput: The flush is generally the most expensive operation, and a small flush interval may lead to excessive seeks. +# The settings below allow one to configure the flush policy to flush data after a period of time or +# every N messages (or both). This can be done globally and overridden on a per-topic basis. + +# The number of messages to accept before forcing a flush of data to disk +#log.flush.interval.messages=10000 + +# The maximum amount of time a message can sit in a log before we force a flush +#log.flush.interval.ms=1000 + +############################# Log Retention Policy ############################# + +# The following configurations control the disposal of log segments. The policy can +# be set to delete segments after a period of time, or after a given size has accumulated. +# A segment will be deleted whenever *either* of these criteria are met. Deletion always happens +# from the end of the log. + +# The minimum age of a log file to be eligible for deletion due to age +log.retention.hours=168 + +# A size-based retention policy for logs. Segments are pruned from the log unless the remaining +# segments drop below log.retention.bytes. Functions independently of log.retention.hours. +#log.retention.bytes=1073741824 + +# The maximum size of a log segment file. When this size is reached a new log segment will be created. +log.segment.bytes=1073741824 + +# The interval at which log segments are checked to see if they can be deleted according +# to the retention policies +log.retention.check.interval.ms=300000 + +############################# Zookeeper ############################# + +# Zookeeper connection string (see zookeeper docs for details). +# This is a comma separated host:port pairs, each corresponding to a zk +# server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002". +# You can also append an optional chroot string to the urls to specify the +# root directory for all kafka znodes. +zookeeper.connect=localhost:2181 + +# Timeout in ms for connecting to zookeeper +zookeeper.connection.timeout.ms=18000 + + +############################# Group Coordinator Settings ############################# + +# The following configuration specifies the time, in milliseconds, that the GroupCoordinator will delay the initial consumer rebalance. +# The rebalance will be further delayed by the value of group.initial.rebalance.delay.ms as new members join the group, up to a maximum of max.poll.interval.ms. +# The default value for this is 3 seconds. +# We override this to 0 here as it makes for a better out-of-the-box experience for development and testing. +# However, in production environments the default value of 3 seconds is more suitable as this will help to avoid unnecessary, and potentially expensive, rebalances during application startup. +group.initial.rebalance.delay.ms=0 diff --git a/hackfest/kafka/kafka_2.13-2.8.0/config/tools-log4j.properties b/hackfest/kafka/kafka_2.13-2.8.0/config/tools-log4j.properties new file mode 100644 index 0000000000000000000000000000000000000000..b19e343265fc3601423cfb08535a139639116375 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/config/tools-log4j.properties @@ -0,0 +1,21 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +log4j.rootLogger=WARN, stderr + +log4j.appender.stderr=org.apache.log4j.ConsoleAppender +log4j.appender.stderr.layout=org.apache.log4j.PatternLayout +log4j.appender.stderr.layout.ConversionPattern=[%d] %p %m (%c)%n +log4j.appender.stderr.Target=System.err diff --git a/hackfest/kafka/kafka_2.13-2.8.0/config/trogdor.conf b/hackfest/kafka/kafka_2.13-2.8.0/config/trogdor.conf new file mode 100644 index 0000000000000000000000000000000000000000..320cbe7560cd0c45f076de4801826424f9df3882 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/config/trogdor.conf @@ -0,0 +1,25 @@ +{ + "_comment": [ + "Licensed to the Apache Software Foundation (ASF) under one or more", + "contributor license agreements. See the NOTICE file distributed with", + "this work for additional information regarding copyright ownership.", + "The ASF licenses this file to You 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." + ], + "platform": "org.apache.kafka.trogdor.basic.BasicPlatform", "nodes": { + "node0": { + "hostname": "localhost", + "trogdor.agent.port": 8888, + "trogdor.coordinator.port": 8889 + } + } +} diff --git a/hackfest/kafka/kafka_2.13-2.8.0/config/zookeeper.properties b/hackfest/kafka/kafka_2.13-2.8.0/config/zookeeper.properties new file mode 100644 index 0000000000000000000000000000000000000000..90f4332ec31cf5e6612daa5fb75c4ac0d0093dd8 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/config/zookeeper.properties @@ -0,0 +1,24 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. +# the directory where the snapshot is stored. +dataDir=/tmp/zookeeper +# the port at which the clients will connect +clientPort=2181 +# disable the per-ip limit on the number of connections since this is a non-production config +maxClientCnxns=0 +# Disable the adminserver by default to avoid port conflicts. +# Set the port to something non-conflicting if choosing to enable this +admin.enableServer=false +# admin.serverPort=8080 diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/activation-1.1.1.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/activation-1.1.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..1b703ab283e0cddabf9c1b5e28658f9198c0def4 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/activation-1.1.1.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/aopalliance-repackaged-2.6.1.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/aopalliance-repackaged-2.6.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..35502f09dcaa845e9ad63fa1ea6f5989cf97731a Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/aopalliance-repackaged-2.6.1.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/argparse4j-0.7.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/argparse4j-0.7.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..b1865dd3827eada57d396d4fc1e012ff990c5f3b Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/argparse4j-0.7.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/audience-annotations-0.5.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/audience-annotations-0.5.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..52491a7ea2048e9ab82534472a1c9fff7396d031 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/audience-annotations-0.5.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/commons-cli-1.4.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/commons-cli-1.4.jar new file mode 100644 index 0000000000000000000000000000000000000000..22deb3089e2f79a983406bd13a75a3e6238afdcf Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/commons-cli-1.4.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/commons-lang3-3.8.1.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/commons-lang3-3.8.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..2c65ce67d5c2b746e0583e4879c35ed0751b505e Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/commons-lang3-3.8.1.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-api-2.8.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-api-2.8.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..7c5ba4316738de9603684b5ee3f81d6ca187f052 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-api-2.8.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-basic-auth-extension-2.8.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-basic-auth-extension-2.8.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..86fcdd7b7f76b7a11df061692bc92c3495712039 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-basic-auth-extension-2.8.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-file-2.8.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-file-2.8.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..ba1b1b19b53fec6727ccad01aaf1df14e54149a0 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-file-2.8.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-json-2.8.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-json-2.8.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..b96a4b00566737cba09a8690ed7c075677ba80ea Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-json-2.8.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-mirror-2.8.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-mirror-2.8.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..9947af91f87c2e13ec32b08094f93319fd850c6f Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-mirror-2.8.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-mirror-client-2.8.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-mirror-client-2.8.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..4099b02b464300e3da31fb289855a88402726e98 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-mirror-client-2.8.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-runtime-2.8.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-runtime-2.8.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..ce0fb813f99fb33e5f105ec76b59d192843ee0a9 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-runtime-2.8.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-transforms-2.8.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-transforms-2.8.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..b72a124106678af9728fd050fc14ae833e506c6a Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/connect-transforms-2.8.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/hk2-api-2.6.1.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/hk2-api-2.6.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..03d6eb05921f28d7fdca0f7bf1af7b187cdf1a8b Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/hk2-api-2.6.1.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/hk2-locator-2.6.1.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/hk2-locator-2.6.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..0906bd1bdaca955a54c37a2b70ed393d5aa9fcca Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/hk2-locator-2.6.1.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/hk2-utils-2.6.1.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/hk2-utils-2.6.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..768bc48800fee6da4526f9b8cff0de1773a7bc3f Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/hk2-utils-2.6.1.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-annotations-2.10.5.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-annotations-2.10.5.jar new file mode 100644 index 0000000000000000000000000000000000000000..74a8b1ba76ed2ba3498f38338f96f1615ad6d65d Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-annotations-2.10.5.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-core-2.10.5.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-core-2.10.5.jar new file mode 100644 index 0000000000000000000000000000000000000000..ed1817300546847acc182edb40b0f068a605d711 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-core-2.10.5.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-databind-2.10.5.1.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-databind-2.10.5.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..3246c3d3c27860b7ae0579dd7b2474d0a800d7e3 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-databind-2.10.5.1.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-dataformat-csv-2.10.5.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-dataformat-csv-2.10.5.jar new file mode 100644 index 0000000000000000000000000000000000000000..df564d944d0a752a58825dc8e9f094f7a5f13764 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-dataformat-csv-2.10.5.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-datatype-jdk8-2.10.5.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-datatype-jdk8-2.10.5.jar new file mode 100644 index 0000000000000000000000000000000000000000..32d020097821a02469a843129cd6c9b055f9fd4b Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-datatype-jdk8-2.10.5.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-jaxrs-base-2.10.5.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-jaxrs-base-2.10.5.jar new file mode 100644 index 0000000000000000000000000000000000000000..74d74f53703a8b92803a9d7d0cf4b2c8afdb6cb5 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-jaxrs-base-2.10.5.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-jaxrs-json-provider-2.10.5.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-jaxrs-json-provider-2.10.5.jar new file mode 100644 index 0000000000000000000000000000000000000000..9d6dde11b2661743a97b296f34653a5514a33bf1 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-jaxrs-json-provider-2.10.5.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-module-jaxb-annotations-2.10.5.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-module-jaxb-annotations-2.10.5.jar new file mode 100644 index 0000000000000000000000000000000000000000..ea23eb79435cc855c6b7c97e542caf54ddd6cb05 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-module-jaxb-annotations-2.10.5.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-module-paranamer-2.10.5.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-module-paranamer-2.10.5.jar new file mode 100644 index 0000000000000000000000000000000000000000..63efc6ac43de3ed20d3034ec4074f7f8b62911af Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-module-paranamer-2.10.5.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-module-scala_2.13-2.10.5.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-module-scala_2.13-2.10.5.jar new file mode 100644 index 0000000000000000000000000000000000000000..51326637eff340dbfa724e4f554fd28ec57bdefb Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jackson-module-scala_2.13-2.10.5.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jakarta.activation-api-1.2.1.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jakarta.activation-api-1.2.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..bbfb52ff01e082afd65ee6444f2645e999f98ee0 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jakarta.activation-api-1.2.1.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jakarta.annotation-api-1.3.5.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jakarta.annotation-api-1.3.5.jar new file mode 100644 index 0000000000000000000000000000000000000000..606d992eb235afffc3284caf6a2f97939e8a1682 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jakarta.annotation-api-1.3.5.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jakarta.inject-2.6.1.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jakarta.inject-2.6.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..cee6acd2a0a81094bb1b6f8b75f2c6913301ba6d Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jakarta.inject-2.6.1.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jakarta.validation-api-2.0.2.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jakarta.validation-api-2.0.2.jar new file mode 100644 index 0000000000000000000000000000000000000000..d68c9f7f36d2cfda66f0b89e0719b73b034143b5 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jakarta.validation-api-2.0.2.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jakarta.ws.rs-api-2.1.6.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jakarta.ws.rs-api-2.1.6.jar new file mode 100644 index 0000000000000000000000000000000000000000..4850659bb6c9f2872836f4d0d5f4600da774d440 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jakarta.ws.rs-api-2.1.6.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jakarta.xml.bind-api-2.3.2.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jakarta.xml.bind-api-2.3.2.jar new file mode 100644 index 0000000000000000000000000000000000000000..b16236d561c08c177f79a99e2c7a47be1f81616d Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jakarta.xml.bind-api-2.3.2.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/javassist-3.27.0-GA.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/javassist-3.27.0-GA.jar new file mode 100644 index 0000000000000000000000000000000000000000..092e59b4d68c3d5832cef4e04324212fd319ab48 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/javassist-3.27.0-GA.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/javax.servlet-api-3.1.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/javax.servlet-api-3.1.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..6b14c3d267867e76c04948bb31b3de18e01412ee Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/javax.servlet-api-3.1.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/javax.ws.rs-api-2.1.1.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/javax.ws.rs-api-2.1.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..3eabbf0874c4a56edf5f47fb9e26c2c125dc23b2 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/javax.ws.rs-api-2.1.1.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jaxb-api-2.3.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jaxb-api-2.3.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..0817c083ad9965d72e18c87dd23b63f8241adc50 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jaxb-api-2.3.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jersey-client-2.31.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jersey-client-2.31.jar new file mode 100644 index 0000000000000000000000000000000000000000..6f4cbe1f0181c85eb4fa1351b55a86ca13a26719 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jersey-client-2.31.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jersey-common-2.31.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jersey-common-2.31.jar new file mode 100644 index 0000000000000000000000000000000000000000..22a163898ff67d1bfed6c81feb806e2371ca4b53 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jersey-common-2.31.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jersey-container-servlet-2.31.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jersey-container-servlet-2.31.jar new file mode 100644 index 0000000000000000000000000000000000000000..5395f6d31d9c070a8b31ff699d56e70dad3db935 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jersey-container-servlet-2.31.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jersey-container-servlet-core-2.31.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jersey-container-servlet-core-2.31.jar new file mode 100644 index 0000000000000000000000000000000000000000..9e0d13fd4cf64859d2c2e106bf1b5c003acfe822 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jersey-container-servlet-core-2.31.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jersey-hk2-2.31.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jersey-hk2-2.31.jar new file mode 100644 index 0000000000000000000000000000000000000000..1c8faeaae7a57fa13e8f1bf642c95782f7747345 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jersey-hk2-2.31.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jersey-media-jaxb-2.31.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jersey-media-jaxb-2.31.jar new file mode 100644 index 0000000000000000000000000000000000000000..b30472a94abce99d9379cf0f3c08df226a3913f4 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jersey-media-jaxb-2.31.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jersey-server-2.31.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jersey-server-2.31.jar new file mode 100644 index 0000000000000000000000000000000000000000..8093610a304e2c1f8c4b0422261368b0c47be8bf Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jersey-server-2.31.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-client-9.4.39.v20210325.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-client-9.4.39.v20210325.jar new file mode 100644 index 0000000000000000000000000000000000000000..8f3456444abdace3451d6abbf5f849adb38d8159 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-client-9.4.39.v20210325.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-continuation-9.4.39.v20210325.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-continuation-9.4.39.v20210325.jar new file mode 100644 index 0000000000000000000000000000000000000000..628c66adb35f67ef4083337f943633ee5a21359d Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-continuation-9.4.39.v20210325.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-http-9.4.39.v20210325.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-http-9.4.39.v20210325.jar new file mode 100644 index 0000000000000000000000000000000000000000..0e4b3a626f5c445f7f94956e7547cfaf41e42a77 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-http-9.4.39.v20210325.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-io-9.4.39.v20210325.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-io-9.4.39.v20210325.jar new file mode 100644 index 0000000000000000000000000000000000000000..410024d7c32c47ec1a910e59f349d463af084fb9 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-io-9.4.39.v20210325.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-security-9.4.39.v20210325.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-security-9.4.39.v20210325.jar new file mode 100644 index 0000000000000000000000000000000000000000..959f42617384cd30caf86e2f2528164f9aad2fc7 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-security-9.4.39.v20210325.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-server-9.4.39.v20210325.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-server-9.4.39.v20210325.jar new file mode 100644 index 0000000000000000000000000000000000000000..93ef391b9669a8c2e8d720d04af7fe058af699e0 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-server-9.4.39.v20210325.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-servlet-9.4.39.v20210325.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-servlet-9.4.39.v20210325.jar new file mode 100644 index 0000000000000000000000000000000000000000..87712d80c28bfe61ab993917e2561286c542057d Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-servlet-9.4.39.v20210325.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-servlets-9.4.39.v20210325.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-servlets-9.4.39.v20210325.jar new file mode 100644 index 0000000000000000000000000000000000000000..6fb55c290838080c1278fbc7fa1149fdbd707f5a Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-servlets-9.4.39.v20210325.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-util-9.4.39.v20210325.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-util-9.4.39.v20210325.jar new file mode 100644 index 0000000000000000000000000000000000000000..a55699def34d2aa97981fa41296da44d31a3671d Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-util-9.4.39.v20210325.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-util-ajax-9.4.39.v20210325.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-util-ajax-9.4.39.v20210325.jar new file mode 100644 index 0000000000000000000000000000000000000000..edfdee3e9bbf4bd19d6bdd46538616ff2c6f4e52 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jetty-util-ajax-9.4.39.v20210325.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jline-3.12.1.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jline-3.12.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..fcb8d4dd6d1450ee214cce78eff1942a1cc1a9d3 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jline-3.12.1.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/jopt-simple-5.0.4.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/jopt-simple-5.0.4.jar new file mode 100644 index 0000000000000000000000000000000000000000..317b2b069c413d1b58a471e7d49d85e03e4425d6 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/jopt-simple-5.0.4.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-clients-2.8.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-clients-2.8.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..375b2f82a46b67cae763c06166757bfa6ebf8ec5 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-clients-2.8.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-log4j-appender-2.8.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-log4j-appender-2.8.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..83ca256013d5076a283dd4ca413e8dc130bde93d Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-log4j-appender-2.8.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-metadata-2.8.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-metadata-2.8.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..ab64f115e1d856ebf866029f342d78430272ee62 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-metadata-2.8.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-raft-2.8.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-raft-2.8.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..93b2c24b40312b89f7419f0d49b861085790984c Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-raft-2.8.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-shell-2.8.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-shell-2.8.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..4f1271f7e37292832911395c0c9909030e969d7b Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-shell-2.8.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-streams-2.8.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-streams-2.8.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..fc135def8c22b6ad32deba9f3a723444c2a69d22 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-streams-2.8.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-streams-examples-2.8.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-streams-examples-2.8.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..7bc625021f55234fcdadc5f3b19e27e419ef3bd9 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-streams-examples-2.8.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-streams-scala_2.13-2.8.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-streams-scala_2.13-2.8.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..49b1bd169f5e052d8d7a2f7a1b09ea3df8efcc2f Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-streams-scala_2.13-2.8.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-streams-test-utils-2.8.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-streams-test-utils-2.8.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..50e01359e90596c87a296622276dee3a95b95459 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-streams-test-utils-2.8.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-tools-2.8.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-tools-2.8.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..ef49b423f6db1a79258437f816d49a7621317219 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka-tools-2.8.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-javadoc.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-javadoc.jar new file mode 100644 index 0000000000000000000000000000000000000000..31705d79e6163ebc7636b3d610b64c3744b83f6f Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-javadoc.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-javadoc.jar.asc b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-javadoc.jar.asc new file mode 100644 index 0000000000000000000000000000000000000000..fb9b148683c4d81ac9a6b09c5fdfea76b9b996e6 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-javadoc.jar.asc @@ -0,0 +1,17 @@ +-----BEGIN PGP SIGNATURE----- +Version: BCPG v1.64 + +iQIcBAABCgAGBQJgdv10AAoJEAFsz8oOL9Vh/HQP/ixN0ulA7WE41KuceF60xJ7+ +kiM3r4pJaJkcUuJRn8Q2U9w5vym0AMlRe7OlbHtRztpsHnUj2fyNvw/lIcWvvHey +G9UWCrjfReq7+Lcb7XsCRJZ1KCnlyKz6r2Jdh5E7nNlH9Fxe1pZv/1M4SZVXeud9 +Rq5byoQsVWGdNinmPvwckFbdmcmyiSGWbUlCVe9MYx+NfxcUisREGDkPdqaOeN+Y +HCEdmY0vpeMgkIpJOEDJHGwrJmp5sWT50Qor5J4FFtBlVPFyEeWVxyL9/025WyZe +wFzAVBmUXYLdhuF1Tq2fmfYTJWasbnu34PHsduq3t0TVAFzOyLDbgoRUnLWRA2Ws +eJgRRn2gKzB40vNpLTk79PjPEe37BKto2HxK/hhZebgl4TlhwR+atn54mfnuL73W ++eCoNikh2Xww1d83Fyv43dUggIr6H+3yipIRqoch4gf5Q40CFArbTDY5QBjWwiTW +2Ee8QuqxK5J21+ThwH+O/3ThcHZPWQvSqKz5AdpgF0JR2/Tzp/or93fthuBAJ+cM +op4IrfCt2uJlUNHzZL5x+WVxwVyhoC7HGJ9tq90aeN1F8d+2wT7gWRVtfASDnbE2 +Se8G3rfJEx2YD2Q0d1oxRR8na0mtfxT3gu4jcxhjlfRaBEBoGZ20nhnaIh2ZT7xN +9FBtpv1yg9q9PW0pordO +=heAh +-----END PGP SIGNATURE----- diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-sources.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-sources.jar new file mode 100644 index 0000000000000000000000000000000000000000..75d51d1b5c0f5335db597a7cd8720b0122dedb64 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-sources.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-sources.jar.asc b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-sources.jar.asc new file mode 100644 index 0000000000000000000000000000000000000000..6abc5e320f316dca38e6c58f66da64fff8cc70e7 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-sources.jar.asc @@ -0,0 +1,17 @@ +-----BEGIN PGP SIGNATURE----- +Version: BCPG v1.64 + +iQIcBAABCgAGBQJgdv10AAoJEAFsz8oOL9VhPeUP/0ZRAJo+0KZ4JycjaR1ea09S +FKXedSNGRMtU/ttwOuTMeICqvPDqxS5OvJD60Kp1yahODUIHvSb30WfjnQEdfM+5 +UiqOYz809NYVbwdLx951dm/c4++aQ+/cnucJLjl6R8Wj0hxOSU/Whb383tl7RBx8 +GVScgAEN+q0qC+jjNi6dm5TKjBxJqFbMcSlc34yk8Wno0d8y1ls1dBvNFmEtIZ1I ++gMUCuRKHrooudis5zPKXLrjCL8VZxqDAuovuRDLbVJDawbMB8sHYXE9phfOvoYi +27SDc7gpQJZ6Xwy2Ns1QaX8DowZgEx4xgZSzO1zHJfTvUoIxIFrg76L9CxbChr+P +eoWY0/UVpIiHRjLwkiVoHSCvgTKohL4kv74fID3xELdvClU4AMNAy9jVVakhLcgq +D/qK4t7+4VlWj/CZOoiN8ZrT/A2l3RcBp6OuXLcLQrEfuL1b2d/SkP9N3VGB3qfV +OUomFztr/CLxR8CNHvMWG2GbbVY/zDVaYPGMtHaorszLV/0+Fpz7+W0WRj4ZwU72 +fxIDKwM/nUrctJZS/D8zXveHtPypDvxsJVIwCGqULhtoYvKBmSaMFtVJ8eq8yO7A +BSbC1/nRGj8aaVItfKPjFoQtjOByzkuqQnG7WgwGIdiwOjOJz0kSkNvRAuRDntUa +j5ACmAY/hiwWEcmEqh7t +=zTA7 +-----END PGP SIGNATURE----- diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-test-sources.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-test-sources.jar new file mode 100644 index 0000000000000000000000000000000000000000..d9bfb261c615da12118f37f3c9a316ea0f7713bc Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-test-sources.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-test-sources.jar.asc b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-test-sources.jar.asc new file mode 100644 index 0000000000000000000000000000000000000000..cb147011ea03462b4f3e34e66659d98ae0947d97 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-test-sources.jar.asc @@ -0,0 +1,17 @@ +-----BEGIN PGP SIGNATURE----- +Version: BCPG v1.64 + +iQIcBAABCgAGBQJgdv1zAAoJEAFsz8oOL9Vh3gIP/00PY5XCwsUFDR9hYnqdNAbZ +5xQWW5hCpnIWNbpAFPY5qf+oW40IuhsjcoJFKk6PNnAwptekx1I/2avz3PD3F613 +mj4b1fPx1LPFtS7+IUEHdb+KuzS4pIQ6zMyRwbISjmJFyPUsxULsx6nrFix53201 ++EPSlxdrygGIb1nlGzSaBe+4UybdsODo1HagXV6jBIsMntFkW7Y5wZAZh+QFQnOm +wPZPFBiwZ1Ly2R1eTs2uWvPfOhoG7Vgdoc1LWIJfWXnlLqE+eSdn7/TMxQ9KYKkZ +1UjWzLE5YEj6rVj4TnxpqNKq8hMGSX6ZDFEXlu95UJuqSZt+o4Z4PxYXY8SNo3U+ +uYpfftnkL26DVyqQS3BjLILSsnICtsuGLnlVdJJr3NzWQRCFVvsuWKyKRixlruk9 +KUDvZN4aR2FJW5N0Xy3cCS6b5m0WoiH14PiA0rgAq1KYD0QMPgFm/FhZkovTslcG +wfZYHtTULWO3NImkPSfRYUX+2RyEkHhfELfnLmQ8P560ULFW8Ckj3OoBk/Im5Faw +rO//gVonTKOuyh9EiGjHVx+VaihbIjf8GBZ7b9q/yZZqTybAashDpqnFD+vAo+jy +YwvxM6fF2CekJpD0Sk+eOcJNB9Ujwz973bDGuqSYhXG330xa1JbJ1hH73p10fsvR +g6OUBQRbTDCXmODUTcsf +=gek7 +-----END PGP SIGNATURE----- diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-test.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-test.jar new file mode 100644 index 0000000000000000000000000000000000000000..7a7e9f7d6efffa2728bf404fd51469338a8eb265 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-test.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-test.jar.asc b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-test.jar.asc new file mode 100644 index 0000000000000000000000000000000000000000..85b5dfe93c5708432c5229ba8011cc366ee5ce0d --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0-test.jar.asc @@ -0,0 +1,17 @@ +-----BEGIN PGP SIGNATURE----- +Version: BCPG v1.64 + +iQIcBAABCgAGBQJgdv1zAAoJEAFsz8oOL9VhGp0QAKRfapWQIdqIRBWZUEzHFlbJ +Z+x0pLGiRJMDyoKj4pDqMyHWaTkW1Oav+XXQXlXHrZVClTiAnwyvYtpVQ42NbDu1 ++EyNuJ20phLVRMRhlMYYNaOVsI309a13RmmRxKWy4L147SZr9v+ay3g+jkjWU/GO +SjnQpT4VrmZjBvbfNYBlP7+yXevoIajpaozau1pIfROzsTdAXDW4pYbDZq7R/htq +fyxrqM2X3pY+WvMm2NpJ+zG3oZtAfSfI4/57PQse9dqWFzxzoGBDW/S9EJdqBWMT +M+6q36N+vYDQ8Y3Wlhe3lZfpsbQ8s2+JbloxO+c5qLyTJpLFnj0lMuc5AqQ4f8pd +B2uVQ3J/dlhj9JL9KA2nL0l1kQ40itUrzSEEsyhkeM/JExpG3GOjUrh0i1fAqaAA +kl04d9cfRNTYnOLL3d1D6M1rcQA9ydBk3MbvAV+3pQLSjKpkGuYDQeH4IcBBKW0F +XvIZEp+xw0eFLoT3DqPYkZJ/ry0r7+JFGJ+zVRU/djs8msspx5nRsEhB+6hvD3sj +SFGwAyJXmi8PMDrJTBqIewNgFC0OXoN4RQVxN0mQKaKVy98gqD2JaRQOjALJvDQQ +kJN2lyZ6OYLfsD8vHm2lYVU3WtRFMugWj/gWs2qJ6ikrDIkLbsFav83pS59gRao/ +vCnwpEMCseMe6XiLH2x5 +=0naQ +-----END PGP SIGNATURE----- diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..158454d4dc57312add0b36eb4d6c85a9496c0078 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0.jar.asc b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0.jar.asc new file mode 100644 index 0000000000000000000000000000000000000000..1ea0782e60696919ca50267ac8ff5c3d4d44738d --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/libs/kafka_2.13-2.8.0.jar.asc @@ -0,0 +1,17 @@ +-----BEGIN PGP SIGNATURE----- +Version: BCPG v1.64 + +iQIcBAABCgAGBQJgdv10AAoJEAFsz8oOL9VhscQP/2Fac2u6DezA+EToziIjIBMh +9gUfnWBBsY//tAaxosYnKp/VX2eRUd2XZ3ChKj1mk1qSosQ8jUOpu8fHgDV45t1T +uWsV1KsTTHu+fgy8zdQ/G4XGQYPdFalc9v8kvHI//ZlHWXcSTvR/B8m4pKyLg/mu +1xQuaLycrEt5dpXIxq+FYG+GnA+lJIrQlq11ZDTWJMSg1qnGVAXLX333HLIIlC5V +YoG7HFCImqX7aHe6sapKGlXYSeMLgO+wnLFXL9cjvxv+2wd+G4DSAz8s05mYiPjf +Bqx2Pp34ah3Oqh8lh4RL9aRqGWAmHrbFQkKQmo4sx8RW1qXp6qaMwSASPAcJQC5e +8gpwGwwo781l1HeKZO633ASrQs9RbQ4rgs4BciT+fhCu63ytjN1vRLz7vLbh9D5t +ZkXsJw33BU6h639sFPKu8eMyYe6ArqQ/5QsLMA+kE88b0wH5qCi57zf40iQQ+HAc +uULfefE+PnEIJrALvOcY9QDJVGxyvS6SOINZ0Fl6sLnfkxLMG/CV5B0UVWWWntNA +ei9F8b7utP8PzSxTnxCr3yWGnE2qVz2hrJeYkXdadZS3Tq6Qt2lVMZ+n0hf1szVn +0DmY27c/cADLIeviJHQzmB2ifVRCZP5dBGn1WqUWSg8oZfh5z+nYktuvdbZIROOQ +DvZIiIsAYS7eJHuJBYQs +=oHk2 +-----END PGP SIGNATURE----- diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/log4j-1.2.17.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/log4j-1.2.17.jar new file mode 100644 index 0000000000000000000000000000000000000000..1d425cf7d7e25f81be64d32c406ff66cfb6c4766 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/log4j-1.2.17.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/lz4-java-1.7.1.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/lz4-java-1.7.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..95f57ca102eb37f7f1a911aa7d45f0ba58c60c9c Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/lz4-java-1.7.1.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/maven-artifact-3.6.3.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/maven-artifact-3.6.3.jar new file mode 100644 index 0000000000000000000000000000000000000000..42c81115aa98ff96892a048b0ca93533b5bbfef6 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/maven-artifact-3.6.3.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/metrics-core-2.2.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/metrics-core-2.2.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..0f6d1cb0ecbd37f673bc87e109cacc535e23350a Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/metrics-core-2.2.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-buffer-4.1.62.Final.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-buffer-4.1.62.Final.jar new file mode 100644 index 0000000000000000000000000000000000000000..2f021341cc3c8318c058cb1343ec8d5b8f53e4fb Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-buffer-4.1.62.Final.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-codec-4.1.62.Final.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-codec-4.1.62.Final.jar new file mode 100644 index 0000000000000000000000000000000000000000..d637c6b933624a3d8fbf1259d86ad082a0ba580f Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-codec-4.1.62.Final.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-common-4.1.62.Final.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-common-4.1.62.Final.jar new file mode 100644 index 0000000000000000000000000000000000000000..b9c80a8efc70065d3f12462d45ea25acef260cc2 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-common-4.1.62.Final.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-handler-4.1.62.Final.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-handler-4.1.62.Final.jar new file mode 100644 index 0000000000000000000000000000000000000000..c28e942be8ef401f64434e5407cbbe36ac9eb0a1 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-handler-4.1.62.Final.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-resolver-4.1.62.Final.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-resolver-4.1.62.Final.jar new file mode 100644 index 0000000000000000000000000000000000000000..45e3662a7299a6e27128fc102c4a51346824c09e Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-resolver-4.1.62.Final.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-transport-4.1.62.Final.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-transport-4.1.62.Final.jar new file mode 100644 index 0000000000000000000000000000000000000000..e277f71afc865c510847223b534d25933331c03d Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-transport-4.1.62.Final.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-transport-native-epoll-4.1.62.Final.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-transport-native-epoll-4.1.62.Final.jar new file mode 100644 index 0000000000000000000000000000000000000000..0d1ea389e28b4108b077c4a95adcec87b8eef411 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-transport-native-epoll-4.1.62.Final.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-transport-native-unix-common-4.1.62.Final.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-transport-native-unix-common-4.1.62.Final.jar new file mode 100644 index 0000000000000000000000000000000000000000..66e66cc1c58d302046c31c0637f4b5c0c930c83a Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/netty-transport-native-unix-common-4.1.62.Final.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/osgi-resource-locator-1.0.3.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/osgi-resource-locator-1.0.3.jar new file mode 100644 index 0000000000000000000000000000000000000000..0f3c38653fb6182b0833f554340dd0c7ca7c4093 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/osgi-resource-locator-1.0.3.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/paranamer-2.8.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/paranamer-2.8.jar new file mode 100644 index 0000000000000000000000000000000000000000..0bf659b93e74bb53003bc521f59c855d0ab8e692 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/paranamer-2.8.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/plexus-utils-3.2.1.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/plexus-utils-3.2.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..d749dd7256acf0748f47ffcb88df78f9e113a7e4 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/plexus-utils-3.2.1.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/reflections-0.9.12.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/reflections-0.9.12.jar new file mode 100644 index 0000000000000000000000000000000000000000..0f176b914126b6893fa8ae34ce21b2d710f60cae Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/reflections-0.9.12.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/rocksdbjni-5.18.4.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/rocksdbjni-5.18.4.jar new file mode 100644 index 0000000000000000000000000000000000000000..86ddb6e01d843af1956f1fbc4d070d056cc00a8c Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/rocksdbjni-5.18.4.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/scala-collection-compat_2.13-2.3.0.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/scala-collection-compat_2.13-2.3.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..cf5a1ea639da93205480fd3cb02a9ef537b9629d Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/scala-collection-compat_2.13-2.3.0.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/scala-java8-compat_2.13-0.9.1.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/scala-java8-compat_2.13-0.9.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..506333953adecdf8929446e1b69a32f1fa606230 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/scala-java8-compat_2.13-0.9.1.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/scala-library-2.13.5.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/scala-library-2.13.5.jar new file mode 100644 index 0000000000000000000000000000000000000000..1eb317d14db71a69da63d378882e093937b31b8d Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/scala-library-2.13.5.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/scala-logging_2.13-3.9.2.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/scala-logging_2.13-3.9.2.jar new file mode 100644 index 0000000000000000000000000000000000000000..1e4465168d033a52bec61ac3fdd5f430a61ecb6a Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/scala-logging_2.13-3.9.2.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/scala-reflect-2.13.5.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/scala-reflect-2.13.5.jar new file mode 100644 index 0000000000000000000000000000000000000000..ebd9e242e32320d733eb07ee6043f54f8f8b39e1 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/scala-reflect-2.13.5.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/slf4j-api-1.7.30.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/slf4j-api-1.7.30.jar new file mode 100644 index 0000000000000000000000000000000000000000..29ac26fb8cad7ef5934377a8c269c4e521520e5c Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/slf4j-api-1.7.30.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/slf4j-log4j12-1.7.30.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/slf4j-log4j12-1.7.30.jar new file mode 100644 index 0000000000000000000000000000000000000000..c6bc8b2efe5f92db94964defab9a80818758d613 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/slf4j-log4j12-1.7.30.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/snappy-java-1.1.8.1.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/snappy-java-1.1.8.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..896967f9bd87c47505c0bf7b22512e675acd8510 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/snappy-java-1.1.8.1.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/zookeeper-3.5.9.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/zookeeper-3.5.9.jar new file mode 100644 index 0000000000000000000000000000000000000000..f5eceaab89c99f8ebff3aeaf82dfc9355e7bb80e Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/zookeeper-3.5.9.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/zookeeper-jute-3.5.9.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/zookeeper-jute-3.5.9.jar new file mode 100644 index 0000000000000000000000000000000000000000..3c9c184a068aa5efdf64ba7767acd543653463d6 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/zookeeper-jute-3.5.9.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/libs/zstd-jni-1.4.9-1.jar b/hackfest/kafka/kafka_2.13-2.8.0/libs/zstd-jni-1.4.9-1.jar new file mode 100644 index 0000000000000000000000000000000000000000..5e88a7b99f71cf7ebe742c611187c99f5b41746d Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/libs/zstd-jni-1.4.9-1.jar differ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/licenses/CDDL+GPL-1.1 b/hackfest/kafka/kafka_2.13-2.8.0/licenses/CDDL+GPL-1.1 new file mode 100644 index 0000000000000000000000000000000000000000..4b156e6e78b43d59b07391bda0e39b62ca2f4e29 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/licenses/CDDL+GPL-1.1 @@ -0,0 +1,760 @@ +COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.1 + +1. Definitions. + + 1.1. "Contributor" means each individual or entity that creates or + contributes to the creation of Modifications. + + 1.2. "Contributor Version" means the combination of the Original + Software, prior Modifications used by a Contributor (if any), and + the Modifications made by that particular Contributor. + + 1.3. "Covered Software" means (a) the Original Software, or (b) + Modifications, or (c) the combination of files containing Original + Software with files containing Modifications, in each case including + portions thereof. + + 1.4. "Executable" means the Covered Software in any form other than + Source Code. + + 1.5. "Initial Developer" means the individual or entity that first + makes Original Software available under this License. + + 1.6. "Larger Work" means a work which combines Covered Software or + portions thereof with code not governed by the terms of this License. + + 1.7. "License" means this document. + + 1.8. "Licensable" means having the right to grant, to the maximum + extent possible, whether at the time of the initial grant or + subsequently acquired, any and all of the rights conveyed herein. + + 1.9. "Modifications" means the Source Code and Executable form of + any of the following: + + A. Any file that results from an addition to, deletion from or + modification of the contents of a file containing Original Software + or previous Modifications; + + B. Any new file that contains any part of the Original Software or + previous Modification; or + + C. Any new file that is contributed or otherwise made available + under the terms of this License. + + 1.10. "Original Software" means the Source Code and Executable form + of computer software code that is originally released under this + License. + + 1.11. "Patent Claims" means any patent claim(s), now owned or + hereafter acquired, including without limitation, method, process, + and apparatus claims, in any patent Licensable by grantor. + + 1.12. "Source Code" means (a) the common form of computer software + code in which modifications are made and (b) associated + documentation included in or with such code. + + 1.13. "You" (or "Your") means an individual or a legal entity + exercising rights under, and complying with all of the terms of, + this License. For legal entities, "You" includes any entity which + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants. + + 2.1. The Initial Developer Grant. + + Conditioned upon Your compliance with Section 3.1 below and subject + to third party intellectual property claims, the Initial Developer + hereby grants You a world-wide, royalty-free, non-exclusive license: + + (a) under intellectual property rights (other than patent or + trademark) Licensable by Initial Developer, to use, reproduce, + modify, display, perform, sublicense and distribute the Original + Software (or portions thereof), with or without Modifications, + and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, using or selling of + Original Software, to make, have made, use, practice, sell, and + offer for sale, and/or otherwise dispose of the Original Software + (or portions thereof). + + (c) The licenses granted in Sections 2.1(a) and (b) are effective on + the date Initial Developer first distributes or otherwise makes the + Original Software available to a third party under the terms of this + License. + + (d) Notwithstanding Section 2.1(b) above, no patent license is + granted: (1) for code that You delete from the Original Software, or + (2) for infringements caused by: (i) the modification of the + Original Software, or (ii) the combination of the Original Software + with other software or devices. + + 2.2. Contributor Grant. + + Conditioned upon Your compliance with Section 3.1 below and subject + to third party intellectual property claims, each Contributor hereby + grants You a world-wide, royalty-free, non-exclusive license: + + (a) under intellectual property rights (other than patent or + trademark) Licensable by Contributor to use, reproduce, modify, + display, perform, sublicense and distribute the Modifications + created by such Contributor (or portions thereof), either on an + unmodified basis, with other Modifications, as Covered Software + and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, using, or selling + of Modifications made by that Contributor either alone and/or in + combination with its Contributor Version (or portions of such + combination), to make, use, sell, offer for sale, have made, and/or + otherwise dispose of: (1) Modifications made by that Contributor (or + portions thereof); and (2) the combination of Modifications made by + that Contributor with its Contributor Version (or portions of such + combination). + + (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective + on the date Contributor first distributes or otherwise makes the + Modifications available to a third party. + + (d) Notwithstanding Section 2.2(b) above, no patent license is + granted: (1) for any code that Contributor has deleted from the + Contributor Version; (2) for infringements caused by: (i) third + party modifications of Contributor Version, or (ii) the combination + of Modifications made by that Contributor with other software + (except as part of the Contributor Version) or other devices; or (3) + under Patent Claims infringed by Covered Software in the absence of + Modifications made by that Contributor. + +3. Distribution Obligations. + + 3.1. Availability of Source Code. + + Any Covered Software that You distribute or otherwise make available + in Executable form must also be made available in Source Code form + and that Source Code form must be distributed only under the terms + of this License. You must include a copy of this License with every + copy of the Source Code form of the Covered Software You distribute + or otherwise make available. You must inform recipients of any such + Covered Software in Executable form as to how they can obtain such + Covered Software in Source Code form in a reasonable manner on or + through a medium customarily used for software exchange. + + 3.2. Modifications. + + The Modifications that You create or to which You contribute are + governed by the terms of this License. You represent that You + believe Your Modifications are Your original creation(s) and/or You + have sufficient rights to grant the rights conveyed by this License. + + 3.3. Required Notices. + + You must include a notice in each of Your Modifications that + identifies You as the Contributor of the Modification. You may not + remove or alter any copyright, patent or trademark notices contained + within the Covered Software, or any notices of licensing or any + descriptive text giving attribution to any Contributor or the + Initial Developer. + + 3.4. Application of Additional Terms. + + You may not offer or impose any terms on any Covered Software in + Source Code form that alters or restricts the applicable version of + this License or the recipients' rights hereunder. You may choose to + offer, and to charge a fee for, warranty, support, indemnity or + liability obligations to one or more recipients of Covered Software. + However, you may do so only on Your own behalf, and not on behalf of + the Initial Developer or any Contributor. You must make it + absolutely clear that any such warranty, support, indemnity or + liability obligation is offered by You alone, and You hereby agree + to indemnify the Initial Developer and every Contributor for any + liability incurred by the Initial Developer or such Contributor as a + result of warranty, support, indemnity or liability terms You offer. + + 3.5. Distribution of Executable Versions. + + You may distribute the Executable form of the Covered Software under + the terms of this License or under the terms of a license of Your + choice, which may contain terms different from this License, + provided that You are in compliance with the terms of this License + and that the license for the Executable form does not attempt to + limit or alter the recipient's rights in the Source Code form from + the rights set forth in this License. If You distribute the Covered + Software in Executable form under a different license, You must make + it absolutely clear that any terms which differ from this License + are offered by You alone, not by the Initial Developer or + Contributor. You hereby agree to indemnify the Initial Developer and + every Contributor for any liability incurred by the Initial + Developer or such Contributor as a result of any such terms You offer. + + 3.6. Larger Works. + + You may create a Larger Work by combining Covered Software with + other code not governed by the terms of this License and distribute + the Larger Work as a single product. In such a case, You must make + sure the requirements of this License are fulfilled for the Covered + Software. + +4. Versions of the License. + + 4.1. New Versions. + + Oracle is the initial license steward and may publish revised and/or + new versions of this License from time to time. Each version will be + given a distinguishing version number. Except as provided in Section + 4.3, no one other than the license steward has the right to modify + this License. + + 4.2. Effect of New Versions. + + You may always continue to use, distribute or otherwise make the + Covered Software available under the terms of the version of the + License under which You originally received the Covered Software. If + the Initial Developer includes a notice in the Original Software + prohibiting it from being distributed or otherwise made available + under any subsequent version of the License, You must distribute and + make the Covered Software available under the terms of the version + of the License under which You originally received the Covered + Software. Otherwise, You may also choose to use, distribute or + otherwise make the Covered Software available under the terms of any + subsequent version of the License published by the license steward. + + 4.3. Modified Versions. + + When You are an Initial Developer and You want to create a new + license for Your Original Software, You may create and use a + modified version of this License if You: (a) rename the license and + remove any references to the name of the license steward (except to + note that the license differs from this License); and (b) otherwise + make it clear that the license contains terms which differ from this + License. + +5. DISCLAIMER OF WARRANTY. + + COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, + INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE + IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR + NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF + THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE + DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY + OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, + REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN + ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS + AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + +6. TERMINATION. + + 6.1. This License and the rights granted hereunder will terminate + automatically if You fail to comply with terms herein and fail to + cure such breach within 30 days of becoming aware of the breach. + Provisions which, by their nature, must remain in effect beyond the + termination of this License shall survive. + + 6.2. If You assert a patent infringement claim (excluding + declaratory judgment actions) against Initial Developer or a + Contributor (the Initial Developer or Contributor against whom You + assert such claim is referred to as "Participant") alleging that the + Participant Software (meaning the Contributor Version where the + Participant is a Contributor or the Original Software where the + Participant is the Initial Developer) directly or indirectly + infringes any patent, then any and all rights granted directly or + indirectly to You by such Participant, the Initial Developer (if the + Initial Developer is not the Participant) and all Contributors under + Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice + from Participant terminate prospectively and automatically at the + expiration of such 60 day notice period, unless if within such 60 + day period You withdraw Your claim with respect to the Participant + Software against such Participant either unilaterally or pursuant to + a written agreement with Participant. + + 6.3. If You assert a patent infringement claim against Participant + alleging that the Participant Software directly or indirectly + infringes any patent where such claim is resolved (such as by + license or settlement) prior to the initiation of patent + infringement litigation, then the reasonable value of the licenses + granted by such Participant under Sections 2.1 or 2.2 shall be taken + into account in determining the amount or value of any payment or + license. + + 6.4. In the event of termination under Sections 6.1 or 6.2 above, + all end user licenses that have been validly granted by You or any + distributor hereunder prior to termination (excluding licenses + granted to You by any distributor) shall survive termination. + +7. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT + (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE + INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF + COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE + TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR + CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT + LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER + FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR + LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE + POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT + APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH + PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH + LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR + LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION + AND LIMITATION MAY NOT APPLY TO YOU. + +8. U.S. GOVERNMENT END USERS. + + The Covered Software is a "commercial item," as that term is defined + in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer + software" (as that term is defined at 48 C.F.R. § + 252.227-7014(a)(1)) and "commercial computer software documentation" + as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent + with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 + (June 1995), all U.S. Government End Users acquire Covered Software + with only those rights set forth herein. This U.S. Government Rights + clause is in lieu of, and supersedes, any other FAR, DFAR, or other + clause or provision that addresses Government rights in computer + software under this License. + +9. MISCELLANEOUS. + + This License represents the complete agreement concerning subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the extent + necessary to make it enforceable. This License shall be governed by + the law of the jurisdiction specified in a notice contained within + the Original Software (except to the extent applicable law, if any, + provides otherwise), excluding such jurisdiction's conflict-of-law + provisions. Any litigation relating to this License shall be subject + to the jurisdiction of the courts located in the jurisdiction and + venue specified in a notice contained within the Original Software, + with the losing party responsible for costs, including, without + limitation, court costs and reasonable attorneys' fees and expenses. + The application of the United Nations Convention on Contracts for + the International Sale of Goods is expressly excluded. Any law or + regulation which provides that the language of a contract shall be + construed against the drafter shall not apply to this License. You + agree that You alone are responsible for compliance with the United + States export administration regulations (and the export control + laws and regulation of any other countries) when You use, distribute + or otherwise make available any Covered Software. + +10. RESPONSIBILITY FOR CLAIMS. + + As between Initial Developer and the Contributors, each party is + responsible for claims and damages arising, directly or indirectly, + out of its utilization of rights under this License and You agree to + work with Initial Developer and Contributors to distribute such + responsibility on an equitable basis. Nothing herein is intended or + shall be deemed to constitute any admission of liability. + +------------------------------------------------------------------------ + +NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION +LICENSE (CDDL) + +The code released under the CDDL shall be governed by the laws of the +State of California (excluding conflict-of-law provisions). Any +litigation relating to this License shall be subject to the jurisdiction +of the Federal Courts of the Northern District of California and the +state courts of the State of California, with venue lying in Santa Clara +County, California. + + + + The GNU General Public License (GPL) Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor +Boston, MA 02110-1335 +USA + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away your freedom to +share and change it. By contrast, the GNU General Public License is +intended to guarantee your freedom to share and change free software--to +make sure the software is free for all its users. This General Public +License applies to most of the Free Software Foundation's software and +to any other program whose authors commit to using it. (Some other Free +Software Foundation software is covered by the GNU Library General +Public License instead.) You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not price. +Our General Public Licenses are designed to make sure that you have the +freedom to distribute copies of free software (and charge for this +service if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid anyone +to deny you these rights or to ask you to surrender the rights. These +restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis +or for a fee, you must give the recipients all the rights that you have. +You must make sure that they, too, receive or can get the source code. +And you must show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software patents. +We wish to avoid the danger that redistributors of a free program will +individually obtain patent licenses, in effect making the program +proprietary. To prevent this, we have made it clear that any patent must +be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains a +notice placed by the copyright holder saying it may be distributed under +the terms of this General Public License. The "Program", below, refers +to any such program or work, and a "work based on the Program" means +either the Program or any derivative work under copyright law: that is +to say, a work containing the Program or a portion of it, either +verbatim or with modifications and/or translated into another language. +(Hereinafter, translation is included without limitation in the term +"modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of running +the Program is not restricted, and the output from the Program is +covered only if its contents constitute a work based on the Program +(independent of having been made by running the Program). Whether that +is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's source +code as you receive it, in any medium, provided that you conspicuously +and appropriately publish on each copy an appropriate copyright notice +and disclaimer of warranty; keep intact all the notices that refer to +this License and to the absence of any warranty; and give any other +recipients of the Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of +it, thus forming a work based on the Program, and copy and distribute +such modifications or work under the terms of Section 1 above, provided +that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any part + thereof, to be licensed as a whole at no charge to all third parties + under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a notice + that there is no warranty (or else, saying that you provide a + warranty) and that users may redistribute the program under these + conditions, and telling the user how to view a copy of this License. + (Exception: if the Program itself is interactive but does not + normally print such an announcement, your work based on the Program + is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, and +can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based on +the Program, the distribution of the whole must be on the terms of this +License, whose permissions for other licensees extend to the entire +whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of a +storage or distribution medium does not bring the other work under the +scope of this License. + +3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections 1 + and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your cost + of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer to + distribute corresponding source code. (This alternative is allowed + only for noncommercial distribution and only if you received the + program in object code or executable form with such an offer, in + accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source code +means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to control +compilation and installation of the executable. However, as a special +exception, the source code distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies the +executable. + +If distribution of executable or object code is made by offering access +to copy from a designated place, then offering equivalent access to copy +the source code from the same place counts as distribution of the source +code, even though third parties are not compelled to copy the source +along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt otherwise +to copy, modify, sublicense or distribute the Program is void, and will +automatically terminate your rights under this License. However, parties +who have received copies, or rights, from you under this License will +not have their licenses terminated so long as such parties remain in +full compliance. + +5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and all +its terms and conditions for copying, distributing or modifying the +Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further restrictions +on the recipients' exercise of the rights granted herein. You are not +responsible for enforcing compliance by third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot distribute +so as to satisfy simultaneously your obligations under this License and +any other pertinent obligations, then as a consequence you may not +distribute the Program at all. For example, if a patent license would +not permit royalty-free redistribution of the Program by all those who +receive copies directly or indirectly through you, then the only way you +could satisfy both it and this License would be to refrain entirely from +distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is implemented +by public license practices. Many people have made generous +contributions to the wide range of software distributed through that +system in reliance on consistent application of that system; it is up to +the author/donor to decide if he or she is willing to distribute +software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be +a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License may +add an explicit geographical distribution limitation excluding those +countries, so that distribution is permitted only in or among countries +not thus excluded. In such case, this License incorporates the +limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new +versions of the General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Program does not specify a version +number of this License, you may choose any version ever published by the +Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the +author to ask for permission. For software which is copyrighted by the +Free Software Foundation, write to the Free Software Foundation; we +sometimes make exceptions for this. Our decision will be guided by the +two goals of preserving the free status of all derivatives of our free +software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, +EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE +ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH +YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL +NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR +DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL +DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM +(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED +INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF +THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR +OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to +attach them to the start of each source file to most effectively convey +the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + One line to give the program's name and a brief idea of what it does. + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type + `show w'. This is free software, and you are welcome to redistribute + it under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the +appropriate parts of the General Public License. Of course, the commands +you use may be called something other than `show w' and `show c'; they +could even be mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + program `Gnomovision' (which makes passes at compilers) written by + James Hacker. + + signature of Ty Coon, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications +with the library. If this is what you want to do, use the GNU Library +General Public License instead of this License. + +# + +Certain source files distributed by Oracle America, Inc. and/or its +affiliates are subject to the following clarification and special +exception to the GPLv2, based on the GNU Project exception for its +Classpath libraries, known as the GNU Classpath Exception, but only +where Oracle has expressly included in the particular source file's +header the words "Oracle designates this particular file as subject to +the "Classpath" exception as provided by Oracle in the LICENSE file +that accompanied this code." + +You should also note that Oracle includes multiple, independent +programs in this software package. Some of those programs are provided +under licenses deemed incompatible with the GPLv2 by the Free Software +Foundation and others. For example, the package includes programs +licensed under the Apache License, Version 2.0. Such programs are +licensed to you under their original licenses. + +Oracle facilitates your further distribution of this package by adding +the Classpath Exception to the necessary parts of its GPLv2 code, which +permits you to use that code in combination with other independent +modules not licensed under the GPLv2. However, note that this would +not permit you to commingle code under an incompatible license with +Oracle's GPLv2 licensed code by, for example, cutting and pasting such +code into a file also containing Oracle's GPLv2 licensed code and then +distributing the result. Additionally, if you were to remove the +Classpath Exception from any of the files to which it applies and +distribute the result, you would likely be required to license some or +all of the other code in that distribution under the GPLv2 as well, and +since the GPLv2 is incompatible with the license terms of some items +included in the distribution by Oracle, removing the Classpath +Exception could therefore effectively compromise your ability to +further distribute the package. + +Proceed with caution and we recommend that you obtain the advice of a +lawyer skilled in open source matters before removing the Classpath +Exception or making modifications to this package which may +subsequently be redistributed and/or involve the use of third party +software. + +CLASSPATH EXCEPTION +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License version 2 cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from or +based on this library. If you modify this library, you may extend this +exception to your version of the library, but you are not obligated to +do so. If you do not wish to do so, delete this exception statement +from your version. + diff --git a/hackfest/kafka/kafka_2.13-2.8.0/licenses/DWTFYWTPL b/hackfest/kafka/kafka_2.13-2.8.0/licenses/DWTFYWTPL new file mode 100644 index 0000000000000000000000000000000000000000..5a8e332545f667aab9bf3a17f11dba27c70b656a --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/licenses/DWTFYWTPL @@ -0,0 +1,14 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. + diff --git a/hackfest/kafka/kafka_2.13-2.8.0/licenses/argparse-MIT b/hackfest/kafka/kafka_2.13-2.8.0/licenses/argparse-MIT new file mode 100644 index 0000000000000000000000000000000000000000..773b0df0e35919182940e77905607e6219243028 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/licenses/argparse-MIT @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2011-2017 Tatsuhiro Tsujikawa + * + * 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. + */ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/licenses/eclipse-distribution-license-1.0 b/hackfest/kafka/kafka_2.13-2.8.0/licenses/eclipse-distribution-license-1.0 new file mode 100644 index 0000000000000000000000000000000000000000..5f06513abf5fedd6b0d480ab36a2f941ba1b4545 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/licenses/eclipse-distribution-license-1.0 @@ -0,0 +1,13 @@ +Eclipse Distribution License - v 1.0 + +Copyright (c) 2007, Eclipse Foundation, Inc. and its licensors. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +* Neither the name of the Eclipse Foundation, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/hackfest/kafka/kafka_2.13-2.8.0/licenses/eclipse-public-license-2.0 b/hackfest/kafka/kafka_2.13-2.8.0/licenses/eclipse-public-license-2.0 new file mode 100644 index 0000000000000000000000000000000000000000..c9f1425f82d02665b3ecd4d24b84e86437e7ea8a --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/licenses/eclipse-public-license-2.0 @@ -0,0 +1,87 @@ +Eclipse Public License - v 2.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. +1. DEFINITIONS + +“Contribution” means: + + a) in the case of the initial Contributor, the initial content Distributed under this Agreement, and + b) in the case of each subsequent Contributor: + i) changes to the Program, and + ii) additions to the Program; + where such changes and/or additions to the Program originate from and are Distributed by that particular Contributor. A Contribution “originates” from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include changes or additions to the Program that are not Modified Works. + +“Contributor” means any person or entity that Distributes the Program. + +“Licensed Patents” mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. + +“Program” means the Contributions Distributed in accordance with this Agreement. + +“Recipient” means anyone who receives the Program under this Agreement or any Secondary License (as applicable), including Contributors. + +“Derivative Works” shall mean any work, whether in Source Code or other form, that is based on (or derived from) the Program and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. + +“Modified Works” shall mean any work in Source Code or other form that results from an addition to, deletion from, or modification of the contents of the Program, including, for purposes of clarity any new file in Source Code form that contains any contents of the Program. Modified Works shall not include works that contain only declarations, interfaces, types, classes, structures, or files of the Program solely in each case in order to link to, bind by name, or subclass the Program or Modified Works thereof. + +“Distribute” means the acts of a) distributing or b) making available in any manner that enables the transfer of a copy. + +“Source Code” means the form of a Program preferred for making modifications, including but not limited to software source code, documentation source, and configuration files. + +“Secondary License” means either the GNU General Public License, Version 2.0, or any later versions of that license, including any exceptions or additional permissions as identified by the initial Contributor. +2. GRANT OF RIGHTS + + a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, Distribute and sublicense the Contribution of such Contributor, if any, and such Derivative Works. + b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in Source Code or other form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. + c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to Distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. + d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. + e) Notwithstanding the terms of any Secondary License, no Contributor makes additional grants to any Recipient (other than those set forth in this Agreement) as a result of such Recipient's receipt of the Program under the terms of a Secondary License (if permitted under the terms of Section 3). + +3. REQUIREMENTS + +3.1 If a Contributor Distributes the Program in any form, then: + + a) the Program must also be made available as Source Code, in accordance with section 3.2, and the Contributor must accompany the Program with a statement that the Source Code for the Program is available under this Agreement, and informs Recipients how to obtain it in a reasonable manner on or through a medium customarily used for software exchange; and + b) the Contributor may Distribute the Program under a license different than this Agreement, provided that such license: + i) effectively disclaims on behalf of all other Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; + ii) effectively excludes on behalf of all other Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; + iii) does not attempt to limit or alter the recipients' rights in the Source Code under section 3.2; and + iv) requires any subsequent distribution of the Program by any party to be under a license that satisfies the requirements of this section 3. + +3.2 When the Program is Distributed as Source Code: + + a) it must be made available under this Agreement, or if the Program (i) is combined with other material in a separate file or files made available under a Secondary License, and (ii) the initial Contributor attached to the Source Code the notice described in Exhibit A of this Agreement, then the Program may be made available under the terms of such Secondary Licenses, and + b) a copy of this Agreement must be included with each copy of the Program. + +3.3 Contributors may not remove or alter any copyright, patent, trademark, attribution notices, disclaimers of warranty, or limitations of liability (‘notices’) contained within the Program from any copy of the Program which they Distribute, provided that Contributors may add their own appropriate notices. +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor (“Commercial Contributor”) hereby agrees to defend and indemnify every other Contributor (“Indemnified Contributor”) against any losses, damages and costs (collectively “Losses”) arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be Distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to Distribute the Program (including its Contributions) under the new version. + +Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. Nothing in this Agreement is intended to be enforceable by any entity that is not a Contributor or Recipient. No third-party beneficiary rights are created under this Agreement. +Exhibit A – Form of Secondary Licenses Notice + +“This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), version(s), and exceptions or additional permissions here}.” + + Simply including a copy of this Agreement, including this Exhibit A is not sufficient to license the Source Code under Secondary Licenses. + + If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. + + You may add additional accurate notices of copyright ownership. + diff --git a/hackfest/kafka/kafka_2.13-2.8.0/licenses/jopt-simple-MIT b/hackfest/kafka/kafka_2.13-2.8.0/licenses/jopt-simple-MIT new file mode 100644 index 0000000000000000000000000000000000000000..54b27325bb6b2b92043e23932329dc2ef107e291 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/licenses/jopt-simple-MIT @@ -0,0 +1,24 @@ +/* + The MIT License + + Copyright (c) 2004-2016 Paul R. Holser, Jr. + + 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. +*/ diff --git a/hackfest/kafka/kafka_2.13-2.8.0/licenses/paranamer-BSD-3-clause b/hackfest/kafka/kafka_2.13-2.8.0/licenses/paranamer-BSD-3-clause new file mode 100644 index 0000000000000000000000000000000000000000..9eab87918636a2933a9e780689d08839f515c898 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/licenses/paranamer-BSD-3-clause @@ -0,0 +1,29 @@ +[ ParaNamer used to be 'Pubic Domain', but since it includes a small piece of ASM it is now the same license as that: BSD ] + + Portions copyright (c) 2006-2018 Paul Hammant & ThoughtWorks Inc + Portions copyright (c) 2000-2007 INRIA, France Telecom + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + THE POSSIBILITY OF SUCH DAMAGE. diff --git a/hackfest/kafka/kafka_2.13-2.8.0/licenses/slf4j-MIT b/hackfest/kafka/kafka_2.13-2.8.0/licenses/slf4j-MIT new file mode 100644 index 0000000000000000000000000000000000000000..315bd4979f1558116a47bf33cea913c2b60c39f3 --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/licenses/slf4j-MIT @@ -0,0 +1,24 @@ +Copyright (c) 2004-2017 QOS.ch +All rights reserved. + +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. + + + diff --git a/hackfest/kafka/kafka_2.13-2.8.0/licenses/zstd-jni-BSD-2-clause b/hackfest/kafka/kafka_2.13-2.8.0/licenses/zstd-jni-BSD-2-clause new file mode 100644 index 0000000000000000000000000000000000000000..66abb8ae782c862428611d37f6c646cf9cc50fca --- /dev/null +++ b/hackfest/kafka/kafka_2.13-2.8.0/licenses/zstd-jni-BSD-2-clause @@ -0,0 +1,26 @@ +Zstd-jni: JNI bindings to Zstd Library + +Copyright (c) 2015-present, Luben Karavelov/ All rights reserved. + +BSD License + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/hackfest/kafka/kafka_2.13-2.8.0/logs/.gitkeep b/hackfest/kafka/kafka_2.13-2.8.0/logs/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/hackfest/kafka/kafka_2.13-2.8.0/site-docs/kafka_2.13-2.8.0-site-docs.tgz b/hackfest/kafka/kafka_2.13-2.8.0/site-docs/kafka_2.13-2.8.0-site-docs.tgz new file mode 100644 index 0000000000000000000000000000000000000000..0d17c747bb0dad60e3815b7073d8b6a0c3c0cdc6 Binary files /dev/null and b/hackfest/kafka/kafka_2.13-2.8.0/site-docs/kafka_2.13-2.8.0-site-docs.tgz differ diff --git a/hackfest/kafka/pub.py b/hackfest/kafka/pub.py new file mode 100644 index 0000000000000000000000000000000000000000..e80dd5db82632b9ef17e7fdf017b8964ab357623 --- /dev/null +++ b/hackfest/kafka/pub.py @@ -0,0 +1,26 @@ +# 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 time import sleep +from json import dumps +from kafka import KafkaProducer + +producer = KafkaProducer(bootstrap_servers=['localhost:9092'], + value_serializer=lambda x: + dumps(x).encode('utf-8')) + +for e in range(10): + data = {'number' : e} + producer.send('my-topic', value=data) + sleep(5) diff --git a/hackfest/kafka/sub.py b/hackfest/kafka/sub.py new file mode 100644 index 0000000000000000000000000000000000000000..233b9f9d0c8b4a4a744859beeaff0141c04e0560 --- /dev/null +++ b/hackfest/kafka/sub.py @@ -0,0 +1,30 @@ +# 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 kafka import KafkaConsumer +from json import loads + +consumer = KafkaConsumer( + 'my-topic', + bootstrap_servers=['localhost:9092'], + auto_offset_reset='earliest', + enable_auto_commit=True, + group_id='my-group', + value_deserializer=lambda x: loads(x.decode('utf-8'))) + + +for message in consumer: + message = message.value + print('{} received'.format(message)) + diff --git a/src/compute/tests/mock_osm/MockOSM.py b/hackfest/mock_osm/MockOSM.py similarity index 97% rename from src/compute/tests/mock_osm/MockOSM.py rename to hackfest/mock_osm/MockOSM.py index b4e629d5845fd7115fa0fa2c0887eca1c7c816c4..338db0e19becc8a9dd277beec7f3b4ceb2e765a3 100644 --- a/src/compute/tests/mock_osm/MockOSM.py +++ b/hackfest/mock_osm/MockOSM.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/compute/tests/mock_osm/WimconnectorIETFL2VPN.py b/hackfest/mock_osm/WimconnectorIETFL2VPN.py similarity index 60% rename from src/compute/tests/mock_osm/WimconnectorIETFL2VPN.py rename to hackfest/mock_osm/WimconnectorIETFL2VPN.py index d5ce65a1e4fcc5c47f90fb35e21023b28cb3c8ee..aa4ca045f41ffdc69d2ebf2fcd9b5db99ce45dbe 100644 --- a/src/compute/tests/mock_osm/WimconnectorIETFL2VPN.py +++ b/hackfest/mock_osm/WimconnectorIETFL2VPN.py @@ -33,6 +33,7 @@ the Layer 2 service. import requests import uuid import logging +import copy #from osm_ro_plugin.sdnconn import SdnConnectorBase, SdnConnectorError from .sdnconn import SdnConnectorBase, SdnConnectorError @@ -72,7 +73,7 @@ class WimconnectorIETFL2VPN(SdnConnectorBase): response = requests.get(endpoint, auth=self.auth) http_code = response.status_code except requests.exceptions.RequestException as e: - raise SdnConnectorError(e.message, http_code=503) + raise SdnConnectorError(e.response, http_code=503) if http_code != 200: raise SdnConnectorError("Failed while authenticating", http_code=http_code) @@ -164,178 +165,221 @@ class WimconnectorIETFL2VPN(SdnConnectorBase): Raises: SdnConnectorException: In case of error. """ - if service_type == "ELINE": - if len(connection_points) > 2: - raise SdnConnectorError( - "Connections between more than 2 endpoints are not supported" + SETTINGS = { # min_endpoints, max_endpoints, vpn_service_type + 'ELINE': (2, 2, 'vpws'), # Virtual Private Wire Service + 'ELAN' : (2, None, 'vpls'), # Virtual Private LAN Service + } + settings = SETTINGS.get(service_type) + if settings is None: raise NotImplementedError('Unsupported service_type({:s})'.format(str(service_type))) + min_endpoints, max_endpoints, vpn_service_type = settings + + if max_endpoints is not None and len(connection_points) > max_endpoints: + msg = "Connections between more than {:d} endpoints are not supported for service_type {:s}" + raise SdnConnectorError(msg.format(max_endpoints, service_type)) + + if min_endpoints is not None and len(connection_points) < min_endpoints: + msg = "Connections must be of at least {:d} endpoints for service_type {:s}" + raise SdnConnectorError(msg.format(min_endpoints, service_type)) + + """First step, create the vpn service""" + uuid_l2vpn = str(uuid.uuid4()) + vpn_service = {} + vpn_service["vpn-id"] = uuid_l2vpn + vpn_service["vpn-svc-type"] = vpn_service_type + vpn_service["svc-topo"] = "any-to-any" + vpn_service["customer-name"] = "osm" + vpn_service_list = [] + vpn_service_list.append(vpn_service) + vpn_service_l = {"ietf-l2vpn-svc:vpn-service": vpn_service_list} + response_service_creation = None + conn_info = [] + self.logger.info("Sending vpn-service :{}".format(vpn_service_l)) + + try: + endpoint_service_creation = ( + "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/vpn-services".format( + self.wim["wim_url"] ) + ) + response_service_creation = requests.post( + endpoint_service_creation, + headers=self.headers, + json=vpn_service_l, + auth=self.auth, + ) + except requests.exceptions.ConnectionError: + raise SdnConnectorError( + "Request to create service Timeout", http_code=408 + ) + + if response_service_creation.status_code == 409: + raise SdnConnectorError( + "Service already exists", + http_code=response_service_creation.status_code, + ) + elif response_service_creation.status_code != requests.codes.created: + raise SdnConnectorError( + "Request to create service not accepted", + http_code=response_service_creation.status_code, + ) + + self.logger.info('connection_points = {:s}'.format(str(connection_points))) + + # Check if protected paths are requested + extended_connection_points = [] + for connection_point in connection_points: + extended_connection_points.append(connection_point) + + connection_point_wan_info = self.search_mapp(connection_point) + service_mapping_info = connection_point_wan_info.get('service_mapping_info', {}) + redundant_service_endpoint_ids = service_mapping_info.get('redundant') + + if redundant_service_endpoint_ids is None: continue + if len(redundant_service_endpoint_ids) == 0: continue + + for redundant_service_endpoint_id in redundant_service_endpoint_ids: + redundant_connection_point = copy.deepcopy(connection_point) + redundant_connection_point['service_endpoint_id'] = redundant_service_endpoint_id + extended_connection_points.append(redundant_connection_point) + + self.logger.info('extended_connection_points = {:s}'.format(str(extended_connection_points))) + + """Second step, create the connections and vpn attachments""" + for connection_point in extended_connection_points: + connection_point_wan_info = self.search_mapp(connection_point) + site_network_access = {} + connection = {} + + if connection_point["service_endpoint_encapsulation_type"] != "none": + if ( + connection_point["service_endpoint_encapsulation_type"] + == "dot1q" + ): + """The connection is a VLAN""" + connection["encapsulation-type"] = "dot1q-vlan-tagged" + tagged = {} + tagged_interf = {} + service_endpoint_encapsulation_info = connection_point[ + "service_endpoint_encapsulation_info" + ] + + if service_endpoint_encapsulation_info["vlan"] is None: + raise SdnConnectorError("VLAN must be provided") + + tagged_interf["cvlan-id"] = service_endpoint_encapsulation_info[ + "vlan" + ] + tagged["dot1q-vlan-tagged"] = tagged_interf + connection["tagged-interface"] = tagged + else: + raise NotImplementedError("Encapsulation type not implemented") + + site_network_access["connection"] = connection + self.logger.info("Sending connection:{}".format(connection)) + vpn_attach = {} + vpn_attach["vpn-id"] = uuid_l2vpn + vpn_attach["site-role"] = vpn_service["svc-topo"] + "-role" + site_network_access["vpn-attachment"] = vpn_attach + self.logger.info("Sending vpn-attachement :{}".format(vpn_attach)) + uuid_sna = str(uuid.uuid4()) + site_network_access["network-access-id"] = uuid_sna + site_network_access["bearer"] = connection_point_wan_info[ + "service_mapping_info" + ]["bearer"] - if len(connection_points) < 2: - raise SdnConnectorError("Connections must be of at least 2 endpoints") - - """First step, create the vpn service""" - uuid_l2vpn = str(uuid.uuid4()) - vpn_service = {} - vpn_service["vpn-id"] = uuid_l2vpn - vpn_service["vpn-svc-type"] = "vpws" # Rename "vpn-scv-type" -> "vpn-svc-type" - vpn_service["svc-topo"] = "any-to-any" - vpn_service["customer-name"] = "osm" - vpn_service_list = [] - vpn_service_list.append(vpn_service) - vpn_service_l = {"ietf-l2vpn-svc:vpn-service": vpn_service_list} - response_service_creation = None - conn_info = [] - self.logger.info("Sending vpn-service :{}".format(vpn_service_l)) + access_priority = connection_point_wan_info["service_mapping_info"].get("priority") + if access_priority is not None: + availability = {} + availability["access-priority"] = access_priority + availability["single-active"] = [None] + site_network_access["availability"] = availability + + constraint = {} + constraint['constraint-type'] = 'end-to-end-diverse' + constraint['target'] = {'all-other-accesses': [None]} + + access_diversity = {} + access_diversity['constraints'] = {'constraint': []} + access_diversity['constraints']['constraint'].append(constraint) + site_network_access["access-diversity"] = access_diversity + + site_network_accesses = {} + site_network_access_list = [] + site_network_access_list.append(site_network_access) + site_network_accesses[ + "ietf-l2vpn-svc:site-network-access" + ] = site_network_access_list + conn_info_d = {} + conn_info_d["site"] = connection_point_wan_info["service_mapping_info"][ + "site-id" + ] + conn_info_d["site-network-access-id"] = site_network_access[ + "network-access-id" + ] + conn_info_d["mapping"] = None + conn_info.append(conn_info_d) try: - endpoint_service_creation = ( - "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/vpn-services".format( - self.wim["wim_url"] + endpoint_site_network_access_creation = ( + "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/" + "sites/site={}/site-network-accesses/".format( + self.wim["wim_url"], + connection_point_wan_info["service_mapping_info"][ + "site-id" + ], ) ) - response_service_creation = requests.post( - endpoint_service_creation, + response_endpoint_site_network_access_creation = requests.post( + endpoint_site_network_access_creation, headers=self.headers, - json=vpn_service_l, + json=site_network_accesses, auth=self.auth, ) - except requests.exceptions.ConnectionError: - raise SdnConnectorError( - "Request to create service Timeout", http_code=408 - ) - if response_service_creation.status_code == 409: - raise SdnConnectorError( - "Service already exists", - http_code=response_service_creation.status_code, - ) - elif response_service_creation.status_code != requests.codes.created: - raise SdnConnectorError( - "Request to create service not accepted", - http_code=response_service_creation.status_code, - ) + if ( + response_endpoint_site_network_access_creation.status_code + == 409 + ): + self.delete_connectivity_service(vpn_service["vpn-id"]) - """Second step, create the connections and vpn attachments""" - for connection_point in connection_points: - connection_point_wan_info = self.search_mapp(connection_point) - site_network_access = {} - connection = {} - - if connection_point["service_endpoint_encapsulation_type"] != "none": - if ( - connection_point["service_endpoint_encapsulation_type"] - == "dot1q" - ): - """The connection is a VLAN""" - connection["encapsulation-type"] = "dot1q-vlan-tagged" - tagged = {} - tagged_interf = {} - service_endpoint_encapsulation_info = connection_point[ - "service_endpoint_encapsulation_info" - ] - - if service_endpoint_encapsulation_info["vlan"] is None: - raise SdnConnectorError("VLAN must be provided") - - tagged_interf["cvlan-id"] = service_endpoint_encapsulation_info[ - "vlan" - ] - tagged["dot1q-vlan-tagged"] = tagged_interf - connection["tagged-interface"] = tagged - else: - raise NotImplementedError("Encapsulation type not implemented") - - site_network_access["connection"] = connection - self.logger.info("Sending connection:{}".format(connection)) - vpn_attach = {} - vpn_attach["vpn-id"] = uuid_l2vpn - vpn_attach["site-role"] = vpn_service["svc-topo"] + "-role" - site_network_access["vpn-attachment"] = vpn_attach - self.logger.info("Sending vpn-attachement :{}".format(vpn_attach)) - uuid_sna = str(uuid.uuid4()) - site_network_access["network-access-id"] = uuid_sna - site_network_access["bearer"] = connection_point_wan_info[ - "service_mapping_info" - ]["bearer"] - site_network_accesses = {} - site_network_access_list = [] - site_network_access_list.append(site_network_access) - site_network_accesses[ - "ietf-l2vpn-svc:site-network-access" - ] = site_network_access_list - conn_info_d = {} - conn_info_d["site"] = connection_point_wan_info["service_mapping_info"][ - "site-id" - ] - conn_info_d["site-network-access-id"] = site_network_access[ - "network-access-id" - ] - conn_info_d["mapping"] = None - conn_info.append(conn_info_d) - - try: - endpoint_site_network_access_creation = ( - "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/" - "sites/site={}/site-network-accesses/".format( - self.wim["wim_url"], + raise SdnConnectorError( + "Site_Network_Access with ID '{}' already exists".format( + site_network_access["network-access-id"] + ), + http_code=response_endpoint_site_network_access_creation.status_code, + ) + elif ( + response_endpoint_site_network_access_creation.status_code + == 400 + ): + self.delete_connectivity_service(vpn_service["vpn-id"]) + + raise SdnConnectorError( + "Site {} does not exist".format( connection_point_wan_info["service_mapping_info"][ "site-id" - ], - ) - ) - response_endpoint_site_network_access_creation = requests.post( - endpoint_site_network_access_creation, - headers=self.headers, - json=site_network_accesses, - auth=self.auth, + ] + ), + http_code=response_endpoint_site_network_access_creation.status_code, ) - - if ( - response_endpoint_site_network_access_creation.status_code - == 409 - ): - self.delete_connectivity_service(vpn_service["vpn-id"]) - - raise SdnConnectorError( - "Site_Network_Access with ID '{}' already exists".format( - site_network_access["network-access-id"] - ), - http_code=response_endpoint_site_network_access_creation.status_code, - ) - elif ( - response_endpoint_site_network_access_creation.status_code - == 400 - ): - self.delete_connectivity_service(vpn_service["vpn-id"]) - - raise SdnConnectorError( - "Site {} does not exist".format( - connection_point_wan_info["service_mapping_info"][ - "site-id" - ] - ), - http_code=response_endpoint_site_network_access_creation.status_code, - ) - elif ( - response_endpoint_site_network_access_creation.status_code - != requests.codes.created - and response_endpoint_site_network_access_creation.status_code - != requests.codes.no_content - ): - self.delete_connectivity_service(vpn_service["vpn-id"]) - - raise SdnConnectorError( - "Request no accepted", - http_code=response_endpoint_site_network_access_creation.status_code, - ) - except requests.exceptions.ConnectionError: + elif ( + response_endpoint_site_network_access_creation.status_code + != requests.codes.created + and response_endpoint_site_network_access_creation.status_code + != requests.codes.no_content + ): self.delete_connectivity_service(vpn_service["vpn-id"]) - raise SdnConnectorError("Request Timeout", http_code=408) + raise SdnConnectorError( + "Request not accepted", + http_code=response_endpoint_site_network_access_creation.status_code, + ) + except requests.exceptions.ConnectionError: + self.delete_connectivity_service(vpn_service["vpn-id"]) - return uuid_l2vpn, conn_info - else: - raise NotImplementedError + raise SdnConnectorError("Request Timeout", http_code=408) + + return uuid_l2vpn, conn_info def delete_connectivity_service(self, service_uuid, conn_info=None): """Disconnect multi-site endpoints previously connected diff --git a/src/common/orm/backend/inmemory/__init__.py b/hackfest/mock_osm/__init__.py similarity index 88% rename from src/common/orm/backend/inmemory/__init__.py rename to hackfest/mock_osm/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/common/orm/backend/inmemory/__init__.py +++ b/hackfest/mock_osm/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hackfest/mock_osm/__main__.py b/hackfest/mock_osm/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..669da2b5e6a1729f35d2958f2d7aa68c0413287d --- /dev/null +++ b/hackfest/mock_osm/__main__.py @@ -0,0 +1,94 @@ +# 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 cmd, logging +from .MockOSM import MockOSM + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +WIM_URL = 'http://10.0.2.10:80' +WIM_USERNAME = 'admin' +WIM_PASSWORD = 'admin' + +# Ref: https://osm.etsi.org/wikipub/index.php/WIM +def create_port_mapping(device_id, port_id, service_endpoint_id, site_id): + bearer_ref = '{:s}:{:s}'.format(device_id, port_id) + return { + 'device-id' : device_id, # pop_switch_dpid + 'service_endpoint_id' : service_endpoint_id, # wan_service_endpoint_id + 'service_mapping_info': { # wan_service_mapping_info, other extra info + 'bearer': {'bearer-reference': bearer_ref}, + 'site-id': site_id, + }, + } + +WIM_PORT_MAPPING = [ + create_port_mapping('R1', '1/2', 'ep-R1-1/2', '1'), + create_port_mapping('R1', '1/3', 'ep-R1-1/3', '1'), + create_port_mapping('R2', '1/2', 'ep-R2-1/2', '2'), + create_port_mapping('R2', '1/3', 'ep-R2-1/3', '2'), + create_port_mapping('R3', '1/2', 'ep-R3-1/2', '3'), + create_port_mapping('R3', '1/3', 'ep-R3-1/3', '3'), + create_port_mapping('R4', '1/2', 'ep-R4-1/2', '4'), + create_port_mapping('R4', '1/3', 'ep-R4-1/3', '4'), +] + +SERVICE_TYPE = 'ELINE' +SERVICE_CONNECTION_POINTS = [ + {'service_endpoint_id': 'ep-R1-1/2', + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': 1234}}, + {'service_endpoint_id': 'ep-R4-1/3', + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': 1234}}, +] + +class MockOSMShell(cmd.Cmd): + intro = 'Welcome to the MockOSM shell.\nType help or ? to list commands.\n' + prompt = '(mock-osm) ' + file = None + + def __init__(self, *args, **kwargs) -> None: + super().__init__(*args, **kwargs) + self.mock_osm = MockOSM(WIM_URL, WIM_PORT_MAPPING, WIM_USERNAME, WIM_PASSWORD) + + # ----- basic turtle commands ----- + def do_create(self, arg): + 'Create an ELINE (L2) service' + service_uuid = self.mock_osm.create_connectivity_service( + SERVICE_TYPE, SERVICE_CONNECTION_POINTS) + print('Service {:s} created'.format(service_uuid)) + + def do_status(self, arg): + 'Retrieve status of services' + service_uuids = list(self.mock_osm.conn_info.keys()) + for service_uuid in service_uuids: + status = self.mock_osm.get_connectivity_service_status(service_uuid) + print('Status of Service {:s} is {:s}'.format(service_uuid, str(status))) + + def do_delete(self, arg): + 'Delete all services' + service_uuids = list(self.mock_osm.conn_info.keys()) + for service_uuid in service_uuids: + self.mock_osm.delete_connectivity_service(service_uuid) + print('Service {:s} deleted'.format(service_uuid)) + + def do_exit(self, arg): + 'Exit MockOSM' + print('Bye!') + return True + +if __name__ == '__main__': + MockOSMShell().cmdloop() diff --git a/src/compute/tests/mock_osm/acknowledgements.txt b/hackfest/mock_osm/acknowledgements.txt similarity index 100% rename from src/compute/tests/mock_osm/acknowledgements.txt rename to hackfest/mock_osm/acknowledgements.txt diff --git a/hackfest/mock_osm/commands.txt b/hackfest/mock_osm/commands.txt new file mode 100644 index 0000000000000000000000000000000000000000..4e21bac3d668f6f6b1c20ceb485d3a4ad679f95e --- /dev/null +++ b/hackfest/mock_osm/commands.txt @@ -0,0 +1,25 @@ +############ +# Mock OSM +############ + +$ cd ~/tfs-ctrl/hackfest/ +$ python -m mock_osm +Welcome to the MockOSM shell. +Type help or ? to list commands. + +(mock-osm) create +Service b8c99e2c-39d8-424d-9833-554634269555 created +# Service should be created in TFS. Check "Slice" and "Service" pages on WebUI. +# Check configuration rules in "Devices" + +(mock-osm) status +response.status_code=200 +Status of Service b8c99e2c-39d8-424d-9833-554634269555 is {'sdn_status': 'ACTIVE'} + +(mock-osm) delete +Service b8c99e2c-39d8-424d-9833-554634269555 deleted +# Service should be removed from TFS. Check "Slice" and "Service" pages on WebUI. +# Check configuration rules in "Devices" + +(mock-osm) exit +Bye! diff --git a/src/compute/tests/mock_osm/sdnconn.py b/hackfest/mock_osm/sdnconn.py similarity index 100% rename from src/compute/tests/mock_osm/sdnconn.py rename to hackfest/mock_osm/sdnconn.py diff --git a/hackfest/netconf-oc/build-instructions.txt b/hackfest/netconf-oc/build-instructions.txt new file mode 100644 index 0000000000000000000000000000000000000000..c485bc006d25244d170f6c515ea985d7cec6d75b --- /dev/null +++ b/hackfest/netconf-oc/build-instructions.txt @@ -0,0 +1,14 @@ +# Build a Netconf server supporting basic OpenConfig data model + +mkdir -p ~/tfs-ctrl/netconf-oc/{git_openconfig,openconfig} + +git clone https://github.com/openconfig/public.git ~/tfs-ctrl/netconf-oc/git_openconfig + +cd ~/tfs-ctrl/netconf-oc + +export PYBINDPLUGIN=`/usr/bin/env python -c 'import pyangbind; import os; print ("{}/plugin".format(os.path.dirname(pyangbind.__file__)))'` +pyang --plugindir $PYBINDPLUGIN -p git_openconfig/release/models/ -f pybind --split-class-dir openconfig \ + git_openconfig/release/models/interfaces/openconfig-interfaces.yang \ + git_openconfig/release/models/interfaces/openconfig-if-ethernet.yang \ + git_openconfig/release/models/platform/openconfig-platform.yang \ + git_openconfig/release/models/platform/openconfig-platform-port.yang diff --git a/hackfest/netconf-oc/device_definition.py b/hackfest/netconf-oc/device_definition.py new file mode 100644 index 0000000000000000000000000000000000000000..6e737f55675e811ebdd96a4d7471f1b4438c8e52 --- /dev/null +++ b/hackfest/netconf-oc/device_definition.py @@ -0,0 +1,38 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from lxml import etree +from netconf import util +from pyangbind.lib.serialise import pybindIETFXMLEncoder + +from openconfig.components import components +from openconfig.interfaces import interfaces + +def get_device_definition(): + occ = components() + port_1_1 = occ.component.add("1/1") + port_1_1.state._set_type("PORT") # state.type is read-only; use special method to set it + + port_1_2 = occ.component.add("1/2") + port_1_2.state._set_type("PORT") # state.type is read-only; use special method to set it + + port_1_3 = occ.component.add("1/3") + port_1_3.state._set_type("PORT") # state.type is read-only; use special method to set it + + ocif = interfaces() + + data = util.elm("nc:data") + data.append(etree.XML(pybindIETFXMLEncoder.serialise(occ))) + data.append(etree.XML(pybindIETFXMLEncoder.serialise(ocif))) + return data diff --git a/hackfest/netconf-oc/interfaces.xml b/hackfest/netconf-oc/interfaces.xml new file mode 100644 index 0000000000000000000000000000000000000000..c47fc44e3ba9ea0290823eb42feaa444d6179526 --- /dev/null +++ b/hackfest/netconf-oc/interfaces.xml @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hackfest/netconf-oc/openconfig/__init__.py b/hackfest/netconf-oc/openconfig/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ccaf6ed7248d84e4f7b154ceb40c906debe512b8 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/__init__.py @@ -0,0 +1,399 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import interfaces +class openconfig_interfaces(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-interfaces - based on the path /openconfig-interfaces. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Model for managing network interfaces and subinterfaces. This +module also defines convenience types / groupings for other +models to create references to interfaces: + + base-interface-ref (type) - reference to a base interface + interface-ref (grouping) - container for reference to a + interface + subinterface + interface-ref-state (grouping) - container for read-only + (opstate) reference to interface + subinterface + +This model reuses data items defined in the IETF YANG model for +interfaces described by RFC 7223 with an alternate structure +(particularly for operational state data) and with +additional configuration items. + +Portions of this code were derived from IETF RFC 7223. +Please reproduce this note if possible. + +IETF code is subject to the following copyright and license: +Copyright (c) IETF Trust and the persons identified as authors of +the code. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, is permitted pursuant to, and subject to the license +terms contained in, the Simplified BSD License set forth in +Section 4.c of the IETF Trust's Legal Provisions Relating +to IETF Documents (http://trustee.ietf.org/license-info). + """ + __slots__ = ('_path_helper', '_extmethods', '__interfaces',) + + _yang_name = 'openconfig-interfaces' + _yang_namespace = 'http://openconfig.net/yang/interfaces' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__interfaces = YANGDynClass(base=interfaces.interfaces, is_container='container', yang_name="interfaces", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [] + + def _get_interfaces(self): + """ + Getter method for interfaces, mapped from YANG variable /interfaces (container) + + YANG Description: Top level container for interfaces, including configuration +and state data. + """ + return self.__interfaces + + def _set_interfaces(self, v, load=False): + """ + Setter method for interfaces, mapped from YANG variable /interfaces (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_interfaces is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_interfaces() directly. + + YANG Description: Top level container for interfaces, including configuration +and state data. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=interfaces.interfaces, is_container='container', yang_name="interfaces", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """interfaces must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=interfaces.interfaces, is_container='container', yang_name="interfaces", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True)""", + }) + + self.__interfaces = t + if hasattr(self, '_set'): + self._set() + + def _unset_interfaces(self): + self.__interfaces = YANGDynClass(base=interfaces.interfaces, is_container='container', yang_name="interfaces", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + + interfaces = __builtin__.property(_get_interfaces, _set_interfaces) + + + _pyangbind_elements = OrderedDict([('interfaces', interfaces), ]) + + +class openconfig_if_ethernet(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-if-ethernet - based on the path /openconfig-if-ethernet. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Model for managing Ethernet interfaces -- augments the OpenConfig +model for interface configuration and state. + """ + _pyangbind_elements = {} + + + +from . import components +class openconfig_platform(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /openconfig-platform. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This module defines a data model for representing a system +component inventory, which can include hardware or software +elements arranged in an arbitrary structure. The primary +relationship supported by the model is containment, e.g., +components containing subcomponents. + +It is expected that this model reflects every field replacable +unit on the device at a minimum (i.e., additional information +may be supplied about non-replacable components). + +Every element in the inventory is termed a 'component' with each +component expected to have a unique name and type, and optionally +a unique system-assigned identifier and FRU number. The +uniqueness is guaranteed by the system within the device. + +Components may have properties defined by the system that are +modeled as a list of key-value pairs. These may or may not be +user-configurable. The model provides a flag for the system +to optionally indicate which properties are user configurable. + +Each component also has a list of 'subcomponents' which are +references to other components. Appearance in a list of +subcomponents indicates a containment relationship as described +above. For example, a linecard component may have a list of +references to port components that reside on the linecard. + +This schema is generic to allow devices to express their own +platform-specific structure. It may be augmented by additional +component type-specific schemas that provide a common structure +for well-known component types. In these cases, the system is +expected to populate the common component schema, and may +optionally also represent the component and its properties in the +generic structure. + +The properties for each component may include dynamic values, +e.g., in the 'state' part of the schema. For example, a CPU +component may report its utilization, temperature, or other +physical properties. The intent is to capture all platform- +specific physical data in one location, including inventory +(presence or absence of a component) and state (physical +attributes or status). + """ + __slots__ = ('_path_helper', '_extmethods', '__components',) + + _yang_name = 'openconfig-platform' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__components = YANGDynClass(base=components.components, is_container='container', yang_name="components", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [] + + def _get_components(self): + """ + Getter method for components, mapped from YANG variable /components (container) + + YANG Description: Enclosing container for the components in the system. + """ + return self.__components + + def _set_components(self, v, load=False): + """ + Setter method for components, mapped from YANG variable /components (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_components is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_components() directly. + + YANG Description: Enclosing container for the components in the system. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=components.components, is_container='container', yang_name="components", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """components must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=components.components, is_container='container', yang_name="components", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__components = t + if hasattr(self, '_set'): + self._set() + + def _unset_components(self): + self.__components = YANGDynClass(base=components.components, is_container='container', yang_name="components", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + components = __builtin__.property(_get_components, _set_components) + + + _pyangbind_elements = OrderedDict([('components', components), ]) + + +from . import components +class openconfig_platform_common(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /openconfig-platform-common. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This modules contains common groupings that are used in multiple +components within the platform module. + """ + __slots__ = ('_path_helper', '_extmethods', '__components',) + + _yang_name = 'openconfig-platform-common' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__components = YANGDynClass(base=components.components, is_container='container', yang_name="components", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [] + + def _get_components(self): + """ + Getter method for components, mapped from YANG variable /components (container) + + YANG Description: Enclosing container for the components in the system. + """ + return self.__components + + def _set_components(self, v, load=False): + """ + Setter method for components, mapped from YANG variable /components (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_components is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_components() directly. + + YANG Description: Enclosing container for the components in the system. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=components.components, is_container='container', yang_name="components", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """components must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=components.components, is_container='container', yang_name="components", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__components = t + if hasattr(self, '_set'): + self._set() + + def _unset_components(self): + self.__components = YANGDynClass(base=components.components, is_container='container', yang_name="components", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + components = __builtin__.property(_get_components, _set_components) + + + _pyangbind_elements = OrderedDict([('components', components), ]) + + +class openconfig_platform_port(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-port - based on the path /openconfig-platform-port. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: This module defines data related to PORT components in the +openconfig-platform model + """ + _pyangbind_elements = {} + + + diff --git a/hackfest/netconf-oc/openconfig/components/__init__.py b/hackfest/netconf-oc/openconfig/components/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1470af40e5acad9715a3acf1473e1e8955426a03 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/__init__.py @@ -0,0 +1,208 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import component +class components(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Enclosing container for the components in the system. + """ + __slots__ = ('_path_helper', '_extmethods', '__component',) + + _yang_name = 'components' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__component = YANGDynClass(base=YANGListType("name",component.component, yang_name="component", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="component", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components'] + + def _get_component(self): + """ + Getter method for component, mapped from YANG variable /components/component (list) + + YANG Description: List of components, keyed by component name. + """ + return self.__component + + def _set_component(self, v, load=False): + """ + Setter method for component, mapped from YANG variable /components/component (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_component is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_component() directly. + + YANG Description: List of components, keyed by component name. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",component.component, yang_name="component", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="component", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """component must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",component.component, yang_name="component", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="component", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True)""", + }) + + self.__component = t + if hasattr(self, '_set'): + self._set() + + def _unset_component(self): + self.__component = YANGDynClass(base=YANGListType("name",component.component, yang_name="component", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="component", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + + component = __builtin__.property(_get_component, _set_component) + + + _pyangbind_elements = OrderedDict([('component', component), ]) + + +from . import component +class components(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Enclosing container for the components in the system. + """ + __slots__ = ('_path_helper', '_extmethods', '__component',) + + _yang_name = 'components' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__component = YANGDynClass(base=YANGListType("name",component.component, yang_name="component", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="component", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components'] + + def _get_component(self): + """ + Getter method for component, mapped from YANG variable /components/component (list) + + YANG Description: List of components, keyed by component name. + """ + return self.__component + + def _set_component(self, v, load=False): + """ + Setter method for component, mapped from YANG variable /components/component (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_component is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_component() directly. + + YANG Description: List of components, keyed by component name. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",component.component, yang_name="component", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="component", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """component must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",component.component, yang_name="component", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="component", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True)""", + }) + + self.__component = t + if hasattr(self, '_set'): + self._set() + + def _unset_component(self): + self.__component = YANGDynClass(base=YANGListType("name",component.component, yang_name="component", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="component", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + + component = __builtin__.property(_get_component, _set_component) + + + _pyangbind_elements = OrderedDict([('component', component), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/__init__.py b/hackfest/netconf-oc/openconfig/components/component/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b80cb6139d5290b7ec4e62a14f2faeba46886d31 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/__init__.py @@ -0,0 +1,1424 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import config +from . import state +from . import properties +from . import subcomponents +from . import chassis +from . import port +from . import power_supply +from . import fan +from . import fabric +from . import storage +from . import cpu +from . import integrated_circuit +from . import backplane +from . import software_module +from . import controller_card +class component(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of components, keyed by component name. + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__config','__state','__properties','__subcomponents','__chassis','__port','__power_supply','__fan','__fabric','__storage','__cpu','__integrated_circuit','__backplane','__software_module','__controller_card',) + + _yang_name = 'component' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__properties = YANGDynClass(base=properties.properties, is_container='container', yang_name="properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__subcomponents = YANGDynClass(base=subcomponents.subcomponents, is_container='container', yang_name="subcomponents", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__chassis = YANGDynClass(base=chassis.chassis, is_container='container', yang_name="chassis", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__port = YANGDynClass(base=port.port, is_container='container', yang_name="port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__power_supply = YANGDynClass(base=power_supply.power_supply, is_container='container', yang_name="power-supply", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__fan = YANGDynClass(base=fan.fan, is_container='container', yang_name="fan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__fabric = YANGDynClass(base=fabric.fabric, is_container='container', yang_name="fabric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__storage = YANGDynClass(base=storage.storage, is_container='container', yang_name="storage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__cpu = YANGDynClass(base=cpu.cpu, is_container='container', yang_name="cpu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__integrated_circuit = YANGDynClass(base=integrated_circuit.integrated_circuit, is_container='container', yang_name="integrated-circuit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__backplane = YANGDynClass(base=backplane.backplane, is_container='container', yang_name="backplane", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__software_module = YANGDynClass(base=software_module.software_module, is_container='container', yang_name="software-module", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__controller_card = YANGDynClass(base=controller_card.controller_card, is_container='container', yang_name="controller-card", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/name (leafref) + + YANG Description: References the component name + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/name (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: References the component name + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + + + def _get_config(self): + """ + Getter method for config, mapped from YANG variable /components/component/config (container) + + YANG Description: Configuration data for each component + """ + return self.__config + + def _set_config(self, v, load=False): + """ + Setter method for config, mapped from YANG variable /components/component/config (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_config is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_config() directly. + + YANG Description: Configuration data for each component + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """config must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__config = t + if hasattr(self, '_set'): + self._set() + + def _unset_config(self): + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_state(self): + """ + Getter method for state, mapped from YANG variable /components/component/state (container) + + YANG Description: Operational state data for each component + """ + return self.__state + + def _set_state(self, v, load=False): + """ + Setter method for state, mapped from YANG variable /components/component/state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_state() directly. + + YANG Description: Operational state data for each component + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__state = t + if hasattr(self, '_set'): + self._set() + + def _unset_state(self): + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_properties(self): + """ + Getter method for properties, mapped from YANG variable /components/component/properties (container) + + YANG Description: Enclosing container + """ + return self.__properties + + def _set_properties(self, v, load=False): + """ + Setter method for properties, mapped from YANG variable /components/component/properties (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_properties is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_properties() directly. + + YANG Description: Enclosing container + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=properties.properties, is_container='container', yang_name="properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """properties must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=properties.properties, is_container='container', yang_name="properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__properties = t + if hasattr(self, '_set'): + self._set() + + def _unset_properties(self): + self.__properties = YANGDynClass(base=properties.properties, is_container='container', yang_name="properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_subcomponents(self): + """ + Getter method for subcomponents, mapped from YANG variable /components/component/subcomponents (container) + + YANG Description: Enclosing container for subcomponent references + """ + return self.__subcomponents + + def _set_subcomponents(self, v, load=False): + """ + Setter method for subcomponents, mapped from YANG variable /components/component/subcomponents (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_subcomponents is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_subcomponents() directly. + + YANG Description: Enclosing container for subcomponent references + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=subcomponents.subcomponents, is_container='container', yang_name="subcomponents", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """subcomponents must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=subcomponents.subcomponents, is_container='container', yang_name="subcomponents", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__subcomponents = t + if hasattr(self, '_set'): + self._set() + + def _unset_subcomponents(self): + self.__subcomponents = YANGDynClass(base=subcomponents.subcomponents, is_container='container', yang_name="subcomponents", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_chassis(self): + """ + Getter method for chassis, mapped from YANG variable /components/component/chassis (container) + + YANG Description: Data for chassis components + """ + return self.__chassis + + def _set_chassis(self, v, load=False): + """ + Setter method for chassis, mapped from YANG variable /components/component/chassis (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_chassis is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_chassis() directly. + + YANG Description: Data for chassis components + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=chassis.chassis, is_container='container', yang_name="chassis", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """chassis must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=chassis.chassis, is_container='container', yang_name="chassis", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__chassis = t + if hasattr(self, '_set'): + self._set() + + def _unset_chassis(self): + self.__chassis = YANGDynClass(base=chassis.chassis, is_container='container', yang_name="chassis", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_port(self): + """ + Getter method for port, mapped from YANG variable /components/component/port (container) + + YANG Description: Data for physical port components + """ + return self.__port + + def _set_port(self, v, load=False): + """ + Setter method for port, mapped from YANG variable /components/component/port (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_port is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_port() directly. + + YANG Description: Data for physical port components + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=port.port, is_container='container', yang_name="port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """port must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=port.port, is_container='container', yang_name="port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__port = t + if hasattr(self, '_set'): + self._set() + + def _unset_port(self): + self.__port = YANGDynClass(base=port.port, is_container='container', yang_name="port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_power_supply(self): + """ + Getter method for power_supply, mapped from YANG variable /components/component/power_supply (container) + + YANG Description: Data for power supply components + """ + return self.__power_supply + + def _set_power_supply(self, v, load=False): + """ + Setter method for power_supply, mapped from YANG variable /components/component/power_supply (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_power_supply is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_power_supply() directly. + + YANG Description: Data for power supply components + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=power_supply.power_supply, is_container='container', yang_name="power-supply", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """power_supply must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=power_supply.power_supply, is_container='container', yang_name="power-supply", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__power_supply = t + if hasattr(self, '_set'): + self._set() + + def _unset_power_supply(self): + self.__power_supply = YANGDynClass(base=power_supply.power_supply, is_container='container', yang_name="power-supply", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_fan(self): + """ + Getter method for fan, mapped from YANG variable /components/component/fan (container) + + YANG Description: Data for fan components + """ + return self.__fan + + def _set_fan(self, v, load=False): + """ + Setter method for fan, mapped from YANG variable /components/component/fan (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_fan is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_fan() directly. + + YANG Description: Data for fan components + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=fan.fan, is_container='container', yang_name="fan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """fan must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=fan.fan, is_container='container', yang_name="fan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__fan = t + if hasattr(self, '_set'): + self._set() + + def _unset_fan(self): + self.__fan = YANGDynClass(base=fan.fan, is_container='container', yang_name="fan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_fabric(self): + """ + Getter method for fabric, mapped from YANG variable /components/component/fabric (container) + + YANG Description: Data for fabric components + """ + return self.__fabric + + def _set_fabric(self, v, load=False): + """ + Setter method for fabric, mapped from YANG variable /components/component/fabric (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_fabric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_fabric() directly. + + YANG Description: Data for fabric components + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=fabric.fabric, is_container='container', yang_name="fabric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """fabric must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=fabric.fabric, is_container='container', yang_name="fabric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__fabric = t + if hasattr(self, '_set'): + self._set() + + def _unset_fabric(self): + self.__fabric = YANGDynClass(base=fabric.fabric, is_container='container', yang_name="fabric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_storage(self): + """ + Getter method for storage, mapped from YANG variable /components/component/storage (container) + + YANG Description: Data for storage components + """ + return self.__storage + + def _set_storage(self, v, load=False): + """ + Setter method for storage, mapped from YANG variable /components/component/storage (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_storage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_storage() directly. + + YANG Description: Data for storage components + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=storage.storage, is_container='container', yang_name="storage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """storage must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=storage.storage, is_container='container', yang_name="storage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__storage = t + if hasattr(self, '_set'): + self._set() + + def _unset_storage(self): + self.__storage = YANGDynClass(base=storage.storage, is_container='container', yang_name="storage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_cpu(self): + """ + Getter method for cpu, mapped from YANG variable /components/component/cpu (container) + + YANG Description: Data for cpu components + """ + return self.__cpu + + def _set_cpu(self, v, load=False): + """ + Setter method for cpu, mapped from YANG variable /components/component/cpu (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_cpu is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_cpu() directly. + + YANG Description: Data for cpu components + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=cpu.cpu, is_container='container', yang_name="cpu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """cpu must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=cpu.cpu, is_container='container', yang_name="cpu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__cpu = t + if hasattr(self, '_set'): + self._set() + + def _unset_cpu(self): + self.__cpu = YANGDynClass(base=cpu.cpu, is_container='container', yang_name="cpu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_integrated_circuit(self): + """ + Getter method for integrated_circuit, mapped from YANG variable /components/component/integrated_circuit (container) + + YANG Description: Data for chip components, such as ASIC, NPUs, etc. + """ + return self.__integrated_circuit + + def _set_integrated_circuit(self, v, load=False): + """ + Setter method for integrated_circuit, mapped from YANG variable /components/component/integrated_circuit (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_integrated_circuit is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_integrated_circuit() directly. + + YANG Description: Data for chip components, such as ASIC, NPUs, etc. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=integrated_circuit.integrated_circuit, is_container='container', yang_name="integrated-circuit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """integrated_circuit must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=integrated_circuit.integrated_circuit, is_container='container', yang_name="integrated-circuit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__integrated_circuit = t + if hasattr(self, '_set'): + self._set() + + def _unset_integrated_circuit(self): + self.__integrated_circuit = YANGDynClass(base=integrated_circuit.integrated_circuit, is_container='container', yang_name="integrated-circuit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_backplane(self): + """ + Getter method for backplane, mapped from YANG variable /components/component/backplane (container) + + YANG Description: Data for backplane components + """ + return self.__backplane + + def _set_backplane(self, v, load=False): + """ + Setter method for backplane, mapped from YANG variable /components/component/backplane (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_backplane is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_backplane() directly. + + YANG Description: Data for backplane components + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=backplane.backplane, is_container='container', yang_name="backplane", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """backplane must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=backplane.backplane, is_container='container', yang_name="backplane", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__backplane = t + if hasattr(self, '_set'): + self._set() + + def _unset_backplane(self): + self.__backplane = YANGDynClass(base=backplane.backplane, is_container='container', yang_name="backplane", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_software_module(self): + """ + Getter method for software_module, mapped from YANG variable /components/component/software_module (container) + + YANG Description: Data for software module components, i.e., for components +with type=SOFTWARE_MODULE + """ + return self.__software_module + + def _set_software_module(self, v, load=False): + """ + Setter method for software_module, mapped from YANG variable /components/component/software_module (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_software_module is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_software_module() directly. + + YANG Description: Data for software module components, i.e., for components +with type=SOFTWARE_MODULE + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=software_module.software_module, is_container='container', yang_name="software-module", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """software_module must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=software_module.software_module, is_container='container', yang_name="software-module", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__software_module = t + if hasattr(self, '_set'): + self._set() + + def _unset_software_module(self): + self.__software_module = YANGDynClass(base=software_module.software_module, is_container='container', yang_name="software-module", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_controller_card(self): + """ + Getter method for controller_card, mapped from YANG variable /components/component/controller_card (container) + + YANG Description: Data for controller card components, i.e., for components +with type=CONTROLLER_CARD + """ + return self.__controller_card + + def _set_controller_card(self, v, load=False): + """ + Setter method for controller_card, mapped from YANG variable /components/component/controller_card (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_controller_card is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_controller_card() directly. + + YANG Description: Data for controller card components, i.e., for components +with type=CONTROLLER_CARD + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=controller_card.controller_card, is_container='container', yang_name="controller-card", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """controller_card must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=controller_card.controller_card, is_container='container', yang_name="controller-card", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__controller_card = t + if hasattr(self, '_set'): + self._set() + + def _unset_controller_card(self): + self.__controller_card = YANGDynClass(base=controller_card.controller_card, is_container='container', yang_name="controller-card", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) + properties = __builtin__.property(_get_properties, _set_properties) + subcomponents = __builtin__.property(_get_subcomponents, _set_subcomponents) + chassis = __builtin__.property(_get_chassis, _set_chassis) + port = __builtin__.property(_get_port, _set_port) + power_supply = __builtin__.property(_get_power_supply, _set_power_supply) + fan = __builtin__.property(_get_fan, _set_fan) + fabric = __builtin__.property(_get_fabric, _set_fabric) + storage = __builtin__.property(_get_storage, _set_storage) + cpu = __builtin__.property(_get_cpu, _set_cpu) + integrated_circuit = __builtin__.property(_get_integrated_circuit, _set_integrated_circuit) + backplane = __builtin__.property(_get_backplane, _set_backplane) + software_module = __builtin__.property(_get_software_module, _set_software_module) + controller_card = __builtin__.property(_get_controller_card, _set_controller_card) + + + _pyangbind_elements = OrderedDict([('name', name), ('config', config), ('state', state), ('properties', properties), ('subcomponents', subcomponents), ('chassis', chassis), ('port', port), ('power_supply', power_supply), ('fan', fan), ('fabric', fabric), ('storage', storage), ('cpu', cpu), ('integrated_circuit', integrated_circuit), ('backplane', backplane), ('software_module', software_module), ('controller_card', controller_card), ]) + + +from . import config +from . import state +from . import properties +from . import subcomponents +from . import chassis +from . import port +from . import power_supply +from . import fan +from . import fabric +from . import storage +from . import cpu +from . import integrated_circuit +from . import backplane +from . import software_module +from . import controller_card +class component(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of components, keyed by component name. + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__config','__state','__properties','__subcomponents','__chassis','__port','__power_supply','__fan','__fabric','__storage','__cpu','__integrated_circuit','__backplane','__software_module','__controller_card',) + + _yang_name = 'component' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__properties = YANGDynClass(base=properties.properties, is_container='container', yang_name="properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__subcomponents = YANGDynClass(base=subcomponents.subcomponents, is_container='container', yang_name="subcomponents", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__chassis = YANGDynClass(base=chassis.chassis, is_container='container', yang_name="chassis", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__port = YANGDynClass(base=port.port, is_container='container', yang_name="port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__power_supply = YANGDynClass(base=power_supply.power_supply, is_container='container', yang_name="power-supply", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__fan = YANGDynClass(base=fan.fan, is_container='container', yang_name="fan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__fabric = YANGDynClass(base=fabric.fabric, is_container='container', yang_name="fabric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__storage = YANGDynClass(base=storage.storage, is_container='container', yang_name="storage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__cpu = YANGDynClass(base=cpu.cpu, is_container='container', yang_name="cpu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__integrated_circuit = YANGDynClass(base=integrated_circuit.integrated_circuit, is_container='container', yang_name="integrated-circuit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__backplane = YANGDynClass(base=backplane.backplane, is_container='container', yang_name="backplane", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__software_module = YANGDynClass(base=software_module.software_module, is_container='container', yang_name="software-module", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__controller_card = YANGDynClass(base=controller_card.controller_card, is_container='container', yang_name="controller-card", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/name (leafref) + + YANG Description: References the component name + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/name (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: References the component name + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + + + def _get_config(self): + """ + Getter method for config, mapped from YANG variable /components/component/config (container) + + YANG Description: Configuration data for each component + """ + return self.__config + + def _set_config(self, v, load=False): + """ + Setter method for config, mapped from YANG variable /components/component/config (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_config is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_config() directly. + + YANG Description: Configuration data for each component + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """config must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__config = t + if hasattr(self, '_set'): + self._set() + + def _unset_config(self): + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_state(self): + """ + Getter method for state, mapped from YANG variable /components/component/state (container) + + YANG Description: Operational state data for each component + """ + return self.__state + + def _set_state(self, v, load=False): + """ + Setter method for state, mapped from YANG variable /components/component/state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_state() directly. + + YANG Description: Operational state data for each component + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__state = t + if hasattr(self, '_set'): + self._set() + + def _unset_state(self): + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_properties(self): + """ + Getter method for properties, mapped from YANG variable /components/component/properties (container) + + YANG Description: Enclosing container + """ + return self.__properties + + def _set_properties(self, v, load=False): + """ + Setter method for properties, mapped from YANG variable /components/component/properties (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_properties is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_properties() directly. + + YANG Description: Enclosing container + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=properties.properties, is_container='container', yang_name="properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """properties must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=properties.properties, is_container='container', yang_name="properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__properties = t + if hasattr(self, '_set'): + self._set() + + def _unset_properties(self): + self.__properties = YANGDynClass(base=properties.properties, is_container='container', yang_name="properties", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_subcomponents(self): + """ + Getter method for subcomponents, mapped from YANG variable /components/component/subcomponents (container) + + YANG Description: Enclosing container for subcomponent references + """ + return self.__subcomponents + + def _set_subcomponents(self, v, load=False): + """ + Setter method for subcomponents, mapped from YANG variable /components/component/subcomponents (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_subcomponents is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_subcomponents() directly. + + YANG Description: Enclosing container for subcomponent references + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=subcomponents.subcomponents, is_container='container', yang_name="subcomponents", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """subcomponents must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=subcomponents.subcomponents, is_container='container', yang_name="subcomponents", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__subcomponents = t + if hasattr(self, '_set'): + self._set() + + def _unset_subcomponents(self): + self.__subcomponents = YANGDynClass(base=subcomponents.subcomponents, is_container='container', yang_name="subcomponents", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_chassis(self): + """ + Getter method for chassis, mapped from YANG variable /components/component/chassis (container) + + YANG Description: Data for chassis components + """ + return self.__chassis + + def _set_chassis(self, v, load=False): + """ + Setter method for chassis, mapped from YANG variable /components/component/chassis (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_chassis is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_chassis() directly. + + YANG Description: Data for chassis components + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=chassis.chassis, is_container='container', yang_name="chassis", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """chassis must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=chassis.chassis, is_container='container', yang_name="chassis", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__chassis = t + if hasattr(self, '_set'): + self._set() + + def _unset_chassis(self): + self.__chassis = YANGDynClass(base=chassis.chassis, is_container='container', yang_name="chassis", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_port(self): + """ + Getter method for port, mapped from YANG variable /components/component/port (container) + + YANG Description: Data for physical port components + """ + return self.__port + + def _set_port(self, v, load=False): + """ + Setter method for port, mapped from YANG variable /components/component/port (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_port is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_port() directly. + + YANG Description: Data for physical port components + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=port.port, is_container='container', yang_name="port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """port must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=port.port, is_container='container', yang_name="port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__port = t + if hasattr(self, '_set'): + self._set() + + def _unset_port(self): + self.__port = YANGDynClass(base=port.port, is_container='container', yang_name="port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_power_supply(self): + """ + Getter method for power_supply, mapped from YANG variable /components/component/power_supply (container) + + YANG Description: Data for power supply components + """ + return self.__power_supply + + def _set_power_supply(self, v, load=False): + """ + Setter method for power_supply, mapped from YANG variable /components/component/power_supply (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_power_supply is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_power_supply() directly. + + YANG Description: Data for power supply components + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=power_supply.power_supply, is_container='container', yang_name="power-supply", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """power_supply must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=power_supply.power_supply, is_container='container', yang_name="power-supply", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__power_supply = t + if hasattr(self, '_set'): + self._set() + + def _unset_power_supply(self): + self.__power_supply = YANGDynClass(base=power_supply.power_supply, is_container='container', yang_name="power-supply", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_fan(self): + """ + Getter method for fan, mapped from YANG variable /components/component/fan (container) + + YANG Description: Data for fan components + """ + return self.__fan + + def _set_fan(self, v, load=False): + """ + Setter method for fan, mapped from YANG variable /components/component/fan (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_fan is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_fan() directly. + + YANG Description: Data for fan components + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=fan.fan, is_container='container', yang_name="fan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """fan must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=fan.fan, is_container='container', yang_name="fan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__fan = t + if hasattr(self, '_set'): + self._set() + + def _unset_fan(self): + self.__fan = YANGDynClass(base=fan.fan, is_container='container', yang_name="fan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_fabric(self): + """ + Getter method for fabric, mapped from YANG variable /components/component/fabric (container) + + YANG Description: Data for fabric components + """ + return self.__fabric + + def _set_fabric(self, v, load=False): + """ + Setter method for fabric, mapped from YANG variable /components/component/fabric (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_fabric is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_fabric() directly. + + YANG Description: Data for fabric components + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=fabric.fabric, is_container='container', yang_name="fabric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """fabric must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=fabric.fabric, is_container='container', yang_name="fabric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__fabric = t + if hasattr(self, '_set'): + self._set() + + def _unset_fabric(self): + self.__fabric = YANGDynClass(base=fabric.fabric, is_container='container', yang_name="fabric", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_storage(self): + """ + Getter method for storage, mapped from YANG variable /components/component/storage (container) + + YANG Description: Data for storage components + """ + return self.__storage + + def _set_storage(self, v, load=False): + """ + Setter method for storage, mapped from YANG variable /components/component/storage (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_storage is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_storage() directly. + + YANG Description: Data for storage components + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=storage.storage, is_container='container', yang_name="storage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """storage must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=storage.storage, is_container='container', yang_name="storage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__storage = t + if hasattr(self, '_set'): + self._set() + + def _unset_storage(self): + self.__storage = YANGDynClass(base=storage.storage, is_container='container', yang_name="storage", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_cpu(self): + """ + Getter method for cpu, mapped from YANG variable /components/component/cpu (container) + + YANG Description: Data for cpu components + """ + return self.__cpu + + def _set_cpu(self, v, load=False): + """ + Setter method for cpu, mapped from YANG variable /components/component/cpu (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_cpu is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_cpu() directly. + + YANG Description: Data for cpu components + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=cpu.cpu, is_container='container', yang_name="cpu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """cpu must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=cpu.cpu, is_container='container', yang_name="cpu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__cpu = t + if hasattr(self, '_set'): + self._set() + + def _unset_cpu(self): + self.__cpu = YANGDynClass(base=cpu.cpu, is_container='container', yang_name="cpu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_integrated_circuit(self): + """ + Getter method for integrated_circuit, mapped from YANG variable /components/component/integrated_circuit (container) + + YANG Description: Data for chip components, such as ASIC, NPUs, etc. + """ + return self.__integrated_circuit + + def _set_integrated_circuit(self, v, load=False): + """ + Setter method for integrated_circuit, mapped from YANG variable /components/component/integrated_circuit (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_integrated_circuit is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_integrated_circuit() directly. + + YANG Description: Data for chip components, such as ASIC, NPUs, etc. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=integrated_circuit.integrated_circuit, is_container='container', yang_name="integrated-circuit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """integrated_circuit must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=integrated_circuit.integrated_circuit, is_container='container', yang_name="integrated-circuit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__integrated_circuit = t + if hasattr(self, '_set'): + self._set() + + def _unset_integrated_circuit(self): + self.__integrated_circuit = YANGDynClass(base=integrated_circuit.integrated_circuit, is_container='container', yang_name="integrated-circuit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_backplane(self): + """ + Getter method for backplane, mapped from YANG variable /components/component/backplane (container) + + YANG Description: Data for backplane components + """ + return self.__backplane + + def _set_backplane(self, v, load=False): + """ + Setter method for backplane, mapped from YANG variable /components/component/backplane (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_backplane is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_backplane() directly. + + YANG Description: Data for backplane components + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=backplane.backplane, is_container='container', yang_name="backplane", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """backplane must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=backplane.backplane, is_container='container', yang_name="backplane", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__backplane = t + if hasattr(self, '_set'): + self._set() + + def _unset_backplane(self): + self.__backplane = YANGDynClass(base=backplane.backplane, is_container='container', yang_name="backplane", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_software_module(self): + """ + Getter method for software_module, mapped from YANG variable /components/component/software_module (container) + + YANG Description: Data for software module components, i.e., for components +with type=SOFTWARE_MODULE + """ + return self.__software_module + + def _set_software_module(self, v, load=False): + """ + Setter method for software_module, mapped from YANG variable /components/component/software_module (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_software_module is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_software_module() directly. + + YANG Description: Data for software module components, i.e., for components +with type=SOFTWARE_MODULE + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=software_module.software_module, is_container='container', yang_name="software-module", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """software_module must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=software_module.software_module, is_container='container', yang_name="software-module", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__software_module = t + if hasattr(self, '_set'): + self._set() + + def _unset_software_module(self): + self.__software_module = YANGDynClass(base=software_module.software_module, is_container='container', yang_name="software-module", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_controller_card(self): + """ + Getter method for controller_card, mapped from YANG variable /components/component/controller_card (container) + + YANG Description: Data for controller card components, i.e., for components +with type=CONTROLLER_CARD + """ + return self.__controller_card + + def _set_controller_card(self, v, load=False): + """ + Setter method for controller_card, mapped from YANG variable /components/component/controller_card (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_controller_card is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_controller_card() directly. + + YANG Description: Data for controller card components, i.e., for components +with type=CONTROLLER_CARD + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=controller_card.controller_card, is_container='container', yang_name="controller-card", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """controller_card must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=controller_card.controller_card, is_container='container', yang_name="controller-card", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__controller_card = t + if hasattr(self, '_set'): + self._set() + + def _unset_controller_card(self): + self.__controller_card = YANGDynClass(base=controller_card.controller_card, is_container='container', yang_name="controller-card", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) + properties = __builtin__.property(_get_properties, _set_properties) + subcomponents = __builtin__.property(_get_subcomponents, _set_subcomponents) + chassis = __builtin__.property(_get_chassis, _set_chassis) + port = __builtin__.property(_get_port, _set_port) + power_supply = __builtin__.property(_get_power_supply, _set_power_supply) + fan = __builtin__.property(_get_fan, _set_fan) + fabric = __builtin__.property(_get_fabric, _set_fabric) + storage = __builtin__.property(_get_storage, _set_storage) + cpu = __builtin__.property(_get_cpu, _set_cpu) + integrated_circuit = __builtin__.property(_get_integrated_circuit, _set_integrated_circuit) + backplane = __builtin__.property(_get_backplane, _set_backplane) + software_module = __builtin__.property(_get_software_module, _set_software_module) + controller_card = __builtin__.property(_get_controller_card, _set_controller_card) + + + _pyangbind_elements = OrderedDict([('name', name), ('config', config), ('state', state), ('properties', properties), ('subcomponents', subcomponents), ('chassis', chassis), ('port', port), ('power_supply', power_supply), ('fan', fan), ('fabric', fabric), ('storage', storage), ('cpu', cpu), ('integrated_circuit', integrated_circuit), ('backplane', backplane), ('software_module', software_module), ('controller_card', controller_card), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/backplane/__init__.py b/hackfest/netconf-oc/openconfig/components/component/backplane/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..15bef3759aab3b7d456fc2bf3e79d364fbf2aa2f --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/backplane/__init__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class backplane(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/backplane. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Data for backplane components + """ + _pyangbind_elements = {} + + + +class backplane(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/backplane. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Data for backplane components + """ + _pyangbind_elements = {} + + + diff --git a/hackfest/netconf-oc/openconfig/components/component/chassis/__init__.py b/hackfest/netconf-oc/openconfig/components/component/chassis/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9e88a339a79e9feb0912c24d1a58043f5a25f5c6 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/chassis/__init__.py @@ -0,0 +1,208 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import utilization +class chassis(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/chassis. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Data for chassis components + """ + __slots__ = ('_path_helper', '_extmethods', '__utilization',) + + _yang_name = 'chassis' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__utilization = YANGDynClass(base=utilization.utilization, is_container='container', yang_name="utilization", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'chassis'] + + def _get_utilization(self): + """ + Getter method for utilization, mapped from YANG variable /components/component/chassis/utilization (container) + + YANG Description: Utilization of the component. + """ + return self.__utilization + + def _set_utilization(self, v, load=False): + """ + Setter method for utilization, mapped from YANG variable /components/component/chassis/utilization (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_utilization is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_utilization() directly. + + YANG Description: Utilization of the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=utilization.utilization, is_container='container', yang_name="utilization", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """utilization must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=utilization.utilization, is_container='container', yang_name="utilization", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__utilization = t + if hasattr(self, '_set'): + self._set() + + def _unset_utilization(self): + self.__utilization = YANGDynClass(base=utilization.utilization, is_container='container', yang_name="utilization", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + utilization = __builtin__.property(_get_utilization, _set_utilization) + + + _pyangbind_elements = OrderedDict([('utilization', utilization), ]) + + +from . import utilization +class chassis(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/chassis. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Data for chassis components + """ + __slots__ = ('_path_helper', '_extmethods', '__utilization',) + + _yang_name = 'chassis' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__utilization = YANGDynClass(base=utilization.utilization, is_container='container', yang_name="utilization", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'chassis'] + + def _get_utilization(self): + """ + Getter method for utilization, mapped from YANG variable /components/component/chassis/utilization (container) + + YANG Description: Utilization of the component. + """ + return self.__utilization + + def _set_utilization(self, v, load=False): + """ + Setter method for utilization, mapped from YANG variable /components/component/chassis/utilization (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_utilization is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_utilization() directly. + + YANG Description: Utilization of the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=utilization.utilization, is_container='container', yang_name="utilization", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """utilization must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=utilization.utilization, is_container='container', yang_name="utilization", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__utilization = t + if hasattr(self, '_set'): + self._set() + + def _unset_utilization(self): + self.__utilization = YANGDynClass(base=utilization.utilization, is_container='container', yang_name="utilization", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + utilization = __builtin__.property(_get_utilization, _set_utilization) + + + _pyangbind_elements = OrderedDict([('utilization', utilization), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/chassis/utilization/__init__.py b/hackfest/netconf-oc/openconfig/components/component/chassis/utilization/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a1bac9c98ca84bd2fcdb13e29b0419d0695a1be8 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/chassis/utilization/__init__.py @@ -0,0 +1,208 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import resources +class utilization(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/chassis/utilization. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Utilization of the component. + """ + __slots__ = ('_path_helper', '_extmethods', '__resources',) + + _yang_name = 'utilization' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__resources = YANGDynClass(base=resources.resources, is_container='container', yang_name="resources", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'chassis', 'utilization'] + + def _get_resources(self): + """ + Getter method for resources, mapped from YANG variable /components/component/chassis/utilization/resources (container) + + YANG Description: Enclosing container for the resources in this component. + """ + return self.__resources + + def _set_resources(self, v, load=False): + """ + Setter method for resources, mapped from YANG variable /components/component/chassis/utilization/resources (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_resources is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_resources() directly. + + YANG Description: Enclosing container for the resources in this component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=resources.resources, is_container='container', yang_name="resources", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """resources must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=resources.resources, is_container='container', yang_name="resources", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__resources = t + if hasattr(self, '_set'): + self._set() + + def _unset_resources(self): + self.__resources = YANGDynClass(base=resources.resources, is_container='container', yang_name="resources", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + resources = __builtin__.property(_get_resources, _set_resources) + + + _pyangbind_elements = OrderedDict([('resources', resources), ]) + + +from . import resources +class utilization(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/chassis/utilization. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Utilization of the component. + """ + __slots__ = ('_path_helper', '_extmethods', '__resources',) + + _yang_name = 'utilization' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__resources = YANGDynClass(base=resources.resources, is_container='container', yang_name="resources", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'chassis', 'utilization'] + + def _get_resources(self): + """ + Getter method for resources, mapped from YANG variable /components/component/chassis/utilization/resources (container) + + YANG Description: Enclosing container for the resources in this component. + """ + return self.__resources + + def _set_resources(self, v, load=False): + """ + Setter method for resources, mapped from YANG variable /components/component/chassis/utilization/resources (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_resources is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_resources() directly. + + YANG Description: Enclosing container for the resources in this component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=resources.resources, is_container='container', yang_name="resources", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """resources must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=resources.resources, is_container='container', yang_name="resources", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__resources = t + if hasattr(self, '_set'): + self._set() + + def _unset_resources(self): + self.__resources = YANGDynClass(base=resources.resources, is_container='container', yang_name="resources", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + resources = __builtin__.property(_get_resources, _set_resources) + + + _pyangbind_elements = OrderedDict([('resources', resources), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/chassis/utilization/resources/__init__.py b/hackfest/netconf-oc/openconfig/components/component/chassis/utilization/resources/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..29d51abe1879b785d0eaefd71a2055f1e136e89c --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/chassis/utilization/resources/__init__.py @@ -0,0 +1,208 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import resource +class resources(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/chassis/utilization/resources. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Enclosing container for the resources in this component. + """ + __slots__ = ('_path_helper', '_extmethods', '__resource',) + + _yang_name = 'resources' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__resource = YANGDynClass(base=YANGListType("name",resource.resource, yang_name="resource", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="resource", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'chassis', 'utilization', 'resources'] + + def _get_resource(self): + """ + Getter method for resource, mapped from YANG variable /components/component/chassis/utilization/resources/resource (list) + + YANG Description: List of resources, keyed by resource name. + """ + return self.__resource + + def _set_resource(self, v, load=False): + """ + Setter method for resource, mapped from YANG variable /components/component/chassis/utilization/resources/resource (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_resource is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_resource() directly. + + YANG Description: List of resources, keyed by resource name. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",resource.resource, yang_name="resource", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="resource", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """resource must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",resource.resource, yang_name="resource", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="resource", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True)""", + }) + + self.__resource = t + if hasattr(self, '_set'): + self._set() + + def _unset_resource(self): + self.__resource = YANGDynClass(base=YANGListType("name",resource.resource, yang_name="resource", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="resource", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + + resource = __builtin__.property(_get_resource, _set_resource) + + + _pyangbind_elements = OrderedDict([('resource', resource), ]) + + +from . import resource +class resources(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/chassis/utilization/resources. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Enclosing container for the resources in this component. + """ + __slots__ = ('_path_helper', '_extmethods', '__resource',) + + _yang_name = 'resources' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__resource = YANGDynClass(base=YANGListType("name",resource.resource, yang_name="resource", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="resource", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'chassis', 'utilization', 'resources'] + + def _get_resource(self): + """ + Getter method for resource, mapped from YANG variable /components/component/chassis/utilization/resources/resource (list) + + YANG Description: List of resources, keyed by resource name. + """ + return self.__resource + + def _set_resource(self, v, load=False): + """ + Setter method for resource, mapped from YANG variable /components/component/chassis/utilization/resources/resource (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_resource is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_resource() directly. + + YANG Description: List of resources, keyed by resource name. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",resource.resource, yang_name="resource", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="resource", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """resource must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",resource.resource, yang_name="resource", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="resource", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True)""", + }) + + self.__resource = t + if hasattr(self, '_set'): + self._set() + + def _unset_resource(self): + self.__resource = YANGDynClass(base=YANGListType("name",resource.resource, yang_name="resource", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="resource", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + + resource = __builtin__.property(_get_resource, _set_resource) + + + _pyangbind_elements = OrderedDict([('resource', resource), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/chassis/utilization/resources/resource/__init__.py b/hackfest/netconf-oc/openconfig/components/component/chassis/utilization/resources/resource/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ff0575f656886cc795b63d8f5c0020c03d0254c3 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/chassis/utilization/resources/resource/__init__.py @@ -0,0 +1,376 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import config +from . import state +class resource(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/chassis/utilization/resources/resource. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of resources, keyed by resource name. + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__config','__state',) + + _yang_name = 'resource' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'chassis', 'utilization', 'resources', 'resource'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/chassis/utilization/resources/resource/name (leafref) + + YANG Description: References the resource name. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/chassis/utilization/resources/resource/name (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: References the resource name. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + + + def _get_config(self): + """ + Getter method for config, mapped from YANG variable /components/component/chassis/utilization/resources/resource/config (container) + + YANG Description: Configuration data for each resource. + """ + return self.__config + + def _set_config(self, v, load=False): + """ + Setter method for config, mapped from YANG variable /components/component/chassis/utilization/resources/resource/config (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_config is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_config() directly. + + YANG Description: Configuration data for each resource. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """config must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__config = t + if hasattr(self, '_set'): + self._set() + + def _unset_config(self): + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_state(self): + """ + Getter method for state, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state (container) + + YANG Description: Operational state data for each resource. + """ + return self.__state + + def _set_state(self, v, load=False): + """ + Setter method for state, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_state() directly. + + YANG Description: Operational state data for each resource. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__state = t + if hasattr(self, '_set'): + self._set() + + def _unset_state(self): + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) + + + _pyangbind_elements = OrderedDict([('name', name), ('config', config), ('state', state), ]) + + +from . import config +from . import state +class resource(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/chassis/utilization/resources/resource. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of resources, keyed by resource name. + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__config','__state',) + + _yang_name = 'resource' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'chassis', 'utilization', 'resources', 'resource'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/chassis/utilization/resources/resource/name (leafref) + + YANG Description: References the resource name. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/chassis/utilization/resources/resource/name (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: References the resource name. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + + + def _get_config(self): + """ + Getter method for config, mapped from YANG variable /components/component/chassis/utilization/resources/resource/config (container) + + YANG Description: Configuration data for each resource. + """ + return self.__config + + def _set_config(self, v, load=False): + """ + Setter method for config, mapped from YANG variable /components/component/chassis/utilization/resources/resource/config (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_config is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_config() directly. + + YANG Description: Configuration data for each resource. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """config must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__config = t + if hasattr(self, '_set'): + self._set() + + def _unset_config(self): + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_state(self): + """ + Getter method for state, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state (container) + + YANG Description: Operational state data for each resource. + """ + return self.__state + + def _set_state(self, v, load=False): + """ + Setter method for state, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_state() directly. + + YANG Description: Operational state data for each resource. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__state = t + if hasattr(self, '_set'): + self._set() + + def _unset_state(self): + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) + + + _pyangbind_elements = OrderedDict([('name', name), ('config', config), ('state', state), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/chassis/utilization/resources/resource/config/__init__.py b/hackfest/netconf-oc/openconfig/components/component/chassis/utilization/resources/resource/config/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a766d52ec6ab7a593be38d4f11fbbc16dc80eb81 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/chassis/utilization/resources/resource/config/__init__.py @@ -0,0 +1,206 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class config(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/chassis/utilization/resources/resource/config. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Configuration data for each resource. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'config' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'chassis', 'utilization', 'resources', 'resource', 'config'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/chassis/utilization/resources/resource/config/name (string) + + YANG Description: Resource name within the component. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/chassis/utilization/resources/resource/config/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Resource name within the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + +class config(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/chassis/utilization/resources/resource/config. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Configuration data for each resource. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'config' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'chassis', 'utilization', 'resources', 'resource', 'config'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/chassis/utilization/resources/resource/config/name (string) + + YANG Description: Resource name within the component. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/chassis/utilization/resources/resource/config/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Resource name within the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/chassis/utilization/resources/resource/state/__init__.py b/hackfest/netconf-oc/openconfig/components/component/chassis/utilization/resources/resource/state/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9c38f59397042e87fc192c24bdbf883ce8e6fc54 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/chassis/utilization/resources/resource/state/__init__.py @@ -0,0 +1,686 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/chassis/utilization/resources/resource/state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Operational state data for each resource. + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__used','__committed','__free','__max_limit','__high_watermark','__last_high_watermark',) + + _yang_name = 'state' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__used = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="used", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + self.__committed = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + self.__free = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="free", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + self.__max_limit = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + self.__high_watermark = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + self.__last_high_watermark = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'chassis', 'utilization', 'resources', 'resource', 'state'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/name (string) + + YANG Description: Resource name within the component. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Resource name within the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_used(self): + """ + Getter method for used, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/used (uint64) + + YANG Description: Number of entries currently in use for the resource. + """ + return self.__used + + def _set_used(self, v, load=False): + """ + Setter method for used, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/used (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_used is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_used() directly. + + YANG Description: Number of entries currently in use for the resource. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="used", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """used must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="used", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__used = t + if hasattr(self, '_set'): + self._set() + + def _unset_used(self): + self.__used = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="used", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + + def _get_committed(self): + """ + Getter method for committed, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/committed (uint64) + + YANG Description: Number of entries currently reserved for this resource. This is only +relevant to tables which allocate a block of resource for a given +feature. + """ + return self.__committed + + def _set_committed(self, v, load=False): + """ + Setter method for committed, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/committed (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_committed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_committed() directly. + + YANG Description: Number of entries currently reserved for this resource. This is only +relevant to tables which allocate a block of resource for a given +feature. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """committed must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__committed = t + if hasattr(self, '_set'): + self._set() + + def _unset_committed(self): + self.__committed = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + + def _get_free(self): + """ + Getter method for free, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/free (uint64) + + YANG Description: Number of entries available to use. + """ + return self.__free + + def _set_free(self, v, load=False): + """ + Setter method for free, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/free (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_free is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_free() directly. + + YANG Description: Number of entries available to use. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="free", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """free must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="free", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__free = t + if hasattr(self, '_set'): + self._set() + + def _unset_free(self): + self.__free = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="free", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + + def _get_max_limit(self): + """ + Getter method for max_limit, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/max_limit (uint64) + + YANG Description: Maximum number of entries available for the resource. The value +is the theoretical maximum resource utilization possible. + """ + return self.__max_limit + + def _set_max_limit(self, v, load=False): + """ + Setter method for max_limit, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/max_limit (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_limit is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_limit() directly. + + YANG Description: Maximum number of entries available for the resource. The value +is the theoretical maximum resource utilization possible. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_limit must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__max_limit = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_limit(self): + self.__max_limit = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + + def _get_high_watermark(self): + """ + Getter method for high_watermark, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/high_watermark (uint64) + + YANG Description: A watermark of highest number of entries used for this resource. + """ + return self.__high_watermark + + def _set_high_watermark(self, v, load=False): + """ + Setter method for high_watermark, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/high_watermark (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_high_watermark is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_high_watermark() directly. + + YANG Description: A watermark of highest number of entries used for this resource. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """high_watermark must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__high_watermark = t + if hasattr(self, '_set'): + self._set() + + def _unset_high_watermark(self): + self.__high_watermark = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + + def _get_last_high_watermark(self): + """ + Getter method for last_high_watermark, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/last_high_watermark (oc-types:timeticks64) + + YANG Description: The time when the high-watermark was last updated + """ + return self.__last_high_watermark + + def _set_last_high_watermark(self, v, load=False): + """ + Setter method for last_high_watermark, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/last_high_watermark (oc-types:timeticks64) + If this variable is read-only (config: false) in the + source YANG file, then _set_last_high_watermark is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_last_high_watermark() directly. + + YANG Description: The time when the high-watermark was last updated + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """last_high_watermark must be of a type compatible with oc-types:timeticks64""", + 'defined-type': "oc-types:timeticks64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False)""", + }) + + self.__last_high_watermark = t + if hasattr(self, '_set'): + self._set() + + def _unset_last_high_watermark(self): + self.__last_high_watermark = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + + name = __builtin__.property(_get_name) + used = __builtin__.property(_get_used) + committed = __builtin__.property(_get_committed) + free = __builtin__.property(_get_free) + max_limit = __builtin__.property(_get_max_limit) + high_watermark = __builtin__.property(_get_high_watermark) + last_high_watermark = __builtin__.property(_get_last_high_watermark) + + + _pyangbind_elements = OrderedDict([('name', name), ('used', used), ('committed', committed), ('free', free), ('max_limit', max_limit), ('high_watermark', high_watermark), ('last_high_watermark', last_high_watermark), ]) + + +class state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/chassis/utilization/resources/resource/state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Operational state data for each resource. + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__used','__committed','__free','__max_limit','__high_watermark','__last_high_watermark',) + + _yang_name = 'state' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__used = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="used", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + self.__committed = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + self.__free = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="free", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + self.__max_limit = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + self.__high_watermark = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + self.__last_high_watermark = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'chassis', 'utilization', 'resources', 'resource', 'state'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/name (string) + + YANG Description: Resource name within the component. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Resource name within the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_used(self): + """ + Getter method for used, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/used (uint64) + + YANG Description: Number of entries currently in use for the resource. + """ + return self.__used + + def _set_used(self, v, load=False): + """ + Setter method for used, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/used (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_used is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_used() directly. + + YANG Description: Number of entries currently in use for the resource. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="used", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """used must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="used", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__used = t + if hasattr(self, '_set'): + self._set() + + def _unset_used(self): + self.__used = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="used", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + + def _get_committed(self): + """ + Getter method for committed, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/committed (uint64) + + YANG Description: Number of entries currently reserved for this resource. This is only +relevant to tables which allocate a block of resource for a given +feature. + """ + return self.__committed + + def _set_committed(self, v, load=False): + """ + Setter method for committed, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/committed (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_committed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_committed() directly. + + YANG Description: Number of entries currently reserved for this resource. This is only +relevant to tables which allocate a block of resource for a given +feature. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """committed must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__committed = t + if hasattr(self, '_set'): + self._set() + + def _unset_committed(self): + self.__committed = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + + def _get_free(self): + """ + Getter method for free, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/free (uint64) + + YANG Description: Number of entries available to use. + """ + return self.__free + + def _set_free(self, v, load=False): + """ + Setter method for free, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/free (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_free is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_free() directly. + + YANG Description: Number of entries available to use. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="free", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """free must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="free", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__free = t + if hasattr(self, '_set'): + self._set() + + def _unset_free(self): + self.__free = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="free", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + + def _get_max_limit(self): + """ + Getter method for max_limit, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/max_limit (uint64) + + YANG Description: Maximum number of entries available for the resource. The value +is the theoretical maximum resource utilization possible. + """ + return self.__max_limit + + def _set_max_limit(self, v, load=False): + """ + Setter method for max_limit, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/max_limit (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_limit is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_limit() directly. + + YANG Description: Maximum number of entries available for the resource. The value +is the theoretical maximum resource utilization possible. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_limit must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__max_limit = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_limit(self): + self.__max_limit = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + + def _get_high_watermark(self): + """ + Getter method for high_watermark, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/high_watermark (uint64) + + YANG Description: A watermark of highest number of entries used for this resource. + """ + return self.__high_watermark + + def _set_high_watermark(self, v, load=False): + """ + Setter method for high_watermark, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/high_watermark (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_high_watermark is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_high_watermark() directly. + + YANG Description: A watermark of highest number of entries used for this resource. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """high_watermark must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__high_watermark = t + if hasattr(self, '_set'): + self._set() + + def _unset_high_watermark(self): + self.__high_watermark = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + + def _get_last_high_watermark(self): + """ + Getter method for last_high_watermark, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/last_high_watermark (oc-types:timeticks64) + + YANG Description: The time when the high-watermark was last updated + """ + return self.__last_high_watermark + + def _set_last_high_watermark(self, v, load=False): + """ + Setter method for last_high_watermark, mapped from YANG variable /components/component/chassis/utilization/resources/resource/state/last_high_watermark (oc-types:timeticks64) + If this variable is read-only (config: false) in the + source YANG file, then _set_last_high_watermark is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_last_high_watermark() directly. + + YANG Description: The time when the high-watermark was last updated + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """last_high_watermark must be of a type compatible with oc-types:timeticks64""", + 'defined-type': "oc-types:timeticks64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False)""", + }) + + self.__last_high_watermark = t + if hasattr(self, '_set'): + self._set() + + def _unset_last_high_watermark(self): + self.__last_high_watermark = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + + name = __builtin__.property(_get_name) + used = __builtin__.property(_get_used) + committed = __builtin__.property(_get_committed) + free = __builtin__.property(_get_free) + max_limit = __builtin__.property(_get_max_limit) + high_watermark = __builtin__.property(_get_high_watermark) + last_high_watermark = __builtin__.property(_get_last_high_watermark) + + + _pyangbind_elements = OrderedDict([('name', name), ('used', used), ('committed', committed), ('free', free), ('max_limit', max_limit), ('high_watermark', high_watermark), ('last_high_watermark', last_high_watermark), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/config/__init__.py b/hackfest/netconf-oc/openconfig/components/component/config/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..05fc5b7959140a835f0cbeee106f326b689e072c --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/config/__init__.py @@ -0,0 +1,218 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class config(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/config. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Configuration data for each component + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'config' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'config'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/config/name (string) + + YANG Description: Device name for the component -- this may not be a +configurable parameter on many implementations. Where +component preconfiguration is supported, for example, +the component name may be configurable. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/config/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Device name for the component -- this may not be a +configurable parameter on many implementations. Where +component preconfiguration is supported, for example, +the component name may be configurable. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + +class config(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/config. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Configuration data for each component + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'config' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'config'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/config/name (string) + + YANG Description: Device name for the component -- this may not be a +configurable parameter on many implementations. Where +component preconfiguration is supported, for example, +the component name may be configurable. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/config/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Device name for the component -- this may not be a +configurable parameter on many implementations. Where +component preconfiguration is supported, for example, +the component name may be configurable. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/controller_card/__init__.py b/hackfest/netconf-oc/openconfig/components/component/controller_card/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7575a47edcbec0bded345e9bdb3a4ef2c18d6b45 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/controller_card/__init__.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class controller_card(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/controller-card. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Data for controller card components, i.e., for components +with type=CONTROLLER_CARD + """ + _pyangbind_elements = {} + + + +class controller_card(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/controller-card. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Data for controller card components, i.e., for components +with type=CONTROLLER_CARD + """ + _pyangbind_elements = {} + + + diff --git a/hackfest/netconf-oc/openconfig/components/component/cpu/__init__.py b/hackfest/netconf-oc/openconfig/components/component/cpu/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..06420eb73a3c14d5e991872eecd4cd68f4b726e2 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/cpu/__init__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class cpu(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/cpu. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Data for cpu components + """ + _pyangbind_elements = {} + + + +class cpu(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/cpu. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Data for cpu components + """ + _pyangbind_elements = {} + + + diff --git a/hackfest/netconf-oc/openconfig/components/component/fabric/__init__.py b/hackfest/netconf-oc/openconfig/components/component/fabric/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b88c441d803837f34cfe270a482ddf6a1d9dd878 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/fabric/__init__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class fabric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/fabric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Data for fabric components + """ + _pyangbind_elements = {} + + + +class fabric(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/fabric. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Data for fabric components + """ + _pyangbind_elements = {} + + + diff --git a/hackfest/netconf-oc/openconfig/components/component/fan/__init__.py b/hackfest/netconf-oc/openconfig/components/component/fan/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e1d3cd8498e89aa26235c0ba94d2aee418c27e70 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/fan/__init__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class fan(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/fan. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Data for fan components + """ + _pyangbind_elements = {} + + + +class fan(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/fan. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Data for fan components + """ + _pyangbind_elements = {} + + + diff --git a/hackfest/netconf-oc/openconfig/components/component/integrated_circuit/__init__.py b/hackfest/netconf-oc/openconfig/components/component/integrated_circuit/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a2f0ee8b82fa19dd322d3224de33942a050a6fa2 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/integrated_circuit/__init__.py @@ -0,0 +1,208 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import utilization +class integrated_circuit(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/integrated-circuit. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Data for chip components, such as ASIC, NPUs, etc. + """ + __slots__ = ('_path_helper', '_extmethods', '__utilization',) + + _yang_name = 'integrated-circuit' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__utilization = YANGDynClass(base=utilization.utilization, is_container='container', yang_name="utilization", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'integrated-circuit'] + + def _get_utilization(self): + """ + Getter method for utilization, mapped from YANG variable /components/component/integrated_circuit/utilization (container) + + YANG Description: Utilization of the component. + """ + return self.__utilization + + def _set_utilization(self, v, load=False): + """ + Setter method for utilization, mapped from YANG variable /components/component/integrated_circuit/utilization (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_utilization is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_utilization() directly. + + YANG Description: Utilization of the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=utilization.utilization, is_container='container', yang_name="utilization", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """utilization must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=utilization.utilization, is_container='container', yang_name="utilization", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__utilization = t + if hasattr(self, '_set'): + self._set() + + def _unset_utilization(self): + self.__utilization = YANGDynClass(base=utilization.utilization, is_container='container', yang_name="utilization", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + utilization = __builtin__.property(_get_utilization, _set_utilization) + + + _pyangbind_elements = OrderedDict([('utilization', utilization), ]) + + +from . import utilization +class integrated_circuit(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/integrated-circuit. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Data for chip components, such as ASIC, NPUs, etc. + """ + __slots__ = ('_path_helper', '_extmethods', '__utilization',) + + _yang_name = 'integrated-circuit' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__utilization = YANGDynClass(base=utilization.utilization, is_container='container', yang_name="utilization", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'integrated-circuit'] + + def _get_utilization(self): + """ + Getter method for utilization, mapped from YANG variable /components/component/integrated_circuit/utilization (container) + + YANG Description: Utilization of the component. + """ + return self.__utilization + + def _set_utilization(self, v, load=False): + """ + Setter method for utilization, mapped from YANG variable /components/component/integrated_circuit/utilization (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_utilization is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_utilization() directly. + + YANG Description: Utilization of the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=utilization.utilization, is_container='container', yang_name="utilization", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """utilization must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=utilization.utilization, is_container='container', yang_name="utilization", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__utilization = t + if hasattr(self, '_set'): + self._set() + + def _unset_utilization(self): + self.__utilization = YANGDynClass(base=utilization.utilization, is_container='container', yang_name="utilization", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + utilization = __builtin__.property(_get_utilization, _set_utilization) + + + _pyangbind_elements = OrderedDict([('utilization', utilization), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/integrated_circuit/utilization/__init__.py b/hackfest/netconf-oc/openconfig/components/component/integrated_circuit/utilization/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..dc2ebc87c9230ab64955cec0a4bfcf752b97acc0 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/integrated_circuit/utilization/__init__.py @@ -0,0 +1,208 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import resources +class utilization(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/integrated-circuit/utilization. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Utilization of the component. + """ + __slots__ = ('_path_helper', '_extmethods', '__resources',) + + _yang_name = 'utilization' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__resources = YANGDynClass(base=resources.resources, is_container='container', yang_name="resources", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'integrated-circuit', 'utilization'] + + def _get_resources(self): + """ + Getter method for resources, mapped from YANG variable /components/component/integrated_circuit/utilization/resources (container) + + YANG Description: Enclosing container for the resources in this component. + """ + return self.__resources + + def _set_resources(self, v, load=False): + """ + Setter method for resources, mapped from YANG variable /components/component/integrated_circuit/utilization/resources (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_resources is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_resources() directly. + + YANG Description: Enclosing container for the resources in this component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=resources.resources, is_container='container', yang_name="resources", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """resources must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=resources.resources, is_container='container', yang_name="resources", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__resources = t + if hasattr(self, '_set'): + self._set() + + def _unset_resources(self): + self.__resources = YANGDynClass(base=resources.resources, is_container='container', yang_name="resources", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + resources = __builtin__.property(_get_resources, _set_resources) + + + _pyangbind_elements = OrderedDict([('resources', resources), ]) + + +from . import resources +class utilization(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/integrated-circuit/utilization. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Utilization of the component. + """ + __slots__ = ('_path_helper', '_extmethods', '__resources',) + + _yang_name = 'utilization' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__resources = YANGDynClass(base=resources.resources, is_container='container', yang_name="resources", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'integrated-circuit', 'utilization'] + + def _get_resources(self): + """ + Getter method for resources, mapped from YANG variable /components/component/integrated_circuit/utilization/resources (container) + + YANG Description: Enclosing container for the resources in this component. + """ + return self.__resources + + def _set_resources(self, v, load=False): + """ + Setter method for resources, mapped from YANG variable /components/component/integrated_circuit/utilization/resources (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_resources is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_resources() directly. + + YANG Description: Enclosing container for the resources in this component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=resources.resources, is_container='container', yang_name="resources", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """resources must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=resources.resources, is_container='container', yang_name="resources", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__resources = t + if hasattr(self, '_set'): + self._set() + + def _unset_resources(self): + self.__resources = YANGDynClass(base=resources.resources, is_container='container', yang_name="resources", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + resources = __builtin__.property(_get_resources, _set_resources) + + + _pyangbind_elements = OrderedDict([('resources', resources), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/integrated_circuit/utilization/resources/__init__.py b/hackfest/netconf-oc/openconfig/components/component/integrated_circuit/utilization/resources/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f0833cc9b6254d4dab2a73303835af935316be07 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/integrated_circuit/utilization/resources/__init__.py @@ -0,0 +1,208 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import resource +class resources(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/integrated-circuit/utilization/resources. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Enclosing container for the resources in this component. + """ + __slots__ = ('_path_helper', '_extmethods', '__resource',) + + _yang_name = 'resources' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__resource = YANGDynClass(base=YANGListType("name",resource.resource, yang_name="resource", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="resource", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'integrated-circuit', 'utilization', 'resources'] + + def _get_resource(self): + """ + Getter method for resource, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource (list) + + YANG Description: List of resources, keyed by resource name. + """ + return self.__resource + + def _set_resource(self, v, load=False): + """ + Setter method for resource, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_resource is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_resource() directly. + + YANG Description: List of resources, keyed by resource name. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",resource.resource, yang_name="resource", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="resource", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """resource must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",resource.resource, yang_name="resource", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="resource", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True)""", + }) + + self.__resource = t + if hasattr(self, '_set'): + self._set() + + def _unset_resource(self): + self.__resource = YANGDynClass(base=YANGListType("name",resource.resource, yang_name="resource", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="resource", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + + resource = __builtin__.property(_get_resource, _set_resource) + + + _pyangbind_elements = OrderedDict([('resource', resource), ]) + + +from . import resource +class resources(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/integrated-circuit/utilization/resources. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Enclosing container for the resources in this component. + """ + __slots__ = ('_path_helper', '_extmethods', '__resource',) + + _yang_name = 'resources' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__resource = YANGDynClass(base=YANGListType("name",resource.resource, yang_name="resource", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="resource", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'integrated-circuit', 'utilization', 'resources'] + + def _get_resource(self): + """ + Getter method for resource, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource (list) + + YANG Description: List of resources, keyed by resource name. + """ + return self.__resource + + def _set_resource(self, v, load=False): + """ + Setter method for resource, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_resource is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_resource() directly. + + YANG Description: List of resources, keyed by resource name. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",resource.resource, yang_name="resource", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="resource", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """resource must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",resource.resource, yang_name="resource", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="resource", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True)""", + }) + + self.__resource = t + if hasattr(self, '_set'): + self._set() + + def _unset_resource(self): + self.__resource = YANGDynClass(base=YANGListType("name",resource.resource, yang_name="resource", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="resource", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + + resource = __builtin__.property(_get_resource, _set_resource) + + + _pyangbind_elements = OrderedDict([('resource', resource), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/integrated_circuit/utilization/resources/resource/__init__.py b/hackfest/netconf-oc/openconfig/components/component/integrated_circuit/utilization/resources/resource/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fe54dd37de1e3c4637206e887b07286d611d1e1c --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/integrated_circuit/utilization/resources/resource/__init__.py @@ -0,0 +1,376 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import config +from . import state +class resource(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/integrated-circuit/utilization/resources/resource. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of resources, keyed by resource name. + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__config','__state',) + + _yang_name = 'resource' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'integrated-circuit', 'utilization', 'resources', 'resource'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/name (leafref) + + YANG Description: References the resource name. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/name (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: References the resource name. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + + + def _get_config(self): + """ + Getter method for config, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/config (container) + + YANG Description: Configuration data for each resource. + """ + return self.__config + + def _set_config(self, v, load=False): + """ + Setter method for config, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/config (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_config is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_config() directly. + + YANG Description: Configuration data for each resource. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """config must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__config = t + if hasattr(self, '_set'): + self._set() + + def _unset_config(self): + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_state(self): + """ + Getter method for state, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state (container) + + YANG Description: Operational state data for each resource. + """ + return self.__state + + def _set_state(self, v, load=False): + """ + Setter method for state, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_state() directly. + + YANG Description: Operational state data for each resource. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__state = t + if hasattr(self, '_set'): + self._set() + + def _unset_state(self): + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) + + + _pyangbind_elements = OrderedDict([('name', name), ('config', config), ('state', state), ]) + + +from . import config +from . import state +class resource(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/integrated-circuit/utilization/resources/resource. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of resources, keyed by resource name. + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__config','__state',) + + _yang_name = 'resource' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'integrated-circuit', 'utilization', 'resources', 'resource'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/name (leafref) + + YANG Description: References the resource name. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/name (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: References the resource name. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + + + def _get_config(self): + """ + Getter method for config, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/config (container) + + YANG Description: Configuration data for each resource. + """ + return self.__config + + def _set_config(self, v, load=False): + """ + Setter method for config, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/config (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_config is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_config() directly. + + YANG Description: Configuration data for each resource. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """config must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__config = t + if hasattr(self, '_set'): + self._set() + + def _unset_config(self): + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_state(self): + """ + Getter method for state, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state (container) + + YANG Description: Operational state data for each resource. + """ + return self.__state + + def _set_state(self, v, load=False): + """ + Setter method for state, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_state() directly. + + YANG Description: Operational state data for each resource. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__state = t + if hasattr(self, '_set'): + self._set() + + def _unset_state(self): + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) + + + _pyangbind_elements = OrderedDict([('name', name), ('config', config), ('state', state), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/integrated_circuit/utilization/resources/resource/config/__init__.py b/hackfest/netconf-oc/openconfig/components/component/integrated_circuit/utilization/resources/resource/config/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..dbc0dc799a609085f77f18a623042a7b1ca556ce --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/integrated_circuit/utilization/resources/resource/config/__init__.py @@ -0,0 +1,206 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class config(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/integrated-circuit/utilization/resources/resource/config. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Configuration data for each resource. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'config' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'integrated-circuit', 'utilization', 'resources', 'resource', 'config'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/config/name (string) + + YANG Description: Resource name within the component. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/config/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Resource name within the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + +class config(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/integrated-circuit/utilization/resources/resource/config. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Configuration data for each resource. + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'config' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'integrated-circuit', 'utilization', 'resources', 'resource', 'config'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/config/name (string) + + YANG Description: Resource name within the component. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/config/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Resource name within the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/integrated_circuit/utilization/resources/resource/state/__init__.py b/hackfest/netconf-oc/openconfig/components/component/integrated_circuit/utilization/resources/resource/state/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e4cb2cec886fe113f1fd595c386eef65e084374f --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/integrated_circuit/utilization/resources/resource/state/__init__.py @@ -0,0 +1,686 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/integrated-circuit/utilization/resources/resource/state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Operational state data for each resource. + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__used','__committed','__free','__max_limit','__high_watermark','__last_high_watermark',) + + _yang_name = 'state' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__used = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="used", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + self.__committed = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + self.__free = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="free", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + self.__max_limit = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + self.__high_watermark = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + self.__last_high_watermark = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'integrated-circuit', 'utilization', 'resources', 'resource', 'state'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/name (string) + + YANG Description: Resource name within the component. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Resource name within the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_used(self): + """ + Getter method for used, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/used (uint64) + + YANG Description: Number of entries currently in use for the resource. + """ + return self.__used + + def _set_used(self, v, load=False): + """ + Setter method for used, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/used (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_used is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_used() directly. + + YANG Description: Number of entries currently in use for the resource. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="used", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """used must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="used", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__used = t + if hasattr(self, '_set'): + self._set() + + def _unset_used(self): + self.__used = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="used", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + + def _get_committed(self): + """ + Getter method for committed, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/committed (uint64) + + YANG Description: Number of entries currently reserved for this resource. This is only +relevant to tables which allocate a block of resource for a given +feature. + """ + return self.__committed + + def _set_committed(self, v, load=False): + """ + Setter method for committed, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/committed (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_committed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_committed() directly. + + YANG Description: Number of entries currently reserved for this resource. This is only +relevant to tables which allocate a block of resource for a given +feature. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """committed must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__committed = t + if hasattr(self, '_set'): + self._set() + + def _unset_committed(self): + self.__committed = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + + def _get_free(self): + """ + Getter method for free, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/free (uint64) + + YANG Description: Number of entries available to use. + """ + return self.__free + + def _set_free(self, v, load=False): + """ + Setter method for free, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/free (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_free is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_free() directly. + + YANG Description: Number of entries available to use. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="free", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """free must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="free", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__free = t + if hasattr(self, '_set'): + self._set() + + def _unset_free(self): + self.__free = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="free", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + + def _get_max_limit(self): + """ + Getter method for max_limit, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/max_limit (uint64) + + YANG Description: Maximum number of entries available for the resource. The value +is the theoretical maximum resource utilization possible. + """ + return self.__max_limit + + def _set_max_limit(self, v, load=False): + """ + Setter method for max_limit, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/max_limit (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_limit is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_limit() directly. + + YANG Description: Maximum number of entries available for the resource. The value +is the theoretical maximum resource utilization possible. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_limit must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__max_limit = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_limit(self): + self.__max_limit = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + + def _get_high_watermark(self): + """ + Getter method for high_watermark, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/high_watermark (uint64) + + YANG Description: A watermark of highest number of entries used for this resource. + """ + return self.__high_watermark + + def _set_high_watermark(self, v, load=False): + """ + Setter method for high_watermark, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/high_watermark (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_high_watermark is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_high_watermark() directly. + + YANG Description: A watermark of highest number of entries used for this resource. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """high_watermark must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__high_watermark = t + if hasattr(self, '_set'): + self._set() + + def _unset_high_watermark(self): + self.__high_watermark = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + + def _get_last_high_watermark(self): + """ + Getter method for last_high_watermark, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/last_high_watermark (oc-types:timeticks64) + + YANG Description: The time when the high-watermark was last updated + """ + return self.__last_high_watermark + + def _set_last_high_watermark(self, v, load=False): + """ + Setter method for last_high_watermark, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/last_high_watermark (oc-types:timeticks64) + If this variable is read-only (config: false) in the + source YANG file, then _set_last_high_watermark is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_last_high_watermark() directly. + + YANG Description: The time when the high-watermark was last updated + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """last_high_watermark must be of a type compatible with oc-types:timeticks64""", + 'defined-type': "oc-types:timeticks64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False)""", + }) + + self.__last_high_watermark = t + if hasattr(self, '_set'): + self._set() + + def _unset_last_high_watermark(self): + self.__last_high_watermark = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + + name = __builtin__.property(_get_name) + used = __builtin__.property(_get_used) + committed = __builtin__.property(_get_committed) + free = __builtin__.property(_get_free) + max_limit = __builtin__.property(_get_max_limit) + high_watermark = __builtin__.property(_get_high_watermark) + last_high_watermark = __builtin__.property(_get_last_high_watermark) + + + _pyangbind_elements = OrderedDict([('name', name), ('used', used), ('committed', committed), ('free', free), ('max_limit', max_limit), ('high_watermark', high_watermark), ('last_high_watermark', last_high_watermark), ]) + + +class state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/integrated-circuit/utilization/resources/resource/state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Operational state data for each resource. + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__used','__committed','__free','__max_limit','__high_watermark','__last_high_watermark',) + + _yang_name = 'state' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__used = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="used", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + self.__committed = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + self.__free = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="free", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + self.__max_limit = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + self.__high_watermark = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + self.__last_high_watermark = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'integrated-circuit', 'utilization', 'resources', 'resource', 'state'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/name (string) + + YANG Description: Resource name within the component. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Resource name within the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_used(self): + """ + Getter method for used, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/used (uint64) + + YANG Description: Number of entries currently in use for the resource. + """ + return self.__used + + def _set_used(self, v, load=False): + """ + Setter method for used, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/used (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_used is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_used() directly. + + YANG Description: Number of entries currently in use for the resource. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="used", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """used must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="used", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__used = t + if hasattr(self, '_set'): + self._set() + + def _unset_used(self): + self.__used = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="used", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + + def _get_committed(self): + """ + Getter method for committed, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/committed (uint64) + + YANG Description: Number of entries currently reserved for this resource. This is only +relevant to tables which allocate a block of resource for a given +feature. + """ + return self.__committed + + def _set_committed(self, v, load=False): + """ + Setter method for committed, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/committed (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_committed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_committed() directly. + + YANG Description: Number of entries currently reserved for this resource. This is only +relevant to tables which allocate a block of resource for a given +feature. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """committed must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__committed = t + if hasattr(self, '_set'): + self._set() + + def _unset_committed(self): + self.__committed = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="committed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + + def _get_free(self): + """ + Getter method for free, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/free (uint64) + + YANG Description: Number of entries available to use. + """ + return self.__free + + def _set_free(self, v, load=False): + """ + Setter method for free, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/free (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_free is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_free() directly. + + YANG Description: Number of entries available to use. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="free", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """free must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="free", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__free = t + if hasattr(self, '_set'): + self._set() + + def _unset_free(self): + self.__free = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="free", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + + def _get_max_limit(self): + """ + Getter method for max_limit, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/max_limit (uint64) + + YANG Description: Maximum number of entries available for the resource. The value +is the theoretical maximum resource utilization possible. + """ + return self.__max_limit + + def _set_max_limit(self, v, load=False): + """ + Setter method for max_limit, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/max_limit (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_limit is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_limit() directly. + + YANG Description: Maximum number of entries available for the resource. The value +is the theoretical maximum resource utilization possible. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_limit must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__max_limit = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_limit(self): + self.__max_limit = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + + def _get_high_watermark(self): + """ + Getter method for high_watermark, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/high_watermark (uint64) + + YANG Description: A watermark of highest number of entries used for this resource. + """ + return self.__high_watermark + + def _set_high_watermark(self, v, load=False): + """ + Setter method for high_watermark, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/high_watermark (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_high_watermark is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_high_watermark() directly. + + YANG Description: A watermark of highest number of entries used for this resource. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """high_watermark must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__high_watermark = t + if hasattr(self, '_set'): + self._set() + + def _unset_high_watermark(self): + self.__high_watermark = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + + def _get_last_high_watermark(self): + """ + Getter method for last_high_watermark, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/last_high_watermark (oc-types:timeticks64) + + YANG Description: The time when the high-watermark was last updated + """ + return self.__last_high_watermark + + def _set_last_high_watermark(self, v, load=False): + """ + Setter method for last_high_watermark, mapped from YANG variable /components/component/integrated_circuit/utilization/resources/resource/state/last_high_watermark (oc-types:timeticks64) + If this variable is read-only (config: false) in the + source YANG file, then _set_last_high_watermark is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_last_high_watermark() directly. + + YANG Description: The time when the high-watermark was last updated + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """last_high_watermark must be of a type compatible with oc-types:timeticks64""", + 'defined-type': "oc-types:timeticks64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False)""", + }) + + self.__last_high_watermark = t + if hasattr(self, '_set'): + self._set() + + def _unset_last_high_watermark(self): + self.__last_high_watermark = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-high-watermark", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + + name = __builtin__.property(_get_name) + used = __builtin__.property(_get_used) + committed = __builtin__.property(_get_committed) + free = __builtin__.property(_get_free) + max_limit = __builtin__.property(_get_max_limit) + high_watermark = __builtin__.property(_get_high_watermark) + last_high_watermark = __builtin__.property(_get_last_high_watermark) + + + _pyangbind_elements = OrderedDict([('name', name), ('used', used), ('committed', committed), ('free', free), ('max_limit', max_limit), ('high_watermark', high_watermark), ('last_high_watermark', last_high_watermark), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/port/__init__.py b/hackfest/netconf-oc/openconfig/components/component/port/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..74542ccd89fc359229b55c7fbb2f6d6701d0fd1a --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/port/__init__.py @@ -0,0 +1,208 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import breakout_mode +class port(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/port. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Data for physical port components + """ + __slots__ = ('_path_helper', '_extmethods', '__breakout_mode',) + + _yang_name = 'port' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__breakout_mode = YANGDynClass(base=breakout_mode.breakout_mode, is_container='container', yang_name="breakout-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'port'] + + def _get_breakout_mode(self): + """ + Getter method for breakout_mode, mapped from YANG variable /components/component/port/breakout_mode (container) + + YANG Description: Top-level container for port breakout-mode data. + """ + return self.__breakout_mode + + def _set_breakout_mode(self, v, load=False): + """ + Setter method for breakout_mode, mapped from YANG variable /components/component/port/breakout_mode (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_breakout_mode is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_breakout_mode() directly. + + YANG Description: Top-level container for port breakout-mode data. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=breakout_mode.breakout_mode, is_container='container', yang_name="breakout-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """breakout_mode must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=breakout_mode.breakout_mode, is_container='container', yang_name="breakout-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True)""", + }) + + self.__breakout_mode = t + if hasattr(self, '_set'): + self._set() + + def _unset_breakout_mode(self): + self.__breakout_mode = YANGDynClass(base=breakout_mode.breakout_mode, is_container='container', yang_name="breakout-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + + breakout_mode = __builtin__.property(_get_breakout_mode, _set_breakout_mode) + + + _pyangbind_elements = OrderedDict([('breakout_mode', breakout_mode), ]) + + +from . import breakout_mode +class port(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/port. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Data for physical port components + """ + __slots__ = ('_path_helper', '_extmethods', '__breakout_mode',) + + _yang_name = 'port' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__breakout_mode = YANGDynClass(base=breakout_mode.breakout_mode, is_container='container', yang_name="breakout-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'port'] + + def _get_breakout_mode(self): + """ + Getter method for breakout_mode, mapped from YANG variable /components/component/port/breakout_mode (container) + + YANG Description: Top-level container for port breakout-mode data. + """ + return self.__breakout_mode + + def _set_breakout_mode(self, v, load=False): + """ + Setter method for breakout_mode, mapped from YANG variable /components/component/port/breakout_mode (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_breakout_mode is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_breakout_mode() directly. + + YANG Description: Top-level container for port breakout-mode data. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=breakout_mode.breakout_mode, is_container='container', yang_name="breakout-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """breakout_mode must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=breakout_mode.breakout_mode, is_container='container', yang_name="breakout-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True)""", + }) + + self.__breakout_mode = t + if hasattr(self, '_set'): + self._set() + + def _unset_breakout_mode(self): + self.__breakout_mode = YANGDynClass(base=breakout_mode.breakout_mode, is_container='container', yang_name="breakout-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + + breakout_mode = __builtin__.property(_get_breakout_mode, _set_breakout_mode) + + + _pyangbind_elements = OrderedDict([('breakout_mode', breakout_mode), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/port/breakout_mode/__init__.py b/hackfest/netconf-oc/openconfig/components/component/port/breakout_mode/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..363988ab6a25e9f8e5928b71e5004f95a6dd49f6 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/port/breakout_mode/__init__.py @@ -0,0 +1,300 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import groups +class breakout_mode(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/port/breakout-mode. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Top-level container for port breakout-mode data. + """ + __slots__ = ('_path_helper', '_extmethods', '__groups',) + + _yang_name = 'breakout-mode' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__groups = YANGDynClass(base=groups.groups, is_container='container', yang_name="groups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'port', 'breakout-mode'] + + def _get_groups(self): + """ + Getter method for groups, mapped from YANG variable /components/component/port/breakout_mode/groups (container) + + YANG Description: Top level container for breakout groups data. + +When a device has the capability to break a port into +interfaces of different speeds and different number of +physical channels, it can breakout a 400G OSFP port with +8 physical channels (with support for 25G NRZ, 50G PAM4 +and 100G PAM4) in the following configuration: + +100G + 100G + 200G -> 1 interface with 2 physical channels +and 1 interface with 4 physical channels and 1 interface with +2 physical channels. With this configuration the interface in +1st breakout group would use 50G PAM4 modulation, interface +in 2nd breakout group would use 25G NRZ modulation and the +interface in 3rd breakout group would use 100G PAM4 modulation +This configuration would result in 3 entries in the breakout +groups list. + +When a device does not have the capability to break a port +into interfaces of different speeds and different number of +physical channels, it would breakout a 400G OSFP port with +8 physical channels in the following configuration: + +50G -> 8 interfaces with 1 physical channel each, this would +result in 1 entry in the breakout groups list. + """ + return self.__groups + + def _set_groups(self, v, load=False): + """ + Setter method for groups, mapped from YANG variable /components/component/port/breakout_mode/groups (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_groups is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_groups() directly. + + YANG Description: Top level container for breakout groups data. + +When a device has the capability to break a port into +interfaces of different speeds and different number of +physical channels, it can breakout a 400G OSFP port with +8 physical channels (with support for 25G NRZ, 50G PAM4 +and 100G PAM4) in the following configuration: + +100G + 100G + 200G -> 1 interface with 2 physical channels +and 1 interface with 4 physical channels and 1 interface with +2 physical channels. With this configuration the interface in +1st breakout group would use 50G PAM4 modulation, interface +in 2nd breakout group would use 25G NRZ modulation and the +interface in 3rd breakout group would use 100G PAM4 modulation +This configuration would result in 3 entries in the breakout +groups list. + +When a device does not have the capability to break a port +into interfaces of different speeds and different number of +physical channels, it would breakout a 400G OSFP port with +8 physical channels in the following configuration: + +50G -> 8 interfaces with 1 physical channel each, this would +result in 1 entry in the breakout groups list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=groups.groups, is_container='container', yang_name="groups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """groups must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=groups.groups, is_container='container', yang_name="groups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True)""", + }) + + self.__groups = t + if hasattr(self, '_set'): + self._set() + + def _unset_groups(self): + self.__groups = YANGDynClass(base=groups.groups, is_container='container', yang_name="groups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + + groups = __builtin__.property(_get_groups, _set_groups) + + + _pyangbind_elements = OrderedDict([('groups', groups), ]) + + +from . import groups +class breakout_mode(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/port/breakout-mode. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Top-level container for port breakout-mode data. + """ + __slots__ = ('_path_helper', '_extmethods', '__groups',) + + _yang_name = 'breakout-mode' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__groups = YANGDynClass(base=groups.groups, is_container='container', yang_name="groups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'port', 'breakout-mode'] + + def _get_groups(self): + """ + Getter method for groups, mapped from YANG variable /components/component/port/breakout_mode/groups (container) + + YANG Description: Top level container for breakout groups data. + +When a device has the capability to break a port into +interfaces of different speeds and different number of +physical channels, it can breakout a 400G OSFP port with +8 physical channels (with support for 25G NRZ, 50G PAM4 +and 100G PAM4) in the following configuration: + +100G + 100G + 200G -> 1 interface with 2 physical channels +and 1 interface with 4 physical channels and 1 interface with +2 physical channels. With this configuration the interface in +1st breakout group would use 50G PAM4 modulation, interface +in 2nd breakout group would use 25G NRZ modulation and the +interface in 3rd breakout group would use 100G PAM4 modulation +This configuration would result in 3 entries in the breakout +groups list. + +When a device does not have the capability to break a port +into interfaces of different speeds and different number of +physical channels, it would breakout a 400G OSFP port with +8 physical channels in the following configuration: + +50G -> 8 interfaces with 1 physical channel each, this would +result in 1 entry in the breakout groups list. + """ + return self.__groups + + def _set_groups(self, v, load=False): + """ + Setter method for groups, mapped from YANG variable /components/component/port/breakout_mode/groups (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_groups is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_groups() directly. + + YANG Description: Top level container for breakout groups data. + +When a device has the capability to break a port into +interfaces of different speeds and different number of +physical channels, it can breakout a 400G OSFP port with +8 physical channels (with support for 25G NRZ, 50G PAM4 +and 100G PAM4) in the following configuration: + +100G + 100G + 200G -> 1 interface with 2 physical channels +and 1 interface with 4 physical channels and 1 interface with +2 physical channels. With this configuration the interface in +1st breakout group would use 50G PAM4 modulation, interface +in 2nd breakout group would use 25G NRZ modulation and the +interface in 3rd breakout group would use 100G PAM4 modulation +This configuration would result in 3 entries in the breakout +groups list. + +When a device does not have the capability to break a port +into interfaces of different speeds and different number of +physical channels, it would breakout a 400G OSFP port with +8 physical channels in the following configuration: + +50G -> 8 interfaces with 1 physical channel each, this would +result in 1 entry in the breakout groups list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=groups.groups, is_container='container', yang_name="groups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """groups must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=groups.groups, is_container='container', yang_name="groups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True)""", + }) + + self.__groups = t + if hasattr(self, '_set'): + self._set() + + def _unset_groups(self): + self.__groups = YANGDynClass(base=groups.groups, is_container='container', yang_name="groups", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + + groups = __builtin__.property(_get_groups, _set_groups) + + + _pyangbind_elements = OrderedDict([('groups', groups), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/port/breakout_mode/groups/__init__.py b/hackfest/netconf-oc/openconfig/components/component/port/breakout_mode/groups/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..523eb15138bed339e2361a968fc3701cdbfb2774 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/port/breakout_mode/groups/__init__.py @@ -0,0 +1,254 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import group +class groups(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/port/breakout-mode/groups. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Top level container for breakout groups data. + +When a device has the capability to break a port into +interfaces of different speeds and different number of +physical channels, it can breakout a 400G OSFP port with +8 physical channels (with support for 25G NRZ, 50G PAM4 +and 100G PAM4) in the following configuration: + +100G + 100G + 200G -> 1 interface with 2 physical channels +and 1 interface with 4 physical channels and 1 interface with +2 physical channels. With this configuration the interface in +1st breakout group would use 50G PAM4 modulation, interface +in 2nd breakout group would use 25G NRZ modulation and the +interface in 3rd breakout group would use 100G PAM4 modulation +This configuration would result in 3 entries in the breakout +groups list. + +When a device does not have the capability to break a port +into interfaces of different speeds and different number of +physical channels, it would breakout a 400G OSFP port with +8 physical channels in the following configuration: + +50G -> 8 interfaces with 1 physical channel each, this would +result in 1 entry in the breakout groups list. + """ + __slots__ = ('_path_helper', '_extmethods', '__group',) + + _yang_name = 'groups' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__group = YANGDynClass(base=YANGListType("index",group.group, yang_name="group", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'port', 'breakout-mode', 'groups'] + + def _get_group(self): + """ + Getter method for group, mapped from YANG variable /components/component/port/breakout_mode/groups/group (list) + + YANG Description: List of breakout groups. + """ + return self.__group + + def _set_group(self, v, load=False): + """ + Setter method for group, mapped from YANG variable /components/component/port/breakout_mode/groups/group (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_group is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_group() directly. + + YANG Description: List of breakout groups. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",group.group, yang_name="group", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """group must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",group.group, yang_name="group", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='list', is_config=True)""", + }) + + self.__group = t + if hasattr(self, '_set'): + self._set() + + def _unset_group(self): + self.__group = YANGDynClass(base=YANGListType("index",group.group, yang_name="group", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='list', is_config=True) + + group = __builtin__.property(_get_group, _set_group) + + + _pyangbind_elements = OrderedDict([('group', group), ]) + + +from . import group +class groups(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/port/breakout-mode/groups. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Top level container for breakout groups data. + +When a device has the capability to break a port into +interfaces of different speeds and different number of +physical channels, it can breakout a 400G OSFP port with +8 physical channels (with support for 25G NRZ, 50G PAM4 +and 100G PAM4) in the following configuration: + +100G + 100G + 200G -> 1 interface with 2 physical channels +and 1 interface with 4 physical channels and 1 interface with +2 physical channels. With this configuration the interface in +1st breakout group would use 50G PAM4 modulation, interface +in 2nd breakout group would use 25G NRZ modulation and the +interface in 3rd breakout group would use 100G PAM4 modulation +This configuration would result in 3 entries in the breakout +groups list. + +When a device does not have the capability to break a port +into interfaces of different speeds and different number of +physical channels, it would breakout a 400G OSFP port with +8 physical channels in the following configuration: + +50G -> 8 interfaces with 1 physical channel each, this would +result in 1 entry in the breakout groups list. + """ + __slots__ = ('_path_helper', '_extmethods', '__group',) + + _yang_name = 'groups' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__group = YANGDynClass(base=YANGListType("index",group.group, yang_name="group", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'port', 'breakout-mode', 'groups'] + + def _get_group(self): + """ + Getter method for group, mapped from YANG variable /components/component/port/breakout_mode/groups/group (list) + + YANG Description: List of breakout groups. + """ + return self.__group + + def _set_group(self, v, load=False): + """ + Setter method for group, mapped from YANG variable /components/component/port/breakout_mode/groups/group (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_group is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_group() directly. + + YANG Description: List of breakout groups. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",group.group, yang_name="group", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """group must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",group.group, yang_name="group", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='list', is_config=True)""", + }) + + self.__group = t + if hasattr(self, '_set'): + self._set() + + def _unset_group(self): + self.__group = YANGDynClass(base=YANGListType("index",group.group, yang_name="group", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="group", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='list', is_config=True) + + group = __builtin__.property(_get_group, _set_group) + + + _pyangbind_elements = OrderedDict([('group', group), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/port/breakout_mode/groups/group/__init__.py b/hackfest/netconf-oc/openconfig/components/component/port/breakout_mode/groups/group/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..82104e792886041d3ef76eebd8a47bd8a8e17bf5 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/port/breakout_mode/groups/group/__init__.py @@ -0,0 +1,376 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import config +from . import state +class group(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/port/breakout-mode/groups/group. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of breakout groups. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__config','__state',) + + _yang_name = 'group' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='leafref', is_config=True) + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'port', 'breakout-mode', 'groups', 'group'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /components/component/port/breakout_mode/groups/group/index (leafref) + + YANG Description: Index of the breakout group entry in the breakout groups list. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /components/component/port/breakout_mode/groups/group/index (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Index of the breakout group entry in the breakout groups list. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='leafref', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='leafref', is_config=True) + + + def _get_config(self): + """ + Getter method for config, mapped from YANG variable /components/component/port/breakout_mode/groups/group/config (container) + + YANG Description: Configuration data for breakout group. + """ + return self.__config + + def _set_config(self, v, load=False): + """ + Setter method for config, mapped from YANG variable /components/component/port/breakout_mode/groups/group/config (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_config is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_config() directly. + + YANG Description: Configuration data for breakout group. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """config must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True)""", + }) + + self.__config = t + if hasattr(self, '_set'): + self._set() + + def _unset_config(self): + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + + + def _get_state(self): + """ + Getter method for state, mapped from YANG variable /components/component/port/breakout_mode/groups/group/state (container) + + YANG Description: Operational state data for breakout group. + """ + return self.__state + + def _set_state(self, v, load=False): + """ + Setter method for state, mapped from YANG variable /components/component/port/breakout_mode/groups/group/state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_state() directly. + + YANG Description: Operational state data for breakout group. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True)""", + }) + + self.__state = t + if hasattr(self, '_set'): + self._set() + + def _unset_state(self): + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) + + + _pyangbind_elements = OrderedDict([('index', index), ('config', config), ('state', state), ]) + + +from . import config +from . import state +class group(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/port/breakout-mode/groups/group. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of breakout groups. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__config','__state',) + + _yang_name = 'group' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='leafref', is_config=True) + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'port', 'breakout-mode', 'groups', 'group'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /components/component/port/breakout_mode/groups/group/index (leafref) + + YANG Description: Index of the breakout group entry in the breakout groups list. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /components/component/port/breakout_mode/groups/group/index (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Index of the breakout group entry in the breakout groups list. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='leafref', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='leafref', is_config=True) + + + def _get_config(self): + """ + Getter method for config, mapped from YANG variable /components/component/port/breakout_mode/groups/group/config (container) + + YANG Description: Configuration data for breakout group. + """ + return self.__config + + def _set_config(self, v, load=False): + """ + Setter method for config, mapped from YANG variable /components/component/port/breakout_mode/groups/group/config (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_config is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_config() directly. + + YANG Description: Configuration data for breakout group. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """config must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True)""", + }) + + self.__config = t + if hasattr(self, '_set'): + self._set() + + def _unset_config(self): + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + + + def _get_state(self): + """ + Getter method for state, mapped from YANG variable /components/component/port/breakout_mode/groups/group/state (container) + + YANG Description: Operational state data for breakout group. + """ + return self.__state + + def _set_state(self, v, load=False): + """ + Setter method for state, mapped from YANG variable /components/component/port/breakout_mode/groups/group/state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_state() directly. + + YANG Description: Operational state data for breakout group. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True)""", + }) + + self.__state = t + if hasattr(self, '_set'): + self._set() + + def _unset_state(self): + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='container', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) + + + _pyangbind_elements = OrderedDict([('index', index), ('config', config), ('state', state), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/port/breakout_mode/groups/group/config/__init__.py b/hackfest/netconf-oc/openconfig/components/component/port/breakout_mode/groups/group/config/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5a989534cd1f8272ee971533e2e4cc97e3b4fffc --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/port/breakout_mode/groups/group/config/__init__.py @@ -0,0 +1,464 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class config(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/port/breakout-mode/groups/group/config. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Configuration data for breakout group. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__num_breakouts','__breakout_speed','__num_physical_channels',) + + _yang_name = 'config' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True) + self.__num_breakouts = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-breakouts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True) + self.__breakout_speed = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="breakout-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='identityref', is_config=True) + self.__num_physical_channels = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-physical-channels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'port', 'breakout-mode', 'groups', 'group', 'config'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /components/component/port/breakout_mode/groups/group/config/index (uint8) + + YANG Description: Each index specifies breakouts that are identical in +terms of speed and the number of physical channels. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /components/component/port/breakout_mode/groups/group/config/index (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Each index specifies breakouts that are identical in +terms of speed and the number of physical channels. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True) + + + def _get_num_breakouts(self): + """ + Getter method for num_breakouts, mapped from YANG variable /components/component/port/breakout_mode/groups/group/config/num_breakouts (uint8) + + YANG Description: Sets the number of interfaces using this breakout group. + """ + return self.__num_breakouts + + def _set_num_breakouts(self, v, load=False): + """ + Setter method for num_breakouts, mapped from YANG variable /components/component/port/breakout_mode/groups/group/config/num_breakouts (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_num_breakouts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_num_breakouts() directly. + + YANG Description: Sets the number of interfaces using this breakout group. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-breakouts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """num_breakouts must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-breakouts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True)""", + }) + + self.__num_breakouts = t + if hasattr(self, '_set'): + self._set() + + def _unset_num_breakouts(self): + self.__num_breakouts = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-breakouts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True) + + + def _get_breakout_speed(self): + """ + Getter method for breakout_speed, mapped from YANG variable /components/component/port/breakout_mode/groups/group/config/breakout_speed (identityref) + + YANG Description: Speed of interfaces in this breakout group, supported +values are defined by the ETHERNET_SPEED identity. + """ + return self.__breakout_speed + + def _set_breakout_speed(self, v, load=False): + """ + Setter method for breakout_speed, mapped from YANG variable /components/component/port/breakout_mode/groups/group/config/breakout_speed (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_breakout_speed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_breakout_speed() directly. + + YANG Description: Speed of interfaces in this breakout group, supported +values are defined by the ETHERNET_SPEED identity. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="breakout-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """breakout_speed must be of a type compatible with identityref""", + 'defined-type': "openconfig-platform-port:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="breakout-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='identityref', is_config=True)""", + }) + + self.__breakout_speed = t + if hasattr(self, '_set'): + self._set() + + def _unset_breakout_speed(self): + self.__breakout_speed = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="breakout-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='identityref', is_config=True) + + + def _get_num_physical_channels(self): + """ + Getter method for num_physical_channels, mapped from YANG variable /components/component/port/breakout_mode/groups/group/config/num_physical_channels (uint8) + + YANG Description: Sets the number of lanes or physical channels assigned +to the interfaces in this breakout group. This leaf need +not be set if there is only one breakout group where all +the interfaces are of equal speed and have equal number +of physical channels + """ + return self.__num_physical_channels + + def _set_num_physical_channels(self, v, load=False): + """ + Setter method for num_physical_channels, mapped from YANG variable /components/component/port/breakout_mode/groups/group/config/num_physical_channels (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_num_physical_channels is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_num_physical_channels() directly. + + YANG Description: Sets the number of lanes or physical channels assigned +to the interfaces in this breakout group. This leaf need +not be set if there is only one breakout group where all +the interfaces are of equal speed and have equal number +of physical channels + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-physical-channels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """num_physical_channels must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-physical-channels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True)""", + }) + + self.__num_physical_channels = t + if hasattr(self, '_set'): + self._set() + + def _unset_num_physical_channels(self): + self.__num_physical_channels = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-physical-channels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + num_breakouts = __builtin__.property(_get_num_breakouts, _set_num_breakouts) + breakout_speed = __builtin__.property(_get_breakout_speed, _set_breakout_speed) + num_physical_channels = __builtin__.property(_get_num_physical_channels, _set_num_physical_channels) + + + _pyangbind_elements = OrderedDict([('index', index), ('num_breakouts', num_breakouts), ('breakout_speed', breakout_speed), ('num_physical_channels', num_physical_channels), ]) + + +class config(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/port/breakout-mode/groups/group/config. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Configuration data for breakout group. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__num_breakouts','__breakout_speed','__num_physical_channels',) + + _yang_name = 'config' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True) + self.__num_breakouts = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-breakouts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True) + self.__breakout_speed = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="breakout-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='identityref', is_config=True) + self.__num_physical_channels = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-physical-channels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'port', 'breakout-mode', 'groups', 'group', 'config'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /components/component/port/breakout_mode/groups/group/config/index (uint8) + + YANG Description: Each index specifies breakouts that are identical in +terms of speed and the number of physical channels. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /components/component/port/breakout_mode/groups/group/config/index (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Each index specifies breakouts that are identical in +terms of speed and the number of physical channels. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True) + + + def _get_num_breakouts(self): + """ + Getter method for num_breakouts, mapped from YANG variable /components/component/port/breakout_mode/groups/group/config/num_breakouts (uint8) + + YANG Description: Sets the number of interfaces using this breakout group. + """ + return self.__num_breakouts + + def _set_num_breakouts(self, v, load=False): + """ + Setter method for num_breakouts, mapped from YANG variable /components/component/port/breakout_mode/groups/group/config/num_breakouts (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_num_breakouts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_num_breakouts() directly. + + YANG Description: Sets the number of interfaces using this breakout group. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-breakouts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """num_breakouts must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-breakouts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True)""", + }) + + self.__num_breakouts = t + if hasattr(self, '_set'): + self._set() + + def _unset_num_breakouts(self): + self.__num_breakouts = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-breakouts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True) + + + def _get_breakout_speed(self): + """ + Getter method for breakout_speed, mapped from YANG variable /components/component/port/breakout_mode/groups/group/config/breakout_speed (identityref) + + YANG Description: Speed of interfaces in this breakout group, supported +values are defined by the ETHERNET_SPEED identity. + """ + return self.__breakout_speed + + def _set_breakout_speed(self, v, load=False): + """ + Setter method for breakout_speed, mapped from YANG variable /components/component/port/breakout_mode/groups/group/config/breakout_speed (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_breakout_speed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_breakout_speed() directly. + + YANG Description: Speed of interfaces in this breakout group, supported +values are defined by the ETHERNET_SPEED identity. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="breakout-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """breakout_speed must be of a type compatible with identityref""", + 'defined-type': "openconfig-platform-port:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="breakout-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='identityref', is_config=True)""", + }) + + self.__breakout_speed = t + if hasattr(self, '_set'): + self._set() + + def _unset_breakout_speed(self): + self.__breakout_speed = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="breakout-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='identityref', is_config=True) + + + def _get_num_physical_channels(self): + """ + Getter method for num_physical_channels, mapped from YANG variable /components/component/port/breakout_mode/groups/group/config/num_physical_channels (uint8) + + YANG Description: Sets the number of lanes or physical channels assigned +to the interfaces in this breakout group. This leaf need +not be set if there is only one breakout group where all +the interfaces are of equal speed and have equal number +of physical channels + """ + return self.__num_physical_channels + + def _set_num_physical_channels(self, v, load=False): + """ + Setter method for num_physical_channels, mapped from YANG variable /components/component/port/breakout_mode/groups/group/config/num_physical_channels (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_num_physical_channels is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_num_physical_channels() directly. + + YANG Description: Sets the number of lanes or physical channels assigned +to the interfaces in this breakout group. This leaf need +not be set if there is only one breakout group where all +the interfaces are of equal speed and have equal number +of physical channels + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-physical-channels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """num_physical_channels must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-physical-channels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True)""", + }) + + self.__num_physical_channels = t + if hasattr(self, '_set'): + self._set() + + def _unset_num_physical_channels(self): + self.__num_physical_channels = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-physical-channels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + num_breakouts = __builtin__.property(_get_num_breakouts, _set_num_breakouts) + breakout_speed = __builtin__.property(_get_breakout_speed, _set_breakout_speed) + num_physical_channels = __builtin__.property(_get_num_physical_channels, _set_num_physical_channels) + + + _pyangbind_elements = OrderedDict([('index', index), ('num_breakouts', num_breakouts), ('breakout_speed', breakout_speed), ('num_physical_channels', num_physical_channels), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/port/breakout_mode/groups/group/state/__init__.py b/hackfest/netconf-oc/openconfig/components/component/port/breakout_mode/groups/group/state/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..71c63f44b61ef5b032652a2d43928d96c83a3a29 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/port/breakout_mode/groups/group/state/__init__.py @@ -0,0 +1,464 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/port/breakout-mode/groups/group/state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Operational state data for breakout group. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__num_breakouts','__breakout_speed','__num_physical_channels',) + + _yang_name = 'state' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False) + self.__num_breakouts = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-breakouts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False) + self.__breakout_speed = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="breakout-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='identityref', is_config=False) + self.__num_physical_channels = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-physical-channels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'port', 'breakout-mode', 'groups', 'group', 'state'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /components/component/port/breakout_mode/groups/group/state/index (uint8) + + YANG Description: Each index specifies breakouts that are identical in +terms of speed and the number of physical channels. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /components/component/port/breakout_mode/groups/group/state/index (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Each index specifies breakouts that are identical in +terms of speed and the number of physical channels. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False) + + + def _get_num_breakouts(self): + """ + Getter method for num_breakouts, mapped from YANG variable /components/component/port/breakout_mode/groups/group/state/num_breakouts (uint8) + + YANG Description: Sets the number of interfaces using this breakout group. + """ + return self.__num_breakouts + + def _set_num_breakouts(self, v, load=False): + """ + Setter method for num_breakouts, mapped from YANG variable /components/component/port/breakout_mode/groups/group/state/num_breakouts (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_num_breakouts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_num_breakouts() directly. + + YANG Description: Sets the number of interfaces using this breakout group. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-breakouts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """num_breakouts must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-breakouts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False)""", + }) + + self.__num_breakouts = t + if hasattr(self, '_set'): + self._set() + + def _unset_num_breakouts(self): + self.__num_breakouts = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-breakouts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False) + + + def _get_breakout_speed(self): + """ + Getter method for breakout_speed, mapped from YANG variable /components/component/port/breakout_mode/groups/group/state/breakout_speed (identityref) + + YANG Description: Speed of interfaces in this breakout group, supported +values are defined by the ETHERNET_SPEED identity. + """ + return self.__breakout_speed + + def _set_breakout_speed(self, v, load=False): + """ + Setter method for breakout_speed, mapped from YANG variable /components/component/port/breakout_mode/groups/group/state/breakout_speed (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_breakout_speed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_breakout_speed() directly. + + YANG Description: Speed of interfaces in this breakout group, supported +values are defined by the ETHERNET_SPEED identity. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="breakout-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """breakout_speed must be of a type compatible with identityref""", + 'defined-type': "openconfig-platform-port:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="breakout-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='identityref', is_config=False)""", + }) + + self.__breakout_speed = t + if hasattr(self, '_set'): + self._set() + + def _unset_breakout_speed(self): + self.__breakout_speed = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="breakout-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='identityref', is_config=False) + + + def _get_num_physical_channels(self): + """ + Getter method for num_physical_channels, mapped from YANG variable /components/component/port/breakout_mode/groups/group/state/num_physical_channels (uint8) + + YANG Description: Sets the number of lanes or physical channels assigned +to the interfaces in this breakout group. This leaf need +not be set if there is only one breakout group where all +the interfaces are of equal speed and have equal number +of physical channels + """ + return self.__num_physical_channels + + def _set_num_physical_channels(self, v, load=False): + """ + Setter method for num_physical_channels, mapped from YANG variable /components/component/port/breakout_mode/groups/group/state/num_physical_channels (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_num_physical_channels is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_num_physical_channels() directly. + + YANG Description: Sets the number of lanes or physical channels assigned +to the interfaces in this breakout group. This leaf need +not be set if there is only one breakout group where all +the interfaces are of equal speed and have equal number +of physical channels + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-physical-channels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """num_physical_channels must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-physical-channels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False)""", + }) + + self.__num_physical_channels = t + if hasattr(self, '_set'): + self._set() + + def _unset_num_physical_channels(self): + self.__num_physical_channels = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-physical-channels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False) + + index = __builtin__.property(_get_index) + num_breakouts = __builtin__.property(_get_num_breakouts) + breakout_speed = __builtin__.property(_get_breakout_speed) + num_physical_channels = __builtin__.property(_get_num_physical_channels) + + + _pyangbind_elements = OrderedDict([('index', index), ('num_breakouts', num_breakouts), ('breakout_speed', breakout_speed), ('num_physical_channels', num_physical_channels), ]) + + +class state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/port/breakout-mode/groups/group/state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Operational state data for breakout group. + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__num_breakouts','__breakout_speed','__num_physical_channels',) + + _yang_name = 'state' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False) + self.__num_breakouts = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-breakouts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False) + self.__breakout_speed = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="breakout-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='identityref', is_config=False) + self.__num_physical_channels = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-physical-channels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'port', 'breakout-mode', 'groups', 'group', 'state'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /components/component/port/breakout_mode/groups/group/state/index (uint8) + + YANG Description: Each index specifies breakouts that are identical in +terms of speed and the number of physical channels. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /components/component/port/breakout_mode/groups/group/state/index (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: Each index specifies breakouts that are identical in +terms of speed and the number of physical channels. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False) + + + def _get_num_breakouts(self): + """ + Getter method for num_breakouts, mapped from YANG variable /components/component/port/breakout_mode/groups/group/state/num_breakouts (uint8) + + YANG Description: Sets the number of interfaces using this breakout group. + """ + return self.__num_breakouts + + def _set_num_breakouts(self, v, load=False): + """ + Setter method for num_breakouts, mapped from YANG variable /components/component/port/breakout_mode/groups/group/state/num_breakouts (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_num_breakouts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_num_breakouts() directly. + + YANG Description: Sets the number of interfaces using this breakout group. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-breakouts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """num_breakouts must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-breakouts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False)""", + }) + + self.__num_breakouts = t + if hasattr(self, '_set'): + self._set() + + def _unset_num_breakouts(self): + self.__num_breakouts = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-breakouts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False) + + + def _get_breakout_speed(self): + """ + Getter method for breakout_speed, mapped from YANG variable /components/component/port/breakout_mode/groups/group/state/breakout_speed (identityref) + + YANG Description: Speed of interfaces in this breakout group, supported +values are defined by the ETHERNET_SPEED identity. + """ + return self.__breakout_speed + + def _set_breakout_speed(self, v, load=False): + """ + Setter method for breakout_speed, mapped from YANG variable /components/component/port/breakout_mode/groups/group/state/breakout_speed (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_breakout_speed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_breakout_speed() directly. + + YANG Description: Speed of interfaces in this breakout group, supported +values are defined by the ETHERNET_SPEED identity. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="breakout-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """breakout_speed must be of a type compatible with identityref""", + 'defined-type': "openconfig-platform-port:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="breakout-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='identityref', is_config=False)""", + }) + + self.__breakout_speed = t + if hasattr(self, '_set'): + self._set() + + def _unset_breakout_speed(self): + self.__breakout_speed = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="breakout-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='identityref', is_config=False) + + + def _get_num_physical_channels(self): + """ + Getter method for num_physical_channels, mapped from YANG variable /components/component/port/breakout_mode/groups/group/state/num_physical_channels (uint8) + + YANG Description: Sets the number of lanes or physical channels assigned +to the interfaces in this breakout group. This leaf need +not be set if there is only one breakout group where all +the interfaces are of equal speed and have equal number +of physical channels + """ + return self.__num_physical_channels + + def _set_num_physical_channels(self, v, load=False): + """ + Setter method for num_physical_channels, mapped from YANG variable /components/component/port/breakout_mode/groups/group/state/num_physical_channels (uint8) + If this variable is read-only (config: false) in the + source YANG file, then _set_num_physical_channels is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_num_physical_channels() directly. + + YANG Description: Sets the number of lanes or physical channels assigned +to the interfaces in this breakout group. This leaf need +not be set if there is only one breakout group where all +the interfaces are of equal speed and have equal number +of physical channels + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-physical-channels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """num_physical_channels must be of a type compatible with uint8""", + 'defined-type': "uint8", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-physical-channels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False)""", + }) + + self.__num_physical_channels = t + if hasattr(self, '_set'): + self._set() + + def _unset_num_physical_channels(self): + self.__num_physical_channels = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), is_leaf=True, yang_name="num-physical-channels", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='uint8', is_config=False) + + index = __builtin__.property(_get_index) + num_breakouts = __builtin__.property(_get_num_breakouts) + breakout_speed = __builtin__.property(_get_breakout_speed) + num_physical_channels = __builtin__.property(_get_num_physical_channels) + + + _pyangbind_elements = OrderedDict([('index', index), ('num_breakouts', num_breakouts), ('breakout_speed', breakout_speed), ('num_physical_channels', num_physical_channels), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/power_supply/__init__.py b/hackfest/netconf-oc/openconfig/components/component/power_supply/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..08a05b98f2d93e26ac391b1cd2c91bcec671348a --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/power_supply/__init__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class power_supply(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/power-supply. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Data for power supply components + """ + _pyangbind_elements = {} + + + +class power_supply(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/power-supply. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Data for power supply components + """ + _pyangbind_elements = {} + + + diff --git a/hackfest/netconf-oc/openconfig/components/component/properties/__init__.py b/hackfest/netconf-oc/openconfig/components/component/properties/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4605df88f39390969e0932a0afac4f43ecd8ba9b --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/properties/__init__.py @@ -0,0 +1,208 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import property_ +class properties(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/properties. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Enclosing container + """ + __slots__ = ('_path_helper', '_extmethods', '__property_',) + + _yang_name = 'properties' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__property_ = YANGDynClass(base=YANGListType("name",property_.property_, yang_name="property", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="property", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'properties'] + + def _get_property_(self): + """ + Getter method for property_, mapped from YANG variable /components/component/properties/property (list) + + YANG Description: List of system properties for the component + """ + return self.__property_ + + def _set_property_(self, v, load=False): + """ + Setter method for property_, mapped from YANG variable /components/component/properties/property (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_property_ is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_property_() directly. + + YANG Description: List of system properties for the component + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",property_.property_, yang_name="property", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="property", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """property_ must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",property_.property_, yang_name="property", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="property", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True)""", + }) + + self.__property_ = t + if hasattr(self, '_set'): + self._set() + + def _unset_property_(self): + self.__property_ = YANGDynClass(base=YANGListType("name",property_.property_, yang_name="property", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="property", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + + property_ = __builtin__.property(_get_property_, _set_property_) + + + _pyangbind_elements = OrderedDict([('property_', property_), ]) + + +from . import property_ +class properties(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/properties. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Enclosing container + """ + __slots__ = ('_path_helper', '_extmethods', '__property_',) + + _yang_name = 'properties' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__property_ = YANGDynClass(base=YANGListType("name",property_.property_, yang_name="property", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="property", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'properties'] + + def _get_property_(self): + """ + Getter method for property_, mapped from YANG variable /components/component/properties/property (list) + + YANG Description: List of system properties for the component + """ + return self.__property_ + + def _set_property_(self, v, load=False): + """ + Setter method for property_, mapped from YANG variable /components/component/properties/property (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_property_ is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_property_() directly. + + YANG Description: List of system properties for the component + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",property_.property_, yang_name="property", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="property", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """property_ must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",property_.property_, yang_name="property", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="property", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True)""", + }) + + self.__property_ = t + if hasattr(self, '_set'): + self._set() + + def _unset_property_(self): + self.__property_ = YANGDynClass(base=YANGListType("name",property_.property_, yang_name="property", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="property", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + + property_ = __builtin__.property(_get_property_, _set_property_) + + + _pyangbind_elements = OrderedDict([('property_', property_), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/properties/property_/__init__.py b/hackfest/netconf-oc/openconfig/components/component/properties/property_/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9e49ab5a26b56c05f1a8db30528d46bc66c17ed8 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/properties/property_/__init__.py @@ -0,0 +1,376 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import config +from . import state +class property_(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/properties/property. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of system properties for the component + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__config','__state',) + + _yang_name = 'property' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'properties', 'property'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/properties/property/name (leafref) + + YANG Description: Reference to the property name. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/properties/property/name (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Reference to the property name. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + + + def _get_config(self): + """ + Getter method for config, mapped from YANG variable /components/component/properties/property/config (container) + + YANG Description: Configuration data for each property + """ + return self.__config + + def _set_config(self, v, load=False): + """ + Setter method for config, mapped from YANG variable /components/component/properties/property/config (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_config is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_config() directly. + + YANG Description: Configuration data for each property + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """config must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__config = t + if hasattr(self, '_set'): + self._set() + + def _unset_config(self): + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_state(self): + """ + Getter method for state, mapped from YANG variable /components/component/properties/property/state (container) + + YANG Description: Operational state data for each property + """ + return self.__state + + def _set_state(self, v, load=False): + """ + Setter method for state, mapped from YANG variable /components/component/properties/property/state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_state() directly. + + YANG Description: Operational state data for each property + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__state = t + if hasattr(self, '_set'): + self._set() + + def _unset_state(self): + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) + + + _pyangbind_elements = OrderedDict([('name', name), ('config', config), ('state', state), ]) + + +from . import config +from . import state +class property_(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/properties/property. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of system properties for the component + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__config','__state',) + + _yang_name = 'property' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'properties', 'property'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/properties/property/name (leafref) + + YANG Description: Reference to the property name. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/properties/property/name (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Reference to the property name. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + + + def _get_config(self): + """ + Getter method for config, mapped from YANG variable /components/component/properties/property/config (container) + + YANG Description: Configuration data for each property + """ + return self.__config + + def _set_config(self, v, load=False): + """ + Setter method for config, mapped from YANG variable /components/component/properties/property/config (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_config is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_config() directly. + + YANG Description: Configuration data for each property + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """config must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__config = t + if hasattr(self, '_set'): + self._set() + + def _unset_config(self): + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_state(self): + """ + Getter method for state, mapped from YANG variable /components/component/properties/property/state (container) + + YANG Description: Operational state data for each property + """ + return self.__state + + def _set_state(self, v, load=False): + """ + Setter method for state, mapped from YANG variable /components/component/properties/property/state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_state() directly. + + YANG Description: Operational state data for each property + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__state = t + if hasattr(self, '_set'): + self._set() + + def _unset_state(self): + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) + + + _pyangbind_elements = OrderedDict([('name', name), ('config', config), ('state', state), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/properties/property_/config/__init__.py b/hackfest/netconf-oc/openconfig/components/component/properties/property_/config/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6eaa7c03a7e44c436f5b85ad31cce5b1b57a6438 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/properties/property_/config/__init__.py @@ -0,0 +1,296 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class config(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/properties/property/config. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Configuration data for each property + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__value',) + + _yang_name = 'config' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + self.__value = YANGDynClass(base=[six.text_type,YANGBool,RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64),RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64),RestrictedPrecisionDecimalType(precision=2),], is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'properties', 'property', 'config'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/properties/property/config/name (string) + + YANG Description: System-supplied name of the property -- this is typically +non-configurable + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/properties/property/config/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: System-supplied name of the property -- this is typically +non-configurable + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /components/component/properties/property/config/value (union) + + YANG Description: Property values can take on a variety of types. Signed and +unsigned integer types may be provided in smaller sizes, +e.g., int8, uint16, etc. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /components/component/properties/property/config/value (union) + If this variable is read-only (config: false) in the + source YANG file, then _set_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_value() directly. + + YANG Description: Property values can take on a variety of types. Signed and +unsigned integer types may be provided in smaller sizes, +e.g., int8, uint16, etc. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[six.text_type,YANGBool,RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64),RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64),RestrictedPrecisionDecimalType(precision=2),], is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with union""", + 'defined-type': "openconfig-platform:union", + 'generated-type': """YANGDynClass(base=[six.text_type,YANGBool,RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64),RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64),RestrictedPrecisionDecimalType(precision=2),], is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=True)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[six.text_type,YANGBool,RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64),RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64),RestrictedPrecisionDecimalType(precision=2),], is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + value = __builtin__.property(_get_value, _set_value) + + + _pyangbind_elements = OrderedDict([('name', name), ('value', value), ]) + + +class config(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/properties/property/config. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Configuration data for each property + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__value',) + + _yang_name = 'config' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + self.__value = YANGDynClass(base=[six.text_type,YANGBool,RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64),RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64),RestrictedPrecisionDecimalType(precision=2),], is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'properties', 'property', 'config'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/properties/property/config/name (string) + + YANG Description: System-supplied name of the property -- this is typically +non-configurable + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/properties/property/config/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: System-supplied name of the property -- this is typically +non-configurable + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=True) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /components/component/properties/property/config/value (union) + + YANG Description: Property values can take on a variety of types. Signed and +unsigned integer types may be provided in smaller sizes, +e.g., int8, uint16, etc. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /components/component/properties/property/config/value (union) + If this variable is read-only (config: false) in the + source YANG file, then _set_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_value() directly. + + YANG Description: Property values can take on a variety of types. Signed and +unsigned integer types may be provided in smaller sizes, +e.g., int8, uint16, etc. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[six.text_type,YANGBool,RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64),RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64),RestrictedPrecisionDecimalType(precision=2),], is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with union""", + 'defined-type': "openconfig-platform:union", + 'generated-type': """YANGDynClass(base=[six.text_type,YANGBool,RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64),RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64),RestrictedPrecisionDecimalType(precision=2),], is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=True)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[six.text_type,YANGBool,RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64),RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64),RestrictedPrecisionDecimalType(precision=2),], is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + value = __builtin__.property(_get_value, _set_value) + + + _pyangbind_elements = OrderedDict([('name', name), ('value', value), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/properties/property_/state/__init__.py b/hackfest/netconf-oc/openconfig/components/component/properties/property_/state/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4d50a0520390ca70e3bffbe75bc4290912c88e2a --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/properties/property_/state/__init__.py @@ -0,0 +1,374 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/properties/property/state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Operational state data for each property + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__value','__configurable',) + + _yang_name = 'state' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__value = YANGDynClass(base=[six.text_type,YANGBool,RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64),RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64),RestrictedPrecisionDecimalType(precision=2),], is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=False) + self.__configurable = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="configurable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'properties', 'property', 'state'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/properties/property/state/name (string) + + YANG Description: System-supplied name of the property -- this is typically +non-configurable + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/properties/property/state/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: System-supplied name of the property -- this is typically +non-configurable + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /components/component/properties/property/state/value (union) + + YANG Description: Property values can take on a variety of types. Signed and +unsigned integer types may be provided in smaller sizes, +e.g., int8, uint16, etc. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /components/component/properties/property/state/value (union) + If this variable is read-only (config: false) in the + source YANG file, then _set_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_value() directly. + + YANG Description: Property values can take on a variety of types. Signed and +unsigned integer types may be provided in smaller sizes, +e.g., int8, uint16, etc. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[six.text_type,YANGBool,RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64),RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64),RestrictedPrecisionDecimalType(precision=2),], is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with union""", + 'defined-type': "openconfig-platform:union", + 'generated-type': """YANGDynClass(base=[six.text_type,YANGBool,RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64),RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64),RestrictedPrecisionDecimalType(precision=2),], is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=False)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[six.text_type,YANGBool,RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64),RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64),RestrictedPrecisionDecimalType(precision=2),], is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=False) + + + def _get_configurable(self): + """ + Getter method for configurable, mapped from YANG variable /components/component/properties/property/state/configurable (boolean) + + YANG Description: Indication whether the property is user-configurable + """ + return self.__configurable + + def _set_configurable(self, v, load=False): + """ + Setter method for configurable, mapped from YANG variable /components/component/properties/property/state/configurable (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_configurable is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_configurable() directly. + + YANG Description: Indication whether the property is user-configurable + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="configurable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """configurable must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="configurable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False)""", + }) + + self.__configurable = t + if hasattr(self, '_set'): + self._set() + + def _unset_configurable(self): + self.__configurable = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="configurable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + + name = __builtin__.property(_get_name) + value = __builtin__.property(_get_value) + configurable = __builtin__.property(_get_configurable) + + + _pyangbind_elements = OrderedDict([('name', name), ('value', value), ('configurable', configurable), ]) + + +class state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/properties/property/state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Operational state data for each property + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__value','__configurable',) + + _yang_name = 'state' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__value = YANGDynClass(base=[six.text_type,YANGBool,RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64),RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64),RestrictedPrecisionDecimalType(precision=2),], is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=False) + self.__configurable = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="configurable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'properties', 'property', 'state'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/properties/property/state/name (string) + + YANG Description: System-supplied name of the property -- this is typically +non-configurable + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/properties/property/state/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: System-supplied name of the property -- this is typically +non-configurable + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_value(self): + """ + Getter method for value, mapped from YANG variable /components/component/properties/property/state/value (union) + + YANG Description: Property values can take on a variety of types. Signed and +unsigned integer types may be provided in smaller sizes, +e.g., int8, uint16, etc. + """ + return self.__value + + def _set_value(self, v, load=False): + """ + Setter method for value, mapped from YANG variable /components/component/properties/property/state/value (union) + If this variable is read-only (config: false) in the + source YANG file, then _set_value is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_value() directly. + + YANG Description: Property values can take on a variety of types. Signed and +unsigned integer types may be provided in smaller sizes, +e.g., int8, uint16, etc. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[six.text_type,YANGBool,RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64),RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64),RestrictedPrecisionDecimalType(precision=2),], is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """value must be of a type compatible with union""", + 'defined-type': "openconfig-platform:union", + 'generated-type': """YANGDynClass(base=[six.text_type,YANGBool,RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64),RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64),RestrictedPrecisionDecimalType(precision=2),], is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=False)""", + }) + + self.__value = t + if hasattr(self, '_set'): + self._set() + + def _unset_value(self): + self.__value = YANGDynClass(base=[six.text_type,YANGBool,RestrictedClassType(base_type=long, restriction_dict={'range': ['-9223372036854775808..9223372036854775807']}, int_size=64),RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64),RestrictedPrecisionDecimalType(precision=2),], is_leaf=True, yang_name="value", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=False) + + + def _get_configurable(self): + """ + Getter method for configurable, mapped from YANG variable /components/component/properties/property/state/configurable (boolean) + + YANG Description: Indication whether the property is user-configurable + """ + return self.__configurable + + def _set_configurable(self, v, load=False): + """ + Setter method for configurable, mapped from YANG variable /components/component/properties/property/state/configurable (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_configurable is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_configurable() directly. + + YANG Description: Indication whether the property is user-configurable + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="configurable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """configurable must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="configurable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False)""", + }) + + self.__configurable = t + if hasattr(self, '_set'): + self._set() + + def _unset_configurable(self): + self.__configurable = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="configurable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + + name = __builtin__.property(_get_name) + value = __builtin__.property(_get_value) + configurable = __builtin__.property(_get_configurable) + + + _pyangbind_elements = OrderedDict([('name', name), ('value', value), ('configurable', configurable), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/software_module/__init__.py b/hackfest/netconf-oc/openconfig/components/component/software_module/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3fa4f2989b255366b0cfe148f1a31ec6906ec0af --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/software_module/__init__.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class software_module(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/software-module. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Data for software module components, i.e., for components +with type=SOFTWARE_MODULE + """ + _pyangbind_elements = {} + + + +class software_module(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/software-module. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Data for software module components, i.e., for components +with type=SOFTWARE_MODULE + """ + _pyangbind_elements = {} + + + diff --git a/hackfest/netconf-oc/openconfig/components/component/state/__init__.py b/hackfest/netconf-oc/openconfig/components/component/state/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..462352e048ab1174f602de5bc9ff24445cdc3da9 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/state/__init__.py @@ -0,0 +1,2528 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import last_switchover_reason +from . import temperature +from . import memory +from . import pcie +class state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Operational state data for each component + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__type','__id','__location','__description','__mfg_name','__mfg_date','__hardware_version','__firmware_version','__software_version','__serial_no','__part_no','__clei_code','__removable','__oper_status','__empty','__parent','__redundant_role','__last_switchover_reason','__last_switchover_time','__last_reboot_reason','__last_reboot_time','__switchover_ready','__temperature','__memory','__allocated_power','__used_power','__pcie',) + + _yang_name = 'state' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__type = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CHASSIS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CHASSIS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BACKPLANE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BACKPLANE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FABRIC': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FABRIC': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'POWER_SUPPLY': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:POWER_SUPPLY': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FAN': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FAN': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'SENSOR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:SENSOR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FRU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FRU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'LINECARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:LINECARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'CONTROLLER_CARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CONTROLLER_CARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'PORT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:PORT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'TRANSCEIVER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:TRANSCEIVER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'CPU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CPU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'STORAGE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:STORAGE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'INTEGRATED_CIRCUIT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:INTEGRATED_CIRCUIT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'OPERATING_SYSTEM': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:OPERATING_SYSTEM': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'OPERATING_SYSTEM_UPDATE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:OPERATING_SYSTEM_UPDATE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BIOS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BIOS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BOOT_LOADER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BOOT_LOADER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'SOFTWARE_MODULE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:SOFTWARE_MODULE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},),], is_leaf=True, yang_name="type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=False) + self.__id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__location = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="location", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__description = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__mfg_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="mfg-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__mfg_date = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9]{4}\\-(0[1-9]|1[0-2])\\-(0[1-9]|[12][0-9]|3[01])'}), is_leaf=True, yang_name="mfg-date", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:date', is_config=False) + self.__hardware_version = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="hardware-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__firmware_version = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="firmware-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__software_version = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="software-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__serial_no = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="serial-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__part_no = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="part-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__clei_code = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="clei-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__removable = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="removable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + self.__oper_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:ACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'INACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:INACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False) + self.__empty = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="empty", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + self.__parent = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="parent", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=False) + self.__redundant_role = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'PRIMARY': {}, 'SECONDARY': {}},), is_leaf=True, yang_name="redundant-role", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-platform-types:component-redundant-role', is_config=False) + self.__last_switchover_reason = YANGDynClass(base=last_switchover_reason.last_switchover_reason, is_container='container', yang_name="last-switchover-reason", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + self.__last_switchover_time = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-switchover-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + self.__last_reboot_reason = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'REBOOT_USER_INITIATED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_USER_INITIATED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'REBOOT_POWER_FAILURE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_POWER_FAILURE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'REBOOT_CRITICAL_ERROR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_CRITICAL_ERROR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="last-reboot-reason", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False) + self.__last_reboot_time = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-reboot-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + self.__switchover_ready = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="switchover-ready", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + self.__temperature = YANGDynClass(base=temperature.temperature, is_container='container', yang_name="temperature", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + self.__memory = YANGDynClass(base=memory.memory, is_container='container', yang_name="memory", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + self.__allocated_power = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="allocated-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False) + self.__used_power = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="used-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False) + self.__pcie = YANGDynClass(base=pcie.pcie, is_container='container', yang_name="pcie", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'state'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/state/name (string) + + YANG Description: Device name for the component -- this may not be a +configurable parameter on many implementations. Where +component preconfiguration is supported, for example, +the component name may be configurable. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/state/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Device name for the component -- this may not be a +configurable parameter on many implementations. Where +component preconfiguration is supported, for example, +the component name may be configurable. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_type(self): + """ + Getter method for type, mapped from YANG variable /components/component/state/type (union) + + YANG Description: Type of component as identified by the system + """ + return self.__type + + def _set_type(self, v, load=False): + """ + Setter method for type, mapped from YANG variable /components/component/state/type (union) + If this variable is read-only (config: false) in the + source YANG file, then _set_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_type() directly. + + YANG Description: Type of component as identified by the system + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CHASSIS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CHASSIS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BACKPLANE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BACKPLANE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FABRIC': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FABRIC': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'POWER_SUPPLY': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:POWER_SUPPLY': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FAN': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FAN': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'SENSOR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:SENSOR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FRU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FRU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'LINECARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:LINECARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'CONTROLLER_CARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CONTROLLER_CARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'PORT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:PORT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'TRANSCEIVER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:TRANSCEIVER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'CPU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CPU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'STORAGE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:STORAGE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'INTEGRATED_CIRCUIT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:INTEGRATED_CIRCUIT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'OPERATING_SYSTEM': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:OPERATING_SYSTEM': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'OPERATING_SYSTEM_UPDATE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:OPERATING_SYSTEM_UPDATE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BIOS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BIOS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BOOT_LOADER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BOOT_LOADER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'SOFTWARE_MODULE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:SOFTWARE_MODULE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},),], is_leaf=True, yang_name="type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """type must be of a type compatible with union""", + 'defined-type': "openconfig-platform:union", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CHASSIS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CHASSIS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BACKPLANE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BACKPLANE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FABRIC': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FABRIC': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'POWER_SUPPLY': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:POWER_SUPPLY': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FAN': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FAN': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'SENSOR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:SENSOR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FRU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FRU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'LINECARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:LINECARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'CONTROLLER_CARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CONTROLLER_CARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'PORT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:PORT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'TRANSCEIVER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:TRANSCEIVER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'CPU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CPU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'STORAGE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:STORAGE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'INTEGRATED_CIRCUIT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:INTEGRATED_CIRCUIT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'OPERATING_SYSTEM': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:OPERATING_SYSTEM': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'OPERATING_SYSTEM_UPDATE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:OPERATING_SYSTEM_UPDATE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BIOS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BIOS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BOOT_LOADER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BOOT_LOADER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'SOFTWARE_MODULE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:SOFTWARE_MODULE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},),], is_leaf=True, yang_name="type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=False)""", + }) + + self.__type = t + if hasattr(self, '_set'): + self._set() + + def _unset_type(self): + self.__type = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CHASSIS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CHASSIS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BACKPLANE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BACKPLANE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FABRIC': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FABRIC': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'POWER_SUPPLY': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:POWER_SUPPLY': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FAN': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FAN': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'SENSOR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:SENSOR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FRU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FRU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'LINECARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:LINECARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'CONTROLLER_CARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CONTROLLER_CARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'PORT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:PORT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'TRANSCEIVER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:TRANSCEIVER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'CPU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CPU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'STORAGE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:STORAGE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'INTEGRATED_CIRCUIT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:INTEGRATED_CIRCUIT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'OPERATING_SYSTEM': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:OPERATING_SYSTEM': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'OPERATING_SYSTEM_UPDATE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:OPERATING_SYSTEM_UPDATE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BIOS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BIOS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BOOT_LOADER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BOOT_LOADER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'SOFTWARE_MODULE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:SOFTWARE_MODULE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},),], is_leaf=True, yang_name="type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=False) + + + def _get_id(self): + """ + Getter method for id, mapped from YANG variable /components/component/state/id (string) + + YANG Description: Unique identifier assigned by the system for the +component + """ + return self.__id + + def _set_id(self, v, load=False): + """ + Setter method for id, mapped from YANG variable /components/component/state/id (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_id() directly. + + YANG Description: Unique identifier assigned by the system for the +component + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """id must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__id = t + if hasattr(self, '_set'): + self._set() + + def _unset_id(self): + self.__id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_location(self): + """ + Getter method for location, mapped from YANG variable /components/component/state/location (string) + + YANG Description: System-supplied description of the location of the +component within the system. This could be a bay position, +slot number, socket location, etc. For component types that +have an explicit slot-id attribute, such as linecards, the +system should populate the more specific slot-id. + """ + return self.__location + + def _set_location(self, v, load=False): + """ + Setter method for location, mapped from YANG variable /components/component/state/location (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_location is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_location() directly. + + YANG Description: System-supplied description of the location of the +component within the system. This could be a bay position, +slot number, socket location, etc. For component types that +have an explicit slot-id attribute, such as linecards, the +system should populate the more specific slot-id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="location", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """location must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="location", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__location = t + if hasattr(self, '_set'): + self._set() + + def _unset_location(self): + self.__location = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="location", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_description(self): + """ + Getter method for description, mapped from YANG variable /components/component/state/description (string) + + YANG Description: System-supplied description of the component + """ + return self.__description + + def _set_description(self, v, load=False): + """ + Setter method for description, mapped from YANG variable /components/component/state/description (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_description is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_description() directly. + + YANG Description: System-supplied description of the component + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """description must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__description = t + if hasattr(self, '_set'): + self._set() + + def _unset_description(self): + self.__description = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_mfg_name(self): + """ + Getter method for mfg_name, mapped from YANG variable /components/component/state/mfg_name (string) + + YANG Description: System-supplied identifier for the manufacturer of the +component. This data is particularly useful when a +component manufacturer is different than the overall +device vendor. + """ + return self.__mfg_name + + def _set_mfg_name(self, v, load=False): + """ + Setter method for mfg_name, mapped from YANG variable /components/component/state/mfg_name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_mfg_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_mfg_name() directly. + + YANG Description: System-supplied identifier for the manufacturer of the +component. This data is particularly useful when a +component manufacturer is different than the overall +device vendor. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="mfg-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """mfg_name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="mfg-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__mfg_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_mfg_name(self): + self.__mfg_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="mfg-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_mfg_date(self): + """ + Getter method for mfg_date, mapped from YANG variable /components/component/state/mfg_date (oc-yang:date) + + YANG Description: System-supplied representation of the component's +manufacturing date. + """ + return self.__mfg_date + + def _set_mfg_date(self, v, load=False): + """ + Setter method for mfg_date, mapped from YANG variable /components/component/state/mfg_date (oc-yang:date) + If this variable is read-only (config: false) in the + source YANG file, then _set_mfg_date is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_mfg_date() directly. + + YANG Description: System-supplied representation of the component's +manufacturing date. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9]{4}\\-(0[1-9]|1[0-2])\\-(0[1-9]|[12][0-9]|3[01])'}), is_leaf=True, yang_name="mfg-date", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:date', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """mfg_date must be of a type compatible with oc-yang:date""", + 'defined-type': "oc-yang:date", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9]{4}\\-(0[1-9]|1[0-2])\\-(0[1-9]|[12][0-9]|3[01])'}), is_leaf=True, yang_name="mfg-date", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:date', is_config=False)""", + }) + + self.__mfg_date = t + if hasattr(self, '_set'): + self._set() + + def _unset_mfg_date(self): + self.__mfg_date = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9]{4}\\-(0[1-9]|1[0-2])\\-(0[1-9]|[12][0-9]|3[01])'}), is_leaf=True, yang_name="mfg-date", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:date', is_config=False) + + + def _get_hardware_version(self): + """ + Getter method for hardware_version, mapped from YANG variable /components/component/state/hardware_version (string) + + YANG Description: For hardware components, this is the hardware revision of +the component. + """ + return self.__hardware_version + + def _set_hardware_version(self, v, load=False): + """ + Setter method for hardware_version, mapped from YANG variable /components/component/state/hardware_version (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_hardware_version is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hardware_version() directly. + + YANG Description: For hardware components, this is the hardware revision of +the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="hardware-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hardware_version must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="hardware-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__hardware_version = t + if hasattr(self, '_set'): + self._set() + + def _unset_hardware_version(self): + self.__hardware_version = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="hardware-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_firmware_version(self): + """ + Getter method for firmware_version, mapped from YANG variable /components/component/state/firmware_version (string) + + YANG Description: For hardware components, this is the version of associated +firmware that is running on the component, if applicable. + """ + return self.__firmware_version + + def _set_firmware_version(self, v, load=False): + """ + Setter method for firmware_version, mapped from YANG variable /components/component/state/firmware_version (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_firmware_version is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_firmware_version() directly. + + YANG Description: For hardware components, this is the version of associated +firmware that is running on the component, if applicable. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="firmware-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """firmware_version must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="firmware-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__firmware_version = t + if hasattr(self, '_set'): + self._set() + + def _unset_firmware_version(self): + self.__firmware_version = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="firmware-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_software_version(self): + """ + Getter method for software_version, mapped from YANG variable /components/component/state/software_version (string) + + YANG Description: For software components such as operating system or other +software module, this is the version of the currently +running software. + """ + return self.__software_version + + def _set_software_version(self, v, load=False): + """ + Setter method for software_version, mapped from YANG variable /components/component/state/software_version (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_software_version is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_software_version() directly. + + YANG Description: For software components such as operating system or other +software module, this is the version of the currently +running software. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="software-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """software_version must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="software-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__software_version = t + if hasattr(self, '_set'): + self._set() + + def _unset_software_version(self): + self.__software_version = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="software-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_serial_no(self): + """ + Getter method for serial_no, mapped from YANG variable /components/component/state/serial_no (string) + + YANG Description: System-assigned serial number of the component. + """ + return self.__serial_no + + def _set_serial_no(self, v, load=False): + """ + Setter method for serial_no, mapped from YANG variable /components/component/state/serial_no (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_serial_no is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_serial_no() directly. + + YANG Description: System-assigned serial number of the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="serial-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """serial_no must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="serial-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__serial_no = t + if hasattr(self, '_set'): + self._set() + + def _unset_serial_no(self): + self.__serial_no = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="serial-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_part_no(self): + """ + Getter method for part_no, mapped from YANG variable /components/component/state/part_no (string) + + YANG Description: System-assigned part number for the component. This should +be present in particular if the component is also an FRU +(field replaceable unit) + """ + return self.__part_no + + def _set_part_no(self, v, load=False): + """ + Setter method for part_no, mapped from YANG variable /components/component/state/part_no (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_part_no is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_part_no() directly. + + YANG Description: System-assigned part number for the component. This should +be present in particular if the component is also an FRU +(field replaceable unit) + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="part-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """part_no must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="part-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__part_no = t + if hasattr(self, '_set'): + self._set() + + def _unset_part_no(self): + self.__part_no = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="part-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_clei_code(self): + """ + Getter method for clei_code, mapped from YANG variable /components/component/state/clei_code (string) + + YANG Description: Common Language Equipment Identifier (CLEI) code of the +component. This should be present in particular if the +component is also an FRU (field replaceable unit) + """ + return self.__clei_code + + def _set_clei_code(self, v, load=False): + """ + Setter method for clei_code, mapped from YANG variable /components/component/state/clei_code (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_clei_code is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_clei_code() directly. + + YANG Description: Common Language Equipment Identifier (CLEI) code of the +component. This should be present in particular if the +component is also an FRU (field replaceable unit) + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="clei-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """clei_code must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="clei-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__clei_code = t + if hasattr(self, '_set'): + self._set() + + def _unset_clei_code(self): + self.__clei_code = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="clei-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_removable(self): + """ + Getter method for removable, mapped from YANG variable /components/component/state/removable (boolean) + + YANG Description: If true, this component is removable or is a field +replaceable unit + """ + return self.__removable + + def _set_removable(self, v, load=False): + """ + Setter method for removable, mapped from YANG variable /components/component/state/removable (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_removable is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_removable() directly. + + YANG Description: If true, this component is removable or is a field +replaceable unit + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="removable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """removable must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="removable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False)""", + }) + + self.__removable = t + if hasattr(self, '_set'): + self._set() + + def _unset_removable(self): + self.__removable = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="removable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + + + def _get_oper_status(self): + """ + Getter method for oper_status, mapped from YANG variable /components/component/state/oper_status (identityref) + + YANG Description: If applicable, this reports the current operational status +of the component. + """ + return self.__oper_status + + def _set_oper_status(self, v, load=False): + """ + Setter method for oper_status, mapped from YANG variable /components/component/state/oper_status (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_oper_status is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_oper_status() directly. + + YANG Description: If applicable, this reports the current operational status +of the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:ACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'INACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:INACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """oper_status must be of a type compatible with identityref""", + 'defined-type': "openconfig-platform:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:ACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'INACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:INACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False)""", + }) + + self.__oper_status = t + if hasattr(self, '_set'): + self._set() + + def _unset_oper_status(self): + self.__oper_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:ACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'INACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:INACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False) + + + def _get_empty(self): + """ + Getter method for empty, mapped from YANG variable /components/component/state/empty (boolean) + + YANG Description: The empty leaf may be used by the device to indicate that a +component position exists but is not populated. Using this +flag, it is possible for the management system to learn how +many positions are available (e.g., occupied vs. empty +linecard slots in a chassis). + """ + return self.__empty + + def _set_empty(self, v, load=False): + """ + Setter method for empty, mapped from YANG variable /components/component/state/empty (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_empty is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_empty() directly. + + YANG Description: The empty leaf may be used by the device to indicate that a +component position exists but is not populated. Using this +flag, it is possible for the management system to learn how +many positions are available (e.g., occupied vs. empty +linecard slots in a chassis). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="empty", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """empty must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="empty", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False)""", + }) + + self.__empty = t + if hasattr(self, '_set'): + self._set() + + def _unset_empty(self): + self.__empty = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="empty", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + + + def _get_parent(self): + """ + Getter method for parent, mapped from YANG variable /components/component/state/parent (leafref) + + YANG Description: Reference to the name of the parent component. Note that +this reference must be kept synchronized with the +corresponding subcomponent reference from the parent +component. + """ + return self.__parent + + def _set_parent(self, v, load=False): + """ + Setter method for parent, mapped from YANG variable /components/component/state/parent (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_parent is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_parent() directly. + + YANG Description: Reference to the name of the parent component. Note that +this reference must be kept synchronized with the +corresponding subcomponent reference from the parent +component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="parent", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """parent must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="parent", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=False)""", + }) + + self.__parent = t + if hasattr(self, '_set'): + self._set() + + def _unset_parent(self): + self.__parent = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="parent", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=False) + + + def _get_redundant_role(self): + """ + Getter method for redundant_role, mapped from YANG variable /components/component/state/redundant_role (oc-platform-types:component-redundant-role) + + YANG Description: For components that have redundant roles (e.g. two +supervisors in a device, one as primary the other as secondary), +this reports the role of the component. + """ + return self.__redundant_role + + def _set_redundant_role(self, v, load=False): + """ + Setter method for redundant_role, mapped from YANG variable /components/component/state/redundant_role (oc-platform-types:component-redundant-role) + If this variable is read-only (config: false) in the + source YANG file, then _set_redundant_role is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_redundant_role() directly. + + YANG Description: For components that have redundant roles (e.g. two +supervisors in a device, one as primary the other as secondary), +this reports the role of the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'PRIMARY': {}, 'SECONDARY': {}},), is_leaf=True, yang_name="redundant-role", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-platform-types:component-redundant-role', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """redundant_role must be of a type compatible with oc-platform-types:component-redundant-role""", + 'defined-type': "oc-platform-types:component-redundant-role", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'PRIMARY': {}, 'SECONDARY': {}},), is_leaf=True, yang_name="redundant-role", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-platform-types:component-redundant-role', is_config=False)""", + }) + + self.__redundant_role = t + if hasattr(self, '_set'): + self._set() + + def _unset_redundant_role(self): + self.__redundant_role = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'PRIMARY': {}, 'SECONDARY': {}},), is_leaf=True, yang_name="redundant-role", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-platform-types:component-redundant-role', is_config=False) + + + def _get_last_switchover_reason(self): + """ + Getter method for last_switchover_reason, mapped from YANG variable /components/component/state/last_switchover_reason (container) + + YANG Description: For components that have redundant roles (e.g. two +supervisors in a device, one as primary the other as secondary), +this reports the reason of the last change of the +component's role. + """ + return self.__last_switchover_reason + + def _set_last_switchover_reason(self, v, load=False): + """ + Setter method for last_switchover_reason, mapped from YANG variable /components/component/state/last_switchover_reason (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_last_switchover_reason is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_last_switchover_reason() directly. + + YANG Description: For components that have redundant roles (e.g. two +supervisors in a device, one as primary the other as secondary), +this reports the reason of the last change of the +component's role. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=last_switchover_reason.last_switchover_reason, is_container='container', yang_name="last-switchover-reason", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """last_switchover_reason must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=last_switchover_reason.last_switchover_reason, is_container='container', yang_name="last-switchover-reason", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False)""", + }) + + self.__last_switchover_reason = t + if hasattr(self, '_set'): + self._set() + + def _unset_last_switchover_reason(self): + self.__last_switchover_reason = YANGDynClass(base=last_switchover_reason.last_switchover_reason, is_container='container', yang_name="last-switchover-reason", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + + + def _get_last_switchover_time(self): + """ + Getter method for last_switchover_time, mapped from YANG variable /components/component/state/last_switchover_time (oc-types:timeticks64) + + YANG Description: For components that have redundant roles (e.g. two +supervisors in a device, one as primary the other as +secondary), this reports the time of the last change of +the component's role. The value is the timestamp in +nanoseconds relative to the Unix Epoch (Jan 1, 1970 00:00:00 UTC). + """ + return self.__last_switchover_time + + def _set_last_switchover_time(self, v, load=False): + """ + Setter method for last_switchover_time, mapped from YANG variable /components/component/state/last_switchover_time (oc-types:timeticks64) + If this variable is read-only (config: false) in the + source YANG file, then _set_last_switchover_time is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_last_switchover_time() directly. + + YANG Description: For components that have redundant roles (e.g. two +supervisors in a device, one as primary the other as +secondary), this reports the time of the last change of +the component's role. The value is the timestamp in +nanoseconds relative to the Unix Epoch (Jan 1, 1970 00:00:00 UTC). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-switchover-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """last_switchover_time must be of a type compatible with oc-types:timeticks64""", + 'defined-type': "oc-types:timeticks64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-switchover-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False)""", + }) + + self.__last_switchover_time = t + if hasattr(self, '_set'): + self._set() + + def _unset_last_switchover_time(self): + self.__last_switchover_time = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-switchover-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + + + def _get_last_reboot_reason(self): + """ + Getter method for last_reboot_reason, mapped from YANG variable /components/component/state/last_reboot_reason (identityref) + + YANG Description: This reports the reason of the last reboot of the component. + """ + return self.__last_reboot_reason + + def _set_last_reboot_reason(self, v, load=False): + """ + Setter method for last_reboot_reason, mapped from YANG variable /components/component/state/last_reboot_reason (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_last_reboot_reason is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_last_reboot_reason() directly. + + YANG Description: This reports the reason of the last reboot of the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'REBOOT_USER_INITIATED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_USER_INITIATED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'REBOOT_POWER_FAILURE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_POWER_FAILURE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'REBOOT_CRITICAL_ERROR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_CRITICAL_ERROR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="last-reboot-reason", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """last_reboot_reason must be of a type compatible with identityref""", + 'defined-type': "openconfig-platform:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'REBOOT_USER_INITIATED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_USER_INITIATED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'REBOOT_POWER_FAILURE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_POWER_FAILURE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'REBOOT_CRITICAL_ERROR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_CRITICAL_ERROR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="last-reboot-reason", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False)""", + }) + + self.__last_reboot_reason = t + if hasattr(self, '_set'): + self._set() + + def _unset_last_reboot_reason(self): + self.__last_reboot_reason = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'REBOOT_USER_INITIATED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_USER_INITIATED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'REBOOT_POWER_FAILURE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_POWER_FAILURE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'REBOOT_CRITICAL_ERROR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_CRITICAL_ERROR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="last-reboot-reason", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False) + + + def _get_last_reboot_time(self): + """ + Getter method for last_reboot_time, mapped from YANG variable /components/component/state/last_reboot_time (oc-types:timeticks64) + + YANG Description: This reports the time of the last reboot of the component. The +value is the timestamp in nanoseconds relative to the Unix Epoch +(Jan 1, 1970 00:00:00 UTC). + """ + return self.__last_reboot_time + + def _set_last_reboot_time(self, v, load=False): + """ + Setter method for last_reboot_time, mapped from YANG variable /components/component/state/last_reboot_time (oc-types:timeticks64) + If this variable is read-only (config: false) in the + source YANG file, then _set_last_reboot_time is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_last_reboot_time() directly. + + YANG Description: This reports the time of the last reboot of the component. The +value is the timestamp in nanoseconds relative to the Unix Epoch +(Jan 1, 1970 00:00:00 UTC). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-reboot-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """last_reboot_time must be of a type compatible with oc-types:timeticks64""", + 'defined-type': "oc-types:timeticks64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-reboot-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False)""", + }) + + self.__last_reboot_time = t + if hasattr(self, '_set'): + self._set() + + def _unset_last_reboot_time(self): + self.__last_reboot_time = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-reboot-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + + + def _get_switchover_ready(self): + """ + Getter method for switchover_ready, mapped from YANG variable /components/component/state/switchover_ready (boolean) + + YANG Description: For components that have redundant roles, this reports a value +that indicates if the component is ready to support failover. + +The components with a redundant-role should reflect the overall +system's switchover status. For example, two supervisors in a +device, one as primary and the other as secondary, should both +report the same value. + """ + return self.__switchover_ready + + def _set_switchover_ready(self, v, load=False): + """ + Setter method for switchover_ready, mapped from YANG variable /components/component/state/switchover_ready (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_switchover_ready is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_switchover_ready() directly. + + YANG Description: For components that have redundant roles, this reports a value +that indicates if the component is ready to support failover. + +The components with a redundant-role should reflect the overall +system's switchover status. For example, two supervisors in a +device, one as primary and the other as secondary, should both +report the same value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="switchover-ready", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """switchover_ready must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="switchover-ready", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False)""", + }) + + self.__switchover_ready = t + if hasattr(self, '_set'): + self._set() + + def _unset_switchover_ready(self): + self.__switchover_ready = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="switchover-ready", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + + + def _get_temperature(self): + """ + Getter method for temperature, mapped from YANG variable /components/component/state/temperature (container) + + YANG Description: Temperature in degrees Celsius of the component. Values include +the instantaneous, average, minimum, and maximum statistics. If +avg/min/max statistics are not supported, the target is expected +to just supply the instant value + """ + return self.__temperature + + def _set_temperature(self, v, load=False): + """ + Setter method for temperature, mapped from YANG variable /components/component/state/temperature (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_temperature is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_temperature() directly. + + YANG Description: Temperature in degrees Celsius of the component. Values include +the instantaneous, average, minimum, and maximum statistics. If +avg/min/max statistics are not supported, the target is expected +to just supply the instant value + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=temperature.temperature, is_container='container', yang_name="temperature", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """temperature must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=temperature.temperature, is_container='container', yang_name="temperature", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False)""", + }) + + self.__temperature = t + if hasattr(self, '_set'): + self._set() + + def _unset_temperature(self): + self.__temperature = YANGDynClass(base=temperature.temperature, is_container='container', yang_name="temperature", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + + + def _get_memory(self): + """ + Getter method for memory, mapped from YANG variable /components/component/state/memory (container) + + YANG Description: For components that have associated memory, these values +report information about available and utilized memory. + """ + return self.__memory + + def _set_memory(self, v, load=False): + """ + Setter method for memory, mapped from YANG variable /components/component/state/memory (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_memory is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_memory() directly. + + YANG Description: For components that have associated memory, these values +report information about available and utilized memory. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=memory.memory, is_container='container', yang_name="memory", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """memory must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=memory.memory, is_container='container', yang_name="memory", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False)""", + }) + + self.__memory = t + if hasattr(self, '_set'): + self._set() + + def _unset_memory(self): + self.__memory = YANGDynClass(base=memory.memory, is_container='container', yang_name="memory", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + + + def _get_allocated_power(self): + """ + Getter method for allocated_power, mapped from YANG variable /components/component/state/allocated_power (uint32) + + YANG Description: Power allocated by the system for the component. + """ + return self.__allocated_power + + def _set_allocated_power(self, v, load=False): + """ + Setter method for allocated_power, mapped from YANG variable /components/component/state/allocated_power (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_allocated_power is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_allocated_power() directly. + + YANG Description: Power allocated by the system for the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="allocated-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """allocated_power must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="allocated-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False)""", + }) + + self.__allocated_power = t + if hasattr(self, '_set'): + self._set() + + def _unset_allocated_power(self): + self.__allocated_power = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="allocated-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False) + + + def _get_used_power(self): + """ + Getter method for used_power, mapped from YANG variable /components/component/state/used_power (uint32) + + YANG Description: Actual power used by the component. + """ + return self.__used_power + + def _set_used_power(self, v, load=False): + """ + Setter method for used_power, mapped from YANG variable /components/component/state/used_power (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_used_power is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_used_power() directly. + + YANG Description: Actual power used by the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="used-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """used_power must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="used-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False)""", + }) + + self.__used_power = t + if hasattr(self, '_set'): + self._set() + + def _unset_used_power(self): + self.__used_power = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="used-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False) + + + def _get_pcie(self): + """ + Getter method for pcie, mapped from YANG variable /components/component/state/pcie (container) + + YANG Description: Components that are connected to the system over the Peripheral +Component Interconnect Express (PCIe), report the fatal, non-fatal +and correctable PCIe error counts. + """ + return self.__pcie + + def _set_pcie(self, v, load=False): + """ + Setter method for pcie, mapped from YANG variable /components/component/state/pcie (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_pcie is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_pcie() directly. + + YANG Description: Components that are connected to the system over the Peripheral +Component Interconnect Express (PCIe), report the fatal, non-fatal +and correctable PCIe error counts. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=pcie.pcie, is_container='container', yang_name="pcie", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """pcie must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=pcie.pcie, is_container='container', yang_name="pcie", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False)""", + }) + + self.__pcie = t + if hasattr(self, '_set'): + self._set() + + def _unset_pcie(self): + self.__pcie = YANGDynClass(base=pcie.pcie, is_container='container', yang_name="pcie", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + + name = __builtin__.property(_get_name) + type = __builtin__.property(_get_type) + id = __builtin__.property(_get_id) + location = __builtin__.property(_get_location) + description = __builtin__.property(_get_description) + mfg_name = __builtin__.property(_get_mfg_name) + mfg_date = __builtin__.property(_get_mfg_date) + hardware_version = __builtin__.property(_get_hardware_version) + firmware_version = __builtin__.property(_get_firmware_version) + software_version = __builtin__.property(_get_software_version) + serial_no = __builtin__.property(_get_serial_no) + part_no = __builtin__.property(_get_part_no) + clei_code = __builtin__.property(_get_clei_code) + removable = __builtin__.property(_get_removable) + oper_status = __builtin__.property(_get_oper_status) + empty = __builtin__.property(_get_empty) + parent = __builtin__.property(_get_parent) + redundant_role = __builtin__.property(_get_redundant_role) + last_switchover_reason = __builtin__.property(_get_last_switchover_reason) + last_switchover_time = __builtin__.property(_get_last_switchover_time) + last_reboot_reason = __builtin__.property(_get_last_reboot_reason) + last_reboot_time = __builtin__.property(_get_last_reboot_time) + switchover_ready = __builtin__.property(_get_switchover_ready) + temperature = __builtin__.property(_get_temperature) + memory = __builtin__.property(_get_memory) + allocated_power = __builtin__.property(_get_allocated_power) + used_power = __builtin__.property(_get_used_power) + pcie = __builtin__.property(_get_pcie) + + + _pyangbind_elements = OrderedDict([('name', name), ('type', type), ('id', id), ('location', location), ('description', description), ('mfg_name', mfg_name), ('mfg_date', mfg_date), ('hardware_version', hardware_version), ('firmware_version', firmware_version), ('software_version', software_version), ('serial_no', serial_no), ('part_no', part_no), ('clei_code', clei_code), ('removable', removable), ('oper_status', oper_status), ('empty', empty), ('parent', parent), ('redundant_role', redundant_role), ('last_switchover_reason', last_switchover_reason), ('last_switchover_time', last_switchover_time), ('last_reboot_reason', last_reboot_reason), ('last_reboot_time', last_reboot_time), ('switchover_ready', switchover_ready), ('temperature', temperature), ('memory', memory), ('allocated_power', allocated_power), ('used_power', used_power), ('pcie', pcie), ]) + + +from . import last_switchover_reason +from . import temperature +from . import memory +from . import pcie +class state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Operational state data for each component + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__type','__id','__location','__description','__mfg_name','__mfg_date','__hardware_version','__firmware_version','__software_version','__serial_no','__part_no','__clei_code','__removable','__oper_status','__empty','__parent','__redundant_role','__last_switchover_reason','__last_switchover_time','__last_reboot_reason','__last_reboot_time','__switchover_ready','__temperature','__memory','__allocated_power','__used_power','__pcie',) + + _yang_name = 'state' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__type = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CHASSIS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CHASSIS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BACKPLANE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BACKPLANE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FABRIC': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FABRIC': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'POWER_SUPPLY': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:POWER_SUPPLY': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FAN': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FAN': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'SENSOR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:SENSOR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FRU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FRU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'LINECARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:LINECARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'CONTROLLER_CARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CONTROLLER_CARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'PORT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:PORT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'TRANSCEIVER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:TRANSCEIVER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'CPU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CPU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'STORAGE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:STORAGE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'INTEGRATED_CIRCUIT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:INTEGRATED_CIRCUIT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'OPERATING_SYSTEM': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:OPERATING_SYSTEM': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'OPERATING_SYSTEM_UPDATE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:OPERATING_SYSTEM_UPDATE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BIOS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BIOS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BOOT_LOADER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BOOT_LOADER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'SOFTWARE_MODULE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:SOFTWARE_MODULE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},),], is_leaf=True, yang_name="type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=False) + self.__id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__location = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="location", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__description = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__mfg_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="mfg-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__mfg_date = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9]{4}\\-(0[1-9]|1[0-2])\\-(0[1-9]|[12][0-9]|3[01])'}), is_leaf=True, yang_name="mfg-date", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:date', is_config=False) + self.__hardware_version = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="hardware-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__firmware_version = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="firmware-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__software_version = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="software-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__serial_no = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="serial-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__part_no = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="part-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__clei_code = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="clei-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + self.__removable = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="removable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + self.__oper_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:ACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'INACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:INACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False) + self.__empty = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="empty", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + self.__parent = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="parent", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=False) + self.__redundant_role = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'PRIMARY': {}, 'SECONDARY': {}},), is_leaf=True, yang_name="redundant-role", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-platform-types:component-redundant-role', is_config=False) + self.__last_switchover_reason = YANGDynClass(base=last_switchover_reason.last_switchover_reason, is_container='container', yang_name="last-switchover-reason", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + self.__last_switchover_time = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-switchover-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + self.__last_reboot_reason = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'REBOOT_USER_INITIATED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_USER_INITIATED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'REBOOT_POWER_FAILURE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_POWER_FAILURE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'REBOOT_CRITICAL_ERROR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_CRITICAL_ERROR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="last-reboot-reason", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False) + self.__last_reboot_time = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-reboot-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + self.__switchover_ready = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="switchover-ready", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + self.__temperature = YANGDynClass(base=temperature.temperature, is_container='container', yang_name="temperature", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + self.__memory = YANGDynClass(base=memory.memory, is_container='container', yang_name="memory", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + self.__allocated_power = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="allocated-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False) + self.__used_power = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="used-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False) + self.__pcie = YANGDynClass(base=pcie.pcie, is_container='container', yang_name="pcie", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'state'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/state/name (string) + + YANG Description: Device name for the component -- this may not be a +configurable parameter on many implementations. Where +component preconfiguration is supported, for example, +the component name may be configurable. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/state/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Device name for the component -- this may not be a +configurable parameter on many implementations. Where +component preconfiguration is supported, for example, +the component name may be configurable. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_type(self): + """ + Getter method for type, mapped from YANG variable /components/component/state/type (union) + + YANG Description: Type of component as identified by the system + """ + return self.__type + + def _set_type(self, v, load=False): + """ + Setter method for type, mapped from YANG variable /components/component/state/type (union) + If this variable is read-only (config: false) in the + source YANG file, then _set_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_type() directly. + + YANG Description: Type of component as identified by the system + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CHASSIS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CHASSIS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BACKPLANE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BACKPLANE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FABRIC': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FABRIC': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'POWER_SUPPLY': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:POWER_SUPPLY': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FAN': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FAN': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'SENSOR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:SENSOR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FRU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FRU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'LINECARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:LINECARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'CONTROLLER_CARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CONTROLLER_CARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'PORT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:PORT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'TRANSCEIVER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:TRANSCEIVER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'CPU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CPU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'STORAGE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:STORAGE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'INTEGRATED_CIRCUIT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:INTEGRATED_CIRCUIT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'OPERATING_SYSTEM': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:OPERATING_SYSTEM': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'OPERATING_SYSTEM_UPDATE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:OPERATING_SYSTEM_UPDATE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BIOS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BIOS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BOOT_LOADER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BOOT_LOADER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'SOFTWARE_MODULE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:SOFTWARE_MODULE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},),], is_leaf=True, yang_name="type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """type must be of a type compatible with union""", + 'defined-type': "openconfig-platform:union", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CHASSIS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CHASSIS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BACKPLANE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BACKPLANE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FABRIC': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FABRIC': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'POWER_SUPPLY': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:POWER_SUPPLY': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FAN': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FAN': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'SENSOR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:SENSOR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FRU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FRU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'LINECARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:LINECARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'CONTROLLER_CARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CONTROLLER_CARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'PORT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:PORT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'TRANSCEIVER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:TRANSCEIVER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'CPU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CPU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'STORAGE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:STORAGE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'INTEGRATED_CIRCUIT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:INTEGRATED_CIRCUIT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'OPERATING_SYSTEM': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:OPERATING_SYSTEM': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'OPERATING_SYSTEM_UPDATE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:OPERATING_SYSTEM_UPDATE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BIOS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BIOS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BOOT_LOADER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BOOT_LOADER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'SOFTWARE_MODULE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:SOFTWARE_MODULE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},),], is_leaf=True, yang_name="type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=False)""", + }) + + self.__type = t + if hasattr(self, '_set'): + self._set() + + def _unset_type(self): + self.__type = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'CHASSIS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CHASSIS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BACKPLANE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BACKPLANE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FABRIC': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FABRIC': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'POWER_SUPPLY': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:POWER_SUPPLY': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FAN': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FAN': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'SENSOR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:SENSOR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'FRU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:FRU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'LINECARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:LINECARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'CONTROLLER_CARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CONTROLLER_CARD': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'PORT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:PORT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'TRANSCEIVER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:TRANSCEIVER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'CPU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:CPU': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'STORAGE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:STORAGE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'INTEGRATED_CIRCUIT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:INTEGRATED_CIRCUIT': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'OPERATING_SYSTEM': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:OPERATING_SYSTEM': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'OPERATING_SYSTEM_UPDATE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:OPERATING_SYSTEM_UPDATE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BIOS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BIOS': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'BOOT_LOADER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:BOOT_LOADER': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'SOFTWARE_MODULE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:SOFTWARE_MODULE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},),], is_leaf=True, yang_name="type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='union', is_config=False) + + + def _get_id(self): + """ + Getter method for id, mapped from YANG variable /components/component/state/id (string) + + YANG Description: Unique identifier assigned by the system for the +component + """ + return self.__id + + def _set_id(self, v, load=False): + """ + Setter method for id, mapped from YANG variable /components/component/state/id (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_id() directly. + + YANG Description: Unique identifier assigned by the system for the +component + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """id must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__id = t + if hasattr(self, '_set'): + self._set() + + def _unset_id(self): + self.__id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_location(self): + """ + Getter method for location, mapped from YANG variable /components/component/state/location (string) + + YANG Description: System-supplied description of the location of the +component within the system. This could be a bay position, +slot number, socket location, etc. For component types that +have an explicit slot-id attribute, such as linecards, the +system should populate the more specific slot-id. + """ + return self.__location + + def _set_location(self, v, load=False): + """ + Setter method for location, mapped from YANG variable /components/component/state/location (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_location is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_location() directly. + + YANG Description: System-supplied description of the location of the +component within the system. This could be a bay position, +slot number, socket location, etc. For component types that +have an explicit slot-id attribute, such as linecards, the +system should populate the more specific slot-id. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="location", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """location must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="location", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__location = t + if hasattr(self, '_set'): + self._set() + + def _unset_location(self): + self.__location = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="location", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_description(self): + """ + Getter method for description, mapped from YANG variable /components/component/state/description (string) + + YANG Description: System-supplied description of the component + """ + return self.__description + + def _set_description(self, v, load=False): + """ + Setter method for description, mapped from YANG variable /components/component/state/description (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_description is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_description() directly. + + YANG Description: System-supplied description of the component + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """description must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__description = t + if hasattr(self, '_set'): + self._set() + + def _unset_description(self): + self.__description = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_mfg_name(self): + """ + Getter method for mfg_name, mapped from YANG variable /components/component/state/mfg_name (string) + + YANG Description: System-supplied identifier for the manufacturer of the +component. This data is particularly useful when a +component manufacturer is different than the overall +device vendor. + """ + return self.__mfg_name + + def _set_mfg_name(self, v, load=False): + """ + Setter method for mfg_name, mapped from YANG variable /components/component/state/mfg_name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_mfg_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_mfg_name() directly. + + YANG Description: System-supplied identifier for the manufacturer of the +component. This data is particularly useful when a +component manufacturer is different than the overall +device vendor. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="mfg-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """mfg_name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="mfg-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__mfg_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_mfg_name(self): + self.__mfg_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="mfg-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_mfg_date(self): + """ + Getter method for mfg_date, mapped from YANG variable /components/component/state/mfg_date (oc-yang:date) + + YANG Description: System-supplied representation of the component's +manufacturing date. + """ + return self.__mfg_date + + def _set_mfg_date(self, v, load=False): + """ + Setter method for mfg_date, mapped from YANG variable /components/component/state/mfg_date (oc-yang:date) + If this variable is read-only (config: false) in the + source YANG file, then _set_mfg_date is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_mfg_date() directly. + + YANG Description: System-supplied representation of the component's +manufacturing date. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9]{4}\\-(0[1-9]|1[0-2])\\-(0[1-9]|[12][0-9]|3[01])'}), is_leaf=True, yang_name="mfg-date", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:date', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """mfg_date must be of a type compatible with oc-yang:date""", + 'defined-type': "oc-yang:date", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9]{4}\\-(0[1-9]|1[0-2])\\-(0[1-9]|[12][0-9]|3[01])'}), is_leaf=True, yang_name="mfg-date", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:date', is_config=False)""", + }) + + self.__mfg_date = t + if hasattr(self, '_set'): + self._set() + + def _unset_mfg_date(self): + self.__mfg_date = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9]{4}\\-(0[1-9]|1[0-2])\\-(0[1-9]|[12][0-9]|3[01])'}), is_leaf=True, yang_name="mfg-date", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:date', is_config=False) + + + def _get_hardware_version(self): + """ + Getter method for hardware_version, mapped from YANG variable /components/component/state/hardware_version (string) + + YANG Description: For hardware components, this is the hardware revision of +the component. + """ + return self.__hardware_version + + def _set_hardware_version(self, v, load=False): + """ + Setter method for hardware_version, mapped from YANG variable /components/component/state/hardware_version (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_hardware_version is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hardware_version() directly. + + YANG Description: For hardware components, this is the hardware revision of +the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="hardware-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hardware_version must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="hardware-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__hardware_version = t + if hasattr(self, '_set'): + self._set() + + def _unset_hardware_version(self): + self.__hardware_version = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="hardware-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_firmware_version(self): + """ + Getter method for firmware_version, mapped from YANG variable /components/component/state/firmware_version (string) + + YANG Description: For hardware components, this is the version of associated +firmware that is running on the component, if applicable. + """ + return self.__firmware_version + + def _set_firmware_version(self, v, load=False): + """ + Setter method for firmware_version, mapped from YANG variable /components/component/state/firmware_version (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_firmware_version is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_firmware_version() directly. + + YANG Description: For hardware components, this is the version of associated +firmware that is running on the component, if applicable. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="firmware-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """firmware_version must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="firmware-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__firmware_version = t + if hasattr(self, '_set'): + self._set() + + def _unset_firmware_version(self): + self.__firmware_version = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="firmware-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_software_version(self): + """ + Getter method for software_version, mapped from YANG variable /components/component/state/software_version (string) + + YANG Description: For software components such as operating system or other +software module, this is the version of the currently +running software. + """ + return self.__software_version + + def _set_software_version(self, v, load=False): + """ + Setter method for software_version, mapped from YANG variable /components/component/state/software_version (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_software_version is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_software_version() directly. + + YANG Description: For software components such as operating system or other +software module, this is the version of the currently +running software. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="software-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """software_version must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="software-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__software_version = t + if hasattr(self, '_set'): + self._set() + + def _unset_software_version(self): + self.__software_version = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="software-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_serial_no(self): + """ + Getter method for serial_no, mapped from YANG variable /components/component/state/serial_no (string) + + YANG Description: System-assigned serial number of the component. + """ + return self.__serial_no + + def _set_serial_no(self, v, load=False): + """ + Setter method for serial_no, mapped from YANG variable /components/component/state/serial_no (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_serial_no is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_serial_no() directly. + + YANG Description: System-assigned serial number of the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="serial-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """serial_no must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="serial-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__serial_no = t + if hasattr(self, '_set'): + self._set() + + def _unset_serial_no(self): + self.__serial_no = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="serial-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_part_no(self): + """ + Getter method for part_no, mapped from YANG variable /components/component/state/part_no (string) + + YANG Description: System-assigned part number for the component. This should +be present in particular if the component is also an FRU +(field replaceable unit) + """ + return self.__part_no + + def _set_part_no(self, v, load=False): + """ + Setter method for part_no, mapped from YANG variable /components/component/state/part_no (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_part_no is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_part_no() directly. + + YANG Description: System-assigned part number for the component. This should +be present in particular if the component is also an FRU +(field replaceable unit) + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="part-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """part_no must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="part-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__part_no = t + if hasattr(self, '_set'): + self._set() + + def _unset_part_no(self): + self.__part_no = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="part-no", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_clei_code(self): + """ + Getter method for clei_code, mapped from YANG variable /components/component/state/clei_code (string) + + YANG Description: Common Language Equipment Identifier (CLEI) code of the +component. This should be present in particular if the +component is also an FRU (field replaceable unit) + """ + return self.__clei_code + + def _set_clei_code(self, v, load=False): + """ + Setter method for clei_code, mapped from YANG variable /components/component/state/clei_code (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_clei_code is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_clei_code() directly. + + YANG Description: Common Language Equipment Identifier (CLEI) code of the +component. This should be present in particular if the +component is also an FRU (field replaceable unit) + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="clei-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """clei_code must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="clei-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__clei_code = t + if hasattr(self, '_set'): + self._set() + + def _unset_clei_code(self): + self.__clei_code = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="clei-code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + + def _get_removable(self): + """ + Getter method for removable, mapped from YANG variable /components/component/state/removable (boolean) + + YANG Description: If true, this component is removable or is a field +replaceable unit + """ + return self.__removable + + def _set_removable(self, v, load=False): + """ + Setter method for removable, mapped from YANG variable /components/component/state/removable (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_removable is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_removable() directly. + + YANG Description: If true, this component is removable or is a field +replaceable unit + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="removable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """removable must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="removable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False)""", + }) + + self.__removable = t + if hasattr(self, '_set'): + self._set() + + def _unset_removable(self): + self.__removable = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="removable", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + + + def _get_oper_status(self): + """ + Getter method for oper_status, mapped from YANG variable /components/component/state/oper_status (identityref) + + YANG Description: If applicable, this reports the current operational status +of the component. + """ + return self.__oper_status + + def _set_oper_status(self, v, load=False): + """ + Setter method for oper_status, mapped from YANG variable /components/component/state/oper_status (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_oper_status is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_oper_status() directly. + + YANG Description: If applicable, this reports the current operational status +of the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:ACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'INACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:INACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """oper_status must be of a type compatible with identityref""", + 'defined-type': "openconfig-platform:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:ACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'INACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:INACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False)""", + }) + + self.__oper_status = t + if hasattr(self, '_set'): + self._set() + + def _unset_oper_status(self): + self.__oper_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:ACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'INACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:INACTIVE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:DISABLED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False) + + + def _get_empty(self): + """ + Getter method for empty, mapped from YANG variable /components/component/state/empty (boolean) + + YANG Description: The empty leaf may be used by the device to indicate that a +component position exists but is not populated. Using this +flag, it is possible for the management system to learn how +many positions are available (e.g., occupied vs. empty +linecard slots in a chassis). + """ + return self.__empty + + def _set_empty(self, v, load=False): + """ + Setter method for empty, mapped from YANG variable /components/component/state/empty (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_empty is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_empty() directly. + + YANG Description: The empty leaf may be used by the device to indicate that a +component position exists but is not populated. Using this +flag, it is possible for the management system to learn how +many positions are available (e.g., occupied vs. empty +linecard slots in a chassis). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="empty", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """empty must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="empty", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False)""", + }) + + self.__empty = t + if hasattr(self, '_set'): + self._set() + + def _unset_empty(self): + self.__empty = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="empty", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + + + def _get_parent(self): + """ + Getter method for parent, mapped from YANG variable /components/component/state/parent (leafref) + + YANG Description: Reference to the name of the parent component. Note that +this reference must be kept synchronized with the +corresponding subcomponent reference from the parent +component. + """ + return self.__parent + + def _set_parent(self, v, load=False): + """ + Setter method for parent, mapped from YANG variable /components/component/state/parent (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_parent is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_parent() directly. + + YANG Description: Reference to the name of the parent component. Note that +this reference must be kept synchronized with the +corresponding subcomponent reference from the parent +component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="parent", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """parent must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="parent", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=False)""", + }) + + self.__parent = t + if hasattr(self, '_set'): + self._set() + + def _unset_parent(self): + self.__parent = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="parent", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=False) + + + def _get_redundant_role(self): + """ + Getter method for redundant_role, mapped from YANG variable /components/component/state/redundant_role (oc-platform-types:component-redundant-role) + + YANG Description: For components that have redundant roles (e.g. two +supervisors in a device, one as primary the other as secondary), +this reports the role of the component. + """ + return self.__redundant_role + + def _set_redundant_role(self, v, load=False): + """ + Setter method for redundant_role, mapped from YANG variable /components/component/state/redundant_role (oc-platform-types:component-redundant-role) + If this variable is read-only (config: false) in the + source YANG file, then _set_redundant_role is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_redundant_role() directly. + + YANG Description: For components that have redundant roles (e.g. two +supervisors in a device, one as primary the other as secondary), +this reports the role of the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'PRIMARY': {}, 'SECONDARY': {}},), is_leaf=True, yang_name="redundant-role", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-platform-types:component-redundant-role', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """redundant_role must be of a type compatible with oc-platform-types:component-redundant-role""", + 'defined-type': "oc-platform-types:component-redundant-role", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'PRIMARY': {}, 'SECONDARY': {}},), is_leaf=True, yang_name="redundant-role", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-platform-types:component-redundant-role', is_config=False)""", + }) + + self.__redundant_role = t + if hasattr(self, '_set'): + self._set() + + def _unset_redundant_role(self): + self.__redundant_role = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'PRIMARY': {}, 'SECONDARY': {}},), is_leaf=True, yang_name="redundant-role", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-platform-types:component-redundant-role', is_config=False) + + + def _get_last_switchover_reason(self): + """ + Getter method for last_switchover_reason, mapped from YANG variable /components/component/state/last_switchover_reason (container) + + YANG Description: For components that have redundant roles (e.g. two +supervisors in a device, one as primary the other as secondary), +this reports the reason of the last change of the +component's role. + """ + return self.__last_switchover_reason + + def _set_last_switchover_reason(self, v, load=False): + """ + Setter method for last_switchover_reason, mapped from YANG variable /components/component/state/last_switchover_reason (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_last_switchover_reason is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_last_switchover_reason() directly. + + YANG Description: For components that have redundant roles (e.g. two +supervisors in a device, one as primary the other as secondary), +this reports the reason of the last change of the +component's role. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=last_switchover_reason.last_switchover_reason, is_container='container', yang_name="last-switchover-reason", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """last_switchover_reason must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=last_switchover_reason.last_switchover_reason, is_container='container', yang_name="last-switchover-reason", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False)""", + }) + + self.__last_switchover_reason = t + if hasattr(self, '_set'): + self._set() + + def _unset_last_switchover_reason(self): + self.__last_switchover_reason = YANGDynClass(base=last_switchover_reason.last_switchover_reason, is_container='container', yang_name="last-switchover-reason", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + + + def _get_last_switchover_time(self): + """ + Getter method for last_switchover_time, mapped from YANG variable /components/component/state/last_switchover_time (oc-types:timeticks64) + + YANG Description: For components that have redundant roles (e.g. two +supervisors in a device, one as primary the other as +secondary), this reports the time of the last change of +the component's role. The value is the timestamp in +nanoseconds relative to the Unix Epoch (Jan 1, 1970 00:00:00 UTC). + """ + return self.__last_switchover_time + + def _set_last_switchover_time(self, v, load=False): + """ + Setter method for last_switchover_time, mapped from YANG variable /components/component/state/last_switchover_time (oc-types:timeticks64) + If this variable is read-only (config: false) in the + source YANG file, then _set_last_switchover_time is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_last_switchover_time() directly. + + YANG Description: For components that have redundant roles (e.g. two +supervisors in a device, one as primary the other as +secondary), this reports the time of the last change of +the component's role. The value is the timestamp in +nanoseconds relative to the Unix Epoch (Jan 1, 1970 00:00:00 UTC). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-switchover-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """last_switchover_time must be of a type compatible with oc-types:timeticks64""", + 'defined-type': "oc-types:timeticks64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-switchover-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False)""", + }) + + self.__last_switchover_time = t + if hasattr(self, '_set'): + self._set() + + def _unset_last_switchover_time(self): + self.__last_switchover_time = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-switchover-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + + + def _get_last_reboot_reason(self): + """ + Getter method for last_reboot_reason, mapped from YANG variable /components/component/state/last_reboot_reason (identityref) + + YANG Description: This reports the reason of the last reboot of the component. + """ + return self.__last_reboot_reason + + def _set_last_reboot_reason(self, v, load=False): + """ + Setter method for last_reboot_reason, mapped from YANG variable /components/component/state/last_reboot_reason (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_last_reboot_reason is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_last_reboot_reason() directly. + + YANG Description: This reports the reason of the last reboot of the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'REBOOT_USER_INITIATED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_USER_INITIATED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'REBOOT_POWER_FAILURE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_POWER_FAILURE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'REBOOT_CRITICAL_ERROR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_CRITICAL_ERROR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="last-reboot-reason", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """last_reboot_reason must be of a type compatible with identityref""", + 'defined-type': "openconfig-platform:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'REBOOT_USER_INITIATED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_USER_INITIATED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'REBOOT_POWER_FAILURE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_POWER_FAILURE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'REBOOT_CRITICAL_ERROR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_CRITICAL_ERROR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="last-reboot-reason", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False)""", + }) + + self.__last_reboot_reason = t + if hasattr(self, '_set'): + self._set() + + def _unset_last_reboot_reason(self): + self.__last_reboot_reason = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'REBOOT_USER_INITIATED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_USER_INITIATED': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'REBOOT_POWER_FAILURE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_POWER_FAILURE': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'REBOOT_CRITICAL_ERROR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}, 'oc-platform-types:REBOOT_CRITICAL_ERROR': {'@module': 'openconfig-platform-types', '@namespace': 'http://openconfig.net/yang/platform-types'}},), is_leaf=True, yang_name="last-reboot-reason", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False) + + + def _get_last_reboot_time(self): + """ + Getter method for last_reboot_time, mapped from YANG variable /components/component/state/last_reboot_time (oc-types:timeticks64) + + YANG Description: This reports the time of the last reboot of the component. The +value is the timestamp in nanoseconds relative to the Unix Epoch +(Jan 1, 1970 00:00:00 UTC). + """ + return self.__last_reboot_time + + def _set_last_reboot_time(self, v, load=False): + """ + Setter method for last_reboot_time, mapped from YANG variable /components/component/state/last_reboot_time (oc-types:timeticks64) + If this variable is read-only (config: false) in the + source YANG file, then _set_last_reboot_time is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_last_reboot_time() directly. + + YANG Description: This reports the time of the last reboot of the component. The +value is the timestamp in nanoseconds relative to the Unix Epoch +(Jan 1, 1970 00:00:00 UTC). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-reboot-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """last_reboot_time must be of a type compatible with oc-types:timeticks64""", + 'defined-type': "oc-types:timeticks64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-reboot-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False)""", + }) + + self.__last_reboot_time = t + if hasattr(self, '_set'): + self._set() + + def _unset_last_reboot_time(self): + self.__last_reboot_time = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-reboot-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + + + def _get_switchover_ready(self): + """ + Getter method for switchover_ready, mapped from YANG variable /components/component/state/switchover_ready (boolean) + + YANG Description: For components that have redundant roles, this reports a value +that indicates if the component is ready to support failover. + +The components with a redundant-role should reflect the overall +system's switchover status. For example, two supervisors in a +device, one as primary and the other as secondary, should both +report the same value. + """ + return self.__switchover_ready + + def _set_switchover_ready(self, v, load=False): + """ + Setter method for switchover_ready, mapped from YANG variable /components/component/state/switchover_ready (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_switchover_ready is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_switchover_ready() directly. + + YANG Description: For components that have redundant roles, this reports a value +that indicates if the component is ready to support failover. + +The components with a redundant-role should reflect the overall +system's switchover status. For example, two supervisors in a +device, one as primary and the other as secondary, should both +report the same value. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="switchover-ready", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """switchover_ready must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="switchover-ready", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False)""", + }) + + self.__switchover_ready = t + if hasattr(self, '_set'): + self._set() + + def _unset_switchover_ready(self): + self.__switchover_ready = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="switchover-ready", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + + + def _get_temperature(self): + """ + Getter method for temperature, mapped from YANG variable /components/component/state/temperature (container) + + YANG Description: Temperature in degrees Celsius of the component. Values include +the instantaneous, average, minimum, and maximum statistics. If +avg/min/max statistics are not supported, the target is expected +to just supply the instant value + """ + return self.__temperature + + def _set_temperature(self, v, load=False): + """ + Setter method for temperature, mapped from YANG variable /components/component/state/temperature (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_temperature is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_temperature() directly. + + YANG Description: Temperature in degrees Celsius of the component. Values include +the instantaneous, average, minimum, and maximum statistics. If +avg/min/max statistics are not supported, the target is expected +to just supply the instant value + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=temperature.temperature, is_container='container', yang_name="temperature", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """temperature must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=temperature.temperature, is_container='container', yang_name="temperature", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False)""", + }) + + self.__temperature = t + if hasattr(self, '_set'): + self._set() + + def _unset_temperature(self): + self.__temperature = YANGDynClass(base=temperature.temperature, is_container='container', yang_name="temperature", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + + + def _get_memory(self): + """ + Getter method for memory, mapped from YANG variable /components/component/state/memory (container) + + YANG Description: For components that have associated memory, these values +report information about available and utilized memory. + """ + return self.__memory + + def _set_memory(self, v, load=False): + """ + Setter method for memory, mapped from YANG variable /components/component/state/memory (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_memory is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_memory() directly. + + YANG Description: For components that have associated memory, these values +report information about available and utilized memory. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=memory.memory, is_container='container', yang_name="memory", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """memory must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=memory.memory, is_container='container', yang_name="memory", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False)""", + }) + + self.__memory = t + if hasattr(self, '_set'): + self._set() + + def _unset_memory(self): + self.__memory = YANGDynClass(base=memory.memory, is_container='container', yang_name="memory", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + + + def _get_allocated_power(self): + """ + Getter method for allocated_power, mapped from YANG variable /components/component/state/allocated_power (uint32) + + YANG Description: Power allocated by the system for the component. + """ + return self.__allocated_power + + def _set_allocated_power(self, v, load=False): + """ + Setter method for allocated_power, mapped from YANG variable /components/component/state/allocated_power (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_allocated_power is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_allocated_power() directly. + + YANG Description: Power allocated by the system for the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="allocated-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """allocated_power must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="allocated-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False)""", + }) + + self.__allocated_power = t + if hasattr(self, '_set'): + self._set() + + def _unset_allocated_power(self): + self.__allocated_power = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="allocated-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False) + + + def _get_used_power(self): + """ + Getter method for used_power, mapped from YANG variable /components/component/state/used_power (uint32) + + YANG Description: Actual power used by the component. + """ + return self.__used_power + + def _set_used_power(self, v, load=False): + """ + Setter method for used_power, mapped from YANG variable /components/component/state/used_power (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_used_power is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_used_power() directly. + + YANG Description: Actual power used by the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="used-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """used_power must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="used-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False)""", + }) + + self.__used_power = t + if hasattr(self, '_set'): + self._set() + + def _unset_used_power(self): + self.__used_power = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="used-power", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False) + + + def _get_pcie(self): + """ + Getter method for pcie, mapped from YANG variable /components/component/state/pcie (container) + + YANG Description: Components that are connected to the system over the Peripheral +Component Interconnect Express (PCIe), report the fatal, non-fatal +and correctable PCIe error counts. + """ + return self.__pcie + + def _set_pcie(self, v, load=False): + """ + Setter method for pcie, mapped from YANG variable /components/component/state/pcie (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_pcie is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_pcie() directly. + + YANG Description: Components that are connected to the system over the Peripheral +Component Interconnect Express (PCIe), report the fatal, non-fatal +and correctable PCIe error counts. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=pcie.pcie, is_container='container', yang_name="pcie", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """pcie must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=pcie.pcie, is_container='container', yang_name="pcie", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False)""", + }) + + self.__pcie = t + if hasattr(self, '_set'): + self._set() + + def _unset_pcie(self): + self.__pcie = YANGDynClass(base=pcie.pcie, is_container='container', yang_name="pcie", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + + name = __builtin__.property(_get_name) + type = __builtin__.property(_get_type) + id = __builtin__.property(_get_id) + location = __builtin__.property(_get_location) + description = __builtin__.property(_get_description) + mfg_name = __builtin__.property(_get_mfg_name) + mfg_date = __builtin__.property(_get_mfg_date) + hardware_version = __builtin__.property(_get_hardware_version) + firmware_version = __builtin__.property(_get_firmware_version) + software_version = __builtin__.property(_get_software_version) + serial_no = __builtin__.property(_get_serial_no) + part_no = __builtin__.property(_get_part_no) + clei_code = __builtin__.property(_get_clei_code) + removable = __builtin__.property(_get_removable) + oper_status = __builtin__.property(_get_oper_status) + empty = __builtin__.property(_get_empty) + parent = __builtin__.property(_get_parent) + redundant_role = __builtin__.property(_get_redundant_role) + last_switchover_reason = __builtin__.property(_get_last_switchover_reason) + last_switchover_time = __builtin__.property(_get_last_switchover_time) + last_reboot_reason = __builtin__.property(_get_last_reboot_reason) + last_reboot_time = __builtin__.property(_get_last_reboot_time) + switchover_ready = __builtin__.property(_get_switchover_ready) + temperature = __builtin__.property(_get_temperature) + memory = __builtin__.property(_get_memory) + allocated_power = __builtin__.property(_get_allocated_power) + used_power = __builtin__.property(_get_used_power) + pcie = __builtin__.property(_get_pcie) + + + _pyangbind_elements = OrderedDict([('name', name), ('type', type), ('id', id), ('location', location), ('description', description), ('mfg_name', mfg_name), ('mfg_date', mfg_date), ('hardware_version', hardware_version), ('firmware_version', firmware_version), ('software_version', software_version), ('serial_no', serial_no), ('part_no', part_no), ('clei_code', clei_code), ('removable', removable), ('oper_status', oper_status), ('empty', empty), ('parent', parent), ('redundant_role', redundant_role), ('last_switchover_reason', last_switchover_reason), ('last_switchover_time', last_switchover_time), ('last_reboot_reason', last_reboot_reason), ('last_reboot_time', last_reboot_time), ('switchover_ready', switchover_ready), ('temperature', temperature), ('memory', memory), ('allocated_power', allocated_power), ('used_power', used_power), ('pcie', pcie), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/state/last_switchover_reason/__init__.py b/hackfest/netconf-oc/openconfig/components/component/state/last_switchover_reason/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0786fb99cde68f9b4e23aa280f7a17e3fe280383 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/state/last_switchover_reason/__init__.py @@ -0,0 +1,306 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class last_switchover_reason(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/state/last-switchover-reason. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: For components that have redundant roles (e.g. two +supervisors in a device, one as primary the other as secondary), +this reports the reason of the last change of the +component's role. + """ + __slots__ = ('_path_helper', '_extmethods', '__trigger','__details',) + + _yang_name = 'last-switchover-reason' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__trigger = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'USER_INITIATED': {}, 'SYSTEM_INITIATED': {}},), is_leaf=True, yang_name="trigger", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='component-redundant-role-switchover-reason-trigger', is_config=False) + self.__details = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="details", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'state', 'last-switchover-reason'] + + def _get_trigger(self): + """ + Getter method for trigger, mapped from YANG variable /components/component/state/last_switchover_reason/trigger (component-redundant-role-switchover-reason-trigger) + + YANG Description: Records the generic triggers, e.g. user or system +initiated the switchover. + """ + return self.__trigger + + def _set_trigger(self, v, load=False): + """ + Setter method for trigger, mapped from YANG variable /components/component/state/last_switchover_reason/trigger (component-redundant-role-switchover-reason-trigger) + If this variable is read-only (config: false) in the + source YANG file, then _set_trigger is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_trigger() directly. + + YANG Description: Records the generic triggers, e.g. user or system +initiated the switchover. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'USER_INITIATED': {}, 'SYSTEM_INITIATED': {}},), is_leaf=True, yang_name="trigger", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='component-redundant-role-switchover-reason-trigger', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """trigger must be of a type compatible with component-redundant-role-switchover-reason-trigger""", + 'defined-type': "openconfig-platform:component-redundant-role-switchover-reason-trigger", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'USER_INITIATED': {}, 'SYSTEM_INITIATED': {}},), is_leaf=True, yang_name="trigger", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='component-redundant-role-switchover-reason-trigger', is_config=False)""", + }) + + self.__trigger = t + if hasattr(self, '_set'): + self._set() + + def _unset_trigger(self): + self.__trigger = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'USER_INITIATED': {}, 'SYSTEM_INITIATED': {}},), is_leaf=True, yang_name="trigger", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='component-redundant-role-switchover-reason-trigger', is_config=False) + + + def _get_details(self): + """ + Getter method for details, mapped from YANG variable /components/component/state/last_switchover_reason/details (string) + + YANG Description: Records detailed description of why the switchover happens. +For example, when system initiated the switchover, this leaf +can be used to record the specific reason, e.g. due to critical +errors of the routing daemon in the primary role. + """ + return self.__details + + def _set_details(self, v, load=False): + """ + Setter method for details, mapped from YANG variable /components/component/state/last_switchover_reason/details (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_details is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_details() directly. + + YANG Description: Records detailed description of why the switchover happens. +For example, when system initiated the switchover, this leaf +can be used to record the specific reason, e.g. due to critical +errors of the routing daemon in the primary role. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="details", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """details must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="details", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__details = t + if hasattr(self, '_set'): + self._set() + + def _unset_details(self): + self.__details = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="details", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + trigger = __builtin__.property(_get_trigger) + details = __builtin__.property(_get_details) + + + _pyangbind_elements = OrderedDict([('trigger', trigger), ('details', details), ]) + + +class last_switchover_reason(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/state/last-switchover-reason. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: For components that have redundant roles (e.g. two +supervisors in a device, one as primary the other as secondary), +this reports the reason of the last change of the +component's role. + """ + __slots__ = ('_path_helper', '_extmethods', '__trigger','__details',) + + _yang_name = 'last-switchover-reason' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__trigger = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'USER_INITIATED': {}, 'SYSTEM_INITIATED': {}},), is_leaf=True, yang_name="trigger", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='component-redundant-role-switchover-reason-trigger', is_config=False) + self.__details = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="details", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'state', 'last-switchover-reason'] + + def _get_trigger(self): + """ + Getter method for trigger, mapped from YANG variable /components/component/state/last_switchover_reason/trigger (component-redundant-role-switchover-reason-trigger) + + YANG Description: Records the generic triggers, e.g. user or system +initiated the switchover. + """ + return self.__trigger + + def _set_trigger(self, v, load=False): + """ + Setter method for trigger, mapped from YANG variable /components/component/state/last_switchover_reason/trigger (component-redundant-role-switchover-reason-trigger) + If this variable is read-only (config: false) in the + source YANG file, then _set_trigger is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_trigger() directly. + + YANG Description: Records the generic triggers, e.g. user or system +initiated the switchover. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'USER_INITIATED': {}, 'SYSTEM_INITIATED': {}},), is_leaf=True, yang_name="trigger", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='component-redundant-role-switchover-reason-trigger', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """trigger must be of a type compatible with component-redundant-role-switchover-reason-trigger""", + 'defined-type': "openconfig-platform:component-redundant-role-switchover-reason-trigger", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'USER_INITIATED': {}, 'SYSTEM_INITIATED': {}},), is_leaf=True, yang_name="trigger", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='component-redundant-role-switchover-reason-trigger', is_config=False)""", + }) + + self.__trigger = t + if hasattr(self, '_set'): + self._set() + + def _unset_trigger(self): + self.__trigger = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'USER_INITIATED': {}, 'SYSTEM_INITIATED': {}},), is_leaf=True, yang_name="trigger", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='component-redundant-role-switchover-reason-trigger', is_config=False) + + + def _get_details(self): + """ + Getter method for details, mapped from YANG variable /components/component/state/last_switchover_reason/details (string) + + YANG Description: Records detailed description of why the switchover happens. +For example, when system initiated the switchover, this leaf +can be used to record the specific reason, e.g. due to critical +errors of the routing daemon in the primary role. + """ + return self.__details + + def _set_details(self, v, load=False): + """ + Setter method for details, mapped from YANG variable /components/component/state/last_switchover_reason/details (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_details is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_details() directly. + + YANG Description: Records detailed description of why the switchover happens. +For example, when system initiated the switchover, this leaf +can be used to record the specific reason, e.g. due to critical +errors of the routing daemon in the primary role. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="details", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """details must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="details", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False)""", + }) + + self.__details = t + if hasattr(self, '_set'): + self._set() + + def _unset_details(self): + self.__details = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="details", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='string', is_config=False) + + trigger = __builtin__.property(_get_trigger) + details = __builtin__.property(_get_details) + + + _pyangbind_elements = OrderedDict([('trigger', trigger), ('details', details), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/state/memory/__init__.py b/hackfest/netconf-oc/openconfig/components/component/state/memory/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9a153eaf65f4eaef08cb2cef68057aa114183d8b --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/state/memory/__init__.py @@ -0,0 +1,298 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class memory(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/state/memory. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: For components that have associated memory, these values +report information about available and utilized memory. + """ + __slots__ = ('_path_helper', '_extmethods', '__available','__utilized',) + + _yang_name = 'memory' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__available = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="available", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + self.__utilized = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="utilized", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'state', 'memory'] + + def _get_available(self): + """ + Getter method for available, mapped from YANG variable /components/component/state/memory/available (uint64) + + YANG Description: The available memory physically installed, or logically +allocated to the component. + """ + return self.__available + + def _set_available(self, v, load=False): + """ + Setter method for available, mapped from YANG variable /components/component/state/memory/available (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_available is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_available() directly. + + YANG Description: The available memory physically installed, or logically +allocated to the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="available", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """available must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="available", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__available = t + if hasattr(self, '_set'): + self._set() + + def _unset_available(self): + self.__available = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="available", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + + def _get_utilized(self): + """ + Getter method for utilized, mapped from YANG variable /components/component/state/memory/utilized (uint64) + + YANG Description: The memory currently in use by processes running on +the component, not considering reserved memory that is +not available for use. + """ + return self.__utilized + + def _set_utilized(self, v, load=False): + """ + Setter method for utilized, mapped from YANG variable /components/component/state/memory/utilized (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_utilized is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_utilized() directly. + + YANG Description: The memory currently in use by processes running on +the component, not considering reserved memory that is +not available for use. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="utilized", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """utilized must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="utilized", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__utilized = t + if hasattr(self, '_set'): + self._set() + + def _unset_utilized(self): + self.__utilized = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="utilized", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + available = __builtin__.property(_get_available) + utilized = __builtin__.property(_get_utilized) + + + _pyangbind_elements = OrderedDict([('available', available), ('utilized', utilized), ]) + + +class memory(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/state/memory. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: For components that have associated memory, these values +report information about available and utilized memory. + """ + __slots__ = ('_path_helper', '_extmethods', '__available','__utilized',) + + _yang_name = 'memory' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__available = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="available", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + self.__utilized = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="utilized", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'state', 'memory'] + + def _get_available(self): + """ + Getter method for available, mapped from YANG variable /components/component/state/memory/available (uint64) + + YANG Description: The available memory physically installed, or logically +allocated to the component. + """ + return self.__available + + def _set_available(self, v, load=False): + """ + Setter method for available, mapped from YANG variable /components/component/state/memory/available (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_available is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_available() directly. + + YANG Description: The available memory physically installed, or logically +allocated to the component. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="available", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """available must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="available", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__available = t + if hasattr(self, '_set'): + self._set() + + def _unset_available(self): + self.__available = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="available", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + + def _get_utilized(self): + """ + Getter method for utilized, mapped from YANG variable /components/component/state/memory/utilized (uint64) + + YANG Description: The memory currently in use by processes running on +the component, not considering reserved memory that is +not available for use. + """ + return self.__utilized + + def _set_utilized(self, v, load=False): + """ + Setter method for utilized, mapped from YANG variable /components/component/state/memory/utilized (uint64) + If this variable is read-only (config: false) in the + source YANG file, then _set_utilized is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_utilized() directly. + + YANG Description: The memory currently in use by processes running on +the component, not considering reserved memory that is +not available for use. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="utilized", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """utilized must be of a type compatible with uint64""", + 'defined-type': "uint64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="utilized", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False)""", + }) + + self.__utilized = t + if hasattr(self, '_set'): + self._set() + + def _unset_utilized(self): + self.__utilized = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="utilized", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint64', is_config=False) + + available = __builtin__.property(_get_available) + utilized = __builtin__.property(_get_utilized) + + + _pyangbind_elements = OrderedDict([('available', available), ('utilized', utilized), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/state/pcie/__init__.py b/hackfest/netconf-oc/openconfig/components/component/state/pcie/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..aae99fcd62370ff7596b1401df999fe6a2a4ec0c --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/state/pcie/__init__.py @@ -0,0 +1,372 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import fatal_errors +from . import non_fatal_errors +from . import correctable_errors +class pcie(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/state/pcie. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Components that are connected to the system over the Peripheral +Component Interconnect Express (PCIe), report the fatal, non-fatal +and correctable PCIe error counts. + """ + __slots__ = ('_path_helper', '_extmethods', '__fatal_errors','__non_fatal_errors','__correctable_errors',) + + _yang_name = 'pcie' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__fatal_errors = YANGDynClass(base=fatal_errors.fatal_errors, is_container='container', yang_name="fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + self.__non_fatal_errors = YANGDynClass(base=non_fatal_errors.non_fatal_errors, is_container='container', yang_name="non-fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + self.__correctable_errors = YANGDynClass(base=correctable_errors.correctable_errors, is_container='container', yang_name="correctable-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'state', 'pcie'] + + def _get_fatal_errors(self): + """ + Getter method for fatal_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors (container) + + YANG Description: The count of the fatal PCIe errors. + """ + return self.__fatal_errors + + def _set_fatal_errors(self, v, load=False): + """ + Setter method for fatal_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_fatal_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_fatal_errors() directly. + + YANG Description: The count of the fatal PCIe errors. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=fatal_errors.fatal_errors, is_container='container', yang_name="fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """fatal_errors must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=fatal_errors.fatal_errors, is_container='container', yang_name="fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False)""", + }) + + self.__fatal_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_fatal_errors(self): + self.__fatal_errors = YANGDynClass(base=fatal_errors.fatal_errors, is_container='container', yang_name="fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + + + def _get_non_fatal_errors(self): + """ + Getter method for non_fatal_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors (container) + + YANG Description: The count of the non-fatal PCIe errors. + """ + return self.__non_fatal_errors + + def _set_non_fatal_errors(self, v, load=False): + """ + Setter method for non_fatal_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_non_fatal_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_non_fatal_errors() directly. + + YANG Description: The count of the non-fatal PCIe errors. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=non_fatal_errors.non_fatal_errors, is_container='container', yang_name="non-fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """non_fatal_errors must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=non_fatal_errors.non_fatal_errors, is_container='container', yang_name="non-fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False)""", + }) + + self.__non_fatal_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_non_fatal_errors(self): + self.__non_fatal_errors = YANGDynClass(base=non_fatal_errors.non_fatal_errors, is_container='container', yang_name="non-fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + + + def _get_correctable_errors(self): + """ + Getter method for correctable_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors (container) + + YANG Description: The count of the correctable PCIe errors. + """ + return self.__correctable_errors + + def _set_correctable_errors(self, v, load=False): + """ + Setter method for correctable_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_correctable_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_correctable_errors() directly. + + YANG Description: The count of the correctable PCIe errors. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=correctable_errors.correctable_errors, is_container='container', yang_name="correctable-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """correctable_errors must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=correctable_errors.correctable_errors, is_container='container', yang_name="correctable-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False)""", + }) + + self.__correctable_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_correctable_errors(self): + self.__correctable_errors = YANGDynClass(base=correctable_errors.correctable_errors, is_container='container', yang_name="correctable-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + + fatal_errors = __builtin__.property(_get_fatal_errors) + non_fatal_errors = __builtin__.property(_get_non_fatal_errors) + correctable_errors = __builtin__.property(_get_correctable_errors) + + + _pyangbind_elements = OrderedDict([('fatal_errors', fatal_errors), ('non_fatal_errors', non_fatal_errors), ('correctable_errors', correctable_errors), ]) + + +from . import fatal_errors +from . import non_fatal_errors +from . import correctable_errors +class pcie(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/state/pcie. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Components that are connected to the system over the Peripheral +Component Interconnect Express (PCIe), report the fatal, non-fatal +and correctable PCIe error counts. + """ + __slots__ = ('_path_helper', '_extmethods', '__fatal_errors','__non_fatal_errors','__correctable_errors',) + + _yang_name = 'pcie' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__fatal_errors = YANGDynClass(base=fatal_errors.fatal_errors, is_container='container', yang_name="fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + self.__non_fatal_errors = YANGDynClass(base=non_fatal_errors.non_fatal_errors, is_container='container', yang_name="non-fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + self.__correctable_errors = YANGDynClass(base=correctable_errors.correctable_errors, is_container='container', yang_name="correctable-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'state', 'pcie'] + + def _get_fatal_errors(self): + """ + Getter method for fatal_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors (container) + + YANG Description: The count of the fatal PCIe errors. + """ + return self.__fatal_errors + + def _set_fatal_errors(self, v, load=False): + """ + Setter method for fatal_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_fatal_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_fatal_errors() directly. + + YANG Description: The count of the fatal PCIe errors. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=fatal_errors.fatal_errors, is_container='container', yang_name="fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """fatal_errors must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=fatal_errors.fatal_errors, is_container='container', yang_name="fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False)""", + }) + + self.__fatal_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_fatal_errors(self): + self.__fatal_errors = YANGDynClass(base=fatal_errors.fatal_errors, is_container='container', yang_name="fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + + + def _get_non_fatal_errors(self): + """ + Getter method for non_fatal_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors (container) + + YANG Description: The count of the non-fatal PCIe errors. + """ + return self.__non_fatal_errors + + def _set_non_fatal_errors(self, v, load=False): + """ + Setter method for non_fatal_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_non_fatal_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_non_fatal_errors() directly. + + YANG Description: The count of the non-fatal PCIe errors. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=non_fatal_errors.non_fatal_errors, is_container='container', yang_name="non-fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """non_fatal_errors must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=non_fatal_errors.non_fatal_errors, is_container='container', yang_name="non-fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False)""", + }) + + self.__non_fatal_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_non_fatal_errors(self): + self.__non_fatal_errors = YANGDynClass(base=non_fatal_errors.non_fatal_errors, is_container='container', yang_name="non-fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + + + def _get_correctable_errors(self): + """ + Getter method for correctable_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors (container) + + YANG Description: The count of the correctable PCIe errors. + """ + return self.__correctable_errors + + def _set_correctable_errors(self, v, load=False): + """ + Setter method for correctable_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_correctable_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_correctable_errors() directly. + + YANG Description: The count of the correctable PCIe errors. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=correctable_errors.correctable_errors, is_container='container', yang_name="correctable-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """correctable_errors must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=correctable_errors.correctable_errors, is_container='container', yang_name="correctable-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False)""", + }) + + self.__correctable_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_correctable_errors(self): + self.__correctable_errors = YANGDynClass(base=correctable_errors.correctable_errors, is_container='container', yang_name="correctable-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=False) + + fatal_errors = __builtin__.property(_get_fatal_errors) + non_fatal_errors = __builtin__.property(_get_non_fatal_errors) + correctable_errors = __builtin__.property(_get_correctable_errors) + + + _pyangbind_elements = OrderedDict([('fatal_errors', fatal_errors), ('non_fatal_errors', non_fatal_errors), ('correctable_errors', correctable_errors), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/state/pcie/correctable_errors/__init__.py b/hackfest/netconf-oc/openconfig/components/component/state/pcie/correctable_errors/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bbef37323ba6b26d689f1575ce9afcd1ffbb9a7e --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/state/pcie/correctable_errors/__init__.py @@ -0,0 +1,866 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class correctable_errors(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/state/pcie/correctable-errors. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The count of the correctable PCIe errors. + """ + __slots__ = ('_path_helper', '_extmethods', '__total_errors','__receiver_errors','__bad_tlp_errors','__bad_dllp_errors','__relay_rollover_errors','__replay_timeout_errors','__advisory_non_fatal_errors','__internal_errors','__hdr_log_overflow_errors',) + + _yang_name = 'correctable-errors' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__total_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__receiver_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__bad_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="bad-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__bad_dllp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="bad-dllp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__relay_rollover_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="relay-rollover-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__replay_timeout_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="replay-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__advisory_non_fatal_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="advisory-non-fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__internal_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__hdr_log_overflow_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="hdr-log-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'state', 'pcie', 'correctable-errors'] + + def _get_total_errors(self): + """ + Getter method for total_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/total_errors (oc-yang:counter64) + + YANG Description: Total number of correctable errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__total_errors + + def _set_total_errors(self, v, load=False): + """ + Setter method for total_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/total_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_total_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_total_errors() directly. + + YANG Description: Total number of correctable errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """total_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__total_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_total_errors(self): + self.__total_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_receiver_errors(self): + """ + Getter method for receiver_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/receiver_errors (oc-yang:counter64) + + YANG Description: Number of receiver errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__receiver_errors + + def _set_receiver_errors(self, v, load=False): + """ + Setter method for receiver_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/receiver_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_receiver_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_receiver_errors() directly. + + YANG Description: Number of receiver errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """receiver_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__receiver_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_receiver_errors(self): + self.__receiver_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_bad_tlp_errors(self): + """ + Getter method for bad_tlp_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/bad_tlp_errors (oc-yang:counter64) + + YANG Description: Number of TLPs with bad LCRC detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__bad_tlp_errors + + def _set_bad_tlp_errors(self, v, load=False): + """ + Setter method for bad_tlp_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/bad_tlp_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_bad_tlp_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_bad_tlp_errors() directly. + + YANG Description: Number of TLPs with bad LCRC detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="bad-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """bad_tlp_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="bad-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__bad_tlp_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_bad_tlp_errors(self): + self.__bad_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="bad-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_bad_dllp_errors(self): + """ + Getter method for bad_dllp_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/bad_dllp_errors (oc-yang:counter64) + + YANG Description: Number of DLLPs with bad LCRC detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__bad_dllp_errors + + def _set_bad_dllp_errors(self, v, load=False): + """ + Setter method for bad_dllp_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/bad_dllp_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_bad_dllp_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_bad_dllp_errors() directly. + + YANG Description: Number of DLLPs with bad LCRC detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="bad-dllp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """bad_dllp_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="bad-dllp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__bad_dllp_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_bad_dllp_errors(self): + self.__bad_dllp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="bad-dllp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_relay_rollover_errors(self): + """ + Getter method for relay_rollover_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/relay_rollover_errors (oc-yang:counter64) + + YANG Description: Number of relay rollover errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__relay_rollover_errors + + def _set_relay_rollover_errors(self, v, load=False): + """ + Setter method for relay_rollover_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/relay_rollover_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_relay_rollover_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_relay_rollover_errors() directly. + + YANG Description: Number of relay rollover errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="relay-rollover-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """relay_rollover_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="relay-rollover-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__relay_rollover_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_relay_rollover_errors(self): + self.__relay_rollover_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="relay-rollover-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_replay_timeout_errors(self): + """ + Getter method for replay_timeout_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/replay_timeout_errors (oc-yang:counter64) + + YANG Description: Number of replay timeout errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__replay_timeout_errors + + def _set_replay_timeout_errors(self, v, load=False): + """ + Setter method for replay_timeout_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/replay_timeout_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_replay_timeout_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_replay_timeout_errors() directly. + + YANG Description: Number of replay timeout errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="replay-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """replay_timeout_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="replay-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__replay_timeout_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_replay_timeout_errors(self): + self.__replay_timeout_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="replay-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_advisory_non_fatal_errors(self): + """ + Getter method for advisory_non_fatal_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/advisory_non_fatal_errors (oc-yang:counter64) + + YANG Description: Number of advisory non fatal errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + return self.__advisory_non_fatal_errors + + def _set_advisory_non_fatal_errors(self, v, load=False): + """ + Setter method for advisory_non_fatal_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/advisory_non_fatal_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_advisory_non_fatal_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_advisory_non_fatal_errors() directly. + + YANG Description: Number of advisory non fatal errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="advisory-non-fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """advisory_non_fatal_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="advisory-non-fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__advisory_non_fatal_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_advisory_non_fatal_errors(self): + self.__advisory_non_fatal_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="advisory-non-fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_internal_errors(self): + """ + Getter method for internal_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/internal_errors (oc-yang:counter64) + + YANG Description: Number of internal errors detected by PCIe device since the system +booted, according to PCIe AER driver. + """ + return self.__internal_errors + + def _set_internal_errors(self, v, load=False): + """ + Setter method for internal_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/internal_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_internal_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_internal_errors() directly. + + YANG Description: Number of internal errors detected by PCIe device since the system +booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """internal_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__internal_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_internal_errors(self): + self.__internal_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_hdr_log_overflow_errors(self): + """ + Getter method for hdr_log_overflow_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/hdr_log_overflow_errors (oc-yang:counter64) + + YANG Description: Number of header log overflow errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + return self.__hdr_log_overflow_errors + + def _set_hdr_log_overflow_errors(self, v, load=False): + """ + Setter method for hdr_log_overflow_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/hdr_log_overflow_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_hdr_log_overflow_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hdr_log_overflow_errors() directly. + + YANG Description: Number of header log overflow errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="hdr-log-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hdr_log_overflow_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="hdr-log-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__hdr_log_overflow_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_hdr_log_overflow_errors(self): + self.__hdr_log_overflow_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="hdr-log-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + total_errors = __builtin__.property(_get_total_errors) + receiver_errors = __builtin__.property(_get_receiver_errors) + bad_tlp_errors = __builtin__.property(_get_bad_tlp_errors) + bad_dllp_errors = __builtin__.property(_get_bad_dllp_errors) + relay_rollover_errors = __builtin__.property(_get_relay_rollover_errors) + replay_timeout_errors = __builtin__.property(_get_replay_timeout_errors) + advisory_non_fatal_errors = __builtin__.property(_get_advisory_non_fatal_errors) + internal_errors = __builtin__.property(_get_internal_errors) + hdr_log_overflow_errors = __builtin__.property(_get_hdr_log_overflow_errors) + + + _pyangbind_elements = OrderedDict([('total_errors', total_errors), ('receiver_errors', receiver_errors), ('bad_tlp_errors', bad_tlp_errors), ('bad_dllp_errors', bad_dllp_errors), ('relay_rollover_errors', relay_rollover_errors), ('replay_timeout_errors', replay_timeout_errors), ('advisory_non_fatal_errors', advisory_non_fatal_errors), ('internal_errors', internal_errors), ('hdr_log_overflow_errors', hdr_log_overflow_errors), ]) + + +class correctable_errors(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/state/pcie/correctable-errors. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The count of the correctable PCIe errors. + """ + __slots__ = ('_path_helper', '_extmethods', '__total_errors','__receiver_errors','__bad_tlp_errors','__bad_dllp_errors','__relay_rollover_errors','__replay_timeout_errors','__advisory_non_fatal_errors','__internal_errors','__hdr_log_overflow_errors',) + + _yang_name = 'correctable-errors' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__total_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__receiver_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__bad_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="bad-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__bad_dllp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="bad-dllp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__relay_rollover_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="relay-rollover-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__replay_timeout_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="replay-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__advisory_non_fatal_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="advisory-non-fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__internal_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__hdr_log_overflow_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="hdr-log-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'state', 'pcie', 'correctable-errors'] + + def _get_total_errors(self): + """ + Getter method for total_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/total_errors (oc-yang:counter64) + + YANG Description: Total number of correctable errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__total_errors + + def _set_total_errors(self, v, load=False): + """ + Setter method for total_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/total_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_total_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_total_errors() directly. + + YANG Description: Total number of correctable errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """total_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__total_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_total_errors(self): + self.__total_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_receiver_errors(self): + """ + Getter method for receiver_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/receiver_errors (oc-yang:counter64) + + YANG Description: Number of receiver errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__receiver_errors + + def _set_receiver_errors(self, v, load=False): + """ + Setter method for receiver_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/receiver_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_receiver_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_receiver_errors() directly. + + YANG Description: Number of receiver errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """receiver_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__receiver_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_receiver_errors(self): + self.__receiver_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_bad_tlp_errors(self): + """ + Getter method for bad_tlp_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/bad_tlp_errors (oc-yang:counter64) + + YANG Description: Number of TLPs with bad LCRC detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__bad_tlp_errors + + def _set_bad_tlp_errors(self, v, load=False): + """ + Setter method for bad_tlp_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/bad_tlp_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_bad_tlp_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_bad_tlp_errors() directly. + + YANG Description: Number of TLPs with bad LCRC detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="bad-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """bad_tlp_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="bad-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__bad_tlp_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_bad_tlp_errors(self): + self.__bad_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="bad-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_bad_dllp_errors(self): + """ + Getter method for bad_dllp_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/bad_dllp_errors (oc-yang:counter64) + + YANG Description: Number of DLLPs with bad LCRC detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__bad_dllp_errors + + def _set_bad_dllp_errors(self, v, load=False): + """ + Setter method for bad_dllp_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/bad_dllp_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_bad_dllp_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_bad_dllp_errors() directly. + + YANG Description: Number of DLLPs with bad LCRC detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="bad-dllp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """bad_dllp_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="bad-dllp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__bad_dllp_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_bad_dllp_errors(self): + self.__bad_dllp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="bad-dllp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_relay_rollover_errors(self): + """ + Getter method for relay_rollover_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/relay_rollover_errors (oc-yang:counter64) + + YANG Description: Number of relay rollover errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__relay_rollover_errors + + def _set_relay_rollover_errors(self, v, load=False): + """ + Setter method for relay_rollover_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/relay_rollover_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_relay_rollover_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_relay_rollover_errors() directly. + + YANG Description: Number of relay rollover errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="relay-rollover-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """relay_rollover_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="relay-rollover-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__relay_rollover_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_relay_rollover_errors(self): + self.__relay_rollover_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="relay-rollover-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_replay_timeout_errors(self): + """ + Getter method for replay_timeout_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/replay_timeout_errors (oc-yang:counter64) + + YANG Description: Number of replay timeout errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__replay_timeout_errors + + def _set_replay_timeout_errors(self, v, load=False): + """ + Setter method for replay_timeout_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/replay_timeout_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_replay_timeout_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_replay_timeout_errors() directly. + + YANG Description: Number of replay timeout errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="replay-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """replay_timeout_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="replay-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__replay_timeout_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_replay_timeout_errors(self): + self.__replay_timeout_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="replay-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_advisory_non_fatal_errors(self): + """ + Getter method for advisory_non_fatal_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/advisory_non_fatal_errors (oc-yang:counter64) + + YANG Description: Number of advisory non fatal errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + return self.__advisory_non_fatal_errors + + def _set_advisory_non_fatal_errors(self, v, load=False): + """ + Setter method for advisory_non_fatal_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/advisory_non_fatal_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_advisory_non_fatal_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_advisory_non_fatal_errors() directly. + + YANG Description: Number of advisory non fatal errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="advisory-non-fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """advisory_non_fatal_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="advisory-non-fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__advisory_non_fatal_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_advisory_non_fatal_errors(self): + self.__advisory_non_fatal_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="advisory-non-fatal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_internal_errors(self): + """ + Getter method for internal_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/internal_errors (oc-yang:counter64) + + YANG Description: Number of internal errors detected by PCIe device since the system +booted, according to PCIe AER driver. + """ + return self.__internal_errors + + def _set_internal_errors(self, v, load=False): + """ + Setter method for internal_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/internal_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_internal_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_internal_errors() directly. + + YANG Description: Number of internal errors detected by PCIe device since the system +booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """internal_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__internal_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_internal_errors(self): + self.__internal_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_hdr_log_overflow_errors(self): + """ + Getter method for hdr_log_overflow_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/hdr_log_overflow_errors (oc-yang:counter64) + + YANG Description: Number of header log overflow errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + return self.__hdr_log_overflow_errors + + def _set_hdr_log_overflow_errors(self, v, load=False): + """ + Setter method for hdr_log_overflow_errors, mapped from YANG variable /components/component/state/pcie/correctable_errors/hdr_log_overflow_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_hdr_log_overflow_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hdr_log_overflow_errors() directly. + + YANG Description: Number of header log overflow errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="hdr-log-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hdr_log_overflow_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="hdr-log-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__hdr_log_overflow_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_hdr_log_overflow_errors(self): + self.__hdr_log_overflow_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="hdr-log-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + total_errors = __builtin__.property(_get_total_errors) + receiver_errors = __builtin__.property(_get_receiver_errors) + bad_tlp_errors = __builtin__.property(_get_bad_tlp_errors) + bad_dllp_errors = __builtin__.property(_get_bad_dllp_errors) + relay_rollover_errors = __builtin__.property(_get_relay_rollover_errors) + replay_timeout_errors = __builtin__.property(_get_replay_timeout_errors) + advisory_non_fatal_errors = __builtin__.property(_get_advisory_non_fatal_errors) + internal_errors = __builtin__.property(_get_internal_errors) + hdr_log_overflow_errors = __builtin__.property(_get_hdr_log_overflow_errors) + + + _pyangbind_elements = OrderedDict([('total_errors', total_errors), ('receiver_errors', receiver_errors), ('bad_tlp_errors', bad_tlp_errors), ('bad_dllp_errors', bad_dllp_errors), ('relay_rollover_errors', relay_rollover_errors), ('replay_timeout_errors', replay_timeout_errors), ('advisory_non_fatal_errors', advisory_non_fatal_errors), ('internal_errors', internal_errors), ('hdr_log_overflow_errors', hdr_log_overflow_errors), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/state/pcie/fatal_errors/__init__.py b/hackfest/netconf-oc/openconfig/components/component/state/pcie/fatal_errors/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..12185542ccc99155d1fd1bd22407db0421a753c0 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/state/pcie/fatal_errors/__init__.py @@ -0,0 +1,1604 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class fatal_errors(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/state/pcie/fatal-errors. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The count of the fatal PCIe errors. + """ + __slots__ = ('_path_helper', '_extmethods', '__total_errors','__undefined_errors','__data_link_errors','__surprise_down_errors','__poisoned_tlp_errors','__flow_control_protocol_errors','__completion_timeout_errors','__completion_abort_errors','__unexpected_completion_errors','__receiver_overflow_errors','__malformed_tlp_errors','__ecrc_errors','__unsupported_request_errors','__acs_violation_errors','__internal_errors','__blocked_tlp_errors','__atomic_op_blocked_errors','__tlp_prefix_blocked_errors',) + + _yang_name = 'fatal-errors' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__total_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__undefined_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="undefined-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__data_link_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="data-link-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__surprise_down_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="surprise-down-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__poisoned_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="poisoned-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__flow_control_protocol_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="flow-control-protocol-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__completion_timeout_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__completion_abort_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-abort-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__unexpected_completion_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unexpected-completion-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__receiver_overflow_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__malformed_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="malformed-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__ecrc_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="ecrc-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__unsupported_request_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unsupported-request-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__acs_violation_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="acs-violation-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__internal_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__blocked_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="blocked-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__atomic_op_blocked_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="atomic-op-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__tlp_prefix_blocked_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="tlp-prefix-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'state', 'pcie', 'fatal-errors'] + + def _get_total_errors(self): + """ + Getter method for total_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/total_errors (oc-yang:counter64) + + YANG Description: Total number of uncorrectable errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__total_errors + + def _set_total_errors(self, v, load=False): + """ + Setter method for total_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/total_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_total_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_total_errors() directly. + + YANG Description: Total number of uncorrectable errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """total_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__total_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_total_errors(self): + self.__total_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_undefined_errors(self): + """ + Getter method for undefined_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/undefined_errors (oc-yang:counter64) + + YANG Description: Number of undefined errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__undefined_errors + + def _set_undefined_errors(self, v, load=False): + """ + Setter method for undefined_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/undefined_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_undefined_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_undefined_errors() directly. + + YANG Description: Number of undefined errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="undefined-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """undefined_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="undefined-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__undefined_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_undefined_errors(self): + self.__undefined_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="undefined-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_data_link_errors(self): + """ + Getter method for data_link_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/data_link_errors (oc-yang:counter64) + + YANG Description: Number of data-link errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__data_link_errors + + def _set_data_link_errors(self, v, load=False): + """ + Setter method for data_link_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/data_link_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_data_link_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_data_link_errors() directly. + + YANG Description: Number of data-link errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="data-link-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """data_link_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="data-link-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__data_link_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_data_link_errors(self): + self.__data_link_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="data-link-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_surprise_down_errors(self): + """ + Getter method for surprise_down_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/surprise_down_errors (oc-yang:counter64) + + YANG Description: Number of unexpected link down errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__surprise_down_errors + + def _set_surprise_down_errors(self, v, load=False): + """ + Setter method for surprise_down_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/surprise_down_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_surprise_down_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_surprise_down_errors() directly. + + YANG Description: Number of unexpected link down errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="surprise-down-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """surprise_down_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="surprise-down-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__surprise_down_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_surprise_down_errors(self): + self.__surprise_down_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="surprise-down-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_poisoned_tlp_errors(self): + """ + Getter method for poisoned_tlp_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/poisoned_tlp_errors (oc-yang:counter64) + + YANG Description: Number of poisoned TLP errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__poisoned_tlp_errors + + def _set_poisoned_tlp_errors(self, v, load=False): + """ + Setter method for poisoned_tlp_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/poisoned_tlp_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_poisoned_tlp_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_poisoned_tlp_errors() directly. + + YANG Description: Number of poisoned TLP errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="poisoned-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """poisoned_tlp_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="poisoned-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__poisoned_tlp_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_poisoned_tlp_errors(self): + self.__poisoned_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="poisoned-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_flow_control_protocol_errors(self): + """ + Getter method for flow_control_protocol_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/flow_control_protocol_errors (oc-yang:counter64) + + YANG Description: Number of flow control protocol errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__flow_control_protocol_errors + + def _set_flow_control_protocol_errors(self, v, load=False): + """ + Setter method for flow_control_protocol_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/flow_control_protocol_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_flow_control_protocol_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_flow_control_protocol_errors() directly. + + YANG Description: Number of flow control protocol errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="flow-control-protocol-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """flow_control_protocol_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="flow-control-protocol-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__flow_control_protocol_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_flow_control_protocol_errors(self): + self.__flow_control_protocol_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="flow-control-protocol-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_completion_timeout_errors(self): + """ + Getter method for completion_timeout_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/completion_timeout_errors (oc-yang:counter64) + + YANG Description: Number of completion timeout errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__completion_timeout_errors + + def _set_completion_timeout_errors(self, v, load=False): + """ + Setter method for completion_timeout_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/completion_timeout_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_completion_timeout_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_completion_timeout_errors() directly. + + YANG Description: Number of completion timeout errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """completion_timeout_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__completion_timeout_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_completion_timeout_errors(self): + self.__completion_timeout_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_completion_abort_errors(self): + """ + Getter method for completion_abort_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/completion_abort_errors (oc-yang:counter64) + + YANG Description: Number of completion abort errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__completion_abort_errors + + def _set_completion_abort_errors(self, v, load=False): + """ + Setter method for completion_abort_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/completion_abort_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_completion_abort_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_completion_abort_errors() directly. + + YANG Description: Number of completion abort errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-abort-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """completion_abort_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-abort-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__completion_abort_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_completion_abort_errors(self): + self.__completion_abort_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-abort-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_unexpected_completion_errors(self): + """ + Getter method for unexpected_completion_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/unexpected_completion_errors (oc-yang:counter64) + + YANG Description: Number of unexpected completion errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__unexpected_completion_errors + + def _set_unexpected_completion_errors(self, v, load=False): + """ + Setter method for unexpected_completion_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/unexpected_completion_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_unexpected_completion_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unexpected_completion_errors() directly. + + YANG Description: Number of unexpected completion errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unexpected-completion-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unexpected_completion_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unexpected-completion-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__unexpected_completion_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_unexpected_completion_errors(self): + self.__unexpected_completion_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unexpected-completion-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_receiver_overflow_errors(self): + """ + Getter method for receiver_overflow_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/receiver_overflow_errors (oc-yang:counter64) + + YANG Description: Number of receiver overflow errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__receiver_overflow_errors + + def _set_receiver_overflow_errors(self, v, load=False): + """ + Setter method for receiver_overflow_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/receiver_overflow_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_receiver_overflow_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_receiver_overflow_errors() directly. + + YANG Description: Number of receiver overflow errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """receiver_overflow_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__receiver_overflow_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_receiver_overflow_errors(self): + self.__receiver_overflow_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_malformed_tlp_errors(self): + """ + Getter method for malformed_tlp_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/malformed_tlp_errors (oc-yang:counter64) + + YANG Description: Number of malformed TLP errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__malformed_tlp_errors + + def _set_malformed_tlp_errors(self, v, load=False): + """ + Setter method for malformed_tlp_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/malformed_tlp_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_malformed_tlp_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_malformed_tlp_errors() directly. + + YANG Description: Number of malformed TLP errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="malformed-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """malformed_tlp_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="malformed-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__malformed_tlp_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_malformed_tlp_errors(self): + self.__malformed_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="malformed-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_ecrc_errors(self): + """ + Getter method for ecrc_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/ecrc_errors (oc-yang:counter64) + + YANG Description: Number of ECRC errors detected by PCIe device since the system +booted, according to PCIe AER driver. + """ + return self.__ecrc_errors + + def _set_ecrc_errors(self, v, load=False): + """ + Setter method for ecrc_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/ecrc_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_ecrc_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ecrc_errors() directly. + + YANG Description: Number of ECRC errors detected by PCIe device since the system +booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="ecrc-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ecrc_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="ecrc-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__ecrc_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_ecrc_errors(self): + self.__ecrc_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="ecrc-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_unsupported_request_errors(self): + """ + Getter method for unsupported_request_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/unsupported_request_errors (oc-yang:counter64) + + YANG Description: Number of unsupported request errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__unsupported_request_errors + + def _set_unsupported_request_errors(self, v, load=False): + """ + Setter method for unsupported_request_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/unsupported_request_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_unsupported_request_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unsupported_request_errors() directly. + + YANG Description: Number of unsupported request errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unsupported-request-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unsupported_request_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unsupported-request-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__unsupported_request_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_unsupported_request_errors(self): + self.__unsupported_request_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unsupported-request-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_acs_violation_errors(self): + """ + Getter method for acs_violation_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/acs_violation_errors (oc-yang:counter64) + + YANG Description: Number of access control errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + return self.__acs_violation_errors + + def _set_acs_violation_errors(self, v, load=False): + """ + Setter method for acs_violation_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/acs_violation_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_acs_violation_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_acs_violation_errors() directly. + + YANG Description: Number of access control errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="acs-violation-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """acs_violation_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="acs-violation-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__acs_violation_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_acs_violation_errors(self): + self.__acs_violation_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="acs-violation-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_internal_errors(self): + """ + Getter method for internal_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/internal_errors (oc-yang:counter64) + + YANG Description: Number of internal errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__internal_errors + + def _set_internal_errors(self, v, load=False): + """ + Setter method for internal_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/internal_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_internal_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_internal_errors() directly. + + YANG Description: Number of internal errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """internal_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__internal_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_internal_errors(self): + self.__internal_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_blocked_tlp_errors(self): + """ + Getter method for blocked_tlp_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/blocked_tlp_errors (oc-yang:counter64) + + YANG Description: Number of blocked TLP errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + return self.__blocked_tlp_errors + + def _set_blocked_tlp_errors(self, v, load=False): + """ + Setter method for blocked_tlp_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/blocked_tlp_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_blocked_tlp_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_blocked_tlp_errors() directly. + + YANG Description: Number of blocked TLP errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="blocked-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """blocked_tlp_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="blocked-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__blocked_tlp_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_blocked_tlp_errors(self): + self.__blocked_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="blocked-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_atomic_op_blocked_errors(self): + """ + Getter method for atomic_op_blocked_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/atomic_op_blocked_errors (oc-yang:counter64) + + YANG Description: Number of atomic operation blocked errors detected by PCIe +device since the system booted, according to PCIe AER driver. + """ + return self.__atomic_op_blocked_errors + + def _set_atomic_op_blocked_errors(self, v, load=False): + """ + Setter method for atomic_op_blocked_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/atomic_op_blocked_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_atomic_op_blocked_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_atomic_op_blocked_errors() directly. + + YANG Description: Number of atomic operation blocked errors detected by PCIe +device since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="atomic-op-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """atomic_op_blocked_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="atomic-op-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__atomic_op_blocked_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_atomic_op_blocked_errors(self): + self.__atomic_op_blocked_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="atomic-op-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_tlp_prefix_blocked_errors(self): + """ + Getter method for tlp_prefix_blocked_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/tlp_prefix_blocked_errors (oc-yang:counter64) + + YANG Description: Number of TLP prefix blocked errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__tlp_prefix_blocked_errors + + def _set_tlp_prefix_blocked_errors(self, v, load=False): + """ + Setter method for tlp_prefix_blocked_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/tlp_prefix_blocked_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_tlp_prefix_blocked_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tlp_prefix_blocked_errors() directly. + + YANG Description: Number of TLP prefix blocked errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="tlp-prefix-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tlp_prefix_blocked_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="tlp-prefix-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__tlp_prefix_blocked_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_tlp_prefix_blocked_errors(self): + self.__tlp_prefix_blocked_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="tlp-prefix-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + total_errors = __builtin__.property(_get_total_errors) + undefined_errors = __builtin__.property(_get_undefined_errors) + data_link_errors = __builtin__.property(_get_data_link_errors) + surprise_down_errors = __builtin__.property(_get_surprise_down_errors) + poisoned_tlp_errors = __builtin__.property(_get_poisoned_tlp_errors) + flow_control_protocol_errors = __builtin__.property(_get_flow_control_protocol_errors) + completion_timeout_errors = __builtin__.property(_get_completion_timeout_errors) + completion_abort_errors = __builtin__.property(_get_completion_abort_errors) + unexpected_completion_errors = __builtin__.property(_get_unexpected_completion_errors) + receiver_overflow_errors = __builtin__.property(_get_receiver_overflow_errors) + malformed_tlp_errors = __builtin__.property(_get_malformed_tlp_errors) + ecrc_errors = __builtin__.property(_get_ecrc_errors) + unsupported_request_errors = __builtin__.property(_get_unsupported_request_errors) + acs_violation_errors = __builtin__.property(_get_acs_violation_errors) + internal_errors = __builtin__.property(_get_internal_errors) + blocked_tlp_errors = __builtin__.property(_get_blocked_tlp_errors) + atomic_op_blocked_errors = __builtin__.property(_get_atomic_op_blocked_errors) + tlp_prefix_blocked_errors = __builtin__.property(_get_tlp_prefix_blocked_errors) + + + _pyangbind_elements = OrderedDict([('total_errors', total_errors), ('undefined_errors', undefined_errors), ('data_link_errors', data_link_errors), ('surprise_down_errors', surprise_down_errors), ('poisoned_tlp_errors', poisoned_tlp_errors), ('flow_control_protocol_errors', flow_control_protocol_errors), ('completion_timeout_errors', completion_timeout_errors), ('completion_abort_errors', completion_abort_errors), ('unexpected_completion_errors', unexpected_completion_errors), ('receiver_overflow_errors', receiver_overflow_errors), ('malformed_tlp_errors', malformed_tlp_errors), ('ecrc_errors', ecrc_errors), ('unsupported_request_errors', unsupported_request_errors), ('acs_violation_errors', acs_violation_errors), ('internal_errors', internal_errors), ('blocked_tlp_errors', blocked_tlp_errors), ('atomic_op_blocked_errors', atomic_op_blocked_errors), ('tlp_prefix_blocked_errors', tlp_prefix_blocked_errors), ]) + + +class fatal_errors(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/state/pcie/fatal-errors. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The count of the fatal PCIe errors. + """ + __slots__ = ('_path_helper', '_extmethods', '__total_errors','__undefined_errors','__data_link_errors','__surprise_down_errors','__poisoned_tlp_errors','__flow_control_protocol_errors','__completion_timeout_errors','__completion_abort_errors','__unexpected_completion_errors','__receiver_overflow_errors','__malformed_tlp_errors','__ecrc_errors','__unsupported_request_errors','__acs_violation_errors','__internal_errors','__blocked_tlp_errors','__atomic_op_blocked_errors','__tlp_prefix_blocked_errors',) + + _yang_name = 'fatal-errors' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__total_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__undefined_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="undefined-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__data_link_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="data-link-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__surprise_down_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="surprise-down-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__poisoned_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="poisoned-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__flow_control_protocol_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="flow-control-protocol-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__completion_timeout_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__completion_abort_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-abort-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__unexpected_completion_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unexpected-completion-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__receiver_overflow_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__malformed_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="malformed-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__ecrc_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="ecrc-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__unsupported_request_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unsupported-request-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__acs_violation_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="acs-violation-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__internal_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__blocked_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="blocked-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__atomic_op_blocked_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="atomic-op-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__tlp_prefix_blocked_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="tlp-prefix-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'state', 'pcie', 'fatal-errors'] + + def _get_total_errors(self): + """ + Getter method for total_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/total_errors (oc-yang:counter64) + + YANG Description: Total number of uncorrectable errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__total_errors + + def _set_total_errors(self, v, load=False): + """ + Setter method for total_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/total_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_total_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_total_errors() directly. + + YANG Description: Total number of uncorrectable errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """total_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__total_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_total_errors(self): + self.__total_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_undefined_errors(self): + """ + Getter method for undefined_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/undefined_errors (oc-yang:counter64) + + YANG Description: Number of undefined errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__undefined_errors + + def _set_undefined_errors(self, v, load=False): + """ + Setter method for undefined_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/undefined_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_undefined_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_undefined_errors() directly. + + YANG Description: Number of undefined errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="undefined-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """undefined_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="undefined-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__undefined_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_undefined_errors(self): + self.__undefined_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="undefined-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_data_link_errors(self): + """ + Getter method for data_link_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/data_link_errors (oc-yang:counter64) + + YANG Description: Number of data-link errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__data_link_errors + + def _set_data_link_errors(self, v, load=False): + """ + Setter method for data_link_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/data_link_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_data_link_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_data_link_errors() directly. + + YANG Description: Number of data-link errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="data-link-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """data_link_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="data-link-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__data_link_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_data_link_errors(self): + self.__data_link_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="data-link-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_surprise_down_errors(self): + """ + Getter method for surprise_down_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/surprise_down_errors (oc-yang:counter64) + + YANG Description: Number of unexpected link down errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__surprise_down_errors + + def _set_surprise_down_errors(self, v, load=False): + """ + Setter method for surprise_down_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/surprise_down_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_surprise_down_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_surprise_down_errors() directly. + + YANG Description: Number of unexpected link down errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="surprise-down-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """surprise_down_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="surprise-down-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__surprise_down_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_surprise_down_errors(self): + self.__surprise_down_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="surprise-down-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_poisoned_tlp_errors(self): + """ + Getter method for poisoned_tlp_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/poisoned_tlp_errors (oc-yang:counter64) + + YANG Description: Number of poisoned TLP errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__poisoned_tlp_errors + + def _set_poisoned_tlp_errors(self, v, load=False): + """ + Setter method for poisoned_tlp_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/poisoned_tlp_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_poisoned_tlp_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_poisoned_tlp_errors() directly. + + YANG Description: Number of poisoned TLP errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="poisoned-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """poisoned_tlp_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="poisoned-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__poisoned_tlp_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_poisoned_tlp_errors(self): + self.__poisoned_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="poisoned-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_flow_control_protocol_errors(self): + """ + Getter method for flow_control_protocol_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/flow_control_protocol_errors (oc-yang:counter64) + + YANG Description: Number of flow control protocol errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__flow_control_protocol_errors + + def _set_flow_control_protocol_errors(self, v, load=False): + """ + Setter method for flow_control_protocol_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/flow_control_protocol_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_flow_control_protocol_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_flow_control_protocol_errors() directly. + + YANG Description: Number of flow control protocol errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="flow-control-protocol-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """flow_control_protocol_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="flow-control-protocol-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__flow_control_protocol_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_flow_control_protocol_errors(self): + self.__flow_control_protocol_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="flow-control-protocol-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_completion_timeout_errors(self): + """ + Getter method for completion_timeout_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/completion_timeout_errors (oc-yang:counter64) + + YANG Description: Number of completion timeout errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__completion_timeout_errors + + def _set_completion_timeout_errors(self, v, load=False): + """ + Setter method for completion_timeout_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/completion_timeout_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_completion_timeout_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_completion_timeout_errors() directly. + + YANG Description: Number of completion timeout errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """completion_timeout_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__completion_timeout_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_completion_timeout_errors(self): + self.__completion_timeout_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_completion_abort_errors(self): + """ + Getter method for completion_abort_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/completion_abort_errors (oc-yang:counter64) + + YANG Description: Number of completion abort errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__completion_abort_errors + + def _set_completion_abort_errors(self, v, load=False): + """ + Setter method for completion_abort_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/completion_abort_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_completion_abort_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_completion_abort_errors() directly. + + YANG Description: Number of completion abort errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-abort-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """completion_abort_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-abort-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__completion_abort_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_completion_abort_errors(self): + self.__completion_abort_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-abort-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_unexpected_completion_errors(self): + """ + Getter method for unexpected_completion_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/unexpected_completion_errors (oc-yang:counter64) + + YANG Description: Number of unexpected completion errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__unexpected_completion_errors + + def _set_unexpected_completion_errors(self, v, load=False): + """ + Setter method for unexpected_completion_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/unexpected_completion_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_unexpected_completion_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unexpected_completion_errors() directly. + + YANG Description: Number of unexpected completion errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unexpected-completion-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unexpected_completion_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unexpected-completion-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__unexpected_completion_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_unexpected_completion_errors(self): + self.__unexpected_completion_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unexpected-completion-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_receiver_overflow_errors(self): + """ + Getter method for receiver_overflow_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/receiver_overflow_errors (oc-yang:counter64) + + YANG Description: Number of receiver overflow errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__receiver_overflow_errors + + def _set_receiver_overflow_errors(self, v, load=False): + """ + Setter method for receiver_overflow_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/receiver_overflow_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_receiver_overflow_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_receiver_overflow_errors() directly. + + YANG Description: Number of receiver overflow errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """receiver_overflow_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__receiver_overflow_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_receiver_overflow_errors(self): + self.__receiver_overflow_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_malformed_tlp_errors(self): + """ + Getter method for malformed_tlp_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/malformed_tlp_errors (oc-yang:counter64) + + YANG Description: Number of malformed TLP errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__malformed_tlp_errors + + def _set_malformed_tlp_errors(self, v, load=False): + """ + Setter method for malformed_tlp_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/malformed_tlp_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_malformed_tlp_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_malformed_tlp_errors() directly. + + YANG Description: Number of malformed TLP errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="malformed-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """malformed_tlp_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="malformed-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__malformed_tlp_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_malformed_tlp_errors(self): + self.__malformed_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="malformed-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_ecrc_errors(self): + """ + Getter method for ecrc_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/ecrc_errors (oc-yang:counter64) + + YANG Description: Number of ECRC errors detected by PCIe device since the system +booted, according to PCIe AER driver. + """ + return self.__ecrc_errors + + def _set_ecrc_errors(self, v, load=False): + """ + Setter method for ecrc_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/ecrc_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_ecrc_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ecrc_errors() directly. + + YANG Description: Number of ECRC errors detected by PCIe device since the system +booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="ecrc-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ecrc_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="ecrc-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__ecrc_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_ecrc_errors(self): + self.__ecrc_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="ecrc-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_unsupported_request_errors(self): + """ + Getter method for unsupported_request_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/unsupported_request_errors (oc-yang:counter64) + + YANG Description: Number of unsupported request errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__unsupported_request_errors + + def _set_unsupported_request_errors(self, v, load=False): + """ + Setter method for unsupported_request_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/unsupported_request_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_unsupported_request_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unsupported_request_errors() directly. + + YANG Description: Number of unsupported request errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unsupported-request-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unsupported_request_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unsupported-request-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__unsupported_request_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_unsupported_request_errors(self): + self.__unsupported_request_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unsupported-request-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_acs_violation_errors(self): + """ + Getter method for acs_violation_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/acs_violation_errors (oc-yang:counter64) + + YANG Description: Number of access control errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + return self.__acs_violation_errors + + def _set_acs_violation_errors(self, v, load=False): + """ + Setter method for acs_violation_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/acs_violation_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_acs_violation_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_acs_violation_errors() directly. + + YANG Description: Number of access control errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="acs-violation-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """acs_violation_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="acs-violation-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__acs_violation_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_acs_violation_errors(self): + self.__acs_violation_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="acs-violation-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_internal_errors(self): + """ + Getter method for internal_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/internal_errors (oc-yang:counter64) + + YANG Description: Number of internal errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__internal_errors + + def _set_internal_errors(self, v, load=False): + """ + Setter method for internal_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/internal_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_internal_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_internal_errors() directly. + + YANG Description: Number of internal errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """internal_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__internal_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_internal_errors(self): + self.__internal_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_blocked_tlp_errors(self): + """ + Getter method for blocked_tlp_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/blocked_tlp_errors (oc-yang:counter64) + + YANG Description: Number of blocked TLP errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + return self.__blocked_tlp_errors + + def _set_blocked_tlp_errors(self, v, load=False): + """ + Setter method for blocked_tlp_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/blocked_tlp_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_blocked_tlp_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_blocked_tlp_errors() directly. + + YANG Description: Number of blocked TLP errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="blocked-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """blocked_tlp_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="blocked-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__blocked_tlp_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_blocked_tlp_errors(self): + self.__blocked_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="blocked-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_atomic_op_blocked_errors(self): + """ + Getter method for atomic_op_blocked_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/atomic_op_blocked_errors (oc-yang:counter64) + + YANG Description: Number of atomic operation blocked errors detected by PCIe +device since the system booted, according to PCIe AER driver. + """ + return self.__atomic_op_blocked_errors + + def _set_atomic_op_blocked_errors(self, v, load=False): + """ + Setter method for atomic_op_blocked_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/atomic_op_blocked_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_atomic_op_blocked_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_atomic_op_blocked_errors() directly. + + YANG Description: Number of atomic operation blocked errors detected by PCIe +device since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="atomic-op-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """atomic_op_blocked_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="atomic-op-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__atomic_op_blocked_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_atomic_op_blocked_errors(self): + self.__atomic_op_blocked_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="atomic-op-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_tlp_prefix_blocked_errors(self): + """ + Getter method for tlp_prefix_blocked_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/tlp_prefix_blocked_errors (oc-yang:counter64) + + YANG Description: Number of TLP prefix blocked errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__tlp_prefix_blocked_errors + + def _set_tlp_prefix_blocked_errors(self, v, load=False): + """ + Setter method for tlp_prefix_blocked_errors, mapped from YANG variable /components/component/state/pcie/fatal_errors/tlp_prefix_blocked_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_tlp_prefix_blocked_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tlp_prefix_blocked_errors() directly. + + YANG Description: Number of TLP prefix blocked errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="tlp-prefix-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tlp_prefix_blocked_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="tlp-prefix-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__tlp_prefix_blocked_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_tlp_prefix_blocked_errors(self): + self.__tlp_prefix_blocked_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="tlp-prefix-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + total_errors = __builtin__.property(_get_total_errors) + undefined_errors = __builtin__.property(_get_undefined_errors) + data_link_errors = __builtin__.property(_get_data_link_errors) + surprise_down_errors = __builtin__.property(_get_surprise_down_errors) + poisoned_tlp_errors = __builtin__.property(_get_poisoned_tlp_errors) + flow_control_protocol_errors = __builtin__.property(_get_flow_control_protocol_errors) + completion_timeout_errors = __builtin__.property(_get_completion_timeout_errors) + completion_abort_errors = __builtin__.property(_get_completion_abort_errors) + unexpected_completion_errors = __builtin__.property(_get_unexpected_completion_errors) + receiver_overflow_errors = __builtin__.property(_get_receiver_overflow_errors) + malformed_tlp_errors = __builtin__.property(_get_malformed_tlp_errors) + ecrc_errors = __builtin__.property(_get_ecrc_errors) + unsupported_request_errors = __builtin__.property(_get_unsupported_request_errors) + acs_violation_errors = __builtin__.property(_get_acs_violation_errors) + internal_errors = __builtin__.property(_get_internal_errors) + blocked_tlp_errors = __builtin__.property(_get_blocked_tlp_errors) + atomic_op_blocked_errors = __builtin__.property(_get_atomic_op_blocked_errors) + tlp_prefix_blocked_errors = __builtin__.property(_get_tlp_prefix_blocked_errors) + + + _pyangbind_elements = OrderedDict([('total_errors', total_errors), ('undefined_errors', undefined_errors), ('data_link_errors', data_link_errors), ('surprise_down_errors', surprise_down_errors), ('poisoned_tlp_errors', poisoned_tlp_errors), ('flow_control_protocol_errors', flow_control_protocol_errors), ('completion_timeout_errors', completion_timeout_errors), ('completion_abort_errors', completion_abort_errors), ('unexpected_completion_errors', unexpected_completion_errors), ('receiver_overflow_errors', receiver_overflow_errors), ('malformed_tlp_errors', malformed_tlp_errors), ('ecrc_errors', ecrc_errors), ('unsupported_request_errors', unsupported_request_errors), ('acs_violation_errors', acs_violation_errors), ('internal_errors', internal_errors), ('blocked_tlp_errors', blocked_tlp_errors), ('atomic_op_blocked_errors', atomic_op_blocked_errors), ('tlp_prefix_blocked_errors', tlp_prefix_blocked_errors), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/state/pcie/non_fatal_errors/__init__.py b/hackfest/netconf-oc/openconfig/components/component/state/pcie/non_fatal_errors/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..02674f40f1f19a8023fc756bb1b2225f7750e645 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/state/pcie/non_fatal_errors/__init__.py @@ -0,0 +1,1604 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class non_fatal_errors(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/state/pcie/non-fatal-errors. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The count of the non-fatal PCIe errors. + """ + __slots__ = ('_path_helper', '_extmethods', '__total_errors','__undefined_errors','__data_link_errors','__surprise_down_errors','__poisoned_tlp_errors','__flow_control_protocol_errors','__completion_timeout_errors','__completion_abort_errors','__unexpected_completion_errors','__receiver_overflow_errors','__malformed_tlp_errors','__ecrc_errors','__unsupported_request_errors','__acs_violation_errors','__internal_errors','__blocked_tlp_errors','__atomic_op_blocked_errors','__tlp_prefix_blocked_errors',) + + _yang_name = 'non-fatal-errors' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__total_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__undefined_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="undefined-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__data_link_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="data-link-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__surprise_down_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="surprise-down-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__poisoned_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="poisoned-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__flow_control_protocol_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="flow-control-protocol-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__completion_timeout_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__completion_abort_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-abort-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__unexpected_completion_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unexpected-completion-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__receiver_overflow_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__malformed_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="malformed-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__ecrc_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="ecrc-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__unsupported_request_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unsupported-request-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__acs_violation_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="acs-violation-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__internal_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__blocked_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="blocked-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__atomic_op_blocked_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="atomic-op-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__tlp_prefix_blocked_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="tlp-prefix-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'state', 'pcie', 'non-fatal-errors'] + + def _get_total_errors(self): + """ + Getter method for total_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/total_errors (oc-yang:counter64) + + YANG Description: Total number of uncorrectable errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__total_errors + + def _set_total_errors(self, v, load=False): + """ + Setter method for total_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/total_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_total_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_total_errors() directly. + + YANG Description: Total number of uncorrectable errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """total_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__total_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_total_errors(self): + self.__total_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_undefined_errors(self): + """ + Getter method for undefined_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/undefined_errors (oc-yang:counter64) + + YANG Description: Number of undefined errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__undefined_errors + + def _set_undefined_errors(self, v, load=False): + """ + Setter method for undefined_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/undefined_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_undefined_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_undefined_errors() directly. + + YANG Description: Number of undefined errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="undefined-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """undefined_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="undefined-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__undefined_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_undefined_errors(self): + self.__undefined_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="undefined-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_data_link_errors(self): + """ + Getter method for data_link_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/data_link_errors (oc-yang:counter64) + + YANG Description: Number of data-link errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__data_link_errors + + def _set_data_link_errors(self, v, load=False): + """ + Setter method for data_link_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/data_link_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_data_link_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_data_link_errors() directly. + + YANG Description: Number of data-link errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="data-link-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """data_link_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="data-link-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__data_link_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_data_link_errors(self): + self.__data_link_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="data-link-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_surprise_down_errors(self): + """ + Getter method for surprise_down_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/surprise_down_errors (oc-yang:counter64) + + YANG Description: Number of unexpected link down errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__surprise_down_errors + + def _set_surprise_down_errors(self, v, load=False): + """ + Setter method for surprise_down_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/surprise_down_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_surprise_down_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_surprise_down_errors() directly. + + YANG Description: Number of unexpected link down errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="surprise-down-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """surprise_down_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="surprise-down-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__surprise_down_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_surprise_down_errors(self): + self.__surprise_down_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="surprise-down-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_poisoned_tlp_errors(self): + """ + Getter method for poisoned_tlp_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/poisoned_tlp_errors (oc-yang:counter64) + + YANG Description: Number of poisoned TLP errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__poisoned_tlp_errors + + def _set_poisoned_tlp_errors(self, v, load=False): + """ + Setter method for poisoned_tlp_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/poisoned_tlp_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_poisoned_tlp_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_poisoned_tlp_errors() directly. + + YANG Description: Number of poisoned TLP errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="poisoned-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """poisoned_tlp_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="poisoned-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__poisoned_tlp_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_poisoned_tlp_errors(self): + self.__poisoned_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="poisoned-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_flow_control_protocol_errors(self): + """ + Getter method for flow_control_protocol_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/flow_control_protocol_errors (oc-yang:counter64) + + YANG Description: Number of flow control protocol errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__flow_control_protocol_errors + + def _set_flow_control_protocol_errors(self, v, load=False): + """ + Setter method for flow_control_protocol_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/flow_control_protocol_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_flow_control_protocol_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_flow_control_protocol_errors() directly. + + YANG Description: Number of flow control protocol errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="flow-control-protocol-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """flow_control_protocol_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="flow-control-protocol-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__flow_control_protocol_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_flow_control_protocol_errors(self): + self.__flow_control_protocol_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="flow-control-protocol-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_completion_timeout_errors(self): + """ + Getter method for completion_timeout_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/completion_timeout_errors (oc-yang:counter64) + + YANG Description: Number of completion timeout errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__completion_timeout_errors + + def _set_completion_timeout_errors(self, v, load=False): + """ + Setter method for completion_timeout_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/completion_timeout_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_completion_timeout_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_completion_timeout_errors() directly. + + YANG Description: Number of completion timeout errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """completion_timeout_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__completion_timeout_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_completion_timeout_errors(self): + self.__completion_timeout_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_completion_abort_errors(self): + """ + Getter method for completion_abort_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/completion_abort_errors (oc-yang:counter64) + + YANG Description: Number of completion abort errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__completion_abort_errors + + def _set_completion_abort_errors(self, v, load=False): + """ + Setter method for completion_abort_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/completion_abort_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_completion_abort_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_completion_abort_errors() directly. + + YANG Description: Number of completion abort errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-abort-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """completion_abort_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-abort-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__completion_abort_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_completion_abort_errors(self): + self.__completion_abort_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-abort-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_unexpected_completion_errors(self): + """ + Getter method for unexpected_completion_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/unexpected_completion_errors (oc-yang:counter64) + + YANG Description: Number of unexpected completion errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__unexpected_completion_errors + + def _set_unexpected_completion_errors(self, v, load=False): + """ + Setter method for unexpected_completion_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/unexpected_completion_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_unexpected_completion_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unexpected_completion_errors() directly. + + YANG Description: Number of unexpected completion errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unexpected-completion-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unexpected_completion_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unexpected-completion-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__unexpected_completion_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_unexpected_completion_errors(self): + self.__unexpected_completion_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unexpected-completion-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_receiver_overflow_errors(self): + """ + Getter method for receiver_overflow_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/receiver_overflow_errors (oc-yang:counter64) + + YANG Description: Number of receiver overflow errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__receiver_overflow_errors + + def _set_receiver_overflow_errors(self, v, load=False): + """ + Setter method for receiver_overflow_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/receiver_overflow_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_receiver_overflow_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_receiver_overflow_errors() directly. + + YANG Description: Number of receiver overflow errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """receiver_overflow_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__receiver_overflow_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_receiver_overflow_errors(self): + self.__receiver_overflow_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_malformed_tlp_errors(self): + """ + Getter method for malformed_tlp_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/malformed_tlp_errors (oc-yang:counter64) + + YANG Description: Number of malformed TLP errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__malformed_tlp_errors + + def _set_malformed_tlp_errors(self, v, load=False): + """ + Setter method for malformed_tlp_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/malformed_tlp_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_malformed_tlp_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_malformed_tlp_errors() directly. + + YANG Description: Number of malformed TLP errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="malformed-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """malformed_tlp_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="malformed-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__malformed_tlp_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_malformed_tlp_errors(self): + self.__malformed_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="malformed-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_ecrc_errors(self): + """ + Getter method for ecrc_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/ecrc_errors (oc-yang:counter64) + + YANG Description: Number of ECRC errors detected by PCIe device since the system +booted, according to PCIe AER driver. + """ + return self.__ecrc_errors + + def _set_ecrc_errors(self, v, load=False): + """ + Setter method for ecrc_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/ecrc_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_ecrc_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ecrc_errors() directly. + + YANG Description: Number of ECRC errors detected by PCIe device since the system +booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="ecrc-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ecrc_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="ecrc-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__ecrc_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_ecrc_errors(self): + self.__ecrc_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="ecrc-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_unsupported_request_errors(self): + """ + Getter method for unsupported_request_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/unsupported_request_errors (oc-yang:counter64) + + YANG Description: Number of unsupported request errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__unsupported_request_errors + + def _set_unsupported_request_errors(self, v, load=False): + """ + Setter method for unsupported_request_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/unsupported_request_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_unsupported_request_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unsupported_request_errors() directly. + + YANG Description: Number of unsupported request errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unsupported-request-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unsupported_request_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unsupported-request-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__unsupported_request_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_unsupported_request_errors(self): + self.__unsupported_request_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unsupported-request-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_acs_violation_errors(self): + """ + Getter method for acs_violation_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/acs_violation_errors (oc-yang:counter64) + + YANG Description: Number of access control errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + return self.__acs_violation_errors + + def _set_acs_violation_errors(self, v, load=False): + """ + Setter method for acs_violation_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/acs_violation_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_acs_violation_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_acs_violation_errors() directly. + + YANG Description: Number of access control errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="acs-violation-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """acs_violation_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="acs-violation-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__acs_violation_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_acs_violation_errors(self): + self.__acs_violation_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="acs-violation-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_internal_errors(self): + """ + Getter method for internal_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/internal_errors (oc-yang:counter64) + + YANG Description: Number of internal errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__internal_errors + + def _set_internal_errors(self, v, load=False): + """ + Setter method for internal_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/internal_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_internal_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_internal_errors() directly. + + YANG Description: Number of internal errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """internal_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__internal_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_internal_errors(self): + self.__internal_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_blocked_tlp_errors(self): + """ + Getter method for blocked_tlp_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/blocked_tlp_errors (oc-yang:counter64) + + YANG Description: Number of blocked TLP errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + return self.__blocked_tlp_errors + + def _set_blocked_tlp_errors(self, v, load=False): + """ + Setter method for blocked_tlp_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/blocked_tlp_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_blocked_tlp_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_blocked_tlp_errors() directly. + + YANG Description: Number of blocked TLP errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="blocked-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """blocked_tlp_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="blocked-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__blocked_tlp_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_blocked_tlp_errors(self): + self.__blocked_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="blocked-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_atomic_op_blocked_errors(self): + """ + Getter method for atomic_op_blocked_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/atomic_op_blocked_errors (oc-yang:counter64) + + YANG Description: Number of atomic operation blocked errors detected by PCIe +device since the system booted, according to PCIe AER driver. + """ + return self.__atomic_op_blocked_errors + + def _set_atomic_op_blocked_errors(self, v, load=False): + """ + Setter method for atomic_op_blocked_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/atomic_op_blocked_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_atomic_op_blocked_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_atomic_op_blocked_errors() directly. + + YANG Description: Number of atomic operation blocked errors detected by PCIe +device since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="atomic-op-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """atomic_op_blocked_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="atomic-op-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__atomic_op_blocked_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_atomic_op_blocked_errors(self): + self.__atomic_op_blocked_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="atomic-op-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_tlp_prefix_blocked_errors(self): + """ + Getter method for tlp_prefix_blocked_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/tlp_prefix_blocked_errors (oc-yang:counter64) + + YANG Description: Number of TLP prefix blocked errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__tlp_prefix_blocked_errors + + def _set_tlp_prefix_blocked_errors(self, v, load=False): + """ + Setter method for tlp_prefix_blocked_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/tlp_prefix_blocked_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_tlp_prefix_blocked_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tlp_prefix_blocked_errors() directly. + + YANG Description: Number of TLP prefix blocked errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="tlp-prefix-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tlp_prefix_blocked_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="tlp-prefix-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__tlp_prefix_blocked_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_tlp_prefix_blocked_errors(self): + self.__tlp_prefix_blocked_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="tlp-prefix-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + total_errors = __builtin__.property(_get_total_errors) + undefined_errors = __builtin__.property(_get_undefined_errors) + data_link_errors = __builtin__.property(_get_data_link_errors) + surprise_down_errors = __builtin__.property(_get_surprise_down_errors) + poisoned_tlp_errors = __builtin__.property(_get_poisoned_tlp_errors) + flow_control_protocol_errors = __builtin__.property(_get_flow_control_protocol_errors) + completion_timeout_errors = __builtin__.property(_get_completion_timeout_errors) + completion_abort_errors = __builtin__.property(_get_completion_abort_errors) + unexpected_completion_errors = __builtin__.property(_get_unexpected_completion_errors) + receiver_overflow_errors = __builtin__.property(_get_receiver_overflow_errors) + malformed_tlp_errors = __builtin__.property(_get_malformed_tlp_errors) + ecrc_errors = __builtin__.property(_get_ecrc_errors) + unsupported_request_errors = __builtin__.property(_get_unsupported_request_errors) + acs_violation_errors = __builtin__.property(_get_acs_violation_errors) + internal_errors = __builtin__.property(_get_internal_errors) + blocked_tlp_errors = __builtin__.property(_get_blocked_tlp_errors) + atomic_op_blocked_errors = __builtin__.property(_get_atomic_op_blocked_errors) + tlp_prefix_blocked_errors = __builtin__.property(_get_tlp_prefix_blocked_errors) + + + _pyangbind_elements = OrderedDict([('total_errors', total_errors), ('undefined_errors', undefined_errors), ('data_link_errors', data_link_errors), ('surprise_down_errors', surprise_down_errors), ('poisoned_tlp_errors', poisoned_tlp_errors), ('flow_control_protocol_errors', flow_control_protocol_errors), ('completion_timeout_errors', completion_timeout_errors), ('completion_abort_errors', completion_abort_errors), ('unexpected_completion_errors', unexpected_completion_errors), ('receiver_overflow_errors', receiver_overflow_errors), ('malformed_tlp_errors', malformed_tlp_errors), ('ecrc_errors', ecrc_errors), ('unsupported_request_errors', unsupported_request_errors), ('acs_violation_errors', acs_violation_errors), ('internal_errors', internal_errors), ('blocked_tlp_errors', blocked_tlp_errors), ('atomic_op_blocked_errors', atomic_op_blocked_errors), ('tlp_prefix_blocked_errors', tlp_prefix_blocked_errors), ]) + + +class non_fatal_errors(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/state/pcie/non-fatal-errors. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The count of the non-fatal PCIe errors. + """ + __slots__ = ('_path_helper', '_extmethods', '__total_errors','__undefined_errors','__data_link_errors','__surprise_down_errors','__poisoned_tlp_errors','__flow_control_protocol_errors','__completion_timeout_errors','__completion_abort_errors','__unexpected_completion_errors','__receiver_overflow_errors','__malformed_tlp_errors','__ecrc_errors','__unsupported_request_errors','__acs_violation_errors','__internal_errors','__blocked_tlp_errors','__atomic_op_blocked_errors','__tlp_prefix_blocked_errors',) + + _yang_name = 'non-fatal-errors' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__total_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__undefined_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="undefined-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__data_link_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="data-link-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__surprise_down_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="surprise-down-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__poisoned_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="poisoned-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__flow_control_protocol_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="flow-control-protocol-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__completion_timeout_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__completion_abort_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-abort-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__unexpected_completion_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unexpected-completion-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__receiver_overflow_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__malformed_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="malformed-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__ecrc_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="ecrc-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__unsupported_request_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unsupported-request-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__acs_violation_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="acs-violation-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__internal_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__blocked_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="blocked-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__atomic_op_blocked_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="atomic-op-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + self.__tlp_prefix_blocked_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="tlp-prefix-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'state', 'pcie', 'non-fatal-errors'] + + def _get_total_errors(self): + """ + Getter method for total_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/total_errors (oc-yang:counter64) + + YANG Description: Total number of uncorrectable errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__total_errors + + def _set_total_errors(self, v, load=False): + """ + Setter method for total_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/total_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_total_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_total_errors() directly. + + YANG Description: Total number of uncorrectable errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """total_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__total_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_total_errors(self): + self.__total_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="total-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_undefined_errors(self): + """ + Getter method for undefined_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/undefined_errors (oc-yang:counter64) + + YANG Description: Number of undefined errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__undefined_errors + + def _set_undefined_errors(self, v, load=False): + """ + Setter method for undefined_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/undefined_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_undefined_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_undefined_errors() directly. + + YANG Description: Number of undefined errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="undefined-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """undefined_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="undefined-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__undefined_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_undefined_errors(self): + self.__undefined_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="undefined-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_data_link_errors(self): + """ + Getter method for data_link_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/data_link_errors (oc-yang:counter64) + + YANG Description: Number of data-link errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__data_link_errors + + def _set_data_link_errors(self, v, load=False): + """ + Setter method for data_link_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/data_link_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_data_link_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_data_link_errors() directly. + + YANG Description: Number of data-link errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="data-link-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """data_link_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="data-link-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__data_link_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_data_link_errors(self): + self.__data_link_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="data-link-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_surprise_down_errors(self): + """ + Getter method for surprise_down_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/surprise_down_errors (oc-yang:counter64) + + YANG Description: Number of unexpected link down errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__surprise_down_errors + + def _set_surprise_down_errors(self, v, load=False): + """ + Setter method for surprise_down_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/surprise_down_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_surprise_down_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_surprise_down_errors() directly. + + YANG Description: Number of unexpected link down errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="surprise-down-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """surprise_down_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="surprise-down-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__surprise_down_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_surprise_down_errors(self): + self.__surprise_down_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="surprise-down-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_poisoned_tlp_errors(self): + """ + Getter method for poisoned_tlp_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/poisoned_tlp_errors (oc-yang:counter64) + + YANG Description: Number of poisoned TLP errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__poisoned_tlp_errors + + def _set_poisoned_tlp_errors(self, v, load=False): + """ + Setter method for poisoned_tlp_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/poisoned_tlp_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_poisoned_tlp_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_poisoned_tlp_errors() directly. + + YANG Description: Number of poisoned TLP errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="poisoned-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """poisoned_tlp_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="poisoned-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__poisoned_tlp_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_poisoned_tlp_errors(self): + self.__poisoned_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="poisoned-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_flow_control_protocol_errors(self): + """ + Getter method for flow_control_protocol_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/flow_control_protocol_errors (oc-yang:counter64) + + YANG Description: Number of flow control protocol errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__flow_control_protocol_errors + + def _set_flow_control_protocol_errors(self, v, load=False): + """ + Setter method for flow_control_protocol_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/flow_control_protocol_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_flow_control_protocol_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_flow_control_protocol_errors() directly. + + YANG Description: Number of flow control protocol errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="flow-control-protocol-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """flow_control_protocol_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="flow-control-protocol-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__flow_control_protocol_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_flow_control_protocol_errors(self): + self.__flow_control_protocol_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="flow-control-protocol-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_completion_timeout_errors(self): + """ + Getter method for completion_timeout_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/completion_timeout_errors (oc-yang:counter64) + + YANG Description: Number of completion timeout errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__completion_timeout_errors + + def _set_completion_timeout_errors(self, v, load=False): + """ + Setter method for completion_timeout_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/completion_timeout_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_completion_timeout_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_completion_timeout_errors() directly. + + YANG Description: Number of completion timeout errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """completion_timeout_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__completion_timeout_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_completion_timeout_errors(self): + self.__completion_timeout_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-timeout-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_completion_abort_errors(self): + """ + Getter method for completion_abort_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/completion_abort_errors (oc-yang:counter64) + + YANG Description: Number of completion abort errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__completion_abort_errors + + def _set_completion_abort_errors(self, v, load=False): + """ + Setter method for completion_abort_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/completion_abort_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_completion_abort_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_completion_abort_errors() directly. + + YANG Description: Number of completion abort errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-abort-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """completion_abort_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-abort-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__completion_abort_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_completion_abort_errors(self): + self.__completion_abort_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="completion-abort-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_unexpected_completion_errors(self): + """ + Getter method for unexpected_completion_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/unexpected_completion_errors (oc-yang:counter64) + + YANG Description: Number of unexpected completion errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__unexpected_completion_errors + + def _set_unexpected_completion_errors(self, v, load=False): + """ + Setter method for unexpected_completion_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/unexpected_completion_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_unexpected_completion_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unexpected_completion_errors() directly. + + YANG Description: Number of unexpected completion errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unexpected-completion-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unexpected_completion_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unexpected-completion-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__unexpected_completion_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_unexpected_completion_errors(self): + self.__unexpected_completion_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unexpected-completion-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_receiver_overflow_errors(self): + """ + Getter method for receiver_overflow_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/receiver_overflow_errors (oc-yang:counter64) + + YANG Description: Number of receiver overflow errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__receiver_overflow_errors + + def _set_receiver_overflow_errors(self, v, load=False): + """ + Setter method for receiver_overflow_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/receiver_overflow_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_receiver_overflow_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_receiver_overflow_errors() directly. + + YANG Description: Number of receiver overflow errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """receiver_overflow_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__receiver_overflow_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_receiver_overflow_errors(self): + self.__receiver_overflow_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="receiver-overflow-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_malformed_tlp_errors(self): + """ + Getter method for malformed_tlp_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/malformed_tlp_errors (oc-yang:counter64) + + YANG Description: Number of malformed TLP errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__malformed_tlp_errors + + def _set_malformed_tlp_errors(self, v, load=False): + """ + Setter method for malformed_tlp_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/malformed_tlp_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_malformed_tlp_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_malformed_tlp_errors() directly. + + YANG Description: Number of malformed TLP errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="malformed-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """malformed_tlp_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="malformed-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__malformed_tlp_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_malformed_tlp_errors(self): + self.__malformed_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="malformed-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_ecrc_errors(self): + """ + Getter method for ecrc_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/ecrc_errors (oc-yang:counter64) + + YANG Description: Number of ECRC errors detected by PCIe device since the system +booted, according to PCIe AER driver. + """ + return self.__ecrc_errors + + def _set_ecrc_errors(self, v, load=False): + """ + Setter method for ecrc_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/ecrc_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_ecrc_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ecrc_errors() directly. + + YANG Description: Number of ECRC errors detected by PCIe device since the system +booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="ecrc-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ecrc_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="ecrc-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__ecrc_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_ecrc_errors(self): + self.__ecrc_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="ecrc-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_unsupported_request_errors(self): + """ + Getter method for unsupported_request_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/unsupported_request_errors (oc-yang:counter64) + + YANG Description: Number of unsupported request errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__unsupported_request_errors + + def _set_unsupported_request_errors(self, v, load=False): + """ + Setter method for unsupported_request_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/unsupported_request_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_unsupported_request_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_unsupported_request_errors() directly. + + YANG Description: Number of unsupported request errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unsupported-request-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """unsupported_request_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unsupported-request-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__unsupported_request_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_unsupported_request_errors(self): + self.__unsupported_request_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="unsupported-request-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_acs_violation_errors(self): + """ + Getter method for acs_violation_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/acs_violation_errors (oc-yang:counter64) + + YANG Description: Number of access control errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + return self.__acs_violation_errors + + def _set_acs_violation_errors(self, v, load=False): + """ + Setter method for acs_violation_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/acs_violation_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_acs_violation_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_acs_violation_errors() directly. + + YANG Description: Number of access control errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="acs-violation-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """acs_violation_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="acs-violation-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__acs_violation_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_acs_violation_errors(self): + self.__acs_violation_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="acs-violation-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_internal_errors(self): + """ + Getter method for internal_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/internal_errors (oc-yang:counter64) + + YANG Description: Number of internal errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + return self.__internal_errors + + def _set_internal_errors(self, v, load=False): + """ + Setter method for internal_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/internal_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_internal_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_internal_errors() directly. + + YANG Description: Number of internal errors detected by PCIe device since the +system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """internal_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__internal_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_internal_errors(self): + self.__internal_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="internal-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_blocked_tlp_errors(self): + """ + Getter method for blocked_tlp_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/blocked_tlp_errors (oc-yang:counter64) + + YANG Description: Number of blocked TLP errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + return self.__blocked_tlp_errors + + def _set_blocked_tlp_errors(self, v, load=False): + """ + Setter method for blocked_tlp_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/blocked_tlp_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_blocked_tlp_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_blocked_tlp_errors() directly. + + YANG Description: Number of blocked TLP errors detected by PCIe device since +the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="blocked-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """blocked_tlp_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="blocked-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__blocked_tlp_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_blocked_tlp_errors(self): + self.__blocked_tlp_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="blocked-tlp-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_atomic_op_blocked_errors(self): + """ + Getter method for atomic_op_blocked_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/atomic_op_blocked_errors (oc-yang:counter64) + + YANG Description: Number of atomic operation blocked errors detected by PCIe +device since the system booted, according to PCIe AER driver. + """ + return self.__atomic_op_blocked_errors + + def _set_atomic_op_blocked_errors(self, v, load=False): + """ + Setter method for atomic_op_blocked_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/atomic_op_blocked_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_atomic_op_blocked_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_atomic_op_blocked_errors() directly. + + YANG Description: Number of atomic operation blocked errors detected by PCIe +device since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="atomic-op-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """atomic_op_blocked_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="atomic-op-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__atomic_op_blocked_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_atomic_op_blocked_errors(self): + self.__atomic_op_blocked_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="atomic-op-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + + def _get_tlp_prefix_blocked_errors(self): + """ + Getter method for tlp_prefix_blocked_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/tlp_prefix_blocked_errors (oc-yang:counter64) + + YANG Description: Number of TLP prefix blocked errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + return self.__tlp_prefix_blocked_errors + + def _set_tlp_prefix_blocked_errors(self, v, load=False): + """ + Setter method for tlp_prefix_blocked_errors, mapped from YANG variable /components/component/state/pcie/non_fatal_errors/tlp_prefix_blocked_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_tlp_prefix_blocked_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_tlp_prefix_blocked_errors() directly. + + YANG Description: Number of TLP prefix blocked errors detected by PCIe device +since the system booted, according to PCIe AER driver. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="tlp-prefix-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """tlp_prefix_blocked_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="tlp-prefix-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__tlp_prefix_blocked_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_tlp_prefix_blocked_errors(self): + self.__tlp_prefix_blocked_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="tlp-prefix-blocked-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-yang:counter64', is_config=False) + + total_errors = __builtin__.property(_get_total_errors) + undefined_errors = __builtin__.property(_get_undefined_errors) + data_link_errors = __builtin__.property(_get_data_link_errors) + surprise_down_errors = __builtin__.property(_get_surprise_down_errors) + poisoned_tlp_errors = __builtin__.property(_get_poisoned_tlp_errors) + flow_control_protocol_errors = __builtin__.property(_get_flow_control_protocol_errors) + completion_timeout_errors = __builtin__.property(_get_completion_timeout_errors) + completion_abort_errors = __builtin__.property(_get_completion_abort_errors) + unexpected_completion_errors = __builtin__.property(_get_unexpected_completion_errors) + receiver_overflow_errors = __builtin__.property(_get_receiver_overflow_errors) + malformed_tlp_errors = __builtin__.property(_get_malformed_tlp_errors) + ecrc_errors = __builtin__.property(_get_ecrc_errors) + unsupported_request_errors = __builtin__.property(_get_unsupported_request_errors) + acs_violation_errors = __builtin__.property(_get_acs_violation_errors) + internal_errors = __builtin__.property(_get_internal_errors) + blocked_tlp_errors = __builtin__.property(_get_blocked_tlp_errors) + atomic_op_blocked_errors = __builtin__.property(_get_atomic_op_blocked_errors) + tlp_prefix_blocked_errors = __builtin__.property(_get_tlp_prefix_blocked_errors) + + + _pyangbind_elements = OrderedDict([('total_errors', total_errors), ('undefined_errors', undefined_errors), ('data_link_errors', data_link_errors), ('surprise_down_errors', surprise_down_errors), ('poisoned_tlp_errors', poisoned_tlp_errors), ('flow_control_protocol_errors', flow_control_protocol_errors), ('completion_timeout_errors', completion_timeout_errors), ('completion_abort_errors', completion_abort_errors), ('unexpected_completion_errors', unexpected_completion_errors), ('receiver_overflow_errors', receiver_overflow_errors), ('malformed_tlp_errors', malformed_tlp_errors), ('ecrc_errors', ecrc_errors), ('unsupported_request_errors', unsupported_request_errors), ('acs_violation_errors', acs_violation_errors), ('internal_errors', internal_errors), ('blocked_tlp_errors', blocked_tlp_errors), ('atomic_op_blocked_errors', atomic_op_blocked_errors), ('tlp_prefix_blocked_errors', tlp_prefix_blocked_errors), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/state/temperature/__init__.py b/hackfest/netconf-oc/openconfig/components/component/state/temperature/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..426d8a1d75604540a04fc92ab9494d9cd330434e --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/state/temperature/__init__.py @@ -0,0 +1,958 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class temperature(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/state/temperature. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Temperature in degrees Celsius of the component. Values include +the instantaneous, average, minimum, and maximum statistics. If +avg/min/max statistics are not supported, the target is expected +to just supply the instant value + """ + __slots__ = ('_path_helper', '_extmethods', '__instant','__avg','__min_','__max_','__interval','__min_time','__max_time','__alarm_status','__alarm_threshold','__alarm_severity',) + + _yang_name = 'temperature' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__instant = YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="instant", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + self.__avg = YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="avg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + self.__min_ = YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="min", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + self.__max_ = YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="max", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + self.__interval = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:stat-interval', is_config=False) + self.__min_time = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="min-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + self.__max_time = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + self.__alarm_status = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="alarm-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + self.__alarm_threshold = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="alarm-threshold", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False) + self.__alarm_severity = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UNKNOWN': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:UNKNOWN': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'MINOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:MINOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'WARNING': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:WARNING': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'MAJOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:MAJOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'CRITICAL': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:CRITICAL': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}},), is_leaf=True, yang_name="alarm-severity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'state', 'temperature'] + + def _get_instant(self): + """ + Getter method for instant, mapped from YANG variable /components/component/state/temperature/instant (decimal64) + + YANG Description: The instantaneous value of the statistic. + """ + return self.__instant + + def _set_instant(self, v, load=False): + """ + Setter method for instant, mapped from YANG variable /components/component/state/temperature/instant (decimal64) + If this variable is read-only (config: false) in the + source YANG file, then _set_instant is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_instant() directly. + + YANG Description: The instantaneous value of the statistic. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="instant", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """instant must be of a type compatible with decimal64""", + 'defined-type': "decimal64", + 'generated-type': """YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="instant", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False)""", + }) + + self.__instant = t + if hasattr(self, '_set'): + self._set() + + def _unset_instant(self): + self.__instant = YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="instant", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + + + def _get_avg(self): + """ + Getter method for avg, mapped from YANG variable /components/component/state/temperature/avg (decimal64) + + YANG Description: The arithmetic mean value of the statistic over the +sampling period. + """ + return self.__avg + + def _set_avg(self, v, load=False): + """ + Setter method for avg, mapped from YANG variable /components/component/state/temperature/avg (decimal64) + If this variable is read-only (config: false) in the + source YANG file, then _set_avg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_avg() directly. + + YANG Description: The arithmetic mean value of the statistic over the +sampling period. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="avg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """avg must be of a type compatible with decimal64""", + 'defined-type': "decimal64", + 'generated-type': """YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="avg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False)""", + }) + + self.__avg = t + if hasattr(self, '_set'): + self._set() + + def _unset_avg(self): + self.__avg = YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="avg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + + + def _get_min_(self): + """ + Getter method for min_, mapped from YANG variable /components/component/state/temperature/min (decimal64) + + YANG Description: The minimum value of the statistic over the sampling +period + """ + return self.__min_ + + def _set_min_(self, v, load=False): + """ + Setter method for min_, mapped from YANG variable /components/component/state/temperature/min (decimal64) + If this variable is read-only (config: false) in the + source YANG file, then _set_min_ is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_min_() directly. + + YANG Description: The minimum value of the statistic over the sampling +period + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="min", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """min_ must be of a type compatible with decimal64""", + 'defined-type': "decimal64", + 'generated-type': """YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="min", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False)""", + }) + + self.__min_ = t + if hasattr(self, '_set'): + self._set() + + def _unset_min_(self): + self.__min_ = YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="min", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + + + def _get_max_(self): + """ + Getter method for max_, mapped from YANG variable /components/component/state/temperature/max (decimal64) + + YANG Description: The maximum value of the statistic over the sampling +period + """ + return self.__max_ + + def _set_max_(self, v, load=False): + """ + Setter method for max_, mapped from YANG variable /components/component/state/temperature/max (decimal64) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_ is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_() directly. + + YANG Description: The maximum value of the statistic over the sampling +period + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="max", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_ must be of a type compatible with decimal64""", + 'defined-type': "decimal64", + 'generated-type': """YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="max", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False)""", + }) + + self.__max_ = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_(self): + self.__max_ = YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="max", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + + + def _get_interval(self): + """ + Getter method for interval, mapped from YANG variable /components/component/state/temperature/interval (oc-types:stat-interval) + + YANG Description: If supported by the system, this reports the time interval +over which the min/max/average statistics are computed by +the system. + """ + return self.__interval + + def _set_interval(self, v, load=False): + """ + Setter method for interval, mapped from YANG variable /components/component/state/temperature/interval (oc-types:stat-interval) + If this variable is read-only (config: false) in the + source YANG file, then _set_interval is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_interval() directly. + + YANG Description: If supported by the system, this reports the time interval +over which the min/max/average statistics are computed by +the system. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:stat-interval', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """interval must be of a type compatible with oc-types:stat-interval""", + 'defined-type': "oc-types:stat-interval", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:stat-interval', is_config=False)""", + }) + + self.__interval = t + if hasattr(self, '_set'): + self._set() + + def _unset_interval(self): + self.__interval = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:stat-interval', is_config=False) + + + def _get_min_time(self): + """ + Getter method for min_time, mapped from YANG variable /components/component/state/temperature/min_time (oc-types:timeticks64) + + YANG Description: The absolute time at which the minimum value occurred. +The value is the timestamp in nanoseconds relative to + the Unix Epoch (Jan 1, 1970 00:00:00 UTC). + """ + return self.__min_time + + def _set_min_time(self, v, load=False): + """ + Setter method for min_time, mapped from YANG variable /components/component/state/temperature/min_time (oc-types:timeticks64) + If this variable is read-only (config: false) in the + source YANG file, then _set_min_time is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_min_time() directly. + + YANG Description: The absolute time at which the minimum value occurred. +The value is the timestamp in nanoseconds relative to + the Unix Epoch (Jan 1, 1970 00:00:00 UTC). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="min-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """min_time must be of a type compatible with oc-types:timeticks64""", + 'defined-type': "oc-types:timeticks64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="min-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False)""", + }) + + self.__min_time = t + if hasattr(self, '_set'): + self._set() + + def _unset_min_time(self): + self.__min_time = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="min-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + + + def _get_max_time(self): + """ + Getter method for max_time, mapped from YANG variable /components/component/state/temperature/max_time (oc-types:timeticks64) + + YANG Description: The absolute time at which the maximum value occurred. +The value is the timestamp in nanoseconds relative to + the Unix Epoch (Jan 1, 1970 00:00:00 UTC). + """ + return self.__max_time + + def _set_max_time(self, v, load=False): + """ + Setter method for max_time, mapped from YANG variable /components/component/state/temperature/max_time (oc-types:timeticks64) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_time is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_time() directly. + + YANG Description: The absolute time at which the maximum value occurred. +The value is the timestamp in nanoseconds relative to + the Unix Epoch (Jan 1, 1970 00:00:00 UTC). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_time must be of a type compatible with oc-types:timeticks64""", + 'defined-type': "oc-types:timeticks64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False)""", + }) + + self.__max_time = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_time(self): + self.__max_time = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + + + def _get_alarm_status(self): + """ + Getter method for alarm_status, mapped from YANG variable /components/component/state/temperature/alarm_status (boolean) + + YANG Description: A value of true indicates the alarm has been raised or +asserted. The value should be false when the alarm is +cleared. + """ + return self.__alarm_status + + def _set_alarm_status(self, v, load=False): + """ + Setter method for alarm_status, mapped from YANG variable /components/component/state/temperature/alarm_status (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_alarm_status is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_alarm_status() directly. + + YANG Description: A value of true indicates the alarm has been raised or +asserted. The value should be false when the alarm is +cleared. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="alarm-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """alarm_status must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="alarm-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False)""", + }) + + self.__alarm_status = t + if hasattr(self, '_set'): + self._set() + + def _unset_alarm_status(self): + self.__alarm_status = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="alarm-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + + + def _get_alarm_threshold(self): + """ + Getter method for alarm_threshold, mapped from YANG variable /components/component/state/temperature/alarm_threshold (uint32) + + YANG Description: The threshold value that was crossed for this alarm. + """ + return self.__alarm_threshold + + def _set_alarm_threshold(self, v, load=False): + """ + Setter method for alarm_threshold, mapped from YANG variable /components/component/state/temperature/alarm_threshold (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_alarm_threshold is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_alarm_threshold() directly. + + YANG Description: The threshold value that was crossed for this alarm. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="alarm-threshold", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """alarm_threshold must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="alarm-threshold", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False)""", + }) + + self.__alarm_threshold = t + if hasattr(self, '_set'): + self._set() + + def _unset_alarm_threshold(self): + self.__alarm_threshold = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="alarm-threshold", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False) + + + def _get_alarm_severity(self): + """ + Getter method for alarm_severity, mapped from YANG variable /components/component/state/temperature/alarm_severity (identityref) + + YANG Description: The severity of the current alarm. + """ + return self.__alarm_severity + + def _set_alarm_severity(self, v, load=False): + """ + Setter method for alarm_severity, mapped from YANG variable /components/component/state/temperature/alarm_severity (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_alarm_severity is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_alarm_severity() directly. + + YANG Description: The severity of the current alarm. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UNKNOWN': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:UNKNOWN': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'MINOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:MINOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'WARNING': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:WARNING': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'MAJOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:MAJOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'CRITICAL': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:CRITICAL': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}},), is_leaf=True, yang_name="alarm-severity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """alarm_severity must be of a type compatible with identityref""", + 'defined-type': "openconfig-platform:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UNKNOWN': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:UNKNOWN': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'MINOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:MINOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'WARNING': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:WARNING': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'MAJOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:MAJOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'CRITICAL': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:CRITICAL': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}},), is_leaf=True, yang_name="alarm-severity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False)""", + }) + + self.__alarm_severity = t + if hasattr(self, '_set'): + self._set() + + def _unset_alarm_severity(self): + self.__alarm_severity = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UNKNOWN': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:UNKNOWN': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'MINOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:MINOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'WARNING': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:WARNING': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'MAJOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:MAJOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'CRITICAL': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:CRITICAL': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}},), is_leaf=True, yang_name="alarm-severity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False) + + instant = __builtin__.property(_get_instant) + avg = __builtin__.property(_get_avg) + min_ = __builtin__.property(_get_min_) + max_ = __builtin__.property(_get_max_) + interval = __builtin__.property(_get_interval) + min_time = __builtin__.property(_get_min_time) + max_time = __builtin__.property(_get_max_time) + alarm_status = __builtin__.property(_get_alarm_status) + alarm_threshold = __builtin__.property(_get_alarm_threshold) + alarm_severity = __builtin__.property(_get_alarm_severity) + + + _pyangbind_elements = OrderedDict([('instant', instant), ('avg', avg), ('min_', min_), ('max_', max_), ('interval', interval), ('min_time', min_time), ('max_time', max_time), ('alarm_status', alarm_status), ('alarm_threshold', alarm_threshold), ('alarm_severity', alarm_severity), ]) + + +class temperature(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/state/temperature. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Temperature in degrees Celsius of the component. Values include +the instantaneous, average, minimum, and maximum statistics. If +avg/min/max statistics are not supported, the target is expected +to just supply the instant value + """ + __slots__ = ('_path_helper', '_extmethods', '__instant','__avg','__min_','__max_','__interval','__min_time','__max_time','__alarm_status','__alarm_threshold','__alarm_severity',) + + _yang_name = 'temperature' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__instant = YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="instant", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + self.__avg = YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="avg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + self.__min_ = YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="min", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + self.__max_ = YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="max", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + self.__interval = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:stat-interval', is_config=False) + self.__min_time = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="min-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + self.__max_time = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + self.__alarm_status = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="alarm-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + self.__alarm_threshold = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="alarm-threshold", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False) + self.__alarm_severity = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UNKNOWN': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:UNKNOWN': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'MINOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:MINOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'WARNING': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:WARNING': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'MAJOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:MAJOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'CRITICAL': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:CRITICAL': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}},), is_leaf=True, yang_name="alarm-severity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'state', 'temperature'] + + def _get_instant(self): + """ + Getter method for instant, mapped from YANG variable /components/component/state/temperature/instant (decimal64) + + YANG Description: The instantaneous value of the statistic. + """ + return self.__instant + + def _set_instant(self, v, load=False): + """ + Setter method for instant, mapped from YANG variable /components/component/state/temperature/instant (decimal64) + If this variable is read-only (config: false) in the + source YANG file, then _set_instant is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_instant() directly. + + YANG Description: The instantaneous value of the statistic. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="instant", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """instant must be of a type compatible with decimal64""", + 'defined-type': "decimal64", + 'generated-type': """YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="instant", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False)""", + }) + + self.__instant = t + if hasattr(self, '_set'): + self._set() + + def _unset_instant(self): + self.__instant = YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="instant", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + + + def _get_avg(self): + """ + Getter method for avg, mapped from YANG variable /components/component/state/temperature/avg (decimal64) + + YANG Description: The arithmetic mean value of the statistic over the +sampling period. + """ + return self.__avg + + def _set_avg(self, v, load=False): + """ + Setter method for avg, mapped from YANG variable /components/component/state/temperature/avg (decimal64) + If this variable is read-only (config: false) in the + source YANG file, then _set_avg is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_avg() directly. + + YANG Description: The arithmetic mean value of the statistic over the +sampling period. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="avg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """avg must be of a type compatible with decimal64""", + 'defined-type': "decimal64", + 'generated-type': """YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="avg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False)""", + }) + + self.__avg = t + if hasattr(self, '_set'): + self._set() + + def _unset_avg(self): + self.__avg = YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="avg", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + + + def _get_min_(self): + """ + Getter method for min_, mapped from YANG variable /components/component/state/temperature/min (decimal64) + + YANG Description: The minimum value of the statistic over the sampling +period + """ + return self.__min_ + + def _set_min_(self, v, load=False): + """ + Setter method for min_, mapped from YANG variable /components/component/state/temperature/min (decimal64) + If this variable is read-only (config: false) in the + source YANG file, then _set_min_ is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_min_() directly. + + YANG Description: The minimum value of the statistic over the sampling +period + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="min", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """min_ must be of a type compatible with decimal64""", + 'defined-type': "decimal64", + 'generated-type': """YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="min", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False)""", + }) + + self.__min_ = t + if hasattr(self, '_set'): + self._set() + + def _unset_min_(self): + self.__min_ = YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="min", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + + + def _get_max_(self): + """ + Getter method for max_, mapped from YANG variable /components/component/state/temperature/max (decimal64) + + YANG Description: The maximum value of the statistic over the sampling +period + """ + return self.__max_ + + def _set_max_(self, v, load=False): + """ + Setter method for max_, mapped from YANG variable /components/component/state/temperature/max (decimal64) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_ is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_() directly. + + YANG Description: The maximum value of the statistic over the sampling +period + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="max", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_ must be of a type compatible with decimal64""", + 'defined-type': "decimal64", + 'generated-type': """YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="max", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False)""", + }) + + self.__max_ = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_(self): + self.__max_ = YANGDynClass(base=RestrictedPrecisionDecimalType(precision=1), is_leaf=True, yang_name="max", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='decimal64', is_config=False) + + + def _get_interval(self): + """ + Getter method for interval, mapped from YANG variable /components/component/state/temperature/interval (oc-types:stat-interval) + + YANG Description: If supported by the system, this reports the time interval +over which the min/max/average statistics are computed by +the system. + """ + return self.__interval + + def _set_interval(self, v, load=False): + """ + Setter method for interval, mapped from YANG variable /components/component/state/temperature/interval (oc-types:stat-interval) + If this variable is read-only (config: false) in the + source YANG file, then _set_interval is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_interval() directly. + + YANG Description: If supported by the system, this reports the time interval +over which the min/max/average statistics are computed by +the system. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:stat-interval', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """interval must be of a type compatible with oc-types:stat-interval""", + 'defined-type': "oc-types:stat-interval", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:stat-interval', is_config=False)""", + }) + + self.__interval = t + if hasattr(self, '_set'): + self._set() + + def _unset_interval(self): + self.__interval = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="interval", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:stat-interval', is_config=False) + + + def _get_min_time(self): + """ + Getter method for min_time, mapped from YANG variable /components/component/state/temperature/min_time (oc-types:timeticks64) + + YANG Description: The absolute time at which the minimum value occurred. +The value is the timestamp in nanoseconds relative to + the Unix Epoch (Jan 1, 1970 00:00:00 UTC). + """ + return self.__min_time + + def _set_min_time(self, v, load=False): + """ + Setter method for min_time, mapped from YANG variable /components/component/state/temperature/min_time (oc-types:timeticks64) + If this variable is read-only (config: false) in the + source YANG file, then _set_min_time is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_min_time() directly. + + YANG Description: The absolute time at which the minimum value occurred. +The value is the timestamp in nanoseconds relative to + the Unix Epoch (Jan 1, 1970 00:00:00 UTC). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="min-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """min_time must be of a type compatible with oc-types:timeticks64""", + 'defined-type': "oc-types:timeticks64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="min-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False)""", + }) + + self.__min_time = t + if hasattr(self, '_set'): + self._set() + + def _unset_min_time(self): + self.__min_time = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="min-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + + + def _get_max_time(self): + """ + Getter method for max_time, mapped from YANG variable /components/component/state/temperature/max_time (oc-types:timeticks64) + + YANG Description: The absolute time at which the maximum value occurred. +The value is the timestamp in nanoseconds relative to + the Unix Epoch (Jan 1, 1970 00:00:00 UTC). + """ + return self.__max_time + + def _set_max_time(self, v, load=False): + """ + Setter method for max_time, mapped from YANG variable /components/component/state/temperature/max_time (oc-types:timeticks64) + If this variable is read-only (config: false) in the + source YANG file, then _set_max_time is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_max_time() directly. + + YANG Description: The absolute time at which the maximum value occurred. +The value is the timestamp in nanoseconds relative to + the Unix Epoch (Jan 1, 1970 00:00:00 UTC). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """max_time must be of a type compatible with oc-types:timeticks64""", + 'defined-type': "oc-types:timeticks64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False)""", + }) + + self.__max_time = t + if hasattr(self, '_set'): + self._set() + + def _unset_max_time(self): + self.__max_time = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="max-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='oc-types:timeticks64', is_config=False) + + + def _get_alarm_status(self): + """ + Getter method for alarm_status, mapped from YANG variable /components/component/state/temperature/alarm_status (boolean) + + YANG Description: A value of true indicates the alarm has been raised or +asserted. The value should be false when the alarm is +cleared. + """ + return self.__alarm_status + + def _set_alarm_status(self, v, load=False): + """ + Setter method for alarm_status, mapped from YANG variable /components/component/state/temperature/alarm_status (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_alarm_status is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_alarm_status() directly. + + YANG Description: A value of true indicates the alarm has been raised or +asserted. The value should be false when the alarm is +cleared. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="alarm-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """alarm_status must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="alarm-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False)""", + }) + + self.__alarm_status = t + if hasattr(self, '_set'): + self._set() + + def _unset_alarm_status(self): + self.__alarm_status = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="alarm-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='boolean', is_config=False) + + + def _get_alarm_threshold(self): + """ + Getter method for alarm_threshold, mapped from YANG variable /components/component/state/temperature/alarm_threshold (uint32) + + YANG Description: The threshold value that was crossed for this alarm. + """ + return self.__alarm_threshold + + def _set_alarm_threshold(self, v, load=False): + """ + Setter method for alarm_threshold, mapped from YANG variable /components/component/state/temperature/alarm_threshold (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_alarm_threshold is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_alarm_threshold() directly. + + YANG Description: The threshold value that was crossed for this alarm. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="alarm-threshold", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """alarm_threshold must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="alarm-threshold", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False)""", + }) + + self.__alarm_threshold = t + if hasattr(self, '_set'): + self._set() + + def _unset_alarm_threshold(self): + self.__alarm_threshold = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="alarm-threshold", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='uint32', is_config=False) + + + def _get_alarm_severity(self): + """ + Getter method for alarm_severity, mapped from YANG variable /components/component/state/temperature/alarm_severity (identityref) + + YANG Description: The severity of the current alarm. + """ + return self.__alarm_severity + + def _set_alarm_severity(self, v, load=False): + """ + Setter method for alarm_severity, mapped from YANG variable /components/component/state/temperature/alarm_severity (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_alarm_severity is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_alarm_severity() directly. + + YANG Description: The severity of the current alarm. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UNKNOWN': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:UNKNOWN': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'MINOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:MINOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'WARNING': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:WARNING': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'MAJOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:MAJOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'CRITICAL': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:CRITICAL': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}},), is_leaf=True, yang_name="alarm-severity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """alarm_severity must be of a type compatible with identityref""", + 'defined-type': "openconfig-platform:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UNKNOWN': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:UNKNOWN': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'MINOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:MINOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'WARNING': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:WARNING': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'MAJOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:MAJOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'CRITICAL': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:CRITICAL': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}},), is_leaf=True, yang_name="alarm-severity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False)""", + }) + + self.__alarm_severity = t + if hasattr(self, '_set'): + self._set() + + def _unset_alarm_severity(self): + self.__alarm_severity = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UNKNOWN': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:UNKNOWN': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'MINOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:MINOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'WARNING': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:WARNING': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'MAJOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:MAJOR': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'CRITICAL': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}, 'oc-alarm-types:CRITICAL': {'@module': 'openconfig-alarm-types', '@namespace': 'http://openconfig.net/yang/alarms/types'}},), is_leaf=True, yang_name="alarm-severity", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='identityref', is_config=False) + + instant = __builtin__.property(_get_instant) + avg = __builtin__.property(_get_avg) + min_ = __builtin__.property(_get_min_) + max_ = __builtin__.property(_get_max_) + interval = __builtin__.property(_get_interval) + min_time = __builtin__.property(_get_min_time) + max_time = __builtin__.property(_get_max_time) + alarm_status = __builtin__.property(_get_alarm_status) + alarm_threshold = __builtin__.property(_get_alarm_threshold) + alarm_severity = __builtin__.property(_get_alarm_severity) + + + _pyangbind_elements = OrderedDict([('instant', instant), ('avg', avg), ('min_', min_), ('max_', max_), ('interval', interval), ('min_time', min_time), ('max_time', max_time), ('alarm_status', alarm_status), ('alarm_threshold', alarm_threshold), ('alarm_severity', alarm_severity), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/storage/__init__.py b/hackfest/netconf-oc/openconfig/components/component/storage/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..84f152b6c379edb6eb7c78e7b8e66f36dd47f23a --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/storage/__init__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class storage(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/storage. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Data for storage components + """ + _pyangbind_elements = {} + + + +class storage(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/storage. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Data for storage components + """ + _pyangbind_elements = {} + + + diff --git a/hackfest/netconf-oc/openconfig/components/component/subcomponents/__init__.py b/hackfest/netconf-oc/openconfig/components/component/subcomponents/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5c5d7cdc87ebbb50448438f8725da5b81848b3f7 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/subcomponents/__init__.py @@ -0,0 +1,208 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import subcomponent +class subcomponents(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/subcomponents. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Enclosing container for subcomponent references + """ + __slots__ = ('_path_helper', '_extmethods', '__subcomponent',) + + _yang_name = 'subcomponents' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__subcomponent = YANGDynClass(base=YANGListType("name",subcomponent.subcomponent, yang_name="subcomponent", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="subcomponent", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'subcomponents'] + + def _get_subcomponent(self): + """ + Getter method for subcomponent, mapped from YANG variable /components/component/subcomponents/subcomponent (list) + + YANG Description: List of subcomponent references + """ + return self.__subcomponent + + def _set_subcomponent(self, v, load=False): + """ + Setter method for subcomponent, mapped from YANG variable /components/component/subcomponents/subcomponent (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_subcomponent is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_subcomponent() directly. + + YANG Description: List of subcomponent references + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",subcomponent.subcomponent, yang_name="subcomponent", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="subcomponent", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """subcomponent must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",subcomponent.subcomponent, yang_name="subcomponent", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="subcomponent", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True)""", + }) + + self.__subcomponent = t + if hasattr(self, '_set'): + self._set() + + def _unset_subcomponent(self): + self.__subcomponent = YANGDynClass(base=YANGListType("name",subcomponent.subcomponent, yang_name="subcomponent", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="subcomponent", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + + subcomponent = __builtin__.property(_get_subcomponent, _set_subcomponent) + + + _pyangbind_elements = OrderedDict([('subcomponent', subcomponent), ]) + + +from . import subcomponent +class subcomponents(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/subcomponents. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Enclosing container for subcomponent references + """ + __slots__ = ('_path_helper', '_extmethods', '__subcomponent',) + + _yang_name = 'subcomponents' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__subcomponent = YANGDynClass(base=YANGListType("name",subcomponent.subcomponent, yang_name="subcomponent", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="subcomponent", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'subcomponents'] + + def _get_subcomponent(self): + """ + Getter method for subcomponent, mapped from YANG variable /components/component/subcomponents/subcomponent (list) + + YANG Description: List of subcomponent references + """ + return self.__subcomponent + + def _set_subcomponent(self, v, load=False): + """ + Setter method for subcomponent, mapped from YANG variable /components/component/subcomponents/subcomponent (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_subcomponent is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_subcomponent() directly. + + YANG Description: List of subcomponent references + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",subcomponent.subcomponent, yang_name="subcomponent", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="subcomponent", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """subcomponent must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",subcomponent.subcomponent, yang_name="subcomponent", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="subcomponent", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True)""", + }) + + self.__subcomponent = t + if hasattr(self, '_set'): + self._set() + + def _unset_subcomponent(self): + self.__subcomponent = YANGDynClass(base=YANGListType("name",subcomponent.subcomponent, yang_name="subcomponent", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="subcomponent", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='list', is_config=True) + + subcomponent = __builtin__.property(_get_subcomponent, _set_subcomponent) + + + _pyangbind_elements = OrderedDict([('subcomponent', subcomponent), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/subcomponents/subcomponent/__init__.py b/hackfest/netconf-oc/openconfig/components/component/subcomponents/subcomponent/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8f187809f977bd6fa9cc12bc81196dca7d51b9a1 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/subcomponents/subcomponent/__init__.py @@ -0,0 +1,376 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import config +from . import state +class subcomponent(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/subcomponents/subcomponent. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of subcomponent references + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__config','__state',) + + _yang_name = 'subcomponent' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'subcomponents', 'subcomponent'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/subcomponents/subcomponent/name (leafref) + + YANG Description: Reference to the name list key + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/subcomponents/subcomponent/name (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Reference to the name list key + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + + + def _get_config(self): + """ + Getter method for config, mapped from YANG variable /components/component/subcomponents/subcomponent/config (container) + + YANG Description: Configuration data for the subcomponent + """ + return self.__config + + def _set_config(self, v, load=False): + """ + Setter method for config, mapped from YANG variable /components/component/subcomponents/subcomponent/config (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_config is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_config() directly. + + YANG Description: Configuration data for the subcomponent + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """config must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__config = t + if hasattr(self, '_set'): + self._set() + + def _unset_config(self): + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_state(self): + """ + Getter method for state, mapped from YANG variable /components/component/subcomponents/subcomponent/state (container) + + YANG Description: Operational state data for the subcomponent + """ + return self.__state + + def _set_state(self, v, load=False): + """ + Setter method for state, mapped from YANG variable /components/component/subcomponents/subcomponent/state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_state() directly. + + YANG Description: Operational state data for the subcomponent + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__state = t + if hasattr(self, '_set'): + self._set() + + def _unset_state(self): + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) + + + _pyangbind_elements = OrderedDict([('name', name), ('config', config), ('state', state), ]) + + +from . import config +from . import state +class subcomponent(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/subcomponents/subcomponent. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: List of subcomponent references + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__config','__state',) + + _yang_name = 'subcomponent' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'subcomponents', 'subcomponent'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/subcomponents/subcomponent/name (leafref) + + YANG Description: Reference to the name list key + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/subcomponents/subcomponent/name (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Reference to the name list key + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + + + def _get_config(self): + """ + Getter method for config, mapped from YANG variable /components/component/subcomponents/subcomponent/config (container) + + YANG Description: Configuration data for the subcomponent + """ + return self.__config + + def _set_config(self, v, load=False): + """ + Setter method for config, mapped from YANG variable /components/component/subcomponents/subcomponent/config (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_config is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_config() directly. + + YANG Description: Configuration data for the subcomponent + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """config must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__config = t + if hasattr(self, '_set'): + self._set() + + def _unset_config(self): + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + + def _get_state(self): + """ + Getter method for state, mapped from YANG variable /components/component/subcomponents/subcomponent/state (container) + + YANG Description: Operational state data for the subcomponent + """ + return self.__state + + def _set_state(self, v, load=False): + """ + Setter method for state, mapped from YANG variable /components/component/subcomponents/subcomponent/state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_state() directly. + + YANG Description: Operational state data for the subcomponent + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True)""", + }) + + self.__state = t + if hasattr(self, '_set'): + self._set() + + def _unset_state(self): + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='container', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) + + + _pyangbind_elements = OrderedDict([('name', name), ('config', config), ('state', state), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/subcomponents/subcomponent/config/__init__.py b/hackfest/netconf-oc/openconfig/components/component/subcomponents/subcomponent/config/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..97f1e2adc9782da13a0285f91ca6a8662578c718 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/subcomponents/subcomponent/config/__init__.py @@ -0,0 +1,206 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class config(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/subcomponents/subcomponent/config. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Configuration data for the subcomponent + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'config' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'subcomponents', 'subcomponent', 'config'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/subcomponents/subcomponent/config/name (leafref) + + YANG Description: Reference to the name of the subcomponent + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/subcomponents/subcomponent/config/name (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Reference to the name of the subcomponent + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + +class config(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/subcomponents/subcomponent/config. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Configuration data for the subcomponent + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'config' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'subcomponents', 'subcomponent', 'config'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/subcomponents/subcomponent/config/name (leafref) + + YANG Description: Reference to the name of the subcomponent + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/subcomponents/subcomponent/config/name (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Reference to the name of the subcomponent + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/hackfest/netconf-oc/openconfig/components/component/subcomponents/subcomponent/state/__init__.py b/hackfest/netconf-oc/openconfig/components/component/subcomponents/subcomponent/state/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fe204b7573784e4b542a53eac6c3ad9fbe15e89f --- /dev/null +++ b/hackfest/netconf-oc/openconfig/components/component/subcomponents/subcomponent/state/__init__.py @@ -0,0 +1,206 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform - based on the path /components/component/subcomponents/subcomponent/state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Operational state data for the subcomponent + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'state' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'subcomponents', 'subcomponent', 'state'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/subcomponents/subcomponent/state/name (leafref) + + YANG Description: Reference to the name of the subcomponent + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/subcomponents/subcomponent/state/name (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Reference to the name of the subcomponent + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=False)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=False) + + name = __builtin__.property(_get_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + +class state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-platform-common - based on the path /components/component/subcomponents/subcomponent/state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Operational state data for the subcomponent + """ + __slots__ = ('_path_helper', '_extmethods', '__name',) + + _yang_name = 'state' + _yang_namespace = 'http://openconfig.net/yang/platform' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['components', 'component', 'subcomponents', 'subcomponent', 'state'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /components/component/subcomponents/subcomponent/state/name (leafref) + + YANG Description: Reference to the name of the subcomponent + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /components/component/subcomponents/subcomponent/state/name (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: Reference to the name of the subcomponent + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=False)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform', defining_module='openconfig-platform', yang_type='leafref', is_config=False) + + name = __builtin__.property(_get_name) + + + _pyangbind_elements = OrderedDict([('name', name), ]) + + diff --git a/hackfest/netconf-oc/openconfig/interfaces/__init__.py b/hackfest/netconf-oc/openconfig/interfaces/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..af0371e3f1870194ab8abd48a8a57773453e59ac --- /dev/null +++ b/hackfest/netconf-oc/openconfig/interfaces/__init__.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import interface +class interfaces(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-interfaces - based on the path /interfaces. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Top level container for interfaces, including configuration +and state data. + """ + __slots__ = ('_path_helper', '_extmethods', '__interface',) + + _yang_name = 'interfaces' + _yang_namespace = 'http://openconfig.net/yang/interfaces' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__interface = YANGDynClass(base=YANGListType("name",interface.interface, yang_name="interface", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['interfaces'] + + def _get_interface(self): + """ + Getter method for interface, mapped from YANG variable /interfaces/interface (list) + + YANG Description: The list of named interfaces on the device. + """ + return self.__interface + + def _set_interface(self, v, load=False): + """ + Setter method for interface, mapped from YANG variable /interfaces/interface (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_interface is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_interface() directly. + + YANG Description: The list of named interfaces on the device. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("name",interface.interface, yang_name="interface", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """interface must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("name",interface.interface, yang_name="interface", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='list', is_config=True)""", + }) + + self.__interface = t + if hasattr(self, '_set'): + self._set() + + def _unset_interface(self): + self.__interface = YANGDynClass(base=YANGListType("name",interface.interface, yang_name="interface", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='list', is_config=True) + + interface = __builtin__.property(_get_interface, _set_interface) + + + _pyangbind_elements = OrderedDict([('interface', interface), ]) + + diff --git a/hackfest/netconf-oc/openconfig/interfaces/interface/__init__.py b/hackfest/netconf-oc/openconfig/interfaces/interface/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7850395040d98f3431c7faa94fbeaedbf55e5b32 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/interfaces/interface/__init__.py @@ -0,0 +1,327 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import config +from . import state +from . import hold_time +from . import subinterfaces +from . import ethernet +class interface(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-interfaces - based on the path /interfaces/interface. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The list of named interfaces on the device. + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__config','__state','__hold_time','__subinterfaces','__ethernet',) + + _yang_name = 'interface' + _yang_namespace = 'http://openconfig.net/yang/interfaces' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='leafref', is_config=True) + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + self.__hold_time = YANGDynClass(base=hold_time.hold_time, is_container='container', yang_name="hold-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + self.__subinterfaces = YANGDynClass(base=subinterfaces.subinterfaces, is_container='container', yang_name="subinterfaces", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + self.__ethernet = YANGDynClass(base=ethernet.ethernet, is_container='container', yang_name="ethernet", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['interfaces', 'interface'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /interfaces/interface/name (leafref) + + YANG Description: References the name of the interface + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /interfaces/interface/name (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: References the name of the interface + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='leafref', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='leafref', is_config=True) + + + def _get_config(self): + """ + Getter method for config, mapped from YANG variable /interfaces/interface/config (container) + + YANG Description: Configurable items at the global, physical interface +level + """ + return self.__config + + def _set_config(self, v, load=False): + """ + Setter method for config, mapped from YANG variable /interfaces/interface/config (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_config is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_config() directly. + + YANG Description: Configurable items at the global, physical interface +level + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """config must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True)""", + }) + + self.__config = t + if hasattr(self, '_set'): + self._set() + + def _unset_config(self): + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + + + def _get_state(self): + """ + Getter method for state, mapped from YANG variable /interfaces/interface/state (container) + + YANG Description: Operational state data at the global interface level + """ + return self.__state + + def _set_state(self, v, load=False): + """ + Setter method for state, mapped from YANG variable /interfaces/interface/state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_state() directly. + + YANG Description: Operational state data at the global interface level + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True)""", + }) + + self.__state = t + if hasattr(self, '_set'): + self._set() + + def _unset_state(self): + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + + + def _get_hold_time(self): + """ + Getter method for hold_time, mapped from YANG variable /interfaces/interface/hold_time (container) + + YANG Description: Top-level container for hold-time settings to enable +dampening advertisements of interface transitions. + """ + return self.__hold_time + + def _set_hold_time(self, v, load=False): + """ + Setter method for hold_time, mapped from YANG variable /interfaces/interface/hold_time (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_hold_time is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hold_time() directly. + + YANG Description: Top-level container for hold-time settings to enable +dampening advertisements of interface transitions. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=hold_time.hold_time, is_container='container', yang_name="hold-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hold_time must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=hold_time.hold_time, is_container='container', yang_name="hold-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True)""", + }) + + self.__hold_time = t + if hasattr(self, '_set'): + self._set() + + def _unset_hold_time(self): + self.__hold_time = YANGDynClass(base=hold_time.hold_time, is_container='container', yang_name="hold-time", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + + + def _get_subinterfaces(self): + """ + Getter method for subinterfaces, mapped from YANG variable /interfaces/interface/subinterfaces (container) + + YANG Description: Enclosing container for the list of subinterfaces associated +with a physical interface + """ + return self.__subinterfaces + + def _set_subinterfaces(self, v, load=False): + """ + Setter method for subinterfaces, mapped from YANG variable /interfaces/interface/subinterfaces (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_subinterfaces is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_subinterfaces() directly. + + YANG Description: Enclosing container for the list of subinterfaces associated +with a physical interface + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=subinterfaces.subinterfaces, is_container='container', yang_name="subinterfaces", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """subinterfaces must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=subinterfaces.subinterfaces, is_container='container', yang_name="subinterfaces", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True)""", + }) + + self.__subinterfaces = t + if hasattr(self, '_set'): + self._set() + + def _unset_subinterfaces(self): + self.__subinterfaces = YANGDynClass(base=subinterfaces.subinterfaces, is_container='container', yang_name="subinterfaces", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + + + def _get_ethernet(self): + """ + Getter method for ethernet, mapped from YANG variable /interfaces/interface/ethernet (container) + + YANG Description: Top-level container for ethernet configuration +and state + """ + return self.__ethernet + + def _set_ethernet(self, v, load=False): + """ + Setter method for ethernet, mapped from YANG variable /interfaces/interface/ethernet (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_ethernet is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ethernet() directly. + + YANG Description: Top-level container for ethernet configuration +and state + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=ethernet.ethernet, is_container='container', yang_name="ethernet", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ethernet must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=ethernet.ethernet, is_container='container', yang_name="ethernet", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='container', is_config=True)""", + }) + + self.__ethernet = t + if hasattr(self, '_set'): + self._set() + + def _unset_ethernet(self): + self.__ethernet = YANGDynClass(base=ethernet.ethernet, is_container='container', yang_name="ethernet", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='container', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) + hold_time = __builtin__.property(_get_hold_time, _set_hold_time) + subinterfaces = __builtin__.property(_get_subinterfaces, _set_subinterfaces) + ethernet = __builtin__.property(_get_ethernet, _set_ethernet) + + + _pyangbind_elements = OrderedDict([('name', name), ('config', config), ('state', state), ('hold_time', hold_time), ('subinterfaces', subinterfaces), ('ethernet', ethernet), ]) + + diff --git a/hackfest/netconf-oc/openconfig/interfaces/interface/config/__init__.py b/hackfest/netconf-oc/openconfig/interfaces/interface/config/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..84dbcfaec66e765d244886bc83622aee2e31c7f4 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/interfaces/interface/config/__init__.py @@ -0,0 +1,476 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class config(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-interfaces - based on the path /interfaces/interface/config. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Configurable items at the global, physical interface +level + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__type','__mtu','__loopback_mode','__description','__enabled',) + + _yang_name = 'config' + _yang_namespace = 'http://openconfig.net/yang/interfaces' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=True) + self.__type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'iana-interface-type': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iana-interface-type': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'other': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:other': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'regular1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:regular1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdh1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdh1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ddnX25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ddnX25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rfc877x25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rfc877x25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ethernetCsmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ethernetCsmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88023Csmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88023Csmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88024TokenBus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88024TokenBus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025TokenRing': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025TokenRing': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88026Man': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88026Man': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'starLan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:starLan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'proteon10Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:proteon10Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'proteon80Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:proteon80Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hyperchannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hyperchannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fddi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fddi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'e1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:e1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'basicISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:basicISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'primaryISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:primaryISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propPointToPointSerial': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propPointToPointSerial': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ppp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ppp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'softwareLoopback': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:softwareLoopback': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'eon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:eon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ethernet3Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ethernet3Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'nsip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:nsip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'slip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:slip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ultra': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ultra': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds3': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds3': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rs232': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rs232': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'para': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:para': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arcnet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arcnet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arcnetPlus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arcnetPlus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'miox25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:miox25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25ple': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25ple': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88022llc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88022llc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'localTalk': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:localTalk': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'smdsDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:smdsDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayService': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayService': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v35': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v35': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hssi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hssi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hippi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hippi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'modem': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:modem': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aal5': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aal5': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetPath': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetPath': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetVT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetVT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'smdsIcip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:smdsIcip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propMultiplexor': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propMultiplexor': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80212': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80212': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fibreChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fibreChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hippiInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hippiInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayInterconnect': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayInterconnect': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aflane8023': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aflane8023': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aflane8025': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aflane8025': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cctEmul': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cctEmul': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v11': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v11': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v36': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v36': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g703at64k': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g703at64k': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g703at2mb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g703at2mb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'qllc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:qllc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastEtherFX': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastEtherFX': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'channel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:channel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80211': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80211': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ibm370parChan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ibm370parChan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'escon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:escon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dlsw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dlsw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdns': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdns': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rsrb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rsrb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmLogical': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmLogical': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds0': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds0': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds0Bundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds0Bundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bsc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bsc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'async': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:async': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cnr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cnr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025Dtr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025Dtr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'eplrs': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:eplrs': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propCnls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propCnls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hostPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hostPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'termPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:termPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayMPI': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayMPI': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x213': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x213': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'radsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:radsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025CRFPInt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025CRFPInt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'myrinet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:myrinet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEM': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEM': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFXO': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFXO': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFXS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFXS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEncap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEncap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmFuni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmFuni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmIma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmIma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pppMultilinkBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pppMultilinkBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverCdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverCdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverClaw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverClaw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'stackToStack': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:stackToStack': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'virtualIpAddress': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:virtualIpAddress': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025Fiber': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025Fiber': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gigabitEthernet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gigabitEthernet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v37': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v37': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25mlp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25mlp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25huntGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25huntGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'transpHdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:transpHdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'interleave': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:interleave': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'a12MppSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:a12MppSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'coffee': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:coffee': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ces': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ces': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmSubInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmSubInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l2vlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l2vlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l3ipvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l3ipvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l3ipxvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l3ipxvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'digitalPowerline': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:digitalPowerline': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mediaMailOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mediaMailOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dcn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dcn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'msdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:msdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee1394': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee1394': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'if-gsn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:if-gsn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mplsTunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mplsTunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'srp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:srp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverFrameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverFrameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'idsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:idsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'compositeLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:compositeLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ss7SigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ss7SigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propWirelessP2P': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propWirelessP2P': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rfc1483': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rfc1483': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'usb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:usb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee8023adLag': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee8023adLag': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bgppolicyaccounting': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bgppolicyaccounting': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frf16MfrBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frf16MfrBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'h323Gatekeeper': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:h323Gatekeeper': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'h323Proxy': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:h323Proxy': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mfSigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mfSigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'shdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:shdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds1FDL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds1FDL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pos': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pos': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbAsiIn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbAsiIn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbAsiOut': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbAsiOut': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'plc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:plc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'nfas': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:nfas': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tr008': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tr008': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gr303RDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gr303RDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gr303IDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gr303IDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hiperlan2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hiperlan2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propBWAp2Mp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propBWAp2Mp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'digitalWrapperOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:digitalWrapperOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aal2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aal2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'radioMAC': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:radioMAC': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'imt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:imt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mvl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mvl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'reachDSL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:reachDSL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frDlciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frDlciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmVciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmVciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverCable': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverCable': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'infiniband': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:infiniband': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'teLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:teLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'q2931': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:q2931': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'virtualTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:virtualTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sipTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sipTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sipSig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sipSig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstreamChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstreamChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'econet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:econet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pon155': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pon155': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pon622': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pon622': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bridge': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bridge': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'linegroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:linegroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEMFGD': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEMFGD': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFGDEANA': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFGDEANA': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceDID': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceDID': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpegTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpegTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sixToFour': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sixToFour': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gtp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gtp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pdnEtherLoop1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pdnEtherLoop1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pdnEtherLoop2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pdnEtherLoop2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalChannelGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalChannelGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'homepna': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:homepna': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gfp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gfp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ciscoISLvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ciscoISLvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'actelisMetaLOOP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:actelisMetaLOOP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fcipLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fcipLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rpr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rpr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'qam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:qam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lmp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lmp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cblVectaStar': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cblVectaStar': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableMCmtsDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableMCmtsDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'macSecControlledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:macSecControlledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'macSecUncontrolledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:macSecUncontrolledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aviciOpticalEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aviciOpticalEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmbond': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmbond': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFGDOS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFGDOS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mocaVersion1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mocaVersion1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80216WMAN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80216WMAN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl2plus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl2plus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRcsMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRcsMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbTdm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbTdm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRcsTdma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRcsTdma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x86Laps': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x86Laps': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'wwanPP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:wwanPP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'wwanPP2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:wwanPP2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEBS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEBS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ifPwType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ifPwType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ilan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ilan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluELP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluELP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapDot11Profile': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapDot11Profile': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapDot11Bss': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapDot11Bss': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapWtpVirtualRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapWtpVirtualRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bits': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bits': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cableDownstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cableDownstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vmwareVirtualNic': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vmwareVirtualNic': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee802154': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee802154': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOdu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOdu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ifVfiType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ifVfiType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9981': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9981': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9982': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9982': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9983': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9983': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponLogicalLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponLogicalLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluGponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluGponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluGponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluGponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vmwareNicTeam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vmwareNicTeam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsOfdmDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsOfdmDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsOfdmaUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsOfdmaUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gfast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gfast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdci': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdci': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'xboxWireless': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:xboxWireless': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d1FwdOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d1FwdOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d1RetOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d1RetOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d2DsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d2DsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d2UsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d2UsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableNdf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableNdf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableNdr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableNdr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ptm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ptm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ghn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ghn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtsi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtsi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtuc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtuc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOduc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOduc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtsig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtsig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'microwaveCarrierTermination': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:microwaveCarrierTermination': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'microwaveRadioLinkTerminal': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:microwaveRadioLinkTerminal': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}},), is_leaf=True, yang_name="type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='identityref', is_config=True) + self.__mtu = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="mtu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint16', is_config=True) + self.__loopback_mode = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="loopback-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=True) + self.__description = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=True) + self.__enabled = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['interfaces', 'interface', 'config'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /interfaces/interface/config/name (string) + + YANG Description: The name of the interface. + +A device MAY restrict the allowed values for this leaf, +possibly depending on the type of the interface. +For system-controlled interfaces, this leaf is the +device-specific name of the interface. The 'config false' +list interfaces/interface[name]/state contains the currently +existing interfaces on the device. + +If a client tries to create configuration for a +system-controlled interface that is not present in the +corresponding state list, the server MAY reject +the request if the implementation does not support +pre-provisioning of interfaces or if the name refers to +an interface that can never exist in the system. A +NETCONF server MUST reply with an rpc-error with the +error-tag 'invalid-value' in this case. + +The IETF model in RFC 7223 provides YANG features for the +following (i.e., pre-provisioning and arbitrary-names), +however they are omitted here: + + If the device supports pre-provisioning of interface + configuration, the 'pre-provisioning' feature is + advertised. + + If the device allows arbitrarily named user-controlled + interfaces, the 'arbitrary-names' feature is advertised. + +When a configured user-controlled interface is created by +the system, it is instantiated with the same name in the +/interfaces/interface[name]/state list. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /interfaces/interface/config/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: The name of the interface. + +A device MAY restrict the allowed values for this leaf, +possibly depending on the type of the interface. +For system-controlled interfaces, this leaf is the +device-specific name of the interface. The 'config false' +list interfaces/interface[name]/state contains the currently +existing interfaces on the device. + +If a client tries to create configuration for a +system-controlled interface that is not present in the +corresponding state list, the server MAY reject +the request if the implementation does not support +pre-provisioning of interfaces or if the name refers to +an interface that can never exist in the system. A +NETCONF server MUST reply with an rpc-error with the +error-tag 'invalid-value' in this case. + +The IETF model in RFC 7223 provides YANG features for the +following (i.e., pre-provisioning and arbitrary-names), +however they are omitted here: + + If the device supports pre-provisioning of interface + configuration, the 'pre-provisioning' feature is + advertised. + + If the device allows arbitrarily named user-controlled + interfaces, the 'arbitrary-names' feature is advertised. + +When a configured user-controlled interface is created by +the system, it is instantiated with the same name in the +/interfaces/interface[name]/state list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=True)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=True) + + + def _get_type(self): + """ + Getter method for type, mapped from YANG variable /interfaces/interface/config/type (identityref) + + YANG Description: The type of the interface. + +When an interface entry is created, a server MAY +initialize the type leaf with a valid value, e.g., if it +is possible to derive the type from the name of the +interface. + +If a client tries to set the type of an interface to a +value that can never be used by the system, e.g., if the +type is not supported or if the type does not match the +name of the interface, the server MUST reject the request. +A NETCONF server MUST reply with an rpc-error with the +error-tag 'invalid-value' in this case. + """ + return self.__type + + def _set_type(self, v, load=False): + """ + Setter method for type, mapped from YANG variable /interfaces/interface/config/type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_type() directly. + + YANG Description: The type of the interface. + +When an interface entry is created, a server MAY +initialize the type leaf with a valid value, e.g., if it +is possible to derive the type from the name of the +interface. + +If a client tries to set the type of an interface to a +value that can never be used by the system, e.g., if the +type is not supported or if the type does not match the +name of the interface, the server MUST reject the request. +A NETCONF server MUST reply with an rpc-error with the +error-tag 'invalid-value' in this case. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'iana-interface-type': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iana-interface-type': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'other': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:other': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'regular1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:regular1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdh1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdh1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ddnX25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ddnX25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rfc877x25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rfc877x25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ethernetCsmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ethernetCsmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88023Csmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88023Csmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88024TokenBus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88024TokenBus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025TokenRing': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025TokenRing': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88026Man': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88026Man': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'starLan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:starLan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'proteon10Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:proteon10Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'proteon80Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:proteon80Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hyperchannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hyperchannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fddi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fddi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'e1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:e1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'basicISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:basicISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'primaryISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:primaryISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propPointToPointSerial': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propPointToPointSerial': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ppp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ppp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'softwareLoopback': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:softwareLoopback': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'eon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:eon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ethernet3Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ethernet3Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'nsip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:nsip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'slip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:slip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ultra': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ultra': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds3': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds3': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rs232': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rs232': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'para': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:para': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arcnet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arcnet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arcnetPlus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arcnetPlus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'miox25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:miox25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25ple': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25ple': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88022llc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88022llc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'localTalk': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:localTalk': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'smdsDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:smdsDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayService': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayService': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v35': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v35': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hssi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hssi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hippi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hippi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'modem': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:modem': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aal5': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aal5': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetPath': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetPath': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetVT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetVT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'smdsIcip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:smdsIcip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propMultiplexor': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propMultiplexor': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80212': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80212': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fibreChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fibreChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hippiInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hippiInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayInterconnect': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayInterconnect': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aflane8023': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aflane8023': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aflane8025': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aflane8025': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cctEmul': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cctEmul': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v11': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v11': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v36': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v36': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g703at64k': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g703at64k': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g703at2mb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g703at2mb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'qllc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:qllc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastEtherFX': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastEtherFX': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'channel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:channel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80211': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80211': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ibm370parChan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ibm370parChan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'escon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:escon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dlsw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dlsw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdns': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdns': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rsrb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rsrb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmLogical': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmLogical': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds0': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds0': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds0Bundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds0Bundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bsc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bsc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'async': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:async': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cnr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cnr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025Dtr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025Dtr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'eplrs': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:eplrs': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propCnls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propCnls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hostPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hostPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'termPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:termPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayMPI': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayMPI': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x213': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x213': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'radsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:radsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025CRFPInt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025CRFPInt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'myrinet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:myrinet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEM': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEM': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFXO': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFXO': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFXS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFXS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEncap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEncap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmFuni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmFuni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmIma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmIma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pppMultilinkBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pppMultilinkBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverCdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverCdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverClaw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverClaw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'stackToStack': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:stackToStack': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'virtualIpAddress': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:virtualIpAddress': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025Fiber': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025Fiber': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gigabitEthernet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gigabitEthernet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v37': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v37': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25mlp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25mlp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25huntGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25huntGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'transpHdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:transpHdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'interleave': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:interleave': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'a12MppSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:a12MppSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'coffee': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:coffee': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ces': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ces': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmSubInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmSubInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l2vlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l2vlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l3ipvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l3ipvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l3ipxvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l3ipxvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'digitalPowerline': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:digitalPowerline': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mediaMailOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mediaMailOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dcn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dcn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'msdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:msdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee1394': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee1394': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'if-gsn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:if-gsn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mplsTunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mplsTunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'srp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:srp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverFrameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverFrameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'idsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:idsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'compositeLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:compositeLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ss7SigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ss7SigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propWirelessP2P': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propWirelessP2P': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rfc1483': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rfc1483': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'usb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:usb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee8023adLag': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee8023adLag': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bgppolicyaccounting': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bgppolicyaccounting': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frf16MfrBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frf16MfrBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'h323Gatekeeper': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:h323Gatekeeper': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'h323Proxy': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:h323Proxy': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mfSigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mfSigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'shdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:shdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds1FDL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds1FDL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pos': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pos': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbAsiIn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbAsiIn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbAsiOut': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbAsiOut': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'plc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:plc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'nfas': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:nfas': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tr008': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tr008': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gr303RDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gr303RDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gr303IDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gr303IDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hiperlan2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hiperlan2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propBWAp2Mp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propBWAp2Mp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'digitalWrapperOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:digitalWrapperOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aal2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aal2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'radioMAC': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:radioMAC': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'imt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:imt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mvl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mvl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'reachDSL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:reachDSL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frDlciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frDlciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmVciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmVciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverCable': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverCable': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'infiniband': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:infiniband': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'teLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:teLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'q2931': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:q2931': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'virtualTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:virtualTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sipTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sipTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sipSig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sipSig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstreamChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstreamChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'econet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:econet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pon155': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pon155': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pon622': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pon622': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bridge': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bridge': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'linegroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:linegroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEMFGD': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEMFGD': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFGDEANA': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFGDEANA': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceDID': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceDID': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpegTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpegTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sixToFour': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sixToFour': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gtp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gtp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pdnEtherLoop1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pdnEtherLoop1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pdnEtherLoop2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pdnEtherLoop2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalChannelGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalChannelGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'homepna': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:homepna': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gfp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gfp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ciscoISLvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ciscoISLvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'actelisMetaLOOP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:actelisMetaLOOP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fcipLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fcipLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rpr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rpr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'qam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:qam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lmp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lmp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cblVectaStar': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cblVectaStar': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableMCmtsDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableMCmtsDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'macSecControlledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:macSecControlledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'macSecUncontrolledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:macSecUncontrolledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aviciOpticalEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aviciOpticalEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmbond': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmbond': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFGDOS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFGDOS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mocaVersion1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mocaVersion1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80216WMAN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80216WMAN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl2plus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl2plus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRcsMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRcsMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbTdm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbTdm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRcsTdma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRcsTdma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x86Laps': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x86Laps': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'wwanPP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:wwanPP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'wwanPP2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:wwanPP2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEBS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEBS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ifPwType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ifPwType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ilan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ilan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluELP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluELP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapDot11Profile': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapDot11Profile': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapDot11Bss': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapDot11Bss': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapWtpVirtualRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapWtpVirtualRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bits': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bits': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cableDownstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cableDownstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vmwareVirtualNic': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vmwareVirtualNic': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee802154': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee802154': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOdu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOdu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ifVfiType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ifVfiType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9981': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9981': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9982': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9982': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9983': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9983': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponLogicalLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponLogicalLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluGponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluGponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluGponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluGponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vmwareNicTeam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vmwareNicTeam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsOfdmDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsOfdmDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsOfdmaUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsOfdmaUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gfast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gfast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdci': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdci': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'xboxWireless': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:xboxWireless': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d1FwdOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d1FwdOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d1RetOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d1RetOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d2DsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d2DsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d2UsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d2UsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableNdf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableNdf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableNdr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableNdr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ptm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ptm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ghn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ghn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtsi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtsi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtuc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtuc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOduc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOduc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtsig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtsig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'microwaveCarrierTermination': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:microwaveCarrierTermination': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'microwaveRadioLinkTerminal': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:microwaveRadioLinkTerminal': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}},), is_leaf=True, yang_name="type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """type must be of a type compatible with identityref""", + 'defined-type': "openconfig-interfaces:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'iana-interface-type': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iana-interface-type': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'other': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:other': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'regular1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:regular1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdh1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdh1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ddnX25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ddnX25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rfc877x25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rfc877x25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ethernetCsmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ethernetCsmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88023Csmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88023Csmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88024TokenBus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88024TokenBus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025TokenRing': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025TokenRing': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88026Man': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88026Man': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'starLan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:starLan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'proteon10Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:proteon10Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'proteon80Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:proteon80Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hyperchannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hyperchannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fddi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fddi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'e1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:e1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'basicISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:basicISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'primaryISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:primaryISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propPointToPointSerial': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propPointToPointSerial': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ppp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ppp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'softwareLoopback': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:softwareLoopback': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'eon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:eon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ethernet3Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ethernet3Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'nsip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:nsip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'slip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:slip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ultra': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ultra': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds3': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds3': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rs232': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rs232': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'para': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:para': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arcnet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arcnet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arcnetPlus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arcnetPlus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'miox25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:miox25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25ple': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25ple': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88022llc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88022llc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'localTalk': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:localTalk': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'smdsDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:smdsDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayService': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayService': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v35': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v35': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hssi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hssi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hippi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hippi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'modem': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:modem': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aal5': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aal5': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetPath': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetPath': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetVT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetVT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'smdsIcip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:smdsIcip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propMultiplexor': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propMultiplexor': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80212': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80212': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fibreChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fibreChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hippiInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hippiInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayInterconnect': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayInterconnect': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aflane8023': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aflane8023': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aflane8025': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aflane8025': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cctEmul': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cctEmul': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v11': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v11': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v36': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v36': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g703at64k': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g703at64k': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g703at2mb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g703at2mb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'qllc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:qllc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastEtherFX': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastEtherFX': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'channel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:channel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80211': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80211': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ibm370parChan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ibm370parChan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'escon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:escon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dlsw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dlsw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdns': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdns': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rsrb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rsrb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmLogical': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmLogical': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds0': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds0': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds0Bundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds0Bundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bsc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bsc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'async': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:async': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cnr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cnr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025Dtr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025Dtr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'eplrs': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:eplrs': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propCnls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propCnls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hostPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hostPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'termPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:termPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayMPI': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayMPI': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x213': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x213': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'radsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:radsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025CRFPInt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025CRFPInt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'myrinet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:myrinet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEM': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEM': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFXO': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFXO': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFXS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFXS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEncap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEncap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmFuni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmFuni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmIma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmIma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pppMultilinkBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pppMultilinkBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverCdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverCdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverClaw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverClaw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'stackToStack': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:stackToStack': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'virtualIpAddress': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:virtualIpAddress': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025Fiber': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025Fiber': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gigabitEthernet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gigabitEthernet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v37': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v37': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25mlp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25mlp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25huntGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25huntGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'transpHdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:transpHdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'interleave': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:interleave': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'a12MppSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:a12MppSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'coffee': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:coffee': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ces': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ces': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmSubInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmSubInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l2vlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l2vlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l3ipvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l3ipvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l3ipxvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l3ipxvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'digitalPowerline': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:digitalPowerline': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mediaMailOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mediaMailOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dcn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dcn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'msdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:msdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee1394': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee1394': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'if-gsn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:if-gsn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mplsTunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mplsTunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'srp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:srp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverFrameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverFrameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'idsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:idsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'compositeLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:compositeLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ss7SigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ss7SigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propWirelessP2P': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propWirelessP2P': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rfc1483': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rfc1483': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'usb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:usb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee8023adLag': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee8023adLag': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bgppolicyaccounting': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bgppolicyaccounting': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frf16MfrBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frf16MfrBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'h323Gatekeeper': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:h323Gatekeeper': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'h323Proxy': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:h323Proxy': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mfSigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mfSigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'shdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:shdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds1FDL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds1FDL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pos': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pos': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbAsiIn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbAsiIn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbAsiOut': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbAsiOut': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'plc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:plc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'nfas': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:nfas': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tr008': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tr008': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gr303RDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gr303RDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gr303IDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gr303IDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hiperlan2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hiperlan2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propBWAp2Mp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propBWAp2Mp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'digitalWrapperOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:digitalWrapperOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aal2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aal2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'radioMAC': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:radioMAC': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'imt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:imt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mvl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mvl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'reachDSL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:reachDSL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frDlciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frDlciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmVciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmVciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverCable': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverCable': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'infiniband': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:infiniband': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'teLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:teLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'q2931': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:q2931': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'virtualTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:virtualTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sipTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sipTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sipSig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sipSig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstreamChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstreamChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'econet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:econet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pon155': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pon155': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pon622': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pon622': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bridge': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bridge': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'linegroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:linegroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEMFGD': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEMFGD': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFGDEANA': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFGDEANA': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceDID': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceDID': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpegTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpegTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sixToFour': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sixToFour': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gtp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gtp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pdnEtherLoop1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pdnEtherLoop1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pdnEtherLoop2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pdnEtherLoop2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalChannelGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalChannelGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'homepna': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:homepna': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gfp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gfp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ciscoISLvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ciscoISLvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'actelisMetaLOOP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:actelisMetaLOOP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fcipLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fcipLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rpr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rpr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'qam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:qam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lmp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lmp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cblVectaStar': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cblVectaStar': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableMCmtsDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableMCmtsDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'macSecControlledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:macSecControlledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'macSecUncontrolledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:macSecUncontrolledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aviciOpticalEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aviciOpticalEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmbond': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmbond': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFGDOS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFGDOS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mocaVersion1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mocaVersion1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80216WMAN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80216WMAN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl2plus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl2plus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRcsMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRcsMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbTdm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbTdm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRcsTdma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRcsTdma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x86Laps': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x86Laps': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'wwanPP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:wwanPP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'wwanPP2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:wwanPP2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEBS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEBS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ifPwType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ifPwType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ilan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ilan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluELP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluELP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapDot11Profile': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapDot11Profile': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapDot11Bss': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapDot11Bss': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapWtpVirtualRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapWtpVirtualRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bits': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bits': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cableDownstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cableDownstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vmwareVirtualNic': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vmwareVirtualNic': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee802154': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee802154': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOdu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOdu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ifVfiType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ifVfiType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9981': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9981': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9982': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9982': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9983': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9983': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponLogicalLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponLogicalLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluGponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluGponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluGponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluGponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vmwareNicTeam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vmwareNicTeam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsOfdmDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsOfdmDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsOfdmaUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsOfdmaUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gfast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gfast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdci': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdci': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'xboxWireless': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:xboxWireless': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d1FwdOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d1FwdOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d1RetOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d1RetOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d2DsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d2DsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d2UsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d2UsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableNdf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableNdf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableNdr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableNdr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ptm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ptm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ghn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ghn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtsi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtsi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtuc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtuc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOduc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOduc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtsig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtsig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'microwaveCarrierTermination': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:microwaveCarrierTermination': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'microwaveRadioLinkTerminal': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:microwaveRadioLinkTerminal': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}},), is_leaf=True, yang_name="type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='identityref', is_config=True)""", + }) + + self.__type = t + if hasattr(self, '_set'): + self._set() + + def _unset_type(self): + self.__type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'iana-interface-type': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iana-interface-type': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'other': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:other': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'regular1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:regular1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdh1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdh1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ddnX25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ddnX25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rfc877x25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rfc877x25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ethernetCsmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ethernetCsmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88023Csmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88023Csmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88024TokenBus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88024TokenBus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025TokenRing': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025TokenRing': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88026Man': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88026Man': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'starLan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:starLan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'proteon10Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:proteon10Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'proteon80Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:proteon80Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hyperchannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hyperchannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fddi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fddi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'e1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:e1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'basicISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:basicISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'primaryISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:primaryISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propPointToPointSerial': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propPointToPointSerial': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ppp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ppp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'softwareLoopback': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:softwareLoopback': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'eon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:eon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ethernet3Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ethernet3Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'nsip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:nsip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'slip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:slip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ultra': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ultra': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds3': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds3': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rs232': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rs232': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'para': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:para': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arcnet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arcnet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arcnetPlus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arcnetPlus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'miox25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:miox25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25ple': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25ple': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88022llc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88022llc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'localTalk': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:localTalk': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'smdsDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:smdsDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayService': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayService': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v35': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v35': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hssi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hssi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hippi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hippi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'modem': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:modem': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aal5': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aal5': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetPath': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetPath': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetVT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetVT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'smdsIcip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:smdsIcip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propMultiplexor': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propMultiplexor': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80212': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80212': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fibreChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fibreChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hippiInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hippiInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayInterconnect': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayInterconnect': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aflane8023': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aflane8023': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aflane8025': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aflane8025': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cctEmul': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cctEmul': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v11': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v11': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v36': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v36': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g703at64k': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g703at64k': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g703at2mb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g703at2mb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'qllc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:qllc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastEtherFX': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastEtherFX': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'channel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:channel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80211': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80211': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ibm370parChan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ibm370parChan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'escon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:escon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dlsw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dlsw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdns': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdns': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rsrb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rsrb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmLogical': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmLogical': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds0': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds0': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds0Bundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds0Bundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bsc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bsc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'async': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:async': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cnr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cnr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025Dtr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025Dtr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'eplrs': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:eplrs': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propCnls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propCnls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hostPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hostPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'termPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:termPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayMPI': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayMPI': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x213': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x213': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'radsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:radsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025CRFPInt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025CRFPInt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'myrinet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:myrinet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEM': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEM': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFXO': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFXO': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFXS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFXS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEncap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEncap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmFuni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmFuni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmIma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmIma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pppMultilinkBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pppMultilinkBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverCdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverCdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverClaw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverClaw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'stackToStack': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:stackToStack': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'virtualIpAddress': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:virtualIpAddress': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025Fiber': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025Fiber': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gigabitEthernet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gigabitEthernet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v37': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v37': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25mlp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25mlp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25huntGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25huntGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'transpHdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:transpHdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'interleave': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:interleave': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'a12MppSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:a12MppSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'coffee': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:coffee': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ces': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ces': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmSubInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmSubInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l2vlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l2vlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l3ipvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l3ipvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l3ipxvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l3ipxvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'digitalPowerline': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:digitalPowerline': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mediaMailOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mediaMailOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dcn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dcn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'msdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:msdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee1394': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee1394': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'if-gsn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:if-gsn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mplsTunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mplsTunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'srp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:srp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverFrameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverFrameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'idsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:idsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'compositeLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:compositeLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ss7SigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ss7SigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propWirelessP2P': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propWirelessP2P': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rfc1483': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rfc1483': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'usb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:usb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee8023adLag': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee8023adLag': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bgppolicyaccounting': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bgppolicyaccounting': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frf16MfrBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frf16MfrBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'h323Gatekeeper': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:h323Gatekeeper': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'h323Proxy': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:h323Proxy': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mfSigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mfSigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'shdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:shdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds1FDL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds1FDL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pos': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pos': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbAsiIn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbAsiIn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbAsiOut': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbAsiOut': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'plc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:plc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'nfas': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:nfas': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tr008': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tr008': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gr303RDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gr303RDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gr303IDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gr303IDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hiperlan2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hiperlan2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propBWAp2Mp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propBWAp2Mp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'digitalWrapperOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:digitalWrapperOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aal2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aal2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'radioMAC': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:radioMAC': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'imt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:imt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mvl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mvl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'reachDSL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:reachDSL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frDlciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frDlciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmVciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmVciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverCable': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverCable': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'infiniband': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:infiniband': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'teLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:teLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'q2931': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:q2931': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'virtualTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:virtualTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sipTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sipTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sipSig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sipSig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstreamChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstreamChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'econet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:econet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pon155': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pon155': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pon622': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pon622': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bridge': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bridge': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'linegroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:linegroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEMFGD': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEMFGD': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFGDEANA': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFGDEANA': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceDID': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceDID': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpegTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpegTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sixToFour': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sixToFour': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gtp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gtp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pdnEtherLoop1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pdnEtherLoop1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pdnEtherLoop2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pdnEtherLoop2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalChannelGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalChannelGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'homepna': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:homepna': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gfp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gfp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ciscoISLvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ciscoISLvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'actelisMetaLOOP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:actelisMetaLOOP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fcipLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fcipLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rpr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rpr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'qam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:qam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lmp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lmp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cblVectaStar': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cblVectaStar': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableMCmtsDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableMCmtsDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'macSecControlledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:macSecControlledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'macSecUncontrolledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:macSecUncontrolledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aviciOpticalEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aviciOpticalEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmbond': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmbond': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFGDOS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFGDOS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mocaVersion1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mocaVersion1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80216WMAN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80216WMAN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl2plus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl2plus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRcsMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRcsMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbTdm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbTdm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRcsTdma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRcsTdma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x86Laps': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x86Laps': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'wwanPP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:wwanPP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'wwanPP2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:wwanPP2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEBS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEBS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ifPwType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ifPwType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ilan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ilan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluELP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluELP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapDot11Profile': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapDot11Profile': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapDot11Bss': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapDot11Bss': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapWtpVirtualRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapWtpVirtualRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bits': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bits': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cableDownstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cableDownstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vmwareVirtualNic': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vmwareVirtualNic': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee802154': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee802154': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOdu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOdu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ifVfiType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ifVfiType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9981': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9981': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9982': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9982': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9983': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9983': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponLogicalLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponLogicalLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluGponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluGponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluGponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluGponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vmwareNicTeam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vmwareNicTeam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsOfdmDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsOfdmDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsOfdmaUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsOfdmaUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gfast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gfast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdci': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdci': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'xboxWireless': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:xboxWireless': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d1FwdOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d1FwdOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d1RetOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d1RetOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d2DsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d2DsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d2UsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d2UsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableNdf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableNdf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableNdr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableNdr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ptm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ptm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ghn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ghn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtsi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtsi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtuc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtuc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOduc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOduc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtsig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtsig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'microwaveCarrierTermination': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:microwaveCarrierTermination': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'microwaveRadioLinkTerminal': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:microwaveRadioLinkTerminal': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}},), is_leaf=True, yang_name="type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='identityref', is_config=True) + + + def _get_mtu(self): + """ + Getter method for mtu, mapped from YANG variable /interfaces/interface/config/mtu (uint16) + + YANG Description: Set the max transmission unit size in octets +for the physical interface. If this is not set, the mtu is +set to the operational default -- e.g., 1514 bytes on an +Ethernet interface. + """ + return self.__mtu + + def _set_mtu(self, v, load=False): + """ + Setter method for mtu, mapped from YANG variable /interfaces/interface/config/mtu (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_mtu is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_mtu() directly. + + YANG Description: Set the max transmission unit size in octets +for the physical interface. If this is not set, the mtu is +set to the operational default -- e.g., 1514 bytes on an +Ethernet interface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="mtu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint16', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """mtu must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="mtu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint16', is_config=True)""", + }) + + self.__mtu = t + if hasattr(self, '_set'): + self._set() + + def _unset_mtu(self): + self.__mtu = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="mtu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint16', is_config=True) + + + def _get_loopback_mode(self): + """ + Getter method for loopback_mode, mapped from YANG variable /interfaces/interface/config/loopback_mode (boolean) + + YANG Description: When set to true, the interface is logically looped back, +such that packets that are forwarded via the interface +are received on the same interface. + """ + return self.__loopback_mode + + def _set_loopback_mode(self, v, load=False): + """ + Setter method for loopback_mode, mapped from YANG variable /interfaces/interface/config/loopback_mode (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_loopback_mode is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_loopback_mode() directly. + + YANG Description: When set to true, the interface is logically looped back, +such that packets that are forwarded via the interface +are received on the same interface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="loopback-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """loopback_mode must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="loopback-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=True)""", + }) + + self.__loopback_mode = t + if hasattr(self, '_set'): + self._set() + + def _unset_loopback_mode(self): + self.__loopback_mode = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="loopback-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=True) + + + def _get_description(self): + """ + Getter method for description, mapped from YANG variable /interfaces/interface/config/description (string) + + YANG Description: A textual description of the interface. + +A server implementation MAY map this leaf to the ifAlias +MIB object. Such an implementation needs to use some +mechanism to handle the differences in size and characters +allowed between this leaf and ifAlias. The definition of +such a mechanism is outside the scope of this document. + +Since ifAlias is defined to be stored in non-volatile +storage, the MIB implementation MUST map ifAlias to the +value of 'description' in the persistently stored +datastore. + +Specifically, if the device supports ':startup', when +ifAlias is read the device MUST return the value of +'description' in the 'startup' datastore, and when it is +written, it MUST be written to the 'running' and 'startup' +datastores. Note that it is up to the implementation to + +decide whether to modify this single leaf in 'startup' or +perform an implicit copy-config from 'running' to +'startup'. + +If the device does not support ':startup', ifAlias MUST +be mapped to the 'description' leaf in the 'running' +datastore. + """ + return self.__description + + def _set_description(self, v, load=False): + """ + Setter method for description, mapped from YANG variable /interfaces/interface/config/description (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_description is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_description() directly. + + YANG Description: A textual description of the interface. + +A server implementation MAY map this leaf to the ifAlias +MIB object. Such an implementation needs to use some +mechanism to handle the differences in size and characters +allowed between this leaf and ifAlias. The definition of +such a mechanism is outside the scope of this document. + +Since ifAlias is defined to be stored in non-volatile +storage, the MIB implementation MUST map ifAlias to the +value of 'description' in the persistently stored +datastore. + +Specifically, if the device supports ':startup', when +ifAlias is read the device MUST return the value of +'description' in the 'startup' datastore, and when it is +written, it MUST be written to the 'running' and 'startup' +datastores. Note that it is up to the implementation to + +decide whether to modify this single leaf in 'startup' or +perform an implicit copy-config from 'running' to +'startup'. + +If the device does not support ':startup', ifAlias MUST +be mapped to the 'description' leaf in the 'running' +datastore. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """description must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=True)""", + }) + + self.__description = t + if hasattr(self, '_set'): + self._set() + + def _unset_description(self): + self.__description = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=True) + + + def _get_enabled(self): + """ + Getter method for enabled, mapped from YANG variable /interfaces/interface/config/enabled (boolean) + + YANG Description: This leaf contains the configured, desired state of the +interface. + +Systems that implement the IF-MIB use the value of this +leaf in the 'running' datastore to set +IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry +has been initialized, as described in RFC 2863. + +Changes in this leaf in the 'running' datastore are +reflected in ifAdminStatus, but if ifAdminStatus is +changed over SNMP, this leaf is not affected. + """ + return self.__enabled + + def _set_enabled(self, v, load=False): + """ + Setter method for enabled, mapped from YANG variable /interfaces/interface/config/enabled (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_enabled is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enabled() directly. + + YANG Description: This leaf contains the configured, desired state of the +interface. + +Systems that implement the IF-MIB use the value of this +leaf in the 'running' datastore to set +IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry +has been initialized, as described in RFC 2863. + +Changes in this leaf in the 'running' datastore are +reflected in ifAdminStatus, but if ifAdminStatus is +changed over SNMP, this leaf is not affected. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enabled must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=True)""", + }) + + self.__enabled = t + if hasattr(self, '_set'): + self._set() + + def _unset_enabled(self): + self.__enabled = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=True) + + name = __builtin__.property(_get_name, _set_name) + type = __builtin__.property(_get_type, _set_type) + mtu = __builtin__.property(_get_mtu, _set_mtu) + loopback_mode = __builtin__.property(_get_loopback_mode, _set_loopback_mode) + description = __builtin__.property(_get_description, _set_description) + enabled = __builtin__.property(_get_enabled, _set_enabled) + + + _pyangbind_elements = OrderedDict([('name', name), ('type', type), ('mtu', mtu), ('loopback_mode', loopback_mode), ('description', description), ('enabled', enabled), ]) + + diff --git a/hackfest/netconf-oc/openconfig/interfaces/interface/ethernet/__init__.py b/hackfest/netconf-oc/openconfig/interfaces/interface/ethernet/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0d56776a7581d6f16a0059ec7f3909e4aa80c41b --- /dev/null +++ b/hackfest/netconf-oc/openconfig/interfaces/interface/ethernet/__init__.py @@ -0,0 +1,156 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import config +from . import state +class ethernet(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-interfaces - based on the path /interfaces/interface/ethernet. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Top-level container for ethernet configuration +and state + """ + __slots__ = ('_path_helper', '_extmethods', '__config','__state',) + + _yang_name = 'ethernet' + _yang_namespace = 'http://openconfig.net/yang/interfaces' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='container', is_config=True) + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['interfaces', 'interface', 'ethernet'] + + def _get_config(self): + """ + Getter method for config, mapped from YANG variable /interfaces/interface/ethernet/config (container) + + YANG Description: Configuration data for ethernet interfaces + """ + return self.__config + + def _set_config(self, v, load=False): + """ + Setter method for config, mapped from YANG variable /interfaces/interface/ethernet/config (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_config is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_config() directly. + + YANG Description: Configuration data for ethernet interfaces + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """config must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='container', is_config=True)""", + }) + + self.__config = t + if hasattr(self, '_set'): + self._set() + + def _unset_config(self): + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='container', is_config=True) + + + def _get_state(self): + """ + Getter method for state, mapped from YANG variable /interfaces/interface/ethernet/state (container) + + YANG Description: State variables for Ethernet interfaces + """ + return self.__state + + def _set_state(self, v, load=False): + """ + Setter method for state, mapped from YANG variable /interfaces/interface/ethernet/state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_state() directly. + + YANG Description: State variables for Ethernet interfaces + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='container', is_config=True)""", + }) + + self.__state = t + if hasattr(self, '_set'): + self._set() + + def _unset_state(self): + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='container', is_config=True) + + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) + + + _pyangbind_elements = OrderedDict([('config', config), ('state', state), ]) + + diff --git a/hackfest/netconf-oc/openconfig/interfaces/interface/ethernet/config/__init__.py b/hackfest/netconf-oc/openconfig/interfaces/interface/ethernet/config/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d07a615a7896c294e004680cc920859df3f80b15 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/interfaces/interface/ethernet/config/__init__.py @@ -0,0 +1,416 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class config(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-interfaces - based on the path /interfaces/interface/ethernet/config. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Configuration data for ethernet interfaces + """ + __slots__ = ('_path_helper', '_extmethods', '__mac_address','__auto_negotiate','__standalone_link_training','__duplex_mode','__port_speed','__enable_flow_control','__fec_mode',) + + _yang_name = 'config' + _yang_namespace = 'http://openconfig.net/yang/interfaces' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__mac_address = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:mac-address', is_config=True) + self.__auto_negotiate = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="auto-negotiate", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=True) + self.__standalone_link_training = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="standalone-link-training", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=True) + self.__duplex_mode = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FULL': {}, 'HALF': {}},), is_leaf=True, yang_name="duplex-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='enumeration', is_config=True) + self.__port_speed = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="port-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='identityref', is_config=True) + self.__enable_flow_control = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="enable-flow-control", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=True) + self.__fec_mode = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_FC': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_FC': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS528': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS528': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS544': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS544': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS544_2X_INTERLEAVE': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS544_2X_INTERLEAVE': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_DISABLED': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_DISABLED': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="fec-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='identityref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['interfaces', 'interface', 'ethernet', 'config'] + + def _get_mac_address(self): + """ + Getter method for mac_address, mapped from YANG variable /interfaces/interface/ethernet/config/mac_address (oc-yang:mac-address) + + YANG Description: Assigns a MAC address to the Ethernet interface. If not +specified, the corresponding operational state leaf is +expected to show the system-assigned MAC address. + """ + return self.__mac_address + + def _set_mac_address(self, v, load=False): + """ + Setter method for mac_address, mapped from YANG variable /interfaces/interface/ethernet/config/mac_address (oc-yang:mac-address) + If this variable is read-only (config: false) in the + source YANG file, then _set_mac_address is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_mac_address() directly. + + YANG Description: Assigns a MAC address to the Ethernet interface. If not +specified, the corresponding operational state leaf is +expected to show the system-assigned MAC address. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:mac-address', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """mac_address must be of a type compatible with oc-yang:mac-address""", + 'defined-type': "oc-yang:mac-address", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:mac-address', is_config=True)""", + }) + + self.__mac_address = t + if hasattr(self, '_set'): + self._set() + + def _unset_mac_address(self): + self.__mac_address = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:mac-address', is_config=True) + + + def _get_auto_negotiate(self): + """ + Getter method for auto_negotiate, mapped from YANG variable /interfaces/interface/ethernet/config/auto_negotiate (boolean) + + YANG Description: Set to TRUE to request the interface to auto-negotiate +transmission parameters with its peer interface. When +set to FALSE, the transmission parameters are specified +manually. + """ + return self.__auto_negotiate + + def _set_auto_negotiate(self, v, load=False): + """ + Setter method for auto_negotiate, mapped from YANG variable /interfaces/interface/ethernet/config/auto_negotiate (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_auto_negotiate is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_auto_negotiate() directly. + + YANG Description: Set to TRUE to request the interface to auto-negotiate +transmission parameters with its peer interface. When +set to FALSE, the transmission parameters are specified +manually. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="auto-negotiate", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """auto_negotiate must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="auto-negotiate", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=True)""", + }) + + self.__auto_negotiate = t + if hasattr(self, '_set'): + self._set() + + def _unset_auto_negotiate(self): + self.__auto_negotiate = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="auto-negotiate", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=True) + + + def _get_standalone_link_training(self): + """ + Getter method for standalone_link_training, mapped from YANG variable /interfaces/interface/ethernet/config/standalone_link_training (boolean) + + YANG Description: Link training is automatic tuning of the SerDes transmit and +receive parameters to ensure an optimal connection over copper +links. It is normally run as part of the auto negotiation +sequence as specified in IEEE 802.3 Clause 73. + +Standalone link training is used when full auto negotiation is +not desired on an Ethernet link but link training is needed. +It is configured by setting the standalone-link-training leaf +to TRUE and augo-negotiate leaf to FALSE. + +Note: If auto-negotiate is true, then the value of standalone +link training leaf will be ignored. + """ + return self.__standalone_link_training + + def _set_standalone_link_training(self, v, load=False): + """ + Setter method for standalone_link_training, mapped from YANG variable /interfaces/interface/ethernet/config/standalone_link_training (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_standalone_link_training is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_standalone_link_training() directly. + + YANG Description: Link training is automatic tuning of the SerDes transmit and +receive parameters to ensure an optimal connection over copper +links. It is normally run as part of the auto negotiation +sequence as specified in IEEE 802.3 Clause 73. + +Standalone link training is used when full auto negotiation is +not desired on an Ethernet link but link training is needed. +It is configured by setting the standalone-link-training leaf +to TRUE and augo-negotiate leaf to FALSE. + +Note: If auto-negotiate is true, then the value of standalone +link training leaf will be ignored. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="standalone-link-training", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """standalone_link_training must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="standalone-link-training", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=True)""", + }) + + self.__standalone_link_training = t + if hasattr(self, '_set'): + self._set() + + def _unset_standalone_link_training(self): + self.__standalone_link_training = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="standalone-link-training", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=True) + + + def _get_duplex_mode(self): + """ + Getter method for duplex_mode, mapped from YANG variable /interfaces/interface/ethernet/config/duplex_mode (enumeration) + + YANG Description: When auto-negotiate is TRUE, this optionally sets the +duplex mode that will be advertised to the peer. If +unspecified, the interface should negotiate the duplex mode +directly (typically full-duplex). When auto-negotiate is +FALSE, this sets the duplex mode on the interface directly. + """ + return self.__duplex_mode + + def _set_duplex_mode(self, v, load=False): + """ + Setter method for duplex_mode, mapped from YANG variable /interfaces/interface/ethernet/config/duplex_mode (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_duplex_mode is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_duplex_mode() directly. + + YANG Description: When auto-negotiate is TRUE, this optionally sets the +duplex mode that will be advertised to the peer. If +unspecified, the interface should negotiate the duplex mode +directly (typically full-duplex). When auto-negotiate is +FALSE, this sets the duplex mode on the interface directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FULL': {}, 'HALF': {}},), is_leaf=True, yang_name="duplex-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='enumeration', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """duplex_mode must be of a type compatible with enumeration""", + 'defined-type': "openconfig-if-ethernet:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FULL': {}, 'HALF': {}},), is_leaf=True, yang_name="duplex-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='enumeration', is_config=True)""", + }) + + self.__duplex_mode = t + if hasattr(self, '_set'): + self._set() + + def _unset_duplex_mode(self): + self.__duplex_mode = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FULL': {}, 'HALF': {}},), is_leaf=True, yang_name="duplex-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='enumeration', is_config=True) + + + def _get_port_speed(self): + """ + Getter method for port_speed, mapped from YANG variable /interfaces/interface/ethernet/config/port_speed (identityref) + + YANG Description: When auto-negotiate is TRUE, this optionally sets the +port-speed mode that will be advertised to the peer for +negotiation. If unspecified, it is expected that the +interface will select the highest speed available based on +negotiation. When auto-negotiate is set to FALSE, sets the +link speed to a fixed value -- supported values are defined +by ETHERNET_SPEED identities + """ + return self.__port_speed + + def _set_port_speed(self, v, load=False): + """ + Setter method for port_speed, mapped from YANG variable /interfaces/interface/ethernet/config/port_speed (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_port_speed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_port_speed() directly. + + YANG Description: When auto-negotiate is TRUE, this optionally sets the +port-speed mode that will be advertised to the peer for +negotiation. If unspecified, it is expected that the +interface will select the highest speed available based on +negotiation. When auto-negotiate is set to FALSE, sets the +link speed to a fixed value -- supported values are defined +by ETHERNET_SPEED identities + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="port-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """port_speed must be of a type compatible with identityref""", + 'defined-type': "openconfig-if-ethernet:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="port-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='identityref', is_config=True)""", + }) + + self.__port_speed = t + if hasattr(self, '_set'): + self._set() + + def _unset_port_speed(self): + self.__port_speed = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="port-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='identityref', is_config=True) + + + def _get_enable_flow_control(self): + """ + Getter method for enable_flow_control, mapped from YANG variable /interfaces/interface/ethernet/config/enable_flow_control (boolean) + + YANG Description: Enable or disable flow control for this interface. +Ethernet flow control is a mechanism by which a receiver +may send PAUSE frames to a sender to stop transmission for +a specified time. + +This setting should override auto-negotiated flow control +settings. If left unspecified, and auto-negotiate is TRUE, +flow control mode is negotiated with the peer interface. + """ + return self.__enable_flow_control + + def _set_enable_flow_control(self, v, load=False): + """ + Setter method for enable_flow_control, mapped from YANG variable /interfaces/interface/ethernet/config/enable_flow_control (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_enable_flow_control is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enable_flow_control() directly. + + YANG Description: Enable or disable flow control for this interface. +Ethernet flow control is a mechanism by which a receiver +may send PAUSE frames to a sender to stop transmission for +a specified time. + +This setting should override auto-negotiated flow control +settings. If left unspecified, and auto-negotiate is TRUE, +flow control mode is negotiated with the peer interface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="enable-flow-control", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enable_flow_control must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="enable-flow-control", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=True)""", + }) + + self.__enable_flow_control = t + if hasattr(self, '_set'): + self._set() + + def _unset_enable_flow_control(self): + self.__enable_flow_control = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="enable-flow-control", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=True) + + + def _get_fec_mode(self): + """ + Getter method for fec_mode, mapped from YANG variable /interfaces/interface/ethernet/config/fec_mode (identityref) + + YANG Description: The FEC mode applied to the physical channels associated with +the interface. + """ + return self.__fec_mode + + def _set_fec_mode(self, v, load=False): + """ + Setter method for fec_mode, mapped from YANG variable /interfaces/interface/ethernet/config/fec_mode (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_fec_mode is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_fec_mode() directly. + + YANG Description: The FEC mode applied to the physical channels associated with +the interface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_FC': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_FC': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS528': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS528': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS544': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS544': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS544_2X_INTERLEAVE': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS544_2X_INTERLEAVE': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_DISABLED': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_DISABLED': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="fec-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='identityref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """fec_mode must be of a type compatible with identityref""", + 'defined-type': "openconfig-if-ethernet:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_FC': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_FC': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS528': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS528': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS544': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS544': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS544_2X_INTERLEAVE': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS544_2X_INTERLEAVE': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_DISABLED': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_DISABLED': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="fec-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='identityref', is_config=True)""", + }) + + self.__fec_mode = t + if hasattr(self, '_set'): + self._set() + + def _unset_fec_mode(self): + self.__fec_mode = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_FC': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_FC': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS528': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS528': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS544': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS544': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS544_2X_INTERLEAVE': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS544_2X_INTERLEAVE': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_DISABLED': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_DISABLED': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="fec-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='identityref', is_config=True) + + mac_address = __builtin__.property(_get_mac_address, _set_mac_address) + auto_negotiate = __builtin__.property(_get_auto_negotiate, _set_auto_negotiate) + standalone_link_training = __builtin__.property(_get_standalone_link_training, _set_standalone_link_training) + duplex_mode = __builtin__.property(_get_duplex_mode, _set_duplex_mode) + port_speed = __builtin__.property(_get_port_speed, _set_port_speed) + enable_flow_control = __builtin__.property(_get_enable_flow_control, _set_enable_flow_control) + fec_mode = __builtin__.property(_get_fec_mode, _set_fec_mode) + + + _pyangbind_elements = OrderedDict([('mac_address', mac_address), ('auto_negotiate', auto_negotiate), ('standalone_link_training', standalone_link_training), ('duplex_mode', duplex_mode), ('port_speed', port_speed), ('enable_flow_control', enable_flow_control), ('fec_mode', fec_mode), ]) + + diff --git a/hackfest/netconf-oc/openconfig/interfaces/interface/ethernet/state/__init__.py b/hackfest/netconf-oc/openconfig/interfaces/interface/ethernet/state/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..07b61c4c08146ce5641faf9efa6188fe84d7d55c --- /dev/null +++ b/hackfest/netconf-oc/openconfig/interfaces/interface/ethernet/state/__init__.py @@ -0,0 +1,583 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import counters +class state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-interfaces - based on the path /interfaces/interface/ethernet/state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: State variables for Ethernet interfaces + """ + __slots__ = ('_path_helper', '_extmethods', '__mac_address','__auto_negotiate','__standalone_link_training','__duplex_mode','__port_speed','__enable_flow_control','__fec_mode','__hw_mac_address','__negotiated_duplex_mode','__negotiated_port_speed','__counters',) + + _yang_name = 'state' + _yang_namespace = 'http://openconfig.net/yang/interfaces' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__mac_address = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:mac-address', is_config=False) + self.__auto_negotiate = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="auto-negotiate", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=False) + self.__standalone_link_training = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="standalone-link-training", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=False) + self.__duplex_mode = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FULL': {}, 'HALF': {}},), is_leaf=True, yang_name="duplex-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='enumeration', is_config=False) + self.__port_speed = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="port-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='identityref', is_config=False) + self.__enable_flow_control = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="enable-flow-control", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=False) + self.__fec_mode = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_FC': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_FC': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS528': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS528': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS544': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS544': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS544_2X_INTERLEAVE': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS544_2X_INTERLEAVE': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_DISABLED': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_DISABLED': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="fec-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='identityref', is_config=False) + self.__hw_mac_address = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="hw-mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:mac-address', is_config=False) + self.__negotiated_duplex_mode = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FULL': {}, 'HALF': {}},), is_leaf=True, yang_name="negotiated-duplex-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='enumeration', is_config=False) + self.__negotiated_port_speed = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="negotiated-port-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='identityref', is_config=False) + self.__counters = YANGDynClass(base=counters.counters, is_container='container', yang_name="counters", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['interfaces', 'interface', 'ethernet', 'state'] + + def _get_mac_address(self): + """ + Getter method for mac_address, mapped from YANG variable /interfaces/interface/ethernet/state/mac_address (oc-yang:mac-address) + + YANG Description: Assigns a MAC address to the Ethernet interface. If not +specified, the corresponding operational state leaf is +expected to show the system-assigned MAC address. + """ + return self.__mac_address + + def _set_mac_address(self, v, load=False): + """ + Setter method for mac_address, mapped from YANG variable /interfaces/interface/ethernet/state/mac_address (oc-yang:mac-address) + If this variable is read-only (config: false) in the + source YANG file, then _set_mac_address is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_mac_address() directly. + + YANG Description: Assigns a MAC address to the Ethernet interface. If not +specified, the corresponding operational state leaf is +expected to show the system-assigned MAC address. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:mac-address', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """mac_address must be of a type compatible with oc-yang:mac-address""", + 'defined-type': "oc-yang:mac-address", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:mac-address', is_config=False)""", + }) + + self.__mac_address = t + if hasattr(self, '_set'): + self._set() + + def _unset_mac_address(self): + self.__mac_address = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:mac-address', is_config=False) + + + def _get_auto_negotiate(self): + """ + Getter method for auto_negotiate, mapped from YANG variable /interfaces/interface/ethernet/state/auto_negotiate (boolean) + + YANG Description: Set to TRUE to request the interface to auto-negotiate +transmission parameters with its peer interface. When +set to FALSE, the transmission parameters are specified +manually. + """ + return self.__auto_negotiate + + def _set_auto_negotiate(self, v, load=False): + """ + Setter method for auto_negotiate, mapped from YANG variable /interfaces/interface/ethernet/state/auto_negotiate (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_auto_negotiate is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_auto_negotiate() directly. + + YANG Description: Set to TRUE to request the interface to auto-negotiate +transmission parameters with its peer interface. When +set to FALSE, the transmission parameters are specified +manually. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="auto-negotiate", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """auto_negotiate must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="auto-negotiate", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=False)""", + }) + + self.__auto_negotiate = t + if hasattr(self, '_set'): + self._set() + + def _unset_auto_negotiate(self): + self.__auto_negotiate = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="auto-negotiate", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=False) + + + def _get_standalone_link_training(self): + """ + Getter method for standalone_link_training, mapped from YANG variable /interfaces/interface/ethernet/state/standalone_link_training (boolean) + + YANG Description: Link training is automatic tuning of the SerDes transmit and +receive parameters to ensure an optimal connection over copper +links. It is normally run as part of the auto negotiation +sequence as specified in IEEE 802.3 Clause 73. + +Standalone link training is used when full auto negotiation is +not desired on an Ethernet link but link training is needed. +It is configured by setting the standalone-link-training leaf +to TRUE and augo-negotiate leaf to FALSE. + +Note: If auto-negotiate is true, then the value of standalone +link training leaf will be ignored. + """ + return self.__standalone_link_training + + def _set_standalone_link_training(self, v, load=False): + """ + Setter method for standalone_link_training, mapped from YANG variable /interfaces/interface/ethernet/state/standalone_link_training (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_standalone_link_training is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_standalone_link_training() directly. + + YANG Description: Link training is automatic tuning of the SerDes transmit and +receive parameters to ensure an optimal connection over copper +links. It is normally run as part of the auto negotiation +sequence as specified in IEEE 802.3 Clause 73. + +Standalone link training is used when full auto negotiation is +not desired on an Ethernet link but link training is needed. +It is configured by setting the standalone-link-training leaf +to TRUE and augo-negotiate leaf to FALSE. + +Note: If auto-negotiate is true, then the value of standalone +link training leaf will be ignored. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="standalone-link-training", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """standalone_link_training must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="standalone-link-training", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=False)""", + }) + + self.__standalone_link_training = t + if hasattr(self, '_set'): + self._set() + + def _unset_standalone_link_training(self): + self.__standalone_link_training = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="standalone-link-training", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=False) + + + def _get_duplex_mode(self): + """ + Getter method for duplex_mode, mapped from YANG variable /interfaces/interface/ethernet/state/duplex_mode (enumeration) + + YANG Description: When auto-negotiate is TRUE, this optionally sets the +duplex mode that will be advertised to the peer. If +unspecified, the interface should negotiate the duplex mode +directly (typically full-duplex). When auto-negotiate is +FALSE, this sets the duplex mode on the interface directly. + """ + return self.__duplex_mode + + def _set_duplex_mode(self, v, load=False): + """ + Setter method for duplex_mode, mapped from YANG variable /interfaces/interface/ethernet/state/duplex_mode (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_duplex_mode is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_duplex_mode() directly. + + YANG Description: When auto-negotiate is TRUE, this optionally sets the +duplex mode that will be advertised to the peer. If +unspecified, the interface should negotiate the duplex mode +directly (typically full-duplex). When auto-negotiate is +FALSE, this sets the duplex mode on the interface directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FULL': {}, 'HALF': {}},), is_leaf=True, yang_name="duplex-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='enumeration', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """duplex_mode must be of a type compatible with enumeration""", + 'defined-type': "openconfig-if-ethernet:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FULL': {}, 'HALF': {}},), is_leaf=True, yang_name="duplex-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='enumeration', is_config=False)""", + }) + + self.__duplex_mode = t + if hasattr(self, '_set'): + self._set() + + def _unset_duplex_mode(self): + self.__duplex_mode = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FULL': {}, 'HALF': {}},), is_leaf=True, yang_name="duplex-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='enumeration', is_config=False) + + + def _get_port_speed(self): + """ + Getter method for port_speed, mapped from YANG variable /interfaces/interface/ethernet/state/port_speed (identityref) + + YANG Description: When auto-negotiate is TRUE, this optionally sets the +port-speed mode that will be advertised to the peer for +negotiation. If unspecified, it is expected that the +interface will select the highest speed available based on +negotiation. When auto-negotiate is set to FALSE, sets the +link speed to a fixed value -- supported values are defined +by ETHERNET_SPEED identities + """ + return self.__port_speed + + def _set_port_speed(self, v, load=False): + """ + Setter method for port_speed, mapped from YANG variable /interfaces/interface/ethernet/state/port_speed (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_port_speed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_port_speed() directly. + + YANG Description: When auto-negotiate is TRUE, this optionally sets the +port-speed mode that will be advertised to the peer for +negotiation. If unspecified, it is expected that the +interface will select the highest speed available based on +negotiation. When auto-negotiate is set to FALSE, sets the +link speed to a fixed value -- supported values are defined +by ETHERNET_SPEED identities + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="port-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """port_speed must be of a type compatible with identityref""", + 'defined-type': "openconfig-if-ethernet:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="port-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='identityref', is_config=False)""", + }) + + self.__port_speed = t + if hasattr(self, '_set'): + self._set() + + def _unset_port_speed(self): + self.__port_speed = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="port-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='identityref', is_config=False) + + + def _get_enable_flow_control(self): + """ + Getter method for enable_flow_control, mapped from YANG variable /interfaces/interface/ethernet/state/enable_flow_control (boolean) + + YANG Description: Enable or disable flow control for this interface. +Ethernet flow control is a mechanism by which a receiver +may send PAUSE frames to a sender to stop transmission for +a specified time. + +This setting should override auto-negotiated flow control +settings. If left unspecified, and auto-negotiate is TRUE, +flow control mode is negotiated with the peer interface. + """ + return self.__enable_flow_control + + def _set_enable_flow_control(self, v, load=False): + """ + Setter method for enable_flow_control, mapped from YANG variable /interfaces/interface/ethernet/state/enable_flow_control (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_enable_flow_control is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enable_flow_control() directly. + + YANG Description: Enable or disable flow control for this interface. +Ethernet flow control is a mechanism by which a receiver +may send PAUSE frames to a sender to stop transmission for +a specified time. + +This setting should override auto-negotiated flow control +settings. If left unspecified, and auto-negotiate is TRUE, +flow control mode is negotiated with the peer interface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="enable-flow-control", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enable_flow_control must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="enable-flow-control", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=False)""", + }) + + self.__enable_flow_control = t + if hasattr(self, '_set'): + self._set() + + def _unset_enable_flow_control(self): + self.__enable_flow_control = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="enable-flow-control", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='boolean', is_config=False) + + + def _get_fec_mode(self): + """ + Getter method for fec_mode, mapped from YANG variable /interfaces/interface/ethernet/state/fec_mode (identityref) + + YANG Description: The FEC mode applied to the physical channels associated with +the interface. + """ + return self.__fec_mode + + def _set_fec_mode(self, v, load=False): + """ + Setter method for fec_mode, mapped from YANG variable /interfaces/interface/ethernet/state/fec_mode (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_fec_mode is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_fec_mode() directly. + + YANG Description: The FEC mode applied to the physical channels associated with +the interface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_FC': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_FC': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS528': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS528': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS544': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS544': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS544_2X_INTERLEAVE': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS544_2X_INTERLEAVE': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_DISABLED': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_DISABLED': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="fec-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """fec_mode must be of a type compatible with identityref""", + 'defined-type': "openconfig-if-ethernet:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_FC': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_FC': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS528': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS528': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS544': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS544': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS544_2X_INTERLEAVE': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS544_2X_INTERLEAVE': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_DISABLED': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_DISABLED': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="fec-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='identityref', is_config=False)""", + }) + + self.__fec_mode = t + if hasattr(self, '_set'): + self._set() + + def _unset_fec_mode(self): + self.__fec_mode = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FEC_FC': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_FC': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS528': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS528': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS544': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS544': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_RS544_2X_INTERLEAVE': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_RS544_2X_INTERLEAVE': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'FEC_DISABLED': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:FEC_DISABLED': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="fec-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='identityref', is_config=False) + + + def _get_hw_mac_address(self): + """ + Getter method for hw_mac_address, mapped from YANG variable /interfaces/interface/ethernet/state/hw_mac_address (oc-yang:mac-address) + + YANG Description: Represents the 'burned-in', or system-assigned, MAC +address for the Ethernet interface. + """ + return self.__hw_mac_address + + def _set_hw_mac_address(self, v, load=False): + """ + Setter method for hw_mac_address, mapped from YANG variable /interfaces/interface/ethernet/state/hw_mac_address (oc-yang:mac-address) + If this variable is read-only (config: false) in the + source YANG file, then _set_hw_mac_address is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hw_mac_address() directly. + + YANG Description: Represents the 'burned-in', or system-assigned, MAC +address for the Ethernet interface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="hw-mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:mac-address', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hw_mac_address must be of a type compatible with oc-yang:mac-address""", + 'defined-type': "oc-yang:mac-address", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="hw-mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:mac-address', is_config=False)""", + }) + + self.__hw_mac_address = t + if hasattr(self, '_set'): + self._set() + + def _unset_hw_mac_address(self): + self.__hw_mac_address = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="hw-mac-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:mac-address', is_config=False) + + + def _get_negotiated_duplex_mode(self): + """ + Getter method for negotiated_duplex_mode, mapped from YANG variable /interfaces/interface/ethernet/state/negotiated_duplex_mode (enumeration) + + YANG Description: When auto-negotiate is set to TRUE, and the interface has +completed auto-negotiation with the remote peer, this value +shows the duplex mode that has been negotiated. + """ + return self.__negotiated_duplex_mode + + def _set_negotiated_duplex_mode(self, v, load=False): + """ + Setter method for negotiated_duplex_mode, mapped from YANG variable /interfaces/interface/ethernet/state/negotiated_duplex_mode (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_negotiated_duplex_mode is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_negotiated_duplex_mode() directly. + + YANG Description: When auto-negotiate is set to TRUE, and the interface has +completed auto-negotiation with the remote peer, this value +shows the duplex mode that has been negotiated. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FULL': {}, 'HALF': {}},), is_leaf=True, yang_name="negotiated-duplex-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='enumeration', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """negotiated_duplex_mode must be of a type compatible with enumeration""", + 'defined-type': "openconfig-if-ethernet:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FULL': {}, 'HALF': {}},), is_leaf=True, yang_name="negotiated-duplex-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='enumeration', is_config=False)""", + }) + + self.__negotiated_duplex_mode = t + if hasattr(self, '_set'): + self._set() + + def _unset_negotiated_duplex_mode(self): + self.__negotiated_duplex_mode = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'FULL': {}, 'HALF': {}},), is_leaf=True, yang_name="negotiated-duplex-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='enumeration', is_config=False) + + + def _get_negotiated_port_speed(self): + """ + Getter method for negotiated_port_speed, mapped from YANG variable /interfaces/interface/ethernet/state/negotiated_port_speed (identityref) + + YANG Description: When auto-negotiate is set to TRUE, and the interface has +completed auto-negotiation with the remote peer, this value +shows the interface speed that has been negotiated. + """ + return self.__negotiated_port_speed + + def _set_negotiated_port_speed(self, v, load=False): + """ + Setter method for negotiated_port_speed, mapped from YANG variable /interfaces/interface/ethernet/state/negotiated_port_speed (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_negotiated_port_speed is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_negotiated_port_speed() directly. + + YANG Description: When auto-negotiate is set to TRUE, and the interface has +completed auto-negotiation with the remote peer, this value +shows the interface speed that has been negotiated. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="negotiated-port-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """negotiated_port_speed must be of a type compatible with identityref""", + 'defined-type': "openconfig-if-ethernet:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="negotiated-port-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='identityref', is_config=False)""", + }) + + self.__negotiated_port_speed = t + if hasattr(self, '_set'): + self._set() + + def _unset_negotiated_port_speed(self): + self.__negotiated_port_speed = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_1GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_2500MB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_5GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_10GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_25GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_40GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_50GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_100GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_200GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_400GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_600GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_800GB': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}, 'oc-eth:SPEED_UNKNOWN': {'@module': 'openconfig-if-ethernet', '@namespace': 'http://openconfig.net/yang/interfaces/ethernet'}},), is_leaf=True, yang_name="negotiated-port-speed", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='identityref', is_config=False) + + + def _get_counters(self): + """ + Getter method for counters, mapped from YANG variable /interfaces/interface/ethernet/state/counters (container) + + YANG Description: Ethernet interface counters + """ + return self.__counters + + def _set_counters(self, v, load=False): + """ + Setter method for counters, mapped from YANG variable /interfaces/interface/ethernet/state/counters (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_counters is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_counters() directly. + + YANG Description: Ethernet interface counters + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=counters.counters, is_container='container', yang_name="counters", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """counters must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=counters.counters, is_container='container', yang_name="counters", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='container', is_config=False)""", + }) + + self.__counters = t + if hasattr(self, '_set'): + self._set() + + def _unset_counters(self): + self.__counters = YANGDynClass(base=counters.counters, is_container='container', yang_name="counters", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='container', is_config=False) + + mac_address = __builtin__.property(_get_mac_address) + auto_negotiate = __builtin__.property(_get_auto_negotiate) + standalone_link_training = __builtin__.property(_get_standalone_link_training) + duplex_mode = __builtin__.property(_get_duplex_mode) + port_speed = __builtin__.property(_get_port_speed) + enable_flow_control = __builtin__.property(_get_enable_flow_control) + fec_mode = __builtin__.property(_get_fec_mode) + hw_mac_address = __builtin__.property(_get_hw_mac_address) + negotiated_duplex_mode = __builtin__.property(_get_negotiated_duplex_mode) + negotiated_port_speed = __builtin__.property(_get_negotiated_port_speed) + counters = __builtin__.property(_get_counters) + + + _pyangbind_elements = OrderedDict([('mac_address', mac_address), ('auto_negotiate', auto_negotiate), ('standalone_link_training', standalone_link_training), ('duplex_mode', duplex_mode), ('port_speed', port_speed), ('enable_flow_control', enable_flow_control), ('fec_mode', fec_mode), ('hw_mac_address', hw_mac_address), ('negotiated_duplex_mode', negotiated_duplex_mode), ('negotiated_port_speed', negotiated_port_speed), ('counters', counters), ]) + + diff --git a/hackfest/netconf-oc/openconfig/interfaces/interface/ethernet/state/counters/__init__.py b/hackfest/netconf-oc/openconfig/interfaces/interface/ethernet/state/counters/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7387174585ced25cd6461839f76702d29e434ceb --- /dev/null +++ b/hackfest/netconf-oc/openconfig/interfaces/interface/ethernet/state/counters/__init__.py @@ -0,0 +1,951 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class counters(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-interfaces - based on the path /interfaces/interface/ethernet/state/counters. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Ethernet interface counters + """ + __slots__ = ('_path_helper', '_extmethods', '__in_mac_control_frames','__in_mac_pause_frames','__in_oversize_frames','__in_undersize_frames','__in_jabber_frames','__in_fragment_frames','__in_8021q_frames','__in_crc_errors','__in_block_errors','__in_carrier_errors','__in_interrupted_tx','__in_late_collision','__in_mac_errors_rx','__in_single_collision','__in_symbol_error','__in_maxsize_exceeded','__out_mac_control_frames','__out_mac_pause_frames','__out_8021q_frames','__out_mac_errors_tx',) + + _yang_name = 'counters' + _yang_namespace = 'http://openconfig.net/yang/interfaces' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__in_mac_control_frames = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-mac-control-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + self.__in_mac_pause_frames = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-mac-pause-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + self.__in_oversize_frames = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-oversize-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + self.__in_undersize_frames = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-undersize-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + self.__in_jabber_frames = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-jabber-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + self.__in_fragment_frames = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-fragment-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + self.__in_8021q_frames = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-8021q-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + self.__in_crc_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-crc-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + self.__in_block_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-block-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + self.__in_carrier_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-carrier-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + self.__in_interrupted_tx = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-interrupted-tx", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + self.__in_late_collision = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-late-collision", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + self.__in_mac_errors_rx = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-mac-errors-rx", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + self.__in_single_collision = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-single-collision", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + self.__in_symbol_error = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-symbol-error", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + self.__in_maxsize_exceeded = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-maxsize-exceeded", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + self.__out_mac_control_frames = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-mac-control-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + self.__out_mac_pause_frames = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-mac-pause-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + self.__out_8021q_frames = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-8021q-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + self.__out_mac_errors_tx = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-mac-errors-tx", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['interfaces', 'interface', 'ethernet', 'state', 'counters'] + + def _get_in_mac_control_frames(self): + """ + Getter method for in_mac_control_frames, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_mac_control_frames (oc-yang:counter64) + + YANG Description: MAC layer control frames received on the interface + """ + return self.__in_mac_control_frames + + def _set_in_mac_control_frames(self, v, load=False): + """ + Setter method for in_mac_control_frames, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_mac_control_frames (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_mac_control_frames is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_mac_control_frames() directly. + + YANG Description: MAC layer control frames received on the interface + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-mac-control-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_mac_control_frames must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-mac-control-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_mac_control_frames = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_mac_control_frames(self): + self.__in_mac_control_frames = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-mac-control-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_mac_pause_frames(self): + """ + Getter method for in_mac_pause_frames, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_mac_pause_frames (oc-yang:counter64) + + YANG Description: MAC layer PAUSE frames received on the interface + """ + return self.__in_mac_pause_frames + + def _set_in_mac_pause_frames(self, v, load=False): + """ + Setter method for in_mac_pause_frames, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_mac_pause_frames (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_mac_pause_frames is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_mac_pause_frames() directly. + + YANG Description: MAC layer PAUSE frames received on the interface + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-mac-pause-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_mac_pause_frames must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-mac-pause-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_mac_pause_frames = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_mac_pause_frames(self): + self.__in_mac_pause_frames = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-mac-pause-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_oversize_frames(self): + """ + Getter method for in_oversize_frames, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_oversize_frames (oc-yang:counter64) + + YANG Description: The total number of frames received that were +longer than 1518 octets (excluding framing bits, +but including FCS octets) and were otherwise +well formed. + """ + return self.__in_oversize_frames + + def _set_in_oversize_frames(self, v, load=False): + """ + Setter method for in_oversize_frames, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_oversize_frames (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_oversize_frames is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_oversize_frames() directly. + + YANG Description: The total number of frames received that were +longer than 1518 octets (excluding framing bits, +but including FCS octets) and were otherwise +well formed. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-oversize-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_oversize_frames must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-oversize-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_oversize_frames = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_oversize_frames(self): + self.__in_oversize_frames = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-oversize-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_undersize_frames(self): + """ + Getter method for in_undersize_frames, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_undersize_frames (oc-yang:counter64) + + YANG Description: The total number of frames received that were +less than 64 octets long (excluding framing bits, +but including FCS octets) and were otherwise well +formed. + """ + return self.__in_undersize_frames + + def _set_in_undersize_frames(self, v, load=False): + """ + Setter method for in_undersize_frames, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_undersize_frames (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_undersize_frames is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_undersize_frames() directly. + + YANG Description: The total number of frames received that were +less than 64 octets long (excluding framing bits, +but including FCS octets) and were otherwise well +formed. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-undersize-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_undersize_frames must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-undersize-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_undersize_frames = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_undersize_frames(self): + self.__in_undersize_frames = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-undersize-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_jabber_frames(self): + """ + Getter method for in_jabber_frames, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_jabber_frames (oc-yang:counter64) + + YANG Description: Number of jabber frames received on the +interface. Jabber frames are typically defined as oversize +frames which also have a bad CRC. Implementations may use +slightly different definitions of what constitutes a jabber +frame. Often indicative of a NIC hardware problem. + """ + return self.__in_jabber_frames + + def _set_in_jabber_frames(self, v, load=False): + """ + Setter method for in_jabber_frames, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_jabber_frames (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_jabber_frames is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_jabber_frames() directly. + + YANG Description: Number of jabber frames received on the +interface. Jabber frames are typically defined as oversize +frames which also have a bad CRC. Implementations may use +slightly different definitions of what constitutes a jabber +frame. Often indicative of a NIC hardware problem. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-jabber-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_jabber_frames must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-jabber-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_jabber_frames = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_jabber_frames(self): + self.__in_jabber_frames = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-jabber-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_fragment_frames(self): + """ + Getter method for in_fragment_frames, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_fragment_frames (oc-yang:counter64) + + YANG Description: The total number of frames received that were less than +64 octets in length (excluding framing bits but including +FCS octets) and had either a bad Frame Check Sequence +(FCS) with an integral number of octets (FCS Error) or a +bad FCS with a non-integral number of octets (Alignment +Error). + """ + return self.__in_fragment_frames + + def _set_in_fragment_frames(self, v, load=False): + """ + Setter method for in_fragment_frames, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_fragment_frames (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_fragment_frames is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_fragment_frames() directly. + + YANG Description: The total number of frames received that were less than +64 octets in length (excluding framing bits but including +FCS octets) and had either a bad Frame Check Sequence +(FCS) with an integral number of octets (FCS Error) or a +bad FCS with a non-integral number of octets (Alignment +Error). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-fragment-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_fragment_frames must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-fragment-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_fragment_frames = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_fragment_frames(self): + self.__in_fragment_frames = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-fragment-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_8021q_frames(self): + """ + Getter method for in_8021q_frames, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_8021q_frames (oc-yang:counter64) + + YANG Description: Number of 802.1q tagged frames received on the interface + """ + return self.__in_8021q_frames + + def _set_in_8021q_frames(self, v, load=False): + """ + Setter method for in_8021q_frames, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_8021q_frames (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_8021q_frames is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_8021q_frames() directly. + + YANG Description: Number of 802.1q tagged frames received on the interface + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-8021q-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_8021q_frames must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-8021q-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_8021q_frames = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_8021q_frames(self): + self.__in_8021q_frames = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-8021q-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_crc_errors(self): + """ + Getter method for in_crc_errors, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_crc_errors (oc-yang:counter64) + + YANG Description: The total number of frames received that +had a length (excluding framing bits, but +including FCS octets) of between 64 and 1518 +octets, inclusive, but had either a bad +Frame Check Sequence (FCS) with an integral +number of octets (FCS Error) or a bad FCS with +a non-integral number of octets (Alignment Error) + """ + return self.__in_crc_errors + + def _set_in_crc_errors(self, v, load=False): + """ + Setter method for in_crc_errors, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_crc_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_crc_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_crc_errors() directly. + + YANG Description: The total number of frames received that +had a length (excluding framing bits, but +including FCS octets) of between 64 and 1518 +octets, inclusive, but had either a bad +Frame Check Sequence (FCS) with an integral +number of octets (FCS Error) or a bad FCS with +a non-integral number of octets (Alignment Error) + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-crc-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_crc_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-crc-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_crc_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_crc_errors(self): + self.__in_crc_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-crc-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_block_errors(self): + """ + Getter method for in_block_errors, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_block_errors (oc-yang:counter64) + + YANG Description: The number of received errored blocks. Error detection codes +are capable of detecting whether one or more errors have +occurred in a given sequence of bits – the block. It is +normally not possible to determine the exact number of errored +bits within the block + """ + return self.__in_block_errors + + def _set_in_block_errors(self, v, load=False): + """ + Setter method for in_block_errors, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_block_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_block_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_block_errors() directly. + + YANG Description: The number of received errored blocks. Error detection codes +are capable of detecting whether one or more errors have +occurred in a given sequence of bits – the block. It is +normally not possible to determine the exact number of errored +bits within the block + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-block-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_block_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-block-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_block_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_block_errors(self): + self.__in_block_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-block-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_carrier_errors(self): + """ + Getter method for in_carrier_errors, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_carrier_errors (oc-yang:counter64) + + YANG Description: The number of received errored frames due to a carrier issue. +The value refers to MIB counter for +dot3StatsCarrierSenseErrors +oid=1.3.6.1.2.1.10.7.2.1.11 + """ + return self.__in_carrier_errors + + def _set_in_carrier_errors(self, v, load=False): + """ + Setter method for in_carrier_errors, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_carrier_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_carrier_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_carrier_errors() directly. + + YANG Description: The number of received errored frames due to a carrier issue. +The value refers to MIB counter for +dot3StatsCarrierSenseErrors +oid=1.3.6.1.2.1.10.7.2.1.11 + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-carrier-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_carrier_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-carrier-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_carrier_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_carrier_errors(self): + self.__in_carrier_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-carrier-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_interrupted_tx(self): + """ + Getter method for in_interrupted_tx, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_interrupted_tx (oc-yang:counter64) + + YANG Description: The number of received errored frames due to interrupted +transmission issue. The value refers to MIB counter for +dot3StatsDeferredTransmissions +oid=1.3.6.1.2.1.10.7.2.1.7 + """ + return self.__in_interrupted_tx + + def _set_in_interrupted_tx(self, v, load=False): + """ + Setter method for in_interrupted_tx, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_interrupted_tx (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_interrupted_tx is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_interrupted_tx() directly. + + YANG Description: The number of received errored frames due to interrupted +transmission issue. The value refers to MIB counter for +dot3StatsDeferredTransmissions +oid=1.3.6.1.2.1.10.7.2.1.7 + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-interrupted-tx", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_interrupted_tx must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-interrupted-tx", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_interrupted_tx = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_interrupted_tx(self): + self.__in_interrupted_tx = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-interrupted-tx", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_late_collision(self): + """ + Getter method for in_late_collision, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_late_collision (oc-yang:counter64) + + YANG Description: The number of received errored frames due to late collision +issue. The value refers to MIB counter for +dot3StatsLateCollisions +oid=1.3.6.1.2.1.10.7.2.1.8 + """ + return self.__in_late_collision + + def _set_in_late_collision(self, v, load=False): + """ + Setter method for in_late_collision, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_late_collision (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_late_collision is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_late_collision() directly. + + YANG Description: The number of received errored frames due to late collision +issue. The value refers to MIB counter for +dot3StatsLateCollisions +oid=1.3.6.1.2.1.10.7.2.1.8 + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-late-collision", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_late_collision must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-late-collision", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_late_collision = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_late_collision(self): + self.__in_late_collision = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-late-collision", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_mac_errors_rx(self): + """ + Getter method for in_mac_errors_rx, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_mac_errors_rx (oc-yang:counter64) + + YANG Description: The number of received errored frames due to MAC errors +received. The value refers to MIB counter for +dot3StatsInternalMacReceiveErrors +oid=1.3.6.1.2.1.10.7.2.1.16 + """ + return self.__in_mac_errors_rx + + def _set_in_mac_errors_rx(self, v, load=False): + """ + Setter method for in_mac_errors_rx, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_mac_errors_rx (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_mac_errors_rx is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_mac_errors_rx() directly. + + YANG Description: The number of received errored frames due to MAC errors +received. The value refers to MIB counter for +dot3StatsInternalMacReceiveErrors +oid=1.3.6.1.2.1.10.7.2.1.16 + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-mac-errors-rx", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_mac_errors_rx must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-mac-errors-rx", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_mac_errors_rx = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_mac_errors_rx(self): + self.__in_mac_errors_rx = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-mac-errors-rx", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_single_collision(self): + """ + Getter method for in_single_collision, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_single_collision (oc-yang:counter64) + + YANG Description: The number of received errored frames due to single collision +issue. The value refers to MIB counter for +dot3StatsSingleCollisionFrames +oid=1.3.6.1.2.1.10.7.2.1.4 + """ + return self.__in_single_collision + + def _set_in_single_collision(self, v, load=False): + """ + Setter method for in_single_collision, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_single_collision (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_single_collision is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_single_collision() directly. + + YANG Description: The number of received errored frames due to single collision +issue. The value refers to MIB counter for +dot3StatsSingleCollisionFrames +oid=1.3.6.1.2.1.10.7.2.1.4 + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-single-collision", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_single_collision must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-single-collision", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_single_collision = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_single_collision(self): + self.__in_single_collision = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-single-collision", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_symbol_error(self): + """ + Getter method for in_symbol_error, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_symbol_error (oc-yang:counter64) + + YANG Description: The number of received errored frames due to symbol error. +The value refers to MIB counter for +in-symbol-error +oid=1.3.6.1.2.1.10.7.2.1.18 + """ + return self.__in_symbol_error + + def _set_in_symbol_error(self, v, load=False): + """ + Setter method for in_symbol_error, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_symbol_error (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_symbol_error is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_symbol_error() directly. + + YANG Description: The number of received errored frames due to symbol error. +The value refers to MIB counter for +in-symbol-error +oid=1.3.6.1.2.1.10.7.2.1.18 + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-symbol-error", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_symbol_error must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-symbol-error", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_symbol_error = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_symbol_error(self): + self.__in_symbol_error = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-symbol-error", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_maxsize_exceeded(self): + """ + Getter method for in_maxsize_exceeded, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_maxsize_exceeded (oc-yang:counter64) + + YANG Description: The total number frames received that are well-formed but +dropped due to exceeding the maximum frame size on the interface +(e.g., MTU or MRU) + """ + return self.__in_maxsize_exceeded + + def _set_in_maxsize_exceeded(self, v, load=False): + """ + Setter method for in_maxsize_exceeded, mapped from YANG variable /interfaces/interface/ethernet/state/counters/in_maxsize_exceeded (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_maxsize_exceeded is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_maxsize_exceeded() directly. + + YANG Description: The total number frames received that are well-formed but +dropped due to exceeding the maximum frame size on the interface +(e.g., MTU or MRU) + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-maxsize-exceeded", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_maxsize_exceeded must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-maxsize-exceeded", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_maxsize_exceeded = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_maxsize_exceeded(self): + self.__in_maxsize_exceeded = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-maxsize-exceeded", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + + + def _get_out_mac_control_frames(self): + """ + Getter method for out_mac_control_frames, mapped from YANG variable /interfaces/interface/ethernet/state/counters/out_mac_control_frames (oc-yang:counter64) + + YANG Description: MAC layer control frames sent on the interface + """ + return self.__out_mac_control_frames + + def _set_out_mac_control_frames(self, v, load=False): + """ + Setter method for out_mac_control_frames, mapped from YANG variable /interfaces/interface/ethernet/state/counters/out_mac_control_frames (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_out_mac_control_frames is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_out_mac_control_frames() directly. + + YANG Description: MAC layer control frames sent on the interface + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-mac-control-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """out_mac_control_frames must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-mac-control-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__out_mac_control_frames = t + if hasattr(self, '_set'): + self._set() + + def _unset_out_mac_control_frames(self): + self.__out_mac_control_frames = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-mac-control-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + + + def _get_out_mac_pause_frames(self): + """ + Getter method for out_mac_pause_frames, mapped from YANG variable /interfaces/interface/ethernet/state/counters/out_mac_pause_frames (oc-yang:counter64) + + YANG Description: MAC layer PAUSE frames sent on the interface + """ + return self.__out_mac_pause_frames + + def _set_out_mac_pause_frames(self, v, load=False): + """ + Setter method for out_mac_pause_frames, mapped from YANG variable /interfaces/interface/ethernet/state/counters/out_mac_pause_frames (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_out_mac_pause_frames is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_out_mac_pause_frames() directly. + + YANG Description: MAC layer PAUSE frames sent on the interface + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-mac-pause-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """out_mac_pause_frames must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-mac-pause-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__out_mac_pause_frames = t + if hasattr(self, '_set'): + self._set() + + def _unset_out_mac_pause_frames(self): + self.__out_mac_pause_frames = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-mac-pause-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + + + def _get_out_8021q_frames(self): + """ + Getter method for out_8021q_frames, mapped from YANG variable /interfaces/interface/ethernet/state/counters/out_8021q_frames (oc-yang:counter64) + + YANG Description: Number of 802.1q tagged frames sent on the interface + """ + return self.__out_8021q_frames + + def _set_out_8021q_frames(self, v, load=False): + """ + Setter method for out_8021q_frames, mapped from YANG variable /interfaces/interface/ethernet/state/counters/out_8021q_frames (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_out_8021q_frames is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_out_8021q_frames() directly. + + YANG Description: Number of 802.1q tagged frames sent on the interface + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-8021q-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """out_8021q_frames must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-8021q-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__out_8021q_frames = t + if hasattr(self, '_set'): + self._set() + + def _unset_out_8021q_frames(self): + self.__out_8021q_frames = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-8021q-frames", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + + + def _get_out_mac_errors_tx(self): + """ + Getter method for out_mac_errors_tx, mapped from YANG variable /interfaces/interface/ethernet/state/counters/out_mac_errors_tx (oc-yang:counter64) + + YANG Description: The number of sent errored frames due to MAC errors +transmitted. The value refers to MIB counter for +dot3StatsInternalMacTransmitErrors +oid=1.3.6.1.2.1.10.7.2.1.10 + """ + return self.__out_mac_errors_tx + + def _set_out_mac_errors_tx(self, v, load=False): + """ + Setter method for out_mac_errors_tx, mapped from YANG variable /interfaces/interface/ethernet/state/counters/out_mac_errors_tx (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_out_mac_errors_tx is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_out_mac_errors_tx() directly. + + YANG Description: The number of sent errored frames due to MAC errors +transmitted. The value refers to MIB counter for +dot3StatsInternalMacTransmitErrors +oid=1.3.6.1.2.1.10.7.2.1.10 + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-mac-errors-tx", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """out_mac_errors_tx must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-mac-errors-tx", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__out_mac_errors_tx = t + if hasattr(self, '_set'): + self._set() + + def _unset_out_mac_errors_tx(self): + self.__out_mac_errors_tx = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-mac-errors-tx", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces/ethernet', defining_module='openconfig-if-ethernet', yang_type='oc-yang:counter64', is_config=False) + + in_mac_control_frames = __builtin__.property(_get_in_mac_control_frames) + in_mac_pause_frames = __builtin__.property(_get_in_mac_pause_frames) + in_oversize_frames = __builtin__.property(_get_in_oversize_frames) + in_undersize_frames = __builtin__.property(_get_in_undersize_frames) + in_jabber_frames = __builtin__.property(_get_in_jabber_frames) + in_fragment_frames = __builtin__.property(_get_in_fragment_frames) + in_8021q_frames = __builtin__.property(_get_in_8021q_frames) + in_crc_errors = __builtin__.property(_get_in_crc_errors) + in_block_errors = __builtin__.property(_get_in_block_errors) + in_carrier_errors = __builtin__.property(_get_in_carrier_errors) + in_interrupted_tx = __builtin__.property(_get_in_interrupted_tx) + in_late_collision = __builtin__.property(_get_in_late_collision) + in_mac_errors_rx = __builtin__.property(_get_in_mac_errors_rx) + in_single_collision = __builtin__.property(_get_in_single_collision) + in_symbol_error = __builtin__.property(_get_in_symbol_error) + in_maxsize_exceeded = __builtin__.property(_get_in_maxsize_exceeded) + out_mac_control_frames = __builtin__.property(_get_out_mac_control_frames) + out_mac_pause_frames = __builtin__.property(_get_out_mac_pause_frames) + out_8021q_frames = __builtin__.property(_get_out_8021q_frames) + out_mac_errors_tx = __builtin__.property(_get_out_mac_errors_tx) + + + _pyangbind_elements = OrderedDict([('in_mac_control_frames', in_mac_control_frames), ('in_mac_pause_frames', in_mac_pause_frames), ('in_oversize_frames', in_oversize_frames), ('in_undersize_frames', in_undersize_frames), ('in_jabber_frames', in_jabber_frames), ('in_fragment_frames', in_fragment_frames), ('in_8021q_frames', in_8021q_frames), ('in_crc_errors', in_crc_errors), ('in_block_errors', in_block_errors), ('in_carrier_errors', in_carrier_errors), ('in_interrupted_tx', in_interrupted_tx), ('in_late_collision', in_late_collision), ('in_mac_errors_rx', in_mac_errors_rx), ('in_single_collision', in_single_collision), ('in_symbol_error', in_symbol_error), ('in_maxsize_exceeded', in_maxsize_exceeded), ('out_mac_control_frames', out_mac_control_frames), ('out_mac_pause_frames', out_mac_pause_frames), ('out_8021q_frames', out_8021q_frames), ('out_mac_errors_tx', out_mac_errors_tx), ]) + + diff --git a/hackfest/netconf-oc/openconfig/interfaces/interface/hold_time/__init__.py b/hackfest/netconf-oc/openconfig/interfaces/interface/hold_time/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2ccfda7efab86d3f1384c506d84a25962e66c1c4 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/interfaces/interface/hold_time/__init__.py @@ -0,0 +1,156 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import config +from . import state +class hold_time(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-interfaces - based on the path /interfaces/interface/hold-time. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Top-level container for hold-time settings to enable +dampening advertisements of interface transitions. + """ + __slots__ = ('_path_helper', '_extmethods', '__config','__state',) + + _yang_name = 'hold-time' + _yang_namespace = 'http://openconfig.net/yang/interfaces' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['interfaces', 'interface', 'hold-time'] + + def _get_config(self): + """ + Getter method for config, mapped from YANG variable /interfaces/interface/hold_time/config (container) + + YANG Description: Configuration data for interface hold-time settings. + """ + return self.__config + + def _set_config(self, v, load=False): + """ + Setter method for config, mapped from YANG variable /interfaces/interface/hold_time/config (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_config is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_config() directly. + + YANG Description: Configuration data for interface hold-time settings. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """config must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True)""", + }) + + self.__config = t + if hasattr(self, '_set'): + self._set() + + def _unset_config(self): + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + + + def _get_state(self): + """ + Getter method for state, mapped from YANG variable /interfaces/interface/hold_time/state (container) + + YANG Description: Operational state data for interface hold-time. + """ + return self.__state + + def _set_state(self, v, load=False): + """ + Setter method for state, mapped from YANG variable /interfaces/interface/hold_time/state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_state() directly. + + YANG Description: Operational state data for interface hold-time. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True)""", + }) + + self.__state = t + if hasattr(self, '_set'): + self._set() + + def _unset_state(self): + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) + + + _pyangbind_elements = OrderedDict([('config', config), ('state', state), ]) + + diff --git a/hackfest/netconf-oc/openconfig/interfaces/interface/hold_time/config/__init__.py b/hackfest/netconf-oc/openconfig/interfaces/interface/hold_time/config/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c3f1d822b900afa7e780d7dbc31564dd5e4316b2 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/interfaces/interface/hold_time/config/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class config(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-interfaces - based on the path /interfaces/interface/hold-time/config. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Configuration data for interface hold-time settings. + """ + __slots__ = ('_path_helper', '_extmethods', '__up','__down',) + + _yang_name = 'config' + _yang_namespace = 'http://openconfig.net/yang/interfaces' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__up = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="up", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=True) + self.__down = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="down", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['interfaces', 'interface', 'hold-time', 'config'] + + def _get_up(self): + """ + Getter method for up, mapped from YANG variable /interfaces/interface/hold_time/config/up (uint32) + + YANG Description: Dampens advertisement when the interface +transitions from down to up. A zero value means dampening +is turned off, i.e., immediate notification. + """ + return self.__up + + def _set_up(self, v, load=False): + """ + Setter method for up, mapped from YANG variable /interfaces/interface/hold_time/config/up (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_up is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_up() directly. + + YANG Description: Dampens advertisement when the interface +transitions from down to up. A zero value means dampening +is turned off, i.e., immediate notification. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="up", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """up must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="up", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=True)""", + }) + + self.__up = t + if hasattr(self, '_set'): + self._set() + + def _unset_up(self): + self.__up = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="up", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=True) + + + def _get_down(self): + """ + Getter method for down, mapped from YANG variable /interfaces/interface/hold_time/config/down (uint32) + + YANG Description: Dampens advertisement when the interface transitions from +up to down. A zero value means dampening is turned off, +i.e., immediate notification. + """ + return self.__down + + def _set_down(self, v, load=False): + """ + Setter method for down, mapped from YANG variable /interfaces/interface/hold_time/config/down (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_down is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_down() directly. + + YANG Description: Dampens advertisement when the interface transitions from +up to down. A zero value means dampening is turned off, +i.e., immediate notification. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="down", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """down must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="down", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=True)""", + }) + + self.__down = t + if hasattr(self, '_set'): + self._set() + + def _unset_down(self): + self.__down = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="down", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=True) + + up = __builtin__.property(_get_up, _set_up) + down = __builtin__.property(_get_down, _set_down) + + + _pyangbind_elements = OrderedDict([('up', up), ('down', down), ]) + + diff --git a/hackfest/netconf-oc/openconfig/interfaces/interface/hold_time/state/__init__.py b/hackfest/netconf-oc/openconfig/interfaces/interface/hold_time/state/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d5c994a6de356feb3618bd10efb399bb7b3ad302 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/interfaces/interface/hold_time/state/__init__.py @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-interfaces - based on the path /interfaces/interface/hold-time/state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Operational state data for interface hold-time. + """ + __slots__ = ('_path_helper', '_extmethods', '__up','__down',) + + _yang_name = 'state' + _yang_namespace = 'http://openconfig.net/yang/interfaces' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__up = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="up", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=False) + self.__down = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="down", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['interfaces', 'interface', 'hold-time', 'state'] + + def _get_up(self): + """ + Getter method for up, mapped from YANG variable /interfaces/interface/hold_time/state/up (uint32) + + YANG Description: Dampens advertisement when the interface +transitions from down to up. A zero value means dampening +is turned off, i.e., immediate notification. + """ + return self.__up + + def _set_up(self, v, load=False): + """ + Setter method for up, mapped from YANG variable /interfaces/interface/hold_time/state/up (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_up is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_up() directly. + + YANG Description: Dampens advertisement when the interface +transitions from down to up. A zero value means dampening +is turned off, i.e., immediate notification. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="up", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """up must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="up", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=False)""", + }) + + self.__up = t + if hasattr(self, '_set'): + self._set() + + def _unset_up(self): + self.__up = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="up", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=False) + + + def _get_down(self): + """ + Getter method for down, mapped from YANG variable /interfaces/interface/hold_time/state/down (uint32) + + YANG Description: Dampens advertisement when the interface transitions from +up to down. A zero value means dampening is turned off, +i.e., immediate notification. + """ + return self.__down + + def _set_down(self, v, load=False): + """ + Setter method for down, mapped from YANG variable /interfaces/interface/hold_time/state/down (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_down is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_down() directly. + + YANG Description: Dampens advertisement when the interface transitions from +up to down. A zero value means dampening is turned off, +i.e., immediate notification. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="down", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """down must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="down", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=False)""", + }) + + self.__down = t + if hasattr(self, '_set'): + self._set() + + def _unset_down(self): + self.__down = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="down", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=False) + + up = __builtin__.property(_get_up) + down = __builtin__.property(_get_down) + + + _pyangbind_elements = OrderedDict([('up', up), ('down', down), ]) + + diff --git a/hackfest/netconf-oc/openconfig/interfaces/interface/state/__init__.py b/hackfest/netconf-oc/openconfig/interfaces/interface/state/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d8e2ff185e1300fa19b14959b005ddd00dd08c88 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/interfaces/interface/state/__init__.py @@ -0,0 +1,875 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import counters +class state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-interfaces - based on the path /interfaces/interface/state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Operational state data at the global interface level + """ + __slots__ = ('_path_helper', '_extmethods', '__name','__type','__mtu','__loopback_mode','__description','__enabled','__ifindex','__admin_status','__oper_status','__last_change','__logical','__management','__cpu','__counters','__hardware_port',) + + _yang_name = 'state' + _yang_namespace = 'http://openconfig.net/yang/interfaces' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=False) + self.__type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'iana-interface-type': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iana-interface-type': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'other': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:other': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'regular1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:regular1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdh1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdh1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ddnX25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ddnX25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rfc877x25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rfc877x25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ethernetCsmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ethernetCsmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88023Csmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88023Csmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88024TokenBus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88024TokenBus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025TokenRing': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025TokenRing': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88026Man': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88026Man': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'starLan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:starLan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'proteon10Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:proteon10Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'proteon80Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:proteon80Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hyperchannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hyperchannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fddi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fddi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'e1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:e1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'basicISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:basicISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'primaryISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:primaryISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propPointToPointSerial': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propPointToPointSerial': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ppp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ppp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'softwareLoopback': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:softwareLoopback': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'eon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:eon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ethernet3Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ethernet3Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'nsip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:nsip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'slip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:slip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ultra': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ultra': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds3': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds3': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rs232': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rs232': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'para': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:para': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arcnet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arcnet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arcnetPlus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arcnetPlus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'miox25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:miox25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25ple': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25ple': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88022llc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88022llc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'localTalk': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:localTalk': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'smdsDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:smdsDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayService': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayService': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v35': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v35': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hssi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hssi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hippi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hippi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'modem': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:modem': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aal5': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aal5': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetPath': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetPath': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetVT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetVT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'smdsIcip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:smdsIcip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propMultiplexor': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propMultiplexor': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80212': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80212': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fibreChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fibreChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hippiInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hippiInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayInterconnect': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayInterconnect': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aflane8023': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aflane8023': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aflane8025': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aflane8025': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cctEmul': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cctEmul': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v11': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v11': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v36': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v36': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g703at64k': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g703at64k': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g703at2mb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g703at2mb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'qllc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:qllc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastEtherFX': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastEtherFX': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'channel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:channel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80211': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80211': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ibm370parChan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ibm370parChan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'escon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:escon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dlsw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dlsw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdns': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdns': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rsrb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rsrb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmLogical': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmLogical': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds0': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds0': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds0Bundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds0Bundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bsc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bsc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'async': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:async': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cnr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cnr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025Dtr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025Dtr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'eplrs': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:eplrs': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propCnls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propCnls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hostPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hostPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'termPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:termPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayMPI': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayMPI': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x213': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x213': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'radsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:radsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025CRFPInt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025CRFPInt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'myrinet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:myrinet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEM': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEM': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFXO': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFXO': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFXS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFXS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEncap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEncap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmFuni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmFuni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmIma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmIma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pppMultilinkBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pppMultilinkBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverCdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverCdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverClaw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverClaw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'stackToStack': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:stackToStack': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'virtualIpAddress': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:virtualIpAddress': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025Fiber': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025Fiber': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gigabitEthernet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gigabitEthernet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v37': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v37': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25mlp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25mlp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25huntGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25huntGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'transpHdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:transpHdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'interleave': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:interleave': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'a12MppSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:a12MppSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'coffee': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:coffee': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ces': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ces': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmSubInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmSubInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l2vlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l2vlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l3ipvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l3ipvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l3ipxvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l3ipxvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'digitalPowerline': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:digitalPowerline': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mediaMailOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mediaMailOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dcn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dcn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'msdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:msdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee1394': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee1394': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'if-gsn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:if-gsn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mplsTunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mplsTunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'srp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:srp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverFrameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverFrameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'idsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:idsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'compositeLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:compositeLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ss7SigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ss7SigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propWirelessP2P': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propWirelessP2P': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rfc1483': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rfc1483': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'usb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:usb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee8023adLag': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee8023adLag': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bgppolicyaccounting': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bgppolicyaccounting': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frf16MfrBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frf16MfrBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'h323Gatekeeper': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:h323Gatekeeper': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'h323Proxy': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:h323Proxy': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mfSigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mfSigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'shdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:shdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds1FDL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds1FDL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pos': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pos': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbAsiIn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbAsiIn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbAsiOut': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbAsiOut': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'plc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:plc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'nfas': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:nfas': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tr008': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tr008': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gr303RDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gr303RDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gr303IDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gr303IDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hiperlan2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hiperlan2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propBWAp2Mp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propBWAp2Mp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'digitalWrapperOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:digitalWrapperOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aal2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aal2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'radioMAC': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:radioMAC': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'imt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:imt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mvl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mvl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'reachDSL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:reachDSL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frDlciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frDlciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmVciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmVciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverCable': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverCable': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'infiniband': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:infiniband': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'teLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:teLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'q2931': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:q2931': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'virtualTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:virtualTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sipTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sipTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sipSig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sipSig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstreamChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstreamChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'econet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:econet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pon155': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pon155': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pon622': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pon622': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bridge': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bridge': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'linegroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:linegroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEMFGD': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEMFGD': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFGDEANA': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFGDEANA': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceDID': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceDID': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpegTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpegTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sixToFour': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sixToFour': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gtp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gtp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pdnEtherLoop1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pdnEtherLoop1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pdnEtherLoop2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pdnEtherLoop2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalChannelGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalChannelGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'homepna': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:homepna': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gfp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gfp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ciscoISLvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ciscoISLvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'actelisMetaLOOP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:actelisMetaLOOP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fcipLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fcipLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rpr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rpr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'qam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:qam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lmp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lmp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cblVectaStar': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cblVectaStar': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableMCmtsDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableMCmtsDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'macSecControlledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:macSecControlledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'macSecUncontrolledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:macSecUncontrolledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aviciOpticalEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aviciOpticalEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmbond': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmbond': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFGDOS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFGDOS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mocaVersion1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mocaVersion1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80216WMAN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80216WMAN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl2plus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl2plus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRcsMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRcsMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbTdm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbTdm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRcsTdma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRcsTdma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x86Laps': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x86Laps': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'wwanPP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:wwanPP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'wwanPP2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:wwanPP2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEBS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEBS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ifPwType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ifPwType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ilan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ilan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluELP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluELP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapDot11Profile': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapDot11Profile': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapDot11Bss': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapDot11Bss': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapWtpVirtualRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapWtpVirtualRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bits': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bits': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cableDownstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cableDownstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vmwareVirtualNic': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vmwareVirtualNic': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee802154': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee802154': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOdu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOdu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ifVfiType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ifVfiType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9981': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9981': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9982': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9982': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9983': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9983': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponLogicalLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponLogicalLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluGponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluGponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluGponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluGponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vmwareNicTeam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vmwareNicTeam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsOfdmDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsOfdmDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsOfdmaUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsOfdmaUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gfast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gfast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdci': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdci': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'xboxWireless': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:xboxWireless': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d1FwdOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d1FwdOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d1RetOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d1RetOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d2DsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d2DsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d2UsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d2UsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableNdf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableNdf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableNdr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableNdr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ptm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ptm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ghn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ghn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtsi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtsi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtuc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtuc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOduc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOduc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtsig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtsig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'microwaveCarrierTermination': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:microwaveCarrierTermination': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'microwaveRadioLinkTerminal': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:microwaveRadioLinkTerminal': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}},), is_leaf=True, yang_name="type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='identityref', is_config=False) + self.__mtu = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="mtu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint16', is_config=False) + self.__loopback_mode = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="loopback-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + self.__description = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=False) + self.__enabled = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + self.__ifindex = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="ifindex", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=False) + self.__admin_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UP': {}, 'DOWN': {}, 'TESTING': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='enumeration', is_config=False) + self.__oper_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UP': {'value': 1}, 'DOWN': {'value': 2}, 'TESTING': {'value': 3}, 'UNKNOWN': {'value': 4}, 'DORMANT': {'value': 5}, 'NOT_PRESENT': {'value': 6}, 'LOWER_LAYER_DOWN': {'value': 7}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='enumeration', is_config=False) + self.__last_change = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-change", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-types:timeticks64', is_config=False) + self.__logical = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="logical", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + self.__management = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="management", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + self.__cpu = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="cpu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + self.__counters = YANGDynClass(base=counters.counters, is_container='container', yang_name="counters", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=False) + self.__hardware_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="hardware-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='leafref', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['interfaces', 'interface', 'state'] + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /interfaces/interface/state/name (string) + + YANG Description: The name of the interface. + +A device MAY restrict the allowed values for this leaf, +possibly depending on the type of the interface. +For system-controlled interfaces, this leaf is the +device-specific name of the interface. The 'config false' +list interfaces/interface[name]/state contains the currently +existing interfaces on the device. + +If a client tries to create configuration for a +system-controlled interface that is not present in the +corresponding state list, the server MAY reject +the request if the implementation does not support +pre-provisioning of interfaces or if the name refers to +an interface that can never exist in the system. A +NETCONF server MUST reply with an rpc-error with the +error-tag 'invalid-value' in this case. + +The IETF model in RFC 7223 provides YANG features for the +following (i.e., pre-provisioning and arbitrary-names), +however they are omitted here: + + If the device supports pre-provisioning of interface + configuration, the 'pre-provisioning' feature is + advertised. + + If the device allows arbitrarily named user-controlled + interfaces, the 'arbitrary-names' feature is advertised. + +When a configured user-controlled interface is created by +the system, it is instantiated with the same name in the +/interfaces/interface[name]/state list. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /interfaces/interface/state/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: The name of the interface. + +A device MAY restrict the allowed values for this leaf, +possibly depending on the type of the interface. +For system-controlled interfaces, this leaf is the +device-specific name of the interface. The 'config false' +list interfaces/interface[name]/state contains the currently +existing interfaces on the device. + +If a client tries to create configuration for a +system-controlled interface that is not present in the +corresponding state list, the server MAY reject +the request if the implementation does not support +pre-provisioning of interfaces or if the name refers to +an interface that can never exist in the system. A +NETCONF server MUST reply with an rpc-error with the +error-tag 'invalid-value' in this case. + +The IETF model in RFC 7223 provides YANG features for the +following (i.e., pre-provisioning and arbitrary-names), +however they are omitted here: + + If the device supports pre-provisioning of interface + configuration, the 'pre-provisioning' feature is + advertised. + + If the device allows arbitrarily named user-controlled + interfaces, the 'arbitrary-names' feature is advertised. + +When a configured user-controlled interface is created by +the system, it is instantiated with the same name in the +/interfaces/interface[name]/state list. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=False)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=False) + + + def _get_type(self): + """ + Getter method for type, mapped from YANG variable /interfaces/interface/state/type (identityref) + + YANG Description: The type of the interface. + +When an interface entry is created, a server MAY +initialize the type leaf with a valid value, e.g., if it +is possible to derive the type from the name of the +interface. + +If a client tries to set the type of an interface to a +value that can never be used by the system, e.g., if the +type is not supported or if the type does not match the +name of the interface, the server MUST reject the request. +A NETCONF server MUST reply with an rpc-error with the +error-tag 'invalid-value' in this case. + """ + return self.__type + + def _set_type(self, v, load=False): + """ + Setter method for type, mapped from YANG variable /interfaces/interface/state/type (identityref) + If this variable is read-only (config: false) in the + source YANG file, then _set_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_type() directly. + + YANG Description: The type of the interface. + +When an interface entry is created, a server MAY +initialize the type leaf with a valid value, e.g., if it +is possible to derive the type from the name of the +interface. + +If a client tries to set the type of an interface to a +value that can never be used by the system, e.g., if the +type is not supported or if the type does not match the +name of the interface, the server MUST reject the request. +A NETCONF server MUST reply with an rpc-error with the +error-tag 'invalid-value' in this case. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'iana-interface-type': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iana-interface-type': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'other': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:other': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'regular1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:regular1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdh1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdh1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ddnX25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ddnX25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rfc877x25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rfc877x25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ethernetCsmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ethernetCsmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88023Csmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88023Csmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88024TokenBus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88024TokenBus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025TokenRing': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025TokenRing': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88026Man': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88026Man': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'starLan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:starLan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'proteon10Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:proteon10Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'proteon80Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:proteon80Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hyperchannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hyperchannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fddi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fddi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'e1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:e1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'basicISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:basicISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'primaryISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:primaryISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propPointToPointSerial': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propPointToPointSerial': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ppp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ppp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'softwareLoopback': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:softwareLoopback': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'eon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:eon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ethernet3Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ethernet3Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'nsip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:nsip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'slip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:slip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ultra': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ultra': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds3': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds3': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rs232': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rs232': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'para': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:para': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arcnet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arcnet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arcnetPlus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arcnetPlus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'miox25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:miox25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25ple': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25ple': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88022llc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88022llc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'localTalk': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:localTalk': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'smdsDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:smdsDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayService': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayService': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v35': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v35': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hssi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hssi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hippi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hippi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'modem': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:modem': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aal5': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aal5': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetPath': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetPath': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetVT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetVT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'smdsIcip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:smdsIcip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propMultiplexor': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propMultiplexor': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80212': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80212': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fibreChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fibreChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hippiInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hippiInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayInterconnect': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayInterconnect': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aflane8023': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aflane8023': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aflane8025': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aflane8025': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cctEmul': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cctEmul': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v11': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v11': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v36': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v36': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g703at64k': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g703at64k': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g703at2mb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g703at2mb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'qllc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:qllc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastEtherFX': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastEtherFX': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'channel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:channel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80211': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80211': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ibm370parChan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ibm370parChan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'escon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:escon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dlsw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dlsw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdns': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdns': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rsrb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rsrb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmLogical': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmLogical': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds0': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds0': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds0Bundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds0Bundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bsc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bsc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'async': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:async': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cnr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cnr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025Dtr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025Dtr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'eplrs': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:eplrs': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propCnls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propCnls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hostPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hostPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'termPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:termPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayMPI': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayMPI': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x213': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x213': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'radsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:radsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025CRFPInt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025CRFPInt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'myrinet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:myrinet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEM': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEM': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFXO': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFXO': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFXS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFXS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEncap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEncap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmFuni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmFuni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmIma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmIma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pppMultilinkBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pppMultilinkBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverCdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverCdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverClaw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverClaw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'stackToStack': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:stackToStack': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'virtualIpAddress': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:virtualIpAddress': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025Fiber': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025Fiber': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gigabitEthernet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gigabitEthernet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v37': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v37': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25mlp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25mlp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25huntGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25huntGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'transpHdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:transpHdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'interleave': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:interleave': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'a12MppSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:a12MppSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'coffee': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:coffee': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ces': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ces': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmSubInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmSubInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l2vlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l2vlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l3ipvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l3ipvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l3ipxvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l3ipxvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'digitalPowerline': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:digitalPowerline': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mediaMailOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mediaMailOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dcn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dcn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'msdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:msdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee1394': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee1394': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'if-gsn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:if-gsn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mplsTunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mplsTunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'srp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:srp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverFrameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverFrameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'idsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:idsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'compositeLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:compositeLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ss7SigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ss7SigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propWirelessP2P': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propWirelessP2P': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rfc1483': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rfc1483': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'usb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:usb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee8023adLag': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee8023adLag': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bgppolicyaccounting': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bgppolicyaccounting': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frf16MfrBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frf16MfrBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'h323Gatekeeper': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:h323Gatekeeper': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'h323Proxy': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:h323Proxy': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mfSigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mfSigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'shdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:shdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds1FDL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds1FDL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pos': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pos': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbAsiIn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbAsiIn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbAsiOut': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbAsiOut': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'plc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:plc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'nfas': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:nfas': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tr008': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tr008': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gr303RDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gr303RDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gr303IDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gr303IDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hiperlan2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hiperlan2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propBWAp2Mp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propBWAp2Mp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'digitalWrapperOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:digitalWrapperOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aal2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aal2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'radioMAC': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:radioMAC': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'imt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:imt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mvl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mvl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'reachDSL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:reachDSL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frDlciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frDlciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmVciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmVciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverCable': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverCable': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'infiniband': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:infiniband': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'teLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:teLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'q2931': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:q2931': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'virtualTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:virtualTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sipTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sipTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sipSig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sipSig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstreamChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstreamChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'econet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:econet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pon155': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pon155': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pon622': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pon622': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bridge': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bridge': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'linegroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:linegroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEMFGD': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEMFGD': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFGDEANA': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFGDEANA': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceDID': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceDID': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpegTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpegTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sixToFour': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sixToFour': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gtp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gtp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pdnEtherLoop1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pdnEtherLoop1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pdnEtherLoop2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pdnEtherLoop2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalChannelGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalChannelGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'homepna': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:homepna': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gfp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gfp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ciscoISLvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ciscoISLvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'actelisMetaLOOP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:actelisMetaLOOP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fcipLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fcipLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rpr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rpr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'qam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:qam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lmp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lmp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cblVectaStar': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cblVectaStar': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableMCmtsDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableMCmtsDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'macSecControlledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:macSecControlledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'macSecUncontrolledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:macSecUncontrolledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aviciOpticalEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aviciOpticalEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmbond': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmbond': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFGDOS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFGDOS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mocaVersion1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mocaVersion1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80216WMAN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80216WMAN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl2plus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl2plus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRcsMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRcsMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbTdm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbTdm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRcsTdma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRcsTdma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x86Laps': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x86Laps': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'wwanPP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:wwanPP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'wwanPP2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:wwanPP2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEBS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEBS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ifPwType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ifPwType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ilan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ilan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluELP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluELP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapDot11Profile': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapDot11Profile': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapDot11Bss': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapDot11Bss': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapWtpVirtualRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapWtpVirtualRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bits': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bits': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cableDownstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cableDownstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vmwareVirtualNic': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vmwareVirtualNic': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee802154': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee802154': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOdu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOdu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ifVfiType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ifVfiType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9981': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9981': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9982': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9982': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9983': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9983': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponLogicalLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponLogicalLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluGponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluGponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluGponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluGponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vmwareNicTeam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vmwareNicTeam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsOfdmDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsOfdmDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsOfdmaUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsOfdmaUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gfast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gfast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdci': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdci': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'xboxWireless': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:xboxWireless': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d1FwdOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d1FwdOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d1RetOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d1RetOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d2DsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d2DsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d2UsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d2UsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableNdf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableNdf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableNdr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableNdr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ptm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ptm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ghn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ghn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtsi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtsi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtuc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtuc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOduc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOduc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtsig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtsig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'microwaveCarrierTermination': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:microwaveCarrierTermination': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'microwaveRadioLinkTerminal': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:microwaveRadioLinkTerminal': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}},), is_leaf=True, yang_name="type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='identityref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """type must be of a type compatible with identityref""", + 'defined-type': "openconfig-interfaces:identityref", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'iana-interface-type': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iana-interface-type': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'other': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:other': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'regular1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:regular1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdh1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdh1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ddnX25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ddnX25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rfc877x25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rfc877x25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ethernetCsmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ethernetCsmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88023Csmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88023Csmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88024TokenBus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88024TokenBus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025TokenRing': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025TokenRing': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88026Man': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88026Man': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'starLan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:starLan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'proteon10Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:proteon10Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'proteon80Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:proteon80Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hyperchannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hyperchannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fddi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fddi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'e1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:e1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'basicISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:basicISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'primaryISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:primaryISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propPointToPointSerial': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propPointToPointSerial': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ppp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ppp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'softwareLoopback': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:softwareLoopback': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'eon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:eon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ethernet3Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ethernet3Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'nsip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:nsip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'slip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:slip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ultra': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ultra': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds3': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds3': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rs232': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rs232': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'para': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:para': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arcnet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arcnet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arcnetPlus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arcnetPlus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'miox25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:miox25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25ple': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25ple': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88022llc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88022llc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'localTalk': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:localTalk': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'smdsDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:smdsDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayService': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayService': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v35': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v35': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hssi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hssi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hippi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hippi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'modem': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:modem': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aal5': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aal5': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetPath': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetPath': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetVT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetVT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'smdsIcip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:smdsIcip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propMultiplexor': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propMultiplexor': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80212': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80212': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fibreChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fibreChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hippiInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hippiInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayInterconnect': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayInterconnect': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aflane8023': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aflane8023': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aflane8025': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aflane8025': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cctEmul': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cctEmul': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v11': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v11': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v36': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v36': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g703at64k': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g703at64k': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g703at2mb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g703at2mb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'qllc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:qllc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastEtherFX': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastEtherFX': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'channel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:channel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80211': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80211': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ibm370parChan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ibm370parChan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'escon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:escon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dlsw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dlsw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdns': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdns': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rsrb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rsrb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmLogical': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmLogical': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds0': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds0': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds0Bundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds0Bundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bsc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bsc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'async': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:async': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cnr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cnr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025Dtr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025Dtr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'eplrs': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:eplrs': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propCnls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propCnls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hostPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hostPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'termPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:termPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayMPI': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayMPI': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x213': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x213': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'radsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:radsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025CRFPInt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025CRFPInt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'myrinet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:myrinet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEM': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEM': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFXO': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFXO': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFXS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFXS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEncap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEncap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmFuni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmFuni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmIma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmIma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pppMultilinkBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pppMultilinkBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverCdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverCdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverClaw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverClaw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'stackToStack': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:stackToStack': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'virtualIpAddress': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:virtualIpAddress': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025Fiber': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025Fiber': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gigabitEthernet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gigabitEthernet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v37': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v37': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25mlp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25mlp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25huntGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25huntGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'transpHdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:transpHdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'interleave': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:interleave': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'a12MppSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:a12MppSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'coffee': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:coffee': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ces': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ces': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmSubInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmSubInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l2vlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l2vlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l3ipvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l3ipvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l3ipxvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l3ipxvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'digitalPowerline': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:digitalPowerline': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mediaMailOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mediaMailOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dcn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dcn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'msdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:msdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee1394': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee1394': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'if-gsn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:if-gsn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mplsTunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mplsTunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'srp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:srp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverFrameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverFrameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'idsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:idsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'compositeLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:compositeLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ss7SigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ss7SigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propWirelessP2P': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propWirelessP2P': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rfc1483': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rfc1483': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'usb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:usb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee8023adLag': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee8023adLag': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bgppolicyaccounting': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bgppolicyaccounting': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frf16MfrBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frf16MfrBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'h323Gatekeeper': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:h323Gatekeeper': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'h323Proxy': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:h323Proxy': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mfSigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mfSigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'shdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:shdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds1FDL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds1FDL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pos': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pos': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbAsiIn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbAsiIn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbAsiOut': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbAsiOut': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'plc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:plc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'nfas': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:nfas': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tr008': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tr008': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gr303RDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gr303RDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gr303IDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gr303IDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hiperlan2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hiperlan2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propBWAp2Mp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propBWAp2Mp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'digitalWrapperOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:digitalWrapperOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aal2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aal2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'radioMAC': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:radioMAC': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'imt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:imt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mvl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mvl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'reachDSL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:reachDSL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frDlciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frDlciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmVciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmVciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverCable': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverCable': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'infiniband': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:infiniband': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'teLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:teLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'q2931': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:q2931': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'virtualTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:virtualTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sipTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sipTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sipSig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sipSig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstreamChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstreamChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'econet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:econet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pon155': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pon155': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pon622': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pon622': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bridge': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bridge': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'linegroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:linegroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEMFGD': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEMFGD': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFGDEANA': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFGDEANA': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceDID': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceDID': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpegTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpegTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sixToFour': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sixToFour': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gtp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gtp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pdnEtherLoop1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pdnEtherLoop1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pdnEtherLoop2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pdnEtherLoop2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalChannelGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalChannelGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'homepna': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:homepna': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gfp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gfp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ciscoISLvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ciscoISLvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'actelisMetaLOOP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:actelisMetaLOOP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fcipLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fcipLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rpr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rpr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'qam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:qam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lmp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lmp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cblVectaStar': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cblVectaStar': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableMCmtsDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableMCmtsDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'macSecControlledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:macSecControlledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'macSecUncontrolledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:macSecUncontrolledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aviciOpticalEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aviciOpticalEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmbond': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmbond': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFGDOS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFGDOS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mocaVersion1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mocaVersion1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80216WMAN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80216WMAN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl2plus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl2plus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRcsMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRcsMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbTdm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbTdm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRcsTdma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRcsTdma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x86Laps': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x86Laps': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'wwanPP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:wwanPP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'wwanPP2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:wwanPP2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEBS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEBS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ifPwType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ifPwType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ilan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ilan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluELP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluELP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapDot11Profile': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapDot11Profile': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapDot11Bss': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapDot11Bss': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapWtpVirtualRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapWtpVirtualRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bits': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bits': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cableDownstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cableDownstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vmwareVirtualNic': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vmwareVirtualNic': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee802154': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee802154': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOdu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOdu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ifVfiType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ifVfiType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9981': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9981': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9982': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9982': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9983': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9983': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponLogicalLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponLogicalLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluGponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluGponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluGponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluGponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vmwareNicTeam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vmwareNicTeam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsOfdmDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsOfdmDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsOfdmaUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsOfdmaUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gfast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gfast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdci': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdci': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'xboxWireless': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:xboxWireless': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d1FwdOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d1FwdOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d1RetOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d1RetOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d2DsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d2DsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d2UsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d2UsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableNdf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableNdf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableNdr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableNdr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ptm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ptm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ghn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ghn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtsi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtsi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtuc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtuc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOduc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOduc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtsig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtsig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'microwaveCarrierTermination': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:microwaveCarrierTermination': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'microwaveRadioLinkTerminal': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:microwaveRadioLinkTerminal': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}},), is_leaf=True, yang_name="type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='identityref', is_config=False)""", + }) + + self.__type = t + if hasattr(self, '_set'): + self._set() + + def _unset_type(self): + self.__type = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'iana-interface-type': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iana-interface-type': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'other': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:other': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'regular1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:regular1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdh1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdh1822': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ddnX25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ddnX25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rfc877x25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rfc877x25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ethernetCsmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ethernetCsmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88023Csmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88023Csmacd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88024TokenBus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88024TokenBus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025TokenRing': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025TokenRing': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88026Man': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88026Man': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'starLan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:starLan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'proteon10Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:proteon10Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'proteon80Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:proteon80Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hyperchannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hyperchannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fddi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fddi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'e1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:e1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'basicISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:basicISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'primaryISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:primaryISDN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propPointToPointSerial': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propPointToPointSerial': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ppp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ppp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'softwareLoopback': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:softwareLoopback': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'eon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:eon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ethernet3Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ethernet3Mbit': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'nsip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:nsip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'slip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:slip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ultra': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ultra': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds3': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds3': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rs232': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rs232': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'para': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:para': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arcnet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arcnet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arcnetPlus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arcnetPlus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'miox25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:miox25': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25ple': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25ple': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88022llc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88022llc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'localTalk': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:localTalk': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'smdsDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:smdsDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayService': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayService': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v35': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v35': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hssi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hssi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hippi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hippi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'modem': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:modem': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aal5': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aal5': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetPath': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetPath': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetVT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetVT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'smdsIcip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:smdsIcip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propMultiplexor': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propMultiplexor': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80212': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80212': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fibreChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fibreChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hippiInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hippiInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayInterconnect': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayInterconnect': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aflane8023': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aflane8023': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aflane8025': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aflane8025': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cctEmul': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cctEmul': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v11': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v11': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v36': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v36': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g703at64k': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g703at64k': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g703at2mb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g703at2mb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'qllc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:qllc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastEtherFX': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastEtherFX': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'channel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:channel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80211': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80211': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ibm370parChan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ibm370parChan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'escon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:escon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dlsw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dlsw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdns': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdns': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isdnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isdnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapd': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rsrb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rsrb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmLogical': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmLogical': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds0': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds0': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds0Bundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds0Bundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bsc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bsc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'async': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:async': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cnr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cnr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025Dtr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025Dtr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'eplrs': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:eplrs': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'arap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:arap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propCnls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propCnls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hostPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hostPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'termPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:termPad': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frameRelayMPI': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frameRelayMPI': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x213': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x213': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'radsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:radsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025CRFPInt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025CRFPInt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'myrinet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:myrinet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEM': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEM': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFXO': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFXO': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFXS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFXS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEncap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEncap': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmDxi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmFuni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmFuni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmIma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmIma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pppMultilinkBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pppMultilinkBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverCdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverCdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverClaw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverClaw': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'stackToStack': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:stackToStack': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'virtualIpAddress': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:virtualIpAddress': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'iso88025Fiber': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:iso88025Fiber': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gigabitEthernet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gigabitEthernet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lapf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lapf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'v37': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:v37': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25mlp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25mlp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x25huntGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x25huntGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'transpHdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:transpHdlc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'interleave': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:interleave': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'a12MppSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:a12MppSwitch': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'coffee': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:coffee': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ces': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ces': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmSubInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmSubInterface': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l2vlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l2vlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l3ipvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l3ipvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'l3ipxvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:l3ipxvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'digitalPowerline': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:digitalPowerline': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mediaMailOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mediaMailOverIp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dcn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dcn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ipForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ipForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'msdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:msdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee1394': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee1394': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'if-gsn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:if-gsn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRccUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRccUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmVirtual': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mplsTunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mplsTunnel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'srp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:srp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverFrameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverFrameRelay': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'idsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:idsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'compositeLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:compositeLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ss7SigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ss7SigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propWirelessP2P': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propWirelessP2P': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frForward': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rfc1483': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rfc1483': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'usb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:usb': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee8023adLag': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee8023adLag': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bgppolicyaccounting': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bgppolicyaccounting': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frf16MfrBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frf16MfrBundle': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'h323Gatekeeper': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:h323Gatekeeper': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'h323Proxy': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:h323Proxy': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpls': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mfSigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mfSigLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'shdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:shdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ds1FDL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ds1FDL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pos': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pos': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbAsiIn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbAsiIn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbAsiOut': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbAsiOut': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'plc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:plc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'nfas': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:nfas': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'tr008': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:tr008': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gr303RDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gr303RDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gr303IDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gr303IDT': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'isup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:isup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessMaclayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propDocsWirelessUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propDocsWirelessUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'hiperlan2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:hiperlan2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propBWAp2Mp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propBWAp2Mp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sonetOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sonetOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'digitalWrapperOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:digitalWrapperOverheadChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aal2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aal2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'radioMAC': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:radioMAC': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'imt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:imt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mvl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mvl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'reachDSL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:reachDSL': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'frDlciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:frDlciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmVciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmVciEndPt': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'propAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:propAtm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceOverCable': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceOverCable': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'infiniband': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:infiniband': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'teLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:teLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'q2931': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:q2931': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'virtualTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:virtualTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sipTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sipTg': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sipSig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sipSig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstreamChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstreamChannel': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'econet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:econet': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pon155': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pon155': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pon622': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pon622': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bridge': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bridge': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'linegroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:linegroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEMFGD': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEMFGD': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFGDEANA': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFGDEANA': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceDID': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceDID': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mpegTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mpegTransport': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sixToFour': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sixToFour': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gtp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gtp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pdnEtherLoop1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pdnEtherLoop1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pdnEtherLoop2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pdnEtherLoop2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'opticalChannelGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:opticalChannelGroup': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'homepna': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:homepna': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gfp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gfp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ciscoISLvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ciscoISLvlan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'actelisMetaLOOP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:actelisMetaLOOP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fcipLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fcipLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'rpr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:rpr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'qam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:qam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'lmp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:lmp': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cblVectaStar': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cblVectaStar': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableMCmtsDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableMCmtsDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'macSecControlledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:macSecControlledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'macSecUncontrolledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:macSecUncontrolledIF': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aviciOpticalEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aviciOpticalEther': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'atmbond': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:atmbond': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceFGDOS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceFGDOS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'mocaVersion1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:mocaVersion1': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee80216WMAN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee80216WMAN': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'adsl2plus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:adsl2plus': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRcsMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRcsMacLayer': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbTdm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbTdm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'dvbRcsTdma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:dvbRcsTdma': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'x86Laps': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:x86Laps': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'wwanPP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:wwanPP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'wwanPP2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:wwanPP2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'voiceEBS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:voiceEBS': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ifPwType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ifPwType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ilan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ilan': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'pip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:pip': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluELP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluELP': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vdsl2': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapDot11Profile': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapDot11Profile': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapDot11Bss': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapDot11Bss': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'capwapWtpVirtualRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:capwapWtpVirtualRadio': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'bits': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:bits': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableUpstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableUpstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'cableDownstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:cableDownstreamRfPort': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vmwareVirtualNic': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vmwareVirtualNic': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ieee802154': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ieee802154': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOdu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOdu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ifVfiType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ifVfiType': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9981': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9981': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9982': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9982': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'g9983': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:g9983': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEpon': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluEponLogicalLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluEponLogicalLink': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluGponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluGponOnu': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'aluGponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:aluGponPhysicalUni': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'vmwareNicTeam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:vmwareNicTeam': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsOfdmDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsOfdmDownstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsOfdmaUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsOfdmaUpstream': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'gfast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:gfast': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'sdci': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:sdci': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'xboxWireless': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:xboxWireless': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'fastdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:fastdsl': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d1FwdOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d1FwdOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d1RetOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d1RetOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d2DsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d2DsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableScte55d2UsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableScte55d2UsOob': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableNdf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableNdf': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'docsCableNdr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:docsCableNdr': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ptm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ptm': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ghn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:ghn': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtsi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtsi': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtuc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtuc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOduc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOduc': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'otnOtsig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:otnOtsig': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'microwaveCarrierTermination': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:microwaveCarrierTermination': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'microwaveRadioLinkTerminal': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}, 'ianaift:microwaveRadioLinkTerminal': {'@module': 'iana-if-type', '@namespace': 'urn:ietf:params:xml:ns:yang:iana-if-type'}},), is_leaf=True, yang_name="type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='identityref', is_config=False) + + + def _get_mtu(self): + """ + Getter method for mtu, mapped from YANG variable /interfaces/interface/state/mtu (uint16) + + YANG Description: Set the max transmission unit size in octets +for the physical interface. If this is not set, the mtu is +set to the operational default -- e.g., 1514 bytes on an +Ethernet interface. + """ + return self.__mtu + + def _set_mtu(self, v, load=False): + """ + Setter method for mtu, mapped from YANG variable /interfaces/interface/state/mtu (uint16) + If this variable is read-only (config: false) in the + source YANG file, then _set_mtu is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_mtu() directly. + + YANG Description: Set the max transmission unit size in octets +for the physical interface. If this is not set, the mtu is +set to the operational default -- e.g., 1514 bytes on an +Ethernet interface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="mtu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint16', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """mtu must be of a type compatible with uint16""", + 'defined-type': "uint16", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="mtu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint16', is_config=False)""", + }) + + self.__mtu = t + if hasattr(self, '_set'): + self._set() + + def _unset_mtu(self): + self.__mtu = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), is_leaf=True, yang_name="mtu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint16', is_config=False) + + + def _get_loopback_mode(self): + """ + Getter method for loopback_mode, mapped from YANG variable /interfaces/interface/state/loopback_mode (boolean) + + YANG Description: When set to true, the interface is logically looped back, +such that packets that are forwarded via the interface +are received on the same interface. + """ + return self.__loopback_mode + + def _set_loopback_mode(self, v, load=False): + """ + Setter method for loopback_mode, mapped from YANG variable /interfaces/interface/state/loopback_mode (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_loopback_mode is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_loopback_mode() directly. + + YANG Description: When set to true, the interface is logically looped back, +such that packets that are forwarded via the interface +are received on the same interface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="loopback-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """loopback_mode must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="loopback-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False)""", + }) + + self.__loopback_mode = t + if hasattr(self, '_set'): + self._set() + + def _unset_loopback_mode(self): + self.__loopback_mode = YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="loopback-mode", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + + + def _get_description(self): + """ + Getter method for description, mapped from YANG variable /interfaces/interface/state/description (string) + + YANG Description: A textual description of the interface. + +A server implementation MAY map this leaf to the ifAlias +MIB object. Such an implementation needs to use some +mechanism to handle the differences in size and characters +allowed between this leaf and ifAlias. The definition of +such a mechanism is outside the scope of this document. + +Since ifAlias is defined to be stored in non-volatile +storage, the MIB implementation MUST map ifAlias to the +value of 'description' in the persistently stored +datastore. + +Specifically, if the device supports ':startup', when +ifAlias is read the device MUST return the value of +'description' in the 'startup' datastore, and when it is +written, it MUST be written to the 'running' and 'startup' +datastores. Note that it is up to the implementation to + +decide whether to modify this single leaf in 'startup' or +perform an implicit copy-config from 'running' to +'startup'. + +If the device does not support ':startup', ifAlias MUST +be mapped to the 'description' leaf in the 'running' +datastore. + """ + return self.__description + + def _set_description(self, v, load=False): + """ + Setter method for description, mapped from YANG variable /interfaces/interface/state/description (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_description is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_description() directly. + + YANG Description: A textual description of the interface. + +A server implementation MAY map this leaf to the ifAlias +MIB object. Such an implementation needs to use some +mechanism to handle the differences in size and characters +allowed between this leaf and ifAlias. The definition of +such a mechanism is outside the scope of this document. + +Since ifAlias is defined to be stored in non-volatile +storage, the MIB implementation MUST map ifAlias to the +value of 'description' in the persistently stored +datastore. + +Specifically, if the device supports ':startup', when +ifAlias is read the device MUST return the value of +'description' in the 'startup' datastore, and when it is +written, it MUST be written to the 'running' and 'startup' +datastores. Note that it is up to the implementation to + +decide whether to modify this single leaf in 'startup' or +perform an implicit copy-config from 'running' to +'startup'. + +If the device does not support ':startup', ifAlias MUST +be mapped to the 'description' leaf in the 'running' +datastore. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """description must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=False)""", + }) + + self.__description = t + if hasattr(self, '_set'): + self._set() + + def _unset_description(self): + self.__description = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=False) + + + def _get_enabled(self): + """ + Getter method for enabled, mapped from YANG variable /interfaces/interface/state/enabled (boolean) + + YANG Description: This leaf contains the configured, desired state of the +interface. + +Systems that implement the IF-MIB use the value of this +leaf in the 'running' datastore to set +IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry +has been initialized, as described in RFC 2863. + +Changes in this leaf in the 'running' datastore are +reflected in ifAdminStatus, but if ifAdminStatus is +changed over SNMP, this leaf is not affected. + """ + return self.__enabled + + def _set_enabled(self, v, load=False): + """ + Setter method for enabled, mapped from YANG variable /interfaces/interface/state/enabled (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_enabled is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enabled() directly. + + YANG Description: This leaf contains the configured, desired state of the +interface. + +Systems that implement the IF-MIB use the value of this +leaf in the 'running' datastore to set +IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry +has been initialized, as described in RFC 2863. + +Changes in this leaf in the 'running' datastore are +reflected in ifAdminStatus, but if ifAdminStatus is +changed over SNMP, this leaf is not affected. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enabled must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False)""", + }) + + self.__enabled = t + if hasattr(self, '_set'): + self._set() + + def _unset_enabled(self): + self.__enabled = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + + + def _get_ifindex(self): + """ + Getter method for ifindex, mapped from YANG variable /interfaces/interface/state/ifindex (uint32) + + YANG Description: System assigned number for each interface. Corresponds to +ifIndex object in SNMP Interface MIB + """ + return self.__ifindex + + def _set_ifindex(self, v, load=False): + """ + Setter method for ifindex, mapped from YANG variable /interfaces/interface/state/ifindex (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_ifindex is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ifindex() directly. + + YANG Description: System assigned number for each interface. Corresponds to +ifIndex object in SNMP Interface MIB + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="ifindex", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ifindex must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="ifindex", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=False)""", + }) + + self.__ifindex = t + if hasattr(self, '_set'): + self._set() + + def _unset_ifindex(self): + self.__ifindex = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="ifindex", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=False) + + + def _get_admin_status(self): + """ + Getter method for admin_status, mapped from YANG variable /interfaces/interface/state/admin_status (enumeration) + + YANG Description: The desired state of the interface. In RFC 7223 this leaf +has the same read semantics as ifAdminStatus. Here, it +reflects the administrative state as set by enabling or +disabling the interface. + """ + return self.__admin_status + + def _set_admin_status(self, v, load=False): + """ + Setter method for admin_status, mapped from YANG variable /interfaces/interface/state/admin_status (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_admin_status is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_admin_status() directly. + + YANG Description: The desired state of the interface. In RFC 7223 this leaf +has the same read semantics as ifAdminStatus. Here, it +reflects the administrative state as set by enabling or +disabling the interface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UP': {}, 'DOWN': {}, 'TESTING': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='enumeration', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """admin_status must be of a type compatible with enumeration""", + 'defined-type': "openconfig-interfaces:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UP': {}, 'DOWN': {}, 'TESTING': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='enumeration', is_config=False)""", + }) + + self.__admin_status = t + if hasattr(self, '_set'): + self._set() + + def _unset_admin_status(self): + self.__admin_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UP': {}, 'DOWN': {}, 'TESTING': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='enumeration', is_config=False) + + + def _get_oper_status(self): + """ + Getter method for oper_status, mapped from YANG variable /interfaces/interface/state/oper_status (enumeration) + + YANG Description: The current operational state of the interface. + +This leaf has the same semantics as ifOperStatus. + """ + return self.__oper_status + + def _set_oper_status(self, v, load=False): + """ + Setter method for oper_status, mapped from YANG variable /interfaces/interface/state/oper_status (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_oper_status is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_oper_status() directly. + + YANG Description: The current operational state of the interface. + +This leaf has the same semantics as ifOperStatus. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UP': {'value': 1}, 'DOWN': {'value': 2}, 'TESTING': {'value': 3}, 'UNKNOWN': {'value': 4}, 'DORMANT': {'value': 5}, 'NOT_PRESENT': {'value': 6}, 'LOWER_LAYER_DOWN': {'value': 7}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='enumeration', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """oper_status must be of a type compatible with enumeration""", + 'defined-type': "openconfig-interfaces:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UP': {'value': 1}, 'DOWN': {'value': 2}, 'TESTING': {'value': 3}, 'UNKNOWN': {'value': 4}, 'DORMANT': {'value': 5}, 'NOT_PRESENT': {'value': 6}, 'LOWER_LAYER_DOWN': {'value': 7}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='enumeration', is_config=False)""", + }) + + self.__oper_status = t + if hasattr(self, '_set'): + self._set() + + def _unset_oper_status(self): + self.__oper_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UP': {'value': 1}, 'DOWN': {'value': 2}, 'TESTING': {'value': 3}, 'UNKNOWN': {'value': 4}, 'DORMANT': {'value': 5}, 'NOT_PRESENT': {'value': 6}, 'LOWER_LAYER_DOWN': {'value': 7}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='enumeration', is_config=False) + + + def _get_last_change(self): + """ + Getter method for last_change, mapped from YANG variable /interfaces/interface/state/last_change (oc-types:timeticks64) + + YANG Description: This timestamp indicates the absolute time of the last +state change of the interface (e.g., up-to-down transition). +This is different than the SNMP ifLastChange object in the +standard interface MIB in that it is not relative to the +system boot time (i.e,. sysUpTime). + +The value is the timestamp in nanoseconds relative to +the Unix Epoch (Jan 1, 1970 00:00:00 UTC). + """ + return self.__last_change + + def _set_last_change(self, v, load=False): + """ + Setter method for last_change, mapped from YANG variable /interfaces/interface/state/last_change (oc-types:timeticks64) + If this variable is read-only (config: false) in the + source YANG file, then _set_last_change is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_last_change() directly. + + YANG Description: This timestamp indicates the absolute time of the last +state change of the interface (e.g., up-to-down transition). +This is different than the SNMP ifLastChange object in the +standard interface MIB in that it is not relative to the +system boot time (i.e,. sysUpTime). + +The value is the timestamp in nanoseconds relative to +the Unix Epoch (Jan 1, 1970 00:00:00 UTC). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-change", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-types:timeticks64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """last_change must be of a type compatible with oc-types:timeticks64""", + 'defined-type': "oc-types:timeticks64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-change", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-types:timeticks64', is_config=False)""", + }) + + self.__last_change = t + if hasattr(self, '_set'): + self._set() + + def _unset_last_change(self): + self.__last_change = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-change", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-types:timeticks64', is_config=False) + + + def _get_logical(self): + """ + Getter method for logical, mapped from YANG variable /interfaces/interface/state/logical (boolean) + + YANG Description: When set to true, the interface is a logical interface +which does not have an associated physical port or +channel on the system. + """ + return self.__logical + + def _set_logical(self, v, load=False): + """ + Setter method for logical, mapped from YANG variable /interfaces/interface/state/logical (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_logical is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_logical() directly. + + YANG Description: When set to true, the interface is a logical interface +which does not have an associated physical port or +channel on the system. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="logical", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """logical must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="logical", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False)""", + }) + + self.__logical = t + if hasattr(self, '_set'): + self._set() + + def _unset_logical(self): + self.__logical = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="logical", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + + + def _get_management(self): + """ + Getter method for management, mapped from YANG variable /interfaces/interface/state/management (boolean) + + YANG Description: When set to true, the interface is a dedicated +management interface that is not connected to dataplane +interfaces. It may be used to connect the system to an +out-of-band management network, for example. + """ + return self.__management + + def _set_management(self, v, load=False): + """ + Setter method for management, mapped from YANG variable /interfaces/interface/state/management (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_management is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_management() directly. + + YANG Description: When set to true, the interface is a dedicated +management interface that is not connected to dataplane +interfaces. It may be used to connect the system to an +out-of-band management network, for example. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="management", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """management must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="management", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False)""", + }) + + self.__management = t + if hasattr(self, '_set'): + self._set() + + def _unset_management(self): + self.__management = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="management", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + + + def _get_cpu(self): + """ + Getter method for cpu, mapped from YANG variable /interfaces/interface/state/cpu (boolean) + + YANG Description: When set to true, the interface is for traffic +that is handled by the system CPU, sometimes also called the +control plane interface. On systems that represent the CPU +interface as an Ethernet interface, for example, this leaf +should be used to distinguish the CPU interface from dataplane +interfaces. + """ + return self.__cpu + + def _set_cpu(self, v, load=False): + """ + Setter method for cpu, mapped from YANG variable /interfaces/interface/state/cpu (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_cpu is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_cpu() directly. + + YANG Description: When set to true, the interface is for traffic +that is handled by the system CPU, sometimes also called the +control plane interface. On systems that represent the CPU +interface as an Ethernet interface, for example, this leaf +should be used to distinguish the CPU interface from dataplane +interfaces. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="cpu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """cpu must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="cpu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False)""", + }) + + self.__cpu = t + if hasattr(self, '_set'): + self._set() + + def _unset_cpu(self): + self.__cpu = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="cpu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + + + def _get_counters(self): + """ + Getter method for counters, mapped from YANG variable /interfaces/interface/state/counters (container) + + YANG Description: A collection of interface-related statistics objects. + """ + return self.__counters + + def _set_counters(self, v, load=False): + """ + Setter method for counters, mapped from YANG variable /interfaces/interface/state/counters (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_counters is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_counters() directly. + + YANG Description: A collection of interface-related statistics objects. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=counters.counters, is_container='container', yang_name="counters", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """counters must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=counters.counters, is_container='container', yang_name="counters", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=False)""", + }) + + self.__counters = t + if hasattr(self, '_set'): + self._set() + + def _unset_counters(self): + self.__counters = YANGDynClass(base=counters.counters, is_container='container', yang_name="counters", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=False) + + + def _get_hardware_port(self): + """ + Getter method for hardware_port, mapped from YANG variable /interfaces/interface/state/hardware_port (leafref) + + YANG Description: For non-channelized interfaces, references the hardware port +corresponding to the base interface. + """ + return self.__hardware_port + + def _set_hardware_port(self, v, load=False): + """ + Setter method for hardware_port, mapped from YANG variable /interfaces/interface/state/hardware_port (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_hardware_port is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_hardware_port() directly. + + YANG Description: For non-channelized interfaces, references the hardware port +corresponding to the base interface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="hardware-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='leafref', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """hardware_port must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="hardware-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='leafref', is_config=False)""", + }) + + self.__hardware_port = t + if hasattr(self, '_set'): + self._set() + + def _unset_hardware_port(self): + self.__hardware_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="hardware-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/platform/port', defining_module='openconfig-platform-port', yang_type='leafref', is_config=False) + + name = __builtin__.property(_get_name) + type = __builtin__.property(_get_type) + mtu = __builtin__.property(_get_mtu) + loopback_mode = __builtin__.property(_get_loopback_mode) + description = __builtin__.property(_get_description) + enabled = __builtin__.property(_get_enabled) + ifindex = __builtin__.property(_get_ifindex) + admin_status = __builtin__.property(_get_admin_status) + oper_status = __builtin__.property(_get_oper_status) + last_change = __builtin__.property(_get_last_change) + logical = __builtin__.property(_get_logical) + management = __builtin__.property(_get_management) + cpu = __builtin__.property(_get_cpu) + counters = __builtin__.property(_get_counters) + hardware_port = __builtin__.property(_get_hardware_port) + + + _pyangbind_elements = OrderedDict([('name', name), ('type', type), ('mtu', mtu), ('loopback_mode', loopback_mode), ('description', description), ('enabled', enabled), ('ifindex', ifindex), ('admin_status', admin_status), ('oper_status', oper_status), ('last_change', last_change), ('logical', logical), ('management', management), ('cpu', cpu), ('counters', counters), ('hardware_port', hardware_port), ]) + + diff --git a/hackfest/netconf-oc/openconfig/interfaces/interface/state/counters/__init__.py b/hackfest/netconf-oc/openconfig/interfaces/interface/state/counters/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..bdda9eb5484cac77f7bee914eac4c130431c4630 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/interfaces/interface/state/counters/__init__.py @@ -0,0 +1,1029 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class counters(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-interfaces - based on the path /interfaces/interface/state/counters. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A collection of interface-related statistics objects. + """ + __slots__ = ('_path_helper', '_extmethods', '__in_octets','__in_pkts','__in_unicast_pkts','__in_broadcast_pkts','__in_multicast_pkts','__in_discards','__in_errors','__in_unknown_protos','__in_fcs_errors','__out_octets','__out_pkts','__out_unicast_pkts','__out_broadcast_pkts','__out_multicast_pkts','__out_discards','__out_errors','__carrier_transitions','__last_clear',) + + _yang_name = 'counters' + _yang_namespace = 'http://openconfig.net/yang/interfaces' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__in_octets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__in_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__in_unicast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-unicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__in_broadcast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-broadcast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__in_multicast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-multicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__in_discards = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-discards", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__in_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__in_unknown_protos = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-unknown-protos", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__in_fcs_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-fcs-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__out_octets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__out_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__out_unicast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-unicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__out_broadcast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-broadcast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__out_multicast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-multicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__out_discards = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-discards", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__out_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__carrier_transitions = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="carrier-transitions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__last_clear = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-clear", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-types:timeticks64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['interfaces', 'interface', 'state', 'counters'] + + def _get_in_octets(self): + """ + Getter method for in_octets, mapped from YANG variable /interfaces/interface/state/counters/in_octets (oc-yang:counter64) + + YANG Description: The total number of octets received on the interface, +including framing characters. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__in_octets + + def _set_in_octets(self, v, load=False): + """ + Setter method for in_octets, mapped from YANG variable /interfaces/interface/state/counters/in_octets (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_octets is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_octets() directly. + + YANG Description: The total number of octets received on the interface, +including framing characters. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_octets must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_octets = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_octets(self): + self.__in_octets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_pkts(self): + """ + Getter method for in_pkts, mapped from YANG variable /interfaces/interface/state/counters/in_pkts (oc-yang:counter64) + + YANG Description: The total number of packets received on the interface, +including all unicast, multicast, broadcast and bad packets +etc. + """ + return self.__in_pkts + + def _set_in_pkts(self, v, load=False): + """ + Setter method for in_pkts, mapped from YANG variable /interfaces/interface/state/counters/in_pkts (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_pkts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_pkts() directly. + + YANG Description: The total number of packets received on the interface, +including all unicast, multicast, broadcast and bad packets +etc. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_pkts must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_pkts = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_pkts(self): + self.__in_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_unicast_pkts(self): + """ + Getter method for in_unicast_pkts, mapped from YANG variable /interfaces/interface/state/counters/in_unicast_pkts (oc-yang:counter64) + + YANG Description: The number of packets, delivered by this sub-layer to a +higher (sub-)layer, that were not addressed to a +multicast or broadcast address at this sub-layer. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__in_unicast_pkts + + def _set_in_unicast_pkts(self, v, load=False): + """ + Setter method for in_unicast_pkts, mapped from YANG variable /interfaces/interface/state/counters/in_unicast_pkts (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_unicast_pkts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_unicast_pkts() directly. + + YANG Description: The number of packets, delivered by this sub-layer to a +higher (sub-)layer, that were not addressed to a +multicast or broadcast address at this sub-layer. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-unicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_unicast_pkts must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-unicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_unicast_pkts = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_unicast_pkts(self): + self.__in_unicast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-unicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_broadcast_pkts(self): + """ + Getter method for in_broadcast_pkts, mapped from YANG variable /interfaces/interface/state/counters/in_broadcast_pkts (oc-yang:counter64) + + YANG Description: The number of packets, delivered by this sub-layer to a +higher (sub-)layer, that were addressed to a broadcast +address at this sub-layer. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__in_broadcast_pkts + + def _set_in_broadcast_pkts(self, v, load=False): + """ + Setter method for in_broadcast_pkts, mapped from YANG variable /interfaces/interface/state/counters/in_broadcast_pkts (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_broadcast_pkts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_broadcast_pkts() directly. + + YANG Description: The number of packets, delivered by this sub-layer to a +higher (sub-)layer, that were addressed to a broadcast +address at this sub-layer. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-broadcast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_broadcast_pkts must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-broadcast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_broadcast_pkts = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_broadcast_pkts(self): + self.__in_broadcast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-broadcast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_multicast_pkts(self): + """ + Getter method for in_multicast_pkts, mapped from YANG variable /interfaces/interface/state/counters/in_multicast_pkts (oc-yang:counter64) + + YANG Description: The number of packets, delivered by this sub-layer to a +higher (sub-)layer, that were addressed to a multicast +address at this sub-layer. For a MAC-layer protocol, +this includes both Group and Functional addresses. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__in_multicast_pkts + + def _set_in_multicast_pkts(self, v, load=False): + """ + Setter method for in_multicast_pkts, mapped from YANG variable /interfaces/interface/state/counters/in_multicast_pkts (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_multicast_pkts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_multicast_pkts() directly. + + YANG Description: The number of packets, delivered by this sub-layer to a +higher (sub-)layer, that were addressed to a multicast +address at this sub-layer. For a MAC-layer protocol, +this includes both Group and Functional addresses. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-multicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_multicast_pkts must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-multicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_multicast_pkts = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_multicast_pkts(self): + self.__in_multicast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-multicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_discards(self): + """ + Getter method for in_discards, mapped from YANG variable /interfaces/interface/state/counters/in_discards (oc-yang:counter64) + + YANG Description: The number of inbound packets that were chosen to be +discarded even though no errors had been detected to +prevent their being deliverable to a higher-layer +protocol. One possible reason for discarding such a +packet could be to free up buffer space. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__in_discards + + def _set_in_discards(self, v, load=False): + """ + Setter method for in_discards, mapped from YANG variable /interfaces/interface/state/counters/in_discards (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_discards is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_discards() directly. + + YANG Description: The number of inbound packets that were chosen to be +discarded even though no errors had been detected to +prevent their being deliverable to a higher-layer +protocol. One possible reason for discarding such a +packet could be to free up buffer space. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-discards", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_discards must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-discards", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_discards = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_discards(self): + self.__in_discards = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-discards", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_errors(self): + """ + Getter method for in_errors, mapped from YANG variable /interfaces/interface/state/counters/in_errors (oc-yang:counter64) + + YANG Description: For packet-oriented interfaces, the number of inbound +packets that contained errors preventing them from being +deliverable to a higher-layer protocol. For character- +oriented or fixed-length interfaces, the number of +inbound transmission units that contained errors +preventing them from being deliverable to a higher-layer +protocol. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__in_errors + + def _set_in_errors(self, v, load=False): + """ + Setter method for in_errors, mapped from YANG variable /interfaces/interface/state/counters/in_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_errors() directly. + + YANG Description: For packet-oriented interfaces, the number of inbound +packets that contained errors preventing them from being +deliverable to a higher-layer protocol. For character- +oriented or fixed-length interfaces, the number of +inbound transmission units that contained errors +preventing them from being deliverable to a higher-layer +protocol. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_errors(self): + self.__in_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_unknown_protos(self): + """ + Getter method for in_unknown_protos, mapped from YANG variable /interfaces/interface/state/counters/in_unknown_protos (oc-yang:counter64) + + YANG Description: For packet-oriented interfaces, the number of packets +received via the interface that were discarded because +of an unknown or unsupported protocol. For +character-oriented or fixed-length interfaces that +support protocol multiplexing, the number of +transmission units received via the interface that were +discarded because of an unknown or unsupported protocol. +For any interface that does not support protocol +multiplexing, this counter is not present. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__in_unknown_protos + + def _set_in_unknown_protos(self, v, load=False): + """ + Setter method for in_unknown_protos, mapped from YANG variable /interfaces/interface/state/counters/in_unknown_protos (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_unknown_protos is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_unknown_protos() directly. + + YANG Description: For packet-oriented interfaces, the number of packets +received via the interface that were discarded because +of an unknown or unsupported protocol. For +character-oriented or fixed-length interfaces that +support protocol multiplexing, the number of +transmission units received via the interface that were +discarded because of an unknown or unsupported protocol. +For any interface that does not support protocol +multiplexing, this counter is not present. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-unknown-protos", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_unknown_protos must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-unknown-protos", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_unknown_protos = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_unknown_protos(self): + self.__in_unknown_protos = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-unknown-protos", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_fcs_errors(self): + """ + Getter method for in_fcs_errors, mapped from YANG variable /interfaces/interface/state/counters/in_fcs_errors (oc-yang:counter64) + + YANG Description: Number of received packets which had errors in the +frame check sequence (FCS), i.e., framing errors. + +Discontinuities in the value of this counter can occur +when the device is re-initialization as indicated by the +value of 'last-clear'. + """ + return self.__in_fcs_errors + + def _set_in_fcs_errors(self, v, load=False): + """ + Setter method for in_fcs_errors, mapped from YANG variable /interfaces/interface/state/counters/in_fcs_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_fcs_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_fcs_errors() directly. + + YANG Description: Number of received packets which had errors in the +frame check sequence (FCS), i.e., framing errors. + +Discontinuities in the value of this counter can occur +when the device is re-initialization as indicated by the +value of 'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-fcs-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_fcs_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-fcs-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_fcs_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_fcs_errors(self): + self.__in_fcs_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-fcs-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_out_octets(self): + """ + Getter method for out_octets, mapped from YANG variable /interfaces/interface/state/counters/out_octets (oc-yang:counter64) + + YANG Description: The total number of octets transmitted out of the +interface, including framing characters. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__out_octets + + def _set_out_octets(self, v, load=False): + """ + Setter method for out_octets, mapped from YANG variable /interfaces/interface/state/counters/out_octets (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_out_octets is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_out_octets() directly. + + YANG Description: The total number of octets transmitted out of the +interface, including framing characters. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """out_octets must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__out_octets = t + if hasattr(self, '_set'): + self._set() + + def _unset_out_octets(self): + self.__out_octets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_out_pkts(self): + """ + Getter method for out_pkts, mapped from YANG variable /interfaces/interface/state/counters/out_pkts (oc-yang:counter64) + + YANG Description: The total number of packets transmitted out of the +interface, including all unicast, multicast, broadcast, +and bad packets etc. + """ + return self.__out_pkts + + def _set_out_pkts(self, v, load=False): + """ + Setter method for out_pkts, mapped from YANG variable /interfaces/interface/state/counters/out_pkts (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_out_pkts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_out_pkts() directly. + + YANG Description: The total number of packets transmitted out of the +interface, including all unicast, multicast, broadcast, +and bad packets etc. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """out_pkts must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__out_pkts = t + if hasattr(self, '_set'): + self._set() + + def _unset_out_pkts(self): + self.__out_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_out_unicast_pkts(self): + """ + Getter method for out_unicast_pkts, mapped from YANG variable /interfaces/interface/state/counters/out_unicast_pkts (oc-yang:counter64) + + YANG Description: The total number of packets that higher-level protocols +requested be transmitted, and that were not addressed +to a multicast or broadcast address at this sub-layer, +including those that were discarded or not sent. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__out_unicast_pkts + + def _set_out_unicast_pkts(self, v, load=False): + """ + Setter method for out_unicast_pkts, mapped from YANG variable /interfaces/interface/state/counters/out_unicast_pkts (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_out_unicast_pkts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_out_unicast_pkts() directly. + + YANG Description: The total number of packets that higher-level protocols +requested be transmitted, and that were not addressed +to a multicast or broadcast address at this sub-layer, +including those that were discarded or not sent. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-unicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """out_unicast_pkts must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-unicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__out_unicast_pkts = t + if hasattr(self, '_set'): + self._set() + + def _unset_out_unicast_pkts(self): + self.__out_unicast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-unicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_out_broadcast_pkts(self): + """ + Getter method for out_broadcast_pkts, mapped from YANG variable /interfaces/interface/state/counters/out_broadcast_pkts (oc-yang:counter64) + + YANG Description: The total number of packets that higher-level protocols +requested be transmitted, and that were addressed to a +broadcast address at this sub-layer, including those +that were discarded or not sent. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__out_broadcast_pkts + + def _set_out_broadcast_pkts(self, v, load=False): + """ + Setter method for out_broadcast_pkts, mapped from YANG variable /interfaces/interface/state/counters/out_broadcast_pkts (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_out_broadcast_pkts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_out_broadcast_pkts() directly. + + YANG Description: The total number of packets that higher-level protocols +requested be transmitted, and that were addressed to a +broadcast address at this sub-layer, including those +that were discarded or not sent. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-broadcast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """out_broadcast_pkts must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-broadcast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__out_broadcast_pkts = t + if hasattr(self, '_set'): + self._set() + + def _unset_out_broadcast_pkts(self): + self.__out_broadcast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-broadcast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_out_multicast_pkts(self): + """ + Getter method for out_multicast_pkts, mapped from YANG variable /interfaces/interface/state/counters/out_multicast_pkts (oc-yang:counter64) + + YANG Description: The total number of packets that higher-level protocols +requested be transmitted, and that were addressed to a +multicast address at this sub-layer, including those +that were discarded or not sent. For a MAC-layer +protocol, this includes both Group and Functional +addresses. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__out_multicast_pkts + + def _set_out_multicast_pkts(self, v, load=False): + """ + Setter method for out_multicast_pkts, mapped from YANG variable /interfaces/interface/state/counters/out_multicast_pkts (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_out_multicast_pkts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_out_multicast_pkts() directly. + + YANG Description: The total number of packets that higher-level protocols +requested be transmitted, and that were addressed to a +multicast address at this sub-layer, including those +that were discarded or not sent. For a MAC-layer +protocol, this includes both Group and Functional +addresses. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-multicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """out_multicast_pkts must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-multicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__out_multicast_pkts = t + if hasattr(self, '_set'): + self._set() + + def _unset_out_multicast_pkts(self): + self.__out_multicast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-multicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_out_discards(self): + """ + Getter method for out_discards, mapped from YANG variable /interfaces/interface/state/counters/out_discards (oc-yang:counter64) + + YANG Description: The number of outbound packets that were chosen to be +discarded even though no errors had been detected to +prevent their being transmitted. One possible reason +for discarding such a packet could be to free up buffer +space. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__out_discards + + def _set_out_discards(self, v, load=False): + """ + Setter method for out_discards, mapped from YANG variable /interfaces/interface/state/counters/out_discards (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_out_discards is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_out_discards() directly. + + YANG Description: The number of outbound packets that were chosen to be +discarded even though no errors had been detected to +prevent their being transmitted. One possible reason +for discarding such a packet could be to free up buffer +space. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-discards", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """out_discards must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-discards", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__out_discards = t + if hasattr(self, '_set'): + self._set() + + def _unset_out_discards(self): + self.__out_discards = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-discards", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_out_errors(self): + """ + Getter method for out_errors, mapped from YANG variable /interfaces/interface/state/counters/out_errors (oc-yang:counter64) + + YANG Description: For packet-oriented interfaces, the number of outbound +packets that could not be transmitted because of errors. +For character-oriented or fixed-length interfaces, the +number of outbound transmission units that could not be +transmitted because of errors. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__out_errors + + def _set_out_errors(self, v, load=False): + """ + Setter method for out_errors, mapped from YANG variable /interfaces/interface/state/counters/out_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_out_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_out_errors() directly. + + YANG Description: For packet-oriented interfaces, the number of outbound +packets that could not be transmitted because of errors. +For character-oriented or fixed-length interfaces, the +number of outbound transmission units that could not be +transmitted because of errors. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """out_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__out_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_out_errors(self): + self.__out_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_carrier_transitions(self): + """ + Getter method for carrier_transitions, mapped from YANG variable /interfaces/interface/state/counters/carrier_transitions (oc-yang:counter64) + + YANG Description: Number of times the interface state has transitioned +between up and down since the time the device restarted +or the last-clear time, whichever is most recent. + """ + return self.__carrier_transitions + + def _set_carrier_transitions(self, v, load=False): + """ + Setter method for carrier_transitions, mapped from YANG variable /interfaces/interface/state/counters/carrier_transitions (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_carrier_transitions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_carrier_transitions() directly. + + YANG Description: Number of times the interface state has transitioned +between up and down since the time the device restarted +or the last-clear time, whichever is most recent. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="carrier-transitions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """carrier_transitions must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="carrier-transitions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__carrier_transitions = t + if hasattr(self, '_set'): + self._set() + + def _unset_carrier_transitions(self): + self.__carrier_transitions = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="carrier-transitions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_last_clear(self): + """ + Getter method for last_clear, mapped from YANG variable /interfaces/interface/state/counters/last_clear (oc-types:timeticks64) + + YANG Description: Timestamp of the last time the interface counters were +cleared. + +The value is the timestamp in nanoseconds relative to +the Unix Epoch (Jan 1, 1970 00:00:00 UTC). + """ + return self.__last_clear + + def _set_last_clear(self, v, load=False): + """ + Setter method for last_clear, mapped from YANG variable /interfaces/interface/state/counters/last_clear (oc-types:timeticks64) + If this variable is read-only (config: false) in the + source YANG file, then _set_last_clear is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_last_clear() directly. + + YANG Description: Timestamp of the last time the interface counters were +cleared. + +The value is the timestamp in nanoseconds relative to +the Unix Epoch (Jan 1, 1970 00:00:00 UTC). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-clear", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-types:timeticks64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """last_clear must be of a type compatible with oc-types:timeticks64""", + 'defined-type': "oc-types:timeticks64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-clear", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-types:timeticks64', is_config=False)""", + }) + + self.__last_clear = t + if hasattr(self, '_set'): + self._set() + + def _unset_last_clear(self): + self.__last_clear = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-clear", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-types:timeticks64', is_config=False) + + in_octets = __builtin__.property(_get_in_octets) + in_pkts = __builtin__.property(_get_in_pkts) + in_unicast_pkts = __builtin__.property(_get_in_unicast_pkts) + in_broadcast_pkts = __builtin__.property(_get_in_broadcast_pkts) + in_multicast_pkts = __builtin__.property(_get_in_multicast_pkts) + in_discards = __builtin__.property(_get_in_discards) + in_errors = __builtin__.property(_get_in_errors) + in_unknown_protos = __builtin__.property(_get_in_unknown_protos) + in_fcs_errors = __builtin__.property(_get_in_fcs_errors) + out_octets = __builtin__.property(_get_out_octets) + out_pkts = __builtin__.property(_get_out_pkts) + out_unicast_pkts = __builtin__.property(_get_out_unicast_pkts) + out_broadcast_pkts = __builtin__.property(_get_out_broadcast_pkts) + out_multicast_pkts = __builtin__.property(_get_out_multicast_pkts) + out_discards = __builtin__.property(_get_out_discards) + out_errors = __builtin__.property(_get_out_errors) + carrier_transitions = __builtin__.property(_get_carrier_transitions) + last_clear = __builtin__.property(_get_last_clear) + + + _pyangbind_elements = OrderedDict([('in_octets', in_octets), ('in_pkts', in_pkts), ('in_unicast_pkts', in_unicast_pkts), ('in_broadcast_pkts', in_broadcast_pkts), ('in_multicast_pkts', in_multicast_pkts), ('in_discards', in_discards), ('in_errors', in_errors), ('in_unknown_protos', in_unknown_protos), ('in_fcs_errors', in_fcs_errors), ('out_octets', out_octets), ('out_pkts', out_pkts), ('out_unicast_pkts', out_unicast_pkts), ('out_broadcast_pkts', out_broadcast_pkts), ('out_multicast_pkts', out_multicast_pkts), ('out_discards', out_discards), ('out_errors', out_errors), ('carrier_transitions', carrier_transitions), ('last_clear', last_clear), ]) + + diff --git a/hackfest/netconf-oc/openconfig/interfaces/interface/subinterfaces/__init__.py b/hackfest/netconf-oc/openconfig/interfaces/interface/subinterfaces/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0145b376a03bf233ef31b50261f70d58241e9a66 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/interfaces/interface/subinterfaces/__init__.py @@ -0,0 +1,118 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import subinterface +class subinterfaces(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-interfaces - based on the path /interfaces/interface/subinterfaces. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Enclosing container for the list of subinterfaces associated +with a physical interface + """ + __slots__ = ('_path_helper', '_extmethods', '__subinterface',) + + _yang_name = 'subinterfaces' + _yang_namespace = 'http://openconfig.net/yang/interfaces' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__subinterface = YANGDynClass(base=YANGListType("index",subinterface.subinterface, yang_name="subinterface", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['interfaces', 'interface', 'subinterfaces'] + + def _get_subinterface(self): + """ + Getter method for subinterface, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface (list) + + YANG Description: The list of subinterfaces (logical interfaces) associated +with a physical interface + """ + return self.__subinterface + + def _set_subinterface(self, v, load=False): + """ + Setter method for subinterface, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_subinterface is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_subinterface() directly. + + YANG Description: The list of subinterfaces (logical interfaces) associated +with a physical interface + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("index",subinterface.subinterface, yang_name="subinterface", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """subinterface must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("index",subinterface.subinterface, yang_name="subinterface", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='list', is_config=True)""", + }) + + self.__subinterface = t + if hasattr(self, '_set'): + self._set() + + def _unset_subinterface(self): + self.__subinterface = YANGDynClass(base=YANGListType("index",subinterface.subinterface, yang_name="subinterface", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='index', extensions=None), is_container='list', yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='list', is_config=True) + + subinterface = __builtin__.property(_get_subinterface, _set_subinterface) + + + _pyangbind_elements = OrderedDict([('subinterface', subinterface), ]) + + diff --git a/hackfest/netconf-oc/openconfig/interfaces/interface/subinterfaces/subinterface/__init__.py b/hackfest/netconf-oc/openconfig/interfaces/interface/subinterfaces/subinterface/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b74e019a7552177737d6d1ad0425467f9ef5e526 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/interfaces/interface/subinterfaces/subinterface/__init__.py @@ -0,0 +1,202 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import config +from . import state +class subinterface(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-interfaces - based on the path /interfaces/interface/subinterfaces/subinterface. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: The list of subinterfaces (logical interfaces) associated +with a physical interface + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__config','__state',) + + _yang_name = 'subinterface' + _yang_namespace = 'http://openconfig.net/yang/interfaces' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='leafref', is_config=True) + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['interfaces', 'interface', 'subinterfaces', 'subinterface'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/index (leafref) + + YANG Description: The index number of the subinterface -- used to address +the logical interface + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/index (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: The index number of the subinterface -- used to address +the logical interface + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='leafref', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='leafref', is_config=True) + + + def _get_config(self): + """ + Getter method for config, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/config (container) + + YANG Description: Configurable items at the subinterface level + """ + return self.__config + + def _set_config(self, v, load=False): + """ + Setter method for config, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/config (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_config is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_config() directly. + + YANG Description: Configurable items at the subinterface level + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """config must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True)""", + }) + + self.__config = t + if hasattr(self, '_set'): + self._set() + + def _unset_config(self): + self.__config = YANGDynClass(base=config.config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + + + def _get_state(self): + """ + Getter method for state, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state (container) + + YANG Description: Operational state data for logical interfaces + """ + return self.__state + + def _set_state(self, v, load=False): + """ + Setter method for state, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_state is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_state() directly. + + YANG Description: Operational state data for logical interfaces + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """state must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True)""", + }) + + self.__state = t + if hasattr(self, '_set'): + self._set() + + def _unset_state(self): + self.__state = YANGDynClass(base=state.state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) + + + _pyangbind_elements = OrderedDict([('index', index), ('config', config), ('state', state), ]) + + diff --git a/hackfest/netconf-oc/openconfig/interfaces/interface/subinterfaces/subinterface/config/__init__.py b/hackfest/netconf-oc/openconfig/interfaces/interface/subinterfaces/subinterface/config/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fb6262e5facf1d46a17eb9edce771ecd99575c17 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/interfaces/interface/subinterfaces/subinterface/config/__init__.py @@ -0,0 +1,268 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class config(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-interfaces - based on the path /interfaces/interface/subinterfaces/subinterface/config. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Configurable items at the subinterface level + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__description','__enabled',) + + _yang_name = 'config' + _yang_namespace = 'http://openconfig.net/yang/interfaces' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=True) + self.__description = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=True) + self.__enabled = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['interfaces', 'interface', 'subinterfaces', 'subinterface', 'config'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/config/index (uint32) + + YANG Description: The index of the subinterface, or logical interface number. +On systems with no support for subinterfaces, or not using +subinterfaces, this value should default to 0, i.e., the +default subinterface. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/config/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: The index of the subinterface, or logical interface number. +On systems with no support for subinterfaces, or not using +subinterfaces, this value should default to 0, i.e., the +default subinterface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=True)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=True) + + + def _get_description(self): + """ + Getter method for description, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/config/description (string) + + YANG Description: A textual description of the interface. + +A server implementation MAY map this leaf to the ifAlias +MIB object. Such an implementation needs to use some +mechanism to handle the differences in size and characters +allowed between this leaf and ifAlias. The definition of +such a mechanism is outside the scope of this document. + +Since ifAlias is defined to be stored in non-volatile +storage, the MIB implementation MUST map ifAlias to the +value of 'description' in the persistently stored +datastore. + +Specifically, if the device supports ':startup', when +ifAlias is read the device MUST return the value of +'description' in the 'startup' datastore, and when it is +written, it MUST be written to the 'running' and 'startup' +datastores. Note that it is up to the implementation to + +decide whether to modify this single leaf in 'startup' or +perform an implicit copy-config from 'running' to +'startup'. + +If the device does not support ':startup', ifAlias MUST +be mapped to the 'description' leaf in the 'running' +datastore. + """ + return self.__description + + def _set_description(self, v, load=False): + """ + Setter method for description, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/config/description (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_description is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_description() directly. + + YANG Description: A textual description of the interface. + +A server implementation MAY map this leaf to the ifAlias +MIB object. Such an implementation needs to use some +mechanism to handle the differences in size and characters +allowed between this leaf and ifAlias. The definition of +such a mechanism is outside the scope of this document. + +Since ifAlias is defined to be stored in non-volatile +storage, the MIB implementation MUST map ifAlias to the +value of 'description' in the persistently stored +datastore. + +Specifically, if the device supports ':startup', when +ifAlias is read the device MUST return the value of +'description' in the 'startup' datastore, and when it is +written, it MUST be written to the 'running' and 'startup' +datastores. Note that it is up to the implementation to + +decide whether to modify this single leaf in 'startup' or +perform an implicit copy-config from 'running' to +'startup'. + +If the device does not support ':startup', ifAlias MUST +be mapped to the 'description' leaf in the 'running' +datastore. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """description must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=True)""", + }) + + self.__description = t + if hasattr(self, '_set'): + self._set() + + def _unset_description(self): + self.__description = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=True) + + + def _get_enabled(self): + """ + Getter method for enabled, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/config/enabled (boolean) + + YANG Description: This leaf contains the configured, desired state of the +interface. + +Systems that implement the IF-MIB use the value of this +leaf in the 'running' datastore to set +IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry +has been initialized, as described in RFC 2863. + +Changes in this leaf in the 'running' datastore are +reflected in ifAdminStatus, but if ifAdminStatus is +changed over SNMP, this leaf is not affected. + """ + return self.__enabled + + def _set_enabled(self, v, load=False): + """ + Setter method for enabled, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/config/enabled (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_enabled is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enabled() directly. + + YANG Description: This leaf contains the configured, desired state of the +interface. + +Systems that implement the IF-MIB use the value of this +leaf in the 'running' datastore to set +IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry +has been initialized, as described in RFC 2863. + +Changes in this leaf in the 'running' datastore are +reflected in ifAdminStatus, but if ifAdminStatus is +changed over SNMP, this leaf is not affected. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enabled must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=True)""", + }) + + self.__enabled = t + if hasattr(self, '_set'): + self._set() + + def _unset_enabled(self): + self.__enabled = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=True) + + index = __builtin__.property(_get_index, _set_index) + description = __builtin__.property(_get_description, _set_description) + enabled = __builtin__.property(_get_enabled, _set_enabled) + + + _pyangbind_elements = OrderedDict([('index', index), ('description', description), ('enabled', enabled), ]) + + diff --git a/hackfest/netconf-oc/openconfig/interfaces/interface/subinterfaces/subinterface/state/__init__.py b/hackfest/netconf-oc/openconfig/interfaces/interface/subinterfaces/subinterface/state/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a40a3022793b2329361872906fca74829d38f711 --- /dev/null +++ b/hackfest/netconf-oc/openconfig/interfaces/interface/subinterfaces/subinterface/state/__init__.py @@ -0,0 +1,672 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +from . import counters +class state(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-interfaces - based on the path /interfaces/interface/subinterfaces/subinterface/state. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Operational state data for logical interfaces + """ + __slots__ = ('_path_helper', '_extmethods', '__index','__description','__enabled','__name','__ifindex','__admin_status','__oper_status','__last_change','__logical','__management','__cpu','__counters',) + + _yang_name = 'state' + _yang_namespace = 'http://openconfig.net/yang/interfaces' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=False) + self.__description = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=False) + self.__enabled = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=False) + self.__ifindex = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="ifindex", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=False) + self.__admin_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UP': {}, 'DOWN': {}, 'TESTING': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='enumeration', is_config=False) + self.__oper_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UP': {'value': 1}, 'DOWN': {'value': 2}, 'TESTING': {'value': 3}, 'UNKNOWN': {'value': 4}, 'DORMANT': {'value': 5}, 'NOT_PRESENT': {'value': 6}, 'LOWER_LAYER_DOWN': {'value': 7}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='enumeration', is_config=False) + self.__last_change = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-change", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-types:timeticks64', is_config=False) + self.__logical = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="logical", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + self.__management = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="management", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + self.__cpu = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="cpu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + self.__counters = YANGDynClass(base=counters.counters, is_container='container', yang_name="counters", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['interfaces', 'interface', 'subinterfaces', 'subinterface', 'state'] + + def _get_index(self): + """ + Getter method for index, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/index (uint32) + + YANG Description: The index of the subinterface, or logical interface number. +On systems with no support for subinterfaces, or not using +subinterfaces, this value should default to 0, i.e., the +default subinterface. + """ + return self.__index + + def _set_index(self, v, load=False): + """ + Setter method for index, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/index (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_index is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_index() directly. + + YANG Description: The index of the subinterface, or logical interface number. +On systems with no support for subinterfaces, or not using +subinterfaces, this value should default to 0, i.e., the +default subinterface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """index must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=False)""", + }) + + self.__index = t + if hasattr(self, '_set'): + self._set() + + def _unset_index(self): + self.__index = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), default=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32)(0), is_leaf=True, yang_name="index", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=False) + + + def _get_description(self): + """ + Getter method for description, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/description (string) + + YANG Description: A textual description of the interface. + +A server implementation MAY map this leaf to the ifAlias +MIB object. Such an implementation needs to use some +mechanism to handle the differences in size and characters +allowed between this leaf and ifAlias. The definition of +such a mechanism is outside the scope of this document. + +Since ifAlias is defined to be stored in non-volatile +storage, the MIB implementation MUST map ifAlias to the +value of 'description' in the persistently stored +datastore. + +Specifically, if the device supports ':startup', when +ifAlias is read the device MUST return the value of +'description' in the 'startup' datastore, and when it is +written, it MUST be written to the 'running' and 'startup' +datastores. Note that it is up to the implementation to + +decide whether to modify this single leaf in 'startup' or +perform an implicit copy-config from 'running' to +'startup'. + +If the device does not support ':startup', ifAlias MUST +be mapped to the 'description' leaf in the 'running' +datastore. + """ + return self.__description + + def _set_description(self, v, load=False): + """ + Setter method for description, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/description (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_description is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_description() directly. + + YANG Description: A textual description of the interface. + +A server implementation MAY map this leaf to the ifAlias +MIB object. Such an implementation needs to use some +mechanism to handle the differences in size and characters +allowed between this leaf and ifAlias. The definition of +such a mechanism is outside the scope of this document. + +Since ifAlias is defined to be stored in non-volatile +storage, the MIB implementation MUST map ifAlias to the +value of 'description' in the persistently stored +datastore. + +Specifically, if the device supports ':startup', when +ifAlias is read the device MUST return the value of +'description' in the 'startup' datastore, and when it is +written, it MUST be written to the 'running' and 'startup' +datastores. Note that it is up to the implementation to + +decide whether to modify this single leaf in 'startup' or +perform an implicit copy-config from 'running' to +'startup'. + +If the device does not support ':startup', ifAlias MUST +be mapped to the 'description' leaf in the 'running' +datastore. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """description must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=False)""", + }) + + self.__description = t + if hasattr(self, '_set'): + self._set() + + def _unset_description(self): + self.__description = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=False) + + + def _get_enabled(self): + """ + Getter method for enabled, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/enabled (boolean) + + YANG Description: This leaf contains the configured, desired state of the +interface. + +Systems that implement the IF-MIB use the value of this +leaf in the 'running' datastore to set +IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry +has been initialized, as described in RFC 2863. + +Changes in this leaf in the 'running' datastore are +reflected in ifAdminStatus, but if ifAdminStatus is +changed over SNMP, this leaf is not affected. + """ + return self.__enabled + + def _set_enabled(self, v, load=False): + """ + Setter method for enabled, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/enabled (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_enabled is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_enabled() directly. + + YANG Description: This leaf contains the configured, desired state of the +interface. + +Systems that implement the IF-MIB use the value of this +leaf in the 'running' datastore to set +IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry +has been initialized, as described in RFC 2863. + +Changes in this leaf in the 'running' datastore are +reflected in ifAdminStatus, but if ifAdminStatus is +changed over SNMP, this leaf is not affected. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """enabled must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False)""", + }) + + self.__enabled = t + if hasattr(self, '_set'): + self._set() + + def _unset_enabled(self): + self.__enabled = YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + + + def _get_name(self): + """ + Getter method for name, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/name (string) + + YANG Description: The system-assigned name for the sub-interface. This MAY +be a combination of the base interface name and the +subinterface index, or some other convention used by the +system. + """ + return self.__name + + def _set_name(self, v, load=False): + """ + Setter method for name, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/name (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_name() directly. + + YANG Description: The system-assigned name for the sub-interface. This MAY +be a combination of the base interface name and the +subinterface index, or some other convention used by the +system. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """name must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=False)""", + }) + + self.__name = t + if hasattr(self, '_set'): + self._set() + + def _unset_name(self): + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='string', is_config=False) + + + def _get_ifindex(self): + """ + Getter method for ifindex, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/ifindex (uint32) + + YANG Description: System assigned number for each interface. Corresponds to +ifIndex object in SNMP Interface MIB + """ + return self.__ifindex + + def _set_ifindex(self, v, load=False): + """ + Setter method for ifindex, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/ifindex (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_ifindex is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_ifindex() directly. + + YANG Description: System assigned number for each interface. Corresponds to +ifIndex object in SNMP Interface MIB + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="ifindex", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """ifindex must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="ifindex", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=False)""", + }) + + self.__ifindex = t + if hasattr(self, '_set'): + self._set() + + def _unset_ifindex(self): + self.__ifindex = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="ifindex", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='uint32', is_config=False) + + + def _get_admin_status(self): + """ + Getter method for admin_status, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/admin_status (enumeration) + + YANG Description: The desired state of the interface. In RFC 7223 this leaf +has the same read semantics as ifAdminStatus. Here, it +reflects the administrative state as set by enabling or +disabling the interface. + """ + return self.__admin_status + + def _set_admin_status(self, v, load=False): + """ + Setter method for admin_status, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/admin_status (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_admin_status is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_admin_status() directly. + + YANG Description: The desired state of the interface. In RFC 7223 this leaf +has the same read semantics as ifAdminStatus. Here, it +reflects the administrative state as set by enabling or +disabling the interface. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UP': {}, 'DOWN': {}, 'TESTING': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='enumeration', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """admin_status must be of a type compatible with enumeration""", + 'defined-type': "openconfig-interfaces:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UP': {}, 'DOWN': {}, 'TESTING': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='enumeration', is_config=False)""", + }) + + self.__admin_status = t + if hasattr(self, '_set'): + self._set() + + def _unset_admin_status(self): + self.__admin_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UP': {}, 'DOWN': {}, 'TESTING': {}},), is_leaf=True, yang_name="admin-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='enumeration', is_config=False) + + + def _get_oper_status(self): + """ + Getter method for oper_status, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/oper_status (enumeration) + + YANG Description: The current operational state of the interface. + +This leaf has the same semantics as ifOperStatus. + """ + return self.__oper_status + + def _set_oper_status(self, v, load=False): + """ + Setter method for oper_status, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/oper_status (enumeration) + If this variable is read-only (config: false) in the + source YANG file, then _set_oper_status is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_oper_status() directly. + + YANG Description: The current operational state of the interface. + +This leaf has the same semantics as ifOperStatus. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UP': {'value': 1}, 'DOWN': {'value': 2}, 'TESTING': {'value': 3}, 'UNKNOWN': {'value': 4}, 'DORMANT': {'value': 5}, 'NOT_PRESENT': {'value': 6}, 'LOWER_LAYER_DOWN': {'value': 7}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='enumeration', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """oper_status must be of a type compatible with enumeration""", + 'defined-type': "openconfig-interfaces:enumeration", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UP': {'value': 1}, 'DOWN': {'value': 2}, 'TESTING': {'value': 3}, 'UNKNOWN': {'value': 4}, 'DORMANT': {'value': 5}, 'NOT_PRESENT': {'value': 6}, 'LOWER_LAYER_DOWN': {'value': 7}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='enumeration', is_config=False)""", + }) + + self.__oper_status = t + if hasattr(self, '_set'): + self._set() + + def _unset_oper_status(self): + self.__oper_status = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'UP': {'value': 1}, 'DOWN': {'value': 2}, 'TESTING': {'value': 3}, 'UNKNOWN': {'value': 4}, 'DORMANT': {'value': 5}, 'NOT_PRESENT': {'value': 6}, 'LOWER_LAYER_DOWN': {'value': 7}},), is_leaf=True, yang_name="oper-status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='enumeration', is_config=False) + + + def _get_last_change(self): + """ + Getter method for last_change, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/last_change (oc-types:timeticks64) + + YANG Description: This timestamp indicates the absolute time of the last +state change of the interface (e.g., up-to-down transition). +This is different than the SNMP ifLastChange object in the +standard interface MIB in that it is not relative to the +system boot time (i.e,. sysUpTime). + +The value is the timestamp in nanoseconds relative to +the Unix Epoch (Jan 1, 1970 00:00:00 UTC). + """ + return self.__last_change + + def _set_last_change(self, v, load=False): + """ + Setter method for last_change, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/last_change (oc-types:timeticks64) + If this variable is read-only (config: false) in the + source YANG file, then _set_last_change is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_last_change() directly. + + YANG Description: This timestamp indicates the absolute time of the last +state change of the interface (e.g., up-to-down transition). +This is different than the SNMP ifLastChange object in the +standard interface MIB in that it is not relative to the +system boot time (i.e,. sysUpTime). + +The value is the timestamp in nanoseconds relative to +the Unix Epoch (Jan 1, 1970 00:00:00 UTC). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-change", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-types:timeticks64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """last_change must be of a type compatible with oc-types:timeticks64""", + 'defined-type': "oc-types:timeticks64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-change", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-types:timeticks64', is_config=False)""", + }) + + self.__last_change = t + if hasattr(self, '_set'): + self._set() + + def _unset_last_change(self): + self.__last_change = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-change", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-types:timeticks64', is_config=False) + + + def _get_logical(self): + """ + Getter method for logical, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/logical (boolean) + + YANG Description: When set to true, the interface is a logical interface +which does not have an associated physical port or +channel on the system. + """ + return self.__logical + + def _set_logical(self, v, load=False): + """ + Setter method for logical, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/logical (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_logical is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_logical() directly. + + YANG Description: When set to true, the interface is a logical interface +which does not have an associated physical port or +channel on the system. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="logical", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """logical must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="logical", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False)""", + }) + + self.__logical = t + if hasattr(self, '_set'): + self._set() + + def _unset_logical(self): + self.__logical = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="logical", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + + + def _get_management(self): + """ + Getter method for management, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/management (boolean) + + YANG Description: When set to true, the interface is a dedicated +management interface that is not connected to dataplane +interfaces. It may be used to connect the system to an +out-of-band management network, for example. + """ + return self.__management + + def _set_management(self, v, load=False): + """ + Setter method for management, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/management (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_management is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_management() directly. + + YANG Description: When set to true, the interface is a dedicated +management interface that is not connected to dataplane +interfaces. It may be used to connect the system to an +out-of-band management network, for example. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="management", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """management must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="management", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False)""", + }) + + self.__management = t + if hasattr(self, '_set'): + self._set() + + def _unset_management(self): + self.__management = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="management", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + + + def _get_cpu(self): + """ + Getter method for cpu, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/cpu (boolean) + + YANG Description: When set to true, the interface is for traffic +that is handled by the system CPU, sometimes also called the +control plane interface. On systems that represent the CPU +interface as an Ethernet interface, for example, this leaf +should be used to distinguish the CPU interface from dataplane +interfaces. + """ + return self.__cpu + + def _set_cpu(self, v, load=False): + """ + Setter method for cpu, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/cpu (boolean) + If this variable is read-only (config: false) in the + source YANG file, then _set_cpu is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_cpu() directly. + + YANG Description: When set to true, the interface is for traffic +that is handled by the system CPU, sometimes also called the +control plane interface. On systems that represent the CPU +interface as an Ethernet interface, for example, this leaf +should be used to distinguish the CPU interface from dataplane +interfaces. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGBool, is_leaf=True, yang_name="cpu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """cpu must be of a type compatible with boolean""", + 'defined-type': "boolean", + 'generated-type': """YANGDynClass(base=YANGBool, is_leaf=True, yang_name="cpu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False)""", + }) + + self.__cpu = t + if hasattr(self, '_set'): + self._set() + + def _unset_cpu(self): + self.__cpu = YANGDynClass(base=YANGBool, is_leaf=True, yang_name="cpu", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='boolean', is_config=False) + + + def _get_counters(self): + """ + Getter method for counters, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters (container) + + YANG Description: A collection of interface-related statistics objects. + """ + return self.__counters + + def _set_counters(self, v, load=False): + """ + Setter method for counters, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_counters is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_counters() directly. + + YANG Description: A collection of interface-related statistics objects. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=counters.counters, is_container='container', yang_name="counters", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """counters must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=counters.counters, is_container='container', yang_name="counters", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=False)""", + }) + + self.__counters = t + if hasattr(self, '_set'): + self._set() + + def _unset_counters(self): + self.__counters = YANGDynClass(base=counters.counters, is_container='container', yang_name="counters", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='container', is_config=False) + + index = __builtin__.property(_get_index) + description = __builtin__.property(_get_description) + enabled = __builtin__.property(_get_enabled) + name = __builtin__.property(_get_name) + ifindex = __builtin__.property(_get_ifindex) + admin_status = __builtin__.property(_get_admin_status) + oper_status = __builtin__.property(_get_oper_status) + last_change = __builtin__.property(_get_last_change) + logical = __builtin__.property(_get_logical) + management = __builtin__.property(_get_management) + cpu = __builtin__.property(_get_cpu) + counters = __builtin__.property(_get_counters) + + + _pyangbind_elements = OrderedDict([('index', index), ('description', description), ('enabled', enabled), ('name', name), ('ifindex', ifindex), ('admin_status', admin_status), ('oper_status', oper_status), ('last_change', last_change), ('logical', logical), ('management', management), ('cpu', cpu), ('counters', counters), ]) + + diff --git a/hackfest/netconf-oc/openconfig/interfaces/interface/subinterfaces/subinterface/state/counters/__init__.py b/hackfest/netconf-oc/openconfig/interfaces/interface/subinterfaces/subinterface/state/counters/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..62bf19a4b7d365bec2537362c71efa19dfb043dc --- /dev/null +++ b/hackfest/netconf-oc/openconfig/interfaces/interface/subinterfaces/subinterface/state/counters/__init__.py @@ -0,0 +1,1029 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class counters(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-interfaces - based on the path /interfaces/interface/subinterfaces/subinterface/state/counters. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: A collection of interface-related statistics objects. + """ + __slots__ = ('_path_helper', '_extmethods', '__in_octets','__in_pkts','__in_unicast_pkts','__in_broadcast_pkts','__in_multicast_pkts','__in_discards','__in_errors','__in_unknown_protos','__in_fcs_errors','__out_octets','__out_pkts','__out_unicast_pkts','__out_broadcast_pkts','__out_multicast_pkts','__out_discards','__out_errors','__carrier_transitions','__last_clear',) + + _yang_name = 'counters' + _yang_namespace = 'http://openconfig.net/yang/interfaces' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__in_octets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__in_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__in_unicast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-unicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__in_broadcast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-broadcast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__in_multicast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-multicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__in_discards = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-discards", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__in_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__in_unknown_protos = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-unknown-protos", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__in_fcs_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-fcs-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__out_octets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__out_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__out_unicast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-unicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__out_broadcast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-broadcast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__out_multicast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-multicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__out_discards = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-discards", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__out_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__carrier_transitions = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="carrier-transitions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + self.__last_clear = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-clear", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-types:timeticks64', is_config=False) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['interfaces', 'interface', 'subinterfaces', 'subinterface', 'state', 'counters'] + + def _get_in_octets(self): + """ + Getter method for in_octets, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/in_octets (oc-yang:counter64) + + YANG Description: The total number of octets received on the interface, +including framing characters. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__in_octets + + def _set_in_octets(self, v, load=False): + """ + Setter method for in_octets, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/in_octets (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_octets is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_octets() directly. + + YANG Description: The total number of octets received on the interface, +including framing characters. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_octets must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_octets = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_octets(self): + self.__in_octets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_pkts(self): + """ + Getter method for in_pkts, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/in_pkts (oc-yang:counter64) + + YANG Description: The total number of packets received on the interface, +including all unicast, multicast, broadcast and bad packets +etc. + """ + return self.__in_pkts + + def _set_in_pkts(self, v, load=False): + """ + Setter method for in_pkts, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/in_pkts (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_pkts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_pkts() directly. + + YANG Description: The total number of packets received on the interface, +including all unicast, multicast, broadcast and bad packets +etc. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_pkts must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_pkts = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_pkts(self): + self.__in_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_unicast_pkts(self): + """ + Getter method for in_unicast_pkts, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/in_unicast_pkts (oc-yang:counter64) + + YANG Description: The number of packets, delivered by this sub-layer to a +higher (sub-)layer, that were not addressed to a +multicast or broadcast address at this sub-layer. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__in_unicast_pkts + + def _set_in_unicast_pkts(self, v, load=False): + """ + Setter method for in_unicast_pkts, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/in_unicast_pkts (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_unicast_pkts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_unicast_pkts() directly. + + YANG Description: The number of packets, delivered by this sub-layer to a +higher (sub-)layer, that were not addressed to a +multicast or broadcast address at this sub-layer. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-unicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_unicast_pkts must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-unicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_unicast_pkts = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_unicast_pkts(self): + self.__in_unicast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-unicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_broadcast_pkts(self): + """ + Getter method for in_broadcast_pkts, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/in_broadcast_pkts (oc-yang:counter64) + + YANG Description: The number of packets, delivered by this sub-layer to a +higher (sub-)layer, that were addressed to a broadcast +address at this sub-layer. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__in_broadcast_pkts + + def _set_in_broadcast_pkts(self, v, load=False): + """ + Setter method for in_broadcast_pkts, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/in_broadcast_pkts (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_broadcast_pkts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_broadcast_pkts() directly. + + YANG Description: The number of packets, delivered by this sub-layer to a +higher (sub-)layer, that were addressed to a broadcast +address at this sub-layer. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-broadcast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_broadcast_pkts must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-broadcast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_broadcast_pkts = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_broadcast_pkts(self): + self.__in_broadcast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-broadcast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_multicast_pkts(self): + """ + Getter method for in_multicast_pkts, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/in_multicast_pkts (oc-yang:counter64) + + YANG Description: The number of packets, delivered by this sub-layer to a +higher (sub-)layer, that were addressed to a multicast +address at this sub-layer. For a MAC-layer protocol, +this includes both Group and Functional addresses. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__in_multicast_pkts + + def _set_in_multicast_pkts(self, v, load=False): + """ + Setter method for in_multicast_pkts, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/in_multicast_pkts (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_multicast_pkts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_multicast_pkts() directly. + + YANG Description: The number of packets, delivered by this sub-layer to a +higher (sub-)layer, that were addressed to a multicast +address at this sub-layer. For a MAC-layer protocol, +this includes both Group and Functional addresses. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-multicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_multicast_pkts must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-multicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_multicast_pkts = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_multicast_pkts(self): + self.__in_multicast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-multicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_discards(self): + """ + Getter method for in_discards, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/in_discards (oc-yang:counter64) + + YANG Description: The number of inbound packets that were chosen to be +discarded even though no errors had been detected to +prevent their being deliverable to a higher-layer +protocol. One possible reason for discarding such a +packet could be to free up buffer space. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__in_discards + + def _set_in_discards(self, v, load=False): + """ + Setter method for in_discards, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/in_discards (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_discards is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_discards() directly. + + YANG Description: The number of inbound packets that were chosen to be +discarded even though no errors had been detected to +prevent their being deliverable to a higher-layer +protocol. One possible reason for discarding such a +packet could be to free up buffer space. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-discards", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_discards must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-discards", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_discards = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_discards(self): + self.__in_discards = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-discards", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_errors(self): + """ + Getter method for in_errors, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/in_errors (oc-yang:counter64) + + YANG Description: For packet-oriented interfaces, the number of inbound +packets that contained errors preventing them from being +deliverable to a higher-layer protocol. For character- +oriented or fixed-length interfaces, the number of +inbound transmission units that contained errors +preventing them from being deliverable to a higher-layer +protocol. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__in_errors + + def _set_in_errors(self, v, load=False): + """ + Setter method for in_errors, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/in_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_errors() directly. + + YANG Description: For packet-oriented interfaces, the number of inbound +packets that contained errors preventing them from being +deliverable to a higher-layer protocol. For character- +oriented or fixed-length interfaces, the number of +inbound transmission units that contained errors +preventing them from being deliverable to a higher-layer +protocol. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_errors(self): + self.__in_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_unknown_protos(self): + """ + Getter method for in_unknown_protos, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/in_unknown_protos (oc-yang:counter64) + + YANG Description: For packet-oriented interfaces, the number of packets +received via the interface that were discarded because +of an unknown or unsupported protocol. For +character-oriented or fixed-length interfaces that +support protocol multiplexing, the number of +transmission units received via the interface that were +discarded because of an unknown or unsupported protocol. +For any interface that does not support protocol +multiplexing, this counter is not present. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__in_unknown_protos + + def _set_in_unknown_protos(self, v, load=False): + """ + Setter method for in_unknown_protos, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/in_unknown_protos (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_unknown_protos is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_unknown_protos() directly. + + YANG Description: For packet-oriented interfaces, the number of packets +received via the interface that were discarded because +of an unknown or unsupported protocol. For +character-oriented or fixed-length interfaces that +support protocol multiplexing, the number of +transmission units received via the interface that were +discarded because of an unknown or unsupported protocol. +For any interface that does not support protocol +multiplexing, this counter is not present. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-unknown-protos", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_unknown_protos must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-unknown-protos", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_unknown_protos = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_unknown_protos(self): + self.__in_unknown_protos = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-unknown-protos", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_in_fcs_errors(self): + """ + Getter method for in_fcs_errors, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/in_fcs_errors (oc-yang:counter64) + + YANG Description: Number of received packets which had errors in the +frame check sequence (FCS), i.e., framing errors. + +Discontinuities in the value of this counter can occur +when the device is re-initialization as indicated by the +value of 'last-clear'. + """ + return self.__in_fcs_errors + + def _set_in_fcs_errors(self, v, load=False): + """ + Setter method for in_fcs_errors, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/in_fcs_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_in_fcs_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_in_fcs_errors() directly. + + YANG Description: Number of received packets which had errors in the +frame check sequence (FCS), i.e., framing errors. + +Discontinuities in the value of this counter can occur +when the device is re-initialization as indicated by the +value of 'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-fcs-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """in_fcs_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-fcs-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__in_fcs_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_in_fcs_errors(self): + self.__in_fcs_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="in-fcs-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_out_octets(self): + """ + Getter method for out_octets, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/out_octets (oc-yang:counter64) + + YANG Description: The total number of octets transmitted out of the +interface, including framing characters. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__out_octets + + def _set_out_octets(self, v, load=False): + """ + Setter method for out_octets, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/out_octets (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_out_octets is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_out_octets() directly. + + YANG Description: The total number of octets transmitted out of the +interface, including framing characters. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """out_octets must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__out_octets = t + if hasattr(self, '_set'): + self._set() + + def _unset_out_octets(self): + self.__out_octets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_out_pkts(self): + """ + Getter method for out_pkts, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/out_pkts (oc-yang:counter64) + + YANG Description: The total number of packets transmitted out of the +interface, including all unicast, multicast, broadcast, +and bad packets etc. + """ + return self.__out_pkts + + def _set_out_pkts(self, v, load=False): + """ + Setter method for out_pkts, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/out_pkts (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_out_pkts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_out_pkts() directly. + + YANG Description: The total number of packets transmitted out of the +interface, including all unicast, multicast, broadcast, +and bad packets etc. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """out_pkts must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__out_pkts = t + if hasattr(self, '_set'): + self._set() + + def _unset_out_pkts(self): + self.__out_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_out_unicast_pkts(self): + """ + Getter method for out_unicast_pkts, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/out_unicast_pkts (oc-yang:counter64) + + YANG Description: The total number of packets that higher-level protocols +requested be transmitted, and that were not addressed +to a multicast or broadcast address at this sub-layer, +including those that were discarded or not sent. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__out_unicast_pkts + + def _set_out_unicast_pkts(self, v, load=False): + """ + Setter method for out_unicast_pkts, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/out_unicast_pkts (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_out_unicast_pkts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_out_unicast_pkts() directly. + + YANG Description: The total number of packets that higher-level protocols +requested be transmitted, and that were not addressed +to a multicast or broadcast address at this sub-layer, +including those that were discarded or not sent. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-unicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """out_unicast_pkts must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-unicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__out_unicast_pkts = t + if hasattr(self, '_set'): + self._set() + + def _unset_out_unicast_pkts(self): + self.__out_unicast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-unicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_out_broadcast_pkts(self): + """ + Getter method for out_broadcast_pkts, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/out_broadcast_pkts (oc-yang:counter64) + + YANG Description: The total number of packets that higher-level protocols +requested be transmitted, and that were addressed to a +broadcast address at this sub-layer, including those +that were discarded or not sent. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__out_broadcast_pkts + + def _set_out_broadcast_pkts(self, v, load=False): + """ + Setter method for out_broadcast_pkts, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/out_broadcast_pkts (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_out_broadcast_pkts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_out_broadcast_pkts() directly. + + YANG Description: The total number of packets that higher-level protocols +requested be transmitted, and that were addressed to a +broadcast address at this sub-layer, including those +that were discarded or not sent. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-broadcast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """out_broadcast_pkts must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-broadcast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__out_broadcast_pkts = t + if hasattr(self, '_set'): + self._set() + + def _unset_out_broadcast_pkts(self): + self.__out_broadcast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-broadcast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_out_multicast_pkts(self): + """ + Getter method for out_multicast_pkts, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/out_multicast_pkts (oc-yang:counter64) + + YANG Description: The total number of packets that higher-level protocols +requested be transmitted, and that were addressed to a +multicast address at this sub-layer, including those +that were discarded or not sent. For a MAC-layer +protocol, this includes both Group and Functional +addresses. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__out_multicast_pkts + + def _set_out_multicast_pkts(self, v, load=False): + """ + Setter method for out_multicast_pkts, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/out_multicast_pkts (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_out_multicast_pkts is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_out_multicast_pkts() directly. + + YANG Description: The total number of packets that higher-level protocols +requested be transmitted, and that were addressed to a +multicast address at this sub-layer, including those +that were discarded or not sent. For a MAC-layer +protocol, this includes both Group and Functional +addresses. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-multicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """out_multicast_pkts must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-multicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__out_multicast_pkts = t + if hasattr(self, '_set'): + self._set() + + def _unset_out_multicast_pkts(self): + self.__out_multicast_pkts = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-multicast-pkts", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_out_discards(self): + """ + Getter method for out_discards, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/out_discards (oc-yang:counter64) + + YANG Description: The number of outbound packets that were chosen to be +discarded even though no errors had been detected to +prevent their being transmitted. One possible reason +for discarding such a packet could be to free up buffer +space. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__out_discards + + def _set_out_discards(self, v, load=False): + """ + Setter method for out_discards, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/out_discards (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_out_discards is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_out_discards() directly. + + YANG Description: The number of outbound packets that were chosen to be +discarded even though no errors had been detected to +prevent their being transmitted. One possible reason +for discarding such a packet could be to free up buffer +space. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-discards", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """out_discards must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-discards", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__out_discards = t + if hasattr(self, '_set'): + self._set() + + def _unset_out_discards(self): + self.__out_discards = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-discards", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_out_errors(self): + """ + Getter method for out_errors, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/out_errors (oc-yang:counter64) + + YANG Description: For packet-oriented interfaces, the number of outbound +packets that could not be transmitted because of errors. +For character-oriented or fixed-length interfaces, the +number of outbound transmission units that could not be +transmitted because of errors. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + return self.__out_errors + + def _set_out_errors(self, v, load=False): + """ + Setter method for out_errors, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/out_errors (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_out_errors is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_out_errors() directly. + + YANG Description: For packet-oriented interfaces, the number of outbound +packets that could not be transmitted because of errors. +For character-oriented or fixed-length interfaces, the +number of outbound transmission units that could not be +transmitted because of errors. + +Discontinuities in the value of this counter can occur +at re-initialization of the management system, and at +other times as indicated by the value of +'last-clear'. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """out_errors must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__out_errors = t + if hasattr(self, '_set'): + self._set() + + def _unset_out_errors(self): + self.__out_errors = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="out-errors", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_carrier_transitions(self): + """ + Getter method for carrier_transitions, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/carrier_transitions (oc-yang:counter64) + + YANG Description: Number of times the interface state has transitioned +between up and down since the time the device restarted +or the last-clear time, whichever is most recent. + """ + return self.__carrier_transitions + + def _set_carrier_transitions(self, v, load=False): + """ + Setter method for carrier_transitions, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/carrier_transitions (oc-yang:counter64) + If this variable is read-only (config: false) in the + source YANG file, then _set_carrier_transitions is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_carrier_transitions() directly. + + YANG Description: Number of times the interface state has transitioned +between up and down since the time the device restarted +or the last-clear time, whichever is most recent. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="carrier-transitions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """carrier_transitions must be of a type compatible with oc-yang:counter64""", + 'defined-type': "oc-yang:counter64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="carrier-transitions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False)""", + }) + + self.__carrier_transitions = t + if hasattr(self, '_set'): + self._set() + + def _unset_carrier_transitions(self): + self.__carrier_transitions = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="carrier-transitions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-yang:counter64', is_config=False) + + + def _get_last_clear(self): + """ + Getter method for last_clear, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/last_clear (oc-types:timeticks64) + + YANG Description: Timestamp of the last time the interface counters were +cleared. + +The value is the timestamp in nanoseconds relative to +the Unix Epoch (Jan 1, 1970 00:00:00 UTC). + """ + return self.__last_clear + + def _set_last_clear(self, v, load=False): + """ + Setter method for last_clear, mapped from YANG variable /interfaces/interface/subinterfaces/subinterface/state/counters/last_clear (oc-types:timeticks64) + If this variable is read-only (config: false) in the + source YANG file, then _set_last_clear is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_last_clear() directly. + + YANG Description: Timestamp of the last time the interface counters were +cleared. + +The value is the timestamp in nanoseconds relative to +the Unix Epoch (Jan 1, 1970 00:00:00 UTC). + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-clear", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-types:timeticks64', is_config=False) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """last_clear must be of a type compatible with oc-types:timeticks64""", + 'defined-type': "oc-types:timeticks64", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-clear", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-types:timeticks64', is_config=False)""", + }) + + self.__last_clear = t + if hasattr(self, '_set'): + self._set() + + def _unset_last_clear(self): + self.__last_clear = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="last-clear", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/interfaces', defining_module='openconfig-interfaces', yang_type='oc-types:timeticks64', is_config=False) + + in_octets = __builtin__.property(_get_in_octets) + in_pkts = __builtin__.property(_get_in_pkts) + in_unicast_pkts = __builtin__.property(_get_in_unicast_pkts) + in_broadcast_pkts = __builtin__.property(_get_in_broadcast_pkts) + in_multicast_pkts = __builtin__.property(_get_in_multicast_pkts) + in_discards = __builtin__.property(_get_in_discards) + in_errors = __builtin__.property(_get_in_errors) + in_unknown_protos = __builtin__.property(_get_in_unknown_protos) + in_fcs_errors = __builtin__.property(_get_in_fcs_errors) + out_octets = __builtin__.property(_get_out_octets) + out_pkts = __builtin__.property(_get_out_pkts) + out_unicast_pkts = __builtin__.property(_get_out_unicast_pkts) + out_broadcast_pkts = __builtin__.property(_get_out_broadcast_pkts) + out_multicast_pkts = __builtin__.property(_get_out_multicast_pkts) + out_discards = __builtin__.property(_get_out_discards) + out_errors = __builtin__.property(_get_out_errors) + carrier_transitions = __builtin__.property(_get_carrier_transitions) + last_clear = __builtin__.property(_get_last_clear) + + + _pyangbind_elements = OrderedDict([('in_octets', in_octets), ('in_pkts', in_pkts), ('in_unicast_pkts', in_unicast_pkts), ('in_broadcast_pkts', in_broadcast_pkts), ('in_multicast_pkts', in_multicast_pkts), ('in_discards', in_discards), ('in_errors', in_errors), ('in_unknown_protos', in_unknown_protos), ('in_fcs_errors', in_fcs_errors), ('out_octets', out_octets), ('out_pkts', out_pkts), ('out_unicast_pkts', out_unicast_pkts), ('out_broadcast_pkts', out_broadcast_pkts), ('out_multicast_pkts', out_multicast_pkts), ('out_discards', out_discards), ('out_errors', out_errors), ('carrier_transitions', carrier_transitions), ('last_clear', last_clear), ]) + + diff --git a/hackfest/netconf-oc/platform.xml b/hackfest/netconf-oc/platform.xml new file mode 100644 index 0000000000000000000000000000000000000000..04c53f559b12bb6dd4364089fb3ed43ba9967059 --- /dev/null +++ b/hackfest/netconf-oc/platform.xml @@ -0,0 +1,464 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/hackfest/netconf-oc/server-key b/hackfest/netconf-oc/server-key new file mode 100644 index 0000000000000000000000000000000000000000..b1da1bf244778f6d884a5e571de1cc77d144c363 --- /dev/null +++ b/hackfest/netconf-oc/server-key @@ -0,0 +1,39 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIG4gIBAAKCAYEAueh9Dsz3havrm3NltIudzPiDAWE1wxkl1iD7x2iAJNRmJaeL +WfMLgAVtC7DujsOpVjLbsPdvrKCvZf3PeJE9jzPYJNhAXhMErAaWm3bRfxK0L6et +/kHnFxTGkNHASMrAySRrJloP6zys8n2e8IQ3vq37SrmkcqnizhDpiSeBjYXtIQpD +4eutZ26pyQktAi/X413jQN0ociKane2JTbBvqdYP7nGVFraEhAL34H5u461lTltw +pAog1N5QW7b9Yc1zhFJFCcXeq9luD/y6Z5KzkbBYwxADJojdffrTTHbgz4r+uJkw +9m1K8sqBzIeBY95nmWbMR1iNzIQ97LW+ePebGPPfCO2+YLOkgZGtRs/zErO+8vl7 +cRsEh1MhQ/2qqUckZZEPKxCT32Pcogx8RPAlfUDhm0e7yBnKZktlzddT01cpo0yi +tDzCqTljklRL36tYFDwZBHgB1Yao28V/q0nCKokxhnPDQSjLAIVd8+f6pOctIitq +mO9g03JAVYrvAC4zAgMBAAECggGAbSxANG7ddJwvMgykT1AmDPZrSGYjwjyEYajg +8otFpVst2TL4vIvj1vxYuyLeFOyGBt668MN9yyxZlFVmfvEb63qQlaKAuj4E4ljE +HOu7vxnmwo1/ue5NnNpQeT8T4ite50ABxHXjH0t0bLqkma2rZsiY55r5HXTygfyg +iDCw/cEGLf7vOj7CiBkOj8ZZrg0WhKjgCXlWhSAZGGEj3oGcMWpJ1MbSvJHWZAey +NR1KVV3APjGohkyEVz1uh02AouyYxu0Oyu27i3NO3NSa0BLz6ct3U2wJFVt7zNIz +XcOr+YDcC0gz6yEz1O1e7+p1dOTL9+azA04Dq0IiSu6k94Rrmnvr42sMmDLi/JBN +ZP82nCOoPO31pdVoHqqG/s7+mjHGqTSC+l4wImZD5YGHRnGbOBarH75MG/PIDl6S +VSzVCZKPEnLkZ3lKC1R3WO5K16WCgqTGLisu4VjXALhHIMmJDNk3Kkv+EvLdXp5Q +hBbDlJCtgs7w8V88ci17ss9bmqWRAoHBAOl6T+gvTO2zbJ2LGXVJKGYFDR637GKJ +tPRyTPK8IJR6PN/VgQdJ70P2a3XEUIMSwH+6rBg+zNZnu7TkwDyyxImyjwtnhGjf +xAGfkj5inmsToBq5INxKBamito3QUyzZhYGfDO61r+e0agDpGYCll9EuhBeQ+00x +2x/vA0Btr4WzFnh3xdlozAcPvws3dXhybRPdgPbn90M2UW2ImdIV2GDJNN+vASbl +M9jhI1tm3KjCCfDzgKmvs48IpoRAwZJihQKBwQDL13Qxgk4L5uemi0fBR1Jwd0IE +gZ6E2rZWbzT5Fe9iSsN+1LHJqvs31We8FhN+sYujG1ZUUSt5bpFggXOw+LwDVOf2 +Bzer681YqkRKtu2wkEzRX0R1esMowba0s1Naonu1lohKKAcZJ4YHDBKjxYHH4+NR +mnFjjxtcnQ/mMVb+ZPjOaXvzCt7NfShlfztkClrDca3WgOh/Zed7+M+0S1rrOEpt +Wyph/Y76AzH/uzdEIPkToNqRIACXWOR2NOpn11cCgcAUb0gfIkSxaUrQXyRTR5vp +kfecAK0H0tWrr3VcqWqQlEJPtPgeEzKF2EN/gzcowbNneocleBmlil67bmoE5gCd +rKsobF8CbtNQ8Q5zt132MTmKHTnrDe+A8WTY9KrS+hbdSXZwTiafOQMuITjCMbwf +6tpU1bOpBfwPx3OZaAA8y3fkA1elt65jz9UAvlHhwOIbIv/unE7f6xklZRdRc+gE +UJf4G/EV3mmzScE2dsJJYvJLzIQuVdp5YmBwotpOXaECgcAKJI1ejUpO401xhwqp +/l+Gwxhg2wZFPBDImj37ivDfZjL2E6VJEJ3xeEfyHvMXYcQ9+HVCOsu7/hlzwN09 +2BKa49Wq80782f3cxJQjV5jaKUP5QxFH+zTMyV7K/QVPxDf9oCDl97nqsYHExgAD +cCd2B8ve2p17w7or0JDi9l+KxwFuW+dT/514ghrJehw9bRp5ESYCP2XSOQLcs1O6 +d+ltPN7PNDMWryQ3IoORYwJr/GwIYv+dKwd8gGrVyupDAn8CgcBJ7YIeLbV5nQ+g +Y2Ht748J3157Emckyxv5vE6QQqBzAN+WOWRjSqExbLnnTL9UsrMbYn0STxYRleti +eZmCSXu5msE1ZkwoGNRnyEAtoN0NPI92pB+rKZw2ERSjgtV9rPnmE4tvuz/dosxb +AjGCxal0bnwrnltq1xFqSWrjbvOfbf7bK68I6+T76ktqsGUhz3mdjzFp6cUducm/ +Ty6M1Y33OKW1ymOGnfaaTOuXWC6yLFjdB+aQg5wjNOIwuoHe750= +-----END RSA PRIVATE KEY----- diff --git a/hackfest/netconf-oc/server-key.pub b/hackfest/netconf-oc/server-key.pub new file mode 100644 index 0000000000000000000000000000000000000000..56d420638839114e7c8f1261fde55bef641357c4 --- /dev/null +++ b/hackfest/netconf-oc/server-key.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC56H0OzPeFq+ubc2W0i53M+IMBYTXDGSXWIPvHaIAk1GYlp4tZ8wuABW0LsO6Ow6lWMtuw92+soK9l/c94kT2PM9gk2EBeEwSsBpabdtF/ErQvp63+QecXFMaQ0cBIysDJJGsmWg/rPKzyfZ7whDe+rftKuaRyqeLOEOmJJ4GNhe0hCkPh661nbqnJCS0CL9fjXeNA3ShyIpqd7YlNsG+p1g/ucZUWtoSEAvfgfm7jrWVOW3CkCiDU3lBbtv1hzXOEUkUJxd6r2W4P/LpnkrORsFjDEAMmiN19+tNMduDPiv64mTD2bUryyoHMh4Fj3meZZsxHWI3MhD3stb5495sY898I7b5gs6SBka1Gz/MSs77y+XtxGwSHUyFD/aqpRyRlkQ8rEJPfY9yiDHxE8CV9QOGbR7vIGcpmS2XN11PTVymjTKK0PMKpOWOSVEvfq1gUPBkEeAHVhqjbxX+rScIqiTGGc8NBKMsAhV3z5/qk5y0iK2qY72DTckBViu8ALjM= chopps@tops diff --git a/hackfest/netconf-oc/server_openconfig.py b/hackfest/netconf-oc/server_openconfig.py new file mode 100644 index 0000000000000000000000000000000000000000..fe4085e3999c3fa4a8ee15fc627cf1656f855b96 --- /dev/null +++ b/hackfest/netconf-oc/server_openconfig.py @@ -0,0 +1,92 @@ +# 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, os, sys, time +from pyangbind.lib.serialise import pybindIETFXMLEncoder, pybindIETFXMLDecoder +from lxml import etree +from netconf import nsmap_add, NSMAP, server, util +from device_definition import get_device_definition + +logging.basicConfig(level=logging.DEBUG) + +#nsmap_add("topology", "urn:topology") +#nsmap_add("connection", "urn:connection") + +class MyServer(server.NetconfMethods): + + def __init__(self, username, password, port): + host_key_value = os.path.join(os.path.abspath(os.path.dirname(__file__)), "server-key") + auth = server.SSHUserPassController(username=username, password=password) + auth.check_auth_none(username) + self.server = server.NetconfSSHServer(server_ctl=auth, server_methods=self, host_key=host_key_value, port=port, debug=True) + + self.data = get_device_definition() + + def nc_append_capabilities(self, capabilities): + logging.debug("--GET capabilities--") + util.subelm(capabilities, "capability").text = "urn:ietf:params:netconf:capability:xpath:1.0" + #util.subelm(capabilities, "capability").text = NSMAP["topology"] + #util.subelm(capabilities, "capability").text = NSMAP["connection"] + + def rpc_get(self, session, rpc, filter_or_none): + #logging.debug("--GET--") + #logging.debug(session) + #logging.debug(etree.tostring(rpc)) + return util.filter_results(rpc, self.data, None) + + def rpc_get_config(self, session, rpc, source_elm, filter_or_none): + #logging.debug("--GET CONFIG--") + #logging.debug(session) + #logging.debug(etree.tostring(rpc)) + return util.filter_results(rpc, self.data, None) + + def rpc_edit_config(self, session, rpc, target, default_operation, new_config): + logging.debug("--EDIT CONFIG--") + logging.debug(session) + logging.debug(etree.tostring(rpc)) + logging.debug(etree.tostring(target)) + logging.debug(etree.tostring(default_operation)) + logging.debug(etree.tostring(new_config)) + + #data_list = new_config.findall(".//xmlns:connection", namespaces={'xmlns': 'urn:connection'}) + #for connect in data_list: + # logging.debug("connect: " ) + # logging.debug(etree.tostring(connect) ) + # logging.debug("CURRENT CONNECTION") + # logging.debug(etree.tostring(self.data[1]) ) + # self.data[1].append(connect) + # break + return util.filter_results(rpc, self.data, None) + + def close(self): + self.server.close() + +def main(*margs): + port = sys.argv[1] + s = MyServer("admin", "admin", int(port)) + + if sys.stdout.isatty(): + logging.debug("^C to quit server") + + try: + while True: + time.sleep(1) + + except Exception: + logging.debug("quitting server") + + s.close() + +if __name__ == "__main__": + main() diff --git a/hackfest/netconf-oc/yang_models.txt b/hackfest/netconf-oc/yang_models.txt new file mode 100644 index 0000000000000000000000000000000000000000..6fbde735fe439f6d42b4d368e1973aac5b8a540c --- /dev/null +++ b/hackfest/netconf-oc/yang_models.txt @@ -0,0 +1,171 @@ +git_openconfig/release/models/devices-manifest/openconfig-terminal-device-property-types.yang +git_openconfig/release/models/devices-manifest/openconfig-terminal-device-properties.yang +git_openconfig/release/models/vlan/openconfig-vlan.yang +git_openconfig/release/models/vlan/openconfig-vlan-types.yang +git_openconfig/release/models/p4rt/openconfig-p4rt.yang +git_openconfig/release/models/stp/openconfig-spanning-tree-types.yang +git_openconfig/release/models/stp/openconfig-spanning-tree.yang +git_openconfig/release/models/rib/openconfig-rib-bgp-shared-attributes.yang +git_openconfig/release/models/rib/openconfig-rib-bgp-table-attributes.yang +git_openconfig/release/models/rib/openconfig-rib-bgp-attributes.yang +git_openconfig/release/models/rib/openconfig-rib-bgp.yang +git_openconfig/release/models/rib/openconfig-rib-bgp-ext.yang +git_openconfig/release/models/rib/openconfig-rib-bgp-tables.yang +git_openconfig/release/models/rib/openconfig-rib-bgp-types.yang +git_openconfig/release/models/segment-routing/openconfig-segment-routing-types.yang +git_openconfig/release/models/segment-routing/openconfig-srte-policy.yang +git_openconfig/release/models/segment-routing/openconfig-segment-routing.yang +git_openconfig/release/models/segment-routing/openconfig-rsvp-sr-ext.yang +git_openconfig/release/models/isis/openconfig-isis-lsp.yang +git_openconfig/release/models/isis/openconfig-isis-policy.yang +git_openconfig/release/models/isis/openconfig-isis-types.yang +git_openconfig/release/models/isis/openconfig-isis-lsdb-types.yang +git_openconfig/release/models/isis/openconfig-isis.yang +git_openconfig/release/models/isis/openconfig-isis-routing.yang +git_openconfig/release/models/pcep/openconfig-pcep.yang +git_openconfig/release/models/lacp/openconfig-lacp.yang +git_openconfig/release/models/keychain/openconfig-keychain.yang +git_openconfig/release/models/keychain/openconfig-keychain-types.yang +git_openconfig/release/models/openconfig-extensions.yang +git_openconfig/release/models/telemetry/openconfig-telemetry.yang +git_openconfig/release/models/telemetry/openconfig-telemetry-types.yang +git_openconfig/release/models/policy/openconfig-policy-types.yang +git_openconfig/release/models/policy/openconfig-routing-policy.yang +git_openconfig/release/models/bfd/openconfig-bfd.yang +git_openconfig/release/models/types/openconfig-types.yang +git_openconfig/release/models/types/openconfig-yang-types.yang +git_openconfig/release/models/types/openconfig-inet-types.yang +git_openconfig/release/models/ospf/openconfig-ospfv2-common.yang +git_openconfig/release/models/ospf/openconfig-ospfv2-area.yang +git_openconfig/release/models/ospf/openconfig-ospfv2-area-interface.yang +git_openconfig/release/models/ospf/openconfig-ospfv2.yang +git_openconfig/release/models/ospf/openconfig-ospf-types.yang +git_openconfig/release/models/ospf/openconfig-ospfv2-global.yang +git_openconfig/release/models/ospf/openconfig-ospf-policy.yang +git_openconfig/release/models/ospf/openconfig-ospfv2-lsdb.yang +git_openconfig/release/models/gribi/openconfig-gribi.yang +git_openconfig/release/models/platform/openconfig-platform-software.yang +git_openconfig/release/models/platform/openconfig-platform-integrated-circuit.yang +git_openconfig/release/models/platform/openconfig-platform-linecard.yang +git_openconfig/release/models/platform/openconfig-platform-controller-card.yang +git_openconfig/release/models/platform/openconfig-platform-port.yang +git_openconfig/release/models/platform/openconfig-platform-psu.yang +git_openconfig/release/models/platform/openconfig-platform-transceiver.yang +git_openconfig/release/models/platform/openconfig-platform-fabric.yang +git_openconfig/release/models/platform/openconfig-platform.yang +git_openconfig/release/models/platform/openconfig-platform-pipeline-counters.yang +git_openconfig/release/models/platform/openconfig-platform-ext.yang +git_openconfig/release/models/platform/openconfig-platform-types.yang +git_openconfig/release/models/platform/openconfig-platform-common.yang +git_openconfig/release/models/platform/openconfig-platform-fan.yang +git_openconfig/release/models/platform/openconfig-platform-cpu.yang +git_openconfig/release/models/policy-forwarding/openconfig-pf-path-groups.yang +git_openconfig/release/models/policy-forwarding/openconfig-policy-forwarding.yang +git_openconfig/release/models/policy-forwarding/openconfig-pf-srte.yang +git_openconfig/release/models/policy-forwarding/openconfig-pf-forwarding-policies.yang +git_openconfig/release/models/policy-forwarding/openconfig-pf-interfaces.yang +git_openconfig/release/models/relay-agent/openconfig-relay-agent.yang +git_openconfig/release/models/optical-transport/openconfig-transport-line-protection.yang +git_openconfig/release/models/optical-transport/openconfig-optical-attenuator.yang +git_openconfig/release/models/optical-transport/openconfig-transport-types.yang +git_openconfig/release/models/optical-transport/openconfig-wavelength-router.yang +git_openconfig/release/models/optical-transport/openconfig-terminal-device.yang +git_openconfig/release/models/optical-transport/openconfig-channel-monitor.yang +git_openconfig/release/models/optical-transport/openconfig-optical-amplifier.yang +git_openconfig/release/models/optical-transport/openconfig-transport-line-connectivity.yang +git_openconfig/release/models/optical-transport/openconfig-transport-line-common.yang +git_openconfig/release/models/multicast/openconfig-pim.yang +git_openconfig/release/models/multicast/openconfig-pim-types.yang +git_openconfig/release/models/multicast/openconfig-igmp.yang +git_openconfig/release/models/multicast/openconfig-igmp-types.yang +git_openconfig/release/models/extensions/openconfig-metadata.yang +git_openconfig/release/models/extensions/openconfig-codegen-extensions.yang +git_openconfig/release/models/wifi/openconfig-wifi-mac.yang +git_openconfig/release/models/wifi/openconfig-wifi-phy.yang +git_openconfig/release/models/wifi/openconfig-ap-interfaces.yang +git_openconfig/release/models/wifi/openconfig-ap-manager.yang +git_openconfig/release/models/wifi/openconfig-wifi-types.yang +git_openconfig/release/models/wifi/openconfig-access-points.yang +git_openconfig/release/models/network-instance/openconfig-network-instance-types.yang +git_openconfig/release/models/network-instance/openconfig-network-instance-l3.yang +git_openconfig/release/models/network-instance/openconfig-evpn.yang +git_openconfig/release/models/network-instance/openconfig-network-instance-l2.yang +git_openconfig/release/models/network-instance/openconfig-network-instance-policy.yang +git_openconfig/release/models/network-instance/openconfig-network-instance.yang +git_openconfig/release/models/network-instance/openconfig-evpn-types.yang +git_openconfig/release/models/system/openconfig-aaa-types.yang +git_openconfig/release/models/system/openconfig-system-logging.yang +git_openconfig/release/models/system/openconfig-aaa-tacacs.yang +git_openconfig/release/models/system/openconfig-procmon.yang +git_openconfig/release/models/system/openconfig-aaa.yang +git_openconfig/release/models/system/openconfig-aaa-radius.yang +git_openconfig/release/models/system/openconfig-system.yang +git_openconfig/release/models/system/openconfig-license.yang +git_openconfig/release/models/system/openconfig-system-grpc.yang +git_openconfig/release/models/system/openconfig-alarms.yang +git_openconfig/release/models/system/openconfig-messages.yang +git_openconfig/release/models/system/openconfig-alarm-types.yang +git_openconfig/release/models/system/openconfig-system-terminal.yang +git_openconfig/release/models/acl/openconfig-packet-match-types.yang +git_openconfig/release/models/acl/openconfig-acl.yang +git_openconfig/release/models/acl/openconfig-packet-match.yang +git_openconfig/release/models/local-routing/openconfig-local-routing.yang +git_openconfig/release/models/openflow/openconfig-openflow.yang +git_openconfig/release/models/openflow/openconfig-openflow-types.yang +git_openconfig/release/models/probes/openconfig-probes.yang +git_openconfig/release/models/probes/openconfig-probes-types.yang +git_openconfig/release/models/lldp/openconfig-lldp-types.yang +git_openconfig/release/models/lldp/openconfig-lldp.yang +git_openconfig/release/models/interfaces/openconfig-if-8021x.yang +git_openconfig/release/models/interfaces/openconfig-interfaces.yang +git_openconfig/release/models/interfaces/openconfig-if-ethernet-ext.yang +git_openconfig/release/models/interfaces/openconfig-if-ip-ext.yang +git_openconfig/release/models/interfaces/openconfig-if-tunnel.yang +git_openconfig/release/models/interfaces/openconfig-if-poe.yang +git_openconfig/release/models/interfaces/openconfig-if-aggregate.yang +git_openconfig/release/models/interfaces/openconfig-if-sdn-ext.yang +git_openconfig/release/models/interfaces/openconfig-if-ip.yang +git_openconfig/release/models/interfaces/openconfig-if-ethernet.yang +git_openconfig/release/models/bgp/openconfig-bgp-errors.yang +git_openconfig/release/models/bgp/openconfig-bgp-common-multiprotocol.yang +git_openconfig/release/models/bgp/openconfig-bgp-common.yang +git_openconfig/release/models/bgp/openconfig-bgp-policy.yang +git_openconfig/release/models/bgp/openconfig-bgp-neighbor.yang +git_openconfig/release/models/bgp/openconfig-bgp-types.yang +git_openconfig/release/models/bgp/openconfig-bgp-common-structure.yang +git_openconfig/release/models/bgp/openconfig-bgp-peer-group.yang +git_openconfig/release/models/bgp/openconfig-bgp-global.yang +git_openconfig/release/models/bgp/openconfig-bgp.yang +git_openconfig/release/models/qos/openconfig-qos-types.yang +git_openconfig/release/models/qos/openconfig-qos-interfaces.yang +git_openconfig/release/models/qos/openconfig-qos.yang +git_openconfig/release/models/qos/openconfig-qos-mem-mgmt.yang +git_openconfig/release/models/qos/openconfig-qos-elements.yang +git_openconfig/release/models/aft/openconfig-aft-mpls.yang +git_openconfig/release/models/aft/openconfig-aft-state-synced.yang +git_openconfig/release/models/aft/openconfig-aft-pf.yang +git_openconfig/release/models/aft/openconfig-aft-ipv6.yang +git_openconfig/release/models/aft/openconfig-aft.yang +git_openconfig/release/models/aft/openconfig-aft-network-instance.yang +git_openconfig/release/models/aft/openconfig-aft-ipv4.yang +git_openconfig/release/models/aft/openconfig-aft-common.yang +git_openconfig/release/models/aft/openconfig-aft-types.yang +git_openconfig/release/models/aft/openconfig-aft-ethernet.yang +git_openconfig/release/models/sampling/openconfig-sampling-sflow.yang +git_openconfig/release/models/sampling/openconfig-sampling.yang +git_openconfig/release/models/firewall/openconfig-fw-link-monitoring.yang +git_openconfig/release/models/firewall/openconfig-fw-high-availability.yang +git_openconfig/release/models/catalog/openconfig-module-catalog.yang +git_openconfig/release/models/catalog/openconfig-catalog-types.yang +git_openconfig/release/models/macsec/openconfig-macsec-types.yang +git_openconfig/release/models/macsec/openconfig-macsec.yang +git_openconfig/release/models/ate/openconfig-ate-intf.yang +git_openconfig/release/models/ate/openconfig-ate-flow.yang +git_openconfig/release/models/mpls/openconfig-mpls-static.yang +git_openconfig/release/models/mpls/openconfig-mpls-rsvp.yang +git_openconfig/release/models/mpls/openconfig-mpls-sr.yang +git_openconfig/release/models/mpls/openconfig-mpls-types.yang +git_openconfig/release/models/mpls/openconfig-mpls.yang +git_openconfig/release/models/mpls/openconfig-mpls-te.yang +git_openconfig/release/models/mpls/openconfig-mpls-ldp.yang +git_openconfig/release/models/mpls/openconfig-mpls-igp.yang diff --git a/hackfest/netconf/binding_connection.py b/hackfest/netconf/binding_connection.py new file mode 100644 index 0000000000000000000000000000000000000000..6da8d21d942afce3e3502783def6179bef406cae --- /dev/null +++ b/hackfest/netconf/binding_connection.py @@ -0,0 +1,411 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class yc_connection_connection__connection(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module connection - based on the path /connection. Each member element of + the container is represented as a class variable - with a specific + YANG type. + """ + __slots__ = ('_path_helper', '_extmethods', '__connection_id','__source_node','__target_node','__source_port','__target_port','__bandwidth','__layer_protocol_name',) + + _yang_name = 'connection' + _yang_namespace = 'urn:connection' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__target_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + self.__layer_protocol_name = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ETH': {}, u'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='topology:layer-protocol-name', is_config=True) + self.__connection_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="connection-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:connection', defining_module='connection', yang_type='string', is_config=True) + self.__bandwidth = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='uint32', is_config=True) + self.__target_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + self.__source_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + self.__source_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [u'connection'] + + def _get_connection_id(self): + """ + Getter method for connection_id, mapped from YANG variable /connection/connection_id (string) + """ + return self.__connection_id + + def _set_connection_id(self, v, load=False): + """ + Setter method for connection_id, mapped from YANG variable /connection/connection_id (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_connection_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_connection_id() directly. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="connection-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:connection', defining_module='connection', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """connection_id must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="connection-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:connection', defining_module='connection', yang_type='string', is_config=True)""", + }) + + self.__connection_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_connection_id(self): + self.__connection_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="connection-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:connection', defining_module='connection', yang_type='string', is_config=True) + + + def _get_source_node(self): + """ + Getter method for source_node, mapped from YANG variable /connection/source_node (leafref) + """ + return self.__source_node + + def _set_source_node(self, v, load=False): + """ + Setter method for source_node, mapped from YANG variable /connection/source_node (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_source_node is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source_node() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source_node must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True)""", + }) + + self.__source_node = t + if hasattr(self, '_set'): + self._set() + + def _unset_source_node(self): + self.__source_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + + + def _get_target_node(self): + """ + Getter method for target_node, mapped from YANG variable /connection/target_node (leafref) + """ + return self.__target_node + + def _set_target_node(self, v, load=False): + """ + Setter method for target_node, mapped from YANG variable /connection/target_node (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_target_node is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_target_node() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """target_node must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True)""", + }) + + self.__target_node = t + if hasattr(self, '_set'): + self._set() + + def _unset_target_node(self): + self.__target_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + + + def _get_source_port(self): + """ + Getter method for source_port, mapped from YANG variable /connection/source_port (leafref) + """ + return self.__source_port + + def _set_source_port(self, v, load=False): + """ + Setter method for source_port, mapped from YANG variable /connection/source_port (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_source_port is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source_port() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source_port must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True)""", + }) + + self.__source_port = t + if hasattr(self, '_set'): + self._set() + + def _unset_source_port(self): + self.__source_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + + + def _get_target_port(self): + """ + Getter method for target_port, mapped from YANG variable /connection/target_port (leafref) + """ + return self.__target_port + + def _set_target_port(self, v, load=False): + """ + Setter method for target_port, mapped from YANG variable /connection/target_port (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_target_port is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_target_port() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """target_port must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True)""", + }) + + self.__target_port = t + if hasattr(self, '_set'): + self._set() + + def _unset_target_port(self): + self.__target_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + + + def _get_bandwidth(self): + """ + Getter method for bandwidth, mapped from YANG variable /connection/bandwidth (uint32) + """ + return self.__bandwidth + + def _set_bandwidth(self, v, load=False): + """ + Setter method for bandwidth, mapped from YANG variable /connection/bandwidth (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_bandwidth() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """bandwidth must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='uint32', is_config=True)""", + }) + + self.__bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_bandwidth(self): + self.__bandwidth = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='uint32', is_config=True) + + + def _get_layer_protocol_name(self): + """ + Getter method for layer_protocol_name, mapped from YANG variable /connection/layer_protocol_name (topology:layer-protocol-name) + """ + return self.__layer_protocol_name + + def _set_layer_protocol_name(self, v, load=False): + """ + Setter method for layer_protocol_name, mapped from YANG variable /connection/layer_protocol_name (topology:layer-protocol-name) + If this variable is read-only (config: false) in the + source YANG file, then _set_layer_protocol_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_layer_protocol_name() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ETH': {}, u'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='topology:layer-protocol-name', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """layer_protocol_name must be of a type compatible with topology:layer-protocol-name""", + 'defined-type': "topology:layer-protocol-name", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ETH': {}, u'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='topology:layer-protocol-name', is_config=True)""", + }) + + self.__layer_protocol_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_layer_protocol_name(self): + self.__layer_protocol_name = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ETH': {}, u'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='topology:layer-protocol-name', is_config=True) + + connection_id = __builtin__.property(_get_connection_id, _set_connection_id) + source_node = __builtin__.property(_get_source_node, _set_source_node) + target_node = __builtin__.property(_get_target_node, _set_target_node) + source_port = __builtin__.property(_get_source_port, _set_source_port) + target_port = __builtin__.property(_get_target_port, _set_target_port) + bandwidth = __builtin__.property(_get_bandwidth, _set_bandwidth) + layer_protocol_name = __builtin__.property(_get_layer_protocol_name, _set_layer_protocol_name) + + + _pyangbind_elements = OrderedDict([('connection_id', connection_id), ('source_node', source_node), ('target_node', target_node), ('source_port', source_port), ('target_port', target_port), ('bandwidth', bandwidth), ('layer_protocol_name', layer_protocol_name), ]) + + +class connection(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module connection - based on the path /connection. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Basic example of network topology + """ + __slots__ = ('_path_helper', '_extmethods', '__connection',) + + _yang_name = 'connection' + _yang_namespace = 'urn:connection' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__connection = YANGDynClass(base=YANGListType("connection_id",yc_connection_connection__connection, yang_name="connection", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='connection-id', extensions=None), is_container='list', yang_name="connection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:connection', defining_module='connection', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [] + + def _get_connection(self): + """ + Getter method for connection, mapped from YANG variable /connection (list) + """ + return self.__connection + + def _set_connection(self, v, load=False): + """ + Setter method for connection, mapped from YANG variable /connection (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_connection is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_connection() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("connection_id",yc_connection_connection__connection, yang_name="connection", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='connection-id', extensions=None), is_container='list', yang_name="connection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:connection', defining_module='connection', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """connection must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("connection_id",yc_connection_connection__connection, yang_name="connection", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='connection-id', extensions=None), is_container='list', yang_name="connection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:connection', defining_module='connection', yang_type='list', is_config=True)""", + }) + + self.__connection = t + if hasattr(self, '_set'): + self._set() + + def _unset_connection(self): + self.__connection = YANGDynClass(base=YANGListType("connection_id",yc_connection_connection__connection, yang_name="connection", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='connection-id', extensions=None), is_container='list', yang_name="connection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:connection', defining_module='connection', yang_type='list', is_config=True) + + connection = __builtin__.property(_get_connection, _set_connection) + + + _pyangbind_elements = OrderedDict([('connection', connection), ]) + + diff --git a/hackfest/netconf/binding_topology.py b/hackfest/netconf/binding_topology.py new file mode 100644 index 0000000000000000000000000000000000000000..ffc30a76ad4fc43f584a7307884ecbd88f5f8528 --- /dev/null +++ b/hackfest/netconf/binding_topology.py @@ -0,0 +1,714 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class yc_port_topology__topology_node_port(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module topology - based on the path /topology/node/port. Each member element of + the container is represented as a class variable - with a specific + YANG type. + """ + __slots__ = ('_path_helper', '_extmethods', '__port_id','__layer_protocol_name',) + + _yang_name = 'port' + _yang_namespace = 'urn:topology' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__layer_protocol_name = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ETH': {}, u'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='layer-protocol-name', is_config=True) + self.__port_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="port-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [u'topology', u'node', u'port'] + + def _get_port_id(self): + """ + Getter method for port_id, mapped from YANG variable /topology/node/port/port_id (string) + """ + return self.__port_id + + def _set_port_id(self, v, load=False): + """ + Setter method for port_id, mapped from YANG variable /topology/node/port/port_id (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_port_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_port_id() directly. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="port-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """port_id must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="port-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True)""", + }) + + self.__port_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_port_id(self): + self.__port_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="port-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + + + def _get_layer_protocol_name(self): + """ + Getter method for layer_protocol_name, mapped from YANG variable /topology/node/port/layer_protocol_name (layer-protocol-name) + """ + return self.__layer_protocol_name + + def _set_layer_protocol_name(self, v, load=False): + """ + Setter method for layer_protocol_name, mapped from YANG variable /topology/node/port/layer_protocol_name (layer-protocol-name) + If this variable is read-only (config: false) in the + source YANG file, then _set_layer_protocol_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_layer_protocol_name() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ETH': {}, u'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='layer-protocol-name', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """layer_protocol_name must be of a type compatible with layer-protocol-name""", + 'defined-type': "topology:layer-protocol-name", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ETH': {}, u'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='layer-protocol-name', is_config=True)""", + }) + + self.__layer_protocol_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_layer_protocol_name(self): + self.__layer_protocol_name = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ETH': {}, u'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='layer-protocol-name', is_config=True) + + port_id = __builtin__.property(_get_port_id, _set_port_id) + layer_protocol_name = __builtin__.property(_get_layer_protocol_name, _set_layer_protocol_name) + + + _pyangbind_elements = OrderedDict([('port_id', port_id), ('layer_protocol_name', layer_protocol_name), ]) + + +class yc_node_topology__topology_node(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module topology - based on the path /topology/node. Each member element of + the container is represented as a class variable - with a specific + YANG type. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__port',) + + _yang_name = 'node' + _yang_namespace = 'urn:topology' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + self.__port = YANGDynClass(base=YANGListType("port_id",yc_port_topology__topology_node_port, yang_name="port", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='port-id', extensions=None), is_container='list', yang_name="port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [u'topology', u'node'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /topology/node/node_id (string) + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /topology/node/node_id (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + + + def _get_port(self): + """ + Getter method for port, mapped from YANG variable /topology/node/port (list) + """ + return self.__port + + def _set_port(self, v, load=False): + """ + Setter method for port, mapped from YANG variable /topology/node/port (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_port is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_port() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("port_id",yc_port_topology__topology_node_port, yang_name="port", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='port-id', extensions=None), is_container='list', yang_name="port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """port must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("port_id",yc_port_topology__topology_node_port, yang_name="port", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='port-id', extensions=None), is_container='list', yang_name="port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True)""", + }) + + self.__port = t + if hasattr(self, '_set'): + self._set() + + def _unset_port(self): + self.__port = YANGDynClass(base=YANGListType("port_id",yc_port_topology__topology_node_port, yang_name="port", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='port-id', extensions=None), is_container='list', yang_name="port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + port = __builtin__.property(_get_port, _set_port) + + + _pyangbind_elements = OrderedDict([('node_id', node_id), ('port', port), ]) + + +class yc_link_topology__topology_link(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module topology - based on the path /topology/link. Each member element of + the container is represented as a class variable - with a specific + YANG type. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_id','__source_node','__target_node','__source_port','__target_port',) + + _yang_name = 'link' + _yang_namespace = 'urn:topology' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__source_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + self.__target_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + self.__target_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + self.__source_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + self.__link_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [u'topology', u'link'] + + def _get_link_id(self): + """ + Getter method for link_id, mapped from YANG variable /topology/link/link_id (string) + """ + return self.__link_id + + def _set_link_id(self, v, load=False): + """ + Setter method for link_id, mapped from YANG variable /topology/link/link_id (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_id() directly. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="link-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_id must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True)""", + }) + + self.__link_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_id(self): + self.__link_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + + + def _get_source_node(self): + """ + Getter method for source_node, mapped from YANG variable /topology/link/source_node (leafref) + """ + return self.__source_node + + def _set_source_node(self, v, load=False): + """ + Setter method for source_node, mapped from YANG variable /topology/link/source_node (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_source_node is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source_node() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source_node must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True)""", + }) + + self.__source_node = t + if hasattr(self, '_set'): + self._set() + + def _unset_source_node(self): + self.__source_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + + + def _get_target_node(self): + """ + Getter method for target_node, mapped from YANG variable /topology/link/target_node (leafref) + """ + return self.__target_node + + def _set_target_node(self, v, load=False): + """ + Setter method for target_node, mapped from YANG variable /topology/link/target_node (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_target_node is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_target_node() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """target_node must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True)""", + }) + + self.__target_node = t + if hasattr(self, '_set'): + self._set() + + def _unset_target_node(self): + self.__target_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + + + def _get_source_port(self): + """ + Getter method for source_port, mapped from YANG variable /topology/link/source_port (leafref) + """ + return self.__source_port + + def _set_source_port(self, v, load=False): + """ + Setter method for source_port, mapped from YANG variable /topology/link/source_port (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_source_port is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source_port() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source_port must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True)""", + }) + + self.__source_port = t + if hasattr(self, '_set'): + self._set() + + def _unset_source_port(self): + self.__source_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + + + def _get_target_port(self): + """ + Getter method for target_port, mapped from YANG variable /topology/link/target_port (leafref) + """ + return self.__target_port + + def _set_target_port(self, v, load=False): + """ + Setter method for target_port, mapped from YANG variable /topology/link/target_port (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_target_port is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_target_port() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """target_port must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True)""", + }) + + self.__target_port = t + if hasattr(self, '_set'): + self._set() + + def _unset_target_port(self): + self.__target_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + + link_id = __builtin__.property(_get_link_id, _set_link_id) + source_node = __builtin__.property(_get_source_node, _set_source_node) + target_node = __builtin__.property(_get_target_node, _set_target_node) + source_port = __builtin__.property(_get_source_port, _set_source_port) + target_port = __builtin__.property(_get_target_port, _set_target_port) + + + _pyangbind_elements = OrderedDict([('link_id', link_id), ('source_node', source_node), ('target_node', target_node), ('source_port', source_port), ('target_port', target_port), ]) + + +class yc_topology_topology__topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module topology - based on the path /topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + """ + __slots__ = ('_path_helper', '_extmethods', '__node','__link',) + + _yang_name = 'topology' + _yang_namespace = 'urn:topology' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node = YANGDynClass(base=YANGListType("node_id",yc_node_topology__topology_node, yang_name="node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-id', extensions=None), is_container='list', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + self.__link = YANGDynClass(base=YANGListType("link_id",yc_link_topology__topology_link, yang_name="link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-id', extensions=None), is_container='list', yang_name="link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [u'topology'] + + def _get_node(self): + """ + Getter method for node, mapped from YANG variable /topology/node (list) + """ + return self.__node + + def _set_node(self, v, load=False): + """ + Setter method for node, mapped from YANG variable /topology/node (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_node is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("node_id",yc_node_topology__topology_node, yang_name="node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-id', extensions=None), is_container='list', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("node_id",yc_node_topology__topology_node, yang_name="node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-id', extensions=None), is_container='list', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True)""", + }) + + self.__node = t + if hasattr(self, '_set'): + self._set() + + def _unset_node(self): + self.__node = YANGDynClass(base=YANGListType("node_id",yc_node_topology__topology_node, yang_name="node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-id', extensions=None), is_container='list', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + + + def _get_link(self): + """ + Getter method for link, mapped from YANG variable /topology/link (list) + """ + return self.__link + + def _set_link(self, v, load=False): + """ + Setter method for link, mapped from YANG variable /topology/link (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_link is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("link_id",yc_link_topology__topology_link, yang_name="link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-id', extensions=None), is_container='list', yang_name="link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("link_id",yc_link_topology__topology_link, yang_name="link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-id', extensions=None), is_container='list', yang_name="link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True)""", + }) + + self.__link = t + if hasattr(self, '_set'): + self._set() + + def _unset_link(self): + self.__link = YANGDynClass(base=YANGListType("link_id",yc_link_topology__topology_link, yang_name="link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-id', extensions=None), is_container='list', yang_name="link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + + node = __builtin__.property(_get_node, _set_node) + link = __builtin__.property(_get_link, _set_link) + + + _pyangbind_elements = OrderedDict([('node', node), ('link', link), ]) + + +class topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module topology - based on the path /topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Basic example of network topology + """ + __slots__ = ('_path_helper', '_extmethods', '__topology',) + + _yang_name = 'topology' + _yang_namespace = 'urn:topology' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__topology = YANGDynClass(base=yc_topology_topology__topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [] + + def _get_topology(self): + """ + Getter method for topology, mapped from YANG variable /topology (container) + """ + return self.__topology + + def _set_topology(self, v, load=False): + """ + Setter method for topology, mapped from YANG variable /topology (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_topology is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_topology() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=yc_topology_topology__topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """topology must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=yc_topology_topology__topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='container', is_config=True)""", + }) + + self.__topology = t + if hasattr(self, '_set'): + self._set() + + def _unset_topology(self): + self.__topology = YANGDynClass(base=yc_topology_topology__topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='container', is_config=True) + + topology = __builtin__.property(_get_topology, _set_topology) + + + _pyangbind_elements = OrderedDict([('topology', topology), ]) + + diff --git a/hackfest/netconf/client_topology.py b/hackfest/netconf/client_topology.py new file mode 100644 index 0000000000000000000000000000000000000000..138468e20780b4d143a18703c5256adf821e5e80 --- /dev/null +++ b/hackfest/netconf/client_topology.py @@ -0,0 +1,38 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from lxml import etree +from netconf.client import NetconfSSHSession + +# connexion parameters +host = 'localhost' +port = 8300 +username = "admin" +password = "admin" + +# connexion to server +session = NetconfSSHSession(host, port, username, password) + +# server capabilities +c = session.capabilities +print(c) + +# get config +print("---GET CONFIG---") +config = session.get_config() +xmlstr = etree.tostring(config, encoding='utf8', xml_declaration=True) +print(xmlstr) + +# close connexion +session.close() diff --git a/hackfest/netconf/confd-basic-6.4.linux.x86_64.zip b/hackfest/netconf/confd-basic-6.4.linux.x86_64.zip new file mode 100644 index 0000000000000000000000000000000000000000..eb5b89e7fbed57e1519ae1990426152651686288 Binary files /dev/null and b/hackfest/netconf/confd-basic-6.4.linux.x86_64.zip differ diff --git a/hackfest/netconf/connection/binding_connection.py b/hackfest/netconf/connection/binding_connection.py new file mode 100644 index 0000000000000000000000000000000000000000..6da8d21d942afce3e3502783def6179bef406cae --- /dev/null +++ b/hackfest/netconf/connection/binding_connection.py @@ -0,0 +1,411 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class yc_connection_connection__connection(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module connection - based on the path /connection. Each member element of + the container is represented as a class variable - with a specific + YANG type. + """ + __slots__ = ('_path_helper', '_extmethods', '__connection_id','__source_node','__target_node','__source_port','__target_port','__bandwidth','__layer_protocol_name',) + + _yang_name = 'connection' + _yang_namespace = 'urn:connection' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__target_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + self.__layer_protocol_name = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ETH': {}, u'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='topology:layer-protocol-name', is_config=True) + self.__connection_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="connection-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:connection', defining_module='connection', yang_type='string', is_config=True) + self.__bandwidth = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='uint32', is_config=True) + self.__target_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + self.__source_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + self.__source_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [u'connection'] + + def _get_connection_id(self): + """ + Getter method for connection_id, mapped from YANG variable /connection/connection_id (string) + """ + return self.__connection_id + + def _set_connection_id(self, v, load=False): + """ + Setter method for connection_id, mapped from YANG variable /connection/connection_id (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_connection_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_connection_id() directly. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="connection-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:connection', defining_module='connection', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """connection_id must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="connection-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:connection', defining_module='connection', yang_type='string', is_config=True)""", + }) + + self.__connection_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_connection_id(self): + self.__connection_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="connection-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:connection', defining_module='connection', yang_type='string', is_config=True) + + + def _get_source_node(self): + """ + Getter method for source_node, mapped from YANG variable /connection/source_node (leafref) + """ + return self.__source_node + + def _set_source_node(self, v, load=False): + """ + Setter method for source_node, mapped from YANG variable /connection/source_node (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_source_node is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source_node() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source_node must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True)""", + }) + + self.__source_node = t + if hasattr(self, '_set'): + self._set() + + def _unset_source_node(self): + self.__source_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + + + def _get_target_node(self): + """ + Getter method for target_node, mapped from YANG variable /connection/target_node (leafref) + """ + return self.__target_node + + def _set_target_node(self, v, load=False): + """ + Setter method for target_node, mapped from YANG variable /connection/target_node (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_target_node is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_target_node() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """target_node must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True)""", + }) + + self.__target_node = t + if hasattr(self, '_set'): + self._set() + + def _unset_target_node(self): + self.__target_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + + + def _get_source_port(self): + """ + Getter method for source_port, mapped from YANG variable /connection/source_port (leafref) + """ + return self.__source_port + + def _set_source_port(self, v, load=False): + """ + Setter method for source_port, mapped from YANG variable /connection/source_port (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_source_port is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source_port() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source_port must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True)""", + }) + + self.__source_port = t + if hasattr(self, '_set'): + self._set() + + def _unset_source_port(self): + self.__source_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + + + def _get_target_port(self): + """ + Getter method for target_port, mapped from YANG variable /connection/target_port (leafref) + """ + return self.__target_port + + def _set_target_port(self, v, load=False): + """ + Setter method for target_port, mapped from YANG variable /connection/target_port (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_target_port is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_target_port() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """target_port must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True)""", + }) + + self.__target_port = t + if hasattr(self, '_set'): + self._set() + + def _unset_target_port(self): + self.__target_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + + + def _get_bandwidth(self): + """ + Getter method for bandwidth, mapped from YANG variable /connection/bandwidth (uint32) + """ + return self.__bandwidth + + def _set_bandwidth(self, v, load=False): + """ + Setter method for bandwidth, mapped from YANG variable /connection/bandwidth (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_bandwidth() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """bandwidth must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='uint32', is_config=True)""", + }) + + self.__bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_bandwidth(self): + self.__bandwidth = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='uint32', is_config=True) + + + def _get_layer_protocol_name(self): + """ + Getter method for layer_protocol_name, mapped from YANG variable /connection/layer_protocol_name (topology:layer-protocol-name) + """ + return self.__layer_protocol_name + + def _set_layer_protocol_name(self, v, load=False): + """ + Setter method for layer_protocol_name, mapped from YANG variable /connection/layer_protocol_name (topology:layer-protocol-name) + If this variable is read-only (config: false) in the + source YANG file, then _set_layer_protocol_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_layer_protocol_name() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ETH': {}, u'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='topology:layer-protocol-name', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """layer_protocol_name must be of a type compatible with topology:layer-protocol-name""", + 'defined-type': "topology:layer-protocol-name", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ETH': {}, u'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='topology:layer-protocol-name', is_config=True)""", + }) + + self.__layer_protocol_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_layer_protocol_name(self): + self.__layer_protocol_name = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ETH': {}, u'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='topology:layer-protocol-name', is_config=True) + + connection_id = __builtin__.property(_get_connection_id, _set_connection_id) + source_node = __builtin__.property(_get_source_node, _set_source_node) + target_node = __builtin__.property(_get_target_node, _set_target_node) + source_port = __builtin__.property(_get_source_port, _set_source_port) + target_port = __builtin__.property(_get_target_port, _set_target_port) + bandwidth = __builtin__.property(_get_bandwidth, _set_bandwidth) + layer_protocol_name = __builtin__.property(_get_layer_protocol_name, _set_layer_protocol_name) + + + _pyangbind_elements = OrderedDict([('connection_id', connection_id), ('source_node', source_node), ('target_node', target_node), ('source_port', source_port), ('target_port', target_port), ('bandwidth', bandwidth), ('layer_protocol_name', layer_protocol_name), ]) + + +class connection(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module connection - based on the path /connection. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Basic example of network topology + """ + __slots__ = ('_path_helper', '_extmethods', '__connection',) + + _yang_name = 'connection' + _yang_namespace = 'urn:connection' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__connection = YANGDynClass(base=YANGListType("connection_id",yc_connection_connection__connection, yang_name="connection", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='connection-id', extensions=None), is_container='list', yang_name="connection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:connection', defining_module='connection', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [] + + def _get_connection(self): + """ + Getter method for connection, mapped from YANG variable /connection (list) + """ + return self.__connection + + def _set_connection(self, v, load=False): + """ + Setter method for connection, mapped from YANG variable /connection (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_connection is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_connection() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("connection_id",yc_connection_connection__connection, yang_name="connection", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='connection-id', extensions=None), is_container='list', yang_name="connection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:connection', defining_module='connection', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """connection must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("connection_id",yc_connection_connection__connection, yang_name="connection", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='connection-id', extensions=None), is_container='list', yang_name="connection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:connection', defining_module='connection', yang_type='list', is_config=True)""", + }) + + self.__connection = t + if hasattr(self, '_set'): + self._set() + + def _unset_connection(self): + self.__connection = YANGDynClass(base=YANGListType("connection_id",yc_connection_connection__connection, yang_name="connection", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='connection-id', extensions=None), is_container='list', yang_name="connection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:connection', defining_module='connection', yang_type='list', is_config=True) + + connection = __builtin__.property(_get_connection, _set_connection) + + + _pyangbind_elements = OrderedDict([('connection', connection), ]) + + diff --git a/hackfest/netconf/connection/binding_topology.py b/hackfest/netconf/connection/binding_topology.py new file mode 100644 index 0000000000000000000000000000000000000000..ffc30a76ad4fc43f584a7307884ecbd88f5f8528 --- /dev/null +++ b/hackfest/netconf/connection/binding_topology.py @@ -0,0 +1,714 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class yc_port_topology__topology_node_port(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module topology - based on the path /topology/node/port. Each member element of + the container is represented as a class variable - with a specific + YANG type. + """ + __slots__ = ('_path_helper', '_extmethods', '__port_id','__layer_protocol_name',) + + _yang_name = 'port' + _yang_namespace = 'urn:topology' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__layer_protocol_name = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ETH': {}, u'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='layer-protocol-name', is_config=True) + self.__port_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="port-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [u'topology', u'node', u'port'] + + def _get_port_id(self): + """ + Getter method for port_id, mapped from YANG variable /topology/node/port/port_id (string) + """ + return self.__port_id + + def _set_port_id(self, v, load=False): + """ + Setter method for port_id, mapped from YANG variable /topology/node/port/port_id (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_port_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_port_id() directly. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="port-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """port_id must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="port-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True)""", + }) + + self.__port_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_port_id(self): + self.__port_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="port-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + + + def _get_layer_protocol_name(self): + """ + Getter method for layer_protocol_name, mapped from YANG variable /topology/node/port/layer_protocol_name (layer-protocol-name) + """ + return self.__layer_protocol_name + + def _set_layer_protocol_name(self, v, load=False): + """ + Setter method for layer_protocol_name, mapped from YANG variable /topology/node/port/layer_protocol_name (layer-protocol-name) + If this variable is read-only (config: false) in the + source YANG file, then _set_layer_protocol_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_layer_protocol_name() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ETH': {}, u'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='layer-protocol-name', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """layer_protocol_name must be of a type compatible with layer-protocol-name""", + 'defined-type': "topology:layer-protocol-name", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ETH': {}, u'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='layer-protocol-name', is_config=True)""", + }) + + self.__layer_protocol_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_layer_protocol_name(self): + self.__layer_protocol_name = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ETH': {}, u'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='layer-protocol-name', is_config=True) + + port_id = __builtin__.property(_get_port_id, _set_port_id) + layer_protocol_name = __builtin__.property(_get_layer_protocol_name, _set_layer_protocol_name) + + + _pyangbind_elements = OrderedDict([('port_id', port_id), ('layer_protocol_name', layer_protocol_name), ]) + + +class yc_node_topology__topology_node(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module topology - based on the path /topology/node. Each member element of + the container is represented as a class variable - with a specific + YANG type. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__port',) + + _yang_name = 'node' + _yang_namespace = 'urn:topology' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + self.__port = YANGDynClass(base=YANGListType("port_id",yc_port_topology__topology_node_port, yang_name="port", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='port-id', extensions=None), is_container='list', yang_name="port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [u'topology', u'node'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /topology/node/node_id (string) + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /topology/node/node_id (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + + + def _get_port(self): + """ + Getter method for port, mapped from YANG variable /topology/node/port (list) + """ + return self.__port + + def _set_port(self, v, load=False): + """ + Setter method for port, mapped from YANG variable /topology/node/port (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_port is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_port() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("port_id",yc_port_topology__topology_node_port, yang_name="port", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='port-id', extensions=None), is_container='list', yang_name="port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """port must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("port_id",yc_port_topology__topology_node_port, yang_name="port", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='port-id', extensions=None), is_container='list', yang_name="port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True)""", + }) + + self.__port = t + if hasattr(self, '_set'): + self._set() + + def _unset_port(self): + self.__port = YANGDynClass(base=YANGListType("port_id",yc_port_topology__topology_node_port, yang_name="port", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='port-id', extensions=None), is_container='list', yang_name="port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + port = __builtin__.property(_get_port, _set_port) + + + _pyangbind_elements = OrderedDict([('node_id', node_id), ('port', port), ]) + + +class yc_link_topology__topology_link(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module topology - based on the path /topology/link. Each member element of + the container is represented as a class variable - with a specific + YANG type. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_id','__source_node','__target_node','__source_port','__target_port',) + + _yang_name = 'link' + _yang_namespace = 'urn:topology' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__source_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + self.__target_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + self.__target_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + self.__source_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + self.__link_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [u'topology', u'link'] + + def _get_link_id(self): + """ + Getter method for link_id, mapped from YANG variable /topology/link/link_id (string) + """ + return self.__link_id + + def _set_link_id(self, v, load=False): + """ + Setter method for link_id, mapped from YANG variable /topology/link/link_id (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_id() directly. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="link-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_id must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True)""", + }) + + self.__link_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_id(self): + self.__link_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + + + def _get_source_node(self): + """ + Getter method for source_node, mapped from YANG variable /topology/link/source_node (leafref) + """ + return self.__source_node + + def _set_source_node(self, v, load=False): + """ + Setter method for source_node, mapped from YANG variable /topology/link/source_node (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_source_node is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source_node() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source_node must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True)""", + }) + + self.__source_node = t + if hasattr(self, '_set'): + self._set() + + def _unset_source_node(self): + self.__source_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + + + def _get_target_node(self): + """ + Getter method for target_node, mapped from YANG variable /topology/link/target_node (leafref) + """ + return self.__target_node + + def _set_target_node(self, v, load=False): + """ + Setter method for target_node, mapped from YANG variable /topology/link/target_node (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_target_node is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_target_node() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """target_node must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True)""", + }) + + self.__target_node = t + if hasattr(self, '_set'): + self._set() + + def _unset_target_node(self): + self.__target_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + + + def _get_source_port(self): + """ + Getter method for source_port, mapped from YANG variable /topology/link/source_port (leafref) + """ + return self.__source_port + + def _set_source_port(self, v, load=False): + """ + Setter method for source_port, mapped from YANG variable /topology/link/source_port (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_source_port is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source_port() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source_port must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True)""", + }) + + self.__source_port = t + if hasattr(self, '_set'): + self._set() + + def _unset_source_port(self): + self.__source_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + + + def _get_target_port(self): + """ + Getter method for target_port, mapped from YANG variable /topology/link/target_port (leafref) + """ + return self.__target_port + + def _set_target_port(self, v, load=False): + """ + Setter method for target_port, mapped from YANG variable /topology/link/target_port (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_target_port is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_target_port() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """target_port must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True)""", + }) + + self.__target_port = t + if hasattr(self, '_set'): + self._set() + + def _unset_target_port(self): + self.__target_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + + link_id = __builtin__.property(_get_link_id, _set_link_id) + source_node = __builtin__.property(_get_source_node, _set_source_node) + target_node = __builtin__.property(_get_target_node, _set_target_node) + source_port = __builtin__.property(_get_source_port, _set_source_port) + target_port = __builtin__.property(_get_target_port, _set_target_port) + + + _pyangbind_elements = OrderedDict([('link_id', link_id), ('source_node', source_node), ('target_node', target_node), ('source_port', source_port), ('target_port', target_port), ]) + + +class yc_topology_topology__topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module topology - based on the path /topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + """ + __slots__ = ('_path_helper', '_extmethods', '__node','__link',) + + _yang_name = 'topology' + _yang_namespace = 'urn:topology' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node = YANGDynClass(base=YANGListType("node_id",yc_node_topology__topology_node, yang_name="node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-id', extensions=None), is_container='list', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + self.__link = YANGDynClass(base=YANGListType("link_id",yc_link_topology__topology_link, yang_name="link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-id', extensions=None), is_container='list', yang_name="link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [u'topology'] + + def _get_node(self): + """ + Getter method for node, mapped from YANG variable /topology/node (list) + """ + return self.__node + + def _set_node(self, v, load=False): + """ + Setter method for node, mapped from YANG variable /topology/node (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_node is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("node_id",yc_node_topology__topology_node, yang_name="node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-id', extensions=None), is_container='list', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("node_id",yc_node_topology__topology_node, yang_name="node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-id', extensions=None), is_container='list', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True)""", + }) + + self.__node = t + if hasattr(self, '_set'): + self._set() + + def _unset_node(self): + self.__node = YANGDynClass(base=YANGListType("node_id",yc_node_topology__topology_node, yang_name="node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-id', extensions=None), is_container='list', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + + + def _get_link(self): + """ + Getter method for link, mapped from YANG variable /topology/link (list) + """ + return self.__link + + def _set_link(self, v, load=False): + """ + Setter method for link, mapped from YANG variable /topology/link (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_link is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("link_id",yc_link_topology__topology_link, yang_name="link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-id', extensions=None), is_container='list', yang_name="link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("link_id",yc_link_topology__topology_link, yang_name="link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-id', extensions=None), is_container='list', yang_name="link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True)""", + }) + + self.__link = t + if hasattr(self, '_set'): + self._set() + + def _unset_link(self): + self.__link = YANGDynClass(base=YANGListType("link_id",yc_link_topology__topology_link, yang_name="link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-id', extensions=None), is_container='list', yang_name="link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + + node = __builtin__.property(_get_node, _set_node) + link = __builtin__.property(_get_link, _set_link) + + + _pyangbind_elements = OrderedDict([('node', node), ('link', link), ]) + + +class topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module topology - based on the path /topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Basic example of network topology + """ + __slots__ = ('_path_helper', '_extmethods', '__topology',) + + _yang_name = 'topology' + _yang_namespace = 'urn:topology' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__topology = YANGDynClass(base=yc_topology_topology__topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [] + + def _get_topology(self): + """ + Getter method for topology, mapped from YANG variable /topology (container) + """ + return self.__topology + + def _set_topology(self, v, load=False): + """ + Setter method for topology, mapped from YANG variable /topology (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_topology is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_topology() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=yc_topology_topology__topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """topology must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=yc_topology_topology__topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='container', is_config=True)""", + }) + + self.__topology = t + if hasattr(self, '_set'): + self._set() + + def _unset_topology(self): + self.__topology = YANGDynClass(base=yc_topology_topology__topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='container', is_config=True) + + topology = __builtin__.property(_get_topology, _set_topology) + + + _pyangbind_elements = OrderedDict([('topology', topology), ]) + + diff --git a/hackfest/netconf/connection/client_connection.py b/hackfest/netconf/connection/client_connection.py new file mode 100644 index 0000000000000000000000000000000000000000..bba5e0ae95a14bed046f37d3e03ea9196152e5b3 --- /dev/null +++ b/hackfest/netconf/connection/client_connection.py @@ -0,0 +1,58 @@ +# 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 lxml import etree +from netconf.client import NetconfSSHSession + +# connexion parameters +host = 'localhost' +port = 8300 +username = "admin" +password = "admin" + +# connexion to server +session = NetconfSSHSession(host, port, username, password) + +# server capabilities +print("---GET C---") +c = session.capabilities +print(c) + +# get config +print("---GET CONFIG---") +config = session.get_config() +xmlstr = etree.tostring(config, encoding='utf8', xml_declaration=True) +print(xmlstr) + +# edit config +new_config = ''' + + + connection1 + node1 + node1portA + node2 + node2portA + 10 + ETH + + +''' +print("---EDIT CONFIG---") +config = session.edit_config(newconf=new_config) +xmlstr = etree.tostring(config, encoding='utf8', xml_declaration=True) +print(xmlstr) + +# close connexion +session.close() diff --git a/hackfest/netconf/connection/server-key b/hackfest/netconf/connection/server-key new file mode 100644 index 0000000000000000000000000000000000000000..7fc5e5f87d49b1b603cc2eb89a062f9c19ab42b4 --- /dev/null +++ b/hackfest/netconf/connection/server-key @@ -0,0 +1,40 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIG4gIBAAKCAYEAueh9Dsz3havrm3NltIudzPiDAWE1wxkl1iD7x2iAJNRmJaeL +WfMLgAVtC7DujsOpVjLbsPdvrKCvZf3PeJE9jzPYJNhAXhMErAaWm3bRfxK0L6et +/kHnFxTGkNHASMrAySRrJloP6zys8n2e8IQ3vq37SrmkcqnizhDpiSeBjYXtIQpD +4eutZ26pyQktAi/X413jQN0ociKane2JTbBvqdYP7nGVFraEhAL34H5u461lTltw +pAog1N5QW7b9Yc1zhFJFCcXeq9luD/y6Z5KzkbBYwxADJojdffrTTHbgz4r+uJkw +9m1K8sqBzIeBY95nmWbMR1iNzIQ97LW+ePebGPPfCO2+YLOkgZGtRs/zErO+8vl7 +cRsEh1MhQ/2qqUckZZEPKxCT32Pcogx8RPAlfUDhm0e7yBnKZktlzddT01cpo0yi +tDzCqTljklRL36tYFDwZBHgB1Yao28V/q0nCKokxhnPDQSjLAIVd8+f6pOctIitq +mO9g03JAVYrvAC4zAgMBAAECggGAbSxANG7ddJwvMgykT1AmDPZrSGYjwjyEYajg +8otFpVst2TL4vIvj1vxYuyLeFOyGBt668MN9yyxZlFVmfvEb63qQlaKAuj4E4ljE +HOu7vxnmwo1/ue5NnNpQeT8T4ite50ABxHXjH0t0bLqkma2rZsiY55r5HXTygfyg +iDCw/cEGLf7vOj7CiBkOj8ZZrg0WhKjgCXlWhSAZGGEj3oGcMWpJ1MbSvJHWZAey +NR1KVV3APjGohkyEVz1uh02AouyYxu0Oyu27i3NO3NSa0BLz6ct3U2wJFVt7zNIz +XcOr+YDcC0gz6yEz1O1e7+p1dOTL9+azA04Dq0IiSu6k94Rrmnvr42sMmDLi/JBN +ZP82nCOoPO31pdVoHqqG/s7+mjHGqTSC+l4wImZD5YGHRnGbOBarH75MG/PIDl6S +VSzVCZKPEnLkZ3lKC1R3WO5K16WCgqTGLisu4VjXALhHIMmJDNk3Kkv+EvLdXp5Q +hBbDlJCtgs7w8V88ci17ss9bmqWRAoHBAOl6T+gvTO2zbJ2LGXVJKGYFDR637GKJ +tPRyTPK8IJR6PN/VgQdJ70P2a3XEUIMSwH+6rBg+zNZnu7TkwDyyxImyjwtnhGjf +xAGfkj5inmsToBq5INxKBamito3QUyzZhYGfDO61r+e0agDpGYCll9EuhBeQ+00x +2x/vA0Btr4WzFnh3xdlozAcPvws3dXhybRPdgPbn90M2UW2ImdIV2GDJNN+vASbl +M9jhI1tm3KjCCfDzgKmvs48IpoRAwZJihQKBwQDL13Qxgk4L5uemi0fBR1Jwd0IE +gZ6E2rZWbzT5Fe9iSsN+1LHJqvs31We8FhN+sYujG1ZUUSt5bpFggXOw+LwDVOf2 +Bzer681YqkRKtu2wkEzRX0R1esMowba0s1Naonu1lohKKAcZJ4YHDBKjxYHH4+NR +mnFjjxtcnQ/mMVb+ZPjOaXvzCt7NfShlfztkClrDca3WgOh/Zed7+M+0S1rrOEpt +Wyph/Y76AzH/uzdEIPkToNqRIACXWOR2NOpn11cCgcAUb0gfIkSxaUrQXyRTR5vp +kfecAK0H0tWrr3VcqWqQlEJPtPgeEzKF2EN/gzcowbNneocleBmlil67bmoE5gCd +rKsobF8CbtNQ8Q5zt132MTmKHTnrDe+A8WTY9KrS+hbdSXZwTiafOQMuITjCMbwf +6tpU1bOpBfwPx3OZaAA8y3fkA1elt65jz9UAvlHhwOIbIv/unE7f6xklZRdRc+gE +UJf4G/EV3mmzScE2dsJJYvJLzIQuVdp5YmBwotpOXaECgcAKJI1ejUpO401xhwqp +/l+Gwxhg2wZFPBDImj37ivDfZjL2E6VJEJ3xeEfyHvMXYcQ9+HVCOsu7/hlzwN09 +2BKa49Wq80782f3cxJQjV5jaKUP5QxFH+zTMyV7K/QVPxDf9oCDl97nqsYHExgAD +cCd2B8ve2p17w7or0JDi9l+KxwFuW+dT/514ghrJehw9bRp5ESYCP2XSOQLcs1O6 +d+ltPN7PNDMWryQ3IoORYwJr/GwIYv+dKwd8gGrVyupDAn8CgcBJ7YIeLbV5nQ+g +Y2Ht748J3157Emckyxv5vE6QQqBzAN+WOWRjSqExbLnnTL9UsrMbYn0STxYRleti +eZmCSXu5msE1ZkwoGNRnyEAtoN0NPI92pB+rKZw2ERSjgtV9rPnmE4tvuz/dosxb +AjGCxal0bnwrnltq1xFqSWrjbvOfbf7bK68I6+T76ktqsGUhz3mdjzFp6cUducm/ +Ty6M1Y33OKW1ymOGnfaaTOuXWC6yLFjdB+aQg5wjNOIwuoHe750= +-----END RSA PRIVATE KEY----- + diff --git a/hackfest/netconf/connection/server-key.pub b/hackfest/netconf/connection/server-key.pub new file mode 100644 index 0000000000000000000000000000000000000000..faf095c812fe6ea34983f78cb03f23a0c0a41635 --- /dev/null +++ b/hackfest/netconf/connection/server-key.pub @@ -0,0 +1,2 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC56H0OzPeFq+ubc2W0i53M+IMBYTXDGSXWIPvHaIAk1GYlp4tZ8wuABW0LsO6Ow6lWMtuw92+soK9l/c94kT2PM9gk2EBeEwSsBpabdtF/ErQvp63+QecXFMaQ0cBIysDJJGsmWg/rPKzyfZ7whDe+rftKuaRyqeLOEOmJJ4GNhe0hCkPh661nbqnJCS0CL9fjXeNA3ShyIpqd7YlNsG+p1g/ucZUWtoSEAvfgfm7jrWVOW3CkCiDU3lBbtv1hzXOEUkUJxd6r2W4P/LpnkrORsFjDEAMmiN19+tNMduDPiv64mTD2bUryyoHMh4Fj3meZZsxHWI3MhD3stb5495sY898I7b5gs6SBka1Gz/MSs77y+XtxGwSHUyFD/aqpRyRlkQ8rEJPfY9yiDHxE8CV9QOGbR7vIGcpmS2XN11PTVymjTKK0PMKpOWOSVEvfq1gUPBkEeAHVhqjbxX+rScIqiTGGc8NBKMsAhV3z5/qk5y0iK2qY72DTckBViu8ALjM= chopps@tops + diff --git a/hackfest/netconf/connection/server_topology_connection.py b/hackfest/netconf/connection/server_topology_connection.py new file mode 100644 index 0000000000000000000000000000000000000000..67953e7ed74c76c481730a4445752b2a23fd8f56 --- /dev/null +++ b/hackfest/netconf/connection/server_topology_connection.py @@ -0,0 +1,109 @@ +# 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 time +import logging +import os + +import binding_topology +import binding_connection + +from pyangbind.lib.serialise import pybindIETFXMLEncoder, pybindIETFXMLDecoder + +from netconf import nsmap_add, NSMAP +from netconf import server, util +from lxml import etree + +logging.basicConfig(level=logging.DEBUG) + + +nsmap_add("topology", "urn:topology") +nsmap_add("connection", "urn:connection") + +class MyServer(object): + + def __init__(self, username, password, port): + host_key_value = os.path.join(os.path.abspath(os.path.dirname(__file__)), "server-key") + auth = server.SSHUserPassController(username=username, password=password) + auth.check_auth_none(username) + self.server = server.NetconfSSHServer(server_ctl=auth, server_methods=self, host_key=host_key_value, port=port, debug=True) + self.data = None + self.load_file() + + def load_file(self): + # create configuration + xml_root = open('topology.xml', 'r').read() + print(xml_root) + topo = pybindIETFXMLDecoder.decode(xml_root, binding_topology, "topology") + xml = pybindIETFXMLEncoder.serialise(topo) + tree = etree.XML(xml) + data = util.elm("nc:data") + data.append(tree) + connection = etree.XML( pybindIETFXMLEncoder.serialise( binding_connection.connection() ) ) + data.append(connection) + + self.data = data + + def nc_append_capabilities(self, capabilities): + logging.debug("--GET capabilities--") + util.subelm(capabilities, "capability").text = "urn:ietf:params:netconf:capability:xpath:1.0" + util.subelm(capabilities, "capability").text = NSMAP["topology"] + util.subelm(capabilities, "capability").text = NSMAP["connection"] + + def rpc_get_config(self, session, rpc, source_elm, filter_or_none): + logging.debug("--GET CONFIG--") + logging.debug(session) + logging.debug(etree.tostring(rpc)) + + return util.filter_results(rpc, self.data, None) + + + def rpc_edit_config(self, session, rpc, target, new_config): + logging.debug("--EDIT CONFIG--") + logging.debug(session) + + data_list = new_config.findall(".//xmlns:connection", namespaces={'xmlns': 'urn:connection'}) + for connect in data_list: + logging.debug("connect: " ) + logging.debug(etree.tostring(connect) ) + logging.debug("CURRENT CONNECTION") + logging.debug(etree.tostring(self.data[1]) ) + self.data[1].append(connect) + break + return util.filter_results(rpc, self.data, None) + + def close(self): + self.server.close() + + + + +def main(*margs): + s = MyServer("admin","admin", 8300) + + if sys.stdout.isatty(): + logging.debug("^C to quit server") + + try: + while True: + time.sleep(1) + + except Exception: + logging.debug("quitting server") + + s.close() + +if __name__ == "__main__": + main() diff --git a/hackfest/netconf/connection/topology.xml b/hackfest/netconf/connection/topology.xml new file mode 100644 index 0000000000000000000000000000000000000000..9baab0342e4020bbe5cb2cb0d549d73c66e7706f --- /dev/null +++ b/hackfest/netconf/connection/topology.xml @@ -0,0 +1,39 @@ + + + + + + node1 + + node1portA + + + + node2 + + node2portA + + + + link1 + node1 + node1portA + node2 + node2portA + + + diff --git a/hackfest/netconf/server-key b/hackfest/netconf/server-key new file mode 100644 index 0000000000000000000000000000000000000000..7fc5e5f87d49b1b603cc2eb89a062f9c19ab42b4 --- /dev/null +++ b/hackfest/netconf/server-key @@ -0,0 +1,40 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIG4gIBAAKCAYEAueh9Dsz3havrm3NltIudzPiDAWE1wxkl1iD7x2iAJNRmJaeL +WfMLgAVtC7DujsOpVjLbsPdvrKCvZf3PeJE9jzPYJNhAXhMErAaWm3bRfxK0L6et +/kHnFxTGkNHASMrAySRrJloP6zys8n2e8IQ3vq37SrmkcqnizhDpiSeBjYXtIQpD +4eutZ26pyQktAi/X413jQN0ociKane2JTbBvqdYP7nGVFraEhAL34H5u461lTltw +pAog1N5QW7b9Yc1zhFJFCcXeq9luD/y6Z5KzkbBYwxADJojdffrTTHbgz4r+uJkw +9m1K8sqBzIeBY95nmWbMR1iNzIQ97LW+ePebGPPfCO2+YLOkgZGtRs/zErO+8vl7 +cRsEh1MhQ/2qqUckZZEPKxCT32Pcogx8RPAlfUDhm0e7yBnKZktlzddT01cpo0yi +tDzCqTljklRL36tYFDwZBHgB1Yao28V/q0nCKokxhnPDQSjLAIVd8+f6pOctIitq +mO9g03JAVYrvAC4zAgMBAAECggGAbSxANG7ddJwvMgykT1AmDPZrSGYjwjyEYajg +8otFpVst2TL4vIvj1vxYuyLeFOyGBt668MN9yyxZlFVmfvEb63qQlaKAuj4E4ljE +HOu7vxnmwo1/ue5NnNpQeT8T4ite50ABxHXjH0t0bLqkma2rZsiY55r5HXTygfyg +iDCw/cEGLf7vOj7CiBkOj8ZZrg0WhKjgCXlWhSAZGGEj3oGcMWpJ1MbSvJHWZAey +NR1KVV3APjGohkyEVz1uh02AouyYxu0Oyu27i3NO3NSa0BLz6ct3U2wJFVt7zNIz +XcOr+YDcC0gz6yEz1O1e7+p1dOTL9+azA04Dq0IiSu6k94Rrmnvr42sMmDLi/JBN +ZP82nCOoPO31pdVoHqqG/s7+mjHGqTSC+l4wImZD5YGHRnGbOBarH75MG/PIDl6S +VSzVCZKPEnLkZ3lKC1R3WO5K16WCgqTGLisu4VjXALhHIMmJDNk3Kkv+EvLdXp5Q +hBbDlJCtgs7w8V88ci17ss9bmqWRAoHBAOl6T+gvTO2zbJ2LGXVJKGYFDR637GKJ +tPRyTPK8IJR6PN/VgQdJ70P2a3XEUIMSwH+6rBg+zNZnu7TkwDyyxImyjwtnhGjf +xAGfkj5inmsToBq5INxKBamito3QUyzZhYGfDO61r+e0agDpGYCll9EuhBeQ+00x +2x/vA0Btr4WzFnh3xdlozAcPvws3dXhybRPdgPbn90M2UW2ImdIV2GDJNN+vASbl +M9jhI1tm3KjCCfDzgKmvs48IpoRAwZJihQKBwQDL13Qxgk4L5uemi0fBR1Jwd0IE +gZ6E2rZWbzT5Fe9iSsN+1LHJqvs31We8FhN+sYujG1ZUUSt5bpFggXOw+LwDVOf2 +Bzer681YqkRKtu2wkEzRX0R1esMowba0s1Naonu1lohKKAcZJ4YHDBKjxYHH4+NR +mnFjjxtcnQ/mMVb+ZPjOaXvzCt7NfShlfztkClrDca3WgOh/Zed7+M+0S1rrOEpt +Wyph/Y76AzH/uzdEIPkToNqRIACXWOR2NOpn11cCgcAUb0gfIkSxaUrQXyRTR5vp +kfecAK0H0tWrr3VcqWqQlEJPtPgeEzKF2EN/gzcowbNneocleBmlil67bmoE5gCd +rKsobF8CbtNQ8Q5zt132MTmKHTnrDe+A8WTY9KrS+hbdSXZwTiafOQMuITjCMbwf +6tpU1bOpBfwPx3OZaAA8y3fkA1elt65jz9UAvlHhwOIbIv/unE7f6xklZRdRc+gE +UJf4G/EV3mmzScE2dsJJYvJLzIQuVdp5YmBwotpOXaECgcAKJI1ejUpO401xhwqp +/l+Gwxhg2wZFPBDImj37ivDfZjL2E6VJEJ3xeEfyHvMXYcQ9+HVCOsu7/hlzwN09 +2BKa49Wq80782f3cxJQjV5jaKUP5QxFH+zTMyV7K/QVPxDf9oCDl97nqsYHExgAD +cCd2B8ve2p17w7or0JDi9l+KxwFuW+dT/514ghrJehw9bRp5ESYCP2XSOQLcs1O6 +d+ltPN7PNDMWryQ3IoORYwJr/GwIYv+dKwd8gGrVyupDAn8CgcBJ7YIeLbV5nQ+g +Y2Ht748J3157Emckyxv5vE6QQqBzAN+WOWRjSqExbLnnTL9UsrMbYn0STxYRleti +eZmCSXu5msE1ZkwoGNRnyEAtoN0NPI92pB+rKZw2ERSjgtV9rPnmE4tvuz/dosxb +AjGCxal0bnwrnltq1xFqSWrjbvOfbf7bK68I6+T76ktqsGUhz3mdjzFp6cUducm/ +Ty6M1Y33OKW1ymOGnfaaTOuXWC6yLFjdB+aQg5wjNOIwuoHe750= +-----END RSA PRIVATE KEY----- + diff --git a/hackfest/netconf/server-key.pub b/hackfest/netconf/server-key.pub new file mode 100644 index 0000000000000000000000000000000000000000..faf095c812fe6ea34983f78cb03f23a0c0a41635 --- /dev/null +++ b/hackfest/netconf/server-key.pub @@ -0,0 +1,2 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC56H0OzPeFq+ubc2W0i53M+IMBYTXDGSXWIPvHaIAk1GYlp4tZ8wuABW0LsO6Ow6lWMtuw92+soK9l/c94kT2PM9gk2EBeEwSsBpabdtF/ErQvp63+QecXFMaQ0cBIysDJJGsmWg/rPKzyfZ7whDe+rftKuaRyqeLOEOmJJ4GNhe0hCkPh661nbqnJCS0CL9fjXeNA3ShyIpqd7YlNsG+p1g/ucZUWtoSEAvfgfm7jrWVOW3CkCiDU3lBbtv1hzXOEUkUJxd6r2W4P/LpnkrORsFjDEAMmiN19+tNMduDPiv64mTD2bUryyoHMh4Fj3meZZsxHWI3MhD3stb5495sY898I7b5gs6SBka1Gz/MSs77y+XtxGwSHUyFD/aqpRyRlkQ8rEJPfY9yiDHxE8CV9QOGbR7vIGcpmS2XN11PTVymjTKK0PMKpOWOSVEvfq1gUPBkEeAHVhqjbxX+rScIqiTGGc8NBKMsAhV3z5/qk5y0iK2qY72DTckBViu8ALjM= chopps@tops + diff --git a/hackfest/netconf/server_topology.py b/hackfest/netconf/server_topology.py new file mode 100644 index 0000000000000000000000000000000000000000..1320a7b00b2fe50f392e3a340579b6038f9f5cd9 --- /dev/null +++ b/hackfest/netconf/server_topology.py @@ -0,0 +1,85 @@ +# 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 time +import logging +import os + +import binding_topology +from pyangbind.lib.serialise import pybindIETFXMLEncoder, pybindIETFXMLDecoder + +from netconf import nsmap_add, NSMAP +from netconf import server, util +from lxml import etree + +logging.basicConfig(level=logging.DEBUG) + + +nsmap_add("topology", "urn:topology") + +class MyServer(object): + + def __init__(self, username, password, port): + host_key_value = os.path.join(os.path.abspath(os.path.dirname(__file__)), "server-key") + auth = server.SSHUserPassController(username=username, password=password) + self.server = server.NetconfSSHServer(server_ctl=auth, server_methods=self, port=port, host_key=host_key_value, debug=False) + self.load_file() + + def load_file(self): + # create configuration + xml_root = open('topology.xml', 'r').read() + print(xml_root) + topo = pybindIETFXMLDecoder.decode(xml_root, binding_topology, "topology") + xml = pybindIETFXMLEncoder.serialise(topo) + tree = etree.XML(xml) + data = util.elm("nc:data") + data.append(tree) + self.node_topology = data + + def nc_append_capabilities(self, capabilities): + util.subelm(capabilities, "capability").text = "urn:ietf:params:netconf:capability:xpath:1.0" + util.subelm(capabilities, "capability").text = NSMAP["topology"] + + def rpc_get_config(self, session, rpc, source_elm, filter_or_none): + logging.debug("--GET CONFIG--") + logging.debug(session) + logging.debug(etree.tostring(rpc)) + + return util.filter_results(rpc, self.node_topology, None) + + + def close(self): + self.server.close() + + + + +def main(*margs): + s = MyServer("admin","admin", 8300) + + if sys.stdout.isatty(): + logging.debug("^C to quit server") + + try: + while True: + time.sleep(1) + + except Exception: + logging.debug("quitting server") + + s.close() + +if __name__ == "__main__": + main() diff --git a/hackfest/netconf/topology.xml b/hackfest/netconf/topology.xml new file mode 100644 index 0000000000000000000000000000000000000000..9baab0342e4020bbe5cb2cb0d549d73c66e7706f --- /dev/null +++ b/hackfest/netconf/topology.xml @@ -0,0 +1,39 @@ + + + + + + node1 + + node1portA + + + + node2 + + node2portA + + + + link1 + node1 + node1portA + node2 + node2portA + + + diff --git a/hackfest/onos_api/commands.txt b/hackfest/onos_api/commands.txt new file mode 100644 index 0000000000000000000000000000000000000000..cac0169e63fac4b16bee718ab0720e2589ffb103 --- /dev/null +++ b/hackfest/onos_api/commands.txt @@ -0,0 +1,45 @@ +== APPENDIX: CONFD +$ cd ~/tfs-ctrl/hackfest/netconf +$ unzip confd-basic-6.4.linux.x86_64.zip +$ cd confd-basic-6.4.linux.x86_64/ +$ ./confd-basic-6.4.linux.x86_64.installer.bin /root/confd/ + +Data model compilation +$ cd /root/confd/bin/ +$ ./confdc -c ~/tfs-ctrl/hackfest/yang/topology.yang + +Start ConfD +$ ./confd --foreground -v --addloadpath . + +In another terminal, use ConfD-client to populate model +$ cd /root/confd/bin/ +$ ./confd_cli +> conf +> topology node node1 +> exit +> commit +> exit +> exit + +Use ConfD-client to show db +$ ./confd_cli +> conf +> show full-configuration +> exit +> exit + +== RUN ONOS +$ cd /root/onos-2.1.0/apache-karaf-4.2.3/bin/ +$ ./karaf clean +> app activate org.onosproject.openflow +> app activate org.onosproject.gui + +In another terminal, run mininet: +$ mn --topo linear,3 --mac --controller=remote,ip=127.0.0.1,port=6653 --switch ovs,protocols=OpenFlow13 + +In another terminal, we use ONOS REST API: +$ curl -X GET -u onos:rocks --header 'Accept: application/json' http://localhost:8181/onos/v1/links | python -m json.tool +$ cd ~/tfs-ctrl/hackfest/onos_api/ +$ python3 onos_topology.py + + diff --git a/hackfest/onos_api/onos_flows.py b/hackfest/onos_api/onos_flows.py new file mode 100644 index 0000000000000000000000000000000000000000..da57506a105116b0afa2d991df9e62ff49b6c576 --- /dev/null +++ b/hackfest/onos_api/onos_flows.py @@ -0,0 +1,67 @@ +#!/usr/bin/python +# 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. + +# -*- coding: utf-8 -*- + +import requests +from requests.auth import HTTPBasicAuth +import json + +IP='localhost' +PORT='8181' +USER='onos' +PASSWORD='rocks' + +URL = 'http://' + IP + ':' + PORT + '/onos/v1/flows/' + +def insertFlow( nodeId, priority, inport, outport ): + + flow='{ "priority": '+priority+', "timeout": 0, "isPermanent": true, "deviceId": "'+nodeId+'", "treatment": { "instructions": [ { "type": "OUTPUT", "port": "'+outport+'" } ] }, "selector": { "criteria": [ { "type": "IN_PORT", "port": "'+inport+'" } ] } }' + + + print ("Flow: " + flow) + url = URL + nodeId + '?appId=tuto' + headers = {'content-type': 'application/json'} + print (url) + response = requests.post(url, data=flow, + headers=headers, auth=HTTPBasicAuth(USER, + PASSWORD)) + print (response) + return response.status_code + +def deleteFlows(): + + url = URL + '' + 'application/'+'tuto' + response = requests.delete(url, auth=HTTPBasicAuth(USER, PASSWORD)) + print (response) + return response.status_code + + + +if __name__ == "__main__": + + print ("Setting flow") + + res = insertFlow(nodeId="of:0000000000000001", priority="40001", inport="1", outport="2") + print (res) + + #deleteFlows() + + + + + + + diff --git a/hackfest/onos_api/onos_topology.py b/hackfest/onos_api/onos_topology.py new file mode 100644 index 0000000000000000000000000000000000000000..eca3285bd99468e3ca10fa611bee682c6449ebdb --- /dev/null +++ b/hackfest/onos_api/onos_topology.py @@ -0,0 +1,40 @@ +#!/usr/bin/python +# 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. + +# -*- coding: utf-8 -*- + +import requests +from requests.auth import HTTPBasicAuth +import json + +IP='127.0.0.1' +PORT='8181' +USER='onos' +PASSWORD='rocks' + +def retrieveTopology(ip, port, user, password): + http_json = 'http://' + ip + ':' + port + '/onos/v1/links' + response = requests.get(http_json, auth=HTTPBasicAuth(user, password)) + topology = response.json() + return topology + +if __name__ == "__main__": + + print ("Reading network-topology") + topo = retrieveTopology(IP, PORT, USER, PASSWORD) + print ( json.dumps(topo, indent=4, sort_keys=True) ) + + + diff --git a/hackfest/openconfig/generated.go b/hackfest/openconfig/generated.go new file mode 100644 index 0000000000000000000000000000000000000000..51c51d41a8e32fa6fec395b88872479e87890da8 --- /dev/null +++ b/hackfest/openconfig/generated.go @@ -0,0 +1,8554 @@ +// 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. + +/* +Package gostruct is a generated package which contains definitions +of structs which represent a YANG schema. The generated schema can be +compressed by a series of transformations (compression was false +in this case). + +This package was generated by /usr/share/gocode/src/github.com/openconfig/ygot/ygen/commongen.go +using the following YANG input files: + - /root/public/release/models/optical-transport/openconfig-terminal-device.yang + - /root/public/release/models/types/openconfig-types.yang + - /root/public/release/models/openconfig-extensions.yang + - /root/public/release/models/platform/openconfig-platform-types.yang + - /root/public/release/models/system/openconfig-alarm-types.yang + - /root/public/release/models/lldp/openconfig-lldp.yang + - /root/public/release/models/interfaces/openconfig-interfaces.yang +Imported modules were sourced from: +*/ +package gostruct + +import ( + "encoding/json" + "fmt" + "reflect" + + "github.com/openconfig/ygot/ygot" + "github.com/openconfig/goyang/pkg/yang" + "github.com/openconfig/ygot/ytypes" +) + +// Binary is a type that is used for fields that have a YANG type of +// binary. It is used such that binary fields can be distinguished from +// leaf-lists of uint8s (which are mapped to []uint8, equivalent to +// []byte in reflection). +type Binary []byte + +// YANGEmpty is a type that is used for fields that have a YANG type of +// empty. It is used such that empty fields can be distinguished from boolean fields +// in the generated code. +type YANGEmpty bool + +var ( + SchemaTree map[string]*yang.Entry +) + +func init() { + var err error + if SchemaTree, err = UnzipSchema(); err != nil { + panic("schema error: " + err.Error()) + } +} + +// Schema returns the details of the generated schema. +func Schema() (*ytypes.Schema, error) { + uzp, err := UnzipSchema() + if err != nil { + return nil, fmt.Errorf("cannot unzip schema, %v", err) + } + + return &ytypes.Schema{ + Root: &Device{}, + SchemaTree: uzp, + Unmarshal: Unmarshal, + }, nil +} + +// UnzipSchema unzips the zipped schema and returns a map of yang.Entry nodes, +// keyed by the name of the struct that the yang.Entry describes the schema for. +func UnzipSchema() (map[string]*yang.Entry, error) { + var schemaTree map[string]*yang.Entry + var err error + if schemaTree, err = ygot.GzipToSchema(ySchema); err != nil { + return nil, fmt.Errorf("could not unzip the schema; %v", err) + } + return schemaTree, nil +} + +// Unmarshal unmarshals data, which must be RFC7951 JSON format, into +// destStruct, which must be non-nil and the correct GoStruct type. It returns +// an error if the destStruct is not found in the schema or the data cannot be +// unmarshaled. The supplied options (opts) are used to control the behaviour +// of the unmarshal function - for example, determining whether errors are +// thrown for unknown fields in the input JSON. +func Unmarshal(data []byte, destStruct ygot.GoStruct, opts ...ytypes.UnmarshalOpt) error { + tn := reflect.TypeOf(destStruct).Elem().Name() + schema, ok := SchemaTree[tn] + if !ok { + return fmt.Errorf("could not find schema for type %s", tn ) + } + var jsonTree interface{} + if err := json.Unmarshal([]byte(data), &jsonTree); err != nil { + return err + } + return ytypes.Unmarshal(schema, destStruct, jsonTree, opts...) +} + +// Device represents the /device YANG schema element. +type Device struct { + Components *OpenconfigPlatform_Components `path:"components" module:"openconfig-platform"` + Interfaces *OpenconfigInterfaces_Interfaces `path:"interfaces" module:"openconfig-interfaces"` + InterfacesState *IETFInterfaces_InterfacesState `path:"interfaces-state" module:"ietf-interfaces"` + Lldp *OpenconfigLldp_Lldp `path:"lldp" module:"openconfig-lldp"` + TerminalDevice *OpenconfigTerminalDevice_TerminalDevice `path:"terminal-device" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that Device implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*Device) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *Device) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["Device"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *Device) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// IETFInterfaces_InterfacesState represents the /ietf-interfaces/interfaces-state YANG schema element. +type IETFInterfaces_InterfacesState struct { + Interface map[string]*IETFInterfaces_InterfacesState_Interface `path:"interface" module:"ietf-interfaces"` +} + +// IsYANGGoStruct ensures that IETFInterfaces_InterfacesState implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*IETFInterfaces_InterfacesState) IsYANGGoStruct() {} + +// NewInterface creates a new entry in the Interface list of the +// IETFInterfaces_InterfacesState struct. The keys of the list are populated from the input +// arguments. +func (t *IETFInterfaces_InterfacesState) NewInterface(Name string) (*IETFInterfaces_InterfacesState_Interface, error){ + + // Initialise the list within the receiver struct if it has not already been + // created. + if t.Interface == nil { + t.Interface = make(map[string]*IETFInterfaces_InterfacesState_Interface) + } + + key := Name + + // Ensure that this key has not already been used in the + // list. Keyed YANG lists do not allow duplicate keys to + // be created. + if _, ok := t.Interface[key]; ok { + return nil, fmt.Errorf("duplicate key %v for list Interface", key) + } + + t.Interface[key] = &IETFInterfaces_InterfacesState_Interface{ + Name: &Name, + } + + return t.Interface[key], nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *IETFInterfaces_InterfacesState) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["IETFInterfaces_InterfacesState"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *IETFInterfaces_InterfacesState) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// IETFInterfaces_InterfacesState_Interface represents the /ietf-interfaces/interfaces-state/interface YANG schema element. +type IETFInterfaces_InterfacesState_Interface struct { + AdminStatus E_IETFInterfaces_InterfacesState_Interface_AdminStatus `path:"admin-status" module:"ietf-interfaces"` + HigherLayerIf []string `path:"higher-layer-if" module:"ietf-interfaces"` + IfIndex *int32 `path:"if-index" module:"ietf-interfaces"` + LastChange *string `path:"last-change" module:"ietf-interfaces"` + LowerLayerIf []string `path:"lower-layer-if" module:"ietf-interfaces"` + Name *string `path:"name" module:"ietf-interfaces"` + OperStatus E_IETFInterfaces_InterfacesState_Interface_OperStatus `path:"oper-status" module:"ietf-interfaces"` + PhysAddress *string `path:"phys-address" module:"ietf-interfaces"` + Speed *uint64 `path:"speed" module:"ietf-interfaces"` + Statistics *IETFInterfaces_InterfacesState_Interface_Statistics `path:"statistics" module:"ietf-interfaces"` + Type E_IETFInterfaces_InterfaceType `path:"type" module:"ietf-interfaces"` +} + +// IsYANGGoStruct ensures that IETFInterfaces_InterfacesState_Interface implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*IETFInterfaces_InterfacesState_Interface) IsYANGGoStruct() {} + +// ΛListKeyMap returns the keys of the IETFInterfaces_InterfacesState_Interface struct, which is a YANG list entry. +func (t *IETFInterfaces_InterfacesState_Interface) ΛListKeyMap() (map[string]interface{}, error) { + if t.Name == nil { + return nil, fmt.Errorf("nil value for key Name") + } + + return map[string]interface{}{ + "name": *t.Name, + }, nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *IETFInterfaces_InterfacesState_Interface) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["IETFInterfaces_InterfacesState_Interface"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *IETFInterfaces_InterfacesState_Interface) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// IETFInterfaces_InterfacesState_Interface_Statistics represents the /ietf-interfaces/interfaces-state/interface/statistics YANG schema element. +type IETFInterfaces_InterfacesState_Interface_Statistics struct { + DiscontinuityTime *string `path:"discontinuity-time" module:"ietf-interfaces"` + InBroadcastPkts *uint64 `path:"in-broadcast-pkts" module:"ietf-interfaces"` + InDiscards *uint32 `path:"in-discards" module:"ietf-interfaces"` + InErrors *uint32 `path:"in-errors" module:"ietf-interfaces"` + InMulticastPkts *uint64 `path:"in-multicast-pkts" module:"ietf-interfaces"` + InOctets *uint64 `path:"in-octets" module:"ietf-interfaces"` + InUnicastPkts *uint64 `path:"in-unicast-pkts" module:"ietf-interfaces"` + InUnknownProtos *uint32 `path:"in-unknown-protos" module:"ietf-interfaces"` + OutBroadcastPkts *uint64 `path:"out-broadcast-pkts" module:"ietf-interfaces"` + OutDiscards *uint32 `path:"out-discards" module:"ietf-interfaces"` + OutErrors *uint32 `path:"out-errors" module:"ietf-interfaces"` + OutMulticastPkts *uint64 `path:"out-multicast-pkts" module:"ietf-interfaces"` + OutOctets *uint64 `path:"out-octets" module:"ietf-interfaces"` + OutUnicastPkts *uint64 `path:"out-unicast-pkts" module:"ietf-interfaces"` +} + +// IsYANGGoStruct ensures that IETFInterfaces_InterfacesState_Interface_Statistics implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*IETFInterfaces_InterfacesState_Interface_Statistics) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *IETFInterfaces_InterfacesState_Interface_Statistics) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["IETFInterfaces_InterfacesState_Interface_Statistics"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *IETFInterfaces_InterfacesState_Interface_Statistics) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigInterfaces_Interfaces represents the /openconfig-interfaces/interfaces YANG schema element. +type OpenconfigInterfaces_Interfaces struct { + Interface map[string]*OpenconfigInterfaces_Interfaces_Interface `path:"interface" module:"openconfig-interfaces"` +} + +// IsYANGGoStruct ensures that OpenconfigInterfaces_Interfaces implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigInterfaces_Interfaces) IsYANGGoStruct() {} + +// NewInterface creates a new entry in the Interface list of the +// OpenconfigInterfaces_Interfaces struct. The keys of the list are populated from the input +// arguments. +func (t *OpenconfigInterfaces_Interfaces) NewInterface(Name string) (*OpenconfigInterfaces_Interfaces_Interface, error){ + + // Initialise the list within the receiver struct if it has not already been + // created. + if t.Interface == nil { + t.Interface = make(map[string]*OpenconfigInterfaces_Interfaces_Interface) + } + + key := Name + + // Ensure that this key has not already been used in the + // list. Keyed YANG lists do not allow duplicate keys to + // be created. + if _, ok := t.Interface[key]; ok { + return nil, fmt.Errorf("duplicate key %v for list Interface", key) + } + + t.Interface[key] = &OpenconfigInterfaces_Interfaces_Interface{ + Name: &Name, + } + + return t.Interface[key], nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigInterfaces_Interfaces) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigInterfaces_Interfaces"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigInterfaces_Interfaces) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigInterfaces_Interfaces_Interface represents the /openconfig-interfaces/interfaces/interface YANG schema element. +type OpenconfigInterfaces_Interfaces_Interface struct { + Config *OpenconfigInterfaces_Interfaces_Interface_Config `path:"config" module:"openconfig-interfaces"` + Ethernet *OpenconfigInterfaces_Interfaces_Interface_Ethernet `path:"ethernet" module:"openconfig-if-ethernet"` + HoldTime *OpenconfigInterfaces_Interfaces_Interface_HoldTime `path:"hold-time" module:"openconfig-interfaces"` + Name *string `path:"name" module:"openconfig-interfaces"` + State *OpenconfigInterfaces_Interfaces_Interface_State `path:"state" module:"openconfig-interfaces"` + Subinterfaces *OpenconfigInterfaces_Interfaces_Interface_Subinterfaces `path:"subinterfaces" module:"openconfig-interfaces"` +} + +// IsYANGGoStruct ensures that OpenconfigInterfaces_Interfaces_Interface implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigInterfaces_Interfaces_Interface) IsYANGGoStruct() {} + +// ΛListKeyMap returns the keys of the OpenconfigInterfaces_Interfaces_Interface struct, which is a YANG list entry. +func (t *OpenconfigInterfaces_Interfaces_Interface) ΛListKeyMap() (map[string]interface{}, error) { + if t.Name == nil { + return nil, fmt.Errorf("nil value for key Name") + } + + return map[string]interface{}{ + "name": *t.Name, + }, nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigInterfaces_Interfaces_Interface) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigInterfaces_Interfaces_Interface"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigInterfaces_Interfaces_Interface) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigInterfaces_Interfaces_Interface_Config represents the /openconfig-interfaces/interfaces/interface/config YANG schema element. +type OpenconfigInterfaces_Interfaces_Interface_Config struct { + Description *string `path:"description" module:"openconfig-interfaces"` + Enabled *bool `path:"enabled" module:"openconfig-interfaces"` + LoopbackMode *bool `path:"loopback-mode" module:"openconfig-interfaces"` + Mtu *uint16 `path:"mtu" module:"openconfig-interfaces"` + Name *string `path:"name" module:"openconfig-interfaces"` + Type E_IETFInterfaces_InterfaceType `path:"type" module:"openconfig-interfaces"` +} + +// IsYANGGoStruct ensures that OpenconfigInterfaces_Interfaces_Interface_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigInterfaces_Interfaces_Interface_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigInterfaces_Interfaces_Interface_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigInterfaces_Interfaces_Interface_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigInterfaces_Interfaces_Interface_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigInterfaces_Interfaces_Interface_Ethernet represents the /openconfig-interfaces/interfaces/interface/ethernet YANG schema element. +type OpenconfigInterfaces_Interfaces_Interface_Ethernet struct { + Config *OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config `path:"config" module:"openconfig-if-ethernet"` + State *OpenconfigInterfaces_Interfaces_Interface_Ethernet_State `path:"state" module:"openconfig-if-ethernet"` +} + +// IsYANGGoStruct ensures that OpenconfigInterfaces_Interfaces_Interface_Ethernet implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigInterfaces_Interfaces_Interface_Ethernet) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigInterfaces_Interfaces_Interface_Ethernet) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigInterfaces_Interfaces_Interface_Ethernet"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigInterfaces_Interfaces_Interface_Ethernet) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config represents the /openconfig-interfaces/interfaces/interface/ethernet/config YANG schema element. +type OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config struct { + AutoNegotiate *bool `path:"auto-negotiate" module:"openconfig-if-ethernet"` + DuplexMode E_OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode `path:"duplex-mode" module:"openconfig-if-ethernet"` + EnableFlowControl *bool `path:"enable-flow-control" module:"openconfig-if-ethernet"` + MacAddress *string `path:"mac-address" module:"openconfig-if-ethernet"` + PortSpeed E_OpenconfigIfEthernet_ETHERNET_SPEED `path:"port-speed" module:"openconfig-if-ethernet"` +} + +// IsYANGGoStruct ensures that OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigInterfaces_Interfaces_Interface_Ethernet_State represents the /openconfig-interfaces/interfaces/interface/ethernet/state YANG schema element. +type OpenconfigInterfaces_Interfaces_Interface_Ethernet_State struct { + AutoNegotiate *bool `path:"auto-negotiate" module:"openconfig-if-ethernet"` + Counters *OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_Counters `path:"counters" module:"openconfig-if-ethernet"` + DuplexMode E_OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode `path:"duplex-mode" module:"openconfig-if-ethernet"` + EnableFlowControl *bool `path:"enable-flow-control" module:"openconfig-if-ethernet"` + HwMacAddress *string `path:"hw-mac-address" module:"openconfig-if-ethernet"` + MacAddress *string `path:"mac-address" module:"openconfig-if-ethernet"` + NegotiatedDuplexMode E_OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode `path:"negotiated-duplex-mode" module:"openconfig-if-ethernet"` + NegotiatedPortSpeed E_OpenconfigIfEthernet_ETHERNET_SPEED `path:"negotiated-port-speed" module:"openconfig-if-ethernet"` + PortSpeed E_OpenconfigIfEthernet_ETHERNET_SPEED `path:"port-speed" module:"openconfig-if-ethernet"` +} + +// IsYANGGoStruct ensures that OpenconfigInterfaces_Interfaces_Interface_Ethernet_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigInterfaces_Interfaces_Interface_Ethernet_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigInterfaces_Interfaces_Interface_Ethernet_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigInterfaces_Interfaces_Interface_Ethernet_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigInterfaces_Interfaces_Interface_Ethernet_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_Counters represents the /openconfig-interfaces/interfaces/interface/ethernet/state/counters YANG schema element. +type OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_Counters struct { + In_8021QFrames *uint64 `path:"in-8021q-frames" module:"openconfig-if-ethernet"` + InBlockErrors *uint64 `path:"in-block-errors" module:"openconfig-if-ethernet"` + InCrcErrors *uint64 `path:"in-crc-errors" module:"openconfig-if-ethernet"` + InFragmentFrames *uint64 `path:"in-fragment-frames" module:"openconfig-if-ethernet"` + InJabberFrames *uint64 `path:"in-jabber-frames" module:"openconfig-if-ethernet"` + InMacControlFrames *uint64 `path:"in-mac-control-frames" module:"openconfig-if-ethernet"` + InMacPauseFrames *uint64 `path:"in-mac-pause-frames" module:"openconfig-if-ethernet"` + InOversizeFrames *uint64 `path:"in-oversize-frames" module:"openconfig-if-ethernet"` + InUndersizeFrames *uint64 `path:"in-undersize-frames" module:"openconfig-if-ethernet"` + Out_8021QFrames *uint64 `path:"out-8021q-frames" module:"openconfig-if-ethernet"` + OutMacControlFrames *uint64 `path:"out-mac-control-frames" module:"openconfig-if-ethernet"` + OutMacPauseFrames *uint64 `path:"out-mac-pause-frames" module:"openconfig-if-ethernet"` +} + +// IsYANGGoStruct ensures that OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_Counters implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_Counters) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_Counters) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_Counters"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_Counters) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigInterfaces_Interfaces_Interface_HoldTime represents the /openconfig-interfaces/interfaces/interface/hold-time YANG schema element. +type OpenconfigInterfaces_Interfaces_Interface_HoldTime struct { + Config *OpenconfigInterfaces_Interfaces_Interface_HoldTime_Config `path:"config" module:"openconfig-interfaces"` + State *OpenconfigInterfaces_Interfaces_Interface_HoldTime_State `path:"state" module:"openconfig-interfaces"` +} + +// IsYANGGoStruct ensures that OpenconfigInterfaces_Interfaces_Interface_HoldTime implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigInterfaces_Interfaces_Interface_HoldTime) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigInterfaces_Interfaces_Interface_HoldTime) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigInterfaces_Interfaces_Interface_HoldTime"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigInterfaces_Interfaces_Interface_HoldTime) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigInterfaces_Interfaces_Interface_HoldTime_Config represents the /openconfig-interfaces/interfaces/interface/hold-time/config YANG schema element. +type OpenconfigInterfaces_Interfaces_Interface_HoldTime_Config struct { + Down *uint32 `path:"down" module:"openconfig-interfaces"` + Up *uint32 `path:"up" module:"openconfig-interfaces"` +} + +// IsYANGGoStruct ensures that OpenconfigInterfaces_Interfaces_Interface_HoldTime_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigInterfaces_Interfaces_Interface_HoldTime_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigInterfaces_Interfaces_Interface_HoldTime_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigInterfaces_Interfaces_Interface_HoldTime_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigInterfaces_Interfaces_Interface_HoldTime_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigInterfaces_Interfaces_Interface_HoldTime_State represents the /openconfig-interfaces/interfaces/interface/hold-time/state YANG schema element. +type OpenconfigInterfaces_Interfaces_Interface_HoldTime_State struct { + Down *uint32 `path:"down" module:"openconfig-interfaces"` + Up *uint32 `path:"up" module:"openconfig-interfaces"` +} + +// IsYANGGoStruct ensures that OpenconfigInterfaces_Interfaces_Interface_HoldTime_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigInterfaces_Interfaces_Interface_HoldTime_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigInterfaces_Interfaces_Interface_HoldTime_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigInterfaces_Interfaces_Interface_HoldTime_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigInterfaces_Interfaces_Interface_HoldTime_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigInterfaces_Interfaces_Interface_State represents the /openconfig-interfaces/interfaces/interface/state YANG schema element. +type OpenconfigInterfaces_Interfaces_Interface_State struct { + AdminStatus E_OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus `path:"admin-status" module:"openconfig-interfaces"` + Counters *OpenconfigInterfaces_Interfaces_Interface_State_Counters `path:"counters" module:"openconfig-interfaces"` + Description *string `path:"description" module:"openconfig-interfaces"` + Enabled *bool `path:"enabled" module:"openconfig-interfaces"` + HardwarePort *string `path:"hardware-port" module:"openconfig-platform-port"` + Ifindex *uint32 `path:"ifindex" module:"openconfig-interfaces"` + LastChange *uint64 `path:"last-change" module:"openconfig-interfaces"` + Logical *bool `path:"logical" module:"openconfig-interfaces"` + LoopbackMode *bool `path:"loopback-mode" module:"openconfig-interfaces"` + Mtu *uint16 `path:"mtu" module:"openconfig-interfaces"` + Name *string `path:"name" module:"openconfig-interfaces"` + OperStatus E_OpenconfigInterfaces_Interfaces_Interface_State_OperStatus `path:"oper-status" module:"openconfig-interfaces"` + PhysicalChannel []uint16 `path:"physical-channel" module:"openconfig-platform-transceiver"` + Transceiver *string `path:"transceiver" module:"openconfig-platform-transceiver"` + Type E_IETFInterfaces_InterfaceType `path:"type" module:"openconfig-interfaces"` +} + +// IsYANGGoStruct ensures that OpenconfigInterfaces_Interfaces_Interface_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigInterfaces_Interfaces_Interface_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigInterfaces_Interfaces_Interface_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigInterfaces_Interfaces_Interface_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigInterfaces_Interfaces_Interface_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigInterfaces_Interfaces_Interface_State_Counters represents the /openconfig-interfaces/interfaces/interface/state/counters YANG schema element. +type OpenconfigInterfaces_Interfaces_Interface_State_Counters struct { + CarrierTransitions *uint64 `path:"carrier-transitions" module:"openconfig-interfaces"` + InBroadcastPkts *uint64 `path:"in-broadcast-pkts" module:"openconfig-interfaces"` + InDiscards *uint64 `path:"in-discards" module:"openconfig-interfaces"` + InErrors *uint64 `path:"in-errors" module:"openconfig-interfaces"` + InFcsErrors *uint64 `path:"in-fcs-errors" module:"openconfig-interfaces"` + InMulticastPkts *uint64 `path:"in-multicast-pkts" module:"openconfig-interfaces"` + InOctets *uint64 `path:"in-octets" module:"openconfig-interfaces"` + InPkts *uint64 `path:"in-pkts" module:"openconfig-interfaces"` + InUnicastPkts *uint64 `path:"in-unicast-pkts" module:"openconfig-interfaces"` + InUnknownProtos *uint64 `path:"in-unknown-protos" module:"openconfig-interfaces"` + LastClear *uint64 `path:"last-clear" module:"openconfig-interfaces"` + OutBroadcastPkts *uint64 `path:"out-broadcast-pkts" module:"openconfig-interfaces"` + OutDiscards *uint64 `path:"out-discards" module:"openconfig-interfaces"` + OutErrors *uint64 `path:"out-errors" module:"openconfig-interfaces"` + OutMulticastPkts *uint64 `path:"out-multicast-pkts" module:"openconfig-interfaces"` + OutOctets *uint64 `path:"out-octets" module:"openconfig-interfaces"` + OutPkts *uint64 `path:"out-pkts" module:"openconfig-interfaces"` + OutUnicastPkts *uint64 `path:"out-unicast-pkts" module:"openconfig-interfaces"` +} + +// IsYANGGoStruct ensures that OpenconfigInterfaces_Interfaces_Interface_State_Counters implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigInterfaces_Interfaces_Interface_State_Counters) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigInterfaces_Interfaces_Interface_State_Counters) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigInterfaces_Interfaces_Interface_State_Counters"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigInterfaces_Interfaces_Interface_State_Counters) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigInterfaces_Interfaces_Interface_Subinterfaces represents the /openconfig-interfaces/interfaces/interface/subinterfaces YANG schema element. +type OpenconfigInterfaces_Interfaces_Interface_Subinterfaces struct { + Subinterface map[uint32]*OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface `path:"subinterface" module:"openconfig-interfaces"` +} + +// IsYANGGoStruct ensures that OpenconfigInterfaces_Interfaces_Interface_Subinterfaces implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigInterfaces_Interfaces_Interface_Subinterfaces) IsYANGGoStruct() {} + +// NewSubinterface creates a new entry in the Subinterface list of the +// OpenconfigInterfaces_Interfaces_Interface_Subinterfaces struct. The keys of the list are populated from the input +// arguments. +func (t *OpenconfigInterfaces_Interfaces_Interface_Subinterfaces) NewSubinterface(Index uint32) (*OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface, error){ + + // Initialise the list within the receiver struct if it has not already been + // created. + if t.Subinterface == nil { + t.Subinterface = make(map[uint32]*OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface) + } + + key := Index + + // Ensure that this key has not already been used in the + // list. Keyed YANG lists do not allow duplicate keys to + // be created. + if _, ok := t.Subinterface[key]; ok { + return nil, fmt.Errorf("duplicate key %v for list Subinterface", key) + } + + t.Subinterface[key] = &OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface{ + Index: &Index, + } + + return t.Subinterface[key], nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigInterfaces_Interfaces_Interface_Subinterfaces) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigInterfaces_Interfaces_Interface_Subinterfaces"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigInterfaces_Interfaces_Interface_Subinterfaces) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface represents the /openconfig-interfaces/interfaces/interface/subinterfaces/subinterface YANG schema element. +type OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface struct { + Config *OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Config `path:"config" module:"openconfig-interfaces"` + Index *uint32 `path:"index" module:"openconfig-interfaces"` + State *OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_State `path:"state" module:"openconfig-interfaces"` +} + +// IsYANGGoStruct ensures that OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface) IsYANGGoStruct() {} + +// ΛListKeyMap returns the keys of the OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface struct, which is a YANG list entry. +func (t *OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface) ΛListKeyMap() (map[string]interface{}, error) { + if t.Index == nil { + return nil, fmt.Errorf("nil value for key Index") + } + + return map[string]interface{}{ + "index": *t.Index, + }, nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Config represents the /openconfig-interfaces/interfaces/interface/subinterfaces/subinterface/config YANG schema element. +type OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Config struct { + Description *string `path:"description" module:"openconfig-interfaces"` + Enabled *bool `path:"enabled" module:"openconfig-interfaces"` + Index *uint32 `path:"index" module:"openconfig-interfaces"` +} + +// IsYANGGoStruct ensures that OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_State represents the /openconfig-interfaces/interfaces/interface/subinterfaces/subinterface/state YANG schema element. +type OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_State struct { + AdminStatus E_OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus `path:"admin-status" module:"openconfig-interfaces"` + Counters *OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_State_Counters `path:"counters" module:"openconfig-interfaces"` + Description *string `path:"description" module:"openconfig-interfaces"` + Enabled *bool `path:"enabled" module:"openconfig-interfaces"` + Ifindex *uint32 `path:"ifindex" module:"openconfig-interfaces"` + Index *uint32 `path:"index" module:"openconfig-interfaces"` + LastChange *uint64 `path:"last-change" module:"openconfig-interfaces"` + Logical *bool `path:"logical" module:"openconfig-interfaces"` + Name *string `path:"name" module:"openconfig-interfaces"` + OperStatus E_OpenconfigInterfaces_Interfaces_Interface_State_OperStatus `path:"oper-status" module:"openconfig-interfaces"` +} + +// IsYANGGoStruct ensures that OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_State_Counters represents the /openconfig-interfaces/interfaces/interface/subinterfaces/subinterface/state/counters YANG schema element. +type OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_State_Counters struct { + CarrierTransitions *uint64 `path:"carrier-transitions" module:"openconfig-interfaces"` + InBroadcastPkts *uint64 `path:"in-broadcast-pkts" module:"openconfig-interfaces"` + InDiscards *uint64 `path:"in-discards" module:"openconfig-interfaces"` + InErrors *uint64 `path:"in-errors" module:"openconfig-interfaces"` + InFcsErrors *uint64 `path:"in-fcs-errors" module:"openconfig-interfaces"` + InMulticastPkts *uint64 `path:"in-multicast-pkts" module:"openconfig-interfaces"` + InOctets *uint64 `path:"in-octets" module:"openconfig-interfaces"` + InPkts *uint64 `path:"in-pkts" module:"openconfig-interfaces"` + InUnicastPkts *uint64 `path:"in-unicast-pkts" module:"openconfig-interfaces"` + InUnknownProtos *uint64 `path:"in-unknown-protos" module:"openconfig-interfaces"` + LastClear *uint64 `path:"last-clear" module:"openconfig-interfaces"` + OutBroadcastPkts *uint64 `path:"out-broadcast-pkts" module:"openconfig-interfaces"` + OutDiscards *uint64 `path:"out-discards" module:"openconfig-interfaces"` + OutErrors *uint64 `path:"out-errors" module:"openconfig-interfaces"` + OutMulticastPkts *uint64 `path:"out-multicast-pkts" module:"openconfig-interfaces"` + OutOctets *uint64 `path:"out-octets" module:"openconfig-interfaces"` + OutPkts *uint64 `path:"out-pkts" module:"openconfig-interfaces"` + OutUnicastPkts *uint64 `path:"out-unicast-pkts" module:"openconfig-interfaces"` +} + +// IsYANGGoStruct ensures that OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_State_Counters implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_State_Counters) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_State_Counters) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_State_Counters"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface_State_Counters) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigLldp_Lldp represents the /openconfig-lldp/lldp YANG schema element. +type OpenconfigLldp_Lldp struct { + Config *OpenconfigLldp_Lldp_Config `path:"config" module:"openconfig-lldp"` + Interfaces *OpenconfigLldp_Lldp_Interfaces `path:"interfaces" module:"openconfig-lldp"` + State *OpenconfigLldp_Lldp_State `path:"state" module:"openconfig-lldp"` +} + +// IsYANGGoStruct ensures that OpenconfigLldp_Lldp implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigLldp_Lldp) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigLldp_Lldp) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigLldp_Lldp"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigLldp_Lldp) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigLldp_Lldp_Config represents the /openconfig-lldp/lldp/config YANG schema element. +type OpenconfigLldp_Lldp_Config struct { + ChassisId *string `path:"chassis-id" module:"openconfig-lldp"` + ChassisIdType E_OpenconfigLldp_ChassisIdType `path:"chassis-id-type" module:"openconfig-lldp"` + Enabled *bool `path:"enabled" module:"openconfig-lldp"` + HelloTimer *uint64 `path:"hello-timer" module:"openconfig-lldp"` + SuppressTlvAdvertisement []E_OpenconfigLldpTypes_LLDP_TLV `path:"suppress-tlv-advertisement" module:"openconfig-lldp"` + SystemDescription *string `path:"system-description" module:"openconfig-lldp"` + SystemName *string `path:"system-name" module:"openconfig-lldp"` +} + +// IsYANGGoStruct ensures that OpenconfigLldp_Lldp_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigLldp_Lldp_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigLldp_Lldp_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigLldp_Lldp_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigLldp_Lldp_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigLldp_Lldp_Interfaces represents the /openconfig-lldp/lldp/interfaces YANG schema element. +type OpenconfigLldp_Lldp_Interfaces struct { + Interface map[string]*OpenconfigLldp_Lldp_Interfaces_Interface `path:"interface" module:"openconfig-lldp"` +} + +// IsYANGGoStruct ensures that OpenconfigLldp_Lldp_Interfaces implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigLldp_Lldp_Interfaces) IsYANGGoStruct() {} + +// NewInterface creates a new entry in the Interface list of the +// OpenconfigLldp_Lldp_Interfaces struct. The keys of the list are populated from the input +// arguments. +func (t *OpenconfigLldp_Lldp_Interfaces) NewInterface(Name string) (*OpenconfigLldp_Lldp_Interfaces_Interface, error){ + + // Initialise the list within the receiver struct if it has not already been + // created. + if t.Interface == nil { + t.Interface = make(map[string]*OpenconfigLldp_Lldp_Interfaces_Interface) + } + + key := Name + + // Ensure that this key has not already been used in the + // list. Keyed YANG lists do not allow duplicate keys to + // be created. + if _, ok := t.Interface[key]; ok { + return nil, fmt.Errorf("duplicate key %v for list Interface", key) + } + + t.Interface[key] = &OpenconfigLldp_Lldp_Interfaces_Interface{ + Name: &Name, + } + + return t.Interface[key], nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigLldp_Lldp_Interfaces) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigLldp_Lldp_Interfaces"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigLldp_Lldp_Interfaces) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigLldp_Lldp_Interfaces_Interface represents the /openconfig-lldp/lldp/interfaces/interface YANG schema element. +type OpenconfigLldp_Lldp_Interfaces_Interface struct { + Config *OpenconfigLldp_Lldp_Interfaces_Interface_Config `path:"config" module:"openconfig-lldp"` + Name *string `path:"name" module:"openconfig-lldp"` + Neighbors *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors `path:"neighbors" module:"openconfig-lldp"` + State *OpenconfigLldp_Lldp_Interfaces_Interface_State `path:"state" module:"openconfig-lldp"` +} + +// IsYANGGoStruct ensures that OpenconfigLldp_Lldp_Interfaces_Interface implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigLldp_Lldp_Interfaces_Interface) IsYANGGoStruct() {} + +// ΛListKeyMap returns the keys of the OpenconfigLldp_Lldp_Interfaces_Interface struct, which is a YANG list entry. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface) ΛListKeyMap() (map[string]interface{}, error) { + if t.Name == nil { + return nil, fmt.Errorf("nil value for key Name") + } + + return map[string]interface{}{ + "name": *t.Name, + }, nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigLldp_Lldp_Interfaces_Interface"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigLldp_Lldp_Interfaces_Interface_Config represents the /openconfig-lldp/lldp/interfaces/interface/config YANG schema element. +type OpenconfigLldp_Lldp_Interfaces_Interface_Config struct { + Enabled *bool `path:"enabled" module:"openconfig-lldp"` + Name *string `path:"name" module:"openconfig-lldp"` +} + +// IsYANGGoStruct ensures that OpenconfigLldp_Lldp_Interfaces_Interface_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigLldp_Lldp_Interfaces_Interface_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigLldp_Lldp_Interfaces_Interface_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors represents the /openconfig-lldp/lldp/interfaces/interface/neighbors YANG schema element. +type OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors struct { + Neighbor map[string]*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor `path:"neighbor" module:"openconfig-lldp"` +} + +// IsYANGGoStruct ensures that OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors) IsYANGGoStruct() {} + +// NewNeighbor creates a new entry in the Neighbor list of the +// OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors struct. The keys of the list are populated from the input +// arguments. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors) NewNeighbor(Id string) (*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor, error){ + + // Initialise the list within the receiver struct if it has not already been + // created. + if t.Neighbor == nil { + t.Neighbor = make(map[string]*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor) + } + + key := Id + + // Ensure that this key has not already been used in the + // list. Keyed YANG lists do not allow duplicate keys to + // be created. + if _, ok := t.Neighbor[key]; ok { + return nil, fmt.Errorf("duplicate key %v for list Neighbor", key) + } + + t.Neighbor[key] = &OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor{ + Id: &Id, + } + + return t.Neighbor[key], nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor represents the /openconfig-lldp/lldp/interfaces/interface/neighbors/neighbor YANG schema element. +type OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor struct { + Capabilities *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities `path:"capabilities" module:"openconfig-lldp"` + Config *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Config `path:"config" module:"openconfig-lldp"` + CustomTlvs *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs `path:"custom-tlvs" module:"openconfig-lldp"` + Id *string `path:"id" module:"openconfig-lldp"` + State *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_State `path:"state" module:"openconfig-lldp"` +} + +// IsYANGGoStruct ensures that OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor) IsYANGGoStruct() {} + +// ΛListKeyMap returns the keys of the OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor struct, which is a YANG list entry. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor) ΛListKeyMap() (map[string]interface{}, error) { + if t.Id == nil { + return nil, fmt.Errorf("nil value for key Id") + } + + return map[string]interface{}{ + "id": *t.Id, + }, nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities represents the /openconfig-lldp/lldp/interfaces/interface/neighbors/neighbor/capabilities YANG schema element. +type OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities struct { + Capability map[E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY]*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability `path:"capability" module:"openconfig-lldp"` +} + +// IsYANGGoStruct ensures that OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities) IsYANGGoStruct() {} + +// NewCapability creates a new entry in the Capability list of the +// OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities struct. The keys of the list are populated from the input +// arguments. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities) NewCapability(Name E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY) (*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability, error){ + + // Initialise the list within the receiver struct if it has not already been + // created. + if t.Capability == nil { + t.Capability = make(map[E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY]*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability) + } + + key := Name + + // Ensure that this key has not already been used in the + // list. Keyed YANG lists do not allow duplicate keys to + // be created. + if _, ok := t.Capability[key]; ok { + return nil, fmt.Errorf("duplicate key %v for list Capability", key) + } + + t.Capability[key] = &OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability{ + Name: Name, + } + + return t.Capability[key], nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability represents the /openconfig-lldp/lldp/interfaces/interface/neighbors/neighbor/capabilities/capability YANG schema element. +type OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability struct { + Config *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability_Config `path:"config" module:"openconfig-lldp"` + Name E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY `path:"name" module:"openconfig-lldp"` + State *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability_State `path:"state" module:"openconfig-lldp"` +} + +// IsYANGGoStruct ensures that OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability) IsYANGGoStruct() {} + +// ΛListKeyMap returns the keys of the OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability struct, which is a YANG list entry. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability) ΛListKeyMap() (map[string]interface{}, error) { + + return map[string]interface{}{ + "name": t.Name, + }, nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability_Config represents the /openconfig-lldp/lldp/interfaces/interface/neighbors/neighbor/capabilities/capability/config YANG schema element. +type OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability_Config struct { +} + +// IsYANGGoStruct ensures that OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability_State represents the /openconfig-lldp/lldp/interfaces/interface/neighbors/neighbor/capabilities/capability/state YANG schema element. +type OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability_State struct { + Enabled *bool `path:"enabled" module:"openconfig-lldp"` + Name E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY `path:"name" module:"openconfig-lldp"` +} + +// IsYANGGoStruct ensures that OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Capabilities_Capability_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Config represents the /openconfig-lldp/lldp/interfaces/interface/neighbors/neighbor/config YANG schema element. +type OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Config struct { +} + +// IsYANGGoStruct ensures that OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs represents the /openconfig-lldp/lldp/interfaces/interface/neighbors/neighbor/custom-tlvs YANG schema element. +type OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs struct { + Tlv map[OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv_Key]*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv `path:"tlv" module:"openconfig-lldp"` +} + +// IsYANGGoStruct ensures that OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs) IsYANGGoStruct() {} + +// OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv_Key represents the key for list Tlv of element /openconfig-lldp/lldp/interfaces/interface/neighbors/neighbor/custom-tlvs. +type OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv_Key struct { + Type int32 `path:"type"` + Oui string `path:"oui"` + OuiSubtype string `path:"oui-subtype"` +} + +// NewTlv creates a new entry in the Tlv list of the +// OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs struct. The keys of the list are populated from the input +// arguments. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs) NewTlv(Type int32, Oui string, OuiSubtype string) (*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv, error){ + + // Initialise the list within the receiver struct if it has not already been + // created. + if t.Tlv == nil { + t.Tlv = make(map[OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv_Key]*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv) + } + + key := OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv_Key{ + Type: Type, + Oui: Oui, + OuiSubtype: OuiSubtype, + } + + // Ensure that this key has not already been used in the + // list. Keyed YANG lists do not allow duplicate keys to + // be created. + if _, ok := t.Tlv[key]; ok { + return nil, fmt.Errorf("duplicate key %v for list Tlv", key) + } + + t.Tlv[key] = &OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv{ + Type: &Type, + Oui: &Oui, + OuiSubtype: &OuiSubtype, + } + + return t.Tlv[key], nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv represents the /openconfig-lldp/lldp/interfaces/interface/neighbors/neighbor/custom-tlvs/tlv YANG schema element. +type OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv struct { + Config *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv_Config `path:"config" module:"openconfig-lldp"` + Oui *string `path:"oui" module:"openconfig-lldp"` + OuiSubtype *string `path:"oui-subtype" module:"openconfig-lldp"` + State *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv_State `path:"state" module:"openconfig-lldp"` + Type *int32 `path:"type" module:"openconfig-lldp"` +} + +// IsYANGGoStruct ensures that OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv) IsYANGGoStruct() {} + +// ΛListKeyMap returns the keys of the OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv struct, which is a YANG list entry. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv) ΛListKeyMap() (map[string]interface{}, error) { + if t.Oui == nil { + return nil, fmt.Errorf("nil value for key Oui") + } + + if t.OuiSubtype == nil { + return nil, fmt.Errorf("nil value for key OuiSubtype") + } + + if t.Type == nil { + return nil, fmt.Errorf("nil value for key Type") + } + + return map[string]interface{}{ + "oui": *t.Oui, + "oui-subtype": *t.OuiSubtype, + "type": *t.Type, + }, nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv_Config represents the /openconfig-lldp/lldp/interfaces/interface/neighbors/neighbor/custom-tlvs/tlv/config YANG schema element. +type OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv_Config struct { +} + +// IsYANGGoStruct ensures that OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv_State represents the /openconfig-lldp/lldp/interfaces/interface/neighbors/neighbor/custom-tlvs/tlv/state YANG schema element. +type OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv_State struct { + Oui *string `path:"oui" module:"openconfig-lldp"` + OuiSubtype *string `path:"oui-subtype" module:"openconfig-lldp"` + Type *int32 `path:"type" module:"openconfig-lldp"` + Value Binary `path:"value" module:"openconfig-lldp"` +} + +// IsYANGGoStruct ensures that OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_CustomTlvs_Tlv_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_State represents the /openconfig-lldp/lldp/interfaces/interface/neighbors/neighbor/state YANG schema element. +type OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_State struct { + Age *uint64 `path:"age" module:"openconfig-lldp"` + ChassisId *string `path:"chassis-id" module:"openconfig-lldp"` + ChassisIdType E_OpenconfigLldp_ChassisIdType `path:"chassis-id-type" module:"openconfig-lldp"` + Id *string `path:"id" module:"openconfig-lldp"` + LastUpdate *int64 `path:"last-update" module:"openconfig-lldp"` + ManagementAddress *string `path:"management-address" module:"openconfig-lldp"` + ManagementAddressType *string `path:"management-address-type" module:"openconfig-lldp"` + PortDescription *string `path:"port-description" module:"openconfig-lldp"` + PortId *string `path:"port-id" module:"openconfig-lldp"` + PortIdType E_OpenconfigLldp_PortIdType `path:"port-id-type" module:"openconfig-lldp"` + SystemDescription *string `path:"system-description" module:"openconfig-lldp"` + SystemName *string `path:"system-name" module:"openconfig-lldp"` + Ttl *uint16 `path:"ttl" module:"openconfig-lldp"` +} + +// IsYANGGoStruct ensures that OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_Neighbors_Neighbor_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigLldp_Lldp_Interfaces_Interface_State represents the /openconfig-lldp/lldp/interfaces/interface/state YANG schema element. +type OpenconfigLldp_Lldp_Interfaces_Interface_State struct { + Counters *OpenconfigLldp_Lldp_Interfaces_Interface_State_Counters `path:"counters" module:"openconfig-lldp"` + Enabled *bool `path:"enabled" module:"openconfig-lldp"` + Name *string `path:"name" module:"openconfig-lldp"` +} + +// IsYANGGoStruct ensures that OpenconfigLldp_Lldp_Interfaces_Interface_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigLldp_Lldp_Interfaces_Interface_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigLldp_Lldp_Interfaces_Interface_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigLldp_Lldp_Interfaces_Interface_State_Counters represents the /openconfig-lldp/lldp/interfaces/interface/state/counters YANG schema element. +type OpenconfigLldp_Lldp_Interfaces_Interface_State_Counters struct { + FrameDiscard *uint64 `path:"frame-discard" module:"openconfig-lldp"` + FrameErrorIn *uint64 `path:"frame-error-in" module:"openconfig-lldp"` + FrameErrorOut *uint64 `path:"frame-error-out" module:"openconfig-lldp"` + FrameIn *uint64 `path:"frame-in" module:"openconfig-lldp"` + FrameOut *uint64 `path:"frame-out" module:"openconfig-lldp"` + LastClear *string `path:"last-clear" module:"openconfig-lldp"` + TlvDiscard *uint64 `path:"tlv-discard" module:"openconfig-lldp"` + TlvUnknown *uint64 `path:"tlv-unknown" module:"openconfig-lldp"` +} + +// IsYANGGoStruct ensures that OpenconfigLldp_Lldp_Interfaces_Interface_State_Counters implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigLldp_Lldp_Interfaces_Interface_State_Counters) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_State_Counters) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigLldp_Lldp_Interfaces_Interface_State_Counters"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigLldp_Lldp_Interfaces_Interface_State_Counters) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigLldp_Lldp_State represents the /openconfig-lldp/lldp/state YANG schema element. +type OpenconfigLldp_Lldp_State struct { + ChassisId *string `path:"chassis-id" module:"openconfig-lldp"` + ChassisIdType E_OpenconfigLldp_ChassisIdType `path:"chassis-id-type" module:"openconfig-lldp"` + Counters *OpenconfigLldp_Lldp_State_Counters `path:"counters" module:"openconfig-lldp"` + Enabled *bool `path:"enabled" module:"openconfig-lldp"` + HelloTimer *uint64 `path:"hello-timer" module:"openconfig-lldp"` + SuppressTlvAdvertisement []E_OpenconfigLldpTypes_LLDP_TLV `path:"suppress-tlv-advertisement" module:"openconfig-lldp"` + SystemDescription *string `path:"system-description" module:"openconfig-lldp"` + SystemName *string `path:"system-name" module:"openconfig-lldp"` +} + +// IsYANGGoStruct ensures that OpenconfigLldp_Lldp_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigLldp_Lldp_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigLldp_Lldp_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigLldp_Lldp_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigLldp_Lldp_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigLldp_Lldp_State_Counters represents the /openconfig-lldp/lldp/state/counters YANG schema element. +type OpenconfigLldp_Lldp_State_Counters struct { + EntriesAgedOut *uint64 `path:"entries-aged-out" module:"openconfig-lldp"` + FrameDiscard *uint64 `path:"frame-discard" module:"openconfig-lldp"` + FrameErrorIn *uint64 `path:"frame-error-in" module:"openconfig-lldp"` + FrameIn *uint64 `path:"frame-in" module:"openconfig-lldp"` + FrameOut *uint64 `path:"frame-out" module:"openconfig-lldp"` + LastClear *string `path:"last-clear" module:"openconfig-lldp"` + TlvAccepted *uint64 `path:"tlv-accepted" module:"openconfig-lldp"` + TlvDiscard *uint64 `path:"tlv-discard" module:"openconfig-lldp"` + TlvUnknown *uint64 `path:"tlv-unknown" module:"openconfig-lldp"` +} + +// IsYANGGoStruct ensures that OpenconfigLldp_Lldp_State_Counters implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigLldp_Lldp_State_Counters) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigLldp_Lldp_State_Counters) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigLldp_Lldp_State_Counters"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigLldp_Lldp_State_Counters) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components represents the /openconfig-platform/components YANG schema element. +type OpenconfigPlatform_Components struct { + Component map[string]*OpenconfigPlatform_Components_Component `path:"component" module:"openconfig-platform"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components) IsYANGGoStruct() {} + +// NewComponent creates a new entry in the Component list of the +// OpenconfigPlatform_Components struct. The keys of the list are populated from the input +// arguments. +func (t *OpenconfigPlatform_Components) NewComponent(Name string) (*OpenconfigPlatform_Components_Component, error){ + + // Initialise the list within the receiver struct if it has not already been + // created. + if t.Component == nil { + t.Component = make(map[string]*OpenconfigPlatform_Components_Component) + } + + key := Name + + // Ensure that this key has not already been used in the + // list. Keyed YANG lists do not allow duplicate keys to + // be created. + if _, ok := t.Component[key]; ok { + return nil, fmt.Errorf("duplicate key %v for list Component", key) + } + + t.Component[key] = &OpenconfigPlatform_Components_Component{ + Name: &Name, + } + + return t.Component[key], nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component represents the /openconfig-platform/components/component YANG schema element. +type OpenconfigPlatform_Components_Component struct { + Backplane *OpenconfigPlatform_Components_Component_Backplane `path:"backplane" module:"openconfig-platform"` + Chassis *OpenconfigPlatform_Components_Component_Chassis `path:"chassis" module:"openconfig-platform"` + Config *OpenconfigPlatform_Components_Component_Config `path:"config" module:"openconfig-platform"` + Cpu *OpenconfigPlatform_Components_Component_Cpu `path:"cpu" module:"openconfig-platform"` + Fabric *OpenconfigPlatform_Components_Component_Fabric `path:"fabric" module:"openconfig-platform"` + Fan *OpenconfigPlatform_Components_Component_Fan `path:"fan" module:"openconfig-platform"` + IntegratedCircuit *OpenconfigPlatform_Components_Component_IntegratedCircuit `path:"integrated-circuit" module:"openconfig-platform"` + Name *string `path:"name" module:"openconfig-platform"` + OpticalChannel *OpenconfigPlatform_Components_Component_OpticalChannel `path:"optical-channel" module:"openconfig-terminal-device"` + Port *OpenconfigPlatform_Components_Component_Port `path:"port" module:"openconfig-platform"` + PowerSupply *OpenconfigPlatform_Components_Component_PowerSupply `path:"power-supply" module:"openconfig-platform"` + Properties *OpenconfigPlatform_Components_Component_Properties `path:"properties" module:"openconfig-platform"` + State *OpenconfigPlatform_Components_Component_State `path:"state" module:"openconfig-platform"` + Storage *OpenconfigPlatform_Components_Component_Storage `path:"storage" module:"openconfig-platform"` + Subcomponents *OpenconfigPlatform_Components_Component_Subcomponents `path:"subcomponents" module:"openconfig-platform"` + Transceiver *OpenconfigPlatform_Components_Component_Transceiver `path:"transceiver" module:"openconfig-platform-transceiver"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component) IsYANGGoStruct() {} + +// ΛListKeyMap returns the keys of the OpenconfigPlatform_Components_Component struct, which is a YANG list entry. +func (t *OpenconfigPlatform_Components_Component) ΛListKeyMap() (map[string]interface{}, error) { + if t.Name == nil { + return nil, fmt.Errorf("nil value for key Name") + } + + return map[string]interface{}{ + "name": *t.Name, + }, nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Backplane represents the /openconfig-platform/components/component/backplane YANG schema element. +type OpenconfigPlatform_Components_Component_Backplane struct { + Config *OpenconfigPlatform_Components_Component_Backplane_Config `path:"config" module:"openconfig-platform"` + State *OpenconfigPlatform_Components_Component_Backplane_State `path:"state" module:"openconfig-platform"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Backplane implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Backplane) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Backplane) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Backplane"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Backplane) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Backplane_Config represents the /openconfig-platform/components/component/backplane/config YANG schema element. +type OpenconfigPlatform_Components_Component_Backplane_Config struct { +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Backplane_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Backplane_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Backplane_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Backplane_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Backplane_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Backplane_State represents the /openconfig-platform/components/component/backplane/state YANG schema element. +type OpenconfigPlatform_Components_Component_Backplane_State struct { +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Backplane_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Backplane_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Backplane_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Backplane_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Backplane_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Chassis represents the /openconfig-platform/components/component/chassis YANG schema element. +type OpenconfigPlatform_Components_Component_Chassis struct { + Config *OpenconfigPlatform_Components_Component_Chassis_Config `path:"config" module:"openconfig-platform"` + State *OpenconfigPlatform_Components_Component_Chassis_State `path:"state" module:"openconfig-platform"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Chassis implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Chassis) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Chassis) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Chassis"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Chassis) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Chassis_Config represents the /openconfig-platform/components/component/chassis/config YANG schema element. +type OpenconfigPlatform_Components_Component_Chassis_Config struct { +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Chassis_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Chassis_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Chassis_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Chassis_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Chassis_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Chassis_State represents the /openconfig-platform/components/component/chassis/state YANG schema element. +type OpenconfigPlatform_Components_Component_Chassis_State struct { +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Chassis_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Chassis_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Chassis_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Chassis_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Chassis_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Config represents the /openconfig-platform/components/component/config YANG schema element. +type OpenconfigPlatform_Components_Component_Config struct { + Name *string `path:"name" module:"openconfig-platform"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Cpu represents the /openconfig-platform/components/component/cpu YANG schema element. +type OpenconfigPlatform_Components_Component_Cpu struct { + Config *OpenconfigPlatform_Components_Component_Cpu_Config `path:"config" module:"openconfig-platform"` + State *OpenconfigPlatform_Components_Component_Cpu_State `path:"state" module:"openconfig-platform"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Cpu implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Cpu) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Cpu) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Cpu"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Cpu) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Cpu_Config represents the /openconfig-platform/components/component/cpu/config YANG schema element. +type OpenconfigPlatform_Components_Component_Cpu_Config struct { +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Cpu_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Cpu_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Cpu_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Cpu_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Cpu_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Cpu_State represents the /openconfig-platform/components/component/cpu/state YANG schema element. +type OpenconfigPlatform_Components_Component_Cpu_State struct { +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Cpu_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Cpu_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Cpu_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Cpu_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Cpu_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Fabric represents the /openconfig-platform/components/component/fabric YANG schema element. +type OpenconfigPlatform_Components_Component_Fabric struct { + Config *OpenconfigPlatform_Components_Component_Fabric_Config `path:"config" module:"openconfig-platform"` + State *OpenconfigPlatform_Components_Component_Fabric_State `path:"state" module:"openconfig-platform"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Fabric implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Fabric) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Fabric) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Fabric"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Fabric) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Fabric_Config represents the /openconfig-platform/components/component/fabric/config YANG schema element. +type OpenconfigPlatform_Components_Component_Fabric_Config struct { +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Fabric_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Fabric_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Fabric_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Fabric_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Fabric_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Fabric_State represents the /openconfig-platform/components/component/fabric/state YANG schema element. +type OpenconfigPlatform_Components_Component_Fabric_State struct { +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Fabric_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Fabric_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Fabric_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Fabric_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Fabric_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Fan represents the /openconfig-platform/components/component/fan YANG schema element. +type OpenconfigPlatform_Components_Component_Fan struct { + Config *OpenconfigPlatform_Components_Component_Fan_Config `path:"config" module:"openconfig-platform"` + State *OpenconfigPlatform_Components_Component_Fan_State `path:"state" module:"openconfig-platform"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Fan implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Fan) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Fan) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Fan"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Fan) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Fan_Config represents the /openconfig-platform/components/component/fan/config YANG schema element. +type OpenconfigPlatform_Components_Component_Fan_Config struct { +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Fan_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Fan_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Fan_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Fan_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Fan_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Fan_State represents the /openconfig-platform/components/component/fan/state YANG schema element. +type OpenconfigPlatform_Components_Component_Fan_State struct { +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Fan_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Fan_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Fan_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Fan_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Fan_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_IntegratedCircuit represents the /openconfig-platform/components/component/integrated-circuit YANG schema element. +type OpenconfigPlatform_Components_Component_IntegratedCircuit struct { + Config *OpenconfigPlatform_Components_Component_IntegratedCircuit_Config `path:"config" module:"openconfig-platform"` + State *OpenconfigPlatform_Components_Component_IntegratedCircuit_State `path:"state" module:"openconfig-platform"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_IntegratedCircuit implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_IntegratedCircuit) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_IntegratedCircuit) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_IntegratedCircuit"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_IntegratedCircuit) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_IntegratedCircuit_Config represents the /openconfig-platform/components/component/integrated-circuit/config YANG schema element. +type OpenconfigPlatform_Components_Component_IntegratedCircuit_Config struct { +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_IntegratedCircuit_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_IntegratedCircuit_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_IntegratedCircuit_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_IntegratedCircuit_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_IntegratedCircuit_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_IntegratedCircuit_State represents the /openconfig-platform/components/component/integrated-circuit/state YANG schema element. +type OpenconfigPlatform_Components_Component_IntegratedCircuit_State struct { +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_IntegratedCircuit_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_IntegratedCircuit_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_IntegratedCircuit_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_IntegratedCircuit_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_IntegratedCircuit_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_OpticalChannel represents the /openconfig-platform/components/component/optical-channel YANG schema element. +type OpenconfigPlatform_Components_Component_OpticalChannel struct { + Config *OpenconfigPlatform_Components_Component_OpticalChannel_Config `path:"config" module:"openconfig-terminal-device"` + State *OpenconfigPlatform_Components_Component_OpticalChannel_State `path:"state" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_OpticalChannel implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_OpticalChannel) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_OpticalChannel) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_OpticalChannel"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_OpticalChannel) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_OpticalChannel_Config represents the /openconfig-platform/components/component/optical-channel/config YANG schema element. +type OpenconfigPlatform_Components_Component_OpticalChannel_Config struct { + Frequency *uint64 `path:"frequency" module:"openconfig-terminal-device"` + LinePort *string `path:"line-port" module:"openconfig-terminal-device"` + OperationalMode *uint16 `path:"operational-mode" module:"openconfig-terminal-device"` + TargetOutputPower *float64 `path:"target-output-power" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_OpticalChannel_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_OpticalChannel_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_OpticalChannel_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_OpticalChannel_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_OpticalChannel_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_OpticalChannel_State represents the /openconfig-platform/components/component/optical-channel/state YANG schema element. +type OpenconfigPlatform_Components_Component_OpticalChannel_State struct { + ChromaticDispersion *OpenconfigPlatform_Components_Component_OpticalChannel_State_ChromaticDispersion `path:"chromatic-dispersion" module:"openconfig-terminal-device"` + Frequency *uint64 `path:"frequency" module:"openconfig-terminal-device"` + GroupId *uint32 `path:"group-id" module:"openconfig-terminal-device"` + InputPower *OpenconfigPlatform_Components_Component_OpticalChannel_State_InputPower `path:"input-power" module:"openconfig-terminal-device"` + LaserBiasCurrent *OpenconfigPlatform_Components_Component_OpticalChannel_State_LaserBiasCurrent `path:"laser-bias-current" module:"openconfig-terminal-device"` + LinePort *string `path:"line-port" module:"openconfig-terminal-device"` + OperationalMode *uint16 `path:"operational-mode" module:"openconfig-terminal-device"` + OutputPower *OpenconfigPlatform_Components_Component_OpticalChannel_State_OutputPower `path:"output-power" module:"openconfig-terminal-device"` + PolarizationDependentLoss *OpenconfigPlatform_Components_Component_OpticalChannel_State_PolarizationDependentLoss `path:"polarization-dependent-loss" module:"openconfig-terminal-device"` + PolarizationModeDispersion *OpenconfigPlatform_Components_Component_OpticalChannel_State_PolarizationModeDispersion `path:"polarization-mode-dispersion" module:"openconfig-terminal-device"` + SecondOrderPolarizationModeDispersion *OpenconfigPlatform_Components_Component_OpticalChannel_State_SecondOrderPolarizationModeDispersion `path:"second-order-polarization-mode-dispersion" module:"openconfig-terminal-device"` + TargetOutputPower *float64 `path:"target-output-power" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_OpticalChannel_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_OpticalChannel_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_OpticalChannel_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_OpticalChannel_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_OpticalChannel_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_OpticalChannel_State_ChromaticDispersion represents the /openconfig-platform/components/component/optical-channel/state/chromatic-dispersion YANG schema element. +type OpenconfigPlatform_Components_Component_OpticalChannel_State_ChromaticDispersion struct { + Avg *float64 `path:"avg" module:"openconfig-terminal-device"` + Instant *float64 `path:"instant" module:"openconfig-terminal-device"` + Interval *uint64 `path:"interval" module:"openconfig-terminal-device"` + Max *float64 `path:"max" module:"openconfig-terminal-device"` + MaxTime *uint64 `path:"max-time" module:"openconfig-terminal-device"` + Min *float64 `path:"min" module:"openconfig-terminal-device"` + MinTime *uint64 `path:"min-time" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_OpticalChannel_State_ChromaticDispersion implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_OpticalChannel_State_ChromaticDispersion) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_OpticalChannel_State_ChromaticDispersion) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_OpticalChannel_State_ChromaticDispersion"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_OpticalChannel_State_ChromaticDispersion) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_OpticalChannel_State_InputPower represents the /openconfig-platform/components/component/optical-channel/state/input-power YANG schema element. +type OpenconfigPlatform_Components_Component_OpticalChannel_State_InputPower struct { + Avg *float64 `path:"avg" module:"openconfig-terminal-device"` + Instant *float64 `path:"instant" module:"openconfig-terminal-device"` + Interval *uint64 `path:"interval" module:"openconfig-terminal-device"` + Max *float64 `path:"max" module:"openconfig-terminal-device"` + MaxTime *uint64 `path:"max-time" module:"openconfig-terminal-device"` + Min *float64 `path:"min" module:"openconfig-terminal-device"` + MinTime *uint64 `path:"min-time" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_OpticalChannel_State_InputPower implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_OpticalChannel_State_InputPower) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_OpticalChannel_State_InputPower) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_OpticalChannel_State_InputPower"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_OpticalChannel_State_InputPower) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_OpticalChannel_State_LaserBiasCurrent represents the /openconfig-platform/components/component/optical-channel/state/laser-bias-current YANG schema element. +type OpenconfigPlatform_Components_Component_OpticalChannel_State_LaserBiasCurrent struct { + Avg *float64 `path:"avg" module:"openconfig-terminal-device"` + Instant *float64 `path:"instant" module:"openconfig-terminal-device"` + Interval *uint64 `path:"interval" module:"openconfig-terminal-device"` + Max *float64 `path:"max" module:"openconfig-terminal-device"` + MaxTime *uint64 `path:"max-time" module:"openconfig-terminal-device"` + Min *float64 `path:"min" module:"openconfig-terminal-device"` + MinTime *uint64 `path:"min-time" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_OpticalChannel_State_LaserBiasCurrent implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_OpticalChannel_State_LaserBiasCurrent) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_OpticalChannel_State_LaserBiasCurrent) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_OpticalChannel_State_LaserBiasCurrent"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_OpticalChannel_State_LaserBiasCurrent) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_OpticalChannel_State_OutputPower represents the /openconfig-platform/components/component/optical-channel/state/output-power YANG schema element. +type OpenconfigPlatform_Components_Component_OpticalChannel_State_OutputPower struct { + Avg *float64 `path:"avg" module:"openconfig-terminal-device"` + Instant *float64 `path:"instant" module:"openconfig-terminal-device"` + Interval *uint64 `path:"interval" module:"openconfig-terminal-device"` + Max *float64 `path:"max" module:"openconfig-terminal-device"` + MaxTime *uint64 `path:"max-time" module:"openconfig-terminal-device"` + Min *float64 `path:"min" module:"openconfig-terminal-device"` + MinTime *uint64 `path:"min-time" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_OpticalChannel_State_OutputPower implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_OpticalChannel_State_OutputPower) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_OpticalChannel_State_OutputPower) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_OpticalChannel_State_OutputPower"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_OpticalChannel_State_OutputPower) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_OpticalChannel_State_PolarizationDependentLoss represents the /openconfig-platform/components/component/optical-channel/state/polarization-dependent-loss YANG schema element. +type OpenconfigPlatform_Components_Component_OpticalChannel_State_PolarizationDependentLoss struct { + Avg *float64 `path:"avg" module:"openconfig-terminal-device"` + Instant *float64 `path:"instant" module:"openconfig-terminal-device"` + Interval *uint64 `path:"interval" module:"openconfig-terminal-device"` + Max *float64 `path:"max" module:"openconfig-terminal-device"` + MaxTime *uint64 `path:"max-time" module:"openconfig-terminal-device"` + Min *float64 `path:"min" module:"openconfig-terminal-device"` + MinTime *uint64 `path:"min-time" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_OpticalChannel_State_PolarizationDependentLoss implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_OpticalChannel_State_PolarizationDependentLoss) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_OpticalChannel_State_PolarizationDependentLoss) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_OpticalChannel_State_PolarizationDependentLoss"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_OpticalChannel_State_PolarizationDependentLoss) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_OpticalChannel_State_PolarizationModeDispersion represents the /openconfig-platform/components/component/optical-channel/state/polarization-mode-dispersion YANG schema element. +type OpenconfigPlatform_Components_Component_OpticalChannel_State_PolarizationModeDispersion struct { + Avg *float64 `path:"avg" module:"openconfig-terminal-device"` + Instant *float64 `path:"instant" module:"openconfig-terminal-device"` + Interval *uint64 `path:"interval" module:"openconfig-terminal-device"` + Max *float64 `path:"max" module:"openconfig-terminal-device"` + MaxTime *uint64 `path:"max-time" module:"openconfig-terminal-device"` + Min *float64 `path:"min" module:"openconfig-terminal-device"` + MinTime *uint64 `path:"min-time" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_OpticalChannel_State_PolarizationModeDispersion implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_OpticalChannel_State_PolarizationModeDispersion) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_OpticalChannel_State_PolarizationModeDispersion) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_OpticalChannel_State_PolarizationModeDispersion"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_OpticalChannel_State_PolarizationModeDispersion) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_OpticalChannel_State_SecondOrderPolarizationModeDispersion represents the /openconfig-platform/components/component/optical-channel/state/second-order-polarization-mode-dispersion YANG schema element. +type OpenconfigPlatform_Components_Component_OpticalChannel_State_SecondOrderPolarizationModeDispersion struct { + Avg *float64 `path:"avg" module:"openconfig-terminal-device"` + Instant *float64 `path:"instant" module:"openconfig-terminal-device"` + Interval *uint64 `path:"interval" module:"openconfig-terminal-device"` + Max *float64 `path:"max" module:"openconfig-terminal-device"` + MaxTime *uint64 `path:"max-time" module:"openconfig-terminal-device"` + Min *float64 `path:"min" module:"openconfig-terminal-device"` + MinTime *uint64 `path:"min-time" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_OpticalChannel_State_SecondOrderPolarizationModeDispersion implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_OpticalChannel_State_SecondOrderPolarizationModeDispersion) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_OpticalChannel_State_SecondOrderPolarizationModeDispersion) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_OpticalChannel_State_SecondOrderPolarizationModeDispersion"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_OpticalChannel_State_SecondOrderPolarizationModeDispersion) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Port represents the /openconfig-platform/components/component/port YANG schema element. +type OpenconfigPlatform_Components_Component_Port struct { + BreakoutMode *OpenconfigPlatform_Components_Component_Port_BreakoutMode `path:"breakout-mode" module:"openconfig-platform-port"` + Config *OpenconfigPlatform_Components_Component_Port_Config `path:"config" module:"openconfig-platform"` + State *OpenconfigPlatform_Components_Component_Port_State `path:"state" module:"openconfig-platform"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Port implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Port) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Port) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Port"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Port) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Port_BreakoutMode represents the /openconfig-platform/components/component/port/breakout-mode YANG schema element. +type OpenconfigPlatform_Components_Component_Port_BreakoutMode struct { + Config *OpenconfigPlatform_Components_Component_Port_BreakoutMode_Config `path:"config" module:"openconfig-platform-port"` + State *OpenconfigPlatform_Components_Component_Port_BreakoutMode_State `path:"state" module:"openconfig-platform-port"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Port_BreakoutMode implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Port_BreakoutMode) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Port_BreakoutMode) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Port_BreakoutMode"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Port_BreakoutMode) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Port_BreakoutMode_Config represents the /openconfig-platform/components/component/port/breakout-mode/config YANG schema element. +type OpenconfigPlatform_Components_Component_Port_BreakoutMode_Config struct { + ChannelSpeed E_OpenconfigIfEthernet_ETHERNET_SPEED `path:"channel-speed" module:"openconfig-platform-port"` + NumChannels *uint8 `path:"num-channels" module:"openconfig-platform-port"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Port_BreakoutMode_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Port_BreakoutMode_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Port_BreakoutMode_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Port_BreakoutMode_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Port_BreakoutMode_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Port_BreakoutMode_State represents the /openconfig-platform/components/component/port/breakout-mode/state YANG schema element. +type OpenconfigPlatform_Components_Component_Port_BreakoutMode_State struct { + ChannelSpeed E_OpenconfigIfEthernet_ETHERNET_SPEED `path:"channel-speed" module:"openconfig-platform-port"` + NumChannels *uint8 `path:"num-channels" module:"openconfig-platform-port"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Port_BreakoutMode_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Port_BreakoutMode_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Port_BreakoutMode_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Port_BreakoutMode_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Port_BreakoutMode_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Port_Config represents the /openconfig-platform/components/component/port/config YANG schema element. +type OpenconfigPlatform_Components_Component_Port_Config struct { +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Port_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Port_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Port_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Port_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Port_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Port_State represents the /openconfig-platform/components/component/port/state YANG schema element. +type OpenconfigPlatform_Components_Component_Port_State struct { +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Port_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Port_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Port_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Port_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Port_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_PowerSupply represents the /openconfig-platform/components/component/power-supply YANG schema element. +type OpenconfigPlatform_Components_Component_PowerSupply struct { + Config *OpenconfigPlatform_Components_Component_PowerSupply_Config `path:"config" module:"openconfig-platform"` + State *OpenconfigPlatform_Components_Component_PowerSupply_State `path:"state" module:"openconfig-platform"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_PowerSupply implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_PowerSupply) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_PowerSupply) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_PowerSupply"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_PowerSupply) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_PowerSupply_Config represents the /openconfig-platform/components/component/power-supply/config YANG schema element. +type OpenconfigPlatform_Components_Component_PowerSupply_Config struct { +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_PowerSupply_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_PowerSupply_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_PowerSupply_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_PowerSupply_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_PowerSupply_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_PowerSupply_State represents the /openconfig-platform/components/component/power-supply/state YANG schema element. +type OpenconfigPlatform_Components_Component_PowerSupply_State struct { +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_PowerSupply_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_PowerSupply_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_PowerSupply_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_PowerSupply_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_PowerSupply_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Properties represents the /openconfig-platform/components/component/properties YANG schema element. +type OpenconfigPlatform_Components_Component_Properties struct { + Property map[string]*OpenconfigPlatform_Components_Component_Properties_Property `path:"property" module:"openconfig-platform"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Properties implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Properties) IsYANGGoStruct() {} + +// NewProperty creates a new entry in the Property list of the +// OpenconfigPlatform_Components_Component_Properties struct. The keys of the list are populated from the input +// arguments. +func (t *OpenconfigPlatform_Components_Component_Properties) NewProperty(Name string) (*OpenconfigPlatform_Components_Component_Properties_Property, error){ + + // Initialise the list within the receiver struct if it has not already been + // created. + if t.Property == nil { + t.Property = make(map[string]*OpenconfigPlatform_Components_Component_Properties_Property) + } + + key := Name + + // Ensure that this key has not already been used in the + // list. Keyed YANG lists do not allow duplicate keys to + // be created. + if _, ok := t.Property[key]; ok { + return nil, fmt.Errorf("duplicate key %v for list Property", key) + } + + t.Property[key] = &OpenconfigPlatform_Components_Component_Properties_Property{ + Name: &Name, + } + + return t.Property[key], nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Properties) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Properties"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Properties) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Properties_Property represents the /openconfig-platform/components/component/properties/property YANG schema element. +type OpenconfigPlatform_Components_Component_Properties_Property struct { + Config *OpenconfigPlatform_Components_Component_Properties_Property_Config `path:"config" module:"openconfig-platform"` + Name *string `path:"name" module:"openconfig-platform"` + State *OpenconfigPlatform_Components_Component_Properties_Property_State `path:"state" module:"openconfig-platform"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Properties_Property implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Properties_Property) IsYANGGoStruct() {} + +// ΛListKeyMap returns the keys of the OpenconfigPlatform_Components_Component_Properties_Property struct, which is a YANG list entry. +func (t *OpenconfigPlatform_Components_Component_Properties_Property) ΛListKeyMap() (map[string]interface{}, error) { + if t.Name == nil { + return nil, fmt.Errorf("nil value for key Name") + } + + return map[string]interface{}{ + "name": *t.Name, + }, nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Properties_Property) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Properties_Property"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Properties_Property) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Properties_Property_Config represents the /openconfig-platform/components/component/properties/property/config YANG schema element. +type OpenconfigPlatform_Components_Component_Properties_Property_Config struct { + Name *string `path:"name" module:"openconfig-platform"` + Value OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union `path:"value" module:"openconfig-platform"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Properties_Property_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Properties_Property_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Properties_Property_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Properties_Property_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Properties_Property_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + +// OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union is an interface that is implemented by valid types for the union +// for the leaf /openconfig-platform/components/component/properties/property/config/value within the YANG schema. +type OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union interface { + Is_OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union() +} + +// OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_Bool is used when /openconfig-platform/components/component/properties/property/config/value +// is to be set to a bool value. +type OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_Bool struct { + Bool bool +} + +// Is_OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union ensures that OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_Bool +// implements the OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union interface. +func (*OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_Bool) Is_OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union() {} + +// OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_Float64 is used when /openconfig-platform/components/component/properties/property/config/value +// is to be set to a float64 value. +type OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_Float64 struct { + Float64 float64 +} + +// Is_OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union ensures that OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_Float64 +// implements the OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union interface. +func (*OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_Float64) Is_OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union() {} + +// OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_Int64 is used when /openconfig-platform/components/component/properties/property/config/value +// is to be set to a int64 value. +type OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_Int64 struct { + Int64 int64 +} + +// Is_OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union ensures that OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_Int64 +// implements the OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union interface. +func (*OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_Int64) Is_OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union() {} + +// OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_String is used when /openconfig-platform/components/component/properties/property/config/value +// is to be set to a string value. +type OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_String struct { + String string +} + +// Is_OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union ensures that OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_String +// implements the OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union interface. +func (*OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_String) Is_OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union() {} + +// OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_Uint64 is used when /openconfig-platform/components/component/properties/property/config/value +// is to be set to a uint64 value. +type OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_Uint64 struct { + Uint64 uint64 +} + +// Is_OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union ensures that OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_Uint64 +// implements the OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union interface. +func (*OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_Uint64) Is_OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union() {} + +// To_OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union takes an input interface{} and attempts to convert it to a struct +// which implements the OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union union. It returns an error if the interface{} supplied +// cannot be converted to a type within the union. +func (t *OpenconfigPlatform_Components_Component_Properties_Property_Config) To_OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union(i interface{}) (OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union, error) { + switch v := i.(type) { + case bool: + return &OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_Bool{v}, nil + case float64: + return &OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_Float64{v}, nil + case int64: + return &OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_Int64{v}, nil + case string: + return &OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_String{v}, nil + case uint64: + return &OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union_Uint64{v}, nil + default: + return nil, fmt.Errorf("cannot convert %v to OpenconfigPlatform_Components_Component_Properties_Property_Config_Value_Union, unknown union type, got: %T, want any of [bool, float64, int64, string, uint64]", i, i) + } +} + + +// OpenconfigPlatform_Components_Component_Properties_Property_State represents the /openconfig-platform/components/component/properties/property/state YANG schema element. +type OpenconfigPlatform_Components_Component_Properties_Property_State struct { + Configurable *bool `path:"configurable" module:"openconfig-platform"` + Name *string `path:"name" module:"openconfig-platform"` + Value OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union `path:"value" module:"openconfig-platform"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Properties_Property_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Properties_Property_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Properties_Property_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Properties_Property_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Properties_Property_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + +// OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union is an interface that is implemented by valid types for the union +// for the leaf /openconfig-platform/components/component/properties/property/state/value within the YANG schema. +type OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union interface { + Is_OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union() +} + +// OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_Bool is used when /openconfig-platform/components/component/properties/property/state/value +// is to be set to a bool value. +type OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_Bool struct { + Bool bool +} + +// Is_OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union ensures that OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_Bool +// implements the OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union interface. +func (*OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_Bool) Is_OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union() {} + +// OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_Float64 is used when /openconfig-platform/components/component/properties/property/state/value +// is to be set to a float64 value. +type OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_Float64 struct { + Float64 float64 +} + +// Is_OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union ensures that OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_Float64 +// implements the OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union interface. +func (*OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_Float64) Is_OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union() {} + +// OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_Int64 is used when /openconfig-platform/components/component/properties/property/state/value +// is to be set to a int64 value. +type OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_Int64 struct { + Int64 int64 +} + +// Is_OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union ensures that OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_Int64 +// implements the OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union interface. +func (*OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_Int64) Is_OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union() {} + +// OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_String is used when /openconfig-platform/components/component/properties/property/state/value +// is to be set to a string value. +type OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_String struct { + String string +} + +// Is_OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union ensures that OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_String +// implements the OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union interface. +func (*OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_String) Is_OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union() {} + +// OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_Uint64 is used when /openconfig-platform/components/component/properties/property/state/value +// is to be set to a uint64 value. +type OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_Uint64 struct { + Uint64 uint64 +} + +// Is_OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union ensures that OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_Uint64 +// implements the OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union interface. +func (*OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_Uint64) Is_OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union() {} + +// To_OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union takes an input interface{} and attempts to convert it to a struct +// which implements the OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union union. It returns an error if the interface{} supplied +// cannot be converted to a type within the union. +func (t *OpenconfigPlatform_Components_Component_Properties_Property_State) To_OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union(i interface{}) (OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union, error) { + switch v := i.(type) { + case bool: + return &OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_Bool{v}, nil + case float64: + return &OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_Float64{v}, nil + case int64: + return &OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_Int64{v}, nil + case string: + return &OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_String{v}, nil + case uint64: + return &OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union_Uint64{v}, nil + default: + return nil, fmt.Errorf("cannot convert %v to OpenconfigPlatform_Components_Component_Properties_Property_State_Value_Union, unknown union type, got: %T, want any of [bool, float64, int64, string, uint64]", i, i) + } +} + + +// OpenconfigPlatform_Components_Component_State represents the /openconfig-platform/components/component/state YANG schema element. +type OpenconfigPlatform_Components_Component_State struct { + AllocatedPower *uint32 `path:"allocated-power" module:"openconfig-platform"` + Description *string `path:"description" module:"openconfig-platform"` + Empty *bool `path:"empty" module:"openconfig-platform"` + FirmwareVersion *string `path:"firmware-version" module:"openconfig-platform"` + HardwareVersion *string `path:"hardware-version" module:"openconfig-platform"` + Id *string `path:"id" module:"openconfig-platform"` + Location *string `path:"location" module:"openconfig-platform"` + Memory *OpenconfigPlatform_Components_Component_State_Memory `path:"memory" module:"openconfig-platform"` + MfgDate *string `path:"mfg-date" module:"openconfig-platform"` + MfgName *string `path:"mfg-name" module:"openconfig-platform"` + Name *string `path:"name" module:"openconfig-platform"` + OperStatus E_OpenconfigPlatformTypes_COMPONENT_OPER_STATUS `path:"oper-status" module:"openconfig-platform"` + Parent *string `path:"parent" module:"openconfig-platform"` + PartNo *string `path:"part-no" module:"openconfig-platform"` + Removable *bool `path:"removable" module:"openconfig-platform"` + SerialNo *string `path:"serial-no" module:"openconfig-platform"` + SoftwareVersion *string `path:"software-version" module:"openconfig-platform"` + Temperature *OpenconfigPlatform_Components_Component_State_Temperature `path:"temperature" module:"openconfig-platform"` + Type OpenconfigPlatform_Components_Component_State_Type_Union `path:"type" module:"openconfig-platform"` + UsedPower *uint32 `path:"used-power" module:"openconfig-platform"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + +// OpenconfigPlatform_Components_Component_State_Type_Union is an interface that is implemented by valid types for the union +// for the leaf /openconfig-platform/components/component/state/type within the YANG schema. +type OpenconfigPlatform_Components_Component_State_Type_Union interface { + Is_OpenconfigPlatform_Components_Component_State_Type_Union() +} + +// OpenconfigPlatform_Components_Component_State_Type_Union_E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT is used when /openconfig-platform/components/component/state/type +// is to be set to a E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT value. +type OpenconfigPlatform_Components_Component_State_Type_Union_E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT struct { + E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT +} + +// Is_OpenconfigPlatform_Components_Component_State_Type_Union ensures that OpenconfigPlatform_Components_Component_State_Type_Union_E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT +// implements the OpenconfigPlatform_Components_Component_State_Type_Union interface. +func (*OpenconfigPlatform_Components_Component_State_Type_Union_E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT) Is_OpenconfigPlatform_Components_Component_State_Type_Union() {} + +// OpenconfigPlatform_Components_Component_State_Type_Union_E_OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT is used when /openconfig-platform/components/component/state/type +// is to be set to a E_OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT value. +type OpenconfigPlatform_Components_Component_State_Type_Union_E_OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT struct { + E_OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT E_OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT +} + +// Is_OpenconfigPlatform_Components_Component_State_Type_Union ensures that OpenconfigPlatform_Components_Component_State_Type_Union_E_OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT +// implements the OpenconfigPlatform_Components_Component_State_Type_Union interface. +func (*OpenconfigPlatform_Components_Component_State_Type_Union_E_OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT) Is_OpenconfigPlatform_Components_Component_State_Type_Union() {} + +// To_OpenconfigPlatform_Components_Component_State_Type_Union takes an input interface{} and attempts to convert it to a struct +// which implements the OpenconfigPlatform_Components_Component_State_Type_Union union. It returns an error if the interface{} supplied +// cannot be converted to a type within the union. +func (t *OpenconfigPlatform_Components_Component_State) To_OpenconfigPlatform_Components_Component_State_Type_Union(i interface{}) (OpenconfigPlatform_Components_Component_State_Type_Union, error) { + switch v := i.(type) { + case E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT: + return &OpenconfigPlatform_Components_Component_State_Type_Union_E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT{v}, nil + case E_OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT: + return &OpenconfigPlatform_Components_Component_State_Type_Union_E_OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT{v}, nil + default: + return nil, fmt.Errorf("cannot convert %v to OpenconfigPlatform_Components_Component_State_Type_Union, unknown union type, got: %T, want any of [E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT, E_OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT]", i, i) + } +} + + +// OpenconfigPlatform_Components_Component_State_Memory represents the /openconfig-platform/components/component/state/memory YANG schema element. +type OpenconfigPlatform_Components_Component_State_Memory struct { + Available *uint64 `path:"available" module:"openconfig-platform"` + Utilized *uint64 `path:"utilized" module:"openconfig-platform"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_State_Memory implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_State_Memory) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_State_Memory) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_State_Memory"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_State_Memory) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_State_Temperature represents the /openconfig-platform/components/component/state/temperature YANG schema element. +type OpenconfigPlatform_Components_Component_State_Temperature struct { + AlarmSeverity E_OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY `path:"alarm-severity" module:"openconfig-platform"` + AlarmStatus *bool `path:"alarm-status" module:"openconfig-platform"` + AlarmThreshold *uint32 `path:"alarm-threshold" module:"openconfig-platform"` + Avg *float64 `path:"avg" module:"openconfig-platform"` + Instant *float64 `path:"instant" module:"openconfig-platform"` + Interval *uint64 `path:"interval" module:"openconfig-platform"` + Max *float64 `path:"max" module:"openconfig-platform"` + MaxTime *uint64 `path:"max-time" module:"openconfig-platform"` + Min *float64 `path:"min" module:"openconfig-platform"` + MinTime *uint64 `path:"min-time" module:"openconfig-platform"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_State_Temperature implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_State_Temperature) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_State_Temperature) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_State_Temperature"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_State_Temperature) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Storage represents the /openconfig-platform/components/component/storage YANG schema element. +type OpenconfigPlatform_Components_Component_Storage struct { + Config *OpenconfigPlatform_Components_Component_Storage_Config `path:"config" module:"openconfig-platform"` + State *OpenconfigPlatform_Components_Component_Storage_State `path:"state" module:"openconfig-platform"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Storage implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Storage) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Storage) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Storage"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Storage) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Storage_Config represents the /openconfig-platform/components/component/storage/config YANG schema element. +type OpenconfigPlatform_Components_Component_Storage_Config struct { +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Storage_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Storage_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Storage_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Storage_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Storage_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Storage_State represents the /openconfig-platform/components/component/storage/state YANG schema element. +type OpenconfigPlatform_Components_Component_Storage_State struct { +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Storage_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Storage_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Storage_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Storage_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Storage_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Subcomponents represents the /openconfig-platform/components/component/subcomponents YANG schema element. +type OpenconfigPlatform_Components_Component_Subcomponents struct { + Subcomponent map[string]*OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent `path:"subcomponent" module:"openconfig-platform"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Subcomponents implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Subcomponents) IsYANGGoStruct() {} + +// NewSubcomponent creates a new entry in the Subcomponent list of the +// OpenconfigPlatform_Components_Component_Subcomponents struct. The keys of the list are populated from the input +// arguments. +func (t *OpenconfigPlatform_Components_Component_Subcomponents) NewSubcomponent(Name string) (*OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent, error){ + + // Initialise the list within the receiver struct if it has not already been + // created. + if t.Subcomponent == nil { + t.Subcomponent = make(map[string]*OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent) + } + + key := Name + + // Ensure that this key has not already been used in the + // list. Keyed YANG lists do not allow duplicate keys to + // be created. + if _, ok := t.Subcomponent[key]; ok { + return nil, fmt.Errorf("duplicate key %v for list Subcomponent", key) + } + + t.Subcomponent[key] = &OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent{ + Name: &Name, + } + + return t.Subcomponent[key], nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Subcomponents) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Subcomponents"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Subcomponents) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent represents the /openconfig-platform/components/component/subcomponents/subcomponent YANG schema element. +type OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent struct { + Config *OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent_Config `path:"config" module:"openconfig-platform"` + Name *string `path:"name" module:"openconfig-platform"` + State *OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent_State `path:"state" module:"openconfig-platform"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent) IsYANGGoStruct() {} + +// ΛListKeyMap returns the keys of the OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent struct, which is a YANG list entry. +func (t *OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent) ΛListKeyMap() (map[string]interface{}, error) { + if t.Name == nil { + return nil, fmt.Errorf("nil value for key Name") + } + + return map[string]interface{}{ + "name": *t.Name, + }, nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent_Config represents the /openconfig-platform/components/component/subcomponents/subcomponent/config YANG schema element. +type OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent_Config struct { + Name *string `path:"name" module:"openconfig-platform"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent_State represents the /openconfig-platform/components/component/subcomponents/subcomponent/state YANG schema element. +type OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent_State struct { + Name *string `path:"name" module:"openconfig-platform"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Subcomponents_Subcomponent_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Transceiver represents the /openconfig-platform/components/component/transceiver YANG schema element. +type OpenconfigPlatform_Components_Component_Transceiver struct { + Config *OpenconfigPlatform_Components_Component_Transceiver_Config `path:"config" module:"openconfig-platform-transceiver"` + PhysicalChannels *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels `path:"physical-channels" module:"openconfig-platform-transceiver"` + State *OpenconfigPlatform_Components_Component_Transceiver_State `path:"state" module:"openconfig-platform-transceiver"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Transceiver implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Transceiver) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Transceiver) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Transceiver"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Transceiver) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Transceiver_Config represents the /openconfig-platform/components/component/transceiver/config YANG schema element. +type OpenconfigPlatform_Components_Component_Transceiver_Config struct { + Enabled *bool `path:"enabled" module:"openconfig-platform-transceiver"` + EthernetPmdPreconf E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE `path:"ethernet-pmd-preconf" module:"openconfig-platform-transceiver"` + FecMode E_OpenconfigPlatformTypes_FEC_MODE_TYPE `path:"fec-mode" module:"openconfig-platform-transceiver"` + FormFactorPreconf E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE `path:"form-factor-preconf" module:"openconfig-platform-transceiver"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Transceiver_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Transceiver_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Transceiver_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Transceiver_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Transceiver_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels represents the /openconfig-platform/components/component/transceiver/physical-channels YANG schema element. +type OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels struct { + Channel map[uint16]*OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel `path:"channel" module:"openconfig-platform-transceiver"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels) IsYANGGoStruct() {} + +// NewChannel creates a new entry in the Channel list of the +// OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels struct. The keys of the list are populated from the input +// arguments. +func (t *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels) NewChannel(Index uint16) (*OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel, error){ + + // Initialise the list within the receiver struct if it has not already been + // created. + if t.Channel == nil { + t.Channel = make(map[uint16]*OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel) + } + + key := Index + + // Ensure that this key has not already been used in the + // list. Keyed YANG lists do not allow duplicate keys to + // be created. + if _, ok := t.Channel[key]; ok { + return nil, fmt.Errorf("duplicate key %v for list Channel", key) + } + + t.Channel[key] = &OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel{ + Index: &Index, + } + + return t.Channel[key], nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel represents the /openconfig-platform/components/component/transceiver/physical-channels/channel YANG schema element. +type OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel struct { + Config *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_Config `path:"config" module:"openconfig-platform-transceiver"` + Index *uint16 `path:"index" module:"openconfig-platform-transceiver"` + State *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State `path:"state" module:"openconfig-platform-transceiver"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel) IsYANGGoStruct() {} + +// ΛListKeyMap returns the keys of the OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel struct, which is a YANG list entry. +func (t *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel) ΛListKeyMap() (map[string]interface{}, error) { + if t.Index == nil { + return nil, fmt.Errorf("nil value for key Index") + } + + return map[string]interface{}{ + "index": *t.Index, + }, nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_Config represents the /openconfig-platform/components/component/transceiver/physical-channels/channel/config YANG schema element. +type OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_Config struct { + Description *string `path:"description" module:"openconfig-platform-transceiver"` + Index *uint16 `path:"index" module:"openconfig-platform-transceiver"` + TargetOutputPower *float64 `path:"target-output-power" module:"openconfig-platform-transceiver"` + TxLaser *bool `path:"tx-laser" module:"openconfig-platform-transceiver"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State represents the /openconfig-platform/components/component/transceiver/physical-channels/channel/state YANG schema element. +type OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State struct { + Description *string `path:"description" module:"openconfig-platform-transceiver"` + Index *uint16 `path:"index" module:"openconfig-platform-transceiver"` + InputPower *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_InputPower `path:"input-power" module:"openconfig-platform-transceiver"` + LaserBiasCurrent *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_LaserBiasCurrent `path:"laser-bias-current" module:"openconfig-platform-transceiver"` + OutputFrequency *uint64 `path:"output-frequency" module:"openconfig-platform-transceiver"` + OutputPower *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_OutputPower `path:"output-power" module:"openconfig-platform-transceiver"` + TargetOutputPower *float64 `path:"target-output-power" module:"openconfig-platform-transceiver"` + TxLaser *bool `path:"tx-laser" module:"openconfig-platform-transceiver"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_InputPower represents the /openconfig-platform/components/component/transceiver/physical-channels/channel/state/input-power YANG schema element. +type OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_InputPower struct { + Avg *float64 `path:"avg" module:"openconfig-platform-transceiver"` + Instant *float64 `path:"instant" module:"openconfig-platform-transceiver"` + Interval *uint64 `path:"interval" module:"openconfig-platform-transceiver"` + Max *float64 `path:"max" module:"openconfig-platform-transceiver"` + MaxTime *uint64 `path:"max-time" module:"openconfig-platform-transceiver"` + Min *float64 `path:"min" module:"openconfig-platform-transceiver"` + MinTime *uint64 `path:"min-time" module:"openconfig-platform-transceiver"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_InputPower implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_InputPower) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_InputPower) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_InputPower"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_InputPower) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_LaserBiasCurrent represents the /openconfig-platform/components/component/transceiver/physical-channels/channel/state/laser-bias-current YANG schema element. +type OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_LaserBiasCurrent struct { + Avg *float64 `path:"avg" module:"openconfig-platform-transceiver"` + Instant *float64 `path:"instant" module:"openconfig-platform-transceiver"` + Interval *uint64 `path:"interval" module:"openconfig-platform-transceiver"` + Max *float64 `path:"max" module:"openconfig-platform-transceiver"` + MaxTime *uint64 `path:"max-time" module:"openconfig-platform-transceiver"` + Min *float64 `path:"min" module:"openconfig-platform-transceiver"` + MinTime *uint64 `path:"min-time" module:"openconfig-platform-transceiver"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_LaserBiasCurrent implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_LaserBiasCurrent) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_LaserBiasCurrent) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_LaserBiasCurrent"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_LaserBiasCurrent) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_OutputPower represents the /openconfig-platform/components/component/transceiver/physical-channels/channel/state/output-power YANG schema element. +type OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_OutputPower struct { + Avg *float64 `path:"avg" module:"openconfig-platform-transceiver"` + Instant *float64 `path:"instant" module:"openconfig-platform-transceiver"` + Interval *uint64 `path:"interval" module:"openconfig-platform-transceiver"` + Max *float64 `path:"max" module:"openconfig-platform-transceiver"` + MaxTime *uint64 `path:"max-time" module:"openconfig-platform-transceiver"` + Min *float64 `path:"min" module:"openconfig-platform-transceiver"` + MinTime *uint64 `path:"min-time" module:"openconfig-platform-transceiver"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_OutputPower implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_OutputPower) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_OutputPower) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_OutputPower"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Transceiver_PhysicalChannels_Channel_State_OutputPower) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Transceiver_State represents the /openconfig-platform/components/component/transceiver/state YANG schema element. +type OpenconfigPlatform_Components_Component_Transceiver_State struct { + ConnectorType E_OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE `path:"connector-type" module:"openconfig-platform-transceiver"` + DateCode *string `path:"date-code" module:"openconfig-platform-transceiver"` + Enabled *bool `path:"enabled" module:"openconfig-platform-transceiver"` + EthernetPmd E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE `path:"ethernet-pmd" module:"openconfig-platform-transceiver"` + EthernetPmdPreconf E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE `path:"ethernet-pmd-preconf" module:"openconfig-platform-transceiver"` + FaultCondition *bool `path:"fault-condition" module:"openconfig-platform-transceiver"` + FecCorrectedBits *uint64 `path:"fec-corrected-bits" module:"openconfig-platform-transceiver"` + FecCorrectedBytes *uint64 `path:"fec-corrected-bytes" module:"openconfig-platform-transceiver"` + FecMode E_OpenconfigPlatformTypes_FEC_MODE_TYPE `path:"fec-mode" module:"openconfig-platform-transceiver"` + FecStatus E_OpenconfigPlatformTypes_FEC_STATUS_TYPE `path:"fec-status" module:"openconfig-platform-transceiver"` + FecUncorrectableBlocks *uint64 `path:"fec-uncorrectable-blocks" module:"openconfig-platform-transceiver"` + FecUncorrectableWords *uint64 `path:"fec-uncorrectable-words" module:"openconfig-platform-transceiver"` + FormFactor E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE `path:"form-factor" module:"openconfig-platform-transceiver"` + FormFactorPreconf E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE `path:"form-factor-preconf" module:"openconfig-platform-transceiver"` + InputPower *OpenconfigPlatform_Components_Component_Transceiver_State_InputPower `path:"input-power" module:"openconfig-platform-transceiver"` + LaserBiasCurrent *OpenconfigPlatform_Components_Component_Transceiver_State_LaserBiasCurrent `path:"laser-bias-current" module:"openconfig-platform-transceiver"` + OtnComplianceCode E_OpenconfigTransportTypes_OTN_APPLICATION_CODE `path:"otn-compliance-code" module:"openconfig-platform-transceiver"` + OutputPower *OpenconfigPlatform_Components_Component_Transceiver_State_OutputPower `path:"output-power" module:"openconfig-platform-transceiver"` + PostFecBer *OpenconfigPlatform_Components_Component_Transceiver_State_PostFecBer `path:"post-fec-ber" module:"openconfig-platform-transceiver"` + PreFecBer *OpenconfigPlatform_Components_Component_Transceiver_State_PreFecBer `path:"pre-fec-ber" module:"openconfig-platform-transceiver"` + Present E_OpenconfigPlatform_Components_Component_Transceiver_State_Present `path:"present" module:"openconfig-platform-transceiver"` + SerialNo *string `path:"serial-no" module:"openconfig-platform-transceiver"` + SonetSdhComplianceCode E_OpenconfigTransportTypes_SONET_APPLICATION_CODE `path:"sonet-sdh-compliance-code" module:"openconfig-platform-transceiver"` + Vendor *string `path:"vendor" module:"openconfig-platform-transceiver"` + VendorPart *string `path:"vendor-part" module:"openconfig-platform-transceiver"` + VendorRev *string `path:"vendor-rev" module:"openconfig-platform-transceiver"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Transceiver_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Transceiver_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Transceiver_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Transceiver_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Transceiver_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Transceiver_State_InputPower represents the /openconfig-platform/components/component/transceiver/state/input-power YANG schema element. +type OpenconfigPlatform_Components_Component_Transceiver_State_InputPower struct { + Avg *float64 `path:"avg" module:"openconfig-platform-transceiver"` + Instant *float64 `path:"instant" module:"openconfig-platform-transceiver"` + Interval *uint64 `path:"interval" module:"openconfig-platform-transceiver"` + Max *float64 `path:"max" module:"openconfig-platform-transceiver"` + MaxTime *uint64 `path:"max-time" module:"openconfig-platform-transceiver"` + Min *float64 `path:"min" module:"openconfig-platform-transceiver"` + MinTime *uint64 `path:"min-time" module:"openconfig-platform-transceiver"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Transceiver_State_InputPower implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Transceiver_State_InputPower) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Transceiver_State_InputPower) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Transceiver_State_InputPower"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Transceiver_State_InputPower) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Transceiver_State_LaserBiasCurrent represents the /openconfig-platform/components/component/transceiver/state/laser-bias-current YANG schema element. +type OpenconfigPlatform_Components_Component_Transceiver_State_LaserBiasCurrent struct { + Avg *float64 `path:"avg" module:"openconfig-platform-transceiver"` + Instant *float64 `path:"instant" module:"openconfig-platform-transceiver"` + Interval *uint64 `path:"interval" module:"openconfig-platform-transceiver"` + Max *float64 `path:"max" module:"openconfig-platform-transceiver"` + MaxTime *uint64 `path:"max-time" module:"openconfig-platform-transceiver"` + Min *float64 `path:"min" module:"openconfig-platform-transceiver"` + MinTime *uint64 `path:"min-time" module:"openconfig-platform-transceiver"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Transceiver_State_LaserBiasCurrent implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Transceiver_State_LaserBiasCurrent) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Transceiver_State_LaserBiasCurrent) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Transceiver_State_LaserBiasCurrent"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Transceiver_State_LaserBiasCurrent) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Transceiver_State_OutputPower represents the /openconfig-platform/components/component/transceiver/state/output-power YANG schema element. +type OpenconfigPlatform_Components_Component_Transceiver_State_OutputPower struct { + Avg *float64 `path:"avg" module:"openconfig-platform-transceiver"` + Instant *float64 `path:"instant" module:"openconfig-platform-transceiver"` + Interval *uint64 `path:"interval" module:"openconfig-platform-transceiver"` + Max *float64 `path:"max" module:"openconfig-platform-transceiver"` + MaxTime *uint64 `path:"max-time" module:"openconfig-platform-transceiver"` + Min *float64 `path:"min" module:"openconfig-platform-transceiver"` + MinTime *uint64 `path:"min-time" module:"openconfig-platform-transceiver"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Transceiver_State_OutputPower implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Transceiver_State_OutputPower) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Transceiver_State_OutputPower) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Transceiver_State_OutputPower"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Transceiver_State_OutputPower) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Transceiver_State_PostFecBer represents the /openconfig-platform/components/component/transceiver/state/post-fec-ber YANG schema element. +type OpenconfigPlatform_Components_Component_Transceiver_State_PostFecBer struct { + Avg *float64 `path:"avg" module:"openconfig-platform-transceiver"` + Instant *float64 `path:"instant" module:"openconfig-platform-transceiver"` + Interval *uint64 `path:"interval" module:"openconfig-platform-transceiver"` + Max *float64 `path:"max" module:"openconfig-platform-transceiver"` + MaxTime *uint64 `path:"max-time" module:"openconfig-platform-transceiver"` + Min *float64 `path:"min" module:"openconfig-platform-transceiver"` + MinTime *uint64 `path:"min-time" module:"openconfig-platform-transceiver"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Transceiver_State_PostFecBer implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Transceiver_State_PostFecBer) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Transceiver_State_PostFecBer) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Transceiver_State_PostFecBer"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Transceiver_State_PostFecBer) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigPlatform_Components_Component_Transceiver_State_PreFecBer represents the /openconfig-platform/components/component/transceiver/state/pre-fec-ber YANG schema element. +type OpenconfigPlatform_Components_Component_Transceiver_State_PreFecBer struct { + Avg *float64 `path:"avg" module:"openconfig-platform-transceiver"` + Instant *float64 `path:"instant" module:"openconfig-platform-transceiver"` + Interval *uint64 `path:"interval" module:"openconfig-platform-transceiver"` + Max *float64 `path:"max" module:"openconfig-platform-transceiver"` + MaxTime *uint64 `path:"max-time" module:"openconfig-platform-transceiver"` + Min *float64 `path:"min" module:"openconfig-platform-transceiver"` + MinTime *uint64 `path:"min-time" module:"openconfig-platform-transceiver"` +} + +// IsYANGGoStruct ensures that OpenconfigPlatform_Components_Component_Transceiver_State_PreFecBer implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigPlatform_Components_Component_Transceiver_State_PreFecBer) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigPlatform_Components_Component_Transceiver_State_PreFecBer) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigPlatform_Components_Component_Transceiver_State_PreFecBer"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigPlatform_Components_Component_Transceiver_State_PreFecBer) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice represents the /openconfig-terminal-device/terminal-device YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice struct { + Config *OpenconfigTerminalDevice_TerminalDevice_Config `path:"config" module:"openconfig-terminal-device"` + LogicalChannels *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels `path:"logical-channels" module:"openconfig-terminal-device"` + OperationalModes *OpenconfigTerminalDevice_TerminalDevice_OperationalModes `path:"operational-modes" module:"openconfig-terminal-device"` + State *OpenconfigTerminalDevice_TerminalDevice_State `path:"state" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_Config represents the /openconfig-terminal-device/terminal-device/config YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_Config struct { +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels represents the /openconfig-terminal-device/terminal-device/logical-channels YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels struct { + Channel map[uint32]*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel `path:"channel" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels) IsYANGGoStruct() {} + +// NewChannel creates a new entry in the Channel list of the +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels struct. The keys of the list are populated from the input +// arguments. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels) NewChannel(Index uint32) (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel, error){ + + // Initialise the list within the receiver struct if it has not already been + // created. + if t.Channel == nil { + t.Channel = make(map[uint32]*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel) + } + + key := Index + + // Ensure that this key has not already been used in the + // list. Keyed YANG lists do not allow duplicate keys to + // be created. + if _, ok := t.Channel[key]; ok { + return nil, fmt.Errorf("duplicate key %v for list Channel", key) + } + + t.Channel[key] = &OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel{ + Index: &Index, + } + + return t.Channel[key], nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel represents the /openconfig-terminal-device/terminal-device/logical-channels/channel YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel struct { + Config *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Config `path:"config" module:"openconfig-terminal-device"` + Ethernet *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet `path:"ethernet" module:"openconfig-terminal-device"` + Index *uint32 `path:"index" module:"openconfig-terminal-device"` + Ingress *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress `path:"ingress" module:"openconfig-terminal-device"` + LogicalChannelAssignments *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments `path:"logical-channel-assignments" module:"openconfig-terminal-device"` + Otn *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn `path:"otn" module:"openconfig-terminal-device"` + State *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State `path:"state" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel) IsYANGGoStruct() {} + +// ΛListKeyMap returns the keys of the OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel struct, which is a YANG list entry. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel) ΛListKeyMap() (map[string]interface{}, error) { + if t.Index == nil { + return nil, fmt.Errorf("nil value for key Index") + } + + return map[string]interface{}{ + "index": *t.Index, + }, nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Config represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/config YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Config struct { + AdminState E_OpenconfigTerminalDevice_AdminStateType `path:"admin-state" module:"openconfig-terminal-device"` + Description *string `path:"description" module:"openconfig-terminal-device"` + Index *uint32 `path:"index" module:"openconfig-terminal-device"` + LogicalChannelType E_OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE `path:"logical-channel-type" module:"openconfig-terminal-device"` + LoopbackMode E_OpenconfigTerminalDevice_LoopbackModeType `path:"loopback-mode" module:"openconfig-terminal-device"` + RateClass E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE `path:"rate-class" module:"openconfig-terminal-device"` + TestSignal *bool `path:"test-signal" module:"openconfig-terminal-device"` + TribProtocol E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE `path:"trib-protocol" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/ethernet YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet struct { + Config *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config `path:"config" module:"openconfig-terminal-device"` + Lldp *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp `path:"lldp" module:"openconfig-terminal-device"` + State *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_State `path:"state" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/ethernet/config YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config struct { + AlsDelay *uint32 `path:"als-delay" module:"openconfig-terminal-device"` + ClientAls E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls `path:"client-als" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/ethernet/lldp YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp struct { + Config *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Config `path:"config" module:"openconfig-terminal-device"` + Neighbors *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors `path:"neighbors" module:"openconfig-terminal-device"` + State *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_State `path:"state" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Config represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/ethernet/lldp/config YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Config struct { + Enabled *bool `path:"enabled" module:"openconfig-terminal-device"` + Snooping *bool `path:"snooping" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/ethernet/lldp/neighbors YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors struct { + Neighbor map[string]*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor `path:"neighbor" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors) IsYANGGoStruct() {} + +// NewNeighbor creates a new entry in the Neighbor list of the +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors struct. The keys of the list are populated from the input +// arguments. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors) NewNeighbor(Id string) (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor, error){ + + // Initialise the list within the receiver struct if it has not already been + // created. + if t.Neighbor == nil { + t.Neighbor = make(map[string]*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor) + } + + key := Id + + // Ensure that this key has not already been used in the + // list. Keyed YANG lists do not allow duplicate keys to + // be created. + if _, ok := t.Neighbor[key]; ok { + return nil, fmt.Errorf("duplicate key %v for list Neighbor", key) + } + + t.Neighbor[key] = &OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor{ + Id: &Id, + } + + return t.Neighbor[key], nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/ethernet/lldp/neighbors/neighbor YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor struct { + Config *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_Config `path:"config" module:"openconfig-terminal-device"` + CustomTlvs *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs `path:"custom-tlvs" module:"openconfig-terminal-device"` + Id *string `path:"id" module:"openconfig-terminal-device"` + State *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_State `path:"state" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor) IsYANGGoStruct() {} + +// ΛListKeyMap returns the keys of the OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor struct, which is a YANG list entry. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor) ΛListKeyMap() (map[string]interface{}, error) { + if t.Id == nil { + return nil, fmt.Errorf("nil value for key Id") + } + + return map[string]interface{}{ + "id": *t.Id, + }, nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_Config represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/ethernet/lldp/neighbors/neighbor/config YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_Config struct { +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/ethernet/lldp/neighbors/neighbor/custom-tlvs YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs struct { + Tlv map[OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv_Key]*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv `path:"tlv" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs) IsYANGGoStruct() {} + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv_Key represents the key for list Tlv of element /openconfig-terminal-device/terminal-device/logical-channels/channel/ethernet/lldp/neighbors/neighbor/custom-tlvs. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv_Key struct { + Type int32 `path:"type"` + Oui string `path:"oui"` + OuiSubtype string `path:"oui-subtype"` +} + +// NewTlv creates a new entry in the Tlv list of the +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs struct. The keys of the list are populated from the input +// arguments. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs) NewTlv(Type int32, Oui string, OuiSubtype string) (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv, error){ + + // Initialise the list within the receiver struct if it has not already been + // created. + if t.Tlv == nil { + t.Tlv = make(map[OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv_Key]*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv) + } + + key := OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv_Key{ + Type: Type, + Oui: Oui, + OuiSubtype: OuiSubtype, + } + + // Ensure that this key has not already been used in the + // list. Keyed YANG lists do not allow duplicate keys to + // be created. + if _, ok := t.Tlv[key]; ok { + return nil, fmt.Errorf("duplicate key %v for list Tlv", key) + } + + t.Tlv[key] = &OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv{ + Type: &Type, + Oui: &Oui, + OuiSubtype: &OuiSubtype, + } + + return t.Tlv[key], nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/ethernet/lldp/neighbors/neighbor/custom-tlvs/tlv YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv struct { + Config *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv_Config `path:"config" module:"openconfig-terminal-device"` + Oui *string `path:"oui" module:"openconfig-terminal-device"` + OuiSubtype *string `path:"oui-subtype" module:"openconfig-terminal-device"` + State *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv_State `path:"state" module:"openconfig-terminal-device"` + Type *int32 `path:"type" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv) IsYANGGoStruct() {} + +// ΛListKeyMap returns the keys of the OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv struct, which is a YANG list entry. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv) ΛListKeyMap() (map[string]interface{}, error) { + if t.Oui == nil { + return nil, fmt.Errorf("nil value for key Oui") + } + + if t.OuiSubtype == nil { + return nil, fmt.Errorf("nil value for key OuiSubtype") + } + + if t.Type == nil { + return nil, fmt.Errorf("nil value for key Type") + } + + return map[string]interface{}{ + "oui": *t.Oui, + "oui-subtype": *t.OuiSubtype, + "type": *t.Type, + }, nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv_Config represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/ethernet/lldp/neighbors/neighbor/custom-tlvs/tlv/config YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv_Config struct { +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv_State represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/ethernet/lldp/neighbors/neighbor/custom-tlvs/tlv/state YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv_State struct { + Oui *string `path:"oui" module:"openconfig-terminal-device"` + OuiSubtype *string `path:"oui-subtype" module:"openconfig-terminal-device"` + Type *int32 `path:"type" module:"openconfig-terminal-device"` + Value Binary `path:"value" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_CustomTlvs_Tlv_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_State represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/ethernet/lldp/neighbors/neighbor/state YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_State struct { + Age *uint64 `path:"age" module:"openconfig-terminal-device"` + ChassisId *string `path:"chassis-id" module:"openconfig-terminal-device"` + ChassisIdType E_OpenconfigLldp_ChassisIdType `path:"chassis-id-type" module:"openconfig-terminal-device"` + Id *string `path:"id" module:"openconfig-terminal-device"` + LastUpdate *int64 `path:"last-update" module:"openconfig-terminal-device"` + ManagementAddress *string `path:"management-address" module:"openconfig-terminal-device"` + ManagementAddressType *string `path:"management-address-type" module:"openconfig-terminal-device"` + PortDescription *string `path:"port-description" module:"openconfig-terminal-device"` + PortId *string `path:"port-id" module:"openconfig-terminal-device"` + PortIdType E_OpenconfigLldp_PortIdType `path:"port-id-type" module:"openconfig-terminal-device"` + SystemDescription *string `path:"system-description" module:"openconfig-terminal-device"` + SystemName *string `path:"system-name" module:"openconfig-terminal-device"` + Ttl *uint16 `path:"ttl" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_Neighbors_Neighbor_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_State represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/ethernet/lldp/state YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_State struct { + Counters *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_State_Counters `path:"counters" module:"openconfig-terminal-device"` + Enabled *bool `path:"enabled" module:"openconfig-terminal-device"` + Snooping *bool `path:"snooping" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_State_Counters represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/ethernet/lldp/state/counters YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_State_Counters struct { + FrameDiscard *uint64 `path:"frame-discard" module:"openconfig-terminal-device"` + FrameErrorIn *uint64 `path:"frame-error-in" module:"openconfig-terminal-device"` + FrameErrorOut *uint64 `path:"frame-error-out" module:"openconfig-terminal-device"` + FrameIn *uint64 `path:"frame-in" module:"openconfig-terminal-device"` + FrameOut *uint64 `path:"frame-out" module:"openconfig-terminal-device"` + LastClear *string `path:"last-clear" module:"openconfig-terminal-device"` + TlvDiscard *uint64 `path:"tlv-discard" module:"openconfig-terminal-device"` + TlvUnknown *uint64 `path:"tlv-unknown" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_State_Counters implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_State_Counters) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_State_Counters) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_State_Counters"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Lldp_State_Counters) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_State represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/ethernet/state YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_State struct { + AlsDelay *uint32 `path:"als-delay" module:"openconfig-terminal-device"` + ClientAls E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls `path:"client-als" module:"openconfig-terminal-device"` + In_8021QFrames *uint64 `path:"in-8021q-frames" module:"openconfig-terminal-device"` + InBlockErrors *uint64 `path:"in-block-errors" module:"openconfig-terminal-device"` + InCrcErrors *uint64 `path:"in-crc-errors" module:"openconfig-terminal-device"` + InFragmentFrames *uint64 `path:"in-fragment-frames" module:"openconfig-terminal-device"` + InJabberFrames *uint64 `path:"in-jabber-frames" module:"openconfig-terminal-device"` + InMacControlFrames *uint64 `path:"in-mac-control-frames" module:"openconfig-terminal-device"` + InMacPauseFrames *uint64 `path:"in-mac-pause-frames" module:"openconfig-terminal-device"` + InOversizeFrames *uint64 `path:"in-oversize-frames" module:"openconfig-terminal-device"` + InPcsBipErrors *uint64 `path:"in-pcs-bip-errors" module:"openconfig-terminal-device"` + InPcsErroredSeconds *uint64 `path:"in-pcs-errored-seconds" module:"openconfig-terminal-device"` + InPcsSeverelyErroredSeconds *uint64 `path:"in-pcs-severely-errored-seconds" module:"openconfig-terminal-device"` + InPcsUnavailableSeconds *uint64 `path:"in-pcs-unavailable-seconds" module:"openconfig-terminal-device"` + InUndersizeFrames *uint64 `path:"in-undersize-frames" module:"openconfig-terminal-device"` + Out_8021QFrames *uint64 `path:"out-8021q-frames" module:"openconfig-terminal-device"` + OutBlockErrors *uint64 `path:"out-block-errors" module:"openconfig-terminal-device"` + OutCrcErrors *uint64 `path:"out-crc-errors" module:"openconfig-terminal-device"` + OutMacControlFrames *uint64 `path:"out-mac-control-frames" module:"openconfig-terminal-device"` + OutMacPauseFrames *uint64 `path:"out-mac-pause-frames" module:"openconfig-terminal-device"` + OutPcsBipErrors *uint64 `path:"out-pcs-bip-errors" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/ingress YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress struct { + Config *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress_Config `path:"config" module:"openconfig-terminal-device"` + State *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress_State `path:"state" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress_Config represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/ingress/config YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress_Config struct { + PhysicalChannel []uint16 `path:"physical-channel" module:"openconfig-terminal-device"` + Transceiver *string `path:"transceiver" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress_State represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/ingress/state YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress_State struct { + PhysicalChannel []uint16 `path:"physical-channel" module:"openconfig-terminal-device"` + Transceiver *string `path:"transceiver" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ingress_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/logical-channel-assignments YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments struct { + Assignment map[uint32]*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment `path:"assignment" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments) IsYANGGoStruct() {} + +// NewAssignment creates a new entry in the Assignment list of the +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments struct. The keys of the list are populated from the input +// arguments. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments) NewAssignment(Index uint32) (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment, error){ + + // Initialise the list within the receiver struct if it has not already been + // created. + if t.Assignment == nil { + t.Assignment = make(map[uint32]*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment) + } + + key := Index + + // Ensure that this key has not already been used in the + // list. Keyed YANG lists do not allow duplicate keys to + // be created. + if _, ok := t.Assignment[key]; ok { + return nil, fmt.Errorf("duplicate key %v for list Assignment", key) + } + + t.Assignment[key] = &OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment{ + Index: &Index, + } + + return t.Assignment[key], nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/logical-channel-assignments/assignment YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment struct { + Config *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config `path:"config" module:"openconfig-terminal-device"` + Index *uint32 `path:"index" module:"openconfig-terminal-device"` + State *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_State `path:"state" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment) IsYANGGoStruct() {} + +// ΛListKeyMap returns the keys of the OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment struct, which is a YANG list entry. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment) ΛListKeyMap() (map[string]interface{}, error) { + if t.Index == nil { + return nil, fmt.Errorf("nil value for key Index") + } + + return map[string]interface{}{ + "index": *t.Index, + }, nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/logical-channel-assignments/assignment/config YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config struct { + Allocation *float64 `path:"allocation" module:"openconfig-terminal-device"` + AssignmentType E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType `path:"assignment-type" module:"openconfig-terminal-device"` + Description *string `path:"description" module:"openconfig-terminal-device"` + Index *uint32 `path:"index" module:"openconfig-terminal-device"` + LogicalChannel *uint32 `path:"logical-channel" module:"openconfig-terminal-device"` + Mapping E_OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL `path:"mapping" module:"openconfig-terminal-device"` + OpticalChannel *string `path:"optical-channel" module:"openconfig-terminal-device"` + TributarySlotIndex *int32 `path:"tributary-slot-index" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_State represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/logical-channel-assignments/assignment/state YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_State struct { + Allocation *float64 `path:"allocation" module:"openconfig-terminal-device"` + AssignmentType E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType `path:"assignment-type" module:"openconfig-terminal-device"` + Description *string `path:"description" module:"openconfig-terminal-device"` + Index *uint32 `path:"index" module:"openconfig-terminal-device"` + LogicalChannel *uint32 `path:"logical-channel" module:"openconfig-terminal-device"` + Mapping E_OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL `path:"mapping" module:"openconfig-terminal-device"` + OpticalChannel *string `path:"optical-channel" module:"openconfig-terminal-device"` + TributarySlotIndex *int32 `path:"tributary-slot-index" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/otn YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn struct { + Config *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_Config `path:"config" module:"openconfig-terminal-device"` + State *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State `path:"state" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_Config represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/otn/config YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_Config struct { + TributarySlotGranularity E_OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY `path:"tributary-slot-granularity" module:"openconfig-terminal-device"` + TtiMsgAuto *bool `path:"tti-msg-auto" module:"openconfig-terminal-device"` + TtiMsgExpected *string `path:"tti-msg-expected" module:"openconfig-terminal-device"` + TtiMsgTransmit *string `path:"tti-msg-transmit" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/otn/state YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State struct { + BackgroundBlockErrors *uint64 `path:"background-block-errors" module:"openconfig-terminal-device"` + CodeViolations *uint64 `path:"code-violations" module:"openconfig-terminal-device"` + ErroredBlocks *uint64 `path:"errored-blocks" module:"openconfig-terminal-device"` + ErroredSeconds *uint64 `path:"errored-seconds" module:"openconfig-terminal-device"` + Esnr *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_Esnr `path:"esnr" module:"openconfig-terminal-device"` + FecCorrectedBits *uint64 `path:"fec-corrected-bits" module:"openconfig-terminal-device"` + FecCorrectedBytes *uint64 `path:"fec-corrected-bytes" module:"openconfig-terminal-device"` + FecUncorrectableBlocks *uint64 `path:"fec-uncorrectable-blocks" module:"openconfig-terminal-device"` + FecUncorrectableWords *uint64 `path:"fec-uncorrectable-words" module:"openconfig-terminal-device"` + PostFecBer *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_PostFecBer `path:"post-fec-ber" module:"openconfig-terminal-device"` + PreFecBer *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_PreFecBer `path:"pre-fec-ber" module:"openconfig-terminal-device"` + QValue *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_QValue `path:"q-value" module:"openconfig-terminal-device"` + RdiMsg *string `path:"rdi-msg" module:"openconfig-terminal-device"` + SeverelyErroredSeconds *uint64 `path:"severely-errored-seconds" module:"openconfig-terminal-device"` + TributarySlotGranularity E_OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY `path:"tributary-slot-granularity" module:"openconfig-terminal-device"` + TtiMsgAuto *bool `path:"tti-msg-auto" module:"openconfig-terminal-device"` + TtiMsgExpected *string `path:"tti-msg-expected" module:"openconfig-terminal-device"` + TtiMsgRecv *string `path:"tti-msg-recv" module:"openconfig-terminal-device"` + TtiMsgTransmit *string `path:"tti-msg-transmit" module:"openconfig-terminal-device"` + UnavailableSeconds *uint64 `path:"unavailable-seconds" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_Esnr represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/otn/state/esnr YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_Esnr struct { + Avg *float64 `path:"avg" module:"openconfig-terminal-device"` + Instant *float64 `path:"instant" module:"openconfig-terminal-device"` + Interval *uint64 `path:"interval" module:"openconfig-terminal-device"` + Max *float64 `path:"max" module:"openconfig-terminal-device"` + MaxTime *uint64 `path:"max-time" module:"openconfig-terminal-device"` + Min *float64 `path:"min" module:"openconfig-terminal-device"` + MinTime *uint64 `path:"min-time" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_Esnr implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_Esnr) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_Esnr) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_Esnr"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_Esnr) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_PostFecBer represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/otn/state/post-fec-ber YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_PostFecBer struct { + Avg *float64 `path:"avg" module:"openconfig-terminal-device"` + Instant *float64 `path:"instant" module:"openconfig-terminal-device"` + Interval *uint64 `path:"interval" module:"openconfig-terminal-device"` + Max *float64 `path:"max" module:"openconfig-terminal-device"` + MaxTime *uint64 `path:"max-time" module:"openconfig-terminal-device"` + Min *float64 `path:"min" module:"openconfig-terminal-device"` + MinTime *uint64 `path:"min-time" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_PostFecBer implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_PostFecBer) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_PostFecBer) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_PostFecBer"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_PostFecBer) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_PreFecBer represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/otn/state/pre-fec-ber YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_PreFecBer struct { + Avg *float64 `path:"avg" module:"openconfig-terminal-device"` + Instant *float64 `path:"instant" module:"openconfig-terminal-device"` + Interval *uint64 `path:"interval" module:"openconfig-terminal-device"` + Max *float64 `path:"max" module:"openconfig-terminal-device"` + MaxTime *uint64 `path:"max-time" module:"openconfig-terminal-device"` + Min *float64 `path:"min" module:"openconfig-terminal-device"` + MinTime *uint64 `path:"min-time" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_PreFecBer implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_PreFecBer) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_PreFecBer) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_PreFecBer"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_PreFecBer) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_QValue represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/otn/state/q-value YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_QValue struct { + Avg *float64 `path:"avg" module:"openconfig-terminal-device"` + Instant *float64 `path:"instant" module:"openconfig-terminal-device"` + Interval *uint64 `path:"interval" module:"openconfig-terminal-device"` + Max *float64 `path:"max" module:"openconfig-terminal-device"` + MaxTime *uint64 `path:"max-time" module:"openconfig-terminal-device"` + Min *float64 `path:"min" module:"openconfig-terminal-device"` + MinTime *uint64 `path:"min-time" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_QValue implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_QValue) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_QValue) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_QValue"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Otn_State_QValue) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State represents the /openconfig-terminal-device/terminal-device/logical-channels/channel/state YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State struct { + AdminState E_OpenconfigTerminalDevice_AdminStateType `path:"admin-state" module:"openconfig-terminal-device"` + Description *string `path:"description" module:"openconfig-terminal-device"` + Index *uint32 `path:"index" module:"openconfig-terminal-device"` + LinkState E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState `path:"link-state" module:"openconfig-terminal-device"` + LogicalChannelType E_OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE `path:"logical-channel-type" module:"openconfig-terminal-device"` + LoopbackMode E_OpenconfigTerminalDevice_LoopbackModeType `path:"loopback-mode" module:"openconfig-terminal-device"` + RateClass E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE `path:"rate-class" module:"openconfig-terminal-device"` + TestSignal *bool `path:"test-signal" module:"openconfig-terminal-device"` + TribProtocol E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE `path:"trib-protocol" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_OperationalModes represents the /openconfig-terminal-device/terminal-device/operational-modes YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_OperationalModes struct { + Mode map[uint16]*OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode `path:"mode" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_OperationalModes implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_OperationalModes) IsYANGGoStruct() {} + +// NewMode creates a new entry in the Mode list of the +// OpenconfigTerminalDevice_TerminalDevice_OperationalModes struct. The keys of the list are populated from the input +// arguments. +func (t *OpenconfigTerminalDevice_TerminalDevice_OperationalModes) NewMode(ModeId uint16) (*OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode, error){ + + // Initialise the list within the receiver struct if it has not already been + // created. + if t.Mode == nil { + t.Mode = make(map[uint16]*OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode) + } + + key := ModeId + + // Ensure that this key has not already been used in the + // list. Keyed YANG lists do not allow duplicate keys to + // be created. + if _, ok := t.Mode[key]; ok { + return nil, fmt.Errorf("duplicate key %v for list Mode", key) + } + + t.Mode[key] = &OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode{ + ModeId: &ModeId, + } + + return t.Mode[key], nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_OperationalModes) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_OperationalModes"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_OperationalModes) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode represents the /openconfig-terminal-device/terminal-device/operational-modes/mode YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode struct { + Config *OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode_Config `path:"config" module:"openconfig-terminal-device"` + ModeId *uint16 `path:"mode-id" module:"openconfig-terminal-device"` + State *OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode_State `path:"state" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode) IsYANGGoStruct() {} + +// ΛListKeyMap returns the keys of the OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode struct, which is a YANG list entry. +func (t *OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode) ΛListKeyMap() (map[string]interface{}, error) { + if t.ModeId == nil { + return nil, fmt.Errorf("nil value for key ModeId") + } + + return map[string]interface{}{ + "mode-id": *t.ModeId, + }, nil +} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode_Config represents the /openconfig-terminal-device/terminal-device/operational-modes/mode/config YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode_Config struct { +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode_Config implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode_Config) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode_Config) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode_Config"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode_Config) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode_State represents the /openconfig-terminal-device/terminal-device/operational-modes/mode/state YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode_State struct { + Description *string `path:"description" module:"openconfig-terminal-device"` + ModeId *uint16 `path:"mode-id" module:"openconfig-terminal-device"` + VendorId *string `path:"vendor-id" module:"openconfig-terminal-device"` +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_OperationalModes_Mode_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// OpenconfigTerminalDevice_TerminalDevice_State represents the /openconfig-terminal-device/terminal-device/state YANG schema element. +type OpenconfigTerminalDevice_TerminalDevice_State struct { +} + +// IsYANGGoStruct ensures that OpenconfigTerminalDevice_TerminalDevice_State implements the yang.GoStruct +// interface. This allows functions that need to handle this struct to +// identify it as being generated by ygen. +func (*OpenconfigTerminalDevice_TerminalDevice_State) IsYANGGoStruct() {} + +// Validate validates s against the YANG schema corresponding to its type. +func (t *OpenconfigTerminalDevice_TerminalDevice_State) Validate(opts ...ygot.ValidationOption) error { + if err := ytypes.Validate(SchemaTree["OpenconfigTerminalDevice_TerminalDevice_State"], t, opts...); err != nil { + return err + } + return nil +} + +// ΛEnumTypeMap returns a map, keyed by YANG schema path, of the enumerated types +// that are included in the generated code. +func (t *OpenconfigTerminalDevice_TerminalDevice_State) ΛEnumTypeMap() map[string][]reflect.Type { return ΛEnumTypes } + + +// E_IETFInterfaces_InterfaceType is a derived int64 type which is used to represent +// the enumerated node IETFInterfaces_InterfaceType. An additional value named +// IETFInterfaces_InterfaceType_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_IETFInterfaces_InterfaceType int64 + +// IsYANGGoEnum ensures that IETFInterfaces_InterfaceType implements the yang.GoEnum +// interface. This ensures that IETFInterfaces_InterfaceType can be identified as a +// mapped type for a YANG enumeration. +func (E_IETFInterfaces_InterfaceType) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with IETFInterfaces_InterfaceType. +func (E_IETFInterfaces_InterfaceType) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // IETFInterfaces_InterfaceType_UNSET corresponds to the value UNSET of IETFInterfaces_InterfaceType + IETFInterfaces_InterfaceType_UNSET E_IETFInterfaces_InterfaceType = 0 +) + + +// E_IETFInterfaces_InterfacesState_Interface_AdminStatus is a derived int64 type which is used to represent +// the enumerated node IETFInterfaces_InterfacesState_Interface_AdminStatus. An additional value named +// IETFInterfaces_InterfacesState_Interface_AdminStatus_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_IETFInterfaces_InterfacesState_Interface_AdminStatus int64 + +// IsYANGGoEnum ensures that IETFInterfaces_InterfacesState_Interface_AdminStatus implements the yang.GoEnum +// interface. This ensures that IETFInterfaces_InterfacesState_Interface_AdminStatus can be identified as a +// mapped type for a YANG enumeration. +func (E_IETFInterfaces_InterfacesState_Interface_AdminStatus) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with IETFInterfaces_InterfacesState_Interface_AdminStatus. +func (E_IETFInterfaces_InterfacesState_Interface_AdminStatus) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // IETFInterfaces_InterfacesState_Interface_AdminStatus_UNSET corresponds to the value UNSET of IETFInterfaces_InterfacesState_Interface_AdminStatus + IETFInterfaces_InterfacesState_Interface_AdminStatus_UNSET E_IETFInterfaces_InterfacesState_Interface_AdminStatus = 0 + // IETFInterfaces_InterfacesState_Interface_AdminStatus_up corresponds to the value up of IETFInterfaces_InterfacesState_Interface_AdminStatus + IETFInterfaces_InterfacesState_Interface_AdminStatus_up E_IETFInterfaces_InterfacesState_Interface_AdminStatus = 2 + // IETFInterfaces_InterfacesState_Interface_AdminStatus_down corresponds to the value down of IETFInterfaces_InterfacesState_Interface_AdminStatus + IETFInterfaces_InterfacesState_Interface_AdminStatus_down E_IETFInterfaces_InterfacesState_Interface_AdminStatus = 3 + // IETFInterfaces_InterfacesState_Interface_AdminStatus_testing corresponds to the value testing of IETFInterfaces_InterfacesState_Interface_AdminStatus + IETFInterfaces_InterfacesState_Interface_AdminStatus_testing E_IETFInterfaces_InterfacesState_Interface_AdminStatus = 4 +) + + +// E_IETFInterfaces_InterfacesState_Interface_OperStatus is a derived int64 type which is used to represent +// the enumerated node IETFInterfaces_InterfacesState_Interface_OperStatus. An additional value named +// IETFInterfaces_InterfacesState_Interface_OperStatus_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_IETFInterfaces_InterfacesState_Interface_OperStatus int64 + +// IsYANGGoEnum ensures that IETFInterfaces_InterfacesState_Interface_OperStatus implements the yang.GoEnum +// interface. This ensures that IETFInterfaces_InterfacesState_Interface_OperStatus can be identified as a +// mapped type for a YANG enumeration. +func (E_IETFInterfaces_InterfacesState_Interface_OperStatus) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with IETFInterfaces_InterfacesState_Interface_OperStatus. +func (E_IETFInterfaces_InterfacesState_Interface_OperStatus) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // IETFInterfaces_InterfacesState_Interface_OperStatus_UNSET corresponds to the value UNSET of IETFInterfaces_InterfacesState_Interface_OperStatus + IETFInterfaces_InterfacesState_Interface_OperStatus_UNSET E_IETFInterfaces_InterfacesState_Interface_OperStatus = 0 + // IETFInterfaces_InterfacesState_Interface_OperStatus_up corresponds to the value up of IETFInterfaces_InterfacesState_Interface_OperStatus + IETFInterfaces_InterfacesState_Interface_OperStatus_up E_IETFInterfaces_InterfacesState_Interface_OperStatus = 2 + // IETFInterfaces_InterfacesState_Interface_OperStatus_down corresponds to the value down of IETFInterfaces_InterfacesState_Interface_OperStatus + IETFInterfaces_InterfacesState_Interface_OperStatus_down E_IETFInterfaces_InterfacesState_Interface_OperStatus = 3 + // IETFInterfaces_InterfacesState_Interface_OperStatus_testing corresponds to the value testing of IETFInterfaces_InterfacesState_Interface_OperStatus + IETFInterfaces_InterfacesState_Interface_OperStatus_testing E_IETFInterfaces_InterfacesState_Interface_OperStatus = 4 + // IETFInterfaces_InterfacesState_Interface_OperStatus_unknown corresponds to the value unknown of IETFInterfaces_InterfacesState_Interface_OperStatus + IETFInterfaces_InterfacesState_Interface_OperStatus_unknown E_IETFInterfaces_InterfacesState_Interface_OperStatus = 5 + // IETFInterfaces_InterfacesState_Interface_OperStatus_dormant corresponds to the value dormant of IETFInterfaces_InterfacesState_Interface_OperStatus + IETFInterfaces_InterfacesState_Interface_OperStatus_dormant E_IETFInterfaces_InterfacesState_Interface_OperStatus = 6 + // IETFInterfaces_InterfacesState_Interface_OperStatus_not_present corresponds to the value not_present of IETFInterfaces_InterfacesState_Interface_OperStatus + IETFInterfaces_InterfacesState_Interface_OperStatus_not_present E_IETFInterfaces_InterfacesState_Interface_OperStatus = 7 + // IETFInterfaces_InterfacesState_Interface_OperStatus_lower_layer_down corresponds to the value lower_layer_down of IETFInterfaces_InterfacesState_Interface_OperStatus + IETFInterfaces_InterfacesState_Interface_OperStatus_lower_layer_down E_IETFInterfaces_InterfacesState_Interface_OperStatus = 8 +) + + +// E_OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY is a derived int64 type which is used to represent +// the enumerated node OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY. An additional value named +// OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY int64 + +// IsYANGGoEnum ensures that OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY implements the yang.GoEnum +// interface. This ensures that OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY. +func (E_OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY_UNSET corresponds to the value UNSET of OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY + OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY_UNSET E_OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY = 0 + // OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY_CRITICAL corresponds to the value CRITICAL of OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY + OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY_CRITICAL E_OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY = 1 + // OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY_MAJOR corresponds to the value MAJOR of OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY + OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY_MAJOR E_OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY = 2 + // OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY_MINOR corresponds to the value MINOR of OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY + OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY_MINOR E_OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY = 3 + // OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY_UNKNOWN corresponds to the value UNKNOWN of OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY + OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY_UNKNOWN E_OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY = 4 + // OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY_WARNING corresponds to the value WARNING of OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY + OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY_WARNING E_OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY = 5 +) + + +// E_OpenconfigIfEthernet_ETHERNET_SPEED is a derived int64 type which is used to represent +// the enumerated node OpenconfigIfEthernet_ETHERNET_SPEED. An additional value named +// OpenconfigIfEthernet_ETHERNET_SPEED_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigIfEthernet_ETHERNET_SPEED int64 + +// IsYANGGoEnum ensures that OpenconfigIfEthernet_ETHERNET_SPEED implements the yang.GoEnum +// interface. This ensures that OpenconfigIfEthernet_ETHERNET_SPEED can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigIfEthernet_ETHERNET_SPEED) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigIfEthernet_ETHERNET_SPEED. +func (E_OpenconfigIfEthernet_ETHERNET_SPEED) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigIfEthernet_ETHERNET_SPEED_UNSET corresponds to the value UNSET of OpenconfigIfEthernet_ETHERNET_SPEED + OpenconfigIfEthernet_ETHERNET_SPEED_UNSET E_OpenconfigIfEthernet_ETHERNET_SPEED = 0 + // OpenconfigIfEthernet_ETHERNET_SPEED_SPEED_100GB corresponds to the value SPEED_100GB of OpenconfigIfEthernet_ETHERNET_SPEED + OpenconfigIfEthernet_ETHERNET_SPEED_SPEED_100GB E_OpenconfigIfEthernet_ETHERNET_SPEED = 1 + // OpenconfigIfEthernet_ETHERNET_SPEED_SPEED_100MB corresponds to the value SPEED_100MB of OpenconfigIfEthernet_ETHERNET_SPEED + OpenconfigIfEthernet_ETHERNET_SPEED_SPEED_100MB E_OpenconfigIfEthernet_ETHERNET_SPEED = 2 + // OpenconfigIfEthernet_ETHERNET_SPEED_SPEED_10GB corresponds to the value SPEED_10GB of OpenconfigIfEthernet_ETHERNET_SPEED + OpenconfigIfEthernet_ETHERNET_SPEED_SPEED_10GB E_OpenconfigIfEthernet_ETHERNET_SPEED = 3 + // OpenconfigIfEthernet_ETHERNET_SPEED_SPEED_10MB corresponds to the value SPEED_10MB of OpenconfigIfEthernet_ETHERNET_SPEED + OpenconfigIfEthernet_ETHERNET_SPEED_SPEED_10MB E_OpenconfigIfEthernet_ETHERNET_SPEED = 4 + // OpenconfigIfEthernet_ETHERNET_SPEED_SPEED_1GB corresponds to the value SPEED_1GB of OpenconfigIfEthernet_ETHERNET_SPEED + OpenconfigIfEthernet_ETHERNET_SPEED_SPEED_1GB E_OpenconfigIfEthernet_ETHERNET_SPEED = 5 + // OpenconfigIfEthernet_ETHERNET_SPEED_SPEED_2500MB corresponds to the value SPEED_2500MB of OpenconfigIfEthernet_ETHERNET_SPEED + OpenconfigIfEthernet_ETHERNET_SPEED_SPEED_2500MB E_OpenconfigIfEthernet_ETHERNET_SPEED = 6 + // OpenconfigIfEthernet_ETHERNET_SPEED_SPEED_25GB corresponds to the value SPEED_25GB of OpenconfigIfEthernet_ETHERNET_SPEED + OpenconfigIfEthernet_ETHERNET_SPEED_SPEED_25GB E_OpenconfigIfEthernet_ETHERNET_SPEED = 7 + // OpenconfigIfEthernet_ETHERNET_SPEED_SPEED_40GB corresponds to the value SPEED_40GB of OpenconfigIfEthernet_ETHERNET_SPEED + OpenconfigIfEthernet_ETHERNET_SPEED_SPEED_40GB E_OpenconfigIfEthernet_ETHERNET_SPEED = 8 + // OpenconfigIfEthernet_ETHERNET_SPEED_SPEED_50GB corresponds to the value SPEED_50GB of OpenconfigIfEthernet_ETHERNET_SPEED + OpenconfigIfEthernet_ETHERNET_SPEED_SPEED_50GB E_OpenconfigIfEthernet_ETHERNET_SPEED = 9 + // OpenconfigIfEthernet_ETHERNET_SPEED_SPEED_5GB corresponds to the value SPEED_5GB of OpenconfigIfEthernet_ETHERNET_SPEED + OpenconfigIfEthernet_ETHERNET_SPEED_SPEED_5GB E_OpenconfigIfEthernet_ETHERNET_SPEED = 10 + // OpenconfigIfEthernet_ETHERNET_SPEED_SPEED_UNKNOWN corresponds to the value SPEED_UNKNOWN of OpenconfigIfEthernet_ETHERNET_SPEED + OpenconfigIfEthernet_ETHERNET_SPEED_SPEED_UNKNOWN E_OpenconfigIfEthernet_ETHERNET_SPEED = 11 +) + + +// E_OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode is a derived int64 type which is used to represent +// the enumerated node OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode. An additional value named +// OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode int64 + +// IsYANGGoEnum ensures that OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode implements the yang.GoEnum +// interface. This ensures that OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode. +func (E_OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode_UNSET corresponds to the value UNSET of OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode + OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode_UNSET E_OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode = 0 + // OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode_FULL corresponds to the value FULL of OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode + OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode_FULL E_OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode = 1 + // OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode_HALF corresponds to the value HALF of OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode + OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode_HALF E_OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode = 2 +) + + +// E_OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode is a derived int64 type which is used to represent +// the enumerated node OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode. An additional value named +// OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode int64 + +// IsYANGGoEnum ensures that OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode implements the yang.GoEnum +// interface. This ensures that OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode. +func (E_OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode_UNSET corresponds to the value UNSET of OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode + OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode_UNSET E_OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode = 0 + // OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode_FULL corresponds to the value FULL of OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode + OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode_FULL E_OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode = 1 + // OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode_HALF corresponds to the value HALF of OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode + OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode_HALF E_OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode = 2 +) + + +// E_OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus is a derived int64 type which is used to represent +// the enumerated node OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus. An additional value named +// OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus int64 + +// IsYANGGoEnum ensures that OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus implements the yang.GoEnum +// interface. This ensures that OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus. +func (E_OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus_UNSET corresponds to the value UNSET of OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus + OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus_UNSET E_OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus = 0 + // OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus_UP corresponds to the value UP of OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus + OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus_UP E_OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus = 1 + // OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus_DOWN corresponds to the value DOWN of OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus + OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus_DOWN E_OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus = 2 + // OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus_TESTING corresponds to the value TESTING of OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus + OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus_TESTING E_OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus = 3 +) + + +// E_OpenconfigInterfaces_Interfaces_Interface_State_OperStatus is a derived int64 type which is used to represent +// the enumerated node OpenconfigInterfaces_Interfaces_Interface_State_OperStatus. An additional value named +// OpenconfigInterfaces_Interfaces_Interface_State_OperStatus_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigInterfaces_Interfaces_Interface_State_OperStatus int64 + +// IsYANGGoEnum ensures that OpenconfigInterfaces_Interfaces_Interface_State_OperStatus implements the yang.GoEnum +// interface. This ensures that OpenconfigInterfaces_Interfaces_Interface_State_OperStatus can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigInterfaces_Interfaces_Interface_State_OperStatus) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigInterfaces_Interfaces_Interface_State_OperStatus. +func (E_OpenconfigInterfaces_Interfaces_Interface_State_OperStatus) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigInterfaces_Interfaces_Interface_State_OperStatus_UNSET corresponds to the value UNSET of OpenconfigInterfaces_Interfaces_Interface_State_OperStatus + OpenconfigInterfaces_Interfaces_Interface_State_OperStatus_UNSET E_OpenconfigInterfaces_Interfaces_Interface_State_OperStatus = 0 + // OpenconfigInterfaces_Interfaces_Interface_State_OperStatus_UP corresponds to the value UP of OpenconfigInterfaces_Interfaces_Interface_State_OperStatus + OpenconfigInterfaces_Interfaces_Interface_State_OperStatus_UP E_OpenconfigInterfaces_Interfaces_Interface_State_OperStatus = 2 + // OpenconfigInterfaces_Interfaces_Interface_State_OperStatus_DOWN corresponds to the value DOWN of OpenconfigInterfaces_Interfaces_Interface_State_OperStatus + OpenconfigInterfaces_Interfaces_Interface_State_OperStatus_DOWN E_OpenconfigInterfaces_Interfaces_Interface_State_OperStatus = 3 + // OpenconfigInterfaces_Interfaces_Interface_State_OperStatus_TESTING corresponds to the value TESTING of OpenconfigInterfaces_Interfaces_Interface_State_OperStatus + OpenconfigInterfaces_Interfaces_Interface_State_OperStatus_TESTING E_OpenconfigInterfaces_Interfaces_Interface_State_OperStatus = 4 + // OpenconfigInterfaces_Interfaces_Interface_State_OperStatus_UNKNOWN corresponds to the value UNKNOWN of OpenconfigInterfaces_Interfaces_Interface_State_OperStatus + OpenconfigInterfaces_Interfaces_Interface_State_OperStatus_UNKNOWN E_OpenconfigInterfaces_Interfaces_Interface_State_OperStatus = 5 + // OpenconfigInterfaces_Interfaces_Interface_State_OperStatus_DORMANT corresponds to the value DORMANT of OpenconfigInterfaces_Interfaces_Interface_State_OperStatus + OpenconfigInterfaces_Interfaces_Interface_State_OperStatus_DORMANT E_OpenconfigInterfaces_Interfaces_Interface_State_OperStatus = 6 + // OpenconfigInterfaces_Interfaces_Interface_State_OperStatus_NOT_PRESENT corresponds to the value NOT_PRESENT of OpenconfigInterfaces_Interfaces_Interface_State_OperStatus + OpenconfigInterfaces_Interfaces_Interface_State_OperStatus_NOT_PRESENT E_OpenconfigInterfaces_Interfaces_Interface_State_OperStatus = 7 + // OpenconfigInterfaces_Interfaces_Interface_State_OperStatus_LOWER_LAYER_DOWN corresponds to the value LOWER_LAYER_DOWN of OpenconfigInterfaces_Interfaces_Interface_State_OperStatus + OpenconfigInterfaces_Interfaces_Interface_State_OperStatus_LOWER_LAYER_DOWN E_OpenconfigInterfaces_Interfaces_Interface_State_OperStatus = 8 +) + + +// E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY is a derived int64 type which is used to represent +// the enumerated node OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY. An additional value named +// OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY int64 + +// IsYANGGoEnum ensures that OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY implements the yang.GoEnum +// interface. This ensures that OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY. +func (E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_UNSET corresponds to the value UNSET of OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY + OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_UNSET E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY = 0 + // OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_C_VLAN corresponds to the value C_VLAN of OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY + OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_C_VLAN E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY = 1 + // OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_DOCSIS_CABLE_DEVICE corresponds to the value DOCSIS_CABLE_DEVICE of OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY + OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_DOCSIS_CABLE_DEVICE E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY = 2 + // OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_MAC_BRIDGE corresponds to the value MAC_BRIDGE of OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY + OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_MAC_BRIDGE E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY = 3 + // OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_OTHER corresponds to the value OTHER of OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY + OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_OTHER E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY = 4 + // OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_REPEATER corresponds to the value REPEATER of OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY + OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_REPEATER E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY = 5 + // OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_ROUTER corresponds to the value ROUTER of OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY + OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_ROUTER E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY = 6 + // OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_STATION_ONLY corresponds to the value STATION_ONLY of OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY + OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_STATION_ONLY E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY = 7 + // OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_S_VLAN corresponds to the value S_VLAN of OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY + OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_S_VLAN E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY = 8 + // OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_TELEPHONE corresponds to the value TELEPHONE of OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY + OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_TELEPHONE E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY = 9 + // OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_TWO_PORT_MAC_RELAY corresponds to the value TWO_PORT_MAC_RELAY of OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY + OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_TWO_PORT_MAC_RELAY E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY = 10 + // OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_WLAN_ACCESS_POINT corresponds to the value WLAN_ACCESS_POINT of OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY + OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY_WLAN_ACCESS_POINT E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY = 11 +) + + +// E_OpenconfigLldpTypes_LLDP_TLV is a derived int64 type which is used to represent +// the enumerated node OpenconfigLldpTypes_LLDP_TLV. An additional value named +// OpenconfigLldpTypes_LLDP_TLV_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigLldpTypes_LLDP_TLV int64 + +// IsYANGGoEnum ensures that OpenconfigLldpTypes_LLDP_TLV implements the yang.GoEnum +// interface. This ensures that OpenconfigLldpTypes_LLDP_TLV can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigLldpTypes_LLDP_TLV) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigLldpTypes_LLDP_TLV. +func (E_OpenconfigLldpTypes_LLDP_TLV) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigLldpTypes_LLDP_TLV_UNSET corresponds to the value UNSET of OpenconfigLldpTypes_LLDP_TLV + OpenconfigLldpTypes_LLDP_TLV_UNSET E_OpenconfigLldpTypes_LLDP_TLV = 0 + // OpenconfigLldpTypes_LLDP_TLV_CHASSIS_ID corresponds to the value CHASSIS_ID of OpenconfigLldpTypes_LLDP_TLV + OpenconfigLldpTypes_LLDP_TLV_CHASSIS_ID E_OpenconfigLldpTypes_LLDP_TLV = 1 + // OpenconfigLldpTypes_LLDP_TLV_MANAGEMENT_ADDRESS corresponds to the value MANAGEMENT_ADDRESS of OpenconfigLldpTypes_LLDP_TLV + OpenconfigLldpTypes_LLDP_TLV_MANAGEMENT_ADDRESS E_OpenconfigLldpTypes_LLDP_TLV = 2 + // OpenconfigLldpTypes_LLDP_TLV_PORT_DESCRIPTION corresponds to the value PORT_DESCRIPTION of OpenconfigLldpTypes_LLDP_TLV + OpenconfigLldpTypes_LLDP_TLV_PORT_DESCRIPTION E_OpenconfigLldpTypes_LLDP_TLV = 3 + // OpenconfigLldpTypes_LLDP_TLV_PORT_ID corresponds to the value PORT_ID of OpenconfigLldpTypes_LLDP_TLV + OpenconfigLldpTypes_LLDP_TLV_PORT_ID E_OpenconfigLldpTypes_LLDP_TLV = 4 + // OpenconfigLldpTypes_LLDP_TLV_SYSTEM_CAPABILITIES corresponds to the value SYSTEM_CAPABILITIES of OpenconfigLldpTypes_LLDP_TLV + OpenconfigLldpTypes_LLDP_TLV_SYSTEM_CAPABILITIES E_OpenconfigLldpTypes_LLDP_TLV = 5 + // OpenconfigLldpTypes_LLDP_TLV_SYSTEM_DESCRIPTION corresponds to the value SYSTEM_DESCRIPTION of OpenconfigLldpTypes_LLDP_TLV + OpenconfigLldpTypes_LLDP_TLV_SYSTEM_DESCRIPTION E_OpenconfigLldpTypes_LLDP_TLV = 6 + // OpenconfigLldpTypes_LLDP_TLV_SYSTEM_NAME corresponds to the value SYSTEM_NAME of OpenconfigLldpTypes_LLDP_TLV + OpenconfigLldpTypes_LLDP_TLV_SYSTEM_NAME E_OpenconfigLldpTypes_LLDP_TLV = 7 +) + + +// E_OpenconfigLldp_ChassisIdType is a derived int64 type which is used to represent +// the enumerated node OpenconfigLldp_ChassisIdType. An additional value named +// OpenconfigLldp_ChassisIdType_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigLldp_ChassisIdType int64 + +// IsYANGGoEnum ensures that OpenconfigLldp_ChassisIdType implements the yang.GoEnum +// interface. This ensures that OpenconfigLldp_ChassisIdType can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigLldp_ChassisIdType) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigLldp_ChassisIdType. +func (E_OpenconfigLldp_ChassisIdType) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigLldp_ChassisIdType_UNSET corresponds to the value UNSET of OpenconfigLldp_ChassisIdType + OpenconfigLldp_ChassisIdType_UNSET E_OpenconfigLldp_ChassisIdType = 0 + // OpenconfigLldp_ChassisIdType_CHASSIS_COMPONENT corresponds to the value CHASSIS_COMPONENT of OpenconfigLldp_ChassisIdType + OpenconfigLldp_ChassisIdType_CHASSIS_COMPONENT E_OpenconfigLldp_ChassisIdType = 1 + // OpenconfigLldp_ChassisIdType_INTERFACE_ALIAS corresponds to the value INTERFACE_ALIAS of OpenconfigLldp_ChassisIdType + OpenconfigLldp_ChassisIdType_INTERFACE_ALIAS E_OpenconfigLldp_ChassisIdType = 2 + // OpenconfigLldp_ChassisIdType_PORT_COMPONENT corresponds to the value PORT_COMPONENT of OpenconfigLldp_ChassisIdType + OpenconfigLldp_ChassisIdType_PORT_COMPONENT E_OpenconfigLldp_ChassisIdType = 3 + // OpenconfigLldp_ChassisIdType_MAC_ADDRESS corresponds to the value MAC_ADDRESS of OpenconfigLldp_ChassisIdType + OpenconfigLldp_ChassisIdType_MAC_ADDRESS E_OpenconfigLldp_ChassisIdType = 4 + // OpenconfigLldp_ChassisIdType_NETWORK_ADDRESS corresponds to the value NETWORK_ADDRESS of OpenconfigLldp_ChassisIdType + OpenconfigLldp_ChassisIdType_NETWORK_ADDRESS E_OpenconfigLldp_ChassisIdType = 5 + // OpenconfigLldp_ChassisIdType_INTERFACE_NAME corresponds to the value INTERFACE_NAME of OpenconfigLldp_ChassisIdType + OpenconfigLldp_ChassisIdType_INTERFACE_NAME E_OpenconfigLldp_ChassisIdType = 6 + // OpenconfigLldp_ChassisIdType_LOCAL corresponds to the value LOCAL of OpenconfigLldp_ChassisIdType + OpenconfigLldp_ChassisIdType_LOCAL E_OpenconfigLldp_ChassisIdType = 7 +) + + +// E_OpenconfigLldp_PortIdType is a derived int64 type which is used to represent +// the enumerated node OpenconfigLldp_PortIdType. An additional value named +// OpenconfigLldp_PortIdType_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigLldp_PortIdType int64 + +// IsYANGGoEnum ensures that OpenconfigLldp_PortIdType implements the yang.GoEnum +// interface. This ensures that OpenconfigLldp_PortIdType can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigLldp_PortIdType) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigLldp_PortIdType. +func (E_OpenconfigLldp_PortIdType) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigLldp_PortIdType_UNSET corresponds to the value UNSET of OpenconfigLldp_PortIdType + OpenconfigLldp_PortIdType_UNSET E_OpenconfigLldp_PortIdType = 0 + // OpenconfigLldp_PortIdType_INTERFACE_ALIAS corresponds to the value INTERFACE_ALIAS of OpenconfigLldp_PortIdType + OpenconfigLldp_PortIdType_INTERFACE_ALIAS E_OpenconfigLldp_PortIdType = 1 + // OpenconfigLldp_PortIdType_PORT_COMPONENT corresponds to the value PORT_COMPONENT of OpenconfigLldp_PortIdType + OpenconfigLldp_PortIdType_PORT_COMPONENT E_OpenconfigLldp_PortIdType = 2 + // OpenconfigLldp_PortIdType_MAC_ADDRESS corresponds to the value MAC_ADDRESS of OpenconfigLldp_PortIdType + OpenconfigLldp_PortIdType_MAC_ADDRESS E_OpenconfigLldp_PortIdType = 3 + // OpenconfigLldp_PortIdType_NETWORK_ADDRESS corresponds to the value NETWORK_ADDRESS of OpenconfigLldp_PortIdType + OpenconfigLldp_PortIdType_NETWORK_ADDRESS E_OpenconfigLldp_PortIdType = 4 + // OpenconfigLldp_PortIdType_INTERFACE_NAME corresponds to the value INTERFACE_NAME of OpenconfigLldp_PortIdType + OpenconfigLldp_PortIdType_INTERFACE_NAME E_OpenconfigLldp_PortIdType = 5 + // OpenconfigLldp_PortIdType_AGENT_CIRCUIT_ID corresponds to the value AGENT_CIRCUIT_ID of OpenconfigLldp_PortIdType + OpenconfigLldp_PortIdType_AGENT_CIRCUIT_ID E_OpenconfigLldp_PortIdType = 6 + // OpenconfigLldp_PortIdType_LOCAL corresponds to the value LOCAL of OpenconfigLldp_PortIdType + OpenconfigLldp_PortIdType_LOCAL E_OpenconfigLldp_PortIdType = 7 +) + + +// E_OpenconfigPlatformTypes_COMPONENT_OPER_STATUS is a derived int64 type which is used to represent +// the enumerated node OpenconfigPlatformTypes_COMPONENT_OPER_STATUS. An additional value named +// OpenconfigPlatformTypes_COMPONENT_OPER_STATUS_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigPlatformTypes_COMPONENT_OPER_STATUS int64 + +// IsYANGGoEnum ensures that OpenconfigPlatformTypes_COMPONENT_OPER_STATUS implements the yang.GoEnum +// interface. This ensures that OpenconfigPlatformTypes_COMPONENT_OPER_STATUS can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigPlatformTypes_COMPONENT_OPER_STATUS) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigPlatformTypes_COMPONENT_OPER_STATUS. +func (E_OpenconfigPlatformTypes_COMPONENT_OPER_STATUS) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigPlatformTypes_COMPONENT_OPER_STATUS_UNSET corresponds to the value UNSET of OpenconfigPlatformTypes_COMPONENT_OPER_STATUS + OpenconfigPlatformTypes_COMPONENT_OPER_STATUS_UNSET E_OpenconfigPlatformTypes_COMPONENT_OPER_STATUS = 0 + // OpenconfigPlatformTypes_COMPONENT_OPER_STATUS_ACTIVE corresponds to the value ACTIVE of OpenconfigPlatformTypes_COMPONENT_OPER_STATUS + OpenconfigPlatformTypes_COMPONENT_OPER_STATUS_ACTIVE E_OpenconfigPlatformTypes_COMPONENT_OPER_STATUS = 1 + // OpenconfigPlatformTypes_COMPONENT_OPER_STATUS_DISABLED corresponds to the value DISABLED of OpenconfigPlatformTypes_COMPONENT_OPER_STATUS + OpenconfigPlatformTypes_COMPONENT_OPER_STATUS_DISABLED E_OpenconfigPlatformTypes_COMPONENT_OPER_STATUS = 2 + // OpenconfigPlatformTypes_COMPONENT_OPER_STATUS_INACTIVE corresponds to the value INACTIVE of OpenconfigPlatformTypes_COMPONENT_OPER_STATUS + OpenconfigPlatformTypes_COMPONENT_OPER_STATUS_INACTIVE E_OpenconfigPlatformTypes_COMPONENT_OPER_STATUS = 3 +) + + +// E_OpenconfigPlatformTypes_FEC_MODE_TYPE is a derived int64 type which is used to represent +// the enumerated node OpenconfigPlatformTypes_FEC_MODE_TYPE. An additional value named +// OpenconfigPlatformTypes_FEC_MODE_TYPE_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigPlatformTypes_FEC_MODE_TYPE int64 + +// IsYANGGoEnum ensures that OpenconfigPlatformTypes_FEC_MODE_TYPE implements the yang.GoEnum +// interface. This ensures that OpenconfigPlatformTypes_FEC_MODE_TYPE can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigPlatformTypes_FEC_MODE_TYPE) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigPlatformTypes_FEC_MODE_TYPE. +func (E_OpenconfigPlatformTypes_FEC_MODE_TYPE) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigPlatformTypes_FEC_MODE_TYPE_UNSET corresponds to the value UNSET of OpenconfigPlatformTypes_FEC_MODE_TYPE + OpenconfigPlatformTypes_FEC_MODE_TYPE_UNSET E_OpenconfigPlatformTypes_FEC_MODE_TYPE = 0 + // OpenconfigPlatformTypes_FEC_MODE_TYPE_FEC_AUTO corresponds to the value FEC_AUTO of OpenconfigPlatformTypes_FEC_MODE_TYPE + OpenconfigPlatformTypes_FEC_MODE_TYPE_FEC_AUTO E_OpenconfigPlatformTypes_FEC_MODE_TYPE = 1 + // OpenconfigPlatformTypes_FEC_MODE_TYPE_FEC_DISABLED corresponds to the value FEC_DISABLED of OpenconfigPlatformTypes_FEC_MODE_TYPE + OpenconfigPlatformTypes_FEC_MODE_TYPE_FEC_DISABLED E_OpenconfigPlatformTypes_FEC_MODE_TYPE = 2 + // OpenconfigPlatformTypes_FEC_MODE_TYPE_FEC_ENABLED corresponds to the value FEC_ENABLED of OpenconfigPlatformTypes_FEC_MODE_TYPE + OpenconfigPlatformTypes_FEC_MODE_TYPE_FEC_ENABLED E_OpenconfigPlatformTypes_FEC_MODE_TYPE = 3 +) + + +// E_OpenconfigPlatformTypes_FEC_STATUS_TYPE is a derived int64 type which is used to represent +// the enumerated node OpenconfigPlatformTypes_FEC_STATUS_TYPE. An additional value named +// OpenconfigPlatformTypes_FEC_STATUS_TYPE_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigPlatformTypes_FEC_STATUS_TYPE int64 + +// IsYANGGoEnum ensures that OpenconfigPlatformTypes_FEC_STATUS_TYPE implements the yang.GoEnum +// interface. This ensures that OpenconfigPlatformTypes_FEC_STATUS_TYPE can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigPlatformTypes_FEC_STATUS_TYPE) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigPlatformTypes_FEC_STATUS_TYPE. +func (E_OpenconfigPlatformTypes_FEC_STATUS_TYPE) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigPlatformTypes_FEC_STATUS_TYPE_UNSET corresponds to the value UNSET of OpenconfigPlatformTypes_FEC_STATUS_TYPE + OpenconfigPlatformTypes_FEC_STATUS_TYPE_UNSET E_OpenconfigPlatformTypes_FEC_STATUS_TYPE = 0 + // OpenconfigPlatformTypes_FEC_STATUS_TYPE_FEC_STATUS_LOCKED corresponds to the value FEC_STATUS_LOCKED of OpenconfigPlatformTypes_FEC_STATUS_TYPE + OpenconfigPlatformTypes_FEC_STATUS_TYPE_FEC_STATUS_LOCKED E_OpenconfigPlatformTypes_FEC_STATUS_TYPE = 1 + // OpenconfigPlatformTypes_FEC_STATUS_TYPE_FEC_STATUS_UNLOCKED corresponds to the value FEC_STATUS_UNLOCKED of OpenconfigPlatformTypes_FEC_STATUS_TYPE + OpenconfigPlatformTypes_FEC_STATUS_TYPE_FEC_STATUS_UNLOCKED E_OpenconfigPlatformTypes_FEC_STATUS_TYPE = 2 +) + + +// E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT is a derived int64 type which is used to represent +// the enumerated node OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT. An additional value named +// OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT int64 + +// IsYANGGoEnum ensures that OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT implements the yang.GoEnum +// interface. This ensures that OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT. +func (E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_UNSET corresponds to the value UNSET of OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT + OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_UNSET E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT = 0 + // OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_BACKPLANE corresponds to the value BACKPLANE of OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT + OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_BACKPLANE E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT = 1 + // OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_CHASSIS corresponds to the value CHASSIS of OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT + OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_CHASSIS E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT = 2 + // OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_CONTROLLER_CARD corresponds to the value CONTROLLER_CARD of OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT + OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_CONTROLLER_CARD E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT = 3 + // OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_CPU corresponds to the value CPU of OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT + OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_CPU E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT = 4 + // OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_FABRIC corresponds to the value FABRIC of OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT + OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_FABRIC E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT = 5 + // OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_FAN corresponds to the value FAN of OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT + OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_FAN E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT = 6 + // OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_FRU corresponds to the value FRU of OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT + OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_FRU E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT = 7 + // OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_INTEGRATED_CIRCUIT corresponds to the value INTEGRATED_CIRCUIT of OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT + OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_INTEGRATED_CIRCUIT E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT = 8 + // OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_LINECARD corresponds to the value LINECARD of OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT + OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_LINECARD E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT = 9 + // OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_OPTICAL_CHANNEL corresponds to the value OPTICAL_CHANNEL of OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT + OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_OPTICAL_CHANNEL E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT = 10 + // OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_PORT corresponds to the value PORT of OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT + OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_PORT E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT = 11 + // OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_POWER_SUPPLY corresponds to the value POWER_SUPPLY of OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT + OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_POWER_SUPPLY E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT = 12 + // OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_SENSOR corresponds to the value SENSOR of OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT + OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_SENSOR E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT = 13 + // OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_STORAGE corresponds to the value STORAGE of OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT + OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_STORAGE E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT = 14 + // OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_TRANSCEIVER corresponds to the value TRANSCEIVER of OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT + OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT_TRANSCEIVER E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT = 15 +) + + +// E_OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT is a derived int64 type which is used to represent +// the enumerated node OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT. An additional value named +// OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT int64 + +// IsYANGGoEnum ensures that OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT implements the yang.GoEnum +// interface. This ensures that OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT. +func (E_OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT_UNSET corresponds to the value UNSET of OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT + OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT_UNSET E_OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT = 0 + // OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT_OPERATING_SYSTEM corresponds to the value OPERATING_SYSTEM of OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT + OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT_OPERATING_SYSTEM E_OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT = 1 + // OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT_OPERATING_SYSTEM_UPDATE corresponds to the value OPERATING_SYSTEM_UPDATE of OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT + OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT_OPERATING_SYSTEM_UPDATE E_OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT = 2 +) + + +// E_OpenconfigPlatform_Components_Component_Transceiver_State_Present is a derived int64 type which is used to represent +// the enumerated node OpenconfigPlatform_Components_Component_Transceiver_State_Present. An additional value named +// OpenconfigPlatform_Components_Component_Transceiver_State_Present_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigPlatform_Components_Component_Transceiver_State_Present int64 + +// IsYANGGoEnum ensures that OpenconfigPlatform_Components_Component_Transceiver_State_Present implements the yang.GoEnum +// interface. This ensures that OpenconfigPlatform_Components_Component_Transceiver_State_Present can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigPlatform_Components_Component_Transceiver_State_Present) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigPlatform_Components_Component_Transceiver_State_Present. +func (E_OpenconfigPlatform_Components_Component_Transceiver_State_Present) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigPlatform_Components_Component_Transceiver_State_Present_UNSET corresponds to the value UNSET of OpenconfigPlatform_Components_Component_Transceiver_State_Present + OpenconfigPlatform_Components_Component_Transceiver_State_Present_UNSET E_OpenconfigPlatform_Components_Component_Transceiver_State_Present = 0 + // OpenconfigPlatform_Components_Component_Transceiver_State_Present_PRESENT corresponds to the value PRESENT of OpenconfigPlatform_Components_Component_Transceiver_State_Present + OpenconfigPlatform_Components_Component_Transceiver_State_Present_PRESENT E_OpenconfigPlatform_Components_Component_Transceiver_State_Present = 1 + // OpenconfigPlatform_Components_Component_Transceiver_State_Present_NOT_PRESENT corresponds to the value NOT_PRESENT of OpenconfigPlatform_Components_Component_Transceiver_State_Present + OpenconfigPlatform_Components_Component_Transceiver_State_Present_NOT_PRESENT E_OpenconfigPlatform_Components_Component_Transceiver_State_Present = 2 +) + + +// E_OpenconfigTerminalDevice_AdminStateType is a derived int64 type which is used to represent +// the enumerated node OpenconfigTerminalDevice_AdminStateType. An additional value named +// OpenconfigTerminalDevice_AdminStateType_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigTerminalDevice_AdminStateType int64 + +// IsYANGGoEnum ensures that OpenconfigTerminalDevice_AdminStateType implements the yang.GoEnum +// interface. This ensures that OpenconfigTerminalDevice_AdminStateType can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigTerminalDevice_AdminStateType) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigTerminalDevice_AdminStateType. +func (E_OpenconfigTerminalDevice_AdminStateType) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigTerminalDevice_AdminStateType_UNSET corresponds to the value UNSET of OpenconfigTerminalDevice_AdminStateType + OpenconfigTerminalDevice_AdminStateType_UNSET E_OpenconfigTerminalDevice_AdminStateType = 0 + // OpenconfigTerminalDevice_AdminStateType_ENABLED corresponds to the value ENABLED of OpenconfigTerminalDevice_AdminStateType + OpenconfigTerminalDevice_AdminStateType_ENABLED E_OpenconfigTerminalDevice_AdminStateType = 1 + // OpenconfigTerminalDevice_AdminStateType_DISABLED corresponds to the value DISABLED of OpenconfigTerminalDevice_AdminStateType + OpenconfigTerminalDevice_AdminStateType_DISABLED E_OpenconfigTerminalDevice_AdminStateType = 2 + // OpenconfigTerminalDevice_AdminStateType_MAINT corresponds to the value MAINT of OpenconfigTerminalDevice_AdminStateType + OpenconfigTerminalDevice_AdminStateType_MAINT E_OpenconfigTerminalDevice_AdminStateType = 3 +) + + +// E_OpenconfigTerminalDevice_LoopbackModeType is a derived int64 type which is used to represent +// the enumerated node OpenconfigTerminalDevice_LoopbackModeType. An additional value named +// OpenconfigTerminalDevice_LoopbackModeType_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigTerminalDevice_LoopbackModeType int64 + +// IsYANGGoEnum ensures that OpenconfigTerminalDevice_LoopbackModeType implements the yang.GoEnum +// interface. This ensures that OpenconfigTerminalDevice_LoopbackModeType can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigTerminalDevice_LoopbackModeType) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigTerminalDevice_LoopbackModeType. +func (E_OpenconfigTerminalDevice_LoopbackModeType) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigTerminalDevice_LoopbackModeType_UNSET corresponds to the value UNSET of OpenconfigTerminalDevice_LoopbackModeType + OpenconfigTerminalDevice_LoopbackModeType_UNSET E_OpenconfigTerminalDevice_LoopbackModeType = 0 + // OpenconfigTerminalDevice_LoopbackModeType_NONE corresponds to the value NONE of OpenconfigTerminalDevice_LoopbackModeType + OpenconfigTerminalDevice_LoopbackModeType_NONE E_OpenconfigTerminalDevice_LoopbackModeType = 1 + // OpenconfigTerminalDevice_LoopbackModeType_FACILITY corresponds to the value FACILITY of OpenconfigTerminalDevice_LoopbackModeType + OpenconfigTerminalDevice_LoopbackModeType_FACILITY E_OpenconfigTerminalDevice_LoopbackModeType = 2 + // OpenconfigTerminalDevice_LoopbackModeType_TERMINAL corresponds to the value TERMINAL of OpenconfigTerminalDevice_LoopbackModeType + OpenconfigTerminalDevice_LoopbackModeType_TERMINAL E_OpenconfigTerminalDevice_LoopbackModeType = 3 +) + + +// E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls is a derived int64 type which is used to represent +// the enumerated node OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls. An additional value named +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls int64 + +// IsYANGGoEnum ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls implements the yang.GoEnum +// interface. This ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls. +func (E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls_UNSET corresponds to the value UNSET of OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls + OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls_UNSET E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls = 0 + // OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls_NONE corresponds to the value NONE of OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls + OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls_NONE E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls = 1 + // OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls_LASER_SHUTDOWN corresponds to the value LASER_SHUTDOWN of OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls + OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls_LASER_SHUTDOWN E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls = 2 + // OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls_ETHERNET corresponds to the value ETHERNET of OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls + OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls_ETHERNET E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls = 3 +) + + +// E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType is a derived int64 type which is used to represent +// the enumerated node OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType. An additional value named +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType int64 + +// IsYANGGoEnum ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType implements the yang.GoEnum +// interface. This ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType. +func (E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType_UNSET corresponds to the value UNSET of OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType + OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType_UNSET E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType = 0 + // OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType_LOGICAL_CHANNEL corresponds to the value LOGICAL_CHANNEL of OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType + OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType_LOGICAL_CHANNEL E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType = 1 + // OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType_OPTICAL_CHANNEL corresponds to the value OPTICAL_CHANNEL of OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType + OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType_OPTICAL_CHANNEL E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType = 2 +) + + +// E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState is a derived int64 type which is used to represent +// the enumerated node OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState. An additional value named +// OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState int64 + +// IsYANGGoEnum ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState implements the yang.GoEnum +// interface. This ensures that OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState. +func (E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState_UNSET corresponds to the value UNSET of OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState + OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState_UNSET E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState = 0 + // OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState_UP corresponds to the value UP of OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState + OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState_UP E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState = 1 + // OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState_DOWN corresponds to the value DOWN of OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState + OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState_DOWN E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState = 2 + // OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState_TESTING corresponds to the value TESTING of OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState + OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState_TESTING E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState = 3 +) + + +// E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE is a derived int64 type which is used to represent +// the enumerated node OpenconfigTransportTypes_ETHERNET_PMD_TYPE. An additional value named +// OpenconfigTransportTypes_ETHERNET_PMD_TYPE_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE int64 + +// IsYANGGoEnum ensures that OpenconfigTransportTypes_ETHERNET_PMD_TYPE implements the yang.GoEnum +// interface. This ensures that OpenconfigTransportTypes_ETHERNET_PMD_TYPE can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigTransportTypes_ETHERNET_PMD_TYPE. +func (E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_UNSET corresponds to the value UNSET of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_UNSET E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 0 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_100GBASE_CLR4 corresponds to the value ETH_100GBASE_CLR4 of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_100GBASE_CLR4 E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 1 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_100GBASE_CR4 corresponds to the value ETH_100GBASE_CR4 of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_100GBASE_CR4 E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 2 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_100GBASE_CWDM4 corresponds to the value ETH_100GBASE_CWDM4 of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_100GBASE_CWDM4 E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 3 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_100GBASE_ER4 corresponds to the value ETH_100GBASE_ER4 of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_100GBASE_ER4 E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 4 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_100GBASE_LR4 corresponds to the value ETH_100GBASE_LR4 of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_100GBASE_LR4 E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 5 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_100GBASE_PSM4 corresponds to the value ETH_100GBASE_PSM4 of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_100GBASE_PSM4 E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 6 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_100GBASE_SR10 corresponds to the value ETH_100GBASE_SR10 of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_100GBASE_SR10 E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 7 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_100GBASE_SR4 corresponds to the value ETH_100GBASE_SR4 of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_100GBASE_SR4 E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 8 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_100G_ACC corresponds to the value ETH_100G_ACC of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_100G_ACC E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 9 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_100G_AOC corresponds to the value ETH_100G_AOC of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_100G_AOC E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 10 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_10GBASE_ER corresponds to the value ETH_10GBASE_ER of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_10GBASE_ER E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 11 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_10GBASE_LR corresponds to the value ETH_10GBASE_LR of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_10GBASE_LR E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 12 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_10GBASE_LRM corresponds to the value ETH_10GBASE_LRM of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_10GBASE_LRM E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 13 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_10GBASE_SR corresponds to the value ETH_10GBASE_SR of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_10GBASE_SR E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 14 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_10GBASE_ZR corresponds to the value ETH_10GBASE_ZR of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_10GBASE_ZR E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 15 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_40GBASE_CR4 corresponds to the value ETH_40GBASE_CR4 of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_40GBASE_CR4 E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 16 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_40GBASE_ER4 corresponds to the value ETH_40GBASE_ER4 of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_40GBASE_ER4 E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 17 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_40GBASE_LR4 corresponds to the value ETH_40GBASE_LR4 of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_40GBASE_LR4 E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 18 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_40GBASE_PSM4 corresponds to the value ETH_40GBASE_PSM4 of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_40GBASE_PSM4 E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 19 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_40GBASE_SR4 corresponds to the value ETH_40GBASE_SR4 of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_40GBASE_SR4 E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 20 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_4X10GBASE_LR corresponds to the value ETH_4X10GBASE_LR of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_4X10GBASE_LR E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 21 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_4X10GBASE_SR corresponds to the value ETH_4X10GBASE_SR of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_4X10GBASE_SR E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 22 + // OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_UNDEFINED corresponds to the value ETH_UNDEFINED of OpenconfigTransportTypes_ETHERNET_PMD_TYPE + OpenconfigTransportTypes_ETHERNET_PMD_TYPE_ETH_UNDEFINED E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE = 23 +) + + +// E_OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE is a derived int64 type which is used to represent +// the enumerated node OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE. An additional value named +// OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE int64 + +// IsYANGGoEnum ensures that OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE implements the yang.GoEnum +// interface. This ensures that OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE. +func (E_OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE_UNSET corresponds to the value UNSET of OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE + OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE_UNSET E_OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE = 0 + // OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE_LC_CONNECTOR corresponds to the value LC_CONNECTOR of OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE + OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE_LC_CONNECTOR E_OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE = 1 + // OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE_MPO_CONNECTOR corresponds to the value MPO_CONNECTOR of OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE + OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE_MPO_CONNECTOR E_OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE = 2 + // OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE_SC_CONNECTOR corresponds to the value SC_CONNECTOR of OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE + OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE_SC_CONNECTOR E_OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE = 3 +) + + +// E_OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL is a derived int64 type which is used to represent +// the enumerated node OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL. An additional value named +// OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL int64 + +// IsYANGGoEnum ensures that OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL implements the yang.GoEnum +// interface. This ensures that OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL. +func (E_OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL_UNSET corresponds to the value UNSET of OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL + OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL_UNSET E_OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL = 0 + // OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL_AMP corresponds to the value AMP of OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL + OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL_AMP E_OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL = 1 + // OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL_BMP corresponds to the value BMP of OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL + OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL_BMP E_OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL = 2 + // OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL_CBR corresponds to the value CBR of OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL + OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL_CBR E_OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL = 3 + // OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL_GFP_F corresponds to the value GFP_F of OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL + OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL_GFP_F E_OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL = 4 + // OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL_GFP_T corresponds to the value GFP_T of OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL + OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL_GFP_T E_OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL = 5 + // OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL_GMP corresponds to the value GMP of OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL + OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL_GMP E_OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL = 6 +) + + +// E_OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE is a derived int64 type which is used to represent +// the enumerated node OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE. An additional value named +// OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE int64 + +// IsYANGGoEnum ensures that OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE implements the yang.GoEnum +// interface. This ensures that OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE. +func (E_OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE_UNSET corresponds to the value UNSET of OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE + OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE_UNSET E_OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE = 0 + // OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE_PROT_ETHERNET corresponds to the value PROT_ETHERNET of OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE + OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE_PROT_ETHERNET E_OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE = 1 + // OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE_PROT_OTN corresponds to the value PROT_OTN of OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE + OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE_PROT_OTN E_OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE = 2 +) + + +// E_OpenconfigTransportTypes_OTN_APPLICATION_CODE is a derived int64 type which is used to represent +// the enumerated node OpenconfigTransportTypes_OTN_APPLICATION_CODE. An additional value named +// OpenconfigTransportTypes_OTN_APPLICATION_CODE_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigTransportTypes_OTN_APPLICATION_CODE int64 + +// IsYANGGoEnum ensures that OpenconfigTransportTypes_OTN_APPLICATION_CODE implements the yang.GoEnum +// interface. This ensures that OpenconfigTransportTypes_OTN_APPLICATION_CODE can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigTransportTypes_OTN_APPLICATION_CODE) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigTransportTypes_OTN_APPLICATION_CODE. +func (E_OpenconfigTransportTypes_OTN_APPLICATION_CODE) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigTransportTypes_OTN_APPLICATION_CODE_UNSET corresponds to the value UNSET of OpenconfigTransportTypes_OTN_APPLICATION_CODE + OpenconfigTransportTypes_OTN_APPLICATION_CODE_UNSET E_OpenconfigTransportTypes_OTN_APPLICATION_CODE = 0 + // OpenconfigTransportTypes_OTN_APPLICATION_CODE_OTN_UNDEFINED corresponds to the value OTN_UNDEFINED of OpenconfigTransportTypes_OTN_APPLICATION_CODE + OpenconfigTransportTypes_OTN_APPLICATION_CODE_OTN_UNDEFINED E_OpenconfigTransportTypes_OTN_APPLICATION_CODE = 1 + // OpenconfigTransportTypes_OTN_APPLICATION_CODE_P1L1_2D1 corresponds to the value P1L1_2D1 of OpenconfigTransportTypes_OTN_APPLICATION_CODE + OpenconfigTransportTypes_OTN_APPLICATION_CODE_P1L1_2D1 E_OpenconfigTransportTypes_OTN_APPLICATION_CODE = 2 + // OpenconfigTransportTypes_OTN_APPLICATION_CODE_P1L1_2D2 corresponds to the value P1L1_2D2 of OpenconfigTransportTypes_OTN_APPLICATION_CODE + OpenconfigTransportTypes_OTN_APPLICATION_CODE_P1L1_2D2 E_OpenconfigTransportTypes_OTN_APPLICATION_CODE = 3 + // OpenconfigTransportTypes_OTN_APPLICATION_CODE_P1S1_2D2 corresponds to the value P1S1_2D2 of OpenconfigTransportTypes_OTN_APPLICATION_CODE + OpenconfigTransportTypes_OTN_APPLICATION_CODE_P1S1_2D2 E_OpenconfigTransportTypes_OTN_APPLICATION_CODE = 4 +) + + +// E_OpenconfigTransportTypes_SONET_APPLICATION_CODE is a derived int64 type which is used to represent +// the enumerated node OpenconfigTransportTypes_SONET_APPLICATION_CODE. An additional value named +// OpenconfigTransportTypes_SONET_APPLICATION_CODE_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigTransportTypes_SONET_APPLICATION_CODE int64 + +// IsYANGGoEnum ensures that OpenconfigTransportTypes_SONET_APPLICATION_CODE implements the yang.GoEnum +// interface. This ensures that OpenconfigTransportTypes_SONET_APPLICATION_CODE can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigTransportTypes_SONET_APPLICATION_CODE) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigTransportTypes_SONET_APPLICATION_CODE. +func (E_OpenconfigTransportTypes_SONET_APPLICATION_CODE) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigTransportTypes_SONET_APPLICATION_CODE_UNSET corresponds to the value UNSET of OpenconfigTransportTypes_SONET_APPLICATION_CODE + OpenconfigTransportTypes_SONET_APPLICATION_CODE_UNSET E_OpenconfigTransportTypes_SONET_APPLICATION_CODE = 0 + // OpenconfigTransportTypes_SONET_APPLICATION_CODE_SONET_UNDEFINED corresponds to the value SONET_UNDEFINED of OpenconfigTransportTypes_SONET_APPLICATION_CODE + OpenconfigTransportTypes_SONET_APPLICATION_CODE_SONET_UNDEFINED E_OpenconfigTransportTypes_SONET_APPLICATION_CODE = 1 + // OpenconfigTransportTypes_SONET_APPLICATION_CODE_VSR2000_3R2 corresponds to the value VSR2000_3R2 of OpenconfigTransportTypes_SONET_APPLICATION_CODE + OpenconfigTransportTypes_SONET_APPLICATION_CODE_VSR2000_3R2 E_OpenconfigTransportTypes_SONET_APPLICATION_CODE = 2 + // OpenconfigTransportTypes_SONET_APPLICATION_CODE_VSR2000_3R3 corresponds to the value VSR2000_3R3 of OpenconfigTransportTypes_SONET_APPLICATION_CODE + OpenconfigTransportTypes_SONET_APPLICATION_CODE_VSR2000_3R3 E_OpenconfigTransportTypes_SONET_APPLICATION_CODE = 3 + // OpenconfigTransportTypes_SONET_APPLICATION_CODE_VSR2000_3R5 corresponds to the value VSR2000_3R5 of OpenconfigTransportTypes_SONET_APPLICATION_CODE + OpenconfigTransportTypes_SONET_APPLICATION_CODE_VSR2000_3R5 E_OpenconfigTransportTypes_SONET_APPLICATION_CODE = 4 +) + + +// E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE is a derived int64 type which is used to represent +// the enumerated node OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE. An additional value named +// OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE int64 + +// IsYANGGoEnum ensures that OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE implements the yang.GoEnum +// interface. This ensures that OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE. +func (E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_UNSET corresponds to the value UNSET of OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE + OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_UNSET E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE = 0 + // OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_CFP corresponds to the value CFP of OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE + OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_CFP E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE = 1 + // OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_CFP2 corresponds to the value CFP2 of OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE + OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_CFP2 E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE = 2 + // OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_CFP2_ACO corresponds to the value CFP2_ACO of OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE + OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_CFP2_ACO E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE = 3 + // OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_CFP4 corresponds to the value CFP4 of OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE + OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_CFP4 E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE = 4 + // OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_CPAK corresponds to the value CPAK of OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE + OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_CPAK E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE = 5 + // OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_NON_PLUGGABLE corresponds to the value NON_PLUGGABLE of OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE + OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_NON_PLUGGABLE E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE = 6 + // OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_OTHER corresponds to the value OTHER of OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE + OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_OTHER E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE = 7 + // OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_QSFP corresponds to the value QSFP of OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE + OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_QSFP E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE = 8 + // OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_QSFP28 corresponds to the value QSFP28 of OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE + OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_QSFP28 E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE = 9 + // OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_QSFP_PLUS corresponds to the value QSFP_PLUS of OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE + OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_QSFP_PLUS E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE = 10 + // OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_SFP corresponds to the value SFP of OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE + OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_SFP E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE = 11 + // OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_SFP_PLUS corresponds to the value SFP_PLUS of OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE + OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_SFP_PLUS E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE = 12 + // OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_X2 corresponds to the value X2 of OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE + OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_X2 E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE = 13 + // OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_XFP corresponds to the value XFP of OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE + OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE_XFP E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE = 14 +) + + +// E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE is a derived int64 type which is used to represent +// the enumerated node OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE. An additional value named +// OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE int64 + +// IsYANGGoEnum ensures that OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE implements the yang.GoEnum +// interface. This ensures that OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE. +func (E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_UNSET corresponds to the value UNSET of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_UNSET E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 0 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_100GE corresponds to the value PROT_100GE of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_100GE E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 1 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_100G_MLG corresponds to the value PROT_100G_MLG of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_100G_MLG E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 2 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_10GE_LAN corresponds to the value PROT_10GE_LAN of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_10GE_LAN E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 3 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_10GE_WAN corresponds to the value PROT_10GE_WAN of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_10GE_WAN E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 4 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_1GE corresponds to the value PROT_1GE of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_1GE E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 5 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_40GE corresponds to the value PROT_40GE of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_40GE E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 6 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_OC192 corresponds to the value PROT_OC192 of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_OC192 E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 7 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_OC48 corresponds to the value PROT_OC48 of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_OC48 E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 8 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_OC768 corresponds to the value PROT_OC768 of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_OC768 E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 9 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_ODU2 corresponds to the value PROT_ODU2 of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_ODU2 E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 10 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_ODU2E corresponds to the value PROT_ODU2E of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_ODU2E E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 11 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_ODU3 corresponds to the value PROT_ODU3 of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_ODU3 E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 12 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_ODU4 corresponds to the value PROT_ODU4 of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_ODU4 E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 13 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_ODUCN corresponds to the value PROT_ODUCN of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_ODUCN E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 14 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_OTU1E corresponds to the value PROT_OTU1E of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_OTU1E E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 15 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_OTU2 corresponds to the value PROT_OTU2 of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_OTU2 E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 16 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_OTU2E corresponds to the value PROT_OTU2E of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_OTU2E E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 17 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_OTU3 corresponds to the value PROT_OTU3 of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_OTU3 E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 18 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_OTU4 corresponds to the value PROT_OTU4 of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_OTU4 E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 19 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_OTUCN corresponds to the value PROT_OTUCN of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_OTUCN E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 20 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_STM16 corresponds to the value PROT_STM16 of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_STM16 E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 21 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_STM256 corresponds to the value PROT_STM256 of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_STM256 E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 22 + // OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_STM64 corresponds to the value PROT_STM64 of OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE + OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE_PROT_STM64 E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE = 23 +) + + +// E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE is a derived int64 type which is used to represent +// the enumerated node OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE. An additional value named +// OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE int64 + +// IsYANGGoEnum ensures that OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE implements the yang.GoEnum +// interface. This ensures that OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE. +func (E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_UNSET corresponds to the value UNSET of OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE + OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_UNSET E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE = 0 + // OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_1000G corresponds to the value TRIB_RATE_1000G of OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE + OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_1000G E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE = 1 + // OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_100G corresponds to the value TRIB_RATE_100G of OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE + OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_100G E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE = 2 + // OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_10G corresponds to the value TRIB_RATE_10G of OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE + OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_10G E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE = 3 + // OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_1100G corresponds to the value TRIB_RATE_1100G of OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE + OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_1100G E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE = 4 + // OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_150G corresponds to the value TRIB_RATE_150G of OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE + OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_150G E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE = 5 + // OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_1G corresponds to the value TRIB_RATE_1G of OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE + OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_1G E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE = 6 + // OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_2_5G corresponds to the value TRIB_RATE_2_5G of OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE + OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_2_5G E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE = 7 + // OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_200G corresponds to the value TRIB_RATE_200G of OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE + OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_200G E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE = 8 + // OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_250G corresponds to the value TRIB_RATE_250G of OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE + OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_250G E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE = 9 + // OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_300G corresponds to the value TRIB_RATE_300G of OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE + OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_300G E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE = 10 + // OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_400G corresponds to the value TRIB_RATE_400G of OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE + OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_400G E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE = 11 + // OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_40G corresponds to the value TRIB_RATE_40G of OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE + OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_40G E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE = 12 + // OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_500G corresponds to the value TRIB_RATE_500G of OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE + OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_500G E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE = 13 + // OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_600G corresponds to the value TRIB_RATE_600G of OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE + OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_600G E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE = 14 + // OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_700G corresponds to the value TRIB_RATE_700G of OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE + OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_700G E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE = 15 + // OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_800G corresponds to the value TRIB_RATE_800G of OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE + OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_800G E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE = 16 + // OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_900G corresponds to the value TRIB_RATE_900G of OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE + OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE_TRIB_RATE_900G E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE = 17 +) + + +// E_OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY is a derived int64 type which is used to represent +// the enumerated node OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY. An additional value named +// OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY_UNSET is added to the enumeration which is used as +// the nil value, indicating that the enumeration was not explicitly set by +// the program importing the generated structures. +type E_OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY int64 + +// IsYANGGoEnum ensures that OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY implements the yang.GoEnum +// interface. This ensures that OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY can be identified as a +// mapped type for a YANG enumeration. +func (E_OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY) IsYANGGoEnum() {} + +// ΛMap returns the value lookup map associated with OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY. +func (E_OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY) ΛMap() map[string]map[int64]ygot.EnumDefinition { return ΛEnum; } + +const ( + // OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY_UNSET corresponds to the value UNSET of OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY + OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY_UNSET E_OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY = 0 + // OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY_TRIB_SLOT_1_25G corresponds to the value TRIB_SLOT_1_25G of OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY + OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY_TRIB_SLOT_1_25G E_OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY = 1 + // OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY_TRIB_SLOT_2_5G corresponds to the value TRIB_SLOT_2_5G of OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY + OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY_TRIB_SLOT_2_5G E_OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY = 2 + // OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY_TRIB_SLOT_5G corresponds to the value TRIB_SLOT_5G of OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY + OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY_TRIB_SLOT_5G E_OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY = 3 +) + + +// ΛEnum is a map, keyed by the name of the type defined for each enum in the +// generated Go code, which provides a mapping between the constant int64 value +// of each value of the enumeration, and the string that is used to represent it +// in the YANG schema. The map is named ΛEnum in order to avoid clash with any +// valid YANG identifier. +var ΛEnum = map[string]map[int64]ygot.EnumDefinition{ + "E_IETFInterfaces_InterfaceType": { + }, + "E_IETFInterfaces_InterfacesState_Interface_AdminStatus": { + 2: {Name: "up"}, + 3: {Name: "down"}, + 4: {Name: "testing"}, + }, + "E_IETFInterfaces_InterfacesState_Interface_OperStatus": { + 2: {Name: "up"}, + 3: {Name: "down"}, + 4: {Name: "testing"}, + 5: {Name: "unknown"}, + 6: {Name: "dormant"}, + 7: {Name: "not-present"}, + 8: {Name: "lower-layer-down"}, + }, + "E_OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY": { + 1: {Name: "CRITICAL", DefiningModule: "openconfig-alarm-types"}, + 2: {Name: "MAJOR", DefiningModule: "openconfig-alarm-types"}, + 3: {Name: "MINOR", DefiningModule: "openconfig-alarm-types"}, + 4: {Name: "UNKNOWN", DefiningModule: "openconfig-alarm-types"}, + 5: {Name: "WARNING", DefiningModule: "openconfig-alarm-types"}, + }, + "E_OpenconfigIfEthernet_ETHERNET_SPEED": { + 1: {Name: "SPEED_100GB", DefiningModule: "openconfig-if-ethernet"}, + 2: {Name: "SPEED_100MB", DefiningModule: "openconfig-if-ethernet"}, + 3: {Name: "SPEED_10GB", DefiningModule: "openconfig-if-ethernet"}, + 4: {Name: "SPEED_10MB", DefiningModule: "openconfig-if-ethernet"}, + 5: {Name: "SPEED_1GB", DefiningModule: "openconfig-if-ethernet"}, + 6: {Name: "SPEED_2500MB", DefiningModule: "openconfig-if-ethernet"}, + 7: {Name: "SPEED_25GB", DefiningModule: "openconfig-if-ethernet"}, + 8: {Name: "SPEED_40GB", DefiningModule: "openconfig-if-ethernet"}, + 9: {Name: "SPEED_50GB", DefiningModule: "openconfig-if-ethernet"}, + 10: {Name: "SPEED_5GB", DefiningModule: "openconfig-if-ethernet"}, + 11: {Name: "SPEED_UNKNOWN", DefiningModule: "openconfig-if-ethernet"}, + }, + "E_OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode": { + 1: {Name: "FULL"}, + 2: {Name: "HALF"}, + }, + "E_OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode": { + 1: {Name: "FULL"}, + 2: {Name: "HALF"}, + }, + "E_OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus": { + 1: {Name: "UP"}, + 2: {Name: "DOWN"}, + 3: {Name: "TESTING"}, + }, + "E_OpenconfigInterfaces_Interfaces_Interface_State_OperStatus": { + 2: {Name: "UP"}, + 3: {Name: "DOWN"}, + 4: {Name: "TESTING"}, + 5: {Name: "UNKNOWN"}, + 6: {Name: "DORMANT"}, + 7: {Name: "NOT_PRESENT"}, + 8: {Name: "LOWER_LAYER_DOWN"}, + }, + "E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY": { + 1: {Name: "C_VLAN", DefiningModule: "openconfig-lldp-types"}, + 2: {Name: "DOCSIS_CABLE_DEVICE", DefiningModule: "openconfig-lldp-types"}, + 3: {Name: "MAC_BRIDGE", DefiningModule: "openconfig-lldp-types"}, + 4: {Name: "OTHER", DefiningModule: "openconfig-lldp-types"}, + 5: {Name: "REPEATER", DefiningModule: "openconfig-lldp-types"}, + 6: {Name: "ROUTER", DefiningModule: "openconfig-lldp-types"}, + 7: {Name: "STATION_ONLY", DefiningModule: "openconfig-lldp-types"}, + 8: {Name: "S_VLAN", DefiningModule: "openconfig-lldp-types"}, + 9: {Name: "TELEPHONE", DefiningModule: "openconfig-lldp-types"}, + 10: {Name: "TWO_PORT_MAC_RELAY", DefiningModule: "openconfig-lldp-types"}, + 11: {Name: "WLAN_ACCESS_POINT", DefiningModule: "openconfig-lldp-types"}, + }, + "E_OpenconfigLldpTypes_LLDP_TLV": { + 1: {Name: "CHASSIS_ID", DefiningModule: "openconfig-lldp-types"}, + 2: {Name: "MANAGEMENT_ADDRESS", DefiningModule: "openconfig-lldp-types"}, + 3: {Name: "PORT_DESCRIPTION", DefiningModule: "openconfig-lldp-types"}, + 4: {Name: "PORT_ID", DefiningModule: "openconfig-lldp-types"}, + 5: {Name: "SYSTEM_CAPABILITIES", DefiningModule: "openconfig-lldp-types"}, + 6: {Name: "SYSTEM_DESCRIPTION", DefiningModule: "openconfig-lldp-types"}, + 7: {Name: "SYSTEM_NAME", DefiningModule: "openconfig-lldp-types"}, + }, + "E_OpenconfigLldp_ChassisIdType": { + 1: {Name: "CHASSIS_COMPONENT"}, + 2: {Name: "INTERFACE_ALIAS"}, + 3: {Name: "PORT_COMPONENT"}, + 4: {Name: "MAC_ADDRESS"}, + 5: {Name: "NETWORK_ADDRESS"}, + 6: {Name: "INTERFACE_NAME"}, + 7: {Name: "LOCAL"}, + }, + "E_OpenconfigLldp_PortIdType": { + 1: {Name: "INTERFACE_ALIAS"}, + 2: {Name: "PORT_COMPONENT"}, + 3: {Name: "MAC_ADDRESS"}, + 4: {Name: "NETWORK_ADDRESS"}, + 5: {Name: "INTERFACE_NAME"}, + 6: {Name: "AGENT_CIRCUIT_ID"}, + 7: {Name: "LOCAL"}, + }, + "E_OpenconfigPlatformTypes_COMPONENT_OPER_STATUS": { + 1: {Name: "ACTIVE", DefiningModule: "openconfig-platform-types"}, + 2: {Name: "DISABLED", DefiningModule: "openconfig-platform-types"}, + 3: {Name: "INACTIVE", DefiningModule: "openconfig-platform-types"}, + }, + "E_OpenconfigPlatformTypes_FEC_MODE_TYPE": { + 1: {Name: "FEC_AUTO", DefiningModule: "openconfig-platform-types"}, + 2: {Name: "FEC_DISABLED", DefiningModule: "openconfig-platform-types"}, + 3: {Name: "FEC_ENABLED", DefiningModule: "openconfig-platform-types"}, + }, + "E_OpenconfigPlatformTypes_FEC_STATUS_TYPE": { + 1: {Name: "FEC_STATUS_LOCKED", DefiningModule: "openconfig-platform-types"}, + 2: {Name: "FEC_STATUS_UNLOCKED", DefiningModule: "openconfig-platform-types"}, + }, + "E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT": { + 1: {Name: "BACKPLANE", DefiningModule: "openconfig-platform-types"}, + 2: {Name: "CHASSIS", DefiningModule: "openconfig-platform-types"}, + 3: {Name: "CONTROLLER_CARD", DefiningModule: "openconfig-platform-types"}, + 4: {Name: "CPU", DefiningModule: "openconfig-platform-types"}, + 5: {Name: "FABRIC", DefiningModule: "openconfig-platform-types"}, + 6: {Name: "FAN", DefiningModule: "openconfig-platform-types"}, + 7: {Name: "FRU", DefiningModule: "openconfig-platform-types"}, + 8: {Name: "INTEGRATED_CIRCUIT", DefiningModule: "openconfig-platform-types"}, + 9: {Name: "LINECARD", DefiningModule: "openconfig-platform-types"}, + 10: {Name: "OPTICAL_CHANNEL", DefiningModule: "openconfig-transport-types"}, + 11: {Name: "PORT", DefiningModule: "openconfig-platform-types"}, + 12: {Name: "POWER_SUPPLY", DefiningModule: "openconfig-platform-types"}, + 13: {Name: "SENSOR", DefiningModule: "openconfig-platform-types"}, + 14: {Name: "STORAGE", DefiningModule: "openconfig-platform-types"}, + 15: {Name: "TRANSCEIVER", DefiningModule: "openconfig-platform-types"}, + }, + "E_OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT": { + 1: {Name: "OPERATING_SYSTEM", DefiningModule: "openconfig-platform-types"}, + 2: {Name: "OPERATING_SYSTEM_UPDATE", DefiningModule: "openconfig-platform-types"}, + }, + "E_OpenconfigPlatform_Components_Component_Transceiver_State_Present": { + 1: {Name: "PRESENT"}, + 2: {Name: "NOT_PRESENT"}, + }, + "E_OpenconfigTerminalDevice_AdminStateType": { + 1: {Name: "ENABLED"}, + 2: {Name: "DISABLED"}, + 3: {Name: "MAINT"}, + }, + "E_OpenconfigTerminalDevice_LoopbackModeType": { + 1: {Name: "NONE"}, + 2: {Name: "FACILITY"}, + 3: {Name: "TERMINAL"}, + }, + "E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls": { + 1: {Name: "NONE"}, + 2: {Name: "LASER_SHUTDOWN"}, + 3: {Name: "ETHERNET"}, + }, + "E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType": { + 1: {Name: "LOGICAL_CHANNEL"}, + 2: {Name: "OPTICAL_CHANNEL"}, + }, + "E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState": { + 1: {Name: "UP"}, + 2: {Name: "DOWN"}, + 3: {Name: "TESTING"}, + }, + "E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE": { + 1: {Name: "ETH_100GBASE_CLR4", DefiningModule: "openconfig-transport-types"}, + 2: {Name: "ETH_100GBASE_CR4", DefiningModule: "openconfig-transport-types"}, + 3: {Name: "ETH_100GBASE_CWDM4", DefiningModule: "openconfig-transport-types"}, + 4: {Name: "ETH_100GBASE_ER4", DefiningModule: "openconfig-transport-types"}, + 5: {Name: "ETH_100GBASE_LR4", DefiningModule: "openconfig-transport-types"}, + 6: {Name: "ETH_100GBASE_PSM4", DefiningModule: "openconfig-transport-types"}, + 7: {Name: "ETH_100GBASE_SR10", DefiningModule: "openconfig-transport-types"}, + 8: {Name: "ETH_100GBASE_SR4", DefiningModule: "openconfig-transport-types"}, + 9: {Name: "ETH_100G_ACC", DefiningModule: "openconfig-transport-types"}, + 10: {Name: "ETH_100G_AOC", DefiningModule: "openconfig-transport-types"}, + 11: {Name: "ETH_10GBASE_ER", DefiningModule: "openconfig-transport-types"}, + 12: {Name: "ETH_10GBASE_LR", DefiningModule: "openconfig-transport-types"}, + 13: {Name: "ETH_10GBASE_LRM", DefiningModule: "openconfig-transport-types"}, + 14: {Name: "ETH_10GBASE_SR", DefiningModule: "openconfig-transport-types"}, + 15: {Name: "ETH_10GBASE_ZR", DefiningModule: "openconfig-transport-types"}, + 16: {Name: "ETH_40GBASE_CR4", DefiningModule: "openconfig-transport-types"}, + 17: {Name: "ETH_40GBASE_ER4", DefiningModule: "openconfig-transport-types"}, + 18: {Name: "ETH_40GBASE_LR4", DefiningModule: "openconfig-transport-types"}, + 19: {Name: "ETH_40GBASE_PSM4", DefiningModule: "openconfig-transport-types"}, + 20: {Name: "ETH_40GBASE_SR4", DefiningModule: "openconfig-transport-types"}, + 21: {Name: "ETH_4X10GBASE_LR", DefiningModule: "openconfig-transport-types"}, + 22: {Name: "ETH_4X10GBASE_SR", DefiningModule: "openconfig-transport-types"}, + 23: {Name: "ETH_UNDEFINED", DefiningModule: "openconfig-transport-types"}, + }, + "E_OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE": { + 1: {Name: "LC_CONNECTOR", DefiningModule: "openconfig-transport-types"}, + 2: {Name: "MPO_CONNECTOR", DefiningModule: "openconfig-transport-types"}, + 3: {Name: "SC_CONNECTOR", DefiningModule: "openconfig-transport-types"}, + }, + "E_OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL": { + 1: {Name: "AMP", DefiningModule: "openconfig-transport-types"}, + 2: {Name: "BMP", DefiningModule: "openconfig-transport-types"}, + 3: {Name: "CBR", DefiningModule: "openconfig-transport-types"}, + 4: {Name: "GFP_F", DefiningModule: "openconfig-transport-types"}, + 5: {Name: "GFP_T", DefiningModule: "openconfig-transport-types"}, + 6: {Name: "GMP", DefiningModule: "openconfig-transport-types"}, + }, + "E_OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE": { + 1: {Name: "PROT_ETHERNET", DefiningModule: "openconfig-transport-types"}, + 2: {Name: "PROT_OTN", DefiningModule: "openconfig-transport-types"}, + }, + "E_OpenconfigTransportTypes_OTN_APPLICATION_CODE": { + 1: {Name: "OTN_UNDEFINED", DefiningModule: "openconfig-transport-types"}, + 2: {Name: "P1L1_2D1", DefiningModule: "openconfig-transport-types"}, + 3: {Name: "P1L1_2D2", DefiningModule: "openconfig-transport-types"}, + 4: {Name: "P1S1_2D2", DefiningModule: "openconfig-transport-types"}, + }, + "E_OpenconfigTransportTypes_SONET_APPLICATION_CODE": { + 1: {Name: "SONET_UNDEFINED", DefiningModule: "openconfig-transport-types"}, + 2: {Name: "VSR2000_3R2", DefiningModule: "openconfig-transport-types"}, + 3: {Name: "VSR2000_3R3", DefiningModule: "openconfig-transport-types"}, + 4: {Name: "VSR2000_3R5", DefiningModule: "openconfig-transport-types"}, + }, + "E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE": { + 1: {Name: "CFP", DefiningModule: "openconfig-transport-types"}, + 2: {Name: "CFP2", DefiningModule: "openconfig-transport-types"}, + 3: {Name: "CFP2_ACO", DefiningModule: "openconfig-transport-types"}, + 4: {Name: "CFP4", DefiningModule: "openconfig-transport-types"}, + 5: {Name: "CPAK", DefiningModule: "openconfig-transport-types"}, + 6: {Name: "NON_PLUGGABLE", DefiningModule: "openconfig-transport-types"}, + 7: {Name: "OTHER", DefiningModule: "openconfig-transport-types"}, + 8: {Name: "QSFP", DefiningModule: "openconfig-transport-types"}, + 9: {Name: "QSFP28", DefiningModule: "openconfig-transport-types"}, + 10: {Name: "QSFP_PLUS", DefiningModule: "openconfig-transport-types"}, + 11: {Name: "SFP", DefiningModule: "openconfig-transport-types"}, + 12: {Name: "SFP_PLUS", DefiningModule: "openconfig-transport-types"}, + 13: {Name: "X2", DefiningModule: "openconfig-transport-types"}, + 14: {Name: "XFP", DefiningModule: "openconfig-transport-types"}, + }, + "E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE": { + 1: {Name: "PROT_100GE", DefiningModule: "openconfig-transport-types"}, + 2: {Name: "PROT_100G_MLG", DefiningModule: "openconfig-transport-types"}, + 3: {Name: "PROT_10GE_LAN", DefiningModule: "openconfig-transport-types"}, + 4: {Name: "PROT_10GE_WAN", DefiningModule: "openconfig-transport-types"}, + 5: {Name: "PROT_1GE", DefiningModule: "openconfig-transport-types"}, + 6: {Name: "PROT_40GE", DefiningModule: "openconfig-transport-types"}, + 7: {Name: "PROT_OC192", DefiningModule: "openconfig-transport-types"}, + 8: {Name: "PROT_OC48", DefiningModule: "openconfig-transport-types"}, + 9: {Name: "PROT_OC768", DefiningModule: "openconfig-transport-types"}, + 10: {Name: "PROT_ODU2", DefiningModule: "openconfig-transport-types"}, + 11: {Name: "PROT_ODU2E", DefiningModule: "openconfig-transport-types"}, + 12: {Name: "PROT_ODU3", DefiningModule: "openconfig-transport-types"}, + 13: {Name: "PROT_ODU4", DefiningModule: "openconfig-transport-types"}, + 14: {Name: "PROT_ODUCN", DefiningModule: "openconfig-transport-types"}, + 15: {Name: "PROT_OTU1E", DefiningModule: "openconfig-transport-types"}, + 16: {Name: "PROT_OTU2", DefiningModule: "openconfig-transport-types"}, + 17: {Name: "PROT_OTU2E", DefiningModule: "openconfig-transport-types"}, + 18: {Name: "PROT_OTU3", DefiningModule: "openconfig-transport-types"}, + 19: {Name: "PROT_OTU4", DefiningModule: "openconfig-transport-types"}, + 20: {Name: "PROT_OTUCN", DefiningModule: "openconfig-transport-types"}, + 21: {Name: "PROT_STM16", DefiningModule: "openconfig-transport-types"}, + 22: {Name: "PROT_STM256", DefiningModule: "openconfig-transport-types"}, + 23: {Name: "PROT_STM64", DefiningModule: "openconfig-transport-types"}, + }, + "E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE": { + 1: {Name: "TRIB_RATE_1000G", DefiningModule: "openconfig-transport-types"}, + 2: {Name: "TRIB_RATE_100G", DefiningModule: "openconfig-transport-types"}, + 3: {Name: "TRIB_RATE_10G", DefiningModule: "openconfig-transport-types"}, + 4: {Name: "TRIB_RATE_1100G", DefiningModule: "openconfig-transport-types"}, + 5: {Name: "TRIB_RATE_150G", DefiningModule: "openconfig-transport-types"}, + 6: {Name: "TRIB_RATE_1G", DefiningModule: "openconfig-transport-types"}, + 7: {Name: "TRIB_RATE_2.5G", DefiningModule: "openconfig-transport-types"}, + 8: {Name: "TRIB_RATE_200G", DefiningModule: "openconfig-transport-types"}, + 9: {Name: "TRIB_RATE_250G", DefiningModule: "openconfig-transport-types"}, + 10: {Name: "TRIB_RATE_300G", DefiningModule: "openconfig-transport-types"}, + 11: {Name: "TRIB_RATE_400G", DefiningModule: "openconfig-transport-types"}, + 12: {Name: "TRIB_RATE_40G", DefiningModule: "openconfig-transport-types"}, + 13: {Name: "TRIB_RATE_500G", DefiningModule: "openconfig-transport-types"}, + 14: {Name: "TRIB_RATE_600G", DefiningModule: "openconfig-transport-types"}, + 15: {Name: "TRIB_RATE_700G", DefiningModule: "openconfig-transport-types"}, + 16: {Name: "TRIB_RATE_800G", DefiningModule: "openconfig-transport-types"}, + 17: {Name: "TRIB_RATE_900G", DefiningModule: "openconfig-transport-types"}, + }, + "E_OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY": { + 1: {Name: "TRIB_SLOT_1.25G", DefiningModule: "openconfig-transport-types"}, + 2: {Name: "TRIB_SLOT_2.5G", DefiningModule: "openconfig-transport-types"}, + 3: {Name: "TRIB_SLOT_5G", DefiningModule: "openconfig-transport-types"}, + }, +} + + +var ( + // ySchema is a byte slice contain a gzip compressed representation of the + // YANG schema from which the Go code was generated. When uncompressed the + // contents of the byte slice is a JSON document containing an object, keyed + // on the name of the generated struct, and containing the JSON marshalled + // contents of a goyang yang.Entry struct, which defines the schema for the + // fields within the struct. + ySchema = []byte{ + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x6b, 0x73, 0xdb, 0xb8, + 0x96, 0xf7, 0xfb, 0xde, 0x9f, 0x42, 0xa5, 0x9a, 0x17, 0xdd, 0x67, 0x87, 0xb1, 0x24, 0xcb, 0xb7, + 0x54, 0x9d, 0x9a, 0x92, 0x6d, 0x25, 0xf1, 0x69, 0x5f, 0xf4, 0x58, 0xca, 0xee, 0xe9, 0xdd, 0xf6, + 0xa8, 0x68, 0x12, 0xb2, 0xf9, 0x84, 0x22, 0x35, 0x24, 0xe4, 0x8e, 0x77, 0x4f, 0xbe, 0xfb, 0x29, + 0xdd, 0xa8, 0xbb, 0x44, 0x00, 0x0b, 0x14, 0x49, 0xfd, 0xbb, 0x76, 0xed, 0x38, 0x8e, 0x08, 0x91, + 0x00, 0xd6, 0x5a, 0xbf, 0xf5, 0x07, 0xb8, 0xf0, 0xf7, 0x41, 0xa1, 0x50, 0x28, 0x14, 0xef, 0xcc, + 0x2e, 0x2b, 0x7e, 0x2a, 0x14, 0x6d, 0xf6, 0xe6, 0x58, 0xac, 0xf8, 0x61, 0xf4, 0xdb, 0xdf, 0x1c, + 0xcf, 0x2e, 0x7e, 0x2a, 0x94, 0xc7, 0x7f, 0xbd, 0xf4, 0xbd, 0x8e, 0xf3, 0x52, 0xfc, 0x54, 0x28, + 0x8d, 0x7f, 0x71, 0xe5, 0x04, 0xc5, 0x4f, 0x85, 0x51, 0x13, 0xc3, 0x5f, 0x58, 0x7e, 0xb7, 0xe7, + 0x7b, 0xcc, 0xe3, 0xe1, 0xdc, 0xef, 0xe7, 0xbe, 0x62, 0xe6, 0x33, 0x1f, 0xe6, 0x3f, 0x31, 0xff, + 0x75, 0xd1, 0xaf, 0x17, 0xbf, 0x36, 0xfa, 0x87, 0x46, 0xc0, 0x3a, 0xce, 0x8f, 0xa5, 0x6f, 0x9a, + 0xfb, 0x36, 0xdf, 0x32, 0x7a, 0xae, 0xc9, 0x3b, 0x7e, 0xd0, 0x5d, 0xf8, 0xba, 0xe1, 0xc7, 0x9a, + 0x7e, 0x3f, 0xb0, 0xd8, 0xca, 0x26, 0x46, 0xb7, 0xc4, 0xde, 0xff, 0xf2, 0x83, 0xc1, 0x5d, 0x15, + 0x7b, 0xa3, 0x6f, 0xfb, 0xb0, 0xfa, 0x83, 0x5f, 0xcd, 0xb0, 0x16, 0xbc, 0xf4, 0xbb, 0xcc, 0xe3, + 0xc5, 0x4f, 0x05, 0x1e, 0xf4, 0xd9, 0x9a, 0x0f, 0xce, 0x7c, 0x6a, 0xee, 0xe6, 0x96, 0x3e, 0xfd, + 0x73, 0xee, 0x37, 0x3f, 0x17, 0x9e, 0x7d, 0xb1, 0xeb, 0x97, 0x87, 0x60, 0xfd, 0x43, 0x2d, 0x8d, + 0xc4, 0xba, 0x87, 0x5a, 0x3d, 0x20, 0x5b, 0x07, 0x26, 0xce, 0x00, 0x09, 0x0e, 0x54, 0xdc, 0x01, + 0x13, 0x1e, 0x38, 0xe1, 0x01, 0x14, 0x1f, 0xc8, 0xd5, 0x03, 0xba, 0x66, 0x60, 0xb7, 0x0e, 0x70, + 0xf4, 0x81, 0x67, 0xd3, 0xfa, 0xde, 0x73, 0x4d, 0x2f, 0x46, 0x67, 0x4c, 0xfa, 0x78, 0x7a, 0xc9, + 0x96, 0x67, 0xdb, 0x3c, 0xf0, 0xb1, 0x27, 0x80, 0xc8, 0x44, 0x90, 0x9c, 0x10, 0xa2, 0x13, 0x43, + 0x7a, 0x82, 0x48, 0x4f, 0x14, 0xf9, 0x09, 0xb3, 0x79, 0xe2, 0x6c, 0x99, 0x40, 0xb1, 0x27, 0xd2, + 0x8c, 0xe7, 0x18, 0x8f, 0x66, 0xcc, 0x1e, 0x9c, 0xba, 0x91, 0xe1, 0x75, 0x31, 0x7b, 0x21, 0xde, + 0xd4, 0x12, 0x9e, 0x62, 0x32, 0x53, 0x4d, 0x71, 0xca, 0xc9, 0x4e, 0x3d, 0xe5, 0x29, 0xa8, 0x3c, + 0x15, 0xd5, 0xa7, 0x64, 0xbc, 0xa9, 0x19, 0x73, 0x8a, 0x4e, 0x6f, 0xc7, 0xf3, 0x7c, 0x6e, 0x72, + 0xc7, 0xf7, 0xc4, 0xc6, 0x2f, 0xb4, 0x5e, 0x59, 0xd7, 0xec, 0x99, 0xfc, 0x75, 0xf0, 0x20, 0x87, + 0x7e, 0x8f, 0x79, 0xa3, 0x49, 0x19, 0x3d, 0xd1, 0xe1, 0x94, 0x3a, 0xa6, 0x3f, 0x1e, 0x46, 0xfe, + 0xf0, 0x50, 0x68, 0x0e, 0x8f, 0xbe, 0x93, 0x07, 0x7d, 0x8b, 0x7b, 0xe3, 0x99, 0x73, 0x1f, 0x7d, + 0x65, 0x63, 0xfc, 0x8d, 0xed, 0xcb, 0xe8, 0x1b, 0xa7, 0x3f, 0xb6, 0x2f, 0x26, 0xdf, 0xd8, 0x1e, + 0x4f, 0xec, 0x03, 0x9a, 0x5e, 0x8e, 0xd1, 0xc3, 0xc5, 0x90, 0x9b, 0x9c, 0x89, 0x9b, 0xf7, 0xe8, + 0x32, 0xcd, 0xd6, 0x5d, 0x81, 0x75, 0xc3, 0xba, 0xb5, 0x59, 0xb7, 0xc8, 0x14, 0x26, 0x31, 0xee, + 0xe6, 0xf0, 0x0b, 0xa9, 0x6c, 0x5b, 0x29, 0xfc, 0x0b, 0xf6, 0xba, 0x7a, 0x6f, 0x17, 0x63, 0xb9, + 0x22, 0xa5, 0xfe, 0xdd, 0xdc, 0xb3, 0xeb, 0xfb, 0x6b, 0x43, 0x5f, 0x15, 0xad, 0x57, 0x33, 0x0c, + 0x9d, 0x30, 0x3e, 0x4c, 0x4f, 0x2e, 0x00, 0x4a, 0x03, 0xa5, 0x81, 0xd2, 0x08, 0xb6, 0xfb, 0x1d, + 0x6c, 0xc7, 0xde, 0x30, 0x31, 0x90, 0xbe, 0x1c, 0x7d, 0x1f, 0x30, 0x1a, 0x18, 0x0d, 0xcb, 0x4e, + 0xc4, 0xb2, 0x13, 0x82, 0xe8, 0x89, 0x61, 0xef, 0x21, 0x42, 0xc7, 0x23, 0x4a, 0xf5, 0xbe, 0xd5, + 0x82, 0xcf, 0xf1, 0x88, 0x47, 0x8c, 0x74, 0x00, 0xcf, 0xfb, 0x08, 0xcf, 0xe3, 0x59, 0x2d, 0x18, + 0x5f, 0x87, 0x57, 0x89, 0x85, 0xd7, 0x12, 0xc0, 0x19, 0xe1, 0x75, 0xf1, 0x76, 0x5a, 0xef, 0x3d, + 0x26, 0x37, 0x72, 0x21, 0x0f, 0x1c, 0x4f, 0x08, 0x7d, 0x27, 0xee, 0xed, 0x6c, 0xbf, 0xc2, 0x5c, + 0xdc, 0x14, 0x41, 0x36, 0xca, 0xc5, 0x48, 0x09, 0x24, 0x83, 0x5c, 0xaf, 0x2f, 0x10, 0xe1, 0x7a, + 0x7d, 0x84, 0x37, 0x84, 0x37, 0x68, 0x43, 0x08, 0x71, 0xfb, 0x9e, 0x41, 0xf6, 0xfa, 0xc9, 0xe9, + 0x42, 0xbd, 0x3e, 0x34, 0x21, 0x68, 0x42, 0xb0, 0x68, 0xed, 0x16, 0x9d, 0x94, 0x1e, 0xd4, 0xeb, + 0xef, 0xa5, 0x16, 0xb4, 0x95, 0x1e, 0xd5, 0xfa, 0x54, 0x07, 0x1e, 0x77, 0xcc, 0xe7, 0xc0, 0xb1, + 0xe2, 0x13, 0xf2, 0xf8, 0xf3, 0x80, 0x64, 0x40, 0x32, 0x20, 0x19, 0x21, 0x75, 0xbf, 0x43, 0xea, + 0xc8, 0x19, 0x26, 0xc6, 0xc9, 0x9f, 0x87, 0x5f, 0x07, 0x54, 0x06, 0x2a, 0xc3, 0xae, 0x93, 0xb0, + 0xeb, 0x84, 0x68, 0x79, 0x6c, 0xd6, 0x7b, 0x08, 0xcc, 0xb1, 0x60, 0x52, 0xb9, 0x67, 0xf5, 0x60, + 0xb3, 0x27, 0xc2, 0xcc, 0x1e, 0x80, 0x19, 0xc0, 0x0c, 0x60, 0x46, 0x60, 0xdd, 0xfb, 0xc0, 0xea, + 0x25, 0x48, 0xcb, 0x1e, 0x50, 0x19, 0xa8, 0x0c, 0x8b, 0xd6, 0x6e, 0xd1, 0x89, 0x71, 0xb2, 0xb7, + 0x9f, 0x90, 0xec, 0xe9, 0x24, 0x64, 0x4f, 0x07, 0x1e, 0x3b, 0x1e, 0x67, 0x2f, 0x81, 0xc9, 0x99, + 0x6d, 0x58, 0x4e, 0x60, 0xf5, 0x1d, 0x1e, 0x9f, 0x96, 0x57, 0x5c, 0x0b, 0x78, 0x06, 0x3c, 0x03, + 0x9e, 0x11, 0x6a, 0xf7, 0x3b, 0xd4, 0x2e, 0x3b, 0xc6, 0xc4, 0x58, 0xfa, 0x3a, 0xfa, 0xea, 0xcb, + 0xd1, 0x37, 0x83, 0xac, 0x41, 0xd6, 0x30, 0xf7, 0xa4, 0xcd, 0x3d, 0x21, 0xd0, 0x5e, 0xb6, 0xf6, + 0x3d, 0xc4, 0x6e, 0x61, 0x0c, 0xa5, 0xec, 0x70, 0x1d, 0x4c, 0x1e, 0xeb, 0x15, 0x0d, 0x91, 0x57, + 0x33, 0x62, 0xbe, 0x92, 0x01, 0xee, 0xce, 0x02, 0x77, 0xc7, 0x7e, 0x85, 0x22, 0xea, 0x79, 0x97, + 0x99, 0x9d, 0x80, 0x75, 0xe2, 0xf4, 0xfa, 0x24, 0xac, 0x9e, 0xc6, 0xf8, 0x6c, 0x63, 0x6c, 0xa9, + 0x1f, 0x3f, 0x8e, 0xe9, 0xe6, 0x70, 0x38, 0x15, 0x35, 0x18, 0x84, 0xdf, 0xe3, 0x8e, 0x65, 0xba, + 0x86, 0xf5, 0x6a, 0x7a, 0x1e, 0x73, 0xe3, 0xdb, 0xc6, 0xe2, 0x85, 0xd9, 0x48, 0x4f, 0xfd, 0x1e, + 0x37, 0x38, 0xcb, 0xa9, 0x99, 0x44, 0x0f, 0x87, 0xf4, 0x34, 0x45, 0xe9, 0xa9, 0xc0, 0x94, 0xcb, + 0x1f, 0xaf, 0xc6, 0x9f, 0x92, 0x7a, 0x78, 0x35, 0xee, 0x54, 0x8d, 0x2e, 0xe8, 0x04, 0xec, 0x7f, + 0xfa, 0xcc, 0xb3, 0xde, 0xc5, 0x3b, 0x3f, 0x5a, 0xe9, 0x8e, 0x9a, 0x10, 0xec, 0x3b, 0xb1, 0xb7, + 0x3b, 0xa5, 0x27, 0xb4, 0xca, 0xc4, 0x26, 0x9a, 0xe0, 0xaa, 0x13, 0x9d, 0x6c, 0xc2, 0x93, 0x4d, + 0x7c, 0x3a, 0x03, 0x10, 0x33, 0x04, 0x41, 0x83, 0x10, 0x47, 0x9d, 0xed, 0xd3, 0xdc, 0xe0, 0x83, + 0xb6, 0x24, 0x06, 0x7f, 0x3c, 0xdf, 0xcf, 0x24, 0x2e, 0xfd, 0xe6, 0x39, 0xc3, 0x52, 0xcd, 0xc5, + 0xdb, 0xaf, 0xff, 0x96, 0xf9, 0xea, 0x07, 0xd3, 0x7b, 0x19, 0x3c, 0xc5, 0x9f, 0x52, 0x83, 0x2c, + 0x37, 0x59, 0x87, 0x5f, 0x7c, 0xeb, 0x78, 0xd2, 0xb3, 0x5d, 0xd1, 0x51, 0x2c, 0x35, 0xf3, 0x4f, + 0xd3, 0xed, 0x33, 0x82, 0x76, 0x3e, 0x07, 0xa6, 0x35, 0xc8, 0x45, 0xaf, 0x9c, 0x97, 0xd1, 0xa8, + 0x94, 0xa4, 0xdb, 0xfb, 0xf9, 0x41, 0xa1, 0x6b, 0xcd, 0x1f, 0xa9, 0xeb, 0xda, 0xf2, 0x59, 0xb5, + 0x7a, 0x72, 0x5a, 0xad, 0x96, 0x4e, 0x8f, 0x4e, 0x4b, 0xe7, 0xc7, 0xc7, 0xe5, 0x93, 0xf2, 0x71, + 0x8a, 0x7a, 0xfb, 0x20, 0x99, 0xab, 0x9e, 0x0e, 0xf4, 0xb4, 0x2f, 0x30, 0x5b, 0x8a, 0xae, 0xe3, + 0x31, 0xa3, 0xe7, 0x07, 0x5c, 0x3e, 0xb0, 0x4f, 0x9b, 0x40, 0x60, 0x47, 0x60, 0xcf, 0x6d, 0x60, + 0x8f, 0xaf, 0x69, 0xa8, 0x68, 0x1c, 0x6b, 0x35, 0x8f, 0xc3, 0x19, 0xc1, 0xe7, 0xd3, 0x8c, 0x2a, + 0xb9, 0xf2, 0xd7, 0x73, 0xbf, 0xdd, 0xae, 0x91, 0x24, 0xe3, 0x6a, 0xfc, 0x1e, 0x0b, 0x86, 0xe2, + 0xac, 0xe9, 0x1a, 0x5d, 0xdf, 0x66, 0xf2, 0x1e, 0x67, 0xa9, 0x25, 0x38, 0x1e, 0x38, 0x9e, 0xdc, + 0x3a, 0x9e, 0xbe, 0xe3, 0xf1, 0xf2, 0x89, 0x82, 0xdf, 0x39, 0x41, 0x26, 0x80, 0x4c, 0x20, 0xa5, + 0x99, 0xc0, 0xc9, 0xf1, 0xf1, 0x11, 0xd0, 0x7f, 0x27, 0xf1, 0x98, 0x9b, 0xc1, 0x0b, 0xe3, 0x86, + 0xdf, 0xe7, 0xbd, 0x3e, 0x37, 0x7a, 0xfe, 0x5f, 0x2c, 0x90, 0x0f, 0xc9, 0xab, 0x1a, 0x43, 0x54, + 0x46, 0x54, 0xce, 0x6d, 0x54, 0xb6, 0x99, 0xe5, 0x74, 0x4d, 0xf7, 0xa4, 0xaa, 0x92, 0x10, 0x54, + 0x24, 0xae, 0x5d, 0xf2, 0x76, 0x95, 0x7d, 0x0d, 0xef, 0x15, 0x84, 0x77, 0x5d, 0xe1, 0xfd, 0x28, + 0x87, 0x5d, 0x9b, 0xf5, 0xd0, 0x9e, 0xe9, 0x1d, 0x6b, 0x0b, 0xfb, 0x22, 0x12, 0xdb, 0x9d, 0x7a, + 0x3f, 0xfa, 0xde, 0xcb, 0xd1, 0xd7, 0x62, 0x6b, 0xea, 0x2e, 0xb6, 0xa6, 0x62, 0xa9, 0x3f, 0x4b, + 0x4b, 0xfd, 0xd6, 0x6b, 0xe0, 0x77, 0x4d, 0xee, 0x58, 0x86, 0xed, 0x84, 0x3d, 0x16, 0x84, 0xa2, + 0x3e, 0xa2, 0x30, 0x7f, 0xaa, 0xce, 0x8a, 0xd6, 0xe4, 0x12, 0x83, 0x32, 0x12, 0x03, 0x24, 0x06, + 0xba, 0x13, 0x03, 0x51, 0x73, 0x89, 0x2e, 0x34, 0xdf, 0x5e, 0xe4, 0x87, 0x6b, 0x32, 0x6b, 0x06, + 0x8d, 0x48, 0xf6, 0xaf, 0x9a, 0x2e, 0x23, 0x6d, 0x2c, 0x14, 0x46, 0xb3, 0xd6, 0x78, 0xde, 0x7b, + 0x2c, 0x2c, 0x2a, 0x10, 0xb1, 0xa2, 0x15, 0x91, 0x5b, 0x13, 0xb9, 0x55, 0x6d, 0xb4, 0xae, 0x61, + 0xef, 0x25, 0x8d, 0xcb, 0x92, 0xb3, 0x47, 0x3a, 0x1f, 0x27, 0xcd, 0xcb, 0x29, 0xf2, 0x73, 0xd2, + 0x3c, 0x9d, 0x28, 0x5f, 0x57, 0xcf, 0xdb, 0x49, 0xf3, 0x77, 0xe2, 0x3c, 0x9e, 0x3a, 0xe9, 0xd4, + 0x91, 0x7c, 0x12, 0xe4, 0xf7, 0xa4, 0x79, 0x3e, 0x71, 0xbe, 0x9f, 0xa9, 0x21, 0x38, 0xd8, 0xcd, + 0xd5, 0x4f, 0x09, 0xe9, 0x0f, 0x12, 0x53, 0xac, 0xe8, 0x78, 0x21, 0x37, 0x3d, 0xae, 0x0e, 0x30, + 0x93, 0x86, 0x00, 0x31, 0x80, 0x18, 0x40, 0x0c, 0x20, 0x06, 0x10, 0x03, 0x88, 0x01, 0xc4, 0x00, + 0x62, 0x92, 0x81, 0x18, 0xce, 0x82, 0x37, 0xd3, 0xa5, 0xa0, 0x98, 0x71, 0x4b, 0xc0, 0x98, 0x41, + 0x20, 0x06, 0xc2, 0xc8, 0x22, 0xcc, 0x9e, 0xe2, 0x4b, 0xc8, 0x4d, 0x6e, 0x28, 0x1a, 0x51, 0x41, + 0xed, 0x55, 0xa8, 0xa8, 0x89, 0xe8, 0x95, 0x28, 0xcf, 0xf4, 0xfc, 0x90, 0x59, 0xbe, 0x67, 0x2b, + 0xcd, 0xe5, 0x5c, 0x43, 0x4c, 0x09, 0x10, 0xb3, 0x6b, 0x88, 0xa1, 0x1e, 0x02, 0xfa, 0x57, 0xad, + 0xc0, 0x35, 0xc9, 0x72, 0x4d, 0x57, 0x61, 0x96, 0x45, 0x2e, 0x79, 0xd0, 0x08, 0x68, 0x06, 0xa2, + 0x0c, 0x44, 0x19, 0x88, 0x32, 0x10, 0x65, 0xc0, 0x33, 0x10, 0x65, 0x00, 0x2f, 0x09, 0xc1, 0x8b, + 0xc1, 0x9d, 0x2e, 0x23, 0x21, 0x98, 0x51, 0x4b, 0xc0, 0x18, 0x88, 0x32, 0x10, 0x65, 0x84, 0xe7, + 0xcc, 0xc0, 0x76, 0xb8, 0x63, 0x7d, 0x0f, 0x49, 0x00, 0x06, 0x92, 0x0c, 0x24, 0x19, 0x48, 0x32, + 0x90, 0x64, 0xf6, 0x94, 0x6a, 0x14, 0x0c, 0x7d, 0x0a, 0x34, 0x8e, 0x07, 0x96, 0x81, 0x24, 0x03, + 0x49, 0x06, 0x92, 0x0c, 0x24, 0x19, 0xf0, 0x0c, 0x24, 0x19, 0xc0, 0x4b, 0x52, 0xf0, 0x42, 0x25, + 0xc9, 0x4c, 0x5a, 0x02, 0xc6, 0x40, 0x92, 0x81, 0x24, 0x03, 0x49, 0x06, 0x92, 0x0c, 0x10, 0x06, + 0x92, 0x0c, 0xa8, 0x46, 0x95, 0x6a, 0xb4, 0xbe, 0xe2, 0x2d, 0x59, 0xfa, 0x24, 0xba, 0x9e, 0xaa, + 0x04, 0xca, 0xb0, 0xc4, 0xc7, 0x21, 0x41, 0x81, 0x84, 0x02, 0x59, 0x79, 0x94, 0xe1, 0x59, 0x5e, + 0xed, 0xcb, 0xc9, 0x2d, 0x5d, 0x4d, 0xef, 0x28, 0x05, 0xf5, 0xea, 0x70, 0x06, 0x85, 0x9c, 0xb0, + 0x86, 0x12, 0x14, 0x1b, 0x74, 0x33, 0x9c, 0x41, 0x41, 0x8c, 0x94, 0x38, 0x83, 0x02, 0x95, 0x67, + 0xb5, 0x20, 0x20, 0xce, 0xa0, 0xd0, 0x71, 0x55, 0x1a, 0x0a, 0xd1, 0xbe, 0x04, 0x7e, 0xbf, 0x67, + 0x38, 0xb6, 0x7c, 0x5c, 0x8f, 0x5a, 0x40, 0x58, 0x47, 0x58, 0xcf, 0x75, 0x21, 0xf8, 0xa3, 0x8a, + 0x42, 0x38, 0x3f, 0x45, 0x38, 0x46, 0x38, 0x4e, 0x69, 0x38, 0xae, 0x56, 0xce, 0xab, 0xe7, 0x27, + 0xa7, 0x95, 0x73, 0x04, 0xe1, 0x9d, 0x04, 0x61, 0xc7, 0x23, 0xa8, 0x02, 0x3f, 0xdb, 0xc8, 0x7e, + 0x14, 0x79, 0xe4, 0x81, 0xe9, 0x85, 0x16, 0x73, 0xde, 0x84, 0x9f, 0x78, 0x3f, 0xa2, 0xf1, 0x6c, + 0xff, 0xa0, 0xd4, 0x23, 0x4a, 0x3d, 0xae, 0x32, 0x21, 0x2c, 0x9b, 0xca, 0x1a, 0x17, 0x76, 0x7d, + 0xa9, 0xe2, 0x0b, 0x76, 0x7d, 0x69, 0x01, 0xef, 0xc5, 0x6e, 0xc6, 0xae, 0xaf, 0xc4, 0x01, 0x7d, + 0x71, 0x08, 0xb0, 0xeb, 0x4b, 0xfb, 0xd5, 0x28, 0xf1, 0x08, 0x78, 0x01, 0xbc, 0x00, 0x5e, 0x00, + 0x2f, 0x80, 0x17, 0xc0, 0x0b, 0xe0, 0x05, 0xf0, 0x42, 0x06, 0x2f, 0x28, 0xed, 0x08, 0x7c, 0x01, + 0xbe, 0xa0, 0xb4, 0xe3, 0x6c, 0x13, 0xd8, 0xb4, 0xae, 0xdf, 0x63, 0x01, 0x62, 0xd2, 0x3b, 0x04, + 0xd8, 0xb4, 0x9e, 0x75, 0xae, 0x41, 0x69, 0x47, 0xd0, 0x0c, 0x68, 0x06, 0x62, 0x0c, 0xc4, 0x18, + 0x88, 0x31, 0x10, 0x63, 0x00, 0x2d, 0x59, 0x81, 0x16, 0x94, 0x74, 0x04, 0xbe, 0x00, 0x5f, 0x50, + 0x3f, 0x00, 0x52, 0x0c, 0xa4, 0x18, 0x48, 0x31, 0x90, 0x62, 0xf2, 0x40, 0x35, 0x28, 0xe9, 0x08, + 0x96, 0x01, 0xcb, 0x40, 0x8a, 0x81, 0x14, 0x03, 0x29, 0x06, 0x52, 0x0c, 0xa0, 0x25, 0x23, 0xd0, + 0x82, 0x52, 0x8e, 0xc0, 0x17, 0xe0, 0x0b, 0xa4, 0x18, 0x48, 0x31, 0x90, 0x62, 0x20, 0xc5, 0x40, + 0x8a, 0x49, 0x1b, 0xd5, 0xec, 0x51, 0x29, 0x47, 0xf9, 0xea, 0x07, 0x05, 0xe2, 0x0a, 0x8e, 0xd7, + 0x83, 0x3b, 0x69, 0x0c, 0x6f, 0x24, 0x05, 0xa5, 0x25, 0x5c, 0x33, 0x64, 0x81, 0xf1, 0xec, 0x98, + 0xa1, 0x61, 0xf5, 0x83, 0x80, 0x49, 0xbc, 0x85, 0x16, 0xc5, 0xd9, 0x15, 0x6d, 0xa1, 0xd0, 0x84, + 0x7e, 0x1e, 0x45, 0xa1, 0x09, 0x05, 0x2f, 0x85, 0x42, 0x13, 0x48, 0xea, 0x90, 0xd4, 0x65, 0x30, + 0xa9, 0x83, 0x26, 0x9d, 0xb9, 0x84, 0x0e, 0x9a, 0xf4, 0xce, 0x13, 0x3a, 0x68, 0xd2, 0xf9, 0xc9, + 0xde, 0x50, 0x68, 0x02, 0xf0, 0x02, 0x78, 0x01, 0xbc, 0x00, 0x5e, 0x00, 0x2f, 0x80, 0x17, 0xc0, + 0x4b, 0xfe, 0xe1, 0x05, 0x85, 0x26, 0x80, 0x2f, 0xc0, 0x17, 0x14, 0x9a, 0x98, 0x6d, 0x02, 0x4b, + 0xea, 0xfa, 0x3d, 0x16, 0x20, 0x26, 0xbd, 0x43, 0x80, 0x25, 0xf5, 0xac, 0x73, 0x0d, 0x0a, 0x4d, + 0x80, 0x66, 0x40, 0x33, 0x10, 0x63, 0x20, 0xc6, 0x40, 0x8c, 0x81, 0x18, 0x03, 0x68, 0xc9, 0x0a, + 0xb4, 0xa0, 0xd0, 0x04, 0xf0, 0x05, 0xf8, 0x82, 0xb7, 0x1b, 0x20, 0xc5, 0x40, 0x8a, 0x81, 0x14, + 0x03, 0x29, 0x26, 0x0f, 0x54, 0x83, 0x42, 0x13, 0x60, 0x19, 0xb0, 0x0c, 0xa4, 0x18, 0x48, 0x31, + 0x90, 0x62, 0x20, 0xc5, 0x00, 0x5a, 0x32, 0x02, 0x2d, 0x28, 0x34, 0x01, 0x7c, 0x01, 0xbe, 0x40, + 0x8a, 0x81, 0x14, 0x03, 0x29, 0x06, 0x52, 0x0c, 0xa4, 0x98, 0xb4, 0x51, 0xcd, 0x1e, 0x15, 0x9a, + 0x50, 0x2e, 0x82, 0x50, 0x20, 0xae, 0x37, 0x71, 0x33, 0xb8, 0xa1, 0x0b, 0xc7, 0x0c, 0x2f, 0xc7, + 0xb7, 0x93, 0x86, 0xaa, 0x13, 0x8e, 0xc7, 0x8c, 0x9e, 0x1f, 0xa8, 0x14, 0x9b, 0x88, 0x9a, 0x90, + 0xab, 0x31, 0x51, 0xca, 0x58, 0x8d, 0x09, 0xbf, 0xc7, 0x0d, 0xce, 0x82, 0x2e, 0x0a, 0x4c, 0xac, + 0xe0, 0xcd, 0xa8, 0x73, 0x52, 0xe6, 0x9a, 0xa4, 0xd1, 0x72, 0x3a, 0xcd, 0x99, 0xd9, 0x09, 0x58, + 0x47, 0x66, 0xd4, 0x27, 0x3a, 0xd8, 0xa9, 0xc4, 0xb5, 0x8d, 0xc8, 0x1b, 0x5a, 0x91, 0x17, 0xfc, + 0x34, 0xe3, 0x05, 0x57, 0xfe, 0x7a, 0xee, 0xb7, 0x43, 0xdf, 0x95, 0x02, 0x57, 0xe3, 0xf7, 0x58, + 0x30, 0x0c, 0x0e, 0xa6, 0x6b, 0x74, 0x7d, 0x9b, 0xc9, 0x7b, 0x9c, 0xa5, 0x96, 0xe0, 0x78, 0xe0, + 0x78, 0x72, 0xeb, 0x78, 0xfa, 0x8e, 0xc7, 0xcb, 0x27, 0x0a, 0x7e, 0xe7, 0x44, 0xe2, 0x52, 0xb5, + 0x34, 0x53, 0x21, 0x83, 0xa7, 0x48, 0x2b, 0x89, 0x72, 0x19, 0xaa, 0x34, 0x92, 0x32, 0x51, 0x51, + 0x48, 0x1b, 0x49, 0xd2, 0x45, 0xea, 0xae, 0x3d, 0x39, 0x3e, 0x3e, 0x3a, 0x4e, 0x51, 0xf7, 0x26, + 0x94, 0x87, 0x3d, 0xa5, 0x21, 0x1e, 0xf7, 0xf9, 0xb4, 0x12, 0x9f, 0x7c, 0x2c, 0x9e, 0x6d, 0x05, + 0x45, 0xe6, 0x10, 0x8a, 0x51, 0x64, 0x6e, 0xed, 0xdc, 0x41, 0x91, 0x39, 0x2c, 0xe8, 0x28, 0x1b, + 0x17, 0xf6, 0xa3, 0xa8, 0xb2, 0x0b, 0xf6, 0xa3, 0x68, 0xa1, 0xee, 0xc5, 0x6e, 0xc6, 0x7e, 0x94, + 0xc4, 0xe9, 0x7c, 0x71, 0x08, 0xb0, 0x1f, 0x45, 0xfb, 0xd5, 0x28, 0x32, 0x07, 0x78, 0x01, 0xbc, + 0x00, 0x5e, 0x00, 0x2f, 0x80, 0x17, 0xc0, 0x0b, 0xe0, 0x05, 0xf0, 0x42, 0x06, 0x2f, 0x28, 0x32, + 0x07, 0x7c, 0x01, 0xbe, 0xa0, 0xc8, 0xdc, 0x6c, 0x13, 0xd8, 0x4e, 0xab, 0xdf, 0x63, 0x01, 0x62, + 0xd2, 0x3b, 0x04, 0xd8, 0x4e, 0x9b, 0x75, 0xae, 0x41, 0x91, 0x39, 0xd0, 0x0c, 0x68, 0x06, 0x62, + 0x0c, 0xc4, 0x18, 0x88, 0x31, 0x10, 0x63, 0x00, 0x2d, 0x59, 0x81, 0x16, 0x14, 0x99, 0x03, 0xbe, + 0x00, 0x5f, 0xf0, 0x66, 0x33, 0xa4, 0x18, 0x48, 0x31, 0x90, 0x62, 0x20, 0xc5, 0xe4, 0x81, 0x6a, + 0x50, 0x64, 0x0e, 0x2c, 0x03, 0x96, 0x81, 0x14, 0x03, 0x29, 0x06, 0x52, 0x0c, 0xa4, 0x18, 0x40, + 0x4b, 0x46, 0xa0, 0x05, 0x45, 0xe6, 0x80, 0x2f, 0xc0, 0x17, 0x48, 0x31, 0x90, 0x62, 0x20, 0xc5, + 0x40, 0x8a, 0x81, 0x14, 0x93, 0x36, 0xaa, 0xd9, 0xa3, 0x22, 0x73, 0x0a, 0xe5, 0x0f, 0x0a, 0xc4, + 0xe5, 0xe5, 0xee, 0x87, 0xb7, 0xd2, 0x18, 0xde, 0x49, 0x0a, 0xca, 0x4b, 0xf4, 0x7c, 0xd7, 0x0c, + 0x9c, 0x7f, 0x0f, 0x47, 0xca, 0xb0, 0x59, 0x8f, 0x79, 0x36, 0xf3, 0xb8, 0xe1, 0xfa, 0x61, 0x28, + 0x5f, 0x6d, 0x62, 0x53, 0xa3, 0xfb, 0x51, 0x7c, 0x02, 0x45, 0xa0, 0x36, 0x80, 0x68, 0x5a, 0x8b, + 0x40, 0xa1, 0xec, 0x04, 0x52, 0x3c, 0xa4, 0x78, 0x19, 0x4c, 0xf1, 0xa0, 0x50, 0x67, 0x2e, 0xbd, + 0x83, 0x42, 0xbd, 0xf3, 0xf4, 0x0e, 0x0a, 0x75, 0x7e, 0x72, 0x39, 0x94, 0x9d, 0x00, 0xbc, 0x00, + 0x5e, 0x00, 0x2f, 0x80, 0x17, 0xc0, 0x0b, 0xe0, 0x05, 0xf0, 0x92, 0x7f, 0x78, 0x41, 0xd9, 0x09, + 0xe0, 0x0b, 0xf0, 0x05, 0x65, 0x27, 0x66, 0x9b, 0xc0, 0x02, 0xbb, 0x7e, 0x8f, 0x05, 0x88, 0x49, + 0xef, 0x10, 0x60, 0x81, 0x3d, 0xeb, 0x5c, 0x83, 0xb2, 0x13, 0xa0, 0x19, 0xd0, 0x0c, 0xc4, 0x18, + 0x88, 0x31, 0x10, 0x63, 0x20, 0xc6, 0x00, 0x5a, 0xb2, 0x02, 0x2d, 0x28, 0x3b, 0x01, 0x7c, 0x01, + 0xbe, 0xe0, 0x5d, 0x07, 0x48, 0x31, 0x90, 0x62, 0x20, 0xc5, 0x40, 0x8a, 0xc9, 0x03, 0xd5, 0xa0, + 0xec, 0x04, 0x58, 0x06, 0x2c, 0x03, 0x29, 0x06, 0x52, 0x0c, 0xa4, 0x18, 0x48, 0x31, 0x80, 0x96, + 0x8c, 0x40, 0x0b, 0xca, 0x4e, 0x00, 0x5f, 0x80, 0x2f, 0x90, 0x62, 0x20, 0xc5, 0x40, 0x8a, 0x81, + 0x14, 0x03, 0x29, 0x26, 0x6d, 0x54, 0xb3, 0x47, 0x65, 0x27, 0xe8, 0xea, 0x20, 0x14, 0x88, 0xab, + 0x50, 0x34, 0x66, 0xee, 0xec, 0x6a, 0x72, 0x63, 0x37, 0x83, 0xfb, 0x4a, 0x5b, 0x4d, 0x8a, 0xae, + 0x6f, 0x33, 0xc3, 0x76, 0xc2, 0x1e, 0x0b, 0x42, 0x99, 0x61, 0x5d, 0x5d, 0x94, 0x62, 0xb1, 0x55, + 0x54, 0xa5, 0xd0, 0xcc, 0xaf, 0xa8, 0x4a, 0x21, 0xeb, 0xd2, 0x50, 0x95, 0x22, 0x1d, 0x19, 0xe0, + 0x70, 0x7e, 0x20, 0x0b, 0x54, 0xb1, 0x2e, 0x08, 0xd9, 0xaa, 0x6c, 0x0c, 0x21, 0x3b, 0x91, 0x2c, + 0x10, 0x42, 0xf6, 0xce, 0xb3, 0x40, 0x08, 0xd9, 0xf9, 0x49, 0xf9, 0x50, 0x9d, 0x02, 0x10, 0x03, + 0x88, 0x01, 0xc4, 0x00, 0x62, 0x00, 0x31, 0x80, 0x18, 0x40, 0xcc, 0xfe, 0x40, 0x0c, 0xaa, 0x54, + 0x68, 0xc1, 0x18, 0x20, 0x8c, 0x2c, 0xc2, 0xa0, 0x4a, 0x05, 0xaa, 0x54, 0x64, 0x09, 0x62, 0xb0, + 0x1e, 0xbf, 0x73, 0x88, 0xc1, 0x7a, 0x3c, 0xb8, 0x66, 0xbe, 0x9b, 0x51, 0xa5, 0x02, 0xa2, 0x0c, + 0x44, 0x19, 0x88, 0x32, 0x10, 0x65, 0x20, 0xca, 0x40, 0x94, 0x81, 0x28, 0x93, 0x35, 0x78, 0x41, + 0xb5, 0x0a, 0x88, 0x32, 0x10, 0x65, 0xf0, 0x8a, 0x04, 0x24, 0x19, 0x48, 0x32, 0x90, 0x64, 0x20, + 0xc9, 0xe4, 0x81, 0x6a, 0x50, 0xad, 0x02, 0x92, 0x0c, 0x24, 0x19, 0x48, 0x32, 0x90, 0x64, 0x20, + 0xc9, 0x40, 0x92, 0x01, 0xbc, 0x64, 0x0c, 0x5e, 0x50, 0xb5, 0x02, 0x92, 0x0c, 0x24, 0x19, 0x48, + 0x32, 0x90, 0x64, 0x20, 0xc9, 0x40, 0x92, 0x81, 0x24, 0x93, 0x36, 0xaa, 0xd9, 0xd7, 0xaa, 0x15, + 0x6a, 0x85, 0x12, 0x0a, 0x1a, 0xcb, 0x56, 0xdc, 0xfa, 0x36, 0xbb, 0x9a, 0xde, 0x58, 0x0a, 0xea, + 0x56, 0x8c, 0xa2, 0x94, 0xe1, 0x07, 0x36, 0x0b, 0x0c, 0x3d, 0x45, 0x2c, 0xe2, 0x7f, 0x05, 0x2a, + 0x5a, 0x68, 0x66, 0x5b, 0x54, 0xb4, 0x90, 0x75, 0x77, 0xa8, 0x68, 0x01, 0x91, 0x3b, 0xfb, 0x19, + 0x22, 0x44, 0x6e, 0x88, 0xdc, 0xd9, 0xc9, 0x10, 0x21, 0x72, 0xef, 0x3c, 0x43, 0x84, 0xc8, 0x9d, + 0x9f, 0x74, 0x10, 0x15, 0x2d, 0x00, 0x31, 0x80, 0x18, 0x40, 0x0c, 0x20, 0x06, 0x10, 0x03, 0x88, + 0x01, 0xc4, 0xec, 0x0f, 0xc4, 0xa0, 0xa2, 0x85, 0x16, 0x8c, 0x01, 0xc2, 0xc8, 0x22, 0x0c, 0x2a, + 0x5a, 0xa0, 0xa2, 0x45, 0x96, 0x20, 0x06, 0x6b, 0xf5, 0x3b, 0x87, 0x18, 0xac, 0xd5, 0x83, 0x6b, + 0xe6, 0xbb, 0x19, 0x15, 0x2d, 0x20, 0xca, 0x40, 0x94, 0x81, 0x28, 0x03, 0x51, 0x06, 0xa2, 0x0c, + 0x44, 0x19, 0x88, 0x32, 0x59, 0x83, 0x17, 0x54, 0xb4, 0x80, 0x28, 0x03, 0x51, 0x06, 0xaf, 0x4f, + 0x40, 0x92, 0x81, 0x24, 0x03, 0x49, 0x06, 0x92, 0x4c, 0x1e, 0xa8, 0x06, 0x15, 0x2d, 0x20, 0xc9, + 0x40, 0x92, 0x81, 0x24, 0x03, 0x49, 0x06, 0x92, 0x0c, 0x24, 0x19, 0xc0, 0x4b, 0xc6, 0xe0, 0x05, + 0x15, 0x2d, 0x20, 0xc9, 0x40, 0x92, 0x81, 0x24, 0x03, 0x49, 0x06, 0x92, 0x0c, 0x24, 0x19, 0x48, + 0x32, 0x69, 0xa3, 0x9a, 0x3d, 0xaa, 0x68, 0xa1, 0xab, 0x6a, 0x42, 0x81, 0xb8, 0xbc, 0x45, 0x73, + 0x78, 0x9f, 0xf7, 0x83, 0xdb, 0x4c, 0x77, 0xa5, 0x0b, 0x6e, 0x06, 0x2f, 0x8c, 0x1b, 0x7e, 0x9f, + 0xf7, 0xfa, 0xdc, 0xe8, 0xf9, 0x7f, 0xb1, 0x40, 0xbe, 0xa6, 0xc5, 0xaa, 0xc6, 0xe4, 0xaa, 0x57, + 0x94, 0x50, 0xbd, 0x22, 0x71, 0x7e, 0xdd, 0xbb, 0xea, 0x15, 0xd2, 0x68, 0x4a, 0xa2, 0xa8, 0xa9, + 0x28, 0x69, 0x24, 0x0a, 0x9a, 0x22, 0x76, 0x2a, 0x10, 0x3d, 0x05, 0x66, 0x12, 0x29, 0x64, 0x54, + 0x58, 0x49, 0x09, 0x2e, 0x0a, 0x18, 0x49, 0x82, 0x8f, 0x44, 0xca, 0x57, 0x2a, 0xbb, 0x36, 0x21, + 0x26, 0x7b, 0xd2, 0x15, 0xda, 0x0f, 0x08, 0x27, 0x90, 0x2c, 0xdb, 0xd1, 0x32, 0x5d, 0x51, 0xa4, + 0x2e, 0x17, 0x19, 0xa1, 0xc5, 0x8b, 0x45, 0xdb, 0xbb, 0x7b, 0xf3, 0x27, 0xb6, 0x0c, 0x84, 0xe8, + 0x00, 0x50, 0x75, 0x7c, 0x8c, 0x2e, 0x27, 0xe9, 0xea, 0xcd, 0x9d, 0xbc, 0xbe, 0xeb, 0x36, 0x74, + 0x5b, 0xb1, 0xe7, 0x07, 0xdb, 0x2b, 0x2f, 0x44, 0x01, 0x7a, 0xf8, 0xe9, 0x2d, 0x83, 0x10, 0xaf, + 0x60, 0x5a, 0x6c, 0xc4, 0x14, 0x41, 0xca, 0x59, 0x84, 0x9c, 0x8c, 0x60, 0x9c, 0xc1, 0x11, 0x44, + 0x46, 0x69, 0x44, 0x94, 0x46, 0xc2, 0x45, 0x04, 0x8c, 0x1e, 0x4e, 0xb3, 0x41, 0xc5, 0x2d, 0x48, + 0x56, 0x7c, 0x0e, 0x98, 0xf9, 0xdd, 0xef, 0xf3, 0x61, 0xde, 0x18, 0xbf, 0x23, 0x27, 0xe3, 0x35, + 0x7f, 0x79, 0xcc, 0x3e, 0x11, 0xab, 0xcc, 0x27, 0x9c, 0xd3, 0xc8, 0xe4, 0x32, 0x73, 0x13, 0x70, + 0xbb, 0xad, 0x50, 0xe4, 0x2d, 0xca, 0xf9, 0x8a, 0x72, 0x9e, 0xb2, 0x34, 0x39, 0x07, 0x0f, 0xbe, + 0xa3, 0x10, 0x2c, 0x5a, 0x41, 0xaf, 0x68, 0x4d, 0x66, 0x85, 0x64, 0x8e, 0x3e, 0xbe, 0x7e, 0x3f, + 0x8a, 0x4a, 0x0a, 0x4e, 0xe9, 0xfd, 0x49, 0xc9, 0xc5, 0xa6, 0x7c, 0x32, 0xe9, 0xb8, 0x74, 0x31, + 0xc9, 0x31, 0xd5, 0x18, 0x61, 0x8f, 0x31, 0x5b, 0x7d, 0x9d, 0x76, 0xbe, 0x39, 0x2c, 0xd6, 0x2a, + 0x18, 0x12, 0x95, 0x41, 0x91, 0x1b, 0x16, 0xb9, 0x81, 0xd1, 0x1a, 0x9a, 0x62, 0xba, 0xba, 0xf3, + 0xa5, 0x5a, 0xc7, 0x66, 0x1e, 0x77, 0xf8, 0x7b, 0xc0, 0x3a, 0x14, 0x7b, 0xcd, 0x14, 0x16, 0x97, + 0x8a, 0xd7, 0xe3, 0x5b, 0xb9, 0x30, 0x43, 0x82, 0xf9, 0x37, 0x79, 0xc0, 0x7a, 0xeb, 0x6b, 0xfd, + 0xe1, 0xae, 0xde, 0x6a, 0x37, 0x1b, 0xf5, 0xfa, 0x55, 0x91, 0x42, 0x28, 0x09, 0x95, 0x17, 0x80, + 0x0b, 0x24, 0x8b, 0xc0, 0x73, 0xcf, 0x39, 0x7c, 0xbc, 0x76, 0xb9, 0x54, 0xfa, 0x72, 0x51, 0x4c, + 0xc3, 0xf2, 0xa8, 0x96, 0xc7, 0x3b, 0xce, 0xf5, 0xd3, 0x95, 0x4b, 0xa5, 0xdb, 0x3c, 0x3f, 0x5e, + 0x9e, 0xc7, 0xae, 0x72, 0x9c, 0xef, 0x99, 0x99, 0xeb, 0x89, 0x99, 0x6b, 0xaf, 0xf2, 0xed, 0xee, + 0xb7, 0xbb, 0xfb, 0xdf, 0xef, 0x72, 0x1c, 0x14, 0xf2, 0xed, 0x57, 0xf2, 0x1d, 0x14, 0xaa, 0x34, + 0xb6, 0xa7, 0xd4, 0xc2, 0x53, 0xea, 0x17, 0xa9, 0x64, 0xb6, 0x43, 0x7b, 0xfd, 0xee, 0x64, 0x15, + 0x21, 0x54, 0x4f, 0xb5, 0xe7, 0x5a, 0x43, 0xa6, 0x8d, 0x4c, 0x1b, 0x99, 0xb6, 0xe0, 0x8c, 0xe9, + 0x3b, 0x1e, 0x3f, 0x23, 0xc8, 0xb1, 0x8f, 0xb1, 0x7d, 0x99, 0xd4, 0xaf, 0xac, 0xce, 0xf1, 0xb1, + 0x7d, 0x39, 0x0d, 0x43, 0x50, 0x39, 0xc6, 0x6e, 0x65, 0x22, 0x5c, 0xc1, 0x6e, 0xe5, 0xd1, 0x06, + 0x8b, 0x41, 0xf0, 0x39, 0x9c, 0x5b, 0x14, 0x3e, 0x94, 0x5a, 0x68, 0x2b, 0xc8, 0x6f, 0xbd, 0x68, + 0xf8, 0x01, 0x6f, 0x5f, 0x8c, 0x6f, 0xe1, 0xd6, 0xb7, 0x59, 0x7b, 0x8c, 0x36, 0x69, 0x38, 0x4f, + 0x6f, 0xb8, 0xe5, 0x46, 0xfe, 0xac, 0x3c, 0xc1, 0x7d, 0x42, 0x05, 0x8a, 0x25, 0xcb, 0x0a, 0x96, + 0x2c, 0x77, 0xca, 0x79, 0x58, 0xb2, 0x8c, 0x3f, 0x6f, 0xb0, 0x64, 0x89, 0x44, 0x0a, 0x89, 0x94, + 0xd2, 0x8c, 0xc1, 0x92, 0xa5, 0x38, 0x4b, 0x63, 0xc9, 0x72, 0x57, 0x8f, 0x87, 0x25, 0xcb, 0x2c, + 0x3f, 0x1e, 0x96, 0x2c, 0xb3, 0x3b, 0x33, 0xb1, 0x64, 0x99, 0xd5, 0xa7, 0xc3, 0x92, 0x65, 0xb6, + 0xfd, 0x0a, 0x96, 0x2c, 0x75, 0xab, 0x87, 0x58, 0xb2, 0xdc, 0x3e, 0x5a, 0x58, 0xb2, 0x44, 0xa6, + 0x8d, 0x4c, 0x5b, 0x65, 0xc6, 0x60, 0xc9, 0x72, 0xe6, 0x46, 0xb0, 0x64, 0xb9, 0xeb, 0x68, 0x8e, + 0x25, 0xcb, 0xdd, 0x42, 0x07, 0x96, 0x2c, 0x53, 0xb3, 0x64, 0x29, 0xb3, 0xce, 0x56, 0xa0, 0x5c, + 0xb1, 0x14, 0x78, 0x35, 0x5f, 0x7c, 0x70, 0xb2, 0x5d, 0x3b, 0x61, 0x79, 0xb8, 0xf4, 0x17, 0x4e, + 0x58, 0x1a, 0x20, 0xb2, 0xaa, 0x09, 0x31, 0xde, 0x71, 0x17, 0x7c, 0xd1, 0x55, 0xee, 0x05, 0xd7, + 0xd4, 0xbf, 0x93, 0x1d, 0xbf, 0x28, 0x80, 0x2a, 0x4e, 0xa7, 0xf0, 0xbd, 0xec, 0xd8, 0x45, 0x03, + 0x72, 0x64, 0xe2, 0xc2, 0xdb, 0x46, 0x54, 0x6c, 0x5b, 0x64, 0x87, 0x08, 0x8d, 0x55, 0x8b, 0xed, + 0x04, 0x91, 0xda, 0x01, 0x22, 0x6d, 0xd3, 0x15, 0xd8, 0x34, 0x6c, 0x5a, 0x87, 0x4d, 0x27, 0x54, + 0xe7, 0x68, 0x68, 0xd2, 0x69, 0xaa, 0x6e, 0xd4, 0x7f, 0x19, 0x8c, 0xfc, 0x70, 0x83, 0xcb, 0xf6, + 0x44, 0x5b, 0xd0, 0x23, 0x1c, 0xce, 0x4c, 0xa6, 0x4f, 0x33, 0x5d, 0xbf, 0xf2, 0xd7, 0x73, 0xbf, + 0x15, 0x90, 0xab, 0x8a, 0x57, 0x2c, 0xb4, 0x02, 0xa7, 0x37, 0x9e, 0x2f, 0xc5, 0x9a, 0x6d, 0x3b, + 0xde, 0x4b, 0x61, 0xd0, 0x42, 0x61, 0xc2, 0x62, 0x05, 0xdb, 0xe4, 0x66, 0x81, 0xfb, 0x85, 0xde, + 0xeb, 0x7b, 0xe8, 0x58, 0xa6, 0x5b, 0x98, 0x7c, 0xd3, 0xf0, 0x5f, 0x50, 0x1c, 0x26, 0xe3, 0x0e, + 0x2b, 0x4b, 0xc5, 0x61, 0xe4, 0xaa, 0x1a, 0x2d, 0x8d, 0xb7, 0x6c, 0x9a, 0xb1, 0xca, 0x64, 0x5a, + 0x7e, 0xcf, 0x70, 0xd9, 0x1b, 0x73, 0x0b, 0x96, 0xef, 0x71, 0xd3, 0xf1, 0x58, 0x50, 0xe8, 0xf8, + 0xc1, 0x0a, 0x1b, 0x42, 0x4d, 0x1a, 0x9d, 0x2a, 0x39, 0x36, 0x78, 0x6a, 0x51, 0x0b, 0x14, 0x43, + 0xe8, 0x53, 0x4a, 0x0a, 0x04, 0xc6, 0x9c, 0x94, 0x0a, 0x60, 0xa2, 0xa7, 0x16, 0xe0, 0x5f, 0x2c, + 0x30, 0xc2, 0x7e, 0xaf, 0xe7, 0xbe, 0x8b, 0xd4, 0x04, 0x9c, 0xb9, 0x0a, 0xb5, 0x01, 0x51, 0x1b, + 0x10, 0xca, 0x13, 0xb2, 0xd4, 0x7d, 0xcf, 0x52, 0xa7, 0x2e, 0x31, 0x41, 0x05, 0xea, 0x2f, 0x16, + 0x34, 0x87, 0xdf, 0x09, 0x21, 0x0a, 0x42, 0x14, 0x4c, 0x3c, 0x39, 0x13, 0x4f, 0x4c, 0x90, 0x9a, + 0x5a, 0xf8, 0x1e, 0x56, 0xdd, 0x16, 0x00, 0x4d, 0x9a, 0x4e, 0xd6, 0xc2, 0xd8, 0x81, 0xdf, 0x63, + 0x01, 0x77, 0x58, 0x28, 0x40, 0xd8, 0xd3, 0x6b, 0xc0, 0xd7, 0xe0, 0xeb, 0x35, 0x53, 0xea, 0x5d, + 0x3c, 0xfa, 0x46, 0x57, 0x82, 0xb1, 0x11, 0x80, 0x93, 0x16, 0x57, 0x51, 0x79, 0x5b, 0xef, 0xd4, + 0xde, 0x23, 0xa5, 0x53, 0x78, 0xea, 0x4b, 0xaa, 0x9d, 0x49, 0xbd, 0xce, 0x3e, 0x66, 0x16, 0xd5, + 0xad, 0xf5, 0x26, 0x0e, 0x47, 0x56, 0x37, 0x1f, 0x2a, 0x33, 0x22, 0x37, 0x27, 0x72, 0xb3, 0xa2, + 0x37, 0x2f, 0x39, 0x33, 0x93, 0x34, 0xb7, 0xe8, 0xf6, 0xe9, 0xb6, 0xd6, 0x87, 0x3c, 0x70, 0xbc, + 0x17, 0x8a, 0xf7, 0xd7, 0xcf, 0x52, 0xfc, 0x42, 0xcf, 0xdb, 0x78, 0x53, 0xb4, 0xa2, 0xbb, 0x19, + 0x35, 0x03, 0x7f, 0x03, 0x7f, 0x03, 0x7f, 0x23, 0x39, 0x73, 0xfa, 0x9e, 0xdc, 0x51, 0xbb, 0x4b, + 0xee, 0xe6, 0x5c, 0xa1, 0x8d, 0xf1, 0xe3, 0xec, 0xfc, 0x55, 0x1e, 0x32, 0x27, 0x4c, 0xe4, 0x8c, + 0x15, 0xa7, 0x89, 0x86, 0x9e, 0x79, 0xf6, 0x7d, 0x97, 0x99, 0x1e, 0x65, 0xd7, 0x94, 0x73, 0xd2, + 0x35, 0x8e, 0xc7, 0xa5, 0x4e, 0x91, 0x5d, 0xd7, 0x31, 0x55, 0x82, 0xa6, 0x68, 0x5e, 0x92, 0xa3, + 0xeb, 0xac, 0xe8, 0xc6, 0x28, 0x5f, 0x9a, 0x53, 0x4c, 0xb4, 0xb7, 0x36, 0x3b, 0x79, 0x83, 0xeb, + 0xbc, 0x52, 0x39, 0x3a, 0x3a, 0xad, 0x94, 0x8e, 0x4e, 0xce, 0x8e, 0xab, 0xa7, 0xa7, 0xc7, 0x67, + 0xa5, 0x33, 0xe2, 0x6f, 0xd2, 0xf0, 0x66, 0x17, 0x91, 0x9d, 0xcc, 0x0f, 0x1e, 0xe1, 0xeb, 0x76, + 0x44, 0x38, 0x26, 0x31, 0x78, 0xa7, 0x19, 0x1a, 0xbc, 0x83, 0x74, 0xb4, 0xf2, 0x94, 0x13, 0x57, + 0xdd, 0xa7, 0xf6, 0xd5, 0x67, 0xf0, 0xd5, 0xe9, 0x32, 0xf7, 0x12, 0x3c, 0x73, 0x56, 0x86, 0xaa, + 0x7c, 0x56, 0xad, 0x9e, 0x9c, 0x56, 0xab, 0xa5, 0xd3, 0xa3, 0xd3, 0xd2, 0xf9, 0xf1, 0x71, 0xf9, + 0xa4, 0x7c, 0x0c, 0xd7, 0xbc, 0xaf, 0xae, 0xd9, 0x66, 0x96, 0xd3, 0x35, 0x5d, 0x52, 0xef, 0x5c, + 0xae, 0x10, 0xb4, 0xb5, 0x34, 0x87, 0x2a, 0xf0, 0xf9, 0x72, 0xc3, 0x51, 0x81, 0xcf, 0xcf, 0x8a, + 0xcf, 0x3f, 0xc2, 0x50, 0xe5, 0xc4, 0xc1, 0xa3, 0x44, 0xc7, 0x6e, 0x4a, 0x74, 0x44, 0xfb, 0xa8, + 0x26, 0x3f, 0xbe, 0x27, 0x7f, 0xac, 0x40, 0x74, 0x0f, 0x93, 0x1f, 0xdf, 0x53, 0x74, 0xb0, 0x80, + 0xd4, 0xc2, 0xb3, 0xca, 0x82, 0xb3, 0x24, 0xcf, 0x62, 0x3f, 0x06, 0xf6, 0x63, 0x88, 0xfb, 0x1d, + 0xe9, 0x85, 0x9a, 0x68, 0xe4, 0x5d, 0x66, 0x76, 0xe4, 0x2a, 0x9a, 0x47, 0xf8, 0x2b, 0xa1, 0x74, + 0x15, 0x1b, 0x63, 0x57, 0xf7, 0xf1, 0xe3, 0xd8, 0x5f, 0x1d, 0x0e, 0x4d, 0x0d, 0x27, 0x91, 0x48, + 0xb9, 0x8c, 0x0a, 0x5c, 0x06, 0x5c, 0x46, 0xcc, 0xdb, 0x94, 0x3f, 0x91, 0x64, 0x38, 0xdb, 0xfa, + 0x81, 0xf9, 0xec, 0x12, 0xec, 0xad, 0x98, 0x6b, 0x0d, 0x5b, 0x2c, 0xb0, 0xc5, 0x62, 0x67, 0xe6, + 0xa6, 0x96, 0xc3, 0xec, 0x7e, 0x8b, 0x85, 0xfa, 0x9a, 0xb9, 0xe2, 0x5a, 0x79, 0x42, 0x45, 0x9a, + 0xb1, 0x83, 0x14, 0xee, 0x06, 0xee, 0x06, 0x3b, 0x48, 0xb1, 0x83, 0x14, 0xfe, 0x06, 0xfe, 0x66, + 0x6f, 0xfc, 0x0d, 0x76, 0x90, 0xea, 0x70, 0xc2, 0x44, 0xce, 0x58, 0x71, 0x9a, 0x68, 0xe8, 0x19, + 0xec, 0x20, 0x5d, 0xdb, 0x35, 0xd8, 0x41, 0x2a, 0x70, 0x63, 0xd8, 0x41, 0xba, 0xea, 0x9b, 0xb0, + 0x66, 0x8d, 0x1d, 0xa4, 0x74, 0x70, 0x41, 0xdf, 0x0a, 0x76, 0x90, 0xae, 0x99, 0xb5, 0xd8, 0x41, + 0x9a, 0x32, 0x73, 0xc7, 0x6e, 0xa2, 0xcc, 0x0c, 0x15, 0x76, 0x90, 0xc2, 0x35, 0x63, 0x07, 0xe9, + 0x1e, 0xf9, 0x7c, 0xec, 0x20, 0xc5, 0x0e, 0x52, 0x38, 0xf8, 0x84, 0x1d, 0x3c, 0x76, 0x90, 0xa6, + 0x66, 0x07, 0x69, 0xd2, 0xa7, 0xbc, 0xad, 0xd8, 0x40, 0x9a, 0xa1, 0x73, 0xde, 0x7e, 0x63, 0xef, + 0x82, 0x2b, 0xcb, 0xc5, 0x1b, 0x27, 0xe4, 0x35, 0xce, 0x05, 0xcb, 0x8b, 0xdd, 0x3a, 0x5e, 0xdd, + 0x65, 0xdd, 0x41, 0xef, 0x15, 0x3f, 0x15, 0xbc, 0xbe, 0xeb, 0x0a, 0x6c, 0x6b, 0xbb, 0x35, 0x7f, + 0xc8, 0x5f, 0x7c, 0x1f, 0xd8, 0x2c, 0x60, 0xf6, 0xc5, 0xfb, 0xf8, 0xd2, 0x6c, 0xd7, 0x39, 0x5d, + 0x9e, 0xf1, 0x09, 0x14, 0x3a, 0x5d, 0x9e, 0xe3, 0x7b, 0x56, 0xea, 0x34, 0x6e, 0xc5, 0x4f, 0x92, + 0x4e, 0xd6, 0x51, 0xe7, 0x34, 0xde, 0xc6, 0x50, 0xa1, 0x8d, 0xa0, 0xc2, 0xd5, 0x4d, 0x2b, 0xa8, + 0x6e, 0x1a, 0xc3, 0xa1, 0xa4, 0xbc, 0xba, 0xa9, 0xe9, 0xba, 0xbe, 0x65, 0x72, 0x66, 0x1b, 0xc3, + 0xfa, 0xbf, 0xe2, 0x45, 0x4e, 0x17, 0x1b, 0x10, 0xab, 0x75, 0x5a, 0x42, 0xad, 0x53, 0xd4, 0x3a, + 0x5d, 0xbc, 0x1d, 0xe1, 0xf5, 0xfa, 0x39, 0xa9, 0xfa, 0xa8, 0x22, 0x32, 0x68, 0xe3, 0x79, 0x28, + 0xb0, 0xbc, 0x21, 0x29, 0x43, 0x48, 0x60, 0xb4, 0x8a, 0xac, 0xa0, 0xba, 0x61, 0x47, 0x31, 0xf7, + 0xa4, 0xc8, 0x31, 0x65, 0xb6, 0x4a, 0xa9, 0xa4, 0xf7, 0x54, 0x5d, 0x56, 0xad, 0x9c, 0x57, 0xcf, + 0x4f, 0x4e, 0x2b, 0xe7, 0xc7, 0x3b, 0xec, 0x3b, 0x4d, 0xd9, 0xca, 0x53, 0x82, 0x67, 0x5e, 0xd8, + 0x73, 0x47, 0xb3, 0x09, 0x86, 0xa5, 0xd9, 0x8b, 0x11, 0x92, 0x10, 0x92, 0x76, 0x16, 0x92, 0x84, + 0x77, 0x47, 0x09, 0xee, 0x82, 0xa2, 0xb1, 0x35, 0xd6, 0xed, 0xc9, 0x54, 0xb8, 0x1f, 0x5d, 0x16, + 0xfb, 0x74, 0xd2, 0x8e, 0xd9, 0x77, 0x87, 0x23, 0xda, 0x31, 0xdd, 0x90, 0xc1, 0x2e, 0x61, 0x97, + 0xbb, 0xb3, 0x4b, 0xf1, 0xbd, 0x79, 0x82, 0x7b, 0xf0, 0x68, 0x0c, 0xb3, 0xe3, 0x04, 0xdd, 0xbf, + 0xcc, 0x80, 0x19, 0x6f, 0x2c, 0x08, 0xa5, 0x22, 0xe1, 0x52, 0x0b, 0x30, 0x3b, 0x98, 0x1d, 0xc2, + 0xe1, 0xc6, 0xef, 0x7c, 0x35, 0x03, 0x5b, 0xcd, 0xea, 0x96, 0x5a, 0x80, 0xd5, 0xc1, 0xea, 0x60, + 0x75, 0x1b, 0xbf, 0xd3, 0xb1, 0xc5, 0xed, 0xcc, 0xb1, 0x61, 0x59, 0xb0, 0x2c, 0x58, 0xd6, 0xe6, + 0xef, 0x1c, 0x4a, 0xf4, 0x52, 0x71, 0x2c, 0xba, 0x12, 0x56, 0x06, 0x2b, 0x83, 0x95, 0x6d, 0xfc, + 0xce, 0x2e, 0xeb, 0xfa, 0x81, 0x84, 0x8a, 0x32, 0xbe, 0x0e, 0xa7, 0x04, 0xc2, 0xc2, 0x14, 0x2d, + 0x4c, 0xf8, 0x94, 0x40, 0xf3, 0xcd, 0x74, 0x5c, 0xa9, 0x22, 0x3a, 0xd3, 0x05, 0xe0, 0xa8, 0x09, + 0xd4, 0xa6, 0xd3, 0x34, 0xd1, 0xc9, 0x26, 0x3c, 0xd9, 0xc4, 0xa7, 0x33, 0x00, 0x31, 0x43, 0x10, + 0x34, 0x08, 0xf9, 0xd0, 0xb3, 0x34, 0xf2, 0xd2, 0x6f, 0x41, 0x29, 0xbc, 0xf5, 0xa4, 0xb8, 0xe3, + 0x5d, 0xe1, 0x85, 0x77, 0x8a, 0x1d, 0xed, 0x44, 0xaf, 0xc2, 0x50, 0x6d, 0x83, 0xa6, 0xdc, 0xf6, + 0xac, 0xb0, 0x23, 0x9d, 0x64, 0x07, 0x3a, 0x75, 0xd7, 0xd2, 0xbf, 0x55, 0x44, 0xda, 0xdb, 0x09, + 0x6d, 0xaa, 0x7e, 0x4a, 0x41, 0xc5, 0xc7, 0x3e, 0x77, 0x5c, 0xe7, 0xdf, 0xcc, 0x96, 0x8f, 0xc7, + 0x51, 0x0b, 0x08, 0xc7, 0x08, 0xc7, 0x08, 0xc7, 0x08, 0xc7, 0x08, 0xc7, 0x08, 0xc7, 0x08, 0xc7, + 0xba, 0x52, 0xee, 0xa4, 0xdf, 0x18, 0x19, 0x6e, 0xe5, 0x3f, 0x14, 0x92, 0x8c, 0x0a, 0xf2, 0x6f, + 0x31, 0x0c, 0x5f, 0x7d, 0x6a, 0xdf, 0x8e, 0xbe, 0x2d, 0x49, 0x29, 0xad, 0xf3, 0x62, 0xd8, 0x22, + 0xb5, 0xaf, 0xa7, 0x62, 0xda, 0xe4, 0x4a, 0x08, 0xd6, 0x90, 0xd3, 0x14, 0x6d, 0x5b, 0x5e, 0xb0, + 0xb6, 0xc5, 0x5e, 0x5a, 0x9c, 0xca, 0xd5, 0x02, 0xd7, 0x34, 0x4c, 0xce, 0x59, 0xe0, 0x09, 0xf3, + 0x48, 0xf1, 0xbf, 0xff, 0x2c, 0x19, 0xe7, 0x4f, 0x7f, 0x57, 0x7f, 0x3e, 0x3e, 0x1a, 0xa3, 0x1f, + 0x2b, 0xb3, 0x3f, 0xfe, 0x47, 0x31, 0x95, 0xdb, 0x81, 0x07, 0x86, 0x2d, 0x54, 0x77, 0x77, 0xce, + 0x25, 0x88, 0xbc, 0x11, 0x09, 0x97, 0x00, 0x97, 0x40, 0xef, 0x12, 0xb2, 0xb1, 0x86, 0x25, 0x67, + 0x61, 0xb0, 0x2e, 0x58, 0x17, 0xac, 0x6b, 0xbb, 0x75, 0xf9, 0x3d, 0x16, 0x18, 0x03, 0x82, 0xef, + 0x87, 0xe2, 0x46, 0x36, 0x7b, 0x31, 0x6c, 0x0d, 0xb6, 0xb6, 0x33, 0x5b, 0x73, 0x6c, 0xe6, 0x71, + 0x87, 0xbf, 0x8b, 0x1d, 0xd5, 0x14, 0x19, 0x9c, 0x80, 0x94, 0x51, 0xbc, 0x1e, 0x7f, 0xd5, 0x85, + 0x19, 0x2a, 0x2c, 0x51, 0x5f, 0xde, 0xdf, 0x36, 0xee, 0xef, 0xea, 0x77, 0xad, 0xf6, 0x7d, 0xa3, + 0xfe, 0xd0, 0x6e, 0xb6, 0x6a, 0xad, 0x6f, 0x4d, 0xd1, 0xf1, 0x1f, 0x8a, 0x33, 0xa1, 0x94, 0xfa, + 0xa7, 0x58, 0xb8, 0xbd, 0x76, 0xd9, 0xba, 0xfe, 0x67, 0xbd, 0x98, 0xc4, 0x0b, 0x94, 0x8a, 0x77, + 0x7a, 0x7d, 0x97, 0x9d, 0x7b, 0xbd, 0xba, 0x6e, 0xd6, 0x2e, 0x6e, 0xea, 0x57, 0xba, 0xb5, 0xf1, + 0x27, 0x6a, 0xfb, 0x26, 0x89, 0x44, 0x3d, 0x33, 0x18, 0xb9, 0x22, 0xc1, 0x20, 0x34, 0xbe, 0x0e, + 0xf1, 0x07, 0xf1, 0x67, 0x67, 0xf1, 0x47, 0xfc, 0x98, 0x40, 0x99, 0xe3, 0x01, 0x67, 0x8f, 0x05, + 0x1c, 0xfd, 0x6f, 0x2a, 0xc2, 0x0a, 0x1f, 0x13, 0x48, 0x66, 0xb4, 0xdc, 0xf0, 0x7c, 0x29, 0xab, + 0x1d, 0x5e, 0x08, 0xb3, 0x85, 0xd9, 0x22, 0x45, 0xdb, 0xf8, 0x9d, 0x01, 0xeb, 0xfa, 0x6f, 0x42, + 0x3b, 0x22, 0xa3, 0x07, 0x9c, 0x5e, 0x0a, 0x3b, 0x83, 0x9d, 0xed, 0xcc, 0xce, 0x32, 0xf2, 0x66, + 0x73, 0xc8, 0x02, 0xc7, 0x74, 0xa5, 0xc2, 0xd9, 0xf4, 0x52, 0x18, 0x1a, 0x0c, 0x0d, 0x01, 0x6d, + 0xb3, 0x9d, 0xf9, 0x1d, 0xae, 0xf6, 0x2e, 0xf3, 0x52, 0x0b, 0xb0, 0x3a, 0x58, 0x1d, 0xac, 0x6e, + 0xe3, 0x77, 0x72, 0xd6, 0xed, 0xb1, 0xc0, 0xe4, 0xfd, 0x40, 0x02, 0x24, 0x67, 0x2f, 0xc6, 0x5b, + 0x61, 0xb0, 0x35, 0x45, 0x5b, 0x13, 0x7f, 0x2b, 0xcc, 0x35, 0x83, 0xae, 0x11, 0xb2, 0x37, 0x16, + 0x38, 0x02, 0x65, 0xa1, 0x96, 0x06, 0x7e, 0xa1, 0x1d, 0x6c, 0x48, 0xd7, 0x34, 0xe5, 0xc9, 0xa6, + 0x3e, 0x99, 0x09, 0xd0, 0x99, 0x82, 0x98, 0x49, 0x08, 0x9a, 0x86, 0x7c, 0x38, 0x5a, 0x1a, 0x79, + 0xb9, 0x45, 0xb1, 0x25, 0xff, 0x2d, 0xb1, 0xcf, 0x57, 0x6d, 0x91, 0x6c, 0xe9, 0x41, 0xee, 0x1b, + 0xf5, 0xbb, 0xcb, 0xfb, 0xbb, 0xcf, 0xd7, 0x5f, 0xda, 0xb5, 0x9b, 0xda, 0xc3, 0x6d, 0xbb, 0x59, + 0xff, 0x67, 0xfd, 0xe1, 0xba, 0xf5, 0x47, 0x51, 0xa5, 0x2e, 0x66, 0xa8, 0x74, 0x6e, 0x8b, 0xe2, + 0xf6, 0xec, 0xc9, 0xa3, 0x7d, 0xbb, 0xfb, 0xed, 0xee, 0xfe, 0xf7, 0xbb, 0xe2, 0x2e, 0x36, 0x9a, + 0x13, 0x3d, 0xc2, 0xed, 0xf5, 0xdd, 0xfd, 0x43, 0x96, 0x1f, 0xe0, 0xf2, 0xe1, 0xba, 0x75, 0x7d, + 0x59, 0xbb, 0xc9, 0xf2, 0x33, 0xfc, 0x5e, 0x7b, 0xb8, 0xbb, 0xbe, 0xfb, 0x92, 0xe9, 0x79, 0x54, + 0xfb, 0xff, 0x94, 0xe6, 0x91, 0xd4, 0x95, 0x4f, 0xa9, 0xa9, 0x63, 0x2b, 0xf2, 0x4a, 0xde, 0x98, + 0x62, 0xc4, 0x76, 0xed, 0xac, 0x63, 0x21, 0x91, 0xed, 0x3b, 0x20, 0x21, 0x90, 0x50, 0x06, 0x49, + 0x48, 0xfe, 0xd4, 0x6b, 0xc9, 0x53, 0xae, 0x75, 0x9a, 0x3d, 0x7f, 0x0d, 0x58, 0xf8, 0xea, 0xbb, + 0xb6, 0xaa, 0xe5, 0x4f, 0x1b, 0x82, 0xf1, 0xc3, 0xf8, 0x73, 0xfd, 0x5e, 0xae, 0xd0, 0x09, 0x0c, + 0x8b, 0xf3, 0xfc, 0x14, 0xef, 0xe5, 0x16, 0xe4, 0xd3, 0x2c, 0xbc, 0x97, 0xab, 0xb3, 0x6b, 0x55, + 0x4f, 0x76, 0xd0, 0xd2, 0xc7, 0x7b, 0x54, 0x1c, 0xc3, 0x7c, 0x7b, 0x51, 0xa9, 0x53, 0xf5, 0xb2, + 0x67, 0xa1, 0xd7, 0xe0, 0xef, 0x3d, 0x16, 0x22, 0x00, 0x6f, 0x08, 0xc0, 0xe3, 0x2e, 0xca, 0x5d, + 0x18, 0x56, 0x39, 0x18, 0x5a, 0xe5, 0x20, 0xe8, 0x65, 0xcf, 0x56, 0xde, 0xd7, 0x78, 0x5e, 0x41, + 0x3c, 0xd7, 0x15, 0xcf, 0x8f, 0x72, 0xd8, 0xb5, 0x7b, 0x14, 0xc6, 0x1d, 0x2f, 0xe4, 0xa6, 0xc0, + 0xcb, 0x07, 0x4b, 0xde, 0x6d, 0xd2, 0x00, 0xc2, 0x39, 0xc2, 0x39, 0xc2, 0x39, 0xc2, 0x39, 0xc2, + 0x39, 0xc2, 0x39, 0xc2, 0xf9, 0xee, 0xc2, 0x39, 0x67, 0xc1, 0x9b, 0xe9, 0xaa, 0xc4, 0xf3, 0x71, + 0x0b, 0xfb, 0x11, 0xd0, 0x11, 0xc7, 0xd7, 0xc5, 0xf1, 0x9c, 0x86, 0xef, 0x90, 0x9b, 0xdc, 0x90, + 0x9c, 0xe4, 0x05, 0xc5, 0x9a, 0x95, 0xdf, 0xbc, 0x91, 0x2f, 0x2b, 0x7a, 0xa6, 0xe7, 0x87, 0xcc, + 0xf2, 0x3d, 0x5b, 0x6a, 0xee, 0x41, 0x63, 0x47, 0x10, 0x4f, 0xa2, 0x6b, 0x51, 0xfb, 0x32, 0x2d, + 0x71, 0xbd, 0x2b, 0x31, 0x3b, 0xa6, 0x35, 0xd7, 0xcc, 0x1f, 0x48, 0xcf, 0x11, 0xd6, 0x91, 0x9e, + 0x23, 0x3d, 0x47, 0x7a, 0x8e, 0xf4, 0x1c, 0xe9, 0xf9, 0x2e, 0xc3, 0xb8, 0xc1, 0x9d, 0x2e, 0x53, + 0x8a, 0xe5, 0xa3, 0x16, 0x90, 0x9e, 0x23, 0x3d, 0xcf, 0x61, 0xf8, 0x1e, 0xcc, 0x6d, 0xee, 0x58, + 0xdf, 0xc3, 0xc4, 0x0f, 0x94, 0x40, 0x72, 0x8e, 0xe4, 0x1c, 0xc9, 0x39, 0xa2, 0xba, 0x44, 0x54, + 0x97, 0x30, 0xbc, 0x69, 0x40, 0x77, 0x3c, 0x24, 0xe7, 0x08, 0xea, 0x48, 0xce, 0x91, 0x9c, 0x23, + 0x39, 0x47, 0x72, 0x8e, 0xe4, 0x7c, 0x97, 0x61, 0x5c, 0x35, 0x39, 0x9f, 0xb4, 0x80, 0xe4, 0x1c, + 0xc9, 0x39, 0x92, 0x73, 0x24, 0xe7, 0x48, 0xce, 0x91, 0x9c, 0x23, 0x39, 0xa7, 0x8f, 0xea, 0x39, + 0x38, 0x35, 0x52, 0xbc, 0xae, 0x5c, 0x41, 0xf5, 0xe8, 0xc8, 0xd6, 0xcc, 0x57, 0x26, 0x59, 0x7e, + 0x4f, 0x24, 0xee, 0x4c, 0x63, 0xcd, 0xe0, 0x2a, 0x14, 0xb7, 0x44, 0xc1, 0x3d, 0x45, 0xeb, 0x96, + 0x2f, 0x6e, 0xd9, 0xf7, 0xe2, 0xd7, 0x57, 0x9d, 0x13, 0x28, 0xce, 0x05, 0xae, 0x19, 0xdf, 0x9e, + 0x18, 0x8f, 0xa0, 0x34, 0xda, 0x5c, 0x69, 0xb4, 0xaf, 0xb5, 0x87, 0xab, 0xdf, 0x6b, 0x0f, 0xf5, + 0x76, 0x74, 0xb6, 0x50, 0xf6, 0xcb, 0xa3, 0xdd, 0x5c, 0xdf, 0xd5, 0x2f, 0x6b, 0x0f, 0x57, 0x59, + 0xae, 0x6b, 0xd5, 0xb8, 0xff, 0xbd, 0xfe, 0xd0, 0x6e, 0x7e, 0x6b, 0x34, 0x6e, 0xfe, 0xc8, 0xf2, + 0x73, 0x7c, 0xae, 0x5d, 0x3c, 0x5c, 0x5f, 0x66, 0xba, 0xd0, 0x5b, 0xe3, 0x5b, 0x96, 0x6f, 0xff, + 0xfa, 0xae, 0x55, 0xff, 0xf2, 0x50, 0x6b, 0xd5, 0xaf, 0xda, 0x97, 0xd7, 0x0f, 0x97, 0xdf, 0xae, + 0x5b, 0x59, 0x7e, 0x9a, 0xfb, 0xc6, 0xb0, 0xe8, 0x5e, 0xfb, 0xf2, 0x6b, 0xed, 0xee, 0xae, 0x9e, + 0xe9, 0xe2, 0x7b, 0x17, 0xb5, 0xcb, 0xdf, 0x1a, 0x37, 0xb5, 0xbb, 0x7a, 0x96, 0x1f, 0xa2, 0xf5, + 0x50, 0xbb, 0x6b, 0x5e, 0xd6, 0xaf, 0xff, 0x59, 0x7f, 0xc8, 0xb6, 0x97, 0xca, 0x74, 0x31, 0xcd, + 0xcb, 0xaf, 0xb5, 0x66, 0xf3, 0xba, 0x99, 0xe5, 0x47, 0x68, 0xd6, 0xef, 0x9a, 0xd9, 0x2e, 0x08, + 0xfa, 0xf9, 0x21, 0xd3, 0x71, 0xe2, 0xf2, 0xfe, 0xae, 0xf5, 0x70, 0x7f, 0x73, 0x53, 0x7f, 0x68, + 0x67, 0x9f, 0x9d, 0x1e, 0x32, 0x1d, 0xe4, 0x9a, 0xad, 0xfb, 0x87, 0xda, 0x97, 0x7a, 0xee, 0xaa, + 0x9a, 0x7e, 0x40, 0xa2, 0x26, 0x9f, 0xa8, 0x35, 0xef, 0x3f, 0xb7, 0xf2, 0x96, 0xa8, 0xdd, 0x37, + 0xea, 0x0f, 0xb5, 0xd6, 0xf5, 0xdd, 0x97, 0x76, 0xf3, 0x8f, 0x66, 0xab, 0x7e, 0x9b, 0x6d, 0x32, + 0x9d, 0x7f, 0x96, 0xf6, 0xb7, 0xc6, 0x55, 0xad, 0x55, 0xdf, 0xdf, 0xd2, 0xc4, 0x4f, 0x09, 0xca, + 0xa4, 0xfd, 0x90, 0xd9, 0x46, 0xcf, 0xff, 0x8b, 0x05, 0xe2, 0x62, 0xe9, 0xcc, 0xb5, 0x90, 0x4c, + 0x21, 0x99, 0xaa, 0x39, 0x18, 0x15, 0xc9, 0x54, 0xb4, 0xe2, 0xa8, 0x44, 0xa5, 0x51, 0xc9, 0x35, + 0x5c, 0x89, 0x50, 0xac, 0xb2, 0x66, 0xab, 0xb8, 0xa0, 0xa8, 0xba, 0x46, 0x4b, 0xb1, 0x5a, 0x28, + 0x11, 0x8f, 0x94, 0xd6, 0x62, 0xa9, 0xba, 0x4c, 0xb5, 0x32, 0x28, 0x49, 0xdf, 0xa5, 0x3d, 0x20, + 0x1d, 0x28, 0x8c, 0xbc, 0xe8, 0x8a, 0xa9, 0xda, 0x4a, 0x69, 0x31, 0xce, 0xb9, 0x7a, 0xf2, 0xab, + 0xa2, 0x9b, 0x9d, 0xec, 0xfa, 0x7e, 0xda, 0xd0, 0x47, 0xc5, 0x90, 0xfb, 0x81, 0xf9, 0xb2, 0xdd, + 0x87, 0xce, 0x14, 0xa5, 0x18, 0x5d, 0xb0, 0xa5, 0xdf, 0xe3, 0x1d, 0x2c, 0x16, 0x3b, 0x58, 0x8b, + 0x04, 0x69, 0xc9, 0xe0, 0x2c, 0x1a, 0x94, 0xa5, 0x83, 0xb1, 0x74, 0x10, 0x96, 0x0f, 0xbe, 0x6a, + 0x36, 0x14, 0xf7, 0x20, 0xb0, 0xa2, 0x35, 0x19, 0x4d, 0x41, 0x26, 0x1c, 0x5f, 0x87, 0x33, 0xeb, + 0xc0, 0x83, 0x8a, 0x3c, 0x98, 0xfc, 0x06, 0x99, 0xa1, 0x37, 0x3c, 0x14, 0x9a, 0xc1, 0x4a, 0x71, + 0x60, 0xf8, 0x7d, 0xed, 0xf1, 0xa4, 0x4e, 0xf2, 0x3c, 0xd8, 0x61, 0x04, 0x12, 0x3f, 0x04, 0x36, + 0x66, 0x5c, 0x54, 0xb2, 0xec, 0x0a, 0x2c, 0x1b, 0x96, 0xad, 0xc9, 0xb2, 0x45, 0x26, 0x30, 0x81, + 0x61, 0xc7, 0x00, 0xbd, 0xfc, 0xa1, 0x73, 0x1c, 0xa2, 0x54, 0xef, 0x5b, 0x2d, 0xf8, 0xdc, 0x7f, + 0x9e, 0x3e, 0x93, 0x00, 0x44, 0xcf, 0x5d, 0x06, 0x94, 0x06, 0x4a, 0x6f, 0x9a, 0x58, 0x12, 0x51, + 0x77, 0xf6, 0x6a, 0x60, 0x35, 0x82, 0xaf, 0x62, 0xf0, 0x15, 0x3e, 0x0a, 0x5a, 0x30, 0x13, 0x54, + 0xcb, 0x08, 0x25, 0xa7, 0xb0, 0xf4, 0x54, 0x56, 0x99, 0xd2, 0x44, 0x53, 0x5b, 0x75, 0x8a, 0x93, + 0x4d, 0x75, 0xb2, 0x29, 0x4f, 0x37, 0xf5, 0x25, 0x85, 0x4d, 0xc1, 0xb1, 0x17, 0x35, 0x89, 0xe8, + 0xc2, 0x31, 0xbd, 0x28, 0x2e, 0x55, 0x0f, 0x5b, 0xf9, 0xb0, 0x13, 0xf1, 0x5a, 0xd6, 0x5c, 0x28, + 0xcc, 0x86, 0xd8, 0x7c, 0xa8, 0xcc, 0x88, 0xdc, 0x9c, 0xc8, 0xcd, 0x8a, 0xde, 0xbc, 0xe4, 0xcc, + 0x4c, 0xd2, 0xdc, 0xa2, 0xdb, 0x97, 0x7e, 0x33, 0x74, 0x69, 0xe6, 0xb8, 0xcc, 0xec, 0xc8, 0xed, + 0x58, 0x59, 0x8a, 0x37, 0xa7, 0x0a, 0x6d, 0x34, 0xc6, 0xf9, 0xd2, 0xc7, 0x8f, 0x87, 0xb3, 0xff, + 0x9b, 0xa6, 0x47, 0xa3, 0x50, 0x78, 0x38, 0x34, 0xf8, 0x84, 0x5e, 0x86, 0xd3, 0xeb, 0x39, 0x25, + 0x33, 0x79, 0xf5, 0x3c, 0x73, 0x36, 0xe9, 0x9a, 0xfb, 0xdb, 0xa1, 0x14, 0x6e, 0xa8, 0x64, 0xa4, + 0xb3, 0xb7, 0x32, 0xf7, 0x37, 0x21, 0x65, 0x4f, 0x7c, 0xbc, 0x44, 0x8a, 0x0c, 0x48, 0x05, 0x2a, + 0x95, 0x00, 0x85, 0x33, 0x6b, 0xc1, 0x6f, 0x89, 0x79, 0x21, 0xf5, 0x12, 0x03, 0xf2, 0x01, 0x44, + 0x25, 0x70, 0xcc, 0x06, 0x0c, 0xe9, 0xd0, 0xa0, 0xc7, 0x61, 0x88, 0x2d, 0x11, 0x2c, 0x8b, 0x16, + 0x82, 0x4a, 0x2b, 0x49, 0xca, 0x57, 0x81, 0xcb, 0x80, 0xcb, 0x40, 0xca, 0x87, 0x94, 0x0f, 0x29, + 0x1f, 0x52, 0x3e, 0xa4, 0x7c, 0xfb, 0x93, 0xf2, 0xc9, 0xd0, 0x86, 0x9e, 0x8c, 0x4f, 0x60, 0xc9, + 0x57, 0x82, 0xdf, 0x48, 0xd7, 0x01, 0x7e, 0x63, 0xef, 0x82, 0x91, 0xa8, 0x78, 0xe3, 0x84, 0xbc, + 0xc6, 0xb9, 0xe0, 0xfa, 0xc1, 0xad, 0xe3, 0xd5, 0x5d, 0xd6, 0x1d, 0xaf, 0xaa, 0x7a, 0x7d, 0xd7, + 0x15, 0xe0, 0xd0, 0x5b, 0xf3, 0x87, 0xfc, 0xc5, 0xf7, 0x81, 0xcd, 0x02, 0x66, 0x5f, 0xbc, 0x8f, + 0x2f, 0xcd, 0xf6, 0x26, 0x86, 0xb5, 0xf3, 0x3f, 0x81, 0x1d, 0x0d, 0x6b, 0x67, 0xfc, 0x9e, 0x6d, + 0x6f, 0x10, 0x58, 0xeb, 0xa7, 0xea, 0x6e, 0x1d, 0x5b, 0x1d, 0x78, 0x60, 0x7a, 0xa1, 0xc5, 0x9c, + 0xb7, 0x18, 0x6f, 0xfd, 0x4c, 0x4b, 0x23, 0xcd, 0x5c, 0x94, 0x8d, 0x6d, 0x0e, 0xf1, 0xef, 0xb8, + 0x90, 0xc9, 0x9d, 0x0e, 0xb3, 0xcf, 0x87, 0x7d, 0xc3, 0x84, 0x39, 0x8f, 0xea, 0x06, 0x07, 0xb1, + 0x89, 0xa7, 0x9a, 0xc6, 0xa4, 0x6f, 0x8f, 0x83, 0xd0, 0xc4, 0xd4, 0x83, 0x37, 0xc2, 0xdb, 0x1c, + 0x98, 0x67, 0x3e, 0xbb, 0xcc, 0x96, 0xd7, 0xbc, 0x26, 0x0d, 0xec, 0x49, 0x15, 0x5e, 0xa9, 0x29, + 0xbe, 0x3f, 0xc2, 0x97, 0x94, 0x09, 0x64, 0x45, 0x2e, 0x7f, 0xf6, 0x7d, 0x97, 0x99, 0x9e, 0x8a, + 0x5c, 0x5e, 0x4e, 0x81, 0xc8, 0xcd, 0xf8, 0x2b, 0x0b, 0x3c, 0xc6, 0x8d, 0x5e, 0xd7, 0x36, 0x7a, + 0x01, 0x1b, 0xc4, 0x20, 0x05, 0xfb, 0x5f, 0xd5, 0x1a, 0x9c, 0x01, 0x9c, 0x41, 0xce, 0x9d, 0x41, + 0x6e, 0x4a, 0x86, 0xd4, 0x5b, 0x5f, 0xeb, 0x0f, 0x77, 0xf5, 0x56, 0xbb, 0x71, 0x7b, 0xd5, 0x6e, + 0xfd, 0xd1, 0xa8, 0x67, 0xbf, 0x4c, 0x48, 0xbd, 0xf5, 0xb5, 0x5d, 0x2e, 0x95, 0xbe, 0x5c, 0xd4, + 0x9a, 0xf5, 0x76, 0xf3, 0xa1, 0x9a, 0xe5, 0x32, 0x21, 0xa3, 0x67, 0x19, 0x3d, 0xca, 0xcd, 0x43, + 0xd6, 0x9f, 0xa4, 0x3a, 0x7e, 0x92, 0x46, 0xf3, 0x36, 0x07, 0xa3, 0x12, 0x0d, 0x4b, 0xe6, 0x9f, + 0xe5, 0xdb, 0xdd, 0x55, 0xfd, 0xf3, 0xf5, 0x5d, 0xfd, 0x2a, 0x0f, 0x83, 0xd2, 0xae, 0xdd, 0x5f, + 0x66, 0xde, 0x50, 0xfe, 0x2b, 0x3f, 0x46, 0x3f, 0xe3, 0x8a, 0xcb, 0xa5, 0xbc, 0xf8, 0xe2, 0x7f, + 0x3d, 0xe4, 0xe5, 0x49, 0x9a, 0x0f, 0xf9, 0x31, 0x96, 0x66, 0x7e, 0x8c, 0xe5, 0xf2, 0xf7, 0xab, + 0xec, 0xc7, 0xc8, 0x6a, 0x9e, 0x20, 0x6c, 0xfc, 0x2c, 0xf5, 0x3c, 0x01, 0xe5, 0x6d, 0x6e, 0x86, + 0x25, 0x57, 0x48, 0x79, 0x79, 0x93, 0x0f, 0x83, 0x69, 0xd7, 0x2e, 0x2f, 0xf3, 0x33, 0x28, 0x0f, + 0xb9, 0xf1, 0xc7, 0x39, 0xf2, 0x61, 0xf5, 0xdc, 0x24, 0xc5, 0x37, 0xf9, 0x99, 0x5f, 0x6a, 0xa6, + 0x92, 0xf1, 0x42, 0xa6, 0x22, 0x62, 0x7c, 0x87, 0x59, 0x46, 0xd7, 0xb7, 0x15, 0x36, 0x9d, 0x47, + 0x2d, 0x40, 0x74, 0x8f, 0xd1, 0x12, 0x44, 0x77, 0x42, 0x8b, 0x80, 0xe8, 0x2e, 0xfb, 0x20, 0x9f, + 0xeb, 0x97, 0xed, 0xdb, 0xfb, 0xab, 0x7a, 0x4e, 0x04, 0xf7, 0xc1, 0xe3, 0xd4, 0xbe, 0xb5, 0xee, + 0x33, 0x7d, 0x1c, 0x43, 0xfd, 0xb2, 0x5d, 0xbf, 0xab, 0x5d, 0xdc, 0x64, 0x5b, 0x04, 0x1d, 0x3c, + 0xc6, 0xd5, 0x75, 0x53, 0xf5, 0x39, 0xf6, 0x29, 0x04, 0xfb, 0x41, 0xd7, 0xe8, 0x98, 0x16, 0xf7, + 0x03, 0xf5, 0xe5, 0xf0, 0x55, 0x8d, 0x21, 0x30, 0x23, 0x30, 0x23, 0x30, 0x67, 0x23, 0x30, 0xcf, + 0x9c, 0x4f, 0xd5, 0xfe, 0x7c, 0xff, 0x70, 0xdb, 0xfe, 0x5c, 0xbb, 0x6c, 0xdd, 0x3f, 0xe4, 0x24, + 0x4e, 0xff, 0x9f, 0xe6, 0xe7, 0x46, 0xbb, 0x71, 0xf3, 0x2d, 0xd3, 0x27, 0x3f, 0x0d, 0x1e, 0xa2, + 0x72, 0x96, 0xe9, 0xa3, 0x93, 0x3e, 0x37, 0xb2, 0x7c, 0xfb, 0xff, 0x55, 0xc9, 0x78, 0xe7, 0x67, + 0x5a, 0x66, 0xf9, 0xaf, 0x6c, 0x4f, 0x9e, 0xcb, 0xcf, 0x8d, 0x4a, 0xbb, 0x76, 0x99, 0xe9, 0x54, + 0xe1, 0xbe, 0xf5, 0x35, 0xdb, 0xaa, 0x63, 0x33, 0xdb, 0x73, 0xe8, 0xee, 0xfe, 0x6e, 0x10, 0xc5, + 0xbe, 0x7c, 0x19, 0x64, 0x39, 0xd9, 0x3e, 0x2a, 0xb6, 0xf6, 0x5b, 0xd6, 0x8d, 0x39, 0xeb, 0x28, + 0x91, 0x71, 0x3b, 0x56, 0xc5, 0xb9, 0xac, 0x27, 0xfa, 0x99, 0x7e, 0xbb, 0x75, 0x26, 0x27, 0x4c, + 0xac, 0x00, 0x7f, 0x6b, 0xfa, 0x9d, 0x3b, 0x28, 0xc2, 0xdf, 0x7b, 0x7d, 0x0f, 0x1d, 0xcb, 0x74, + 0x0d, 0xeb, 0xd5, 0xf4, 0x3c, 0xe6, 0x86, 0xe2, 0xef, 0xcc, 0x2d, 0x37, 0x81, 0xd7, 0xe7, 0xf0, + 0xfa, 0x1c, 0x89, 0xfd, 0x8b, 0x57, 0x09, 0x1e, 0x4d, 0x41, 0x85, 0x32, 0xc1, 0xe3, 0x06, 0xf6, + 0xa3, 0x4e, 0x30, 0x34, 0xc2, 0xcc, 0x6a, 0x84, 0xd2, 0xa5, 0xa3, 0x24, 0x0b, 0x69, 0x2f, 0x5b, + 0x8a, 0x6c, 0x85, 0x4b, 0x05, 0x83, 0x51, 0x36, 0x1c, 0x0a, 0x03, 0xa2, 0x37, 0x24, 0x2a, 0x83, + 0x22, 0x37, 0x2c, 0x72, 0x03, 0xd3, 0x62, 0x68, 0x6a, 0xec, 0x2c, 0x5b, 0x44, 0x4a, 0xd6, 0x00, + 0xa3, 0x06, 0x6c, 0x16, 0x5a, 0x81, 0xd3, 0x93, 0xae, 0x61, 0xb4, 0x72, 0x2e, 0xce, 0x36, 0xaa, + 0x38, 0x44, 0x6a, 0x15, 0xde, 0xc8, 0x4c, 0x95, 0xd2, 0x64, 0xf5, 0x99, 0x2e, 0xb5, 0x09, 0x6b, + 0x33, 0x65, 0x6d, 0x26, 0xad, 0xd5, 0xb4, 0xd5, 0x4c, 0x9c, 0x40, 0x20, 0x28, 0x90, 0xd4, 0x8d, + 0x5b, 0x9a, 0x7f, 0x21, 0x0f, 0x1c, 0xef, 0x85, 0x62, 0xde, 0x4d, 0x02, 0xea, 0xd9, 0xc1, 0x6e, + 0xfa, 0x57, 0xa1, 0x6f, 0x8b, 0x8e, 0x67, 0xb3, 0x1f, 0x74, 0x3e, 0x70, 0xd4, 0x1c, 0xbc, 0x1f, + 0xbc, 0x1f, 0xbc, 0x5f, 0xaa, 0xbd, 0x5f, 0xdf, 0xf1, 0x78, 0xf9, 0x84, 0xd0, 0xfb, 0x9d, 0x10, + 0x34, 0x25, 0x77, 0xc2, 0xfa, 0xba, 0xff, 0x68, 0xec, 0xa0, 0xa0, 0x7a, 0x22, 0xbb, 0x66, 0x37, + 0xb7, 0xd4, 0xac, 0xe2, 0x09, 0xee, 0x6b, 0xdb, 0x25, 0x38, 0x9d, 0x5c, 0x93, 0x79, 0xcc, 0x0f, + 0x95, 0xf9, 0x43, 0xdb, 0x50, 0x1d, 0x61, 0xa8, 0x7e, 0x1e, 0xa4, 0xa3, 0x95, 0xa7, 0x0c, 0xb2, + 0x16, 0x37, 0x83, 0x17, 0xc6, 0x0d, 0xbf, 0xcf, 0x7b, 0x7d, 0x6e, 0xf4, 0xfc, 0xbf, 0x58, 0x40, + 0x47, 0x5e, 0xab, 0x1a, 0x07, 0x87, 0x81, 0xc3, 0xc0, 0x61, 0xa9, 0xe6, 0x30, 0x9b, 0x59, 0x4e, + 0xd7, 0x74, 0x4f, 0xaa, 0x94, 0x89, 0x68, 0x85, 0xa0, 0xad, 0xa5, 0x18, 0x52, 0x01, 0xe0, 0xc9, + 0x0d, 0x47, 0x05, 0xd4, 0x00, 0xc0, 0x03, 0xe0, 0xed, 0x03, 0xe0, 0xfd, 0x30, 0x5c, 0x33, 0x24, + 0xa5, 0xba, 0x49, 0x8b, 0x40, 0x39, 0xa0, 0x1c, 0x50, 0x2e, 0xd5, 0x28, 0x27, 0x5f, 0x13, 0x77, + 0x2d, 0xc8, 0x95, 0x77, 0xe5, 0x04, 0x13, 0x5d, 0xce, 0x55, 0x3c, 0x50, 0x26, 0x6a, 0x87, 0x62, + 0xeb, 0xe1, 0xd2, 0x8e, 0xba, 0xc3, 0xf1, 0x0f, 0x87, 0x4a, 0x9b, 0x2e, 0x0a, 0x34, 0x9b, 0x14, + 0x1b, 0xe3, 0xbb, 0xbb, 0x1c, 0xdf, 0x5c, 0x7b, 0xfc, 0x83, 0xd4, 0x41, 0xa3, 0xf2, 0x83, 0x2d, + 0x31, 0xd0, 0x8a, 0x0b, 0x4d, 0x24, 0x0b, 0x4c, 0x79, 0x3b, 0x38, 0x0d, 0x3b, 0x5f, 0x52, 0x10, + 0xcd, 0x70, 0x7c, 0x1a, 0xd5, 0xf1, 0x69, 0xe3, 0x83, 0xd2, 0x46, 0x16, 0x9e, 0x62, 0x4f, 0x26, + 0x77, 0x32, 0xea, 0xd2, 0x00, 0xc8, 0x9e, 0x59, 0x56, 0xa0, 0xdc, 0xc3, 0x57, 0x81, 0x27, 0x83, + 0x27, 0xdb, 0x89, 0x27, 0xc3, 0x1e, 0x3e, 0xa4, 0xdc, 0x48, 0xb9, 0x91, 0x72, 0x2b, 0xc6, 0x50, + 0xec, 0xe1, 0xc3, 0x1e, 0x3e, 0x78, 0x3f, 0x78, 0xbf, 0x7d, 0xf4, 0x7e, 0xd8, 0xc3, 0x27, 0x72, + 0x63, 0xd8, 0xc3, 0x87, 0x25, 0x5e, 0x2c, 0xf1, 0x16, 0xb0, 0xc4, 0xab, 0xc8, 0x5a, 0x1a, 0xf6, + 0xee, 0xcd, 0x36, 0x4a, 0xc3, 0x5d, 0x65, 0x70, 0x17, 0xb8, 0x0b, 0xdc, 0x45, 0x21, 0x34, 0x45, + 0x0d, 0x99, 0x6f, 0x2f, 0x74, 0x33, 0x64, 0x32, 0x97, 0x07, 0x8d, 0x12, 0x0d, 0x21, 0x2d, 0x8b, + 0x90, 0xb9, 0x00, 0x1d, 0xae, 0x60, 0xa5, 0x4b, 0x78, 0xef, 0xb1, 0xb0, 0x48, 0x48, 0x21, 0xc4, + 0x4e, 0x41, 0xbb, 0x73, 0xd0, 0xee, 0x24, 0xd6, 0x3a, 0x8b, 0x61, 0xcf, 0xa7, 0x0d, 0x4f, 0x88, + 0x66, 0x2d, 0x59, 0xda, 0xb6, 0x34, 0x67, 0x29, 0xb7, 0xfe, 0x2e, 0xc5, 0x7f, 0xc2, 0x4d, 0xa7, + 0x5a, 0xb6, 0x02, 0x6b, 0xca, 0x17, 0xe9, 0xf3, 0x46, 0xad, 0xf9, 0xe3, 0xe2, 0xb0, 0x11, 0x6f, + 0x15, 0xd6, 0x9d, 0xa4, 0x24, 0x91, 0xac, 0x68, 0xc8, 0x2f, 0xb5, 0xe6, 0x99, 0x9a, 0xf3, 0xcd, + 0x5c, 0x0d, 0xe9, 0x41, 0x3a, 0x5b, 0x7b, 0x4a, 0x49, 0x7e, 0x4c, 0x30, 0xe5, 0x8b, 0x8e, 0x17, + 0x72, 0x73, 0x18, 0xa9, 0x89, 0xc1, 0x75, 0xd2, 0x30, 0xe0, 0x15, 0xf0, 0x0a, 0x78, 0x05, 0xbc, + 0x02, 0x5e, 0x01, 0xaf, 0x20, 0x1d, 0xc0, 0x2b, 0xe0, 0x15, 0xf0, 0x4a, 0x07, 0xaf, 0x9c, 0x05, + 0x6f, 0xa6, 0xab, 0x83, 0x5e, 0xc7, 0x2d, 0x03, 0x5f, 0x81, 0xaf, 0xc0, 0xd7, 0xbd, 0xc3, 0xd7, + 0x90, 0x9b, 0xdc, 0x20, 0x76, 0x02, 0xb3, 0x8e, 0xe0, 0x8c, 0xb0, 0xc9, 0x6f, 0xde, 0x28, 0x86, + 0x15, 0x3d, 0xd3, 0xf3, 0x43, 0x66, 0xf9, 0x9e, 0x4d, 0x6a, 0x6b, 0x80, 0x58, 0x7d, 0x3b, 0x79, + 0x00, 0xb1, 0xbb, 0x87, 0x58, 0xdd, 0x43, 0x5a, 0x3e, 0xab, 0x56, 0x4f, 0x4e, 0xab, 0xd5, 0xd2, + 0xe9, 0xd1, 0x69, 0xe9, 0xfc, 0xf8, 0xb8, 0x7c, 0x22, 0x73, 0x78, 0x1f, 0xb8, 0x76, 0x7f, 0xb8, + 0xb6, 0x4b, 0x38, 0xeb, 0xa3, 0x90, 0x36, 0x68, 0x14, 0x34, 0x0b, 0x9a, 0x05, 0xcd, 0xee, 0x1d, + 0xcd, 0x42, 0x8c, 0x05, 0xc7, 0x2e, 0x0c, 0x1b, 0xc4, 0xd8, 0xdc, 0x71, 0x2c, 0xc4, 0x58, 0x40, + 0xeb, 0x6e, 0xa1, 0xd5, 0xe0, 0x4e, 0x97, 0x69, 0x21, 0xd7, 0x51, 0xcb, 0xc0, 0x57, 0xe0, 0x2b, + 0xf0, 0x75, 0xef, 0xf0, 0x75, 0x60, 0xfb, 0xdc, 0xb1, 0xbe, 0x87, 0x5a, 0x00, 0x16, 0x52, 0x2c, + 0xa4, 0x58, 0x20, 0x6c, 0x3a, 0x10, 0x16, 0x52, 0x2c, 0xa8, 0x36, 0x65, 0x54, 0x4b, 0xe8, 0xc8, + 0xa6, 0x40, 0xeb, 0x78, 0x60, 0x59, 0xb0, 0x2c, 0x58, 0x76, 0xff, 0x58, 0x16, 0x52, 0x2c, 0x38, + 0x76, 0x61, 0xd8, 0x20, 0xc5, 0xe6, 0x8e, 0x63, 0x21, 0xc5, 0x02, 0x5a, 0x77, 0x0b, 0xad, 0xba, + 0xa4, 0xd8, 0x49, 0xcb, 0xc0, 0x57, 0xe0, 0x2b, 0xf0, 0x75, 0xef, 0xf0, 0x15, 0x52, 0x2c, 0x10, + 0x56, 0x9f, 0xff, 0x06, 0xc2, 0xa6, 0x07, 0x61, 0x21, 0xc5, 0x82, 0x6a, 0x09, 0xa9, 0x76, 0xa7, + 0x25, 0xbe, 0x88, 0x0e, 0x10, 0x8a, 0xda, 0xd3, 0x7b, 0x90, 0xd0, 0xf0, 0xe0, 0x87, 0x43, 0xba, + 0x9a, 0x7f, 0x05, 0xcd, 0x67, 0x0b, 0x35, 0x07, 0xf7, 0xdb, 0xbe, 0x1e, 0xdc, 0x6f, 0x63, 0x78, + 0xbb, 0x19, 0x2c, 0xdb, 0x38, 0x3c, 0x44, 0xcf, 0x78, 0x76, 0xcc, 0xd0, 0xb0, 0xfa, 0x41, 0xc0, + 0x08, 0x2a, 0x62, 0x4c, 0x4f, 0x52, 0x59, 0x6e, 0x1b, 0x45, 0x1c, 0x63, 0x65, 0x47, 0x28, 0xe2, + 0x88, 0x22, 0x8e, 0xf1, 0x9e, 0x0c, 0x45, 0x1c, 0x21, 0x98, 0x40, 0x30, 0x81, 0x60, 0x92, 0x3a, + 0xc1, 0x04, 0xeb, 0x7d, 0x10, 0x4b, 0x16, 0x86, 0x0d, 0xeb, 0x7d, 0xb9, 0x13, 0x4b, 0xb0, 0xde, + 0x07, 0x65, 0x64, 0x77, 0x53, 0x1e, 0x45, 0x1c, 0x01, 0xaf, 0x80, 0x57, 0xc0, 0x2b, 0xe0, 0x15, + 0xf0, 0x0a, 0x78, 0x05, 0xbc, 0x02, 0x5e, 0x01, 0xaf, 0x59, 0x82, 0x57, 0x14, 0x71, 0x04, 0xbe, + 0x02, 0x5f, 0x81, 0xaf, 0xd4, 0x73, 0x16, 0x45, 0x1c, 0x01, 0xb1, 0x3a, 0x3d, 0x38, 0x20, 0x36, + 0x3d, 0x10, 0x8b, 0xed, 0x6a, 0xe0, 0xda, 0x74, 0x71, 0x2d, 0x8a, 0x38, 0x82, 0x66, 0x41, 0xb3, + 0xa0, 0x59, 0xaa, 0x39, 0x0b, 0x31, 0x16, 0x1c, 0xbb, 0x30, 0x6c, 0x10, 0x63, 0x73, 0xc7, 0xb1, + 0x10, 0x63, 0x01, 0xad, 0xbb, 0x85, 0x56, 0x14, 0x71, 0x04, 0xbe, 0x02, 0x5f, 0x81, 0xaf, 0xc4, + 0x73, 0x16, 0x6f, 0x0e, 0x03, 0x61, 0xf5, 0xf9, 0x6f, 0x20, 0x6c, 0x7a, 0x10, 0x16, 0x52, 0x2c, + 0xa8, 0x36, 0x65, 0x54, 0x8b, 0x22, 0x8e, 0x60, 0x59, 0xb0, 0x2c, 0x58, 0x96, 0x68, 0xce, 0x42, + 0x8a, 0x05, 0xc7, 0x2e, 0x0c, 0x1b, 0xa4, 0xd8, 0xdc, 0x71, 0x2c, 0xa4, 0x58, 0x40, 0xeb, 0x6e, + 0xa1, 0x15, 0x45, 0x1c, 0x81, 0xaf, 0xc0, 0x57, 0xe0, 0x2b, 0xf1, 0x9c, 0x85, 0x14, 0x0b, 0x84, + 0xd5, 0xe7, 0xbf, 0x81, 0xb0, 0xe9, 0x41, 0x58, 0x48, 0xb1, 0xa0, 0x5a, 0x42, 0xaa, 0x45, 0x11, + 0x47, 0xc1, 0x22, 0x8e, 0xe4, 0xa5, 0xff, 0x0a, 0x89, 0xd4, 0x72, 0xbc, 0x19, 0xdc, 0xf6, 0x85, + 0x63, 0x86, 0x97, 0xe3, 0x9b, 0xce, 0x60, 0x45, 0x47, 0xbf, 0xcf, 0x7b, 0x7d, 0x6e, 0x74, 0x02, + 0xf6, 0x3f, 0x7d, 0xe6, 0x59, 0xef, 0x74, 0xf5, 0x1c, 0x97, 0x5a, 0xa6, 0xa9, 0xe6, 0x58, 0x42, + 0x35, 0xc7, 0x1d, 0x26, 0x49, 0xa8, 0xe6, 0x98, 0x22, 0x57, 0x4f, 0x96, 0xfa, 0x44, 0xf3, 0x2f, + 0x32, 0xd6, 0x61, 0xce, 0x48, 0x31, 0xff, 0xe8, 0xb2, 0x9d, 0x69, 0x96, 0x73, 0xfb, 0xf5, 0xdf, + 0x14, 0xb7, 0x46, 0x9b, 0xd5, 0x10, 0x26, 0xa0, 0x3a, 0xb2, 0x18, 0x4d, 0xa8, 0xab, 0x2b, 0x6b, + 0xd1, 0xc9, 0xb1, 0x84, 0x59, 0x8a, 0x96, 0xec, 0x44, 0xf7, 0x50, 0xe9, 0xcf, 0x46, 0xb4, 0x8e, + 0x5e, 0x4a, 0x28, 0xff, 0x29, 0xbb, 0xb0, 0x37, 0xaa, 0x96, 0x4e, 0x0d, 0x7a, 0x14, 0x35, 0xd8, + 0x51, 0xb2, 0x1b, 0x90, 0x07, 0xc8, 0x9b, 0x7b, 0x32, 0x94, 0xec, 0xde, 0xad, 0x0b, 0xd0, 0xe1, + 0x0a, 0x56, 0xba, 0x04, 0x2c, 0x8f, 0x69, 0x76, 0x12, 0x6b, 0x9d, 0x05, 0x96, 0xc7, 0x64, 0xe6, + 0x2c, 0x76, 0x77, 0x61, 0x69, 0x6c, 0x61, 0xd8, 0xb0, 0xbb, 0x2b, 0x89, 0xa4, 0x53, 0x6b, 0xf2, + 0xb9, 0x38, 0xa4, 0xd8, 0xdd, 0xa5, 0xd9, 0xd1, 0xd3, 0xb7, 0x86, 0x92, 0xdd, 0x31, 0xa2, 0x17, + 0x4a, 0x76, 0x03, 0x5e, 0x01, 0xaf, 0x80, 0x57, 0xc0, 0x2b, 0xe0, 0x15, 0xf0, 0x0a, 0x78, 0x05, + 0xbc, 0x02, 0x5e, 0xe9, 0xe1, 0x15, 0x25, 0xbb, 0x81, 0xaf, 0xc0, 0x57, 0xe0, 0x2b, 0xf5, 0x9c, + 0x45, 0xc9, 0x6e, 0x40, 0xac, 0x4e, 0x0f, 0x0e, 0x88, 0x4d, 0x0f, 0xc4, 0xe2, 0xe5, 0x04, 0x70, + 0x6d, 0xba, 0xb8, 0x16, 0x25, 0xbb, 0x41, 0xb3, 0xa0, 0x59, 0xd0, 0x2c, 0xd5, 0x9c, 0x85, 0x18, + 0x0b, 0x8e, 0x5d, 0x18, 0x36, 0x88, 0xb1, 0xb9, 0xe3, 0x58, 0x88, 0xb1, 0x80, 0xd6, 0xdd, 0x42, + 0x2b, 0x4a, 0x76, 0x03, 0x5f, 0x81, 0xaf, 0xc0, 0x57, 0xe2, 0x39, 0x8b, 0x3a, 0x31, 0x40, 0x58, + 0x7d, 0xfe, 0x1b, 0x08, 0x9b, 0x1e, 0x84, 0x85, 0x14, 0x0b, 0xaa, 0x4d, 0x19, 0xd5, 0xa2, 0x64, + 0x37, 0x58, 0x16, 0x2c, 0x0b, 0x96, 0x25, 0x9a, 0xb3, 0x90, 0x62, 0xc1, 0xb1, 0x0b, 0xc3, 0x06, + 0x29, 0x36, 0x77, 0x1c, 0x0b, 0x29, 0x16, 0xd0, 0xba, 0x5b, 0x68, 0x45, 0xc9, 0x6e, 0xe0, 0x2b, + 0xf0, 0x15, 0xf8, 0x4a, 0x3c, 0x67, 0x21, 0xc5, 0x02, 0x61, 0xf5, 0xf9, 0x6f, 0x20, 0x6c, 0x7a, + 0x10, 0x16, 0x52, 0x2c, 0xa8, 0x96, 0x90, 0x6a, 0x51, 0xb2, 0x5b, 0xb0, 0x64, 0x37, 0x61, 0xd1, + 0xbf, 0x42, 0x22, 0xc5, 0xba, 0xef, 0x87, 0x37, 0xdc, 0x18, 0xde, 0x6f, 0x06, 0x4b, 0x37, 0x72, + 0x33, 0x78, 0x61, 0xdc, 0xd0, 0x53, 0xc1, 0x71, 0x55, 0xe3, 0xa8, 0xd6, 0x1d, 0x2b, 0x43, 0x42, + 0x21, 0x47, 0x14, 0x72, 0x4c, 0x38, 0xeb, 0xd1, 0x22, 0xd6, 0x53, 0x8a, 0xf4, 0x5a, 0xc4, 0xf9, + 0xfd, 0x2c, 0xd7, 0x5d, 0x41, 0xb9, 0xee, 0xac, 0x94, 0xeb, 0x3e, 0xc2, 0x50, 0xa1, 0x36, 0xb7, + 0x02, 0xe0, 0xfd, 0x30, 0x86, 0xc7, 0xe0, 0x10, 0x52, 0xdd, 0xa4, 0x45, 0xa0, 0x1c, 0x50, 0x0e, + 0x28, 0x97, 0x6a, 0x94, 0x7b, 0xf6, 0x7d, 0x97, 0x99, 0x1e, 0x25, 0xc8, 0x95, 0x77, 0xe5, 0x04, + 0x0f, 0x12, 0x1c, 0x12, 0x2a, 0xed, 0x24, 0x09, 0xcd, 0x44, 0x61, 0x70, 0xb5, 0xcb, 0x23, 0x72, + 0x16, 0x29, 0x3e, 0xd4, 0x62, 0x57, 0x08, 0x4e, 0x8a, 0x81, 0x8f, 0x1c, 0x55, 0x47, 0xb2, 0x99, + 0xa8, 0x7b, 0x2c, 0xde, 0x38, 0x21, 0xaf, 0x71, 0x2e, 0x17, 0x7f, 0x07, 0x39, 0x40, 0xdd, 0x65, + 0x03, 0x6f, 0x37, 0x20, 0x2a, 0xaf, 0xef, 0xba, 0x1f, 0x0e, 0x64, 0xe8, 0x54, 0xbd, 0x91, 0xfb, + 0xc0, 0x66, 0x01, 0xb3, 0x2f, 0xde, 0xc7, 0x4d, 0x68, 0xed, 0x70, 0x45, 0xeb, 0xd3, 0x6b, 0x75, + 0x12, 0xf6, 0xa6, 0xd1, 0xce, 0xc4, 0x2c, 0x2c, 0xbe, 0x9d, 0xc4, 0xfb, 0x64, 0xcc, 0x81, 0x95, + 0x1d, 0x50, 0x3d, 0x03, 0x29, 0x30, 0x80, 0x1a, 0x06, 0x2e, 0xde, 0x80, 0x6d, 0xef, 0xfe, 0x18, + 0x5d, 0x5f, 0x1c, 0xc5, 0x87, 0xb8, 0x3d, 0x3e, 0x57, 0x06, 0x2a, 0x6e, 0x58, 0x11, 0x3c, 0x5a, + 0x67, 0x8a, 0xeb, 0x31, 0x25, 0x08, 0x19, 0x2c, 0x57, 0xc7, 0x6f, 0x59, 0xcc, 0x56, 0xc6, 0x69, + 0x65, 0x6c, 0x26, 0xc1, 0x63, 0x5a, 0xe3, 0x17, 0x3d, 0x6a, 0xa6, 0x68, 0xf9, 0x9e, 0xc7, 0x2c, + 0xee, 0x07, 0xa3, 0xe3, 0x02, 0x85, 0x07, 0x61, 0x32, 0xfc, 0x0b, 0xed, 0x88, 0x46, 0x7d, 0xa9, + 0xfc, 0x54, 0x3a, 0x1f, 0x55, 0xc9, 0x3f, 0xe9, 0xf2, 0x4d, 0xd5, 0xfc, 0x92, 0x2c, 0x9f, 0x24, + 0xcb, 0x1f, 0x49, 0xf3, 0x45, 0xbd, 0x9c, 0x29, 0x9d, 0xff, 0x4d, 0x0b, 0x78, 0xda, 0xcc, 0xe3, + 0x0e, 0x7f, 0x0f, 0x58, 0x47, 0x66, 0xf0, 0x27, 0xbe, 0x5c, 0x62, 0x4b, 0x42, 0xf1, 0x7a, 0xfc, + 0xd5, 0x17, 0x66, 0xa8, 0x30, 0x7d, 0x26, 0x0f, 0xf2, 0xf9, 0xfa, 0xa2, 0xfe, 0xd0, 0xbe, 0xbc, + 0xbf, 0xbb, 0xab, 0x5f, 0xb6, 0xee, 0x1f, 0xda, 0xad, 0x3f, 0x1a, 0x75, 0xd9, 0x99, 0x34, 0x54, + 0x3c, 0x43, 0x25, 0x89, 0x9f, 0x48, 0x3a, 0xbb, 0xb9, 0x9c, 0x3e, 0x52, 0x71, 0x17, 0x72, 0x20, + 0xd1, 0x73, 0x34, 0x73, 0xf2, 0x1c, 0xb7, 0x8d, 0x7b, 0x92, 0x07, 0x39, 0x48, 0x46, 0x4d, 0xfe, + 0xa9, 0x8b, 0xf5, 0x05, 0xc0, 0xc8, 0x36, 0x39, 0x33, 0x2c, 0xdf, 0x56, 0x08, 0xcb, 0xd3, 0x26, + 0x10, 0x91, 0x11, 0x91, 0x73, 0x1e, 0x91, 0x87, 0x93, 0xdd, 0xf4, 0x6c, 0xd9, 0xf7, 0x07, 0xa2, + 0x98, 0x2c, 0xb1, 0x4b, 0xb8, 0xd8, 0x30, 0x39, 0x67, 0x81, 0x27, 0x1d, 0xfa, 0x8a, 0xff, 0xfd, + 0x67, 0xc9, 0x38, 0x7f, 0xfa, 0xbb, 0xfa, 0xf3, 0xf1, 0xd1, 0x18, 0xfd, 0x58, 0x99, 0xfd, 0xb1, + 0x35, 0xf9, 0xe1, 0xd3, 0xd2, 0x0f, 0xbf, 0x3c, 0x3e, 0x7e, 0x1c, 0xfe, 0xfc, 0x8f, 0x5f, 0xff, + 0xf3, 0x5f, 0x7f, 0xfe, 0xc3, 0x78, 0x5a, 0xfa, 0xc4, 0x7f, 0x88, 0x0f, 0xf6, 0x53, 0x0a, 0x1c, + 0x20, 0xf3, 0xcc, 0x67, 0x97, 0xd9, 0xf2, 0xee, 0x6f, 0xd2, 0x00, 0x9c, 0x1f, 0x9c, 0x5f, 0xce, + 0x9d, 0x9f, 0xfc, 0xf2, 0x93, 0xe4, 0x72, 0x93, 0x26, 0x93, 0xe7, 0xaf, 0x2c, 0xf0, 0x18, 0x37, + 0x7a, 0x5d, 0x15, 0xbb, 0x9f, 0x6d, 0x05, 0xc6, 0x0f, 0xe3, 0x87, 0x16, 0x91, 0x0d, 0x2d, 0xa2, + 0xde, 0xfa, 0x5a, 0x7f, 0xb8, 0xab, 0xb7, 0xda, 0x8d, 0xdb, 0xab, 0x9c, 0x08, 0x11, 0xf5, 0xd6, + 0xd7, 0x76, 0xb9, 0x54, 0xfa, 0x72, 0x51, 0x6b, 0xd6, 0xdb, 0xcd, 0x87, 0x6a, 0x96, 0x93, 0xf8, + 0xd1, 0xb3, 0x8c, 0x1e, 0xe5, 0xe6, 0x21, 0xeb, 0x4f, 0x52, 0x1d, 0x3f, 0x49, 0xa3, 0x79, 0x9b, + 0x83, 0x51, 0x89, 0x86, 0x25, 0xf3, 0xcf, 0xf2, 0xed, 0xee, 0xaa, 0xfe, 0xf9, 0xfa, 0xae, 0x7e, + 0x95, 0x87, 0x41, 0x69, 0xd7, 0xee, 0x2f, 0x33, 0x6f, 0x28, 0xff, 0x95, 0x1f, 0xa3, 0x9f, 0x71, + 0xc5, 0xe5, 0x52, 0x5e, 0x7c, 0xf1, 0xbf, 0x1e, 0xf2, 0xf2, 0x24, 0xcd, 0x87, 0xfc, 0x18, 0x4b, + 0x33, 0x3f, 0xc6, 0x72, 0xf9, 0xfb, 0x55, 0xf6, 0x63, 0x64, 0x35, 0x4f, 0x10, 0x36, 0x7e, 0x96, + 0x7a, 0x9e, 0x80, 0xf2, 0x36, 0x37, 0xc3, 0x92, 0x2b, 0xa4, 0xbc, 0xbc, 0xc9, 0x87, 0xc1, 0xb4, + 0x6b, 0x97, 0x97, 0xf9, 0x19, 0x94, 0x87, 0xdc, 0xf8, 0xe3, 0x1c, 0xf9, 0xb0, 0x7a, 0x6e, 0x92, + 0xe2, 0x9b, 0xfc, 0xcc, 0x2f, 0x35, 0x53, 0xd9, 0xa3, 0x0d, 0x07, 0xb3, 0xb2, 0xb9, 0xd1, 0x0b, + 0x98, 0xe5, 0x7b, 0x1d, 0x1a, 0x11, 0x3e, 0x6a, 0x0d, 0x62, 0x7c, 0x8c, 0x96, 0x20, 0xc6, 0x13, + 0x5a, 0x0a, 0xc4, 0x78, 0x05, 0x1f, 0x0a, 0x31, 0x3e, 0x2b, 0xb9, 0x13, 0xc4, 0xf8, 0x02, 0xc4, + 0x78, 0x0d, 0xcf, 0x02, 0x31, 0x3e, 0xb5, 0xfa, 0x22, 0xc4, 0xf8, 0x54, 0xfa, 0x62, 0x88, 0xf1, + 0x05, 0x88, 0xf1, 0x5a, 0xa5, 0x1f, 0x88, 0xf1, 0xe9, 0x1c, 0x18, 0x88, 0xf1, 0xa9, 0x1c, 0x16, + 0x88, 0xf1, 0xa9, 0x44, 0x31, 0x88, 0xf1, 0x69, 0xf4, 0xc7, 0x10, 0xe3, 0x53, 0x38, 0x28, 0x10, + 0xe3, 0x65, 0xa4, 0xbf, 0xc9, 0x7f, 0xd9, 0x14, 0xe3, 0x3b, 0x66, 0xdf, 0xe5, 0x86, 0xe5, 0x7b, + 0xb6, 0x23, 0x55, 0x9d, 0x25, 0xea, 0xfd, 0xc5, 0x86, 0x20, 0xc1, 0xc7, 0x68, 0x09, 0x12, 0x3c, + 0xa1, 0x7d, 0xe0, 0x65, 0x18, 0x49, 0x17, 0xc0, 0x2c, 0xc3, 0xf2, 0x83, 0x80, 0x59, 0x9c, 0xd9, + 0xc6, 0xf3, 0xa8, 0xd6, 0xa7, 0xac, 0x17, 0x58, 0x6e, 0x0b, 0x8e, 0x00, 0x8e, 0x20, 0xe7, 0x8e, + 0xc0, 0xf2, 0xfb, 0x1e, 0x67, 0x81, 0x54, 0x7d, 0x6d, 0x85, 0x33, 0x83, 0x14, 0x2b, 0x5d, 0x2b, + 0x14, 0x41, 0xa4, 0xa8, 0x64, 0x4d, 0x55, 0x2e, 0x96, 0xa8, 0xfc, 0x31, 0x65, 0xb9, 0x63, 0x95, + 0xf2, 0xbe, 0x14, 0x95, 0xa7, 0xa9, 0xbb, 0x96, 0xfe, 0x8c, 0x1b, 0xd2, 0xde, 0x4e, 0xa8, 0x24, + 0xe5, 0x53, 0xfa, 0x62, 0xf5, 0x3b, 0x67, 0x74, 0xc1, 0x7a, 0xd8, 0x18, 0xa2, 0x35, 0xa2, 0x35, + 0xa2, 0x35, 0xa2, 0x35, 0xa2, 0x35, 0xa2, 0x35, 0xa2, 0x35, 0x41, 0xb4, 0xee, 0x2a, 0x55, 0xd6, + 0x8a, 0x5a, 0x40, 0x5c, 0x46, 0x5c, 0xc6, 0x8e, 0xd6, 0x38, 0x92, 0x5a, 0x0a, 0x4a, 0x5d, 0xd6, + 0x2f, 0xdb, 0xb7, 0xf7, 0x57, 0xf5, 0x9c, 0xec, 0x66, 0x1d, 0x3c, 0x4e, 0xed, 0x5b, 0xeb, 0x3e, + 0xcb, 0x6b, 0x43, 0x83, 0x67, 0xa8, 0xdf, 0xd5, 0x2e, 0x6e, 0xb2, 0xbd, 0xc3, 0x70, 0xf0, 0x18, + 0x57, 0xd7, 0x4d, 0xd5, 0xe7, 0xd8, 0xa7, 0xf5, 0x2d, 0x66, 0x19, 0x21, 0x37, 0x79, 0x5f, 0x31, + 0x4f, 0x1e, 0xb7, 0x81, 0x30, 0x8c, 0x30, 0x8c, 0x30, 0x9c, 0x9d, 0x30, 0xdc, 0x6c, 0xd5, 0x5a, + 0xdf, 0x9a, 0x39, 0x0a, 0xc4, 0xe3, 0x07, 0xfa, 0x76, 0x77, 0x73, 0x7f, 0xf9, 0x5b, 0xf6, 0x83, + 0xd9, 0xf8, 0x71, 0x94, 0x1f, 0x66, 0xcf, 0x22, 0x5a, 0xdf, 0x1b, 0xeb, 0xb6, 0xe6, 0xb3, 0xcb, + 0x8c, 0x67, 0xd7, 0xb7, 0xbe, 0x2b, 0xc6, 0xb7, 0x95, 0x2d, 0x22, 0xda, 0x21, 0xda, 0x41, 0x0c, + 0xde, 0x3a, 0xe1, 0x21, 0x06, 0x2b, 0x2a, 0x96, 0x10, 0x83, 0xb5, 0x75, 0x2d, 0xc4, 0xe0, 0x42, + 0x8a, 0xc4, 0xe0, 0xf9, 0x28, 0x3b, 0x70, 0xfb, 0xa4, 0x61, 0x7b, 0xd4, 0x20, 0xa2, 0x36, 0xa2, + 0x36, 0xa2, 0x36, 0xa2, 0x36, 0xa2, 0x36, 0xa2, 0x36, 0xa2, 0xb6, 0x6a, 0xd4, 0xf6, 0x83, 0xae, + 0xd1, 0x31, 0x2d, 0xee, 0x07, 0x0a, 0x91, 0x7a, 0xa6, 0x11, 0x44, 0x67, 0x44, 0x67, 0x28, 0xc8, + 0x31, 0xa6, 0x7c, 0x0a, 0x14, 0xe4, 0xd6, 0x43, 0xed, 0xae, 0x79, 0x59, 0xbf, 0xfe, 0x67, 0xfd, + 0xa1, 0xfd, 0xf9, 0xfe, 0xe1, 0xb6, 0xfd, 0xb9, 0x96, 0xa3, 0xb3, 0x0b, 0xff, 0x4f, 0xf3, 0x73, + 0xa3, 0xdd, 0xb8, 0xf9, 0xd6, 0xcc, 0xb2, 0x88, 0x3c, 0x78, 0x88, 0xca, 0x59, 0x96, 0x9f, 0xe0, + 0xf2, 0x73, 0x23, 0xcb, 0xb7, 0xff, 0x5f, 0x95, 0x8c, 0x77, 0x7e, 0xa6, 0xdf, 0x79, 0xfd, 0xaf, + 0x6c, 0x4f, 0x9e, 0xcb, 0xcf, 0x8d, 0x4a, 0xbb, 0x76, 0x99, 0xe9, 0xad, 0x25, 0xf7, 0xad, 0xaf, + 0xd9, 0x7e, 0x05, 0xbc, 0x99, 0xed, 0x39, 0x74, 0x77, 0x7f, 0x37, 0x88, 0x62, 0x5f, 0xbe, 0xd4, + 0x2e, 0x6e, 0xea, 0x99, 0x36, 0x86, 0x46, 0xed, 0xb7, 0xac, 0x1b, 0x73, 0xd6, 0x51, 0x22, 0xe3, + 0x76, 0xac, 0x8a, 0x73, 0xfb, 0xb4, 0x8c, 0x3e, 0xcd, 0xc9, 0xd5, 0x8b, 0x10, 0xaf, 0x6a, 0x0c, + 0x89, 0x3e, 0x12, 0x7d, 0x24, 0xfa, 0x48, 0xf4, 0x91, 0xe8, 0x23, 0xd1, 0x47, 0xa2, 0x8f, 0x44, + 0x1f, 0x89, 0x3e, 0x12, 0x7d, 0x24, 0xfa, 0x48, 0xf4, 0x91, 0xe8, 0x23, 0xd1, 0x47, 0xa2, 0x9f, + 0x5c, 0xa2, 0xef, 0x78, 0xbd, 0x3e, 0x37, 0x7a, 0xfe, 0x5f, 0x4c, 0x61, 0x05, 0x7f, 0xb6, 0x11, + 0xb9, 0xc4, 0xbe, 0x8c, 0xc4, 0x1e, 0x89, 0x7d, 0x32, 0x89, 0xfd, 0x95, 0x13, 0xc8, 0x0d, 0xbf, + 0xf9, 0xf6, 0xa2, 0x9e, 0x4b, 0x0f, 0x1a, 0x91, 0xec, 0x62, 0xb5, 0x5d, 0x54, 0xd2, 0x26, 0x43, + 0x61, 0x3a, 0x2b, 0x4d, 0xe8, 0xbd, 0x27, 0x5c, 0x51, 0x89, 0xd2, 0x88, 0xc8, 0x8d, 0x89, 0xdc, + 0xa8, 0xd6, 0x1a, 0xd7, 0xb0, 0xe7, 0x92, 0xde, 0xa0, 0x26, 0x39, 0x6b, 0xa4, 0x75, 0xb4, 0xa5, + 0x39, 0x63, 0x33, 0xcb, 0xe9, 0x9a, 0xae, 0xd4, 0xb6, 0xd6, 0xa5, 0x78, 0x53, 0x51, 0x68, 0x63, + 0x69, 0xb3, 0xa0, 0x4a, 0x63, 0x6a, 0x9b, 0x66, 0x69, 0xd8, 0xa9, 0x40, 0xb5, 0x89, 0x76, 0xb1, + 0x9b, 0x2b, 0x1f, 0x68, 0x9a, 0x23, 0xda, 0x54, 0xbb, 0x7e, 0x04, 0x4b, 0xca, 0xed, 0xfe, 0xfc, + 0x40, 0x30, 0x04, 0x04, 0x9b, 0x6d, 0x17, 0x87, 0xe0, 0x68, 0x8f, 0x86, 0xe0, 0x60, 0x37, 0x57, + 0x3f, 0x25, 0xb4, 0xe3, 0x57, 0x62, 0x8a, 0x15, 0x1d, 0x2f, 0xe4, 0xe6, 0x30, 0x72, 0x28, 0x82, + 0xcb, 0xa4, 0x21, 0xc0, 0x0b, 0xe0, 0x05, 0xf0, 0x02, 0x78, 0x01, 0xbc, 0x00, 0x5e, 0x00, 0x2f, + 0x80, 0x17, 0xbd, 0xf0, 0xc2, 0x59, 0xf0, 0x66, 0xba, 0x14, 0xf4, 0x32, 0x6e, 0x09, 0xf8, 0x02, + 0x7c, 0x01, 0xbe, 0x08, 0xcf, 0x99, 0x90, 0x9b, 0xdc, 0x50, 0x34, 0xa2, 0x82, 0xda, 0xeb, 0xc5, + 0x51, 0x13, 0xdf, 0xbc, 0x91, 0xcf, 0x2d, 0x7a, 0xa6, 0xe7, 0x87, 0xcc, 0xf2, 0x3d, 0x5b, 0x69, + 0x2e, 0xe7, 0x1a, 0x62, 0x4a, 0x80, 0x98, 0x5d, 0x43, 0x0c, 0xf5, 0x10, 0xd0, 0xbf, 0xfe, 0x0c, + 0xae, 0x49, 0x96, 0x6b, 0xba, 0x0a, 0xb3, 0x2c, 0x72, 0xc9, 0x83, 0x46, 0x40, 0x33, 0xa0, 0x19, + 0xd0, 0x0c, 0xc4, 0x18, 0x88, 0x31, 0xe0, 0x18, 0x88, 0x31, 0x80, 0x16, 0xcd, 0xd0, 0x62, 0x70, + 0xa7, 0xcb, 0x48, 0xc8, 0x65, 0xd4, 0x12, 0xf0, 0x05, 0xf8, 0x02, 0x7c, 0x11, 0x9e, 0x33, 0x03, + 0xdb, 0xe1, 0x8e, 0xf5, 0x3d, 0x24, 0x01, 0x18, 0x48, 0x31, 0x90, 0x62, 0x20, 0xc5, 0x40, 0x8a, + 0xd9, 0x53, 0xaa, 0x51, 0x30, 0xf4, 0x29, 0xd0, 0x38, 0x1e, 0x58, 0x06, 0x2c, 0x03, 0x96, 0x81, + 0x14, 0x03, 0x29, 0x06, 0x1c, 0x03, 0x29, 0x06, 0xd0, 0xa2, 0x1b, 0x5a, 0xa8, 0xa4, 0x98, 0x49, + 0x4b, 0xc0, 0x17, 0xe0, 0x0b, 0xf0, 0x05, 0x52, 0x0c, 0xa4, 0x18, 0x20, 0x0c, 0xa4, 0x18, 0x50, + 0x8d, 0x2a, 0xd5, 0x68, 0x7d, 0x85, 0xbb, 0xe6, 0x79, 0x3e, 0x37, 0x07, 0x43, 0x22, 0xf7, 0x26, + 0x77, 0x68, 0xbd, 0xb2, 0xae, 0xd9, 0x33, 0xf9, 0xeb, 0xc0, 0x61, 0x1e, 0xfa, 0x3d, 0xe6, 0x59, + 0x43, 0x12, 0x31, 0x7a, 0xae, 0xc9, 0x3b, 0x7e, 0xd0, 0x3d, 0xb4, 0xfc, 0x6e, 0xcf, 0xf7, 0x98, + 0xc7, 0xc3, 0xe9, 0x8f, 0x87, 0x33, 0x6f, 0xb5, 0x1f, 0x86, 0xdc, 0xe4, 0xec, 0x50, 0xbe, 0xf2, + 0xc1, 0xe8, 0x46, 0x78, 0xd0, 0xb7, 0xb8, 0x37, 0x29, 0xa1, 0x13, 0xdd, 0x47, 0x63, 0x7c, 0x1b, + 0xed, 0xcb, 0xe8, 0x36, 0xa6, 0x3f, 0xb6, 0x5b, 0xd3, 0xdb, 0x68, 0x37, 0x07, 0xb7, 0xd1, 0xbe, + 0x1e, 0xdc, 0x46, 0x63, 0x78, 0x17, 0x29, 0xa8, 0x29, 0xe1, 0x9a, 0x21, 0x0b, 0x8c, 0x67, 0xc7, + 0x0c, 0x0d, 0xab, 0x1f, 0x04, 0x4c, 0xe2, 0xf5, 0xb3, 0x28, 0xc0, 0xae, 0x68, 0x0b, 0x15, 0x26, + 0xf4, 0x83, 0x28, 0x2a, 0x4c, 0x28, 0xb8, 0x27, 0x54, 0x98, 0x40, 0x36, 0x87, 0x6c, 0x2e, 0x83, + 0xd9, 0x1c, 0xc4, 0xe8, 0xcc, 0x65, 0x72, 0x10, 0xa3, 0x77, 0x9e, 0xc9, 0x41, 0x8c, 0xce, 0x4f, + 0xda, 0x86, 0x0a, 0x13, 0x80, 0x17, 0xc0, 0x0b, 0xe0, 0x05, 0xf0, 0x02, 0x78, 0x01, 0xbc, 0x00, + 0x5e, 0xf2, 0x0f, 0x2f, 0xa8, 0x30, 0x01, 0x7c, 0x01, 0xbe, 0xa0, 0xc2, 0xc4, 0x6c, 0x13, 0x58, + 0x4b, 0xd7, 0xef, 0xb1, 0x00, 0x31, 0xe9, 0x1d, 0x02, 0xac, 0xa5, 0x67, 0x9d, 0x6b, 0x50, 0x61, + 0x02, 0x34, 0x03, 0x9a, 0x81, 0x18, 0x03, 0x31, 0x06, 0x62, 0x0c, 0xc4, 0x18, 0x40, 0x4b, 0x56, + 0xa0, 0x05, 0x15, 0x26, 0x80, 0x2f, 0xc0, 0x17, 0xbc, 0xd6, 0x00, 0x29, 0x06, 0x52, 0x0c, 0xa4, + 0x18, 0x48, 0x31, 0x79, 0xa0, 0x1a, 0x54, 0x98, 0x00, 0xcb, 0x80, 0x65, 0x20, 0xc5, 0x40, 0x8a, + 0x81, 0x14, 0x03, 0x29, 0x06, 0xd0, 0x92, 0x11, 0x68, 0x41, 0x85, 0x09, 0xe0, 0x0b, 0xf0, 0x05, + 0x52, 0x0c, 0xa4, 0x18, 0x48, 0x31, 0x90, 0x62, 0x20, 0xc5, 0xa4, 0x8d, 0x6a, 0xf6, 0xa4, 0xc2, + 0x84, 0x72, 0x01, 0x84, 0x02, 0x65, 0xa1, 0x89, 0x9b, 0xc1, 0xdd, 0x5c, 0x38, 0x66, 0x78, 0x39, + 0xbe, 0x97, 0x14, 0x94, 0x9b, 0xf0, 0xb9, 0x67, 0x0c, 0x7a, 0xd0, 0x75, 0x4c, 0xcf, 0x62, 0x86, + 0xe5, 0xdb, 0x4c, 0xbe, 0xde, 0xc4, 0xaa, 0xc6, 0xe4, 0x0a, 0x4e, 0x94, 0x50, 0x70, 0x62, 0x17, + 0x3c, 0xba, 0x8f, 0x05, 0x27, 0xa4, 0x69, 0x73, 0xfa, 0xf6, 0x82, 0xcd, 0x3c, 0xee, 0xf0, 0xf7, + 0x80, 0x75, 0x64, 0x06, 0x7f, 0x22, 0x8f, 0x49, 0xc4, 0xc3, 0xe2, 0xf5, 0xf8, 0xab, 0x2f, 0xcc, + 0x90, 0x20, 0xdd, 0xbc, 0x6f, 0xdd, 0xb5, 0x6b, 0x8d, 0xc6, 0xcd, 0xf5, 0x65, 0xad, 0x75, 0x7d, + 0x7f, 0xd7, 0xbe, 0xbc, 0xbf, 0xaa, 0xcb, 0xce, 0xa4, 0x61, 0xe0, 0x0f, 0x95, 0x08, 0x55, 0x31, + 0x49, 0x9b, 0x3c, 0x55, 0xa3, 0x7c, 0x53, 0x6e, 0x57, 0xae, 0x2a, 0x0a, 0xe9, 0xcf, 0x87, 0x5d, + 0x3f, 0xc3, 0x60, 0x64, 0xbe, 0xdd, 0x5d, 0xd5, 0x3f, 0x5f, 0xdf, 0xd5, 0xaf, 0xb2, 0xfc, 0x20, + 0xe3, 0xc1, 0x28, 0x67, 0xfb, 0x19, 0x9a, 0xaa, 0x13, 0xea, 0x20, 0x19, 0x3a, 0xfc, 0x99, 0x06, + 0xc2, 0xe8, 0xf3, 0x69, 0x99, 0x2f, 0x79, 0xb4, 0x98, 0x6d, 0x05, 0x45, 0xac, 0xc0, 0x14, 0x28, + 0x62, 0xb5, 0x76, 0xee, 0xa0, 0x88, 0x15, 0x04, 0x63, 0x65, 0xe3, 0xc2, 0x7a, 0xb7, 0xaa, 0x84, + 0x86, 0xf5, 0xee, 0x65, 0xa5, 0x12, 0xeb, 0xdd, 0x4a, 0xc2, 0x22, 0xd6, 0xbb, 0x77, 0x3e, 0x04, + 0x58, 0xef, 0x5e, 0xea, 0x66, 0x14, 0xb1, 0x02, 0xbc, 0x00, 0x5e, 0x00, 0x2f, 0x80, 0x17, 0xc0, + 0x0b, 0xe0, 0x05, 0xf0, 0x92, 0x31, 0x78, 0x41, 0x11, 0x2b, 0xe0, 0x0b, 0xf0, 0x05, 0x45, 0xac, + 0x66, 0x9b, 0xc0, 0x76, 0x3d, 0xfd, 0x1e, 0x0b, 0x10, 0x93, 0xde, 0x21, 0xc0, 0x76, 0xbd, 0xac, + 0x73, 0x0d, 0x8a, 0x58, 0x81, 0x66, 0x40, 0x33, 0x10, 0x63, 0x20, 0xc6, 0x40, 0x8c, 0x81, 0x18, + 0x03, 0x68, 0xc9, 0x0a, 0xb4, 0xa0, 0x88, 0x15, 0xf0, 0x05, 0xf8, 0x82, 0x37, 0x27, 0x21, 0xc5, + 0x40, 0x8a, 0x81, 0x14, 0x03, 0x29, 0x26, 0x0f, 0x54, 0x83, 0x22, 0x56, 0x60, 0x19, 0xb0, 0x0c, + 0xa4, 0x18, 0x48, 0x31, 0x90, 0x62, 0x20, 0xc5, 0x00, 0x5a, 0x32, 0x02, 0x2d, 0x28, 0x62, 0x05, + 0x7c, 0x01, 0xbe, 0x40, 0x8a, 0x81, 0x14, 0x03, 0x29, 0x06, 0x52, 0x0c, 0xa4, 0x98, 0xb4, 0x51, + 0xcd, 0x9e, 0x14, 0xb1, 0x52, 0x28, 0x7d, 0x50, 0xa0, 0x2c, 0x5f, 0x75, 0x3f, 0xbc, 0x8f, 0xc6, + 0xf0, 0x36, 0x52, 0x50, 0x57, 0xa2, 0xe7, 0x87, 0xdc, 0xe8, 0x30, 0xcb, 0x78, 0x56, 0xa9, 0x2b, + 0x31, 0xd7, 0x0a, 0xea, 0x4a, 0xe8, 0xc7, 0x4f, 0xd4, 0x95, 0x50, 0x70, 0x4a, 0xa8, 0x2b, 0x91, + 0x8e, 0x1c, 0xce, 0xef, 0x71, 0xe4, 0x71, 0xd2, 0x06, 0x36, 0xed, 0x3d, 0x48, 0xd1, 0x0a, 0xc6, + 0x44, 0x2b, 0x45, 0x97, 0xcf, 0x90, 0xc8, 0xad, 0xee, 0x67, 0x68, 0xd1, 0x3b, 0x4f, 0xe4, 0xa0, + 0x45, 0xe7, 0x27, 0x6b, 0x43, 0x81, 0x09, 0x50, 0x0c, 0x28, 0x06, 0x14, 0x03, 0x8a, 0x01, 0xc5, + 0x80, 0x62, 0x40, 0x31, 0x7b, 0x44, 0x31, 0xa8, 0x34, 0xa1, 0x85, 0x63, 0xc0, 0x30, 0xb2, 0x0c, + 0x83, 0x4a, 0x13, 0xa8, 0x34, 0x91, 0x25, 0x88, 0xc1, 0x9a, 0xfa, 0xce, 0x21, 0x06, 0x6b, 0xea, + 0xe0, 0x9a, 0xf9, 0x6e, 0x46, 0xa5, 0x09, 0xa8, 0x32, 0x50, 0x65, 0xa0, 0xca, 0x40, 0x95, 0x81, + 0x2a, 0x03, 0x55, 0x06, 0xaa, 0x4c, 0xe6, 0xe8, 0x05, 0x25, 0x27, 0xa0, 0xca, 0x40, 0x95, 0xc1, + 0x7b, 0x0e, 0xd0, 0x64, 0xa0, 0xc9, 0x40, 0x93, 0x81, 0x26, 0x93, 0x07, 0xaa, 0x41, 0xc9, 0x09, + 0x68, 0x32, 0xd0, 0x64, 0xa0, 0xc9, 0x40, 0x93, 0x81, 0x26, 0x03, 0x4d, 0x06, 0x9a, 0x4c, 0xd6, + 0xe8, 0x05, 0xb5, 0x27, 0xa0, 0xc9, 0x40, 0x93, 0x81, 0x26, 0x03, 0x4d, 0x06, 0x9a, 0x0c, 0x34, + 0x19, 0x68, 0x32, 0x69, 0xa3, 0x9a, 0x3d, 0xa9, 0x3d, 0xa1, 0x50, 0x1e, 0xa1, 0x40, 0x59, 0x7b, + 0xa2, 0xe1, 0x87, 0xfc, 0x33, 0xb3, 0x2e, 0x52, 0x52, 0x7a, 0x22, 0x60, 0x04, 0x95, 0x27, 0x66, + 0x1a, 0x41, 0xe1, 0x09, 0xfd, 0xec, 0x89, 0xc2, 0x13, 0x0a, 0x1e, 0x09, 0x85, 0x27, 0x20, 0x44, + 0x67, 0x3f, 0x89, 0x83, 0x10, 0x0d, 0x21, 0x3a, 0x43, 0x59, 0x1c, 0x84, 0xe8, 0x9d, 0x67, 0x71, + 0x10, 0xa2, 0xf3, 0x93, 0xb2, 0xa1, 0xf0, 0x04, 0x28, 0x06, 0x14, 0x03, 0x8a, 0x01, 0xc5, 0x80, + 0x62, 0x40, 0x31, 0xa0, 0x98, 0x3d, 0xa2, 0x18, 0x14, 0x9e, 0xd0, 0xc2, 0x31, 0x60, 0x18, 0x59, + 0x86, 0x41, 0xe1, 0x09, 0x14, 0x9e, 0xc8, 0x12, 0xc4, 0x60, 0x41, 0x7d, 0xe7, 0x10, 0x83, 0x05, + 0x75, 0x70, 0xcd, 0x7c, 0x37, 0xa3, 0xf0, 0x04, 0x54, 0x19, 0xa8, 0x32, 0x50, 0x65, 0xa0, 0xca, + 0x40, 0x95, 0x81, 0x2a, 0x03, 0x55, 0x26, 0x73, 0xf4, 0x82, 0xc2, 0x13, 0x50, 0x65, 0xa0, 0xca, + 0xe0, 0x25, 0x07, 0x68, 0x32, 0xd0, 0x64, 0xa0, 0xc9, 0x40, 0x93, 0xc9, 0x03, 0xd5, 0xa0, 0xf0, + 0x04, 0x34, 0x19, 0x68, 0x32, 0xd0, 0x64, 0xa0, 0xc9, 0x40, 0x93, 0x81, 0x26, 0x03, 0x4d, 0x26, + 0x6b, 0xf4, 0x82, 0xc2, 0x13, 0xd0, 0x64, 0xa0, 0xc9, 0x40, 0x93, 0x81, 0x26, 0x03, 0x4d, 0x06, + 0x9a, 0x0c, 0x34, 0x99, 0xb4, 0x51, 0xcd, 0xbe, 0x14, 0x9e, 0x90, 0xae, 0x8e, 0x50, 0x20, 0xad, + 0x3b, 0x11, 0xb0, 0x54, 0x95, 0x9d, 0x08, 0x99, 0xc4, 0xdb, 0x68, 0xb3, 0x25, 0x27, 0x86, 0x0d, + 0xc8, 0x95, 0x9b, 0x28, 0xa1, 0xdc, 0xc4, 0x2e, 0x48, 0x73, 0x1f, 0xcb, 0x4d, 0x48, 0x73, 0x64, + 0x34, 0xfe, 0xcc, 0xeb, 0x77, 0x59, 0x30, 0x72, 0x65, 0x12, 0x83, 0x3f, 0x51, 0xbe, 0xaa, 0x12, + 0xd7, 0xd6, 0xbd, 0x7e, 0x77, 0x70, 0xf3, 0x3f, 0x53, 0xe0, 0x32, 0x42, 0x16, 0x38, 0xa6, 0x6b, + 0x78, 0xbe, 0xbc, 0xd3, 0x98, 0x36, 0x01, 0xb7, 0x01, 0xb7, 0x91, 0x73, 0xb7, 0x11, 0xf2, 0xc0, + 0xf1, 0x5e, 0x54, 0x3c, 0x86, 0x44, 0xaa, 0x59, 0xbc, 0x61, 0xde, 0xcb, 0x10, 0x99, 0xe4, 0x72, + 0x42, 0x85, 0x74, 0x9b, 0x22, 0x07, 0x24, 0x4a, 0x3c, 0xa6, 0x09, 0x87, 0x62, 0x3b, 0x84, 0x59, + 0x85, 0x42, 0x8e, 0x47, 0x92, 0xdb, 0x91, 0x77, 0xed, 0x49, 0x8a, 0xfa, 0x36, 0xa1, 0x8c, 0xe9, + 0x29, 0x0d, 0x61, 0xd8, 0xf7, 0x18, 0x37, 0x42, 0xfb, 0xd5, 0x18, 0xe4, 0x3c, 0xae, 0x63, 0x7a, + 0x16, 0x33, 0x2c, 0xdf, 0x66, 0x0a, 0x61, 0x79, 0x6d, 0x93, 0x08, 0xd3, 0x08, 0xd3, 0x39, 0x0f, + 0xd3, 0x8e, 0xcd, 0x3c, 0xee, 0xf0, 0xf7, 0x80, 0x75, 0x54, 0x62, 0xb5, 0x84, 0x8e, 0x55, 0xbc, + 0x1e, 0x7f, 0xf5, 0x85, 0x19, 0x12, 0x2c, 0x13, 0x35, 0xef, 0xef, 0xea, 0xad, 0x76, 0xad, 0xd1, + 0xb8, 0xb9, 0xbe, 0xac, 0xb5, 0xae, 0xef, 0xef, 0xda, 0x97, 0xf7, 0x57, 0x75, 0xd9, 0xb9, 0x34, + 0x74, 0xf3, 0xa1, 0x92, 0xb6, 0xac, 0x18, 0xaf, 0xe6, 0x9f, 0xeb, 0xdb, 0xdd, 0x55, 0xfd, 0xf3, + 0xf5, 0x5d, 0xfd, 0xaa, 0xb8, 0x8b, 0x08, 0x4c, 0xf4, 0x28, 0xff, 0x6c, 0x3e, 0x54, 0x4a, 0xa5, + 0x52, 0xfb, 0xe8, 0xe1, 0x28, 0x1f, 0x8f, 0x71, 0x9c, 0x8f, 0xc7, 0xa8, 0x24, 0xbd, 0x28, 0xf6, + 0xa4, 0xdb, 0x8d, 0x6a, 0x41, 0x8f, 0x37, 0xe6, 0xd9, 0xbe, 0x42, 0x99, 0xda, 0xf1, 0xf5, 0x80, + 0x0a, 0x40, 0x05, 0x72, 0x7f, 0xe4, 0xfe, 0xc8, 0xfd, 0x91, 0xfb, 0x23, 0xf7, 0x17, 0x0f, 0xc0, + 0x46, 0xcf, 0x0c, 0xb8, 0x6a, 0x14, 0x1e, 0x35, 0x82, 0x50, 0x8c, 0x50, 0x8c, 0x50, 0x8c, 0x50, + 0x8c, 0x50, 0x8c, 0x50, 0x8c, 0x50, 0x2c, 0x11, 0x8a, 0x03, 0xf6, 0xa6, 0x1c, 0x89, 0x07, 0x6d, + 0x20, 0x10, 0x23, 0x10, 0x23, 0x10, 0x23, 0x10, 0x23, 0x10, 0x67, 0x35, 0x10, 0x57, 0x10, 0x87, + 0xc9, 0xe2, 0xf0, 0x01, 0xe1, 0x04, 0x92, 0xdd, 0x88, 0x4c, 0xb7, 0x01, 0xb9, 0x28, 0xb2, 0xba, + 0x4f, 0xb3, 0xd9, 0x38, 0x5e, 0xf4, 0xd8, 0xde, 0xcf, 0x9b, 0x3f, 0xb1, 0x65, 0x04, 0x44, 0x7b, + 0x9e, 0xa2, 0xc7, 0x63, 0xf4, 0xb5, 0x7a, 0x1f, 0x6f, 0xee, 0xdd, 0xf5, 0x7d, 0xb6, 0xfa, 0x5f, + 0xd6, 0xf4, 0xe2, 0x80, 0x56, 0x46, 0xaf, 0x0a, 0xad, 0x7d, 0xf3, 0xaf, 0x78, 0xe3, 0x84, 0xbc, + 0xc6, 0xf9, 0xe6, 0x25, 0x99, 0x41, 0x20, 0xaa, 0xbb, 0x6c, 0x80, 0x19, 0x03, 0xb7, 0xe2, 0xf5, + 0x5d, 0xf7, 0xc3, 0xc1, 0x26, 0xd7, 0x1a, 0xff, 0xc3, 0xf7, 0x81, 0xcd, 0x02, 0x66, 0x5f, 0xbc, + 0x8f, 0x3f, 0x2a, 0xf4, 0x7c, 0xb5, 0xfe, 0xcb, 0xe0, 0x6b, 0x98, 0xbd, 0x31, 0x38, 0x6f, 0x9e, + 0x36, 0x11, 0x5c, 0x1c, 0xfa, 0x56, 0x34, 0x49, 0x3e, 0xcd, 0x4c, 0x92, 0x95, 0xbf, 0xde, 0x32, + 0x49, 0x8a, 0x57, 0x2c, 0xb4, 0x02, 0xa7, 0x37, 0x9e, 0xb8, 0xc5, 0x9a, 0x6d, 0x3b, 0xde, 0x4b, + 0xc1, 0xef, 0x71, 0xc7, 0x32, 0xdd, 0x82, 0xf5, 0x6a, 0x7a, 0x1e, 0x73, 0x0b, 0xb6, 0xc9, 0xcd, + 0x02, 0xf7, 0x0b, 0xbd, 0xd7, 0xf7, 0x70, 0xf8, 0x0f, 0x8e, 0xf7, 0xc6, 0x3c, 0xee, 0x07, 0xef, + 0xdb, 0xda, 0x8f, 0x77, 0xe6, 0x62, 0x6c, 0x5a, 0x17, 0xa1, 0xf3, 0xa5, 0x82, 0x10, 0x2c, 0xe8, + 0xc6, 0xb1, 0x19, 0x41, 0xf4, 0x96, 0x46, 0x6d, 0x69, 0xb4, 0x5e, 0x59, 0xaf, 0x61, 0xf0, 0x70, + 0x9a, 0x7d, 0x5c, 0xdc, 0xd3, 0x0c, 0x8b, 0xe3, 0xe9, 0x63, 0x8c, 0xa7, 0x4f, 0xfc, 0xae, 0x8c, + 0x46, 0x6c, 0xa1, 0x81, 0x98, 0xfd, 0xb2, 0x30, 0x99, 0xeb, 0x9e, 0xe5, 0xfa, 0xe1, 0x60, 0x3e, + 0x5b, 0xbe, 0xc7, 0x4d, 0xc7, 0x63, 0x41, 0xa1, 0xe3, 0x07, 0x05, 0xfe, 0xca, 0x0a, 0xae, 0x13, + 0xf2, 0x82, 0xdf, 0x59, 0x9c, 0xe9, 0x71, 0x5f, 0x51, 0x14, 0x3c, 0x4b, 0x54, 0x38, 0x1b, 0x95, + 0xc9, 0x42, 0x25, 0xe7, 0xbb, 0x6a, 0xca, 0xa9, 0x9c, 0x6a, 0x2a, 0xa7, 0x98, 0xf2, 0xf6, 0x20, + 0x48, 0x61, 0xaa, 0xf6, 0x75, 0x20, 0x61, 0x79, 0xe9, 0x09, 0x0a, 0x33, 0xe8, 0x91, 0xfd, 0x80, + 0x20, 0xc8, 0x51, 0x99, 0x8b, 0x09, 0x42, 0xf2, 0x4a, 0x42, 0x61, 0x61, 0xf6, 0x9e, 0x84, 0x43, + 0x82, 0xb8, 0x9e, 0xb6, 0x38, 0x8d, 0x5b, 0x7e, 0xcf, 0x70, 0xd9, 0x1b, 0x73, 0x17, 0xc2, 0x81, + 0xe5, 0x3a, 0xcc, 0xe3, 0x85, 0x9e, 0x1f, 0xf0, 0xa5, 0x39, 0x9e, 0x93, 0x70, 0x20, 0x27, 0x46, + 0xe6, 0x27, 0x22, 0x48, 0x89, 0x8d, 0x3b, 0x0f, 0x0a, 0x2b, 0xff, 0xe5, 0x69, 0x5d, 0x8a, 0x11, + 0x2f, 0x01, 0x95, 0x4d, 0x3c, 0x37, 0x8c, 0xa0, 0x5c, 0x92, 0xb9, 0x7a, 0x1c, 0x96, 0x9f, 0x79, + 0xfe, 0x37, 0x0b, 0xbe, 0x68, 0xdb, 0x53, 0x8b, 0x3d, 0xed, 0x8a, 0x67, 0x14, 0x79, 0xb6, 0xf9, + 0x27, 0x9a, 0xde, 0xf7, 0xcc, 0x3d, 0x8f, 0x4e, 0x82, 0xea, 0x98, 0xd6, 0x70, 0xbb, 0xf1, 0xfc, + 0xfd, 0xce, 0x9f, 0x16, 0x35, 0xfa, 0xcc, 0xc2, 0xd3, 0xae, 0xf6, 0x32, 0x6b, 0xbd, 0xc9, 0x26, + 0xaf, 0x31, 0xeb, 0x1d, 0x9c, 0x55, 0xbb, 0xc1, 0xb7, 0x19, 0x7f, 0x6c, 0x23, 0x8f, 0x6d, 0xcc, + 0x8b, 0x46, 0xeb, 0x74, 0x8a, 0x82, 0xb3, 0x61, 0x5d, 0x24, 0x9a, 0x76, 0xe9, 0xfa, 0xc7, 0x59, + 0xea, 0xfd, 0x75, 0x8f, 0xb3, 0xd9, 0xd5, 0x6f, 0x75, 0xed, 0x71, 0x5c, 0xf9, 0xd6, 0xc1, 0x11, + 0xf5, 0xd0, 0xc2, 0x1e, 0x59, 0xd8, 0x03, 0xc7, 0x19, 0x3c, 0x39, 0x6d, 0x68, 0x1b, 0x5e, 0x14, + 0xad, 0x49, 0x8f, 0xc7, 0x44, 0xe5, 0xf1, 0xe7, 0xb3, 0xc1, 0xa9, 0x4e, 0x27, 0x97, 0x78, 0xba, + 0x69, 0x7a, 0x24, 0x4c, 0xa5, 0xf6, 0x1c, 0x25, 0x0a, 0x52, 0xe9, 0xec, 0xc5, 0x62, 0xa8, 0x58, + 0x4a, 0x29, 0x2a, 0x3a, 0x9d, 0xbd, 0x24, 0xc4, 0x38, 0x13, 0x52, 0xcf, 0x9a, 0x8d, 0xf0, 0x6a, + 0xb3, 0xfc, 0x2a, 0xf3, 0x74, 0x75, 0x99, 0x0a, 0x6d, 0x63, 0xf8, 0x26, 0xe6, 0x99, 0xcf, 0xee, + 0x50, 0xf9, 0x16, 0xb4, 0xad, 0xc9, 0x85, 0xb1, 0xb3, 0xbd, 0x8e, 0xd9, 0x77, 0xf9, 0x28, 0x57, + 0xec, 0x33, 0x98, 0x23, 0xcc, 0x31, 0x59, 0x73, 0x7c, 0xf6, 0x7d, 0x97, 0x99, 0x9e, 0x8c, 0x3d, + 0x96, 0x13, 0xb4, 0x47, 0xd7, 0xf7, 0x7b, 0xcf, 0xa6, 0xf5, 0xdd, 0xe8, 0x8a, 0xbc, 0x48, 0x1d, + 0x3d, 0xe5, 0xfc, 0xe5, 0xe2, 0xb6, 0xd9, 0x31, 0xdd, 0x10, 0xc6, 0x09, 0xe3, 0x84, 0x71, 0xae, + 0xfa, 0xce, 0x2e, 0xef, 0x8b, 0x9b, 0xe4, 0xe0, 0x22, 0x18, 0x14, 0x0c, 0x2a, 0x51, 0x83, 0xea, + 0x3b, 0x1e, 0x2f, 0x9f, 0x48, 0xd8, 0x93, 0xc0, 0x26, 0x6e, 0xc9, 0xa2, 0xaf, 0x12, 0x1b, 0x37, + 0x55, 0x36, 0x30, 0xaa, 0x16, 0x9d, 0x56, 0x2c, 0xda, 0x4a, 0xb1, 0x9b, 0x4e, 0xa6, 0xe8, 0xb7, + 0xca, 0xc6, 0x44, 0xaa, 0x2e, 0x3b, 0x39, 0x3e, 0x3e, 0x3a, 0xde, 0x61, 0xb7, 0x69, 0xda, 0x14, + 0xf8, 0x94, 0x60, 0xc4, 0x19, 0x4b, 0xdb, 0x82, 0x21, 0x67, 0xc3, 0x4e, 0x2d, 0xc4, 0x1c, 0xc4, + 0x9c, 0xbd, 0x16, 0x3c, 0xb8, 0xc8, 0xf3, 0x4d, 0xd7, 0xb7, 0x07, 0x57, 0xc1, 0xa2, 0x60, 0x51, + 0x89, 0x5a, 0x94, 0x5c, 0x45, 0x28, 0x99, 0x4a, 0x50, 0x6a, 0x15, 0xa0, 0x96, 0x97, 0xe7, 0x86, + 0x27, 0x3c, 0xa4, 0x6e, 0x31, 0x7f, 0xcb, 0xa2, 0x44, 0xfd, 0x07, 0x8f, 0x57, 0x67, 0x4a, 0x7c, + 0x1d, 0xc7, 0xb7, 0x0c, 0xf6, 0x83, 0x7f, 0xe2, 0xcc, 0x65, 0x5d, 0xc6, 0x83, 0x77, 0xc3, 0xf7, + 0x86, 0xdb, 0x27, 0x5f, 0x98, 0xdc, 0xda, 0xce, 0x50, 0xa7, 0x91, 0x58, 0xdc, 0x51, 0x5d, 0xd7, + 0x79, 0x4a, 0x6c, 0xa3, 0xfd, 0x74, 0x9d, 0xfd, 0x70, 0xd5, 0x8f, 0x87, 0xb1, 0xd6, 0x09, 0x0b, + 0x9b, 0x36, 0x09, 0x5c, 0x47, 0xcd, 0xb6, 0x57, 0xfd, 0xd8, 0x1e, 0x3b, 0x66, 0xfa, 0x4d, 0x83, + 0x45, 0xc6, 0x5f, 0x59, 0xe0, 0x31, 0x1e, 0x7f, 0x55, 0x34, 0xba, 0x22, 0x1b, 0xeb, 0xa2, 0x8c, + 0xbf, 0xe6, 0x72, 0x61, 0x74, 0xf0, 0x5c, 0x69, 0x59, 0x19, 0x8d, 0xb9, 0xb0, 0xbe, 0x34, 0x3c, + 0xb1, 0x0d, 0xa7, 0x90, 0x81, 0xad, 0x73, 0xf1, 0x26, 0x5a, 0xfe, 0x68, 0x26, 0xd6, 0x44, 0xd4, + 0x83, 0x33, 0x71, 0x27, 0x68, 0x74, 0x81, 0xd9, 0xe7, 0xbe, 0xe1, 0xb1, 0x17, 0x9f, 0x3b, 0x26, + 0x57, 0x80, 0x8b, 0x85, 0x76, 0x04, 0x3b, 0x50, 0x6e, 0x01, 0x52, 0x51, 0x12, 0xd9, 0xf9, 0x7b, + 0xee, 0x62, 0xf6, 0xa1, 0x6a, 0x27, 0x64, 0xf6, 0x42, 0x66, 0x37, 0x24, 0xf6, 0x23, 0x29, 0x28, + 0x25, 0xfe, 0x5e, 0xbb, 0xf8, 0x2a, 0xca, 0x92, 0x9b, 0x2f, 0xa7, 0xa0, 0xa0, 0x85, 0xdd, 0xef, + 0xb9, 0xec, 0x87, 0xd8, 0x02, 0xe8, 0x52, 0x5f, 0xcc, 0x36, 0x02, 0x53, 0x87, 0xa9, 0xe7, 0xcc, + 0xd4, 0x71, 0x12, 0x4c, 0x61, 0xba, 0x7b, 0xc9, 0xe8, 0xb8, 0xfe, 0x5f, 0x86, 0xe5, 0x7b, 0x3c, + 0xf0, 0x5d, 0x79, 0x97, 0xb1, 0xaa, 0x31, 0x79, 0xc8, 0x10, 0xd9, 0x49, 0x01, 0xd7, 0x03, 0xd7, + 0x03, 0xca, 0x48, 0xd6, 0x75, 0x74, 0x4d, 0xcb, 0x30, 0x6d, 0x3b, 0x60, 0x61, 0x28, 0xef, 0x32, + 0x66, 0x1b, 0x81, 0xa9, 0xc3, 0xd4, 0x73, 0x66, 0xea, 0xf2, 0xd3, 0xbb, 0xa0, 0x5a, 0x2d, 0xab, + 0x61, 0x72, 0xce, 0x02, 0x4f, 0xba, 0x5c, 0x56, 0xf1, 0xbf, 0xff, 0x2c, 0x19, 0xe7, 0xa6, 0xd1, + 0xa9, 0x19, 0x9f, 0x9f, 0xfe, 0xae, 0xfc, 0xfc, 0xe5, 0xd3, 0xfc, 0xdf, 0x7f, 0xfd, 0xfb, 0xf8, + 0xe7, 0x7f, 0x14, 0x33, 0x59, 0xf0, 0xaf, 0xe7, 0x07, 0xdc, 0x08, 0x7b, 0x4c, 0x60, 0xd7, 0xf6, + 0xd2, 0xc8, 0xce, 0xb4, 0x01, 0xbf, 0x05, 0xbf, 0x95, 0x33, 0xbf, 0x95, 0x9b, 0x93, 0x74, 0xea, + 0xad, 0xaf, 0xf5, 0x87, 0xbb, 0x7a, 0xab, 0xdd, 0x6c, 0xd4, 0xeb, 0x57, 0x39, 0x38, 0x41, 0x67, + 0xf0, 0x18, 0xed, 0x72, 0xa9, 0xf4, 0xe5, 0x22, 0xcb, 0xe7, 0xb5, 0x8c, 0x1e, 0xe3, 0x38, 0x17, + 0x4f, 0x51, 0x2e, 0x95, 0x6e, 0xf3, 0xf0, 0x18, 0x79, 0x18, 0x8b, 0xca, 0x71, 0x3e, 0x66, 0x54, + 0x2e, 0x26, 0x54, 0x2e, 0xac, 0xfb, 0xdb, 0xdd, 0x6f, 0x77, 0xf7, 0xbf, 0xdf, 0xe5, 0xc0, 0xd9, + 0xe6, 0xc3, 0xbe, 0xf3, 0xe1, 0x6c, 0xab, 0x6a, 0xb6, 0x91, 0xf5, 0x83, 0xca, 0x52, 0x5e, 0x14, + 0x76, 0xdb, 0xce, 0xa9, 0xc9, 0x5e, 0xa2, 0x43, 0xa1, 0x9d, 0x20, 0x05, 0x95, 0xad, 0x54, 0xf5, + 0xf1, 0x57, 0xc6, 0xda, 0x53, 0x15, 0xbf, 0x9f, 0x7f, 0xc6, 0xda, 0xfd, 0x25, 0xb2, 0xe9, 0x60, + 0x66, 0x33, 0x73, 0xfc, 0x3d, 0x06, 0xd2, 0x9b, 0x64, 0x2a, 0xd8, 0x24, 0x43, 0x99, 0xe3, 0x62, + 0x93, 0x0c, 0x36, 0xc9, 0x40, 0x1b, 0x82, 0x36, 0xb4, 0x71, 0xbc, 0x73, 0xb2, 0x7c, 0x65, 0xf9, + 0xfd, 0x41, 0x74, 0x55, 0x58, 0xbb, 0x8a, 0x5a, 0x90, 0x33, 0xf2, 0x32, 0x8c, 0x1c, 0x46, 0xae, + 0xc7, 0xc8, 0x45, 0x83, 0x67, 0x74, 0xa1, 0xe3, 0x19, 0x67, 0xa5, 0x4a, 0xf9, 0x7f, 0x8c, 0x4e, + 0x60, 0x76, 0x59, 0xa8, 0xae, 0xbf, 0x2e, 0x36, 0xf8, 0x61, 0x27, 0xef, 0xd3, 0xca, 0x9a, 0x0e, + 0x85, 0x09, 0xd1, 0x99, 0x12, 0x95, 0x49, 0x91, 0x9b, 0x16, 0xb9, 0x89, 0x91, 0x9a, 0x9a, 0x5a, + 0xd6, 0x2c, 0xa9, 0x18, 0xc8, 0xc7, 0xd9, 0x75, 0x61, 0xe6, 0xa4, 0xaa, 0x32, 0x65, 0xc6, 0x06, + 0x74, 0xa6, 0xd0, 0x84, 0x5c, 0xb1, 0x02, 0x5a, 0x19, 0xa5, 0x40, 0x75, 0x1a, 0x13, 0x91, 0x67, + 0x59, 0x6a, 0x4e, 0xb1, 0xd8, 0xc1, 0x52, 0x7b, 0x84, 0x47, 0x09, 0x11, 0x68, 0x60, 0xd3, 0x21, + 0x20, 0x38, 0xb5, 0x49, 0xf7, 0x10, 0x94, 0xcf, 0xaa, 0xd5, 0x93, 0xd3, 0x6a, 0xb5, 0x74, 0x7a, + 0x74, 0x5a, 0x3a, 0x3f, 0x3e, 0x2e, 0x9f, 0x94, 0x8f, 0x53, 0x3c, 0x2a, 0x07, 0xbb, 0xb9, 0xfa, + 0x29, 0xa1, 0x03, 0xa6, 0x64, 0x4a, 0x70, 0x38, 0x9e, 0xf1, 0xec, 0xfa, 0xd6, 0x77, 0x83, 0x05, + 0x81, 0x1f, 0xd0, 0xd0, 0xc8, 0x5c, 0x83, 0xa0, 0x11, 0xd0, 0x08, 0x68, 0x04, 0x34, 0x02, 0x1a, + 0x01, 0x8d, 0x80, 0x46, 0x40, 0x23, 0xdb, 0x68, 0xc4, 0x0a, 0x2c, 0x4a, 0x16, 0x99, 0x69, 0x0e, + 0x24, 0x02, 0x12, 0x01, 0x89, 0x80, 0x44, 0x40, 0x22, 0x20, 0x11, 0x90, 0x08, 0x48, 0x64, 0x1b, + 0x89, 0x74, 0x02, 0x73, 0x78, 0xe4, 0x2e, 0xe5, 0x42, 0xcd, 0x62, 0x9b, 0x60, 0x12, 0x30, 0x09, + 0x98, 0x04, 0x4c, 0x02, 0x26, 0x01, 0x93, 0x80, 0x49, 0xc0, 0x24, 0xdb, 0x98, 0xe4, 0xff, 0x9a, + 0xcf, 0xcf, 0x2c, 0xa0, 0x24, 0x92, 0xf9, 0x16, 0xc1, 0x23, 0xe0, 0x11, 0xf0, 0x08, 0x78, 0x04, + 0x3c, 0x02, 0x1e, 0x01, 0x8f, 0x80, 0x47, 0xb6, 0xf1, 0x48, 0xd7, 0xb4, 0x26, 0x65, 0xc8, 0x28, + 0xa1, 0x64, 0x45, 0xb3, 0x20, 0x13, 0x90, 0x09, 0xc8, 0x04, 0x64, 0x02, 0x32, 0x01, 0x99, 0x80, + 0x4c, 0x40, 0x26, 0x71, 0xc8, 0xa4, 0x67, 0xf6, 0x43, 0x46, 0xcd, 0x25, 0x73, 0x8d, 0x82, 0x4a, + 0x40, 0x25, 0xa0, 0x12, 0x50, 0x09, 0xa8, 0x04, 0x54, 0x02, 0x2a, 0x01, 0x95, 0x6c, 0xa3, 0x12, + 0xff, 0x8d, 0x05, 0xa1, 0xf3, 0x6f, 0x52, 0x28, 0x59, 0x6c, 0x13, 0x4c, 0x02, 0x26, 0x01, 0x93, + 0x80, 0x49, 0xc0, 0x24, 0x60, 0x12, 0x30, 0x09, 0x98, 0x64, 0x1b, 0x93, 0xf4, 0x3d, 0x9b, 0x1e, + 0x4a, 0x96, 0x1a, 0x05, 0x95, 0x80, 0x4a, 0x40, 0x25, 0xa0, 0x12, 0x50, 0x09, 0xa8, 0x04, 0x54, + 0x02, 0x2a, 0xd9, 0xd8, 0xcd, 0x7e, 0x9f, 0x13, 0x17, 0x49, 0x5b, 0x6a, 0x11, 0x3c, 0x02, 0x1e, + 0x01, 0x8f, 0x80, 0x47, 0xc0, 0x23, 0xe0, 0x11, 0xf0, 0x08, 0x78, 0x64, 0x2b, 0x8f, 0xe8, 0xd8, + 0xea, 0xba, 0xa6, 0x5d, 0xb0, 0x09, 0xd8, 0x04, 0x6c, 0x02, 0x36, 0x01, 0x9b, 0x80, 0x4d, 0xc0, + 0x26, 0x60, 0x93, 0x58, 0x6c, 0x42, 0xbb, 0xd9, 0x75, 0x65, 0xab, 0xe0, 0x12, 0x70, 0x09, 0xb8, + 0x04, 0x5c, 0x02, 0x2e, 0x01, 0x97, 0x80, 0x4b, 0xf6, 0x89, 0x4b, 0xb4, 0x1e, 0xa5, 0x23, 0x79, + 0xba, 0x64, 0x74, 0x3d, 0xc1, 0x29, 0x93, 0xc3, 0x93, 0x14, 0x0f, 0x25, 0x4f, 0x9b, 0x2a, 0x90, + 0x9c, 0x3a, 0xd9, 0x1c, 0xdc, 0x42, 0xfb, 0x72, 0x72, 0x0b, 0x29, 0x38, 0xbe, 0xcb, 0xee, 0xf7, + 0x5c, 0xf6, 0xc3, 0xe8, 0xfa, 0xb6, 0xc2, 0x59, 0x7f, 0xb3, 0x8d, 0xe0, 0xa4, 0x3e, 0x7d, 0x5c, + 0x88, 0x43, 0xbc, 0x76, 0x72, 0x52, 0x1f, 0xf3, 0xfa, 0x5d, 0x16, 0x8c, 0x9c, 0x97, 0xc2, 0x69, + 0x7d, 0x55, 0x89, 0x6b, 0xeb, 0x5e, 0xbf, 0x3b, 0xb8, 0xf9, 0x9f, 0x29, 0x70, 0x15, 0xcc, 0x33, + 0x9f, 0x5d, 0x66, 0x74, 0x5c, 0xff, 0xaf, 0x89, 0x98, 0x2d, 0xef, 0x32, 0x56, 0x35, 0x26, 0x7f, + 0x46, 0x68, 0xc7, 0x74, 0x43, 0xb8, 0x1e, 0xb8, 0x1e, 0x1c, 0x12, 0xba, 0xec, 0x76, 0xd2, 0x70, + 0x48, 0xe8, 0xeb, 0x5f, 0x43, 0xa1, 0xc9, 0xb4, 0xed, 0x80, 0x85, 0x0a, 0x47, 0x85, 0x2e, 0xb4, + 0x03, 0x83, 0x87, 0xc1, 0xe7, 0xcc, 0xe0, 0xe5, 0xa7, 0xf7, 0x9c, 0xd1, 0x4b, 0xc8, 0x48, 0xc5, + 0x86, 0xc9, 0x39, 0x0b, 0x3c, 0x69, 0x01, 0xa9, 0xf8, 0xdf, 0x7f, 0x96, 0x8c, 0x73, 0xd3, 0xe8, + 0xd4, 0x8c, 0xcf, 0x4f, 0x7f, 0x57, 0x7e, 0xfe, 0xf2, 0x69, 0xfe, 0xef, 0xbf, 0xfe, 0x7d, 0xfc, + 0xf3, 0x3f, 0xc4, 0x47, 0xec, 0x29, 0x05, 0xfe, 0x8b, 0xc4, 0x79, 0xc1, 0x73, 0xc1, 0x73, 0xc1, + 0x73, 0xc1, 0x73, 0x25, 0xea, 0xb9, 0x3c, 0xf6, 0xe2, 0x73, 0xc7, 0xe4, 0xcc, 0x36, 0x48, 0xa4, + 0x9e, 0x35, 0xed, 0xc1, 0x9f, 0xc1, 0x9f, 0x41, 0xf5, 0xc9, 0xa3, 0xea, 0x33, 0x63, 0xf0, 0x3d, + 0x3f, 0xe0, 0x46, 0xd8, 0x63, 0xcc, 0x26, 0xf1, 0x1f, 0x33, 0xcd, 0xc1, 0x7d, 0xc0, 0x7d, 0xe4, + 0xcc, 0x7d, 0x38, 0x36, 0xf3, 0xb8, 0xc3, 0xdf, 0x03, 0xd6, 0x51, 0x71, 0x1f, 0x12, 0x0b, 0xa2, + 0xc5, 0xeb, 0xf1, 0x57, 0x5f, 0x98, 0x21, 0x53, 0xdf, 0x25, 0x54, 0x6f, 0x7d, 0xad, 0x3f, 0xdc, + 0xd5, 0x5b, 0xed, 0x66, 0xa3, 0x5e, 0xbf, 0x92, 0x9d, 0x3b, 0xc3, 0x35, 0xdf, 0x50, 0x69, 0x73, + 0x82, 0xe2, 0x5e, 0x9a, 0xc9, 0xf3, 0x0c, 0x1f, 0xa3, 0x5d, 0x2e, 0x95, 0xbe, 0x5c, 0x28, 0x6c, + 0x55, 0xf9, 0x90, 0x8e, 0xc7, 0x38, 0xce, 0xc5, 0x53, 0x94, 0x4b, 0xa5, 0xdb, 0x3c, 0x3c, 0x46, + 0x1e, 0xc6, 0xa2, 0x72, 0x9c, 0x8f, 0x19, 0x95, 0x8b, 0x09, 0x95, 0x0b, 0xeb, 0xfe, 0x76, 0xf7, + 0xdb, 0xdd, 0xfd, 0xef, 0x77, 0x39, 0x70, 0xb6, 0xf9, 0xb0, 0xef, 0x7c, 0x38, 0xdb, 0xaa, 0x9a, + 0x6d, 0x48, 0x5d, 0xf9, 0xa4, 0x9b, 0x52, 0xb5, 0x64, 0x70, 0x14, 0x69, 0x1b, 0x72, 0x35, 0xe4, + 0x6a, 0xc8, 0xd5, 0x90, 0xab, 0x21, 0x57, 0x43, 0xae, 0x86, 0x5c, 0x0d, 0xb9, 0x1a, 0x72, 0x35, + 0xe4, 0x6a, 0xc8, 0xd5, 0x90, 0xab, 0x21, 0x57, 0xa3, 0xfa, 0x64, 0xcc, 0xb1, 0x92, 0x7d, 0x91, + 0x86, 0xec, 0x05, 0x1a, 0x01, 0xa8, 0x24, 0x7a, 0x5f, 0x26, 0xde, 0xcc, 0xd9, 0xde, 0xcb, 0x9b, + 0x3f, 0xb1, 0xa5, 0xff, 0x45, 0xfb, 0x9d, 0xa0, 0xbf, 0x63, 0xf4, 0xb4, 0x72, 0x0f, 0x6f, 0xee, + 0xdb, 0xf5, 0x3d, 0xb6, 0xa1, 0xb7, 0x8a, 0xaf, 0xbe, 0x6b, 0x1b, 0xdc, 0xe9, 0x6e, 0xcf, 0x67, + 0xa6, 0xfb, 0x7a, 0xa3, 0x4b, 0xb6, 0x8c, 0xc2, 0x24, 0xd5, 0xda, 0xf2, 0xb1, 0xb8, 0xea, 0x81, + 0x88, 0x5a, 0x30, 0xab, 0x0e, 0x38, 0x71, 0xf2, 0x44, 0x51, 0x31, 0x40, 0x3a, 0xf9, 0x97, 0x4e, + 0xf6, 0x17, 0x93, 0x7b, 0xa7, 0x53, 0xd4, 0x6c, 0x45, 0x57, 0x4e, 0x10, 0xaf, 0xb3, 0xad, 0xc9, + 0x08, 0xc6, 0xec, 0xbb, 0xe9, 0xbb, 0xd8, 0xc3, 0xeb, 0x62, 0x3e, 0x7f, 0xbc, 0xe9, 0x24, 0x2d, + 0x4a, 0xc9, 0x88, 0x51, 0xc2, 0xd3, 0x4c, 0x55, 0x7b, 0x52, 0xd6, 0x9c, 0x94, 0xb5, 0x26, 0x99, + 0x69, 0xa8, 0x27, 0xb8, 0xc6, 0x9d, 0x9e, 0xd1, 0x05, 0xb6, 0xff, 0x97, 0xa7, 0xf0, 0xde, 0xe4, + 0xe0, 0x6a, 0xf9, 0xb7, 0x9e, 0x4a, 0x7b, 0xa2, 0xc5, 0x3a, 0x1d, 0x48, 0xb1, 0x8a, 0x66, 0x92, + 0x15, 0x25, 0xb6, 0xef, 0x78, 0xfc, 0xa8, 0xa2, 0x20, 0xc2, 0x9e, 0x4a, 0x5c, 0xaa, 0x56, 0x37, + 0x43, 0xa1, 0x80, 0x08, 0x45, 0x9d, 0x0c, 0xa2, 0xe2, 0x0c, 0x54, 0x75, 0x31, 0x28, 0x2b, 0x2f, + 0x28, 0xa4, 0xaf, 0x24, 0xf5, 0x2f, 0xa8, 0xbb, 0xb6, 0x5a, 0x39, 0xaf, 0x9e, 0x9f, 0x9c, 0x56, + 0xce, 0x8f, 0x53, 0xd4, 0xc7, 0x09, 0x55, 0x97, 0x48, 0xc3, 0x5e, 0xf8, 0x7e, 0x4f, 0x3e, 0x54, + 0xf7, 0x7b, 0x08, 0xd4, 0x08, 0xd4, 0x08, 0xd4, 0x08, 0xd4, 0x08, 0xd4, 0x08, 0xd4, 0x08, 0xd4, + 0xe2, 0x81, 0x9a, 0x34, 0x51, 0xaf, 0xff, 0xe0, 0x62, 0x1b, 0x14, 0xe4, 0x35, 0x11, 0xdf, 0x32, + 0xd8, 0x0f, 0xfe, 0x89, 0x33, 0x97, 0x75, 0x19, 0x0f, 0xde, 0x0d, 0xdf, 0x33, 0xac, 0xd7, 0xa1, + 0x27, 0x52, 0xd2, 0x49, 0x86, 0x35, 0x4b, 0x14, 0x84, 0x12, 0x6a, 0x8d, 0xe4, 0x29, 0xb5, 0x0b, + 0x10, 0x91, 0x3a, 0x7c, 0x28, 0xa4, 0xee, 0x15, 0x54, 0x04, 0xf2, 0xaf, 0xbe, 0x6b, 0xb7, 0x9c, + 0x2e, 0x6b, 0x8f, 0x99, 0x8a, 0x6a, 0x0d, 0x22, 0x96, 0xa6, 0x6f, 0x72, 0x26, 0xae, 0x7c, 0x8a, + 0xac, 0xce, 0x48, 0x0b, 0x9f, 0x15, 0x08, 0x9f, 0x10, 0x3e, 0x21, 0x7c, 0x22, 0x9f, 0x42, 0x3e, + 0x85, 0x7c, 0x0a, 0xf9, 0x14, 0xf2, 0x29, 0xe4, 0x53, 0x10, 0x3e, 0x11, 0xa8, 0x11, 0xa8, 0x11, + 0xa8, 0x11, 0xa8, 0x11, 0xa8, 0x11, 0xa8, 0x11, 0xa8, 0xf5, 0x26, 0xea, 0xbb, 0x54, 0xdf, 0x12, + 0xdb, 0xff, 0x1b, 0x89, 0x6f, 0x7b, 0xb9, 0xff, 0x37, 0xee, 0x66, 0x58, 0x92, 0x2e, 0xd6, 0xb1, + 0x01, 0x78, 0x7c, 0x37, 0x31, 0xf7, 0xfe, 0x0e, 0x3f, 0x1d, 0x6f, 0xdb, 0x6f, 0x09, 0xdb, 0x7e, + 0x29, 0xb0, 0x2d, 0xf9, 0x6d, 0xbf, 0xb1, 0xb1, 0x2b, 0xea, 0x6d, 0x97, 0x99, 0x9d, 0x78, 0xaf, + 0xe3, 0x46, 0x5a, 0x76, 0x0c, 0xb0, 0x2a, 0x36, 0xc6, 0xf6, 0xf8, 0xf1, 0xe3, 0x78, 0x2d, 0xe1, + 0x70, 0x38, 0xfd, 0x34, 0x18, 0x41, 0x3c, 0x15, 0x5f, 0x48, 0xbd, 0x17, 0xde, 0xfd, 0x5e, 0x81, + 0x19, 0xa4, 0xca, 0x0c, 0x62, 0xef, 0x7e, 0x37, 0xed, 0xae, 0xe3, 0x19, 0x83, 0x39, 0xd1, 0x0f, + 0xc5, 0x57, 0x82, 0xe6, 0xae, 0x16, 0x5b, 0x10, 0x2a, 0x61, 0x27, 0x3c, 0x16, 0x84, 0xa4, 0x12, + 0x65, 0xc5, 0xba, 0x99, 0x32, 0xf5, 0x32, 0x05, 0xeb, 0x64, 0x62, 0x6f, 0x41, 0xec, 0xa9, 0x47, + 0xbe, 0xb7, 0x80, 0x64, 0x61, 0x3c, 0x3a, 0xba, 0x4b, 0xe2, 0xad, 0x20, 0xa1, 0x43, 0xbf, 0xf0, + 0x5e, 0x10, 0xbc, 0xa1, 0x54, 0xe0, 0x9e, 0x4e, 0x55, 0x33, 0x08, 0x1c, 0x16, 0x18, 0x3c, 0x30, + 0xbd, 0xd0, 0x19, 0xf8, 0x42, 0x85, 0x83, 0x03, 0x56, 0x35, 0x06, 0x5d, 0x1d, 0xba, 0x7a, 0xae, + 0x74, 0x75, 0x95, 0x43, 0x74, 0x15, 0x0e, 0xcf, 0x85, 0xb4, 0x0e, 0x69, 0x3d, 0x91, 0xae, 0xa5, + 0x3f, 0xec, 0x76, 0x0f, 0x44, 0x76, 0x41, 0x2f, 0x24, 0x4c, 0xee, 0x6a, 0x66, 0xac, 0x85, 0xe4, + 0xe9, 0x88, 0x5e, 0x91, 0xec, 0xe5, 0x06, 0xf9, 0x49, 0xcb, 0x06, 0x06, 0xc7, 0x33, 0x9e, 0x03, + 0xdf, 0xb4, 0x2d, 0x33, 0xe4, 0x46, 0xef, 0x3b, 0x57, 0x80, 0xa9, 0xe5, 0xa6, 0x80, 0x52, 0x40, + 0x29, 0xa0, 0x14, 0x50, 0x0a, 0x28, 0x05, 0x94, 0xc2, 0x7e, 0x05, 0xd1, 0xb8, 0x6c, 0x3b, 0xa1, + 0x65, 0x06, 0xb6, 0x5a, 0x44, 0x8e, 0x1a, 0x41, 0x2c, 0x46, 0x2c, 0x46, 0x2c, 0x46, 0x2c, 0x46, + 0x2c, 0x46, 0x2c, 0x46, 0x2c, 0x16, 0x8d, 0xc5, 0x2c, 0x08, 0xfc, 0x40, 0x2d, 0x12, 0x8f, 0x9b, + 0x40, 0x1c, 0x46, 0x1c, 0x46, 0x1c, 0x46, 0x1c, 0x46, 0x1c, 0x46, 0x1c, 0x46, 0x1c, 0x16, 0x8d, + 0xc3, 0x1d, 0x2b, 0xa4, 0x88, 0xc5, 0x33, 0xcd, 0x20, 0x1e, 0x23, 0x1e, 0x23, 0x1e, 0x23, 0x1e, + 0x23, 0x1e, 0x23, 0x1e, 0x23, 0x1e, 0x8b, 0xc6, 0xe3, 0x6e, 0xdf, 0xe5, 0x0e, 0xcd, 0xda, 0xf1, + 0x42, 0x53, 0x88, 0xcb, 0x88, 0xcb, 0x88, 0xcb, 0x88, 0xcb, 0x88, 0xcb, 0x88, 0xcb, 0x88, 0xcb, + 0xa2, 0x71, 0xd9, 0xb7, 0x38, 0x53, 0x8c, 0xc7, 0xe3, 0x26, 0x10, 0x87, 0x11, 0x87, 0x11, 0x87, + 0x11, 0x87, 0x11, 0x87, 0x11, 0x87, 0x11, 0x87, 0x45, 0xe3, 0xb0, 0x72, 0x56, 0x8c, 0x5c, 0x18, + 0x31, 0x18, 0x31, 0x18, 0x31, 0x18, 0x31, 0x18, 0x31, 0x18, 0x31, 0x58, 0x2a, 0x06, 0xf7, 0x3d, + 0x22, 0x85, 0x7a, 0xae, 0x21, 0xc4, 0x64, 0xc4, 0x64, 0xc4, 0x64, 0xc4, 0x64, 0xc4, 0x64, 0xc4, + 0x64, 0xc4, 0x64, 0xf1, 0x98, 0xfc, 0xdd, 0xf3, 0xff, 0xf2, 0x8c, 0x5e, 0xe0, 0x73, 0x5f, 0x35, + 0x2a, 0xcf, 0x35, 0x85, 0xb8, 0x8c, 0xb8, 0x8c, 0xb8, 0x8c, 0xb8, 0x8c, 0xb8, 0x8c, 0xb8, 0x8c, + 0xb8, 0x2c, 0x14, 0x97, 0xdd, 0x41, 0x72, 0x6b, 0xb9, 0xcc, 0x0c, 0xe4, 0x03, 0xf2, 0x4c, 0x1b, + 0x88, 0xc4, 0x88, 0xc4, 0xb9, 0x8a, 0xc4, 0xdc, 0xe9, 0x32, 0xee, 0x58, 0xdf, 0xc3, 0xc4, 0x63, + 0xf1, 0x37, 0x6f, 0xe4, 0xc7, 0x8a, 0x9e, 0xe9, 0xf9, 0x21, 0xb3, 0x7c, 0x4f, 0xf8, 0x8d, 0x7e, + 0xc4, 0x74, 0xc4, 0x74, 0xc4, 0xf4, 0x34, 0xc7, 0x74, 0x94, 0x64, 0x43, 0x49, 0xb6, 0xc1, 0x13, + 0xf8, 0x7d, 0x4e, 0x56, 0x93, 0x6d, 0x45, 0x5b, 0xc0, 0x32, 0x60, 0x19, 0x04, 0x12, 0x08, 0x24, + 0x80, 0x29, 0xc0, 0x14, 0x04, 0x12, 0xe1, 0xc8, 0xac, 0x5e, 0x95, 0x6d, 0xae, 0x15, 0x44, 0x63, + 0x44, 0x63, 0x44, 0x63, 0x44, 0x63, 0x44, 0x63, 0x44, 0x63, 0x44, 0x63, 0xe1, 0x68, 0xac, 0x5a, + 0x0b, 0x66, 0xa6, 0x0d, 0x44, 0x62, 0x44, 0x62, 0x44, 0x62, 0x44, 0x62, 0x44, 0x62, 0x44, 0x62, + 0x44, 0x62, 0xe1, 0x48, 0x4c, 0x55, 0x09, 0x66, 0x45, 0x5b, 0x88, 0xcc, 0x88, 0xcc, 0x88, 0xcc, + 0x88, 0xcc, 0x88, 0xcc, 0x88, 0xcc, 0x88, 0xcc, 0xc2, 0x91, 0x59, 0xb5, 0x16, 0xcc, 0x4c, 0x1b, + 0x88, 0xc4, 0x88, 0xc4, 0x88, 0xc4, 0x88, 0xc4, 0x88, 0xc4, 0x88, 0xc4, 0x88, 0xc4, 0xc2, 0x91, + 0x58, 0x3d, 0x33, 0x46, 0x3e, 0x8c, 0x28, 0x8c, 0x28, 0x8c, 0x28, 0x8c, 0x28, 0x8c, 0x28, 0x8c, + 0x28, 0x2c, 0x17, 0x85, 0x69, 0xea, 0xc1, 0x2c, 0xb5, 0x84, 0xa8, 0x8c, 0xa8, 0x8c, 0xa8, 0x8c, + 0xa8, 0x8c, 0xa8, 0x8c, 0xa8, 0x8c, 0xa8, 0x1c, 0xf3, 0x93, 0x31, 0xe7, 0x54, 0xb1, 0xe6, 0x79, + 0x3e, 0x37, 0x07, 0x5d, 0x2b, 0x34, 0x8d, 0x8a, 0xa1, 0xf5, 0xca, 0xba, 0x66, 0xcf, 0xe4, 0xaf, + 0x03, 0x8f, 0x76, 0xe8, 0xf7, 0x98, 0x67, 0x0d, 0x23, 0xa8, 0xe1, 0x0c, 0x7c, 0x5b, 0xc7, 0xb4, + 0x58, 0x78, 0xb8, 0xea, 0xc7, 0xc3, 0x90, 0x9b, 0x9c, 0x1d, 0x8e, 0x7d, 0xa0, 0x48, 0x74, 0x2f, + 0x86, 0x3c, 0xe8, 0x5b, 0xdc, 0x1b, 0x7b, 0xd1, 0xfb, 0xe8, 0x2b, 0xaf, 0xa3, 0xaf, 0x69, 0xaf, + 0xfa, 0xb1, 0xdd, 0x1c, 0x7c, 0x63, 0xfb, 0x72, 0xf2, 0x8d, 0x07, 0x34, 0xbd, 0x1c, 0xa3, 0x87, + 0x8b, 0x36, 0x0b, 0xad, 0xc0, 0xe9, 0x09, 0x75, 0x6f, 0x14, 0x26, 0x66, 0x2f, 0x8e, 0x39, 0x9a, + 0x62, 0x86, 0x2c, 0xcc, 0x3c, 0x32, 0xac, 0x23, 0xcd, 0x38, 0xb2, 0x6c, 0xa3, 0xcc, 0x34, 0xca, + 0x2c, 0xa3, 0xc2, 0x30, 0xb4, 0xd6, 0x2d, 0xcc, 0x2a, 0xd1, 0x68, 0x85, 0x3c, 0x70, 0xbc, 0x17, + 0x91, 0xe1, 0x1a, 0xcf, 0xbd, 0xf2, 0x59, 0x82, 0xf6, 0xc5, 0x3c, 0xf3, 0xd9, 0x65, 0xb6, 0xb8, + 0x6d, 0x4d, 0x2e, 0x8c, 0xd9, 0x8f, 0x57, 0xac, 0x63, 0xf6, 0xdd, 0xe1, 0x78, 0x0e, 0xa6, 0x03, + 0xcc, 0x11, 0xe6, 0x98, 0xac, 0x39, 0x3e, 0xfb, 0xbe, 0xcb, 0x4c, 0x4f, 0xc6, 0x1e, 0xcb, 0x09, + 0xda, 0xe3, 0xab, 0x19, 0xd8, 0x7f, 0x99, 0x01, 0x33, 0x7a, 0x7e, 0xc0, 0xc5, 0xad, 0x72, 0xfe, + 0xf2, 0x7c, 0x18, 0x99, 0xc0, 0xa3, 0xe4, 0xcb, 0xcc, 0x86, 0x0f, 0x9e, 0x39, 0x43, 0x73, 0x99, + 0xd9, 0x09, 0x58, 0x47, 0xc6, 0xd0, 0x4e, 0x05, 0xae, 0x69, 0x44, 0xe0, 0x6c, 0x19, 0x3d, 0xd7, + 0xe4, 0x1d, 0x3f, 0xe8, 0x7e, 0xb2, 0xfc, 0x6e, 0xcf, 0xf7, 0x98, 0xc7, 0xc3, 0xd5, 0xbf, 0x9e, + 0xfb, 0xed, 0x10, 0x83, 0x13, 0x34, 0x6d, 0xa7, 0xe3, 0x78, 0x36, 0xfb, 0x21, 0x6e, 0xd4, 0x93, + 0x0b, 0x11, 0x33, 0x11, 0x33, 0x13, 0x35, 0xe5, 0xbe, 0xe3, 0xf1, 0xa3, 0x8a, 0x84, 0x25, 0x8b, + 0x18, 0xb2, 0x9c, 0xa6, 0x26, 0x21, 0x1e, 0xaa, 0x68, 0x68, 0x8a, 0x02, 0x8f, 0xaa, 0x66, 0x46, + 0xa1, 0xde, 0x48, 0x68, 0x64, 0x4a, 0xda, 0x18, 0x55, 0x97, 0x55, 0x2b, 0xe7, 0xd5, 0xf3, 0x93, + 0xd3, 0xca, 0xf9, 0xf1, 0x0e, 0xfb, 0x4e, 0x93, 0x12, 0xf5, 0x44, 0x6a, 0xe8, 0xc2, 0x65, 0x97, + 0xe4, 0x7d, 0x2a, 0x59, 0x99, 0x25, 0xf5, 0xf2, 0x4a, 0x92, 0x65, 0x95, 0xe2, 0x0d, 0xd2, 0x13, + 0x49, 0xe4, 0x1f, 0x55, 0x9e, 0x7c, 0x1d, 0x3b, 0x3a, 0xc1, 0xe8, 0x3f, 0x7b, 0x31, 0x08, 0x00, + 0x04, 0x90, 0x28, 0x01, 0xc8, 0xd5, 0x95, 0x94, 0x58, 0x62, 0x53, 0xad, 0x23, 0x09, 0x8c, 0x00, + 0x46, 0x6c, 0xec, 0x32, 0xba, 0x25, 0x35, 0x00, 0x05, 0x80, 0x62, 0xd7, 0x40, 0xe1, 0xbf, 0x38, + 0x96, 0xe9, 0x4a, 0xc0, 0xc4, 0xf8, 0x42, 0x80, 0x04, 0x40, 0x22, 0x51, 0x90, 0xd0, 0x2f, 0xbf, + 0xc3, 0xa7, 0x65, 0xdd, 0xa7, 0xf9, 0xbd, 0x67, 0xd3, 0xfa, 0x6e, 0x74, 0x7d, 0x5b, 0x26, 0x4d, + 0x9a, 0xbb, 0x5c, 0x7c, 0x55, 0x72, 0xd8, 0xa9, 0xf0, 0x8b, 0xf0, 0x8b, 0x79, 0xf3, 0x8b, 0x24, + 0xc6, 0xd9, 0xe5, 0x7d, 0x71, 0x93, 0x1c, 0x5c, 0x04, 0x83, 0x82, 0x41, 0x25, 0x6a, 0x50, 0x7d, + 0xc7, 0xe3, 0xe5, 0x13, 0x09, 0x7b, 0x3a, 0x81, 0xd8, 0x00, 0xb1, 0x81, 0xa8, 0xcb, 0x4e, 0x8e, + 0x8f, 0x8f, 0xf6, 0x57, 0x5d, 0x20, 0x89, 0x38, 0xe3, 0x4d, 0xaa, 0x82, 0x21, 0x67, 0x78, 0x15, + 0x62, 0x0e, 0x62, 0x4e, 0xa2, 0x31, 0x27, 0x1b, 0x5b, 0x3d, 0xfd, 0x1e, 0x0b, 0x8c, 0x90, 0x9b, + 0xbc, 0x1f, 0x8a, 0x1b, 0xd6, 0xec, 0xc5, 0xb0, 0x2f, 0xd8, 0x57, 0xa2, 0xf6, 0xc5, 0xbc, 0x7e, + 0x97, 0x05, 0xa6, 0xc0, 0x3e, 0xfe, 0x39, 0x23, 0xab, 0x0a, 0x5c, 0x53, 0xf7, 0xfa, 0xdd, 0xc1, + 0x4d, 0xfe, 0x84, 0xe8, 0xb4, 0x0f, 0xa2, 0x53, 0xef, 0xf5, 0x3d, 0x74, 0x2c, 0xd3, 0x1d, 0x76, + 0x91, 0xc7, 0x24, 0x14, 0xf5, 0xa5, 0x16, 0xf2, 0xe1, 0x1d, 0x79, 0x60, 0x7a, 0xa1, 0xc5, 0x9c, + 0x37, 0x16, 0xec, 0xa5, 0x9b, 0x9c, 0x7d, 0x7e, 0x6c, 0xc1, 0x5d, 0x33, 0xc5, 0x64, 0xb6, 0xe0, + 0xfe, 0xb9, 0xb8, 0x05, 0xf7, 0xff, 0xb5, 0xfa, 0x41, 0xc0, 0x3c, 0xfe, 0xcb, 0xaf, 0x87, 0x1f, + 0x3f, 0x1e, 0xce, 0x77, 0xfd, 0xa7, 0x99, 0x9f, 0x9f, 0x36, 0xfc, 0xdb, 0xe2, 0x3f, 0x2d, 0x1a, + 0x65, 0xb8, 0xf8, 0x81, 0xf1, 0xef, 0x17, 0x7f, 0x3d, 0xda, 0x67, 0x4b, 0x3a, 0x8a, 0x37, 0x4e, + 0xc8, 0x6b, 0x9c, 0x8b, 0x9d, 0x5b, 0x3b, 0xc8, 0xfb, 0xeb, 0x03, 0x07, 0xee, 0x0d, 0xe3, 0x86, + 0xd7, 0x77, 0x5d, 0x81, 0x71, 0xb9, 0x35, 0x7f, 0xc8, 0x5f, 0x7c, 0x1f, 0xd8, 0x2c, 0x60, 0xf6, + 0xc5, 0xfb, 0xf8, 0xd2, 0x04, 0x01, 0x75, 0xd6, 0xe6, 0x84, 0xfd, 0xb0, 0xb8, 0xc3, 0x82, 0x0b, + 0x86, 0x0b, 0x86, 0x0b, 0x5e, 0xe9, 0x82, 0x7b, 0x7e, 0xc0, 0x3f, 0xcd, 0xbd, 0x4b, 0xf4, 0x34, + 0xd7, 0x54, 0xd8, 0x7f, 0x5e, 0xf3, 0x25, 0xb3, 0xff, 0xb2, 0xd3, 0xb7, 0x2d, 0xb8, 0xc8, 0xd0, + 0x4d, 0xbd, 0xc8, 0xe0, 0x2a, 0xe4, 0xb7, 0xc8, 0x6f, 0x13, 0x75, 0x16, 0x8e, 0xcd, 0x3c, 0xee, + 0xf0, 0x77, 0x49, 0x87, 0x21, 0xa0, 0x34, 0x17, 0xaf, 0xc7, 0x5f, 0x75, 0x61, 0x86, 0x4c, 0xbe, + 0xc2, 0x50, 0x54, 0x8b, 0xc0, 0x18, 0x1a, 0x0c, 0x75, 0x87, 0x1f, 0xa8, 0x7d, 0x62, 0xcb, 0x80, + 0x15, 0x6b, 0xfd, 0x97, 0xc1, 0x84, 0x19, 0xbe, 0xf5, 0xbc, 0x3d, 0x25, 0x17, 0xf4, 0x20, 0x87, + 0xc3, 0x39, 0xf8, 0x69, 0xa6, 0x70, 0xc3, 0xc2, 0x2f, 0xc6, 0x7f, 0x1f, 0x16, 0x71, 0x88, 0xbf, + 0x4f, 0x61, 0xb6, 0x0a, 0x42, 0xb1, 0x66, 0xdb, 0x61, 0xc1, 0x2c, 0x04, 0xac, 0xc3, 0x02, 0xe6, + 0x59, 0xac, 0xd0, 0x09, 0xfc, 0x6e, 0x81, 0xbf, 0xb2, 0xc2, 0xb3, 0x19, 0xb2, 0x42, 0xf4, 0x55, + 0x05, 0xee, 0x0f, 0x7f, 0x6b, 0xf9, 0x41, 0xc0, 0xc2, 0x9e, 0xef, 0xd9, 0x8e, 0xf7, 0xf2, 0xe8, + 0x0d, 0xfc, 0x79, 0x21, 0xf2, 0xd2, 0x05, 0xc7, 0x1b, 0x7e, 0xc8, 0x66, 0x6f, 0x8e, 0x35, 0xb8, + 0xf8, 0x8d, 0x79, 0xdc, 0x0f, 0xde, 0x3f, 0x0a, 0xfa, 0xc1, 0x32, 0x5e, 0x1f, 0xc5, 0xeb, 0xa3, + 0xd1, 0x84, 0x75, 0x04, 0x13, 0x1e, 0xb9, 0xf7, 0x9e, 0x97, 0xc6, 0x5b, 0xe6, 0xfd, 0xe7, 0x75, + 0x56, 0xf6, 0xd9, 0x0f, 0x0a, 0xde, 0x58, 0x3d, 0xf3, 0x98, 0xeb, 0xfc, 0x9b, 0xd9, 0x53, 0xd3, + 0x0a, 0x3f, 0x4c, 0xcd, 0x2f, 0x1c, 0xda, 0xcf, 0xe4, 0xab, 0x0b, 0x83, 0xaf, 0x7e, 0xf4, 0xe6, + 0x6c, 0x6e, 0x62, 0x88, 0xf3, 0xe6, 0xf9, 0x71, 0x4f, 0x0a, 0xb3, 0x49, 0x8c, 0x45, 0x61, 0x2f, + 0x4a, 0xb3, 0x89, 0x59, 0xa8, 0x98, 0xa5, 0x0a, 0x5a, 0xac, 0x3c, 0xc5, 0x10, 0xa4, 0x3e, 0x2a, + 0x29, 0x90, 0x5a, 0x2a, 0x24, 0x99, 0xa2, 0x88, 0x0f, 0xc5, 0xcf, 0xe4, 0x52, 0x9f, 0xcc, 0x00, + 0x8b, 0xe9, 0x6d, 0x45, 0x95, 0x19, 0x0d, 0x60, 0x4a, 0x2c, 0x79, 0x21, 0x13, 0x08, 0x3c, 0x3b, + 0x17, 0x78, 0x84, 0x39, 0x45, 0x46, 0xa3, 0x24, 0xd0, 0x2a, 0xd7, 0x19, 0x56, 0x23, 0xf0, 0xdf, + 0x1c, 0x9b, 0xcd, 0x1b, 0xd7, 0xd8, 0x94, 0x66, 0x6d, 0x67, 0x56, 0x96, 0x29, 0xf0, 0x57, 0x73, + 0x0e, 0x50, 0xc2, 0xc9, 0x15, 0x13, 0xd9, 0xbc, 0xb0, 0x90, 0x21, 0x74, 0xfc, 0xa0, 0xc0, 0x5f, + 0x9d, 0x70, 0x06, 0x5d, 0x1e, 0xbd, 0xd6, 0x34, 0x67, 0xe8, 0xf6, 0x43, 0x5e, 0xf0, 0x3d, 0xf7, + 0xbd, 0xd0, 0xf3, 0x7b, 0x7d, 0xd7, 0xe4, 0x6c, 0xf4, 0xf1, 0x41, 0x24, 0x28, 0xfc, 0xe5, 0xf0, + 0xd7, 0x85, 0xdb, 0x7b, 0xf4, 0xcc, 0x99, 0xd6, 0xfd, 0x4e, 0x61, 0x90, 0x45, 0x16, 0x5a, 0x0f, + 0xb5, 0xbb, 0xe6, 0x65, 0xfd, 0xfa, 0x9f, 0xf5, 0x87, 0x7d, 0x21, 0x23, 0xf9, 0x89, 0xb0, 0x1f, + 0x80, 0x24, 0xe5, 0x21, 0xc0, 0x49, 0x7b, 0x27, 0x19, 0x83, 0xc7, 0xf4, 0x09, 0x48, 0x0e, 0x0f, + 0x97, 0x04, 0xa4, 0x49, 0x9c, 0x98, 0x2c, 0xaf, 0x82, 0xc8, 0x40, 0x64, 0xbb, 0x22, 0x32, 0xe9, + 0x2d, 0x3c, 0x4b, 0x13, 0x40, 0x72, 0x2b, 0xcf, 0x26, 0xfd, 0xc8, 0x2c, 0xac, 0x54, 0x8f, 0x3e, + 0x14, 0x5c, 0x27, 0x1c, 0x92, 0xcf, 0xac, 0x88, 0x34, 0x84, 0xb0, 0x15, 0xd6, 0x55, 0xf8, 0xc5, + 0x35, 0x3d, 0x16, 0xfe, 0x5a, 0x58, 0xa9, 0x29, 0x2d, 0x32, 0xd9, 0xf2, 0xe5, 0x66, 0xc0, 0x0a, + 0x6c, 0xbc, 0x21, 0x60, 0xf0, 0x9d, 0x66, 0x61, 0x65, 0x5a, 0xf5, 0xe8, 0x8d, 0x95, 0xe0, 0x89, + 0x03, 0x2e, 0x74, 0x7d, 0x9b, 0xb9, 0x60, 0x31, 0xb0, 0x18, 0x58, 0x2c, 0x53, 0x2c, 0x96, 0x8d, + 0x1d, 0x54, 0xb2, 0xa3, 0x2d, 0xb5, 0xa3, 0x2a, 0xba, 0x5a, 0x65, 0x67, 0xd5, 0xb4, 0x11, 0x85, + 0x1d, 0x56, 0x51, 0x23, 0x52, 0x3b, 0xad, 0x76, 0x48, 0xba, 0x1b, 0x3f, 0xf1, 0xb4, 0x6d, 0xcd, + 0x55, 0xac, 0x4a, 0xbe, 0x6a, 0x75, 0xfc, 0x18, 0x86, 0xac, 0x56, 0x0c, 0x7f, 0xf3, 0x14, 0x5f, + 0xdf, 0x57, 0x1b, 0x26, 0x7b, 0x31, 0xec, 0x3f, 0x4f, 0x9f, 0x68, 0x6b, 0x37, 0x4d, 0xdf, 0x3e, + 0x99, 0xbb, 0x6c, 0xcb, 0x38, 0xc4, 0x03, 0xf0, 0xd8, 0xc1, 0x58, 0x24, 0xf8, 0x0a, 0x6f, 0x4e, + 0x11, 0x8d, 0xa9, 0xd2, 0x31, 0x54, 0x3a, 0x66, 0xca, 0x6c, 0x3e, 0x51, 0xdb, 0xbb, 0x10, 0x17, + 0x8f, 0xe7, 0x66, 0x85, 0xf8, 0x3e, 0xa8, 0xb9, 0xab, 0xf3, 0x91, 0xdb, 0x61, 0x3f, 0x54, 0xda, + 0x33, 0x39, 0x6b, 0x32, 0x23, 0x24, 0xf3, 0xb7, 0xf1, 0xf5, 0x72, 0xe9, 0x4a, 0x19, 0xa7, 0x9d, + 0xe5, 0x21, 0x4b, 0x49, 0xdf, 0x69, 0x67, 0xa2, 0x66, 0x10, 0x5d, 0x28, 0x73, 0xf4, 0xcd, 0xda, + 0x19, 0x23, 0x7e, 0x14, 0x0e, 0x51, 0x5e, 0xaf, 0x6c, 0x30, 0x14, 0x86, 0x43, 0x66, 0x40, 0x54, + 0x86, 0x44, 0x6e, 0x50, 0xe4, 0x86, 0x45, 0x69, 0x60, 0x72, 0x86, 0x26, 0x69, 0x70, 0xea, 0xaa, + 0xc0, 0x32, 0x0d, 0x89, 0xbe, 0xdf, 0xbd, 0x36, 0xc8, 0x9c, 0x25, 0x74, 0x74, 0x9a, 0x4c, 0xe1, + 0x0c, 0xd1, 0xa3, 0x80, 0xd6, 0x76, 0x97, 0xd8, 0xd1, 0x40, 0x2b, 0x64, 0x54, 0x99, 0xa3, 0x82, + 0xe0, 0xae, 0xe0, 0xae, 0xe0, 0xae, 0x24, 0x6b, 0x8a, 0xad, 0xf5, 0x57, 0xe5, 0x14, 0xfb, 0x2b, + 0xb1, 0xd3, 0x54, 0xd6, 0xf6, 0x96, 0xc8, 0xd9, 0x2a, 0x9b, 0x7c, 0x55, 0x09, 0x8e, 0x0a, 0x8e, + 0x0a, 0x8e, 0x4a, 0x64, 0xb6, 0x08, 0x9f, 0x2f, 0xb3, 0xce, 0x76, 0x4e, 0x15, 0x9a, 0x50, 0x3b, + 0xd3, 0x79, 0xf2, 0x9f, 0xda, 0x74, 0x2d, 0x50, 0x9d, 0xf1, 0x4c, 0xe4, 0x54, 0x96, 0x9a, 0x23, + 0x3a, 0xf3, 0x39, 0x6a, 0x8f, 0xf0, 0x34, 0x62, 0xc5, 0xe9, 0x3c, 0x3f, 0x04, 0x04, 0x67, 0x41, + 0xeb, 0x1e, 0x02, 0xd5, 0xf3, 0x70, 0x12, 0x19, 0x8b, 0x83, 0xdd, 0x5c, 0xfd, 0x94, 0x14, 0xae, + 0x68, 0x55, 0x8c, 0x84, 0xab, 0x05, 0xa9, 0x39, 0x21, 0x2d, 0xd5, 0x83, 0xd6, 0xc4, 0x4d, 0x89, + 0x2a, 0x42, 0x2b, 0x03, 0xa6, 0x6e, 0x91, 0xef, 0x49, 0x54, 0x74, 0x97, 0x3b, 0x04, 0x3c, 0xba, + 0x5e, 0x61, 0xb9, 0x73, 0x76, 0xf5, 0x6f, 0xee, 0x6f, 0x87, 0x52, 0x7a, 0x78, 0x41, 0x69, 0x69, + 0x74, 0xf6, 0x66, 0xe6, 0xfe, 0xd6, 0x1e, 0x63, 0xaa, 0xae, 0x45, 0x6e, 0x81, 0xa5, 0x1d, 0xb9, + 0xbc, 0x41, 0x29, 0x5f, 0xc8, 0xea, 0x9e, 0x28, 0x2c, 0x32, 0x90, 0xb1, 0x3a, 0x76, 0x40, 0xad, + 0x9e, 0xa8, 0x63, 0x97, 0xf7, 0xf1, 0xe3, 0xd8, 0x5d, 0x1d, 0xca, 0xec, 0x20, 0xd2, 0xe2, 0x27, + 0x46, 0x1b, 0x49, 0xa4, 0xfd, 0x84, 0xc8, 0xfe, 0xec, 0xa5, 0xae, 0x94, 0xf5, 0x13, 0x15, 0xf8, + 0x09, 0xf8, 0x89, 0x4d, 0x7a, 0x95, 0xec, 0x62, 0xa4, 0x69, 0x77, 0x1d, 0x4f, 0xb4, 0x7a, 0xec, + 0xda, 0x29, 0x33, 0xd7, 0x1a, 0x64, 0x33, 0xc8, 0x66, 0x90, 0xcd, 0x04, 0x66, 0x8b, 0x5c, 0x39, + 0xdc, 0xb5, 0xb1, 0xa6, 0xaa, 0xd0, 0x86, 0x58, 0xb9, 0x5c, 0xaa, 0xae, 0x94, 0x4e, 0x90, 0x69, + 0xd4, 0x3a, 0xad, 0x09, 0x33, 0x7d, 0xe2, 0x4c, 0x94, 0x40, 0xab, 0x59, 0xcd, 0x53, 0x22, 0x4b, + 0x42, 0x96, 0xdf, 0x1f, 0x24, 0x9c, 0x04, 0x11, 0x2a, 0x6a, 0x49, 0x2d, 0x3a, 0x95, 0x11, 0x9d, + 0x10, 0x9d, 0xb2, 0x10, 0x9d, 0x64, 0xc1, 0x70, 0x6a, 0x7a, 0x66, 0x10, 0x38, 0x2c, 0x18, 0xbd, + 0x0c, 0xe2, 0x0c, 0x62, 0x53, 0xa8, 0x3e, 0xe0, 0x91, 0x35, 0xae, 0x68, 0x5c, 0x71, 0xa4, 0x68, + 0xd4, 0x79, 0x65, 0x43, 0xa5, 0x34, 0x58, 0x72, 0xc3, 0xa5, 0x36, 0x60, 0x6d, 0x86, 0xac, 0xcd, + 0xa0, 0x75, 0x18, 0xb6, 0x9a, 0x81, 0x2b, 0x1a, 0x3a, 0x1d, 0x8e, 0xae, 0x0b, 0x99, 0x42, 0x27, + 0x85, 0x6f, 0x33, 0xcf, 0x33, 0x82, 0xa6, 0x68, 0x16, 0x78, 0x69, 0xd0, 0x71, 0xee, 0xc6, 0x28, + 0x17, 0x7c, 0x89, 0xfd, 0xda, 0x52, 0xb3, 0xc4, 0x0b, 0xc0, 0x51, 0xbb, 0x1a, 0x16, 0x1f, 0x89, + 0x2c, 0x64, 0x7e, 0xa8, 0x08, 0x17, 0x86, 0x93, 0x1a, 0x2a, 0xba, 0x13, 0xcf, 0x77, 0x32, 0x7a, + 0x07, 0xe9, 0x68, 0xe5, 0x69, 0xa7, 0x5e, 0x5a, 0x39, 0xd3, 0xa5, 0x75, 0x5b, 0x89, 0x64, 0xbe, + 0xfa, 0x32, 0x60, 0xe2, 0x4c, 0x98, 0x66, 0x92, 0xc9, 0x4f, 0x30, 0x85, 0xc9, 0x55, 0x74, 0x3c, + 0xe3, 0x39, 0xf0, 0x4d, 0xdb, 0x32, 0x43, 0x6e, 0xf4, 0xbe, 0x73, 0x42, 0x58, 0x5f, 0x6e, 0x1a, + 0xa8, 0x0e, 0x54, 0x07, 0xaa, 0x03, 0xd5, 0x81, 0xea, 0x40, 0x75, 0xa0, 0x3a, 0x50, 0x3d, 0x9d, + 0xa8, 0xbe, 0x2b, 0x0e, 0xb3, 0x9d, 0xd0, 0x32, 0x03, 0x9b, 0x96, 0xc0, 0xa2, 0x46, 0xc1, 0x5e, + 0x60, 0x2f, 0xb0, 0x17, 0xd8, 0x0b, 0xec, 0x05, 0xf6, 0x02, 0x7b, 0x81, 0xbd, 0xc0, 0x5e, 0xb3, + 0xec, 0xc5, 0x82, 0xc0, 0x0f, 0x68, 0xc9, 0x6b, 0xdc, 0x24, 0xb8, 0x0b, 0xdc, 0x05, 0xee, 0x02, + 0x77, 0x81, 0xbb, 0xc0, 0x5d, 0xe0, 0x2e, 0x70, 0x17, 0xb8, 0x6b, 0x96, 0xbb, 0x3a, 0x56, 0xa8, + 0x83, 0xbd, 0x66, 0x9a, 0x05, 0x7f, 0x81, 0xbf, 0xc0, 0x5f, 0xe0, 0x2f, 0xf0, 0x17, 0xf8, 0x0b, + 0xfc, 0x05, 0xfe, 0x02, 0x7f, 0xcd, 0xf2, 0x57, 0xb7, 0xef, 0x72, 0x47, 0xcf, 0xde, 0xaf, 0x85, + 0xa6, 0xc1, 0x61, 0xe0, 0x30, 0x70, 0x18, 0x38, 0x0c, 0x1c, 0x06, 0x0e, 0x03, 0x87, 0x81, 0xc3, + 0xc0, 0x61, 0xb3, 0x1c, 0xe6, 0x5b, 0x9c, 0x11, 0xf3, 0xd7, 0xb8, 0x49, 0x70, 0x17, 0xb8, 0x0b, + 0xdc, 0x05, 0xee, 0x02, 0x77, 0x81, 0xbb, 0xc0, 0x5d, 0xe0, 0x2e, 0x70, 0xd7, 0x2c, 0x77, 0x91, + 0xab, 0x5e, 0xd0, 0xba, 0xc0, 0x5c, 0x60, 0x2e, 0x30, 0x17, 0x98, 0x0b, 0xcc, 0x05, 0xe6, 0x02, + 0x73, 0x81, 0xb9, 0x96, 0x98, 0xab, 0xef, 0x69, 0x5a, 0x71, 0x9c, 0x6b, 0x18, 0x0c, 0x06, 0x06, + 0x03, 0x83, 0x81, 0xc1, 0xc0, 0x60, 0x60, 0x30, 0x30, 0x18, 0x18, 0x0c, 0x0c, 0x36, 0xcf, 0x60, + 0xdf, 0x3d, 0xff, 0x2f, 0xcf, 0xe8, 0x05, 0x3e, 0xf7, 0xa9, 0x29, 0x6c, 0xae, 0x69, 0x70, 0x18, + 0x38, 0x0c, 0x1c, 0x06, 0x0e, 0x03, 0x87, 0x81, 0xc3, 0xc0, 0x61, 0xe0, 0x30, 0x70, 0x58, 0x34, + 0x2c, 0xae, 0x19, 0x72, 0xc3, 0x72, 0x99, 0x19, 0xd0, 0x01, 0xd8, 0x4c, 0x9b, 0x20, 0x2f, 0x90, + 0x17, 0xc8, 0x2b, 0x45, 0xe4, 0xc5, 0x9d, 0x2e, 0xe3, 0x8e, 0xf5, 0x3d, 0x4c, 0x1d, 0x7b, 0x7d, + 0xf3, 0x46, 0x71, 0xa1, 0xe8, 0x99, 0x9e, 0x1f, 0x32, 0xcb, 0xf7, 0x94, 0x2b, 0x06, 0x82, 0xe9, + 0xc0, 0x74, 0x60, 0x3a, 0x30, 0xdd, 0xee, 0x98, 0x0e, 0x47, 0x2e, 0x50, 0x61, 0x02, 0x8e, 0x5c, + 0xa0, 0xc4, 0x7e, 0xbf, 0xcf, 0xb5, 0x9d, 0xb9, 0xb0, 0xa2, 0x6d, 0xa4, 0x01, 0x48, 0x03, 0x90, + 0x06, 0xa4, 0x28, 0x0d, 0x80, 0x00, 0x0b, 0x58, 0x07, 0xac, 0x03, 0xd6, 0x01, 0xeb, 0x14, 0xdf, + 0xaf, 0x4a, 0x62, 0xf4, 0xa7, 0x2e, 0xcc, 0xb5, 0x0a, 0xfa, 0x02, 0x7d, 0x81, 0xbe, 0x40, 0x5f, + 0xa0, 0x2f, 0xd0, 0x17, 0xe8, 0x0b, 0xf4, 0x05, 0xfa, 0x9a, 0xa3, 0x2f, 0xea, 0xda, 0xbf, 0x33, + 0x6d, 0x82, 0xbc, 0x40, 0x5e, 0x20, 0x2f, 0x90, 0x17, 0xc8, 0x0b, 0xe4, 0x05, 0xf2, 0x02, 0x79, + 0x81, 0xbc, 0xe6, 0xc8, 0x4b, 0x57, 0xe5, 0xdf, 0x15, 0x6d, 0x83, 0xc4, 0x40, 0x62, 0x20, 0x31, + 0x90, 0x18, 0x48, 0x0c, 0x24, 0x06, 0x12, 0x03, 0x89, 0x81, 0xc4, 0xe6, 0x48, 0x8c, 0xba, 0xf6, + 0xef, 0x4c, 0x9b, 0x20, 0x2f, 0x90, 0x17, 0xc8, 0x0b, 0xe4, 0x05, 0xf2, 0x02, 0x79, 0x81, 0xbc, + 0x40, 0x5e, 0x20, 0xaf, 0x39, 0xf2, 0xa2, 0x57, 0xbe, 0xa0, 0x77, 0x81, 0xba, 0x40, 0x5d, 0xa0, + 0x2e, 0x50, 0x17, 0xa8, 0x0b, 0xd4, 0x05, 0xea, 0x02, 0x75, 0x2d, 0x53, 0x97, 0x9e, 0xfa, 0xbf, + 0x4b, 0x2d, 0x83, 0xc2, 0x40, 0x61, 0xa0, 0x30, 0x50, 0x18, 0x28, 0x0c, 0x14, 0x06, 0x0a, 0x03, + 0x85, 0xe5, 0x8d, 0xc2, 0x0e, 0x12, 0x9c, 0xf3, 0xc5, 0x9a, 0xe7, 0xf9, 0xdc, 0x1c, 0x0c, 0xa5, + 0xd2, 0x34, 0x2f, 0x86, 0xd6, 0x2b, 0xeb, 0x9a, 0x3d, 0x93, 0xbf, 0x0e, 0x22, 0xc2, 0xa1, 0xdf, + 0x63, 0x9e, 0x35, 0x24, 0x24, 0xc3, 0x19, 0xc4, 0x86, 0x8e, 0x69, 0xb1, 0xf0, 0x70, 0xd5, 0x8f, + 0x87, 0x61, 0xff, 0x79, 0xe6, 0xf7, 0xb3, 0x7f, 0x3b, 0x0c, 0xb9, 0xc9, 0xd9, 0xe1, 0x38, 0xbc, + 0xa8, 0x80, 0x5f, 0x31, 0xe4, 0x41, 0xdf, 0xe2, 0xde, 0x38, 0x60, 0xdd, 0x47, 0x77, 0x77, 0x1d, + 0x7d, 0x73, 0x7b, 0xd5, 0x8f, 0xed, 0xe6, 0xec, 0xcd, 0xcd, 0xfd, 0xad, 0xdd, 0x1c, 0xdc, 0x5c, + 0xfb, 0x72, 0x72, 0x73, 0x07, 0xc9, 0x8c, 0xb5, 0xc4, 0x38, 0x17, 0x6d, 0x16, 0x5a, 0x81, 0xd3, + 0x53, 0x1a, 0xe4, 0x28, 0xd8, 0xcf, 0x36, 0x26, 0x39, 0xe7, 0xd4, 0xdc, 0x9f, 0x32, 0x79, 0x53, + 0x10, 0x37, 0x19, 0x69, 0x53, 0x11, 0x36, 0x39, 0x59, 0x93, 0x13, 0x35, 0x25, 0x49, 0x27, 0xeb, + 0x23, 0x95, 0x89, 0x39, 0x9a, 0x2d, 0x21, 0x0f, 0x1c, 0xef, 0x45, 0x65, 0xba, 0x8c, 0x6d, 0xa7, + 0x7c, 0x96, 0x62, 0x7f, 0xc3, 0x3c, 0xf3, 0xd9, 0x65, 0xb6, 0xba, 0xaf, 0x99, 0x34, 0x24, 0x39, + 0x6e, 0x57, 0xac, 0x63, 0xf6, 0xdd, 0xe1, 0x7c, 0x1b, 0x4c, 0x5f, 0xb8, 0x2b, 0xb8, 0x2b, 0xb8, + 0x2b, 0x91, 0xd9, 0xf2, 0xec, 0xfb, 0x2e, 0x33, 0x3d, 0x0a, 0x7f, 0x55, 0x4e, 0xb1, 0xbf, 0x72, + 0x3a, 0x8e, 0x67, 0xb3, 0x1f, 0xea, 0xfe, 0x6a, 0xd2, 0x10, 0x1c, 0x0d, 0x1c, 0x0d, 0x1c, 0x8d, + 0xc0, 0x6c, 0xe9, 0x3b, 0x1e, 0x3f, 0xaa, 0x10, 0xf8, 0x99, 0x53, 0x85, 0x26, 0x68, 0xe4, 0x42, + 0x02, 0x5d, 0x95, 0x52, 0x1e, 0x24, 0xd6, 0x9a, 0xa8, 0xe5, 0x40, 0x1d, 0x42, 0x12, 0x81, 0xfc, + 0x47, 0x2a, 0xfb, 0xe9, 0x1a, 0x82, 0x6a, 0xe5, 0xbc, 0x7a, 0x7e, 0x72, 0x5a, 0x39, 0x3f, 0x4e, + 0xf1, 0x58, 0xec, 0x48, 0x44, 0x7b, 0x4a, 0xd4, 0x11, 0x2a, 0x57, 0x14, 0xa6, 0x8b, 0x71, 0xda, + 0x2a, 0x08, 0xd3, 0x57, 0x0e, 0x26, 0xaa, 0x18, 0x2c, 0x37, 0x49, 0x9e, 0x92, 0x21, 0x4b, 0x22, + 0xae, 0x54, 0xa1, 0xca, 0x99, 0x2c, 0xb8, 0x04, 0x32, 0x05, 0x99, 0x82, 0x4c, 0x41, 0xa6, 0x20, + 0x53, 0x90, 0x29, 0xc8, 0x34, 0x4b, 0x64, 0x9a, 0x08, 0xae, 0x8c, 0xce, 0x18, 0x7b, 0x1d, 0x7b, + 0x1b, 0x45, 0x68, 0x99, 0x6d, 0x0c, 0xd8, 0x01, 0xec, 0x00, 0x76, 0x08, 0xcc, 0x16, 0x9a, 0x13, + 0xc5, 0x08, 0x36, 0xd3, 0x51, 0x9f, 0x20, 0x06, 0x96, 0x01, 0xcb, 0x64, 0x8a, 0x65, 0xf4, 0x6d, + 0xa6, 0x03, 0xd5, 0x40, 0x6f, 0x83, 0xde, 0x46, 0x0b, 0xb0, 0xfe, 0x8b, 0x63, 0x99, 0x2e, 0x01, + 0xbc, 0x8e, 0x1b, 0x02, 0xb8, 0x02, 0x5c, 0x01, 0xae, 0x02, 0xb3, 0x65, 0xf7, 0x5b, 0x46, 0x10, + 0x53, 0x10, 0x53, 0x28, 0x63, 0xca, 0x78, 0xd3, 0xb8, 0x62, 0x40, 0x19, 0xb6, 0x82, 0x68, 0x82, + 0x68, 0x82, 0x68, 0x22, 0x30, 0x5b, 0x76, 0xbe, 0x5f, 0x1a, 0xc1, 0x04, 0xc1, 0x84, 0x32, 0x98, + 0xf8, 0x3d, 0x16, 0x18, 0x21, 0x37, 0x79, 0x3f, 0x54, 0x8f, 0x29, 0xb3, 0x8d, 0x21, 0xb4, 0x20, + 0xb4, 0x20, 0xb4, 0x08, 0xcc, 0x16, 0xe6, 0xf5, 0xbb, 0x2c, 0x30, 0x15, 0xde, 0x63, 0x9b, 0x8b, + 0x2f, 0x55, 0x85, 0x36, 0xea, 0x5e, 0xbf, 0x3b, 0x78, 0xa8, 0x9f, 0x88, 0x51, 0x88, 0x51, 0xc4, + 0x31, 0xea, 0x40, 0xe3, 0x54, 0x52, 0x7d, 0x79, 0x58, 0xe3, 0x4b, 0xc3, 0x12, 0xf3, 0x46, 0xdb, + 0x3b, 0xc2, 0x62, 0xb3, 0x24, 0xfe, 0x88, 0xc5, 0xfb, 0x64, 0xcc, 0x31, 0x1d, 0x98, 0xa3, 0xe8, + 0x56, 0xc3, 0xe2, 0x8d, 0x13, 0xf2, 0x1a, 0xe7, 0x81, 0xd0, 0xe8, 0x17, 0x6f, 0x1d, 0xaf, 0x3e, + 0x30, 0x74, 0x6f, 0xe8, 0x7f, 0xbc, 0xbe, 0xeb, 0x7e, 0x10, 0xb8, 0xd8, 0xfc, 0x21, 0x7f, 0xf1, + 0x7d, 0x60, 0xb3, 0x80, 0xd9, 0x17, 0xef, 0xe3, 0x4b, 0x49, 0x3b, 0x50, 0xd2, 0x18, 0xb4, 0x18, + 0x81, 0xc0, 0xf4, 0xd7, 0x30, 0xed, 0xe3, 0x4d, 0xf8, 0xed, 0xd3, 0x77, 0xf3, 0x27, 0xb6, 0x8c, + 0x8b, 0xe8, 0x78, 0x50, 0x8d, 0x43, 0x8c, 0xae, 0xa7, 0xe9, 0xf2, 0xcd, 0xbd, 0xbc, 0xbe, 0xef, + 0x56, 0xff, 0xcb, 0x9a, 0xde, 0x9c, 0xb8, 0x85, 0x0d, 0xf2, 0x55, 0x3c, 0x2f, 0x20, 0x64, 0xf5, + 0x42, 0x56, 0x1e, 0xcf, 0xaa, 0xd7, 0x3d, 0x5f, 0xad, 0xff, 0x32, 0xf8, 0x9a, 0xe1, 0xdb, 0xca, + 0xeb, 0x51, 0x68, 0xf3, 0xf4, 0x89, 0x98, 0xf2, 0x70, 0xc8, 0xd2, 0x9f, 0x66, 0x26, 0xc9, 0xc2, + 0x2f, 0xb6, 0x4c, 0x8e, 0xe2, 0xd5, 0x5c, 0xa5, 0x86, 0x62, 0xcd, 0xb6, 0xc3, 0x82, 0x69, 0xdb, + 0x83, 0xbf, 0x9b, 0x6e, 0xa1, 0xce, 0x5f, 0x59, 0xe0, 0x31, 0x6e, 0x84, 0x3d, 0x66, 0x39, 0x1d, + 0xc7, 0x2a, 0x8c, 0xa6, 0x4d, 0x7f, 0x84, 0xb1, 0x05, 0xee, 0x3f, 0x7a, 0xd3, 0xef, 0x2e, 0x74, + 0x7d, 0x9b, 0x6d, 0x5b, 0xc1, 0x8a, 0xf8, 0x75, 0xcb, 0xc7, 0xe2, 0x26, 0x7a, 0x22, 0x09, 0xdd, + 0x6c, 0xe2, 0xc6, 0xf8, 0x6b, 0x1c, 0xc3, 0x11, 0xcc, 0xd0, 0xa4, 0x33, 0x31, 0xe9, 0x8c, 0x6b, + 0x31, 0xb3, 0x1a, 0x3c, 0x97, 0x66, 0x3f, 0x77, 0xe5, 0xc4, 0x8b, 0xbf, 0x45, 0x36, 0x9e, 0x3e, + 0xf1, 0xbb, 0x2f, 0xca, 0x95, 0x26, 0x57, 0xc6, 0xec, 0x84, 0x85, 0x69, 0xdc, 0xf2, 0x7b, 0x86, + 0xcb, 0xde, 0x98, 0x3b, 0x98, 0xaf, 0xdc, 0x74, 0x3c, 0x16, 0x14, 0x3a, 0x7e, 0x50, 0x98, 0x34, + 0x3b, 0x3f, 0x8d, 0x1f, 0x3d, 0xd3, 0xb3, 0x0b, 0x22, 0x14, 0x17, 0x73, 0x12, 0x4b, 0xab, 0x16, + 0x32, 0x2a, 0x85, 0xf8, 0xe4, 0x56, 0x95, 0x21, 0x94, 0x65, 0x07, 0x65, 0x99, 0x41, 0x6a, 0xf2, + 0x0b, 0xd2, 0xac, 0xaa, 0x31, 0x09, 0x86, 0xc5, 0xa7, 0x75, 0x61, 0x23, 0x1e, 0x5c, 0xc8, 0x43, + 0xc5, 0x86, 0xb1, 0x93, 0xc5, 0x87, 0xd5, 0x63, 0xb1, 0xfc, 0xdc, 0xf3, 0xbf, 0x59, 0x70, 0x3f, + 0xdb, 0x9e, 0x5c, 0xf4, 0x89, 0x57, 0x3c, 0xa7, 0xd8, 0xf3, 0xcd, 0x3f, 0xd5, 0xf4, 0xde, 0x67, + 0xee, 0xbb, 0x38, 0xfd, 0x3a, 0x63, 0xe4, 0x57, 0x16, 0xef, 0x7c, 0xe6, 0x4d, 0xab, 0x85, 0x4f, + 0x2e, 0x3c, 0xfd, 0x6a, 0x4f, 0x33, 0xf5, 0x28, 0x95, 0x85, 0x7f, 0xd8, 0xe0, 0x39, 0x66, 0xaa, + 0x06, 0xac, 0xea, 0x84, 0x2d, 0x5e, 0x20, 0xb6, 0xb5, 0xc7, 0xb6, 0xea, 0x39, 0xeb, 0x5d, 0xa5, + 0x08, 0x6e, 0x9e, 0x17, 0xeb, 0xc2, 0xd0, 0xb4, 0x4b, 0xd7, 0x3f, 0xcb, 0x52, 0xef, 0xaf, 0x7b, + 0x96, 0xcd, 0x8e, 0x7e, 0xab, 0x63, 0x8f, 0xe3, 0xc8, 0x37, 0x0f, 0x8b, 0xa8, 0x93, 0x16, 0x76, + 0xca, 0xc2, 0x4e, 0x78, 0xeb, 0xb0, 0xc9, 0x71, 0xff, 0x36, 0xaa, 0x28, 0x9a, 0x76, 0xd7, 0xf1, + 0xe2, 0x2e, 0x65, 0x44, 0x9d, 0x3a, 0x77, 0x55, 0x3c, 0x34, 0x2d, 0xed, 0x12, 0x4d, 0x63, 0x2d, + 0x28, 0x64, 0x0c, 0x4b, 0xe3, 0xa8, 0xfd, 0x6a, 0x48, 0x1a, 0x5b, 0xa5, 0x97, 0x54, 0xe3, 0x45, + 0x54, 0xf7, 0x98, 0xea, 0xfa, 0x06, 0x30, 0xd8, 0xe0, 0x05, 0x5e, 0x9d, 0x97, 0x57, 0x16, 0x18, + 0xae, 0xf9, 0xce, 0x02, 0xc3, 0xe9, 0xc4, 0xb7, 0x83, 0xc5, 0x0b, 0x61, 0x0a, 0x30, 0x85, 0xc5, + 0x20, 0x38, 0x22, 0x10, 0x23, 0x60, 0x1d, 0x11, 0x93, 0x88, 0xf1, 0x9e, 0x69, 0xb1, 0x31, 0xa1, + 0xb3, 0x39, 0xb1, 0x62, 0xf4, 0x7d, 0x73, 0xbf, 0x1b, 0xfc, 0x65, 0xc8, 0x61, 0x4a, 0x7d, 0x20, + 0x24, 0x13, 0x4b, 0xc9, 0xc3, 0x52, 0xb2, 0xb0, 0x98, 0x1c, 0x2c, 0xe7, 0x20, 0x9c, 0x8e, 0x11, + 0xaf, 0x06, 0xc0, 0x8c, 0x99, 0x19, 0x71, 0x34, 0x78, 0xb8, 0x84, 0xfd, 0x72, 0x09, 0xb1, 0xde, + 0x41, 0x9f, 0x4c, 0x8a, 0xa3, 0x18, 0x1f, 0x15, 0x7b, 0x0f, 0x4b, 0x6c, 0x79, 0x47, 0x42, 0xbb, + 0x90, 0xda, 0x87, 0x32, 0x7d, 0x49, 0x47, 0xf0, 0x3a, 0x85, 0x37, 0x6f, 0x7e, 0x8a, 0x2d, 0x56, + 0x25, 0xde, 0x15, 0x95, 0x72, 0xf5, 0xb4, 0x7a, 0x76, 0x74, 0x52, 0x3d, 0x4d, 0xb0, 0x4f, 0x88, + 0xb4, 0x9b, 0x27, 0x0d, 0x1e, 0x58, 0xe4, 0x9d, 0x66, 0x89, 0x77, 0x97, 0xe1, 0x87, 0xf7, 0xc8, + 0x0f, 0xdb, 0x03, 0x1e, 0x33, 0x3d, 0xdb, 0xe0, 0x4e, 0xac, 0xdd, 0xdc, 0xd3, 0xdd, 0xa7, 0xf1, + 0xa0, 0x8c, 0xb3, 0xc0, 0x8b, 0xed, 0x92, 0x8b, 0x8f, 0x8f, 0xf6, 0xdf, 0xd5, 0x9f, 0xc6, 0xe0, + 0x8f, 0xca, 0xe4, 0x8f, 0xd6, 0xe8, 0x8f, 0x4f, 0x73, 0x7f, 0xfc, 0xf2, 0xf8, 0xf8, 0xf1, 0xf1, + 0xd1, 0xfe, 0xc7, 0xaf, 0xff, 0xf9, 0xcb, 0xbf, 0xfe, 0xf7, 0xcf, 0xc7, 0xc7, 0x7f, 0x3c, 0x3e, + 0x1a, 0x4f, 0x73, 0x9f, 0xf8, 0xb5, 0xb8, 0x1b, 0xdb, 0xf4, 0xff, 0x92, 0xca, 0x9e, 0x16, 0xae, + 0x83, 0x85, 0xc2, 0x42, 0x91, 0x3c, 0xe5, 0x2f, 0x79, 0x8a, 0xf5, 0xe6, 0x8d, 0xc8, 0x1b, 0x36, + 0x70, 0x05, 0x7b, 0xe4, 0x0a, 0x62, 0xbf, 0x3b, 0x12, 0xf3, 0x1d, 0x11, 0xb9, 0x39, 0x2c, 0xb2, + 0xe1, 0x5f, 0x62, 0x63, 0x3f, 0x66, 0x34, 0x44, 0xf2, 0xb4, 0x8b, 0xe4, 0xbd, 0xd7, 0xf7, 0xd0, + 0x30, 0x6d, 0x3b, 0x60, 0xa1, 0x80, 0x0d, 0xcc, 0x5d, 0x05, 0x23, 0x80, 0x11, 0x88, 0xcf, 0x0b, + 0xfd, 0x29, 0xd8, 0x2f, 0x7f, 0x96, 0x8c, 0x73, 0xd3, 0xe8, 0xd4, 0x8c, 0xcf, 0x4f, 0x83, 0x44, + 0xeb, 0xd3, 0xfc, 0xdf, 0x7f, 0xfd, 0x7f, 0x7e, 0xfd, 0xcf, 0xdd, 0x64, 0x56, 0x61, 0x8f, 0xc5, + 0x38, 0x80, 0x65, 0x1a, 0x2b, 0x87, 0x1f, 0x87, 0x95, 0xc1, 0xca, 0xc6, 0xfd, 0xfc, 0x62, 0xf6, + 0x5f, 0x58, 0xac, 0xda, 0x63, 0x02, 0x35, 0xc6, 0xf2, 0xa5, 0x39, 0x97, 0xa0, 0x39, 0xd3, 0xd5, + 0xc8, 0xca, 0xab, 0xfa, 0x3c, 0x80, 0x78, 0x27, 0xe4, 0x8e, 0x25, 0x40, 0x3e, 0x33, 0xd7, 0x64, + 0x60, 0xf3, 0x36, 0x3c, 0xb2, 0x8c, 0x47, 0x8e, 0xbd, 0x69, 0xdb, 0x76, 0x42, 0xcb, 0xf7, 0xb8, + 0xe3, 0xf5, 0x1d, 0xfe, 0x3e, 0xd2, 0x9d, 0x85, 0xb7, 0x6f, 0xaf, 0x68, 0x43, 0x6c, 0x63, 0x75, + 0x29, 0x8d, 0x1b, 0xab, 0x85, 0xde, 0xf5, 0xce, 0xc9, 0xa6, 0x6a, 0x91, 0x17, 0xb5, 0x69, 0x5f, + 0x0f, 0x14, 0x7e, 0xf1, 0x5a, 0x7a, 0xd1, 0x44, 0x86, 0xdc, 0xa5, 0x09, 0x3e, 0xba, 0x30, 0xd9, + 0xc5, 0x94, 0x78, 0x21, 0x27, 0xfe, 0x48, 0xc6, 0x18, 0xc5, 0xa2, 0xe3, 0x19, 0xcf, 0x81, 0x6f, + 0xda, 0x96, 0x19, 0x72, 0xa3, 0xf7, 0x9d, 0x87, 0xe2, 0x8e, 0x64, 0xb9, 0x09, 0xf8, 0x11, 0xf8, + 0x91, 0x84, 0xfc, 0xc8, 0xf8, 0x18, 0x68, 0xa1, 0x82, 0xc8, 0x12, 0x05, 0x90, 0x25, 0x0b, 0x14, + 0x4b, 0xbc, 0xfd, 0xae, 0x52, 0x80, 0x58, 0xb5, 0x70, 0x8b, 0x62, 0x81, 0x61, 0x8a, 0xd2, 0xb5, + 0x32, 0xe5, 0x73, 0x54, 0x0a, 0x06, 0x53, 0x75, 0x19, 0x5d, 0x41, 0x60, 0x92, 0x5e, 0xd4, 0x54, + 0x5c, 0x20, 0xe1, 0xc8, 0x34, 0x40, 0x54, 0x33, 0xb0, 0xe5, 0x62, 0x52, 0x74, 0x31, 0xa2, 0x11, + 0xa2, 0x51, 0xb2, 0xd1, 0x48, 0xe8, 0x68, 0x20, 0x89, 0xa3, 0x80, 0x10, 0x8d, 0x10, 0x8d, 0x36, + 0x76, 0x99, 0xea, 0x51, 0x3b, 0x88, 0x41, 0x51, 0x0c, 0x62, 0x41, 0xe0, 0x07, 0x72, 0x11, 0x68, + 0x7c, 0x29, 0xe2, 0x0f, 0xe2, 0x0f, 0xe2, 0x0f, 0xe2, 0x0f, 0xe2, 0x0f, 0xe2, 0x8f, 0x78, 0xfc, + 0xe9, 0xf6, 0x5d, 0xee, 0xa8, 0xa9, 0x73, 0x0b, 0x4d, 0x20, 0x1e, 0x21, 0x1e, 0x41, 0x9d, 0x43, + 0x3c, 0x82, 0x3a, 0x87, 0xc8, 0xa4, 0x12, 0x99, 0x7c, 0x8b, 0x33, 0xc9, 0x88, 0x34, 0xbe, 0x14, + 0x91, 0x08, 0x91, 0x08, 0x91, 0x08, 0x91, 0x08, 0x91, 0x08, 0x91, 0x48, 0x25, 0x12, 0xf5, 0x3d, + 0xc5, 0x0c, 0x69, 0xae, 0x01, 0x44, 0x25, 0x44, 0x25, 0x44, 0x25, 0x44, 0x25, 0x44, 0x25, 0x44, + 0x25, 0xb5, 0xa8, 0xf4, 0xdd, 0xf3, 0xff, 0xf2, 0x8c, 0x5e, 0xe0, 0x73, 0x5f, 0x36, 0x2e, 0xcd, + 0x35, 0x81, 0xc8, 0x84, 0xc8, 0x94, 0x6c, 0x64, 0xc2, 0x4a, 0x12, 0x22, 0x13, 0x56, 0x92, 0x72, + 0x10, 0x8f, 0xfc, 0x3e, 0x57, 0xde, 0xe8, 0xbd, 0xa2, 0x0d, 0x44, 0x24, 0x44, 0x24, 0xe4, 0x4a, + 0x88, 0x48, 0xc8, 0x95, 0x10, 0x9b, 0x94, 0x62, 0x93, 0xfc, 0x56, 0xef, 0xb9, 0xab, 0x11, 0x8f, + 0x10, 0x8f, 0x90, 0x21, 0x21, 0x1e, 0x21, 0x43, 0x42, 0x14, 0x92, 0x88, 0x42, 0xb2, 0x9b, 0xbd, + 0x67, 0xae, 0x45, 0x04, 0x42, 0x04, 0x42, 0x04, 0x42, 0x04, 0x42, 0x04, 0x42, 0x04, 0x92, 0x88, + 0x40, 0xaa, 0xdb, 0xbd, 0x57, 0xb4, 0x81, 0x88, 0x84, 0x88, 0x04, 0x8d, 0x0e, 0x11, 0x09, 0x1a, + 0x1d, 0x62, 0x93, 0x52, 0x6c, 0x92, 0xdd, 0xf0, 0x3d, 0x73, 0x2d, 0x62, 0x11, 0x62, 0x11, 0x62, + 0x11, 0x62, 0x11, 0x62, 0x11, 0x62, 0x91, 0x52, 0x2c, 0x52, 0xdb, 0xf2, 0xbd, 0xd4, 0x02, 0xe2, + 0x12, 0xe2, 0x12, 0xe2, 0x12, 0xe2, 0x12, 0xe2, 0x12, 0xe2, 0x92, 0xc4, 0x27, 0xb6, 0x15, 0x76, + 0xae, 0x79, 0x9e, 0xcf, 0x47, 0x47, 0xb4, 0xc4, 0xaa, 0xef, 0x1c, 0x5a, 0xaf, 0xac, 0x6b, 0xf6, + 0xa2, 0x33, 0xc5, 0x18, 0xef, 0x18, 0xd3, 0x53, 0xc5, 0x0e, 0x97, 0x0f, 0x18, 0x8b, 0x4e, 0x17, + 0x8b, 0x5d, 0x26, 0x7c, 0xf4, 0x3d, 0x3c, 0xe8, 0x5b, 0x7c, 0x7c, 0xa2, 0x56, 0xf1, 0xba, 0xde, + 0xfa, 0x7c, 0x1d, 0x35, 0xdd, 0x9e, 0xfe, 0xd8, 0x1c, 0x7c, 0xc9, 0xf4, 0xef, 0xed, 0xe6, 0xf4, + 0x4b, 0x34, 0x54, 0x47, 0xe7, 0x71, 0x5c, 0x6b, 0xe4, 0x4e, 0x87, 0x9f, 0xc6, 0x19, 0x15, 0x38, + 0xa3, 0x62, 0xd2, 0xcf, 0x36, 0xf3, 0xb8, 0xc3, 0xdf, 0x05, 0xcf, 0xf8, 0x8b, 0xe1, 0xfa, 0x8a, + 0xd7, 0xe3, 0xa6, 0x2f, 0xcc, 0x90, 0xc9, 0xbc, 0xce, 0x31, 0x39, 0x84, 0x70, 0x38, 0x65, 0x55, + 0x3b, 0xee, 0x40, 0xec, 0x5f, 0xd6, 0x74, 0xf4, 0x60, 0x02, 0x6d, 0x39, 0x26, 0x2f, 0xde, 0x59, + 0x83, 0x42, 0x67, 0x0c, 0x0a, 0x9d, 0x2d, 0x18, 0xef, 0x4c, 0xc1, 0x75, 0xcf, 0x17, 0xd3, 0xf3, + 0xca, 0x7b, 0xdc, 0xe2, 0xc6, 0x73, 0x1e, 0x64, 0xdc, 0xeb, 0xea, 0xa9, 0xb1, 0x3c, 0xac, 0xf3, + 0xbf, 0x59, 0xe8, 0x80, 0x6d, 0x0f, 0x2e, 0xfa, 0xc0, 0x2b, 0x1e, 0x53, 0xe8, 0xf1, 0xe6, 0x1f, + 0x6a, 0x7a, 0xeb, 0x33, 0xb7, 0x5d, 0x74, 0x5d, 0xbb, 0xb7, 0x74, 0xb3, 0xd3, 0xe3, 0x5d, 0x07, + 0xff, 0xba, 0xf0, 0x90, 0xab, 0x8f, 0xba, 0x58, 0xeb, 0xc8, 0x37, 0x39, 0xee, 0x69, 0x6e, 0x68, + 0x19, 0x2b, 0xbe, 0x2a, 0x8e, 0x77, 0x8e, 0xed, 0x8d, 0x63, 0x7b, 0xdf, 0x39, 0x6f, 0x3b, 0xb9, + 0x31, 0xc1, 0x89, 0xb0, 0xee, 0x50, 0x89, 0xa2, 0x35, 0xe9, 0xa5, 0x35, 0x4f, 0x33, 0x4d, 0x58, + 0x86, 0x9f, 0x5b, 0xe7, 0x40, 0x36, 0x9e, 0x36, 0xb2, 0x35, 0xa6, 0xc6, 0x89, 0xa5, 0x31, 0x86, + 0x46, 0x34, 0x80, 0x0a, 0x07, 0x4e, 0xe1, 0x80, 0x19, 0x6f, 0xe8, 0xe4, 0x9c, 0xf6, 0xb6, 0x73, + 0x42, 0x8a, 0xd6, 0xab, 0x19, 0x86, 0x4e, 0x68, 0x38, 0x02, 0xa7, 0x7d, 0xcd, 0x5c, 0x93, 0x01, + 0x9c, 0xda, 0x3e, 0x15, 0x32, 0xca, 0x54, 0x5b, 0xa7, 0xca, 0xae, 0xc0, 0x2a, 0x1d, 0x27, 0xa7, + 0x4e, 0x67, 0xa9, 0x21, 0x96, 0x27, 0x2c, 0x5e, 0x88, 0x39, 0x8e, 0x39, 0xae, 0x38, 0x49, 0x0a, + 0x69, 0x3a, 0x4f, 0x95, 0x79, 0xe6, 0xb3, 0x2b, 0x72, 0xba, 0xe3, 0xe4, 0x82, 0x6d, 0x67, 0x52, + 0xb1, 0x8e, 0xd9, 0x77, 0x87, 0xc3, 0x36, 0x18, 0x6d, 0xd8, 0x0d, 0xec, 0x66, 0xb9, 0xc7, 0x9f, + 0x7d, 0xdf, 0x65, 0xa6, 0xd0, 0xf9, 0xc3, 0x65, 0x0d, 0x36, 0xf0, 0xca, 0x5c, 0xd7, 0x1f, 0x9e, + 0x28, 0x15, 0xc4, 0xb7, 0x83, 0xd9, 0x8b, 0x30, 0xb9, 0x31, 0xb9, 0x97, 0x7a, 0xbc, 0xef, 0x78, + 0x1c, 0x87, 0x9e, 0x12, 0xae, 0xbe, 0xe0, 0xd0, 0x53, 0x6d, 0xbd, 0x93, 0xe6, 0x43, 0x4f, 0xfb, + 0xbd, 0x5e, 0xc0, 0xc2, 0xd0, 0xe0, 0xee, 0x9b, 0x61, 0xda, 0x6f, 0x2c, 0xe0, 0x4e, 0xc8, 0xc6, + 0xd6, 0x1f, 0xf7, 0x10, 0xd4, 0xf5, 0x6d, 0xc0, 0x75, 0xc3, 0x75, 0x67, 0x67, 0x31, 0xe0, 0xe6, + 0xe6, 0xaa, 0xd1, 0x6e, 0xdd, 0xfc, 0x33, 0xee, 0x30, 0x0d, 0xdd, 0x4b, 0x28, 0xb4, 0x9a, 0x2f, + 0xe8, 0xf7, 0x26, 0x77, 0xd6, 0xb8, 0x7f, 0x68, 0xb5, 0xaf, 0xea, 0xcd, 0xcb, 0x87, 0xeb, 0x46, + 0xeb, 0xfa, 0xfe, 0xae, 0xa8, 0xc3, 0x35, 0x4b, 0xde, 0x5b, 0xf3, 0x8f, 0x66, 0xab, 0x7e, 0xdb, + 0xbe, 0xac, 0x35, 0x6a, 0x17, 0xd7, 0x37, 0xd7, 0xad, 0xeb, 0x7a, 0x33, 0x85, 0xb7, 0x97, 0xd2, + 0xce, 0xbb, 0xfc, 0x5a, 0x6b, 0x36, 0xaf, 0x9b, 0xed, 0xeb, 0xab, 0x34, 0xdd, 0xd5, 0x6d, 0xed, + 0xae, 0xf6, 0xa5, 0x7e, 0x5b, 0xbf, 0x6b, 0xb5, 0x6b, 0x57, 0x57, 0x0f, 0xf5, 0x66, 0xaa, 0x46, + 0x74, 0x68, 0x0c, 0xe9, 0xea, 0xb0, 0xf1, 0x24, 0xbb, 0xab, 0xdd, 0xd6, 0xa9, 0xf7, 0x3e, 0x3d, + 0x69, 0xf6, 0xdf, 0xb1, 0x16, 0x12, 0x67, 0x41, 0x36, 0xf6, 0x1a, 0xe1, 0x2c, 0xf2, 0x89, 0x5f, + 0x14, 0x6b, 0x81, 0x51, 0x11, 0x7e, 0xde, 0x43, 0xce, 0xba, 0x86, 0xcd, 0x42, 0x2b, 0x70, 0x7a, + 0xb1, 0x36, 0x82, 0x4c, 0xa1, 0x67, 0xf9, 0x5a, 0xc0, 0x0e, 0x60, 0x87, 0x42, 0xa0, 0x8f, 0xf1, + 0xd9, 0x1b, 0xe6, 0xbd, 0x0c, 0xd7, 0x88, 0x91, 0xa9, 0xe6, 0x2b, 0x53, 0xad, 0x1c, 0x23, 0x31, + 0x9d, 0xf5, 0xcd, 0xe3, 0x7d, 0x0c, 0x62, 0x4e, 0x79, 0xc3, 0xbe, 0x19, 0x78, 0x63, 0x78, 0x63, + 0x78, 0x63, 0x78, 0x63, 0x78, 0xe3, 0x98, 0xff, 0x42, 0xbc, 0x85, 0xcf, 0xef, 0x31, 0x6f, 0xb4, + 0x75, 0x69, 0xe8, 0x21, 0x0e, 0x87, 0xff, 0xb7, 0x71, 0x2f, 0x53, 0x61, 0x79, 0x53, 0xdb, 0x7d, + 0xd4, 0xc8, 0x8d, 0x6b, 0xf7, 0xda, 0xc3, 0xff, 0x1b, 0x3b, 0xea, 0xb8, 0xbb, 0xf4, 0x56, 0xec, + 0x23, 0x9b, 0x6e, 0xae, 0xdb, 0xbe, 0xfb, 0x6a, 0xe6, 0xb3, 0xd8, 0x81, 0x95, 0x9d, 0x1d, 0x58, + 0xd3, 0xfd, 0xa1, 0xb1, 0x91, 0x22, 0xce, 0x96, 0xd2, 0x18, 0x03, 0x0e, 0xa0, 0xc8, 0x02, 0x50, + 0x6c, 0x9b, 0x40, 0xd1, 0x07, 0xb7, 0xec, 0xd2, 0x5c, 0x3b, 0x40, 0x5b, 0x3d, 0x9d, 0xc4, 0x94, + 0x12, 0x9e, 0x5a, 0x32, 0x53, 0x4c, 0x61, 0xaa, 0xc9, 0x4e, 0x39, 0xe5, 0xa9, 0xa7, 0x3c, 0x05, + 0xd5, 0xa6, 0xa2, 0x60, 0x5c, 0x8f, 0x39, 0x66, 0x71, 0xa7, 0x68, 0x74, 0x41, 0xdc, 0x2d, 0x48, + 0x6b, 0x47, 0x3a, 0xde, 0x96, 0xa4, 0xe5, 0x1b, 0x15, 0xda, 0xa2, 0x44, 0x45, 0x6e, 0xa2, 0x36, + 0xa0, 0x62, 0x0b, 0x04, 0x36, 0xa1, 0x6a, 0x1b, 0x64, 0x36, 0x42, 0x66, 0x2b, 0x34, 0x36, 0x23, + 0x66, 0x3b, 0x12, 0xe9, 0x44, 0x41, 0xea, 0x75, 0xe1, 0xa5, 0x11, 0x8f, 0xbf, 0xc5, 0x6a, 0xad, + 0x73, 0x2f, 0x6b, 0x7a, 0xc7, 0x52, 0x24, 0xb7, 0x8a, 0xa5, 0xb2, 0xac, 0xed, 0x84, 0x18, 0x72, + 0x0b, 0xcc, 0x1b, 0xe6, 0x9d, 0x45, 0xf3, 0x36, 0x43, 0x36, 0x7d, 0xff, 0xca, 0x88, 0xb7, 0x61, + 0x61, 0xad, 0xa5, 0x9f, 0x4a, 0x5c, 0xdb, 0x88, 0x12, 0x67, 0xcb, 0x70, 0x3a, 0x9f, 0x66, 0xde, + 0x05, 0x5b, 0xf8, 0xc5, 0xf8, 0xef, 0x43, 0x5b, 0xd4, 0xe5, 0x51, 0x48, 0x41, 0x46, 0xf0, 0xed, + 0x6b, 0x21, 0x41, 0x61, 0xd5, 0x2b, 0x73, 0x87, 0x42, 0xec, 0x1d, 0x53, 0x75, 0x58, 0xf5, 0x6a, + 0xdd, 0x46, 0x29, 0x42, 0xbc, 0x4f, 0xe3, 0xd4, 0x5e, 0x11, 0xf2, 0xdf, 0x32, 0x7e, 0x3b, 0xd5, + 0x35, 0x56, 0x90, 0x8a, 0xec, 0xc6, 0x82, 0xe5, 0xab, 0xad, 0xb8, 0xcc, 0xec, 0x88, 0x39, 0x53, + 0x19, 0x27, 0x1a, 0x39, 0xcf, 0x8f, 0x1f, 0xc7, 0xc6, 0x7f, 0x18, 0xdf, 0x3d, 0x12, 0x19, 0x26, + 0x73, 0x5e, 0x5e, 0x9f, 0xa5, 0xaa, 0x97, 0x4f, 0x2f, 0xd5, 0xac, 0x16, 0x54, 0x60, 0xa2, 0x50, + 0x0b, 0x16, 0x27, 0xac, 0x42, 0x36, 0x30, 0x69, 0x41, 0x2e, 0x23, 0x28, 0x23, 0x23, 0x40, 0x46, + 0xa0, 0x2b, 0x23, 0x10, 0x35, 0x87, 0xa9, 0xde, 0x6b, 0xf6, 0xcc, 0x67, 0xc7, 0x75, 0xb8, 0xc3, + 0x42, 0xf9, 0x31, 0x8b, 0x54, 0xe0, 0xd9, 0xd6, 0x3e, 0x28, 0xd5, 0x9b, 0x2a, 0x4b, 0x5e, 0x2e, + 0xea, 0xfd, 0x29, 0xcd, 0x87, 0xd0, 0x8c, 0xa8, 0xcc, 0x89, 0xdc, 0xac, 0xc8, 0xcd, 0x8b, 0xd6, + 0xcc, 0xe4, 0xcc, 0x4d, 0xd2, 0xec, 0x94, 0xcd, 0x6f, 0xd9, 0x0c, 0xdf, 0xd5, 0x47, 0x7a, 0xc9, + 0x18, 0xdf, 0x55, 0x87, 0x5a, 0xcd, 0x24, 0x95, 0x23, 0x9a, 0x0e, 0x13, 0xd5, 0x60, 0xaa, 0xd4, + 0x26, 0xab, 0xcd, 0x74, 0xb5, 0x99, 0xb0, 0x1e, 0x53, 0x56, 0x33, 0x69, 0x45, 0xd3, 0x26, 0x33, + 0xf1, 0xa9, 0xa9, 0x8b, 0xad, 0xb0, 0xc6, 0x37, 0x77, 0x51, 0x15, 0x28, 0x01, 0x93, 0x27, 0x37, + 0x7d, 0x1d, 0x2e, 0x40, 0xa3, 0x2b, 0xd0, 0xe5, 0x12, 0xb4, 0xbb, 0x06, 0xed, 0x2e, 0x42, 0xaf, + 0xab, 0xa0, 0x71, 0x19, 0x44, 0xae, 0x63, 0xfa, 0xa8, 0x72, 0xc2, 0xf0, 0xd6, 0x76, 0xa5, 0x85, + 0xe3, 0x48, 0x89, 0x89, 0x7e, 0x3a, 0x9c, 0x25, 0xf8, 0xe9, 0x5f, 0xde, 0x0f, 0x49, 0xbd, 0x4b, + 0x41, 0x41, 0x83, 0xbe, 0x9b, 0xdc, 0x73, 0xf4, 0x53, 0xfb, 0x72, 0xe6, 0x9e, 0xa7, 0x7f, 0x79, + 0x17, 0x92, 0xab, 0xf5, 0xcf, 0x24, 0x82, 0x59, 0x24, 0xb7, 0x9c, 0xb9, 0x5d, 0xd8, 0x10, 0x5f, + 0xe6, 0xdc, 0x16, 0x37, 0x4a, 0x88, 0x1b, 0x88, 0x1b, 0x88, 0x1b, 0x34, 0x73, 0x56, 0x7a, 0xb9, + 0x77, 0xeb, 0x8c, 0x15, 0x5f, 0xae, 0x88, 0x0d, 0x8e, 0xa7, 0x84, 0x6d, 0xce, 0x2c, 0x77, 0x8c, + 0xca, 0xa1, 0x8a, 0x2f, 0x06, 0xa7, 0xdb, 0xaf, 0x8f, 0x6a, 0x9e, 0x92, 0x3b, 0xf6, 0x75, 0xa5, + 0x54, 0x53, 0x95, 0x11, 0x54, 0xe0, 0xd9, 0xe1, 0xd9, 0xf7, 0xd4, 0xb3, 0x53, 0x89, 0x0a, 0x51, + 0x83, 0xb2, 0x7b, 0x62, 0x63, 0x5b, 0x82, 0xdc, 0x9e, 0xd9, 0x84, 0xb1, 0x51, 0x1b, 0x3e, 0xea, + 0x74, 0x36, 0x09, 0x38, 0x1d, 0xdd, 0xce, 0x27, 0x31, 0x27, 0x94, 0x98, 0x33, 0x4a, 0xc6, 0x29, + 0xd1, 0x3a, 0x27, 0x62, 0x27, 0xa5, 0x0f, 0x43, 0x97, 0x66, 0xbc, 0xfc, 0xa6, 0xe3, 0xd8, 0xf4, + 0x52, 0x3e, 0x48, 0xe7, 0x80, 0x11, 0x0e, 0x16, 0xad, 0x4a, 0xa0, 0x53, 0x2d, 0x80, 0xfb, 0x87, + 0xfb, 0x87, 0xfb, 0x87, 0xfb, 0x97, 0x2a, 0x9f, 0x27, 0x1d, 0x02, 0x8e, 0x35, 0xb4, 0x2d, 0x55, + 0x9e, 0x4f, 0xba, 0xa3, 0x86, 0xe5, 0xfc, 0x16, 0xab, 0xd3, 0xfd, 0xa1, 0xcb, 0xc8, 0x24, 0x8a, + 0x01, 0x8a, 0xfe, 0xf7, 0xb7, 0xb6, 0x96, 0xe7, 0xfa, 0xad, 0x55, 0xbf, 0xa9, 0x37, 0xbe, 0xde, + 0xdf, 0xd5, 0x8b, 0xda, 0xbe, 0xef, 0xe7, 0x87, 0xac, 0x77, 0xd2, 0xc3, 0xfd, 0xb7, 0x56, 0xfd, + 0x01, 0x3d, 0xb4, 0xbe, 0x87, 0xae, 0xee, 0x2f, 0x9b, 0xd7, 0xcd, 0xf6, 0x65, 0xed, 0xe2, 0xa6, + 0xde, 0xbe, 0xaa, 0xff, 0xf3, 0xfa, 0x12, 0x13, 0x6a, 0x43, 0x77, 0x35, 0x5b, 0xb5, 0xd6, 0xf5, + 0xfd, 0x5d, 0xfb, 0xfe, 0xee, 0xe6, 0x0f, 0xf4, 0xd3, 0x86, 0x7e, 0x6a, 0xff, 0xf3, 0xa6, 0x76, + 0x87, 0x1e, 0x5a, 0xdf, 0x43, 0xf7, 0xad, 0xaf, 0xf0, 0x4c, 0x9b, 0x3a, 0xe8, 0x12, 0x53, 0x68, + 0x4b, 0x0f, 0xdd, 0xd6, 0x2e, 0xdb, 0x17, 0x0f, 0xd7, 0x57, 0x5f, 0xe0, 0xb2, 0x37, 0x31, 0x40, + 0xbd, 0x51, 0xaf, 0x81, 0x02, 0x36, 0xc3, 0xe4, 0xef, 0xf7, 0xed, 0x61, 0xc1, 0xde, 0xc1, 0x94, + 0x7a, 0xa8, 0xdf, 0xd4, 0x10, 0xdc, 0x36, 0xf4, 0xd6, 0xef, 0x37, 0xb5, 0xbb, 0x76, 0xed, 0xf2, + 0xb2, 0xde, 0x6c, 0xb6, 0x1b, 0xf7, 0xd7, 0x77, 0x2d, 0x8d, 0x9d, 0xa5, 0xa5, 0xe5, 0xa7, 0xb4, + 0xa7, 0xfb, 0xd8, 0x34, 0x27, 0xd4, 0x6e, 0x12, 0x9b, 0xe6, 0x28, 0xd7, 0xdf, 0x0b, 0xc9, 0xec, + 0x99, 0x5b, 0x71, 0x7a, 0xea, 0xee, 0xe6, 0xd1, 0x6e, 0x77, 0x7c, 0x6f, 0x3f, 0xab, 0x38, 0x76, + 0x53, 0x42, 0xa5, 0xc8, 0xb7, 0xb6, 0x26, 0x53, 0xaa, 0x7c, 0x7b, 0xa3, 0x12, 0xa5, 0xcc, 0xb7, + 0x36, 0x2a, 0x54, 0xea, 0x5c, 0xf7, 0x78, 0x12, 0x7b, 0x92, 0x24, 0x3c, 0x48, 0x91, 0x64, 0x6f, + 0x91, 0x66, 0x9f, 0xa1, 0xe6, 0x2d, 0x7e, 0x66, 0xe4, 0x15, 0x2f, 0xa2, 0xd9, 0xa3, 0x6d, 0xd6, + 0xa8, 0xbc, 0x63, 0xa8, 0x67, 0x8a, 0xc8, 0xcd, 0x0b, 0xf1, 0x51, 0x95, 0x18, 0x51, 0xd5, 0x97, + 0x70, 0x68, 0x5e, 0xba, 0x21, 0x7b, 0xd5, 0xb5, 0x84, 0x57, 0x5d, 0x17, 0x02, 0x37, 0x5e, 0x75, + 0xdd, 0x2b, 0x3f, 0xa8, 0xfa, 0x72, 0x0a, 0xa5, 0x07, 0x54, 0x78, 0xe9, 0x24, 0x21, 0xdf, 0xd7, + 0x0f, 0xb9, 0xdf, 0x35, 0xb8, 0xfb, 0x46, 0xf1, 0xc6, 0xff, 0x4c, 0x63, 0x78, 0xe1, 0x1f, 0x5e, + 0x70, 0x4f, 0xbc, 0xa0, 0xf2, 0x0b, 0xff, 0xdc, 0x7d, 0xa3, 0x7b, 0xd3, 0x7f, 0xd0, 0x18, 0x5e, + 0xf1, 0x4f, 0xc0, 0x38, 0xa9, 0x8d, 0x54, 0x9b, 0xb1, 0x6a, 0x33, 0x5a, 0x3d, 0xc6, 0x9b, 0x0e, + 0xc1, 0x07, 0xaf, 0xf8, 0xa7, 0xc1, 0xf4, 0x75, 0xb8, 0x00, 0x8d, 0xae, 0x40, 0x97, 0x4b, 0xd0, + 0xee, 0x1a, 0xb4, 0xbb, 0x08, 0xbd, 0xae, 0x82, 0xc6, 0x65, 0x10, 0xb9, 0x0e, 0x5d, 0x1a, 0xa3, + 0x9e, 0x6c, 0x69, 0x8a, 0xec, 0x87, 0xdc, 0x7d, 0x4b, 0xf7, 0xab, 0xfd, 0xc3, 0x7b, 0x6d, 0xb9, + 0x6f, 0x61, 0xbb, 0xe5, 0xbe, 0xe5, 0xf0, 0x8d, 0x7e, 0xbf, 0xef, 0xd0, 0xc7, 0x89, 0x41, 0xa3, + 0x78, 0x9f, 0x1f, 0x41, 0x02, 0x41, 0x22, 0x95, 0x41, 0x02, 0xef, 0xf3, 0x2f, 0xbe, 0xcf, 0x3f, + 0x70, 0x58, 0xf9, 0x72, 0xea, 0x46, 0xd8, 0x7f, 0xe6, 0x94, 0xe3, 0x3c, 0xeb, 0xdc, 0xa3, 0xc6, + 0xe1, 0xe4, 0xe1, 0xe4, 0xe1, 0xe4, 0xe1, 0xe4, 0xb3, 0xe2, 0xe4, 0x23, 0xc7, 0x85, 0xda, 0x2d, + 0xdb, 0x46, 0x19, 0xb5, 0x5b, 0xe0, 0xe0, 0xe1, 0xe0, 0x53, 0xec, 0xe0, 0xc9, 0x6b, 0xb7, 0x50, + 0x4a, 0x01, 0x1a, 0x25, 0x01, 0x4d, 0xd4, 0xa8, 0x8d, 0x1e, 0x75, 0x3a, 0x99, 0x04, 0x9c, 0x8d, + 0x6e, 0xa7, 0x93, 0x98, 0xf3, 0x49, 0xcc, 0x09, 0x25, 0xe3, 0x8c, 0x68, 0x9d, 0x12, 0xb1, 0x73, + 0xd2, 0x47, 0xa1, 0x2b, 0x38, 0x25, 0x70, 0xbc, 0x17, 0x9d, 0xef, 0xeb, 0x9f, 0xed, 0x41, 0xc9, + 0x16, 0x1d, 0x8a, 0x41, 0x02, 0xca, 0x01, 0x62, 0x01, 0x62, 0x01, 0x62, 0x01, 0x62, 0x01, 0x62, + 0x01, 0x61, 0x2c, 0xd0, 0x1b, 0x04, 0xe0, 0xfd, 0xe1, 0xfd, 0xe1, 0xfd, 0xe1, 0xfd, 0xe9, 0x67, + 0xbc, 0xe3, 0xf1, 0xa3, 0x8a, 0x46, 0xe7, 0x7f, 0xa4, 0xa1, 0xe9, 0x07, 0xd3, 0x7b, 0x61, 0xda, + 0x4a, 0x5b, 0xe9, 0x7b, 0xb7, 0xbe, 0x78, 0xeb, 0x78, 0xda, 0x1c, 0xc0, 0x52, 0xd4, 0xfd, 0xa0, + 0xf7, 0x6b, 0x86, 0x05, 0xc6, 0x8a, 0x9f, 0x0a, 0x95, 0x72, 0xf5, 0xb4, 0x7a, 0x76, 0x74, 0x52, + 0x3d, 0xd3, 0xfc, 0x85, 0x9f, 0x03, 0xd3, 0xe2, 0x8e, 0xef, 0x5d, 0x39, 0x2f, 0xce, 0xf0, 0x75, + 0xd7, 0x52, 0x16, 0x2b, 0x37, 0x14, 0x6f, 0xcd, 0x1f, 0x89, 0xcd, 0x81, 0x52, 0xd2, 0x73, 0xe0, + 0x34, 0x47, 0x73, 0xe0, 0x20, 0x1b, 0xad, 0x3e, 0xed, 0x01, 0x5c, 0xbf, 0x8d, 0xe7, 0x99, 0x26, + 0xba, 0x1e, 0x35, 0x0f, 0xbc, 0x06, 0x5e, 0x03, 0xaf, 0x81, 0xd7, 0xa4, 0x33, 0xfe, 0xd9, 0xf1, + 0xcc, 0xe0, 0x5d, 0x23, 0x5f, 0x9f, 0xa3, 0x1e, 0x51, 0x9c, 0xb9, 0x9e, 0xc1, 0x1d, 0xfe, 0x69, + 0xae, 0x43, 0x34, 0xbf, 0xc1, 0x3f, 0x5d, 0xe5, 0x87, 0x08, 0x76, 0x07, 0xe9, 0xd9, 0x03, 0x8a, + 0xcd, 0x9f, 0x69, 0xa5, 0x08, 0xec, 0x0d, 0xda, 0x0d, 0x25, 0x60, 0xf3, 0xa7, 0xb2, 0xca, 0xa3, + 0x75, 0xf3, 0x67, 0xaa, 0x76, 0x7d, 0xa6, 0xa1, 0xac, 0xdc, 0xa0, 0x43, 0x0a, 0x7e, 0xdf, 0x29, + 0xd0, 0xad, 0xca, 0xa3, 0xcc, 0x1c, 0xca, 0xcc, 0x09, 0x81, 0x61, 0xca, 0xca, 0xcb, 0xcd, 0xa1, + 0x20, 0xaa, 0xca, 0xa5, 0x60, 0x92, 0xa4, 0xa4, 0xa4, 0x52, 0x34, 0x31, 0xd2, 0x5c, 0x56, 0xc9, + 0xb1, 0xd5, 0xab, 0x29, 0x39, 0xb6, 0x62, 0x11, 0xa5, 0x12, 0x4a, 0xc9, 0x15, 0x50, 0x44, 0x29, + 0x23, 0xce, 0x4f, 0x99, 0x92, 0x09, 0xa9, 0x98, 0x82, 0x82, 0x97, 0xa9, 0xd7, 0xb1, 0xd3, 0xec, + 0xb1, 0xd4, 0xde, 0x5c, 0x22, 0x79, 0x53, 0x09, 0xc5, 0xdf, 0xe0, 0xb7, 0xf6, 0xaf, 0xf8, 0x9b, + 0xf9, 0xc2, 0xe8, 0x8a, 0xbf, 0x0d, 0x1a, 0xa3, 0x29, 0xfe, 0x56, 0x42, 0xf1, 0xb7, 0x5d, 0x48, + 0x7c, 0x28, 0xfe, 0x96, 0x06, 0x59, 0x86, 0x4c, 0xb2, 0x8b, 0x66, 0x5c, 0xdf, 0xf1, 0xf8, 0x49, + 0x95, 0x62, 0xc2, 0x8d, 0xed, 0x93, 0x60, 0x5b, 0x14, 0xf1, 0x86, 0x37, 0x42, 0x81, 0x53, 0xc7, + 0x86, 0x36, 0x5d, 0x3b, 0x27, 0x26, 0x9b, 0x95, 0xa8, 0xdb, 0xd5, 0xb8, 0x27, 0x89, 0x72, 0x0f, + 0x8d, 0x8e, 0x7d, 0x67, 0xba, 0x87, 0xaa, 0x7c, 0x56, 0xad, 0x9e, 0x9c, 0x56, 0xab, 0xa5, 0xd3, + 0xa3, 0xd3, 0xd2, 0xf9, 0xf1, 0x71, 0xf9, 0x84, 0xfa, 0x1c, 0x58, 0xad, 0xa3, 0x97, 0x12, 0xe5, + 0xfc, 0x69, 0x57, 0xa2, 0x9c, 0x02, 0x52, 0x5b, 0xaf, 0x66, 0x18, 0x3a, 0xa1, 0xa1, 0xa0, 0xcf, + 0x2c, 0xb9, 0xf6, 0x99, 0x36, 0x81, 0x5e, 0x40, 0x2f, 0xa0, 0x57, 0xca, 0xd0, 0x8b, 0xec, 0x45, + 0x34, 0xa2, 0x17, 0xcf, 0x76, 0xed, 0xf9, 0x0c, 0x92, 0x6d, 0x28, 0x2b, 0xdc, 0x9f, 0x41, 0xb1, + 0x6c, 0x09, 0x1f, 0x08, 0x1f, 0x08, 0x1f, 0x48, 0xed, 0x03, 0x69, 0x8d, 0x74, 0xce, 0x19, 0x56, + 0x09, 0xda, 0xaa, 0x7b, 0xfd, 0xee, 0xe0, 0x81, 0x7f, 0x66, 0xd0, 0xb1, 0x52, 0xa2, 0x24, 0x10, + 0x12, 0xee, 0x13, 0xee, 0x13, 0x08, 0x99, 0x4e, 0x4f, 0xe7, 0x9a, 0x21, 0x37, 0xfa, 0x3d, 0x9b, + 0xa2, 0xc4, 0xe1, 0x74, 0xb5, 0x76, 0xa6, 0x51, 0xf8, 0x3e, 0xf8, 0x3e, 0xf8, 0xbe, 0x94, 0xf9, + 0x3e, 0xea, 0x85, 0x8b, 0x2a, 0x16, 0x2e, 0x24, 0x63, 0x86, 0x26, 0x35, 0xfc, 0xbc, 0x52, 0x39, + 0x3a, 0x3a, 0xad, 0x94, 0x8e, 0x4e, 0xce, 0x8e, 0xab, 0xa7, 0xa7, 0xc7, 0x67, 0xa5, 0x33, 0x2c, + 0x65, 0x50, 0x0f, 0x5e, 0x29, 0xb1, 0xc1, 0x3b, 0xc5, 0x4a, 0x86, 0xe8, 0x7f, 0x59, 0x5c, 0xc9, + 0xe8, 0x9a, 0x9e, 0xf9, 0x32, 0xdc, 0x3b, 0x6f, 0x98, 0xb6, 0x1d, 0xb0, 0x30, 0xa4, 0x63, 0xb2, + 0x15, 0x6d, 0x03, 0xcd, 0x80, 0x66, 0x40, 0x33, 0xa4, 0xa5, 0x99, 0xf0, 0x84, 0xc4, 0x2b, 0x1c, + 0xeb, 0xbe, 0x00, 0x3e, 0x11, 0x3e, 0x11, 0x3e, 0x11, 0x3e, 0x31, 0x85, 0x3e, 0xb1, 0xe7, 0x07, + 0xdc, 0xb0, 0x59, 0x68, 0x05, 0x4e, 0x8f, 0xe4, 0xed, 0xc3, 0xa8, 0x7f, 0x97, 0x5a, 0x86, 0x17, + 0x84, 0x17, 0x84, 0x17, 0x84, 0x17, 0x4c, 0xab, 0x17, 0xa4, 0x5c, 0x9f, 0x9d, 0x34, 0x08, 0x9f, + 0x07, 0x9f, 0x07, 0x9f, 0x07, 0x9f, 0x97, 0x5e, 0x9f, 0x47, 0x9c, 0x02, 0xcf, 0xb5, 0x0a, 0xef, + 0x07, 0xef, 0x07, 0xef, 0x97, 0x32, 0xef, 0x47, 0x68, 0xa1, 0x05, 0x6c, 0xef, 0x9b, 0xde, 0x7b, + 0xf8, 0x1e, 0x72, 0xd6, 0xd5, 0x93, 0x4b, 0xaf, 0x68, 0x1b, 0xbe, 0x15, 0xbe, 0x15, 0xbe, 0x35, + 0xff, 0x64, 0x49, 0xd0, 0xd6, 0x0d, 0xf3, 0x5e, 0x86, 0x25, 0x46, 0xf0, 0xfa, 0xae, 0x42, 0xb3, + 0x78, 0x7d, 0x37, 0x73, 0x43, 0x55, 0x39, 0xc6, 0xdb, 0xba, 0xc2, 0xff, 0x3d, 0x65, 0x97, 0xbd, + 0xc6, 0x65, 0xe3, 0x68, 0xa1, 0x6b, 0xd8, 0x28, 0x68, 0x0b, 0xb4, 0x05, 0xda, 0x02, 0x6d, 0x81, + 0xb6, 0x40, 0x5b, 0xa0, 0x2d, 0xd0, 0xd6, 0x5e, 0xd3, 0x16, 0xe7, 0x2e, 0x1d, 0x65, 0x0d, 0x1a, + 0x03, 0x5d, 0x81, 0xae, 0x40, 0x57, 0x29, 0xa3, 0xab, 0xbe, 0xe3, 0xf1, 0xf2, 0x09, 0x21, 0x5d, + 0x9d, 0xe0, 0x7d, 0x2e, 0xb0, 0x15, 0xd8, 0x4a, 0x6a, 0xa8, 0x4e, 0x8e, 0x8f, 0x8f, 0x40, 0x57, + 0xd9, 0xa1, 0xab, 0xbd, 0x3f, 0x0e, 0x42, 0xf5, 0xf0, 0x38, 0xc2, 0x83, 0x20, 0x14, 0x4e, 0x87, + 0x93, 0xa8, 0xa8, 0x7e, 0xa0, 0x71, 0xc4, 0x27, 0xa7, 0x00, 0x09, 0x6f, 0x2c, 0x54, 0x3b, 0xe3, + 0x87, 0xe4, 0x4c, 0x1f, 0x92, 0x33, 0x7c, 0xd4, 0xce, 0xec, 0x11, 0xed, 0x6d, 0x45, 0xbb, 0xa2, + 0xb4, 0xa7, 0xa2, 0x54, 0xa1, 0x7e, 0x22, 0x0b, 0x12, 0xb3, 0x9d, 0xf8, 0x16, 0x10, 0xef, 0x93, + 0x31, 0x47, 0x4d, 0x76, 0xb4, 0x08, 0x46, 0x49, 0x60, 0x70, 0x94, 0x07, 0x25, 0xde, 0x58, 0x6c, + 0xef, 0xd9, 0x18, 0xbd, 0x2a, 0x78, 0xd2, 0x83, 0xd4, 0xc9, 0x0e, 0x82, 0x25, 0x0b, 0x84, 0x4f, + 0x6e, 0x90, 0xc9, 0xc5, 0x15, 0x72, 0x6e, 0xd9, 0xdc, 0x5a, 0x39, 0x87, 0x56, 0xce, 0x95, 0xd5, + 0x72, 0x62, 0x5a, 0x4b, 0x16, 0x3d, 0x29, 0xa1, 0x68, 0xf9, 0xfd, 0x81, 0xa5, 0x88, 0xbf, 0xd8, + 0x3e, 0x2d, 0x7b, 0x37, 0x69, 0x41, 0x34, 0x20, 0x4b, 0x55, 0xdc, 0x90, 0x96, 0x9a, 0x54, 0xa4, + 0x25, 0x02, 0x29, 0x49, 0x55, 0x3a, 0x22, 0x93, 0x8a, 0xc8, 0xa4, 0x21, 0x1a, 0x29, 0x48, 0x2f, + 0xf4, 0xc9, 0x1e, 0x1c, 0x52, 0xec, 0x04, 0x66, 0x97, 0x19, 0xb6, 0x13, 0x5a, 0x66, 0x40, 0x70, + 0xcc, 0xd8, 0x7c, 0x73, 0x38, 0x71, 0x0c, 0x27, 0xf7, 0xec, 0x4c, 0x73, 0xcd, 0xea, 0x89, 0x63, + 0xe3, 0x30, 0xa3, 0x54, 0x26, 0x8b, 0xe0, 0x5c, 0x0f, 0x22, 0x19, 0x95, 0xe6, 0xb4, 0x58, 0xc2, + 0x85, 0x08, 0xda, 0x33, 0xc9, 0x89, 0x65, 0x52, 0x1d, 0x7a, 0xdb, 0x4f, 0x9a, 0xb3, 0x75, 0x53, + 0x3f, 0x04, 0xfa, 0xce, 0xe1, 0xd0, 0x32, 0x2a, 0x3b, 0x52, 0x1d, 0x9f, 0x52, 0x7c, 0x6a, 0xe0, + 0x08, 0x1e, 0x58, 0x10, 0xf8, 0x81, 0xa1, 0x60, 0xf3, 0x0b, 0x30, 0x12, 0xb5, 0x07, 0x1a, 0x01, + 0x8d, 0x80, 0x46, 0x40, 0x23, 0xa0, 0x11, 0xd0, 0x08, 0x68, 0x04, 0x34, 0x22, 0x40, 0x23, 0x7e, + 0x9f, 0xd3, 0xe2, 0xc8, 0xa0, 0x41, 0xf0, 0x08, 0x78, 0x04, 0x3c, 0x02, 0x1e, 0x01, 0x8f, 0x80, + 0x47, 0xc0, 0x23, 0xe0, 0x91, 0x58, 0x3c, 0x42, 0xa7, 0x8b, 0x40, 0x11, 0x01, 0x81, 0x80, 0x40, + 0x40, 0x20, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04, 0x12, 0x97, 0x40, 0x08, 0xb5, 0x10, 0xa8, + 0x20, 0x60, 0x10, 0x30, 0x08, 0x18, 0x04, 0x0c, 0x02, 0x06, 0x01, 0x83, 0x80, 0x41, 0x62, 0x74, + 0xf3, 0xf0, 0x84, 0x57, 0xcb, 0x65, 0x66, 0xa0, 0x0e, 0x21, 0x33, 0x6d, 0x81, 0x42, 0x40, 0x21, + 0xa0, 0x10, 0xc1, 0x19, 0x63, 0x9b, 0x9c, 0x19, 0xa6, 0x67, 0x1b, 0xdc, 0x51, 0x2a, 0x7f, 0x46, + 0x51, 0x5a, 0xa9, 0xd8, 0x30, 0x39, 0x67, 0x81, 0xa7, 0x0c, 0x23, 0xc5, 0xc7, 0x47, 0xfb, 0xef, + 0xea, 0x4f, 0x63, 0xf0, 0x47, 0x65, 0xf2, 0x47, 0x6b, 0xf4, 0xc7, 0xa7, 0xb9, 0x3f, 0x7e, 0x79, + 0x7c, 0xfc, 0xf8, 0xf8, 0x68, 0xff, 0xe3, 0xd7, 0xff, 0xfc, 0xe5, 0x5f, 0xff, 0xfb, 0xe7, 0xe3, + 0xe3, 0x3f, 0x1e, 0x1f, 0x8d, 0xa7, 0xb9, 0x4f, 0xfc, 0x5a, 0xcc, 0xa5, 0x0f, 0xe6, 0xee, 0x1b, + 0xdd, 0x1b, 0x03, 0xb3, 0x8d, 0xc1, 0x0b, 0xc3, 0x0b, 0xc3, 0x0b, 0x23, 0x17, 0x44, 0x2e, 0x88, + 0x5c, 0x10, 0xb9, 0x20, 0x72, 0xc1, 0x18, 0x1c, 0xd2, 0xf7, 0xbe, 0x7b, 0xfe, 0x5f, 0x1e, 0x0d, + 0x87, 0x4c, 0x1a, 0x03, 0x87, 0x80, 0x43, 0xc0, 0x21, 0xe0, 0x10, 0x70, 0x08, 0x38, 0x04, 0x1c, + 0xb2, 0x5f, 0x1c, 0x92, 0xcf, 0x6a, 0x51, 0xc3, 0x7a, 0x3b, 0x87, 0x92, 0x15, 0x4c, 0x0a, 0x0a, + 0x45, 0x89, 0x86, 0x85, 0xd5, 0xda, 0x97, 0x93, 0x2f, 0xd6, 0x55, 0x25, 0x4a, 0xa0, 0xfc, 0x0e, + 0xf3, 0xcc, 0x67, 0x97, 0xd9, 0xf2, 0x75, 0x60, 0x26, 0x0d, 0x88, 0x96, 0xe8, 0x60, 0x1d, 0xb3, + 0xef, 0x0e, 0x19, 0x61, 0x80, 0x1c, 0x92, 0x55, 0x64, 0x4a, 0xa8, 0x22, 0x93, 0x28, 0x34, 0xee, + 0x55, 0x15, 0x19, 0x69, 0x18, 0x8c, 0x46, 0xfc, 0xd9, 0xf7, 0x5d, 0x66, 0xca, 0x64, 0x50, 0xd1, + 0x22, 0x40, 0x39, 0x05, 0x3e, 0x42, 0xea, 0x90, 0x98, 0xa8, 0x13, 0x24, 0x4e, 0x83, 0x81, 0x79, + 0xc3, 0xbc, 0xb3, 0x60, 0xde, 0x66, 0xc8, 0x8c, 0x88, 0x2a, 0x8c, 0x80, 0x75, 0x54, 0x2c, 0xfd, + 0x54, 0xe2, 0xda, 0x46, 0xc4, 0x3e, 0x96, 0xe1, 0x74, 0x3e, 0xcd, 0xc0, 0xce, 0xc2, 0x2f, 0xc6, + 0x7f, 0x1f, 0xda, 0x22, 0x6a, 0x53, 0xae, 0x65, 0xc2, 0x04, 0xea, 0x52, 0x0a, 0xd4, 0xd6, 0x8d, + 0x51, 0x93, 0xf2, 0x40, 0xa1, 0xaf, 0x27, 0xb5, 0x71, 0x63, 0x38, 0x68, 0xb1, 0x6a, 0xb8, 0x52, + 0xd5, 0x6f, 0xa5, 0xaa, 0xdd, 0x8a, 0x55, 0xb7, 0xdd, 0xd6, 0x1f, 0x82, 0x73, 0x4e, 0x7a, 0xae, + 0x15, 0x63, 0x55, 0x12, 0x95, 0x99, 0x5d, 0x9b, 0xe7, 0xd5, 0xfa, 0xd9, 0xb2, 0xfa, 0x5f, 0xd6, + 0xf4, 0x57, 0xdc, 0x7e, 0x12, 0xec, 0x9f, 0x0d, 0xbd, 0x22, 0xd4, 0x1b, 0xab, 0xfb, 0x60, 0xf9, + 0x09, 0x57, 0x3c, 0xdd, 0x96, 0xfa, 0xad, 0xb1, 0xea, 0xb5, 0x6e, 0x29, 0x70, 0xb9, 0xb5, 0x1e, + 0x6b, 0x1c, 0x16, 0x11, 0x60, 0x8e, 0xb8, 0x6c, 0x21, 0xcc, 0x10, 0xc2, 0xac, 0x20, 0xc6, 0x04, + 0x62, 0x33, 0x72, 0x5b, 0xc1, 0xc7, 0xa2, 0xf5, 0x6a, 0x86, 0xa1, 0x13, 0x1a, 0xce, 0xf6, 0x4c, + 0x77, 0x2a, 0xe1, 0x4e, 0xaf, 0xd9, 0xe6, 0x48, 0x63, 0xe1, 0x6a, 0x6c, 0x3c, 0x15, 0xc1, 0x51, + 0x09, 0xfc, 0x14, 0xc5, 0x4d, 0x69, 0xbc, 0x94, 0xc6, 0x49, 0x39, 0x7c, 0x54, 0x0b, 0x86, 0xb1, + 0x71, 0x50, 0xfc, 0x30, 0xbd, 0xe9, 0x8e, 0x2e, 0x59, 0xf7, 0xfc, 0x21, 0xce, 0xcc, 0x1e, 0x9d, + 0x4f, 0x2f, 0x31, 0xbd, 0xe3, 0x1c, 0x6c, 0x8f, 0x39, 0xbe, 0x97, 0x73, 0x5c, 0x6c, 0x92, 0xcc, + 0x4d, 0xf6, 0x6a, 0x8c, 0xcf, 0xd6, 0xbd, 0x7e, 0x77, 0x70, 0x43, 0x3f, 0x75, 0x18, 0x46, 0xdc, + 0x12, 0xd7, 0xa2, 0x25, 0xad, 0x63, 0x96, 0xb0, 0x86, 0x29, 0xa4, 0xd9, 0x14, 0xe2, 0x96, 0x88, + 0x2e, 0x32, 0x8f, 0x07, 0x0e, 0x0b, 0x0d, 0xf3, 0x85, 0xd9, 0x42, 0x6f, 0xfb, 0xcd, 0x28, 0xe4, + 0x0b, 0x2d, 0x88, 0x15, 0xfa, 0x2f, 0x89, 0x16, 0xfa, 0x2f, 0xa1, 0xd0, 0x3f, 0xa9, 0xa8, 0x95, + 0xa6, 0x42, 0xff, 0xc2, 0xa2, 0x95, 0xd2, 0x86, 0x04, 0x89, 0x0d, 0x08, 0x92, 0x1b, 0x0e, 0xe4, + 0x8e, 0xd8, 0x51, 0x50, 0x4c, 0xd5, 0x36, 0x27, 0x29, 0x6e, 0x18, 0xa0, 0x58, 0x8a, 0xfe, 0x29, + 0x77, 0xa0, 0xd0, 0xce, 0xbb, 0x8c, 0x6e, 0x81, 0x9f, 0xa4, 0x17, 0x35, 0x89, 0xa1, 0x4f, 0x09, + 0x1e, 0x3a, 0x23, 0x77, 0x68, 0x81, 0xd2, 0x21, 0x05, 0x88, 0x4d, 0x88, 0x4d, 0x88, 0x4d, 0x88, + 0x4d, 0x88, 0x4d, 0x88, 0x4d, 0x31, 0x62, 0x93, 0x70, 0x11, 0x7b, 0xb5, 0xa2, 0xf5, 0x88, 0x4e, + 0x88, 0x4e, 0x88, 0x4e, 0x88, 0x4e, 0x88, 0x4e, 0x88, 0x4e, 0x31, 0xa2, 0x93, 0x7c, 0x5c, 0x42, + 0x44, 0x42, 0x44, 0x42, 0x44, 0x42, 0x44, 0x42, 0x44, 0x42, 0x44, 0xa2, 0x8c, 0x48, 0x52, 0xcb, + 0x4c, 0xa2, 0x45, 0x24, 0x11, 0x93, 0x10, 0x93, 0x10, 0x93, 0x10, 0x93, 0x10, 0x93, 0x10, 0x93, + 0x36, 0x76, 0x83, 0x44, 0x91, 0x41, 0xf9, 0xa2, 0x82, 0x88, 0x4a, 0x88, 0x4a, 0x84, 0x51, 0x49, + 0xb6, 0x28, 0x9f, 0x4c, 0x11, 0x3e, 0xe9, 0xa2, 0x7b, 0x3b, 0x2a, 0xb2, 0x97, 0xa4, 0x0f, 0xe1, + 0xee, 0x9b, 0x61, 0x5a, 0x16, 0xeb, 0x71, 0x26, 0xb1, 0x44, 0x3d, 0x77, 0x35, 0xfc, 0x08, 0xfc, + 0x08, 0xe8, 0x16, 0x74, 0x0b, 0xba, 0x05, 0xdd, 0x12, 0x45, 0x26, 0xe9, 0xbd, 0x53, 0xe2, 0xe5, + 0x5a, 0x11, 0x97, 0x10, 0x97, 0x10, 0x97, 0x10, 0x97, 0x10, 0x97, 0x10, 0x97, 0xb6, 0xc6, 0x25, + 0xd1, 0x72, 0x9e, 0x0a, 0xe5, 0x3b, 0x11, 0x97, 0x10, 0x97, 0x10, 0x97, 0x10, 0x97, 0x10, 0x97, + 0xf6, 0x39, 0x2e, 0xa5, 0xae, 0x7c, 0x8a, 0x70, 0xa5, 0xc6, 0x18, 0xa5, 0x42, 0x44, 0x8a, 0x30, + 0xca, 0xbd, 0x7a, 0x1c, 0xb7, 0xa8, 0xa2, 0x60, 0x11, 0x45, 0xc1, 0xa2, 0x89, 0x78, 0x65, 0x9f, + 0x38, 0x44, 0x67, 0xe3, 0x95, 0xfd, 0xf8, 0x45, 0x07, 0x63, 0x16, 0x19, 0x94, 0xb3, 0x81, 0x57, + 0xe6, 0xba, 0xfe, 0x70, 0xd9, 0x25, 0x88, 0x6f, 0x07, 0xb3, 0x17, 0x61, 0x72, 0x63, 0x72, 0x2f, + 0xf5, 0x78, 0xdf, 0xf1, 0x78, 0x2c, 0xa8, 0x14, 0x80, 0x49, 0x41, 0x88, 0x14, 0xa0, 0x61, 0x19, + 0x68, 0x94, 0xad, 0x7d, 0x29, 0x09, 0x89, 0x2a, 0x58, 0x23, 0x52, 0x43, 0x54, 0x06, 0x06, 0x55, + 0xbb, 0x42, 0x1d, 0xfe, 0x94, 0x7a, 0x87, 0x08, 0xca, 0x9e, 0x34, 0x38, 0xe7, 0xb0, 0xdf, 0xeb, + 0x05, 0x2c, 0x0c, 0x8d, 0xe1, 0xca, 0xaa, 0xfd, 0xc6, 0x02, 0xee, 0x84, 0x6c, 0x6c, 0xfd, 0x31, + 0x7d, 0xf5, 0x86, 0x36, 0xe0, 0xba, 0xe1, 0xba, 0x97, 0x7a, 0xdc, 0xb1, 0x99, 0xc7, 0x1d, 0xfe, + 0x1e, 0xaf, 0x4c, 0x6a, 0xc4, 0x26, 0x31, 0x2c, 0xb6, 0x78, 0x3d, 0x6e, 0xfa, 0xc2, 0x0c, 0x99, + 0xb8, 0x58, 0x76, 0x73, 0x73, 0xd5, 0x68, 0xb7, 0x6e, 0xfe, 0x19, 0x77, 0x98, 0x86, 0xee, 0x25, + 0x14, 0x12, 0x1d, 0x24, 0x4b, 0x27, 0x37, 0xee, 0x1f, 0x5a, 0xed, 0xab, 0x7a, 0xf3, 0xf2, 0xe1, + 0xba, 0xd1, 0xba, 0xbe, 0xbf, 0x2b, 0xea, 0x70, 0xcd, 0x92, 0xf7, 0xd6, 0xfc, 0xa3, 0xd9, 0xaa, + 0xdf, 0xb6, 0x2f, 0x6b, 0x8d, 0xda, 0xc5, 0xf5, 0xcd, 0x75, 0xeb, 0xba, 0xde, 0x4c, 0xe1, 0xed, + 0xa5, 0xb4, 0xf3, 0x2e, 0xbf, 0xd6, 0x9a, 0xcd, 0xeb, 0x66, 0xfb, 0xfa, 0x2a, 0x4d, 0x77, 0x75, + 0x5b, 0xbb, 0xab, 0x7d, 0xa9, 0xdf, 0xd6, 0xef, 0x5a, 0xed, 0xda, 0xd5, 0xd5, 0x43, 0xbd, 0x99, + 0xaa, 0x11, 0x1d, 0x1a, 0x43, 0xba, 0x3a, 0x6c, 0x3c, 0xc9, 0xee, 0x6a, 0xb7, 0x75, 0x6a, 0x89, + 0xf6, 0x49, 0xb3, 0xff, 0xce, 0x47, 0x41, 0x5f, 0x39, 0xf8, 0x79, 0x0f, 0x39, 0xeb, 0x1a, 0x36, + 0x0b, 0xad, 0xc0, 0xe9, 0xc5, 0xd2, 0xab, 0xa6, 0xd0, 0xb3, 0x7c, 0x2d, 0x60, 0x07, 0xb0, 0xb3, + 0x3c, 0x4f, 0xc4, 0x6b, 0x83, 0xc6, 0xf8, 0xec, 0x0d, 0xf3, 0x5e, 0x86, 0x6a, 0x29, 0x32, 0xd5, + 0x7c, 0x65, 0xaa, 0x95, 0x63, 0x24, 0xa6, 0xb3, 0xbe, 0x39, 0xd6, 0x89, 0x23, 0x8b, 0x4e, 0x39, + 0x4e, 0x1d, 0x7b, 0x78, 0x63, 0x78, 0x63, 0x78, 0x63, 0x78, 0x63, 0x78, 0xe3, 0xcd, 0xff, 0x92, + 0xc4, 0xd1, 0x0f, 0xdb, 0x4e, 0x5c, 0x89, 0xbb, 0x94, 0x1b, 0xfb, 0xc0, 0x87, 0x83, 0x0d, 0x4f, + 0xb8, 0xed, 0xc9, 0xe2, 0x3c, 0x51, 0x71, 0xe5, 0x89, 0x12, 0x5b, 0x9e, 0x61, 0xfe, 0xee, 0xa7, + 0xf7, 0x38, 0x73, 0x7f, 0x45, 0xce, 0x82, 0xae, 0xe3, 0x99, 0xae, 0x61, 0xb3, 0x37, 0x67, 0x45, + 0x3c, 0x98, 0xee, 0xfb, 0x5a, 0xf8, 0xe0, 0xc2, 0x33, 0xae, 0x2e, 0x5c, 0xbd, 0x36, 0xda, 0x6d, + 0x8a, 0x6e, 0xb3, 0xd1, 0xcc, 0xef, 0x71, 0x63, 0xf0, 0xcd, 0xab, 0x9e, 0x7f, 0x4b, 0x04, 0x8b, + 0x1d, 0xb1, 0x62, 0x47, 0xa8, 0xc5, 0x88, 0x14, 0xdd, 0x9c, 0xe0, 0x7c, 0x58, 0x57, 0x20, 0xba, + 0x68, 0x4d, 0x7a, 0x6b, 0xcb, 0x21, 0x21, 0xe3, 0xcf, 0x29, 0x9e, 0x12, 0x52, 0xa2, 0x39, 0x25, + 0x64, 0xc3, 0x10, 0x89, 0xc2, 0x46, 0xf2, 0x27, 0x85, 0xac, 0x1f, 0xc2, 0x5d, 0x39, 0xb1, 0x05, + 0x3b, 0x3b, 0x5c, 0xfc, 0xfb, 0xc6, 0xb1, 0xdf, 0xe8, 0x17, 0x5a, 0xe3, 0x96, 0xae, 0x86, 0x0d, + 0xb5, 0x17, 0xfe, 0x3a, 0x9e, 0x16, 0x0a, 0x27, 0xdc, 0xb8, 0xfe, 0x8b, 0x63, 0x99, 0xae, 0x61, + 0xbd, 0x9a, 0x9e, 0xc7, 0xdc, 0x70, 0xfb, 0x3c, 0x5e, 0xba, 0x02, 0x33, 0x3a, 0x75, 0x33, 0x3a, + 0xce, 0xf9, 0x37, 0x83, 0xc1, 0x13, 0x3a, 0x1d, 0x64, 0x78, 0x41, 0x36, 0x8e, 0x42, 0x88, 0x31, + 0x19, 0xb2, 0x9b, 0x53, 0x6d, 0x9f, 0x2c, 0x34, 0x79, 0x55, 0xec, 0x23, 0x11, 0xb6, 0x44, 0x40, + 0xb9, 0x88, 0x28, 0x39, 0xb5, 0x84, 0xa7, 0x98, 0xcc, 0x54, 0x53, 0x9c, 0x72, 0xb2, 0x53, 0x4f, + 0x79, 0x0a, 0x2a, 0x4f, 0x45, 0xf5, 0x29, 0x29, 0x98, 0xe6, 0xc4, 0x1c, 0xbb, 0xb8, 0x53, 0x35, + 0xba, 0xc0, 0xb4, 0xbb, 0x8e, 0x67, 0x6c, 0x3e, 0xde, 0x6d, 0xeb, 0xa8, 0xcf, 0x36, 0xb2, 0x1f, + 0x07, 0xda, 0x4a, 0x4c, 0x72, 0xd5, 0xc9, 0x4e, 0x36, 0xe9, 0xc9, 0x26, 0x3f, 0x9d, 0x11, 0x88, + 0x19, 0x83, 0x84, 0x5c, 0x52, 0xa0, 0x39, 0xd8, 0x76, 0x66, 0xa2, 0xc7, 0x3d, 0xf6, 0x69, 0xad, + 0xfb, 0xae, 0x4a, 0x5c, 0x1b, 0xef, 0x58, 0x28, 0xf9, 0x5e, 0x15, 0x11, 0xa0, 0x44, 0x96, 0x09, + 0xd7, 0x76, 0x68, 0xfc, 0xf5, 0x42, 0x78, 0x0e, 0x78, 0x8e, 0x0c, 0x7b, 0x8e, 0xd8, 0x4a, 0xfb, + 0x7a, 0xe5, 0x3d, 0x05, 0x36, 0xef, 0x78, 0x36, 0xfb, 0x21, 0x6f, 0xed, 0xa3, 0xcb, 0x61, 0xe7, + 0xb0, 0xf3, 0xdc, 0xda, 0x79, 0xdf, 0xf1, 0xf8, 0x51, 0x45, 0xc1, 0xce, 0x65, 0x4e, 0xbb, 0x97, + 0x7b, 0xd9, 0x73, 0xf2, 0x9f, 0xdc, 0x24, 0x2b, 0xa8, 0xbe, 0xfc, 0xa9, 0x68, 0xe0, 0x4b, 0xcd, + 0x28, 0xbe, 0x0c, 0x1a, 0xb5, 0x43, 0xf0, 0x3a, 0xa3, 0xe4, 0xf4, 0x9b, 0xef, 0x5a, 0x85, 0x97, + 0x44, 0x75, 0x75, 0x6d, 0xb5, 0x72, 0x5e, 0x3d, 0x3f, 0x39, 0xad, 0x9c, 0x1f, 0xa7, 0xa8, 0x8f, + 0x0f, 0x92, 0xb9, 0xea, 0x29, 0x05, 0xe1, 0x77, 0x41, 0x71, 0x8e, 0x77, 0xae, 0xf1, 0x5a, 0x57, + 0xb5, 0xb2, 0x35, 0x04, 0x67, 0x04, 0xe7, 0xdc, 0x06, 0x67, 0xb1, 0x37, 0x2d, 0xd6, 0x92, 0xb8, + 0x84, 0xf7, 0x93, 0x7b, 0x13, 0x63, 0xed, 0x83, 0xdc, 0xdc, 0x7f, 0xb9, 0xbe, 0xac, 0xdd, 0xb4, + 0xeb, 0x37, 0xa3, 0x5d, 0xe9, 0x8d, 0x87, 0xfb, 0xd6, 0xfd, 0xe5, 0xfd, 0x4d, 0xbb, 0xf5, 0x47, + 0xa3, 0x5e, 0x54, 0x29, 0x0d, 0x10, 0x4a, 0x63, 0x84, 0x1a, 0x4a, 0xcc, 0x3d, 0xde, 0xe0, 0x71, + 0xda, 0xf7, 0xad, 0xbb, 0xe2, 0x2e, 0x22, 0x2f, 0xe5, 0x33, 0xd4, 0x5b, 0x5f, 0xeb, 0x0f, 0x77, + 0xf5, 0x56, 0x31, 0xe1, 0xf0, 0xf6, 0x94, 0x9a, 0x0a, 0x0c, 0x62, 0xe1, 0xcd, 0xef, 0x3d, 0x9b, + 0xd6, 0x77, 0xa3, 0xeb, 0xdb, 0x4a, 0x71, 0x6d, 0xb6, 0x19, 0x04, 0x34, 0x04, 0xb4, 0xdc, 0x06, + 0xb4, 0xb9, 0xa9, 0xbe, 0x5b, 0x45, 0x5a, 0xe2, 0xda, 0x99, 0xaa, 0x1d, 0x77, 0xf7, 0x77, 0xf5, + 0x62, 0x0a, 0x5c, 0x50, 0x60, 0x72, 0x66, 0x58, 0xae, 0x19, 0x86, 0xf2, 0xfe, 0x67, 0xa6, 0x0d, + 0x38, 0x1f, 0x38, 0x1f, 0xd0, 0x74, 0xda, 0x69, 0xba, 0xf5, 0x70, 0x7d, 0xf1, 0xad, 0x55, 0x7b, + 0xf8, 0xa3, 0xfd, 0x50, 0x6b, 0xd5, 0xdb, 0x97, 0x37, 0xb5, 0x66, 0x33, 0x27, 0x24, 0x3d, 0x78, + 0xb4, 0xd1, 0x53, 0x1d, 0x97, 0x4a, 0x5f, 0xb2, 0xcc, 0xd3, 0xd3, 0x27, 0x39, 0xcb, 0xcd, 0x93, + 0x94, 0xcb, 0xb9, 0x79, 0x94, 0x6a, 0x5e, 0x1e, 0xe4, 0x24, 0x47, 0x43, 0x92, 0x1b, 0x3b, 0xc9, + 0xd1, 0x93, 0xe4, 0xe5, 0x41, 0x72, 0xf2, 0x1c, 0x95, 0x8f, 0xc7, 0x79, 0x79, 0x92, 0xdc, 0x18, + 0xc9, 0x79, 0x6e, 0x9e, 0xa4, 0x72, 0x9c, 0x1b, 0x7b, 0xcf, 0xcd, 0x93, 0x9c, 0xe6, 0x29, 0x2c, + 0xe6, 0xe5, 0x51, 0x8e, 0xd4, 0x9e, 0x64, 0x8f, 0x44, 0x72, 0xce, 0x42, 0x6e, 0x84, 0xce, 0x8b, + 0x67, 0xba, 0xf2, 0x12, 0xd5, 0x6c, 0x23, 0xd0, 0xa8, 0xa0, 0x51, 0xe5, 0x56, 0xa3, 0x8a, 0x5f, + 0xf3, 0x77, 0xad, 0x3e, 0x55, 0x4e, 0x83, 0xd1, 0x07, 0xce, 0xb3, 0xd1, 0x0b, 0x7c, 0xee, 0x5b, + 0xbe, 0x8a, 0xd9, 0xcf, 0x35, 0x03, 0xc3, 0x87, 0xe1, 0x43, 0x9c, 0xde, 0x6c, 0xfc, 0x69, 0x12, + 0xa7, 0xf3, 0xb8, 0xc9, 0xa3, 0xfc, 0xa5, 0x9e, 0xf9, 0x4d, 0x1e, 0xf7, 0xad, 0x6f, 0xd5, 0xec, + 0x3f, 0xc4, 0xd5, 0xb7, 0xa3, 0xcc, 0x3f, 0x44, 0xb3, 0x75, 0x5b, 0x39, 0x3e, 0xc9, 0xfe, 0x58, + 0x5c, 0x9e, 0x9e, 0x9c, 0xe5, 0xe0, 0x29, 0xaa, 0x67, 0x79, 0xb0, 0xed, 0x4a, 0xf6, 0x3d, 0x54, + 0xb9, 0xf4, 0xa5, 0xde, 0xbe, 0xa9, 0xdd, 0xe5, 0x61, 0x38, 0x8e, 0xf2, 0xe0, 0x6a, 0x73, 0x31, + 0xa7, 0x4a, 0x39, 0x88, 0xdd, 0xcd, 0xd6, 0x6d, 0xf9, 0x24, 0x17, 0x63, 0xd1, 0xbe, 0xbd, 0xf9, + 0x92, 0x07, 0xd3, 0xb8, 0xbc, 0xcb, 0x87, 0xbb, 0xfd, 0x3d, 0x1f, 0xee, 0xb6, 0x9c, 0x0b, 0x3e, + 0xaf, 0xe4, 0xe1, 0x21, 0x72, 0x60, 0x19, 0x83, 0xd0, 0x97, 0x87, 0x98, 0x71, 0x92, 0xfd, 0x84, + 0xaf, 0x9a, 0x87, 0xf0, 0x7d, 0x7f, 0x95, 0x87, 0xd4, 0xfb, 0xb2, 0x7c, 0x5e, 0xd9, 0xe3, 0xc5, + 0x2f, 0xd2, 0x02, 0x48, 0x82, 0x67, 0x6d, 0x46, 0xd7, 0xc9, 0x97, 0x34, 0x5c, 0x2c, 0x03, 0x78, + 0x38, 0xfe, 0xe1, 0x50, 0xa8, 0xaa, 0x57, 0x41, 0xbe, 0xf6, 0xe1, 0xcd, 0xe8, 0x06, 0x2e, 0xc7, + 0xdf, 0xdf, 0x1e, 0xff, 0xb0, 0xb1, 0x26, 0xa2, 0xf8, 0x20, 0xc4, 0x39, 0x9a, 0x9b, 0xf1, 0x57, + 0x16, 0x78, 0x8c, 0x8b, 0x57, 0x40, 0x8b, 0xae, 0x44, 0x0d, 0x34, 0xd4, 0x40, 0x53, 0x74, 0x01, + 0xc2, 0x35, 0xd0, 0x04, 0xcb, 0xf6, 0x2d, 0x0d, 0xb8, 0xb0, 0xa1, 0x4b, 0x4c, 0x61, 0xe9, 0xa9, + 0xac, 0x32, 0xa5, 0x89, 0xa6, 0xb6, 0xea, 0x14, 0x27, 0x9b, 0xea, 0x64, 0x53, 0x9e, 0x6e, 0xea, + 0x4b, 0x46, 0x57, 0xc1, 0xb1, 0x17, 0x35, 0x89, 0xe8, 0x42, 0xd3, 0x0d, 0x0d, 0x9b, 0xb9, 0xe6, + 0xbb, 0xfa, 0x42, 0xd6, 0xb4, 0x29, 0xc9, 0xbe, 0x9e, 0x79, 0x5d, 0xac, 0x24, 0xdb, 0x86, 0xe2, + 0xe9, 0xe9, 0xb2, 0xc6, 0x47, 0x61, 0x84, 0xc4, 0xc6, 0x48, 0x65, 0x94, 0xe4, 0xc6, 0x49, 0x6e, + 0xa4, 0xf4, 0xc6, 0xaa, 0x86, 0xde, 0x92, 0x69, 0x87, 0xfc, 0xa2, 0xf8, 0xd2, 0xcc, 0x91, 0x2e, + 0x52, 0xb4, 0x68, 0x47, 0xa7, 0x0a, 0x4d, 0xa8, 0x15, 0x2d, 0xa2, 0x49, 0xc4, 0x0a, 0x54, 0x45, + 0x8c, 0x88, 0x1c, 0xcc, 0x52, 0x73, 0x44, 0x45, 0x8d, 0xa2, 0xf6, 0x08, 0x0b, 0xef, 0x10, 0x64, + 0xd1, 0xd3, 0x21, 0x20, 0x28, 0x76, 0xa4, 0x7b, 0x08, 0xa8, 0x8a, 0x1f, 0x69, 0x1d, 0x8b, 0x83, + 0xdd, 0x5c, 0xfd, 0x94, 0x50, 0x11, 0x26, 0x99, 0xb7, 0xcc, 0x2d, 0xd7, 0x61, 0x1e, 0x37, 0x4c, + 0x37, 0x54, 0x67, 0x98, 0x99, 0xb6, 0xd4, 0x21, 0x26, 0x2a, 0x0e, 0x02, 0x96, 0x01, 0xcb, 0x80, + 0x65, 0x24, 0x67, 0x0e, 0xf3, 0xfa, 0x5d, 0x16, 0x98, 0x12, 0x15, 0x84, 0x57, 0x66, 0xe3, 0x55, + 0x85, 0x36, 0xe4, 0xaa, 0x33, 0x2b, 0x78, 0x43, 0xad, 0x39, 0xa3, 0xa4, 0x92, 0xaa, 0x53, 0x51, + 0x9d, 0xa8, 0x84, 0x87, 0x52, 0x8a, 0x8b, 0x06, 0x89, 0xb5, 0x3e, 0xbe, 0x21, 0x21, 0xad, 0x55, + 0x7c, 0xf8, 0x84, 0x8a, 0x28, 0xb9, 0x76, 0x4f, 0xa1, 0x76, 0x52, 0xbc, 0xf3, 0x17, 0x21, 0x64, + 0x41, 0xc8, 0xca, 0x96, 0x90, 0x25, 0xa9, 0xf1, 0x2e, 0x13, 0xa0, 0xac, 0xe7, 0x51, 0x30, 0x15, + 0x20, 0x1b, 0x90, 0x6d, 0xf7, 0xc8, 0x26, 0x6b, 0x7a, 0x51, 0x03, 0xcc, 0x33, 0x9f, 0x5d, 0x66, + 0xab, 0x0f, 0xf5, 0x14, 0xfd, 0x46, 0x0d, 0x2a, 0x8e, 0xcb, 0x4c, 0x4a, 0xd6, 0x31, 0xdd, 0x90, + 0xa9, 0xb6, 0x47, 0x54, 0x74, 0x59, 0xd5, 0xd8, 0x29, 0x8d, 0x5e, 0x93, 0xf1, 0x53, 0x3b, 0x01, + 0x6d, 0xce, 0x40, 0x9b, 0x53, 0xd0, 0xe7, 0x1c, 0x88, 0x24, 0x21, 0xc5, 0xb9, 0xa7, 0x9c, 0xe7, + 0x2d, 0xcd, 0x3c, 0xf9, 0x37, 0x3a, 0xd7, 0x46, 0xe3, 0xf2, 0x8e, 0x54, 0x33, 0x95, 0xf2, 0xf0, + 0xa1, 0xe7, 0xfb, 0x3d, 0xc7, 0x7b, 0xa1, 0xf3, 0xa6, 0x51, 0x8b, 0x70, 0xa7, 0x70, 0xa7, 0x70, + 0xa7, 0x70, 0xa7, 0x99, 0x73, 0xa7, 0x89, 0xe2, 0xb0, 0xa2, 0x3c, 0x96, 0x88, 0x4c, 0x36, 0x3c, + 0x80, 0x5d, 0x29, 0x63, 0xd5, 0xa9, 0x99, 0x0d, 0x4f, 0x7a, 0x97, 0x11, 0xce, 0x14, 0x14, 0x53, + 0x09, 0xad, 0xc7, 0x63, 0xce, 0xcb, 0xeb, 0xb3, 0x1f, 0x10, 0x2c, 0x1f, 0x4d, 0x9b, 0xda, 0xb1, + 0x7e, 0x50, 0x81, 0x7e, 0x00, 0xfd, 0x20, 0x6b, 0xfa, 0xc1, 0xc4, 0x7a, 0xe8, 0x90, 0x37, 0x6a, + 0x91, 0x06, 0x51, 0xcb, 0x40, 0x54, 0x20, 0xea, 0xbe, 0x23, 0xaa, 0xaa, 0x99, 0x47, 0x0d, 0x29, + 0x2a, 0xf6, 0x6b, 0x27, 0xb2, 0x32, 0x0f, 0x69, 0x30, 0x7d, 0x72, 0x17, 0xa0, 0xc3, 0x15, 0x68, + 0x76, 0x09, 0xba, 0x5c, 0x83, 0x76, 0x17, 0xa1, 0xdd, 0x55, 0xe8, 0x77, 0x19, 0x34, 0xae, 0x83, + 0xc8, 0x85, 0x50, 0xa7, 0x58, 0xc9, 0xa7, 0x5c, 0x11, 0xe7, 0x47, 0x3f, 0x1d, 0x92, 0x7a, 0x1d, + 0xed, 0x59, 0xd9, 0xdd, 0xe4, 0x01, 0xa2, 0x9f, 0x94, 0x12, 0x35, 0xfa, 0x69, 0x46, 0xb1, 0xe9, + 0xd4, 0xea, 0x87, 0xdc, 0xef, 0x1a, 0xdc, 0x7d, 0x0b, 0x35, 0x44, 0x99, 0x99, 0xc6, 0x53, 0x1e, + 0x6a, 0x2a, 0xd9, 0x08, 0x35, 0x12, 0x5b, 0x53, 0x10, 0x66, 0x28, 0xc2, 0xcc, 0xb0, 0xe3, 0x73, + 0x1a, 0x62, 0xa8, 0x68, 0x35, 0x6a, 0x90, 0xbb, 0x6f, 0xf4, 0x53, 0x2a, 0xaa, 0xdf, 0xe9, 0xbe, + 0x51, 0x4f, 0x26, 0x5a, 0xa7, 0xa2, 0x8d, 0x63, 0x75, 0x3a, 0x99, 0x04, 0x9c, 0x8d, 0x6e, 0xa7, + 0x93, 0x98, 0xf3, 0x49, 0xcc, 0x09, 0x25, 0xe3, 0x8c, 0x68, 0x9d, 0x12, 0xb1, 0x73, 0xd2, 0xe6, + 0xa4, 0x74, 0xa5, 0xd8, 0xc9, 0xa4, 0xdc, 0x09, 0xb9, 0x30, 0xed, 0xae, 0x2c, 0x09, 0x97, 0x96, + 0xa0, 0x6b, 0x4b, 0xca, 0xc5, 0x25, 0xee, 0xea, 0x12, 0x77, 0x79, 0xc9, 0xba, 0x3e, 0x3d, 0x2e, + 0x50, 0x93, 0x2b, 0xd4, 0x2d, 0x0d, 0xa4, 0x43, 0x2a, 0x98, 0xa6, 0x8e, 0x87, 0xdc, 0x7d, 0x3b, + 0xd4, 0xea, 0x3d, 0x77, 0x22, 0x25, 0x0c, 0x1f, 0xb0, 0xe5, 0xbe, 0x85, 0xed, 0x96, 0xfb, 0x46, + 0xaa, 0x2c, 0xe8, 0x9f, 0xd5, 0x1a, 0x66, 0x74, 0xd1, 0xef, 0x3b, 0xfa, 0x83, 0xf0, 0xe0, 0x4b, + 0xf4, 0x46, 0xe0, 0x12, 0x22, 0x30, 0x22, 0x30, 0x22, 0xf0, 0x7e, 0x44, 0x60, 0xb2, 0xad, 0x68, + 0x5b, 0x2d, 0xc6, 0x65, 0x66, 0x47, 0xee, 0x18, 0x07, 0xe1, 0x14, 0xe2, 0x54, 0xe3, 0x77, 0x34, + 0xc6, 0x10, 0xf1, 0xf1, 0xe3, 0x61, 0xc8, 0x4d, 0xce, 0x0e, 0x07, 0x0e, 0x79, 0xbf, 0x83, 0x9e, + 0x11, 0xf6, 0x9f, 0xb9, 0xce, 0x79, 0x34, 0x1b, 0xfc, 0xa2, 0x2f, 0x43, 0x10, 0x44, 0x10, 0x44, + 0x10, 0x44, 0x10, 0x44, 0x10, 0x4c, 0x47, 0x10, 0x8c, 0x1c, 0xf3, 0x1e, 0x07, 0xc3, 0x61, 0x67, + 0xe8, 0x0f, 0x83, 0xa3, 0xaf, 0xc9, 0xb8, 0x0e, 0x5b, 0x41, 0x00, 0x44, 0x00, 0x44, 0x00, 0x4c, + 0x45, 0x00, 0xd4, 0xb5, 0x34, 0x95, 0x88, 0x34, 0xb6, 0x2a, 0x4b, 0xd0, 0x3d, 0x79, 0xf5, 0x66, + 0x09, 0x89, 0x65, 0x0b, 0x49, 0x3a, 0xcd, 0x1d, 0x38, 0xcf, 0xa4, 0x9d, 0xe8, 0xce, 0x9c, 0xe9, + 0xce, 0x9c, 0xea, 0x6e, 0x9c, 0xab, 0x5e, 0x27, 0xab, 0xd9, 0xd9, 0x26, 0x97, 0x75, 0xac, 0xe0, + 0xc6, 0x40, 0xfd, 0xcd, 0x70, 0x21, 0x88, 0x3c, 0x3b, 0xc8, 0xe6, 0xf8, 0x6b, 0x1c, 0xfb, 0x44, + 0x14, 0xb3, 0x55, 0x31, 0x51, 0xb3, 0x72, 0x86, 0xd8, 0x88, 0xd8, 0x88, 0xd8, 0x88, 0xd8, 0x88, + 0xd8, 0x88, 0xd8, 0x28, 0xdd, 0x37, 0xc9, 0x06, 0x45, 0x44, 0x43, 0x44, 0x43, 0x44, 0x43, 0x44, + 0x43, 0x44, 0xc3, 0x45, 0x8b, 0x53, 0x3d, 0x59, 0x44, 0xd4, 0x3d, 0x1e, 0x25, 0xf0, 0x55, 0x34, + 0x27, 0x95, 0xc4, 0xfd, 0x2f, 0x19, 0xff, 0x51, 0xa0, 0x3e, 0xf9, 0x44, 0x98, 0x62, 0x3e, 0x24, + 0xfb, 0xb5, 0x93, 0x63, 0x3c, 0x2a, 0xe5, 0xea, 0x69, 0xf5, 0xec, 0xe8, 0xa4, 0x7a, 0x96, 0xf0, + 0x0d, 0x68, 0x38, 0xee, 0x23, 0x25, 0x6e, 0x66, 0x7e, 0x4e, 0x99, 0x3f, 0x76, 0x36, 0xa7, 0x4a, + 0xbb, 0x9e, 0x53, 0xa7, 0x7b, 0x34, 0xa7, 0x0e, 0xf2, 0xf1, 0x2d, 0x4f, 0x48, 0xa6, 0x96, 0xa6, + 0xd5, 0xdb, 0x78, 0x5e, 0x27, 0x94, 0x4d, 0x8d, 0xbe, 0x0e, 0xe9, 0x14, 0xd2, 0x29, 0xa4, 0x53, + 0x48, 0xa7, 0x90, 0x4e, 0xcd, 0x96, 0x67, 0x75, 0x3c, 0x33, 0x78, 0x4f, 0x30, 0x9f, 0x3a, 0xcf, + 0x6a, 0x38, 0xc4, 0xeb, 0x8b, 0x2b, 0xbe, 0x27, 0x0d, 0xaf, 0x2f, 0xea, 0xdc, 0x73, 0x58, 0xd8, + 0xfd, 0xdb, 0x8b, 0xcd, 0xe1, 0xe3, 0xed, 0xf1, 0xd6, 0xd5, 0x64, 0x5e, 0xe0, 0xc0, 0x9b, 0x1b, + 0x3b, 0x45, 0x41, 0x6c, 0x5c, 0xcd, 0x20, 0xea, 0x61, 0xe3, 0xea, 0x0e, 0x51, 0x2e, 0xf7, 0x6f, + 0x6e, 0x64, 0xea, 0x95, 0x8d, 0x54, 0xd7, 0xf7, 0xf9, 0x8d, 0xbd, 0x4f, 0x42, 0x5c, 0xc1, 0xef, + 0x3b, 0x05, 0x7d, 0x5b, 0xae, 0x8a, 0x37, 0x4e, 0xc8, 0x6b, 0x9c, 0x6b, 0xaa, 0x27, 0x74, 0xeb, + 0x78, 0x75, 0x97, 0x0d, 0x3c, 0x4e, 0x58, 0xfc, 0x54, 0xf0, 0xfa, 0xae, 0xab, 0x81, 0x37, 0x6e, + 0xcd, 0x1f, 0xfa, 0xbf, 0xe4, 0x3e, 0xb0, 0x59, 0xc0, 0xec, 0x8b, 0xf7, 0xf1, 0x57, 0xa4, 0x7a, + 0xfe, 0x68, 0xce, 0x26, 0xd2, 0x90, 0x45, 0x14, 0xb5, 0xbc, 0x73, 0xb5, 0xc3, 0xbc, 0x81, 0xd6, + 0x73, 0xfe, 0x44, 0x05, 0xe0, 0x2c, 0xcd, 0xe8, 0x2c, 0x97, 0x01, 0x8e, 0x66, 0x71, 0x9e, 0x4a, + 0x01, 0x3b, 0x36, 0x7d, 0x05, 0x60, 0xc7, 0x26, 0x2e, 0xfc, 0x5b, 0x42, 0x8d, 0xf9, 0xb4, 0xe7, + 0x98, 0xa8, 0x31, 0x9f, 0xb5, 0x08, 0x43, 0x9e, 0x07, 0x6a, 0xcc, 0xfb, 0x74, 0xe4, 0x79, 0xcb, + 0x79, 0x9d, 0x63, 0xe7, 0xc9, 0xb3, 0xd3, 0xbe, 0x58, 0xaf, 0xe5, 0x45, 0xfa, 0x7d, 0x2f, 0xec, + 0x0e, 0xff, 0x0e, 0xff, 0xae, 0xcd, 0xbf, 0x93, 0x17, 0x78, 0x37, 0x5f, 0x98, 0xbe, 0x02, 0xef, + 0x83, 0xc6, 0xf5, 0x14, 0x78, 0x2f, 0xa1, 0xc0, 0x3b, 0x0a, 0xbc, 0xa7, 0xc9, 0x11, 0xad, 0x73, + 0x48, 0xfb, 0x58, 0xe0, 0x5d, 0xdb, 0x62, 0x44, 0x34, 0xe3, 0xfb, 0x8e, 0xc7, 0x4f, 0xaa, 0x3a, + 0x26, 0xfc, 0xd8, 0xbf, 0x68, 0xd8, 0x4d, 0xad, 0x79, 0xdf, 0xbd, 0xc6, 0xa5, 0x9f, 0x24, 0xf6, + 0xd5, 0x27, 0xb5, 0xa1, 0x71, 0xb2, 0xc7, 0x59, 0xf7, 0xf7, 0x24, 0xb8, 0x95, 0x59, 0xe7, 0xd6, + 0xd9, 0x24, 0xb6, 0xbf, 0x27, 0x3d, 0xf4, 0xe5, 0xb3, 0x6a, 0xf5, 0xe4, 0xb4, 0x5a, 0x2d, 0x9d, + 0x1e, 0x9d, 0x96, 0xce, 0x8f, 0x8f, 0xcb, 0x27, 0xe5, 0xe3, 0x1c, 0xcd, 0x86, 0x8c, 0xac, 0x61, + 0x3e, 0xa5, 0x75, 0xc5, 0x80, 0x30, 0x6d, 0xb3, 0x5e, 0xcd, 0x30, 0x74, 0x42, 0x83, 0x50, 0x8f, + 0x5d, 0x0a, 0x85, 0x33, 0xdf, 0x01, 0xd4, 0x06, 0x6a, 0x03, 0xb5, 0x81, 0xda, 0xa4, 0x33, 0x5e, + 0x5b, 0x3d, 0x08, 0x4d, 0xf5, 0x1f, 0xd2, 0x1e, 0x09, 0x0c, 0x2d, 0x1b, 0x4c, 0x57, 0x84, 0x03, + 0x43, 0xc7, 0x86, 0x1b, 0xc4, 0x04, 0xc4, 0x04, 0xc4, 0x84, 0x7d, 0x8f, 0x09, 0x7a, 0x9d, 0xcc, + 0x5c, 0x70, 0xa8, 0x6a, 0x68, 0xbb, 0xee, 0xf5, 0xbb, 0x83, 0x0e, 0xfa, 0xb9, 0x07, 0x81, 0x47, + 0x67, 0xea, 0x81, 0x94, 0x03, 0xe1, 0x05, 0xe1, 0x05, 0xe1, 0x05, 0x29, 0x47, 0x1a, 0x3d, 0xbf, + 0x6b, 0x86, 0xdc, 0xe8, 0xf7, 0x6c, 0x1d, 0x27, 0x31, 0x4c, 0x77, 0x05, 0xcd, 0x7c, 0x09, 0x62, + 0x01, 0x62, 0x01, 0x62, 0x01, 0x62, 0x01, 0x2d, 0x63, 0x6a, 0x5e, 0xe8, 0xad, 0x62, 0xa1, 0x77, + 0x7a, 0xe3, 0x49, 0x2e, 0xf4, 0x96, 0x13, 0x5a, 0xed, 0x3b, 0xaf, 0x54, 0x8e, 0x8e, 0x4e, 0x2b, + 0xa5, 0xa3, 0x93, 0xb3, 0xe3, 0xea, 0xe9, 0xe9, 0xf1, 0x59, 0xe9, 0x0c, 0x4b, 0xbf, 0xb1, 0x26, + 0x43, 0x0e, 0x97, 0x7e, 0x97, 0x27, 0xc3, 0x29, 0x56, 0x7e, 0x93, 0x6e, 0x75, 0x1f, 0x56, 0x7e, + 0xbb, 0xa6, 0x67, 0xbe, 0x0c, 0xdf, 0xea, 0x34, 0x4c, 0xdb, 0x0e, 0x58, 0x18, 0xea, 0x63, 0xf0, + 0x15, 0xdf, 0x05, 0x14, 0x07, 0x8a, 0x03, 0xc5, 0x81, 0xe2, 0x90, 0x65, 0x32, 0x10, 0x19, 0x34, + 0xaf, 0x08, 0xaf, 0xfb, 0x42, 0xc4, 0x08, 0xc4, 0x08, 0xc4, 0x08, 0xc4, 0x08, 0xc4, 0x88, 0xd4, + 0xc5, 0x88, 0x9e, 0x1f, 0x70, 0xc3, 0x66, 0xa1, 0x15, 0x38, 0x3d, 0x2d, 0x75, 0x50, 0xa2, 0xf1, + 0x5a, 0xfa, 0x26, 0x44, 0x05, 0x44, 0x05, 0x44, 0x05, 0x44, 0x05, 0x44, 0x85, 0x74, 0x46, 0x05, + 0x9d, 0xfb, 0x79, 0x26, 0x5f, 0x80, 0x18, 0x80, 0x18, 0x80, 0x18, 0x80, 0x18, 0x80, 0x18, 0x90, + 0xd6, 0x18, 0xa0, 0x59, 0x32, 0x9a, 0xfb, 0x16, 0x44, 0x03, 0x44, 0x03, 0x44, 0x03, 0x44, 0x83, + 0xac, 0x78, 0x98, 0x02, 0x5e, 0x1f, 0x20, 0x2c, 0xc7, 0xf9, 0x1e, 0x72, 0xd6, 0x4d, 0x46, 0x8b, + 0x5a, 0xf1, 0x5d, 0x88, 0x3d, 0x88, 0x3d, 0x88, 0x3d, 0x88, 0x3d, 0x59, 0xcb, 0x44, 0x34, 0xb4, + 0x7d, 0xc3, 0xbc, 0x97, 0x61, 0x69, 0x4b, 0xec, 0x2a, 0x4d, 0xce, 0xb5, 0x2f, 0x7d, 0x0d, 0xca, + 0x07, 0x89, 0x0d, 0x7d, 0x0e, 0xf7, 0x90, 0x56, 0x8e, 0x51, 0x2d, 0x28, 0xf1, 0x56, 0x9f, 0xf6, + 0x87, 0xb5, 0xc7, 0xb5, 0xef, 0xf5, 0x42, 0xf6, 0xf0, 0x4b, 0x40, 0xd7, 0xa0, 0x6b, 0xd0, 0x35, + 0xe8, 0x1a, 0x74, 0x0d, 0xba, 0x06, 0x5d, 0x83, 0xae, 0x41, 0xd7, 0xa0, 0xeb, 0xdc, 0xd2, 0x35, + 0xe7, 0xae, 0x3e, 0xaa, 0x1e, 0x34, 0x0e, 0x9a, 0x06, 0x4d, 0x83, 0xa6, 0x41, 0xd3, 0xa4, 0x33, + 0xbe, 0xef, 0x78, 0xbc, 0x7c, 0xa2, 0x91, 0xa6, 0x4f, 0x50, 0xff, 0x00, 0x2c, 0x0d, 0x96, 0xce, + 0x25, 0x4b, 0x9f, 0x1c, 0x1f, 0x1f, 0x81, 0xa6, 0x41, 0xd3, 0xa4, 0x2d, 0xe1, 0x2c, 0xdc, 0xe5, + 0xb3, 0x70, 0x29, 0x8f, 0xcf, 0x2b, 0xec, 0xe0, 0x14, 0xdc, 0xe6, 0xf0, 0xfe, 0xd3, 0x72, 0x4c, + 0xe2, 0xc1, 0x0e, 0xa7, 0xe7, 0xe4, 0xf0, 0x7a, 0xe5, 0xb7, 0x20, 0x68, 0x8f, 0xa6, 0xd7, 0x72, + 0x14, 0xbd, 0x96, 0xa3, 0xe7, 0x69, 0x8f, 0x9a, 0x57, 0x1d, 0x4d, 0x62, 0x27, 0xb3, 0x0b, 0xe7, + 0x52, 0x24, 0x39, 0x35, 0x34, 0x49, 0x77, 0xa2, 0xe6, 0x48, 0xe4, 0xcd, 0x5f, 0xee, 0x4a, 0xc9, + 0x29, 0x46, 0x35, 0xb5, 0x12, 0x9c, 0x52, 0x0a, 0x33, 0x29, 0x99, 0x19, 0x24, 0x37, 0x71, 0xc4, + 0x87, 0x5d, 0x62, 0xc8, 0x15, 0x0f, 0xde, 0x25, 0x39, 0x68, 0x57, 0xb1, 0x72, 0x9e, 0xf2, 0x41, + 0xba, 0x14, 0x12, 0x1f, 0xf1, 0x41, 0xb9, 0x54, 0xb2, 0x1d, 0xb9, 0x3c, 0x47, 0x2e, 0xc3, 0xd1, + 0x1f, 0x74, 0x9b, 0xac, 0xbb, 0x54, 0x3d, 0xb8, 0xb6, 0x68, 0xf9, 0x7d, 0x8f, 0xb3, 0x40, 0xbd, + 0x8e, 0xda, 0xf4, 0x14, 0x83, 0x49, 0x8b, 0xaa, 0xc8, 0x48, 0x52, 0xd0, 0x92, 0x4c, 0x99, 0xa7, + 0x54, 0xe2, 0x35, 0x28, 0xef, 0xd4, 0x4a, 0xbb, 0x36, 0x65, 0x5d, 0x9b, 0x92, 0xae, 0x47, 0x39, + 0xdf, 0x6d, 0xda, 0x44, 0x75, 0x2e, 0x75, 0xb1, 0x13, 0x98, 0x5d, 0x66, 0xd8, 0x4e, 0x68, 0x99, + 0x81, 0x4d, 0x7f, 0xd0, 0xfd, 0x7c, 0xf3, 0xb4, 0x07, 0xde, 0x97, 0xa8, 0x0f, 0xbc, 0x2f, 0x65, + 0xe3, 0xc0, 0x7b, 0xe2, 0x25, 0x39, 0x1c, 0x76, 0x9f, 0xac, 0xe3, 0x48, 0xa7, 0x3c, 0x48, 0xbe, + 0xb4, 0xb6, 0x18, 0xf6, 0x49, 0xab, 0x8a, 0x6b, 0x38, 0x36, 0x5a, 0xd3, 0x2a, 0x9a, 0x86, 0xb5, + 0x4a, 0x9d, 0xab, 0x66, 0x9a, 0x97, 0x4c, 0x74, 0xaf, 0x92, 0x25, 0xb1, 0x3c, 0xa2, 0x61, 0x55, + 0x4c, 0xeb, 0x6a, 0x58, 0x52, 0x43, 0x9a, 0xdc, 0x31, 0xcf, 0x89, 0x8c, 0x72, 0x4a, 0x17, 0x95, + 0x9e, 0xd2, 0xb2, 0x6a, 0xf0, 0x81, 0x8a, 0x3d, 0x59, 0x10, 0xf8, 0x81, 0x41, 0xe8, 0xd3, 0x16, + 0xe0, 0x33, 0x6a, 0x1f, 0xf4, 0x09, 0xfa, 0x04, 0x7d, 0x82, 0x3e, 0x41, 0x9f, 0xa0, 0x4f, 0xd0, + 0x27, 0xe8, 0x13, 0xf4, 0x09, 0xfa, 0x1c, 0xd3, 0xa1, 0xdf, 0xe7, 0x7a, 0xf1, 0x73, 0xf0, 0x05, + 0xe0, 0x4f, 0xf0, 0x27, 0xf8, 0x13, 0xfc, 0x09, 0xfe, 0x04, 0x7f, 0x82, 0x3f, 0xc1, 0x9f, 0xe0, + 0x4f, 0xf0, 0xa7, 0x46, 0xdd, 0x13, 0x8a, 0x27, 0x88, 0x13, 0xc4, 0x09, 0xe2, 0x04, 0x71, 0x82, + 0x38, 0x41, 0x9c, 0x20, 0x4e, 0x10, 0x27, 0x88, 0x73, 0xc0, 0x85, 0x1a, 0xb5, 0x4e, 0xa8, 0x9c, + 0x60, 0x4e, 0x30, 0x27, 0x98, 0x13, 0xcc, 0x09, 0xe6, 0x04, 0x73, 0x82, 0x39, 0xc1, 0x9c, 0x7b, + 0xcf, 0x9c, 0xae, 0x19, 0x72, 0xc3, 0x72, 0x99, 0x19, 0xd0, 0x43, 0xe7, 0x4c, 0xdb, 0xa0, 0x4e, + 0x50, 0x27, 0xa8, 0x73, 0xcf, 0xa8, 0xd3, 0x36, 0x39, 0x33, 0x4c, 0xcf, 0x36, 0xb8, 0x43, 0x5a, + 0x5d, 0x5f, 0x47, 0xe5, 0xeb, 0x62, 0xc3, 0xe4, 0x9c, 0x05, 0x1e, 0x39, 0x7c, 0x16, 0x1f, 0x1f, + 0xed, 0xbf, 0xab, 0x3f, 0x8d, 0xc1, 0x1f, 0x95, 0xc9, 0x1f, 0xad, 0xd1, 0x1f, 0x9f, 0xe6, 0xfe, + 0xf8, 0xe5, 0xf1, 0xf1, 0xe3, 0xe3, 0xa3, 0xfd, 0x8f, 0x5f, 0xff, 0xf3, 0x97, 0x7f, 0xfd, 0xef, + 0x9f, 0x8f, 0x8f, 0xff, 0x78, 0x7c, 0x34, 0x9e, 0xe6, 0x3e, 0xf1, 0x6b, 0x11, 0x31, 0x6c, 0x45, + 0x0f, 0x73, 0xf7, 0x4d, 0xdf, 0x1b, 0xb2, 0xb3, 0x8d, 0x23, 0x8a, 0x21, 0x8a, 0x21, 0x8a, 0x41, + 0x3b, 0x81, 0x76, 0x02, 0xed, 0x04, 0xda, 0x09, 0xb4, 0x13, 0x68, 0x27, 0x7b, 0xcf, 0x9d, 0x7d, + 0xef, 0xbb, 0xe7, 0xff, 0xe5, 0xe9, 0xe1, 0xce, 0x49, 0xe3, 0xe0, 0x4e, 0x70, 0x27, 0xb8, 0x13, + 0xdc, 0x09, 0xee, 0x04, 0x77, 0x82, 0x3b, 0xc1, 0x9d, 0xe0, 0xce, 0xec, 0x72, 0x27, 0xea, 0x7f, + 0x8b, 0x14, 0x6b, 0x1e, 0xd6, 0x07, 0x3e, 0x24, 0xaa, 0x4c, 0x5a, 0xd0, 0x5d, 0xb9, 0x79, 0x78, + 0x6e, 0x40, 0xfb, 0x72, 0x72, 0xb7, 0xbb, 0xaa, 0xfb, 0xad, 0x50, 0x3f, 0x98, 0x79, 0xe6, 0xb3, + 0xcb, 0x6c, 0xba, 0xa2, 0xb2, 0x93, 0x06, 0x55, 0xeb, 0x69, 0xb2, 0x8e, 0xd9, 0x77, 0x87, 0x40, + 0xd9, 0x31, 0xdd, 0x90, 0x11, 0xd5, 0xa8, 0x2d, 0xe5, 0xbc, 0x46, 0x2d, 0x41, 0x49, 0x69, 0x5d, + 0xe9, 0x4e, 0xf6, 0xeb, 0xd4, 0xaa, 0x97, 0x9c, 0x4e, 0x47, 0x50, 0x20, 0x4b, 0x61, 0xa2, 0x99, + 0xf7, 0xec, 0xfb, 0x2e, 0x33, 0x29, 0x74, 0x8b, 0x68, 0xa9, 0xb7, 0x9c, 0x41, 0x67, 0x1a, 0x7a, + 0xbe, 0xdf, 0x73, 0xbc, 0x17, 0x3a, 0x6f, 0x1a, 0xb5, 0x08, 0x77, 0x0a, 0x77, 0x0a, 0x77, 0x0a, + 0x77, 0x9a, 0x39, 0x77, 0x8a, 0x33, 0x69, 0xd6, 0xa6, 0x39, 0x69, 0x3d, 0x8f, 0x46, 0xe1, 0x34, + 0x34, 0x89, 0xb3, 0x68, 0x0e, 0x34, 0x4e, 0x0c, 0xd5, 0x09, 0xa1, 0x7d, 0x22, 0x14, 0xa5, 0x4e, + 0xe2, 0xd1, 0x36, 0xf4, 0x62, 0x83, 0x1e, 0x7f, 0xe8, 0x04, 0x86, 0x4d, 0xf2, 0xa0, 0x21, 0xa5, + 0x03, 0x86, 0x24, 0x4f, 0x30, 0x91, 0x3e, 0x50, 0x48, 0x05, 0x57, 0x88, 0xf0, 0x44, 0x15, 0x47, + 0xc8, 0xf0, 0x83, 0x0c, 0x37, 0xe8, 0xf0, 0x42, 0xaf, 0x4b, 0x92, 0x3d, 0x29, 0xa4, 0x68, 0xba, + 0xa1, 0x61, 0x33, 0xd7, 0x7c, 0x57, 0x3f, 0x85, 0x6b, 0xda, 0x94, 0xec, 0x69, 0x46, 0xd3, 0x7c, + 0xa2, 0xa4, 0x78, 0x9a, 0x57, 0x49, 0xf5, 0x34, 0xaf, 0x12, 0x4e, 0xf3, 0xd2, 0x9d, 0x1b, 0xe0, + 0x34, 0x2f, 0x6a, 0xe6, 0x9f, 0x3b, 0xe0, 0xfe, 0xa8, 0xa2, 0x32, 0x69, 0xc6, 0x76, 0x74, 0xaa, + 0xd0, 0x04, 0xcd, 0x92, 0x2e, 0xcd, 0x31, 0xaf, 0x84, 0x19, 0x32, 0xed, 0xf6, 0x17, 0xe2, 0x25, + 0x59, 0x1d, 0x8b, 0x73, 0x3f, 0x69, 0x0e, 0xc5, 0x4d, 0xfd, 0x10, 0x54, 0x2b, 0xe7, 0xd5, 0xf3, + 0x93, 0xd3, 0xca, 0xf9, 0x71, 0x8a, 0xc7, 0x62, 0x47, 0x19, 0xf7, 0x53, 0x8a, 0x0f, 0x11, 0xb5, + 0x5c, 0x87, 0x79, 0xdc, 0x30, 0xdd, 0x50, 0x9d, 0x61, 0x66, 0xda, 0x52, 0x87, 0x98, 0x7a, 0xeb, + 0x6b, 0xfd, 0xe1, 0xae, 0xde, 0x02, 0xcb, 0x80, 0x65, 0xc0, 0x32, 0xb2, 0x33, 0x87, 0x79, 0xfd, + 0x2e, 0x0b, 0x46, 0x72, 0x8b, 0x3a, 0xd0, 0x94, 0xab, 0x0a, 0x6d, 0xd4, 0xbd, 0x7e, 0x77, 0xf0, + 0x50, 0x3f, 0x53, 0xec, 0x0d, 0x1d, 0xcf, 0x38, 0x2b, 0x55, 0xca, 0xff, 0x63, 0x0c, 0x8b, 0xf5, + 0x10, 0xb8, 0xc4, 0xc5, 0x06, 0xe1, 0xcc, 0x06, 0xf6, 0xc8, 0xf8, 0x2b, 0xfc, 0x98, 0x84, 0x1f, + 0x1b, 0xf4, 0xdb, 0xde, 0xb9, 0x30, 0x8a, 0x4d, 0xb8, 0x04, 0x9b, 0x6e, 0x91, 0x91, 0x21, 0x23, + 0xcb, 0x54, 0x46, 0xa6, 0x6f, 0x53, 0x2b, 0x72, 0xb3, 0xc4, 0x68, 0xe4, 0xd9, 0xf5, 0xad, 0xef, + 0xa3, 0x03, 0x52, 0x68, 0x68, 0x64, 0xae, 0x41, 0xd0, 0x08, 0x68, 0x04, 0x34, 0x02, 0x1a, 0x01, + 0x8d, 0x80, 0x46, 0x40, 0x23, 0xa0, 0x91, 0x6d, 0x34, 0x62, 0x05, 0x16, 0x25, 0x8b, 0xcc, 0x34, + 0x07, 0x12, 0x01, 0x89, 0x80, 0x44, 0x40, 0x22, 0x20, 0x11, 0x90, 0x08, 0x48, 0x04, 0x24, 0xb2, + 0x8d, 0x44, 0x3a, 0x81, 0xf9, 0x32, 0x08, 0x00, 0x94, 0x0b, 0x35, 0x8b, 0x6d, 0x82, 0x49, 0xc0, + 0x24, 0x60, 0x12, 0x30, 0x09, 0x98, 0x04, 0x4c, 0x02, 0x26, 0x01, 0x93, 0x6c, 0x63, 0x92, 0xff, + 0x6b, 0x3e, 0x3f, 0xb3, 0x80, 0x92, 0x48, 0xe6, 0x5b, 0x04, 0x8f, 0x80, 0x47, 0xc0, 0x23, 0xe0, + 0x11, 0xf0, 0x08, 0x78, 0x04, 0x3c, 0x02, 0x1e, 0xd9, 0xc6, 0x23, 0x5d, 0xd3, 0x32, 0x2c, 0xdf, + 0xe3, 0x81, 0xef, 0x52, 0x42, 0xc9, 0x8a, 0x66, 0x41, 0x26, 0x20, 0x13, 0x90, 0x09, 0xc8, 0x04, + 0x64, 0x02, 0x32, 0x01, 0x99, 0x80, 0x4c, 0xe2, 0x90, 0x49, 0xcf, 0xec, 0x87, 0x8c, 0x9a, 0x4b, + 0xe6, 0x1a, 0x05, 0x95, 0x80, 0x4a, 0x40, 0x25, 0xa0, 0x12, 0x50, 0x09, 0xa8, 0x04, 0x54, 0x02, + 0x2a, 0xd9, 0x46, 0x25, 0xfe, 0x1b, 0x0b, 0x42, 0xe7, 0xdf, 0xa4, 0x50, 0xb2, 0xd8, 0x26, 0x98, + 0x04, 0x4c, 0x02, 0x26, 0x01, 0x93, 0x80, 0x49, 0xc0, 0x24, 0x60, 0x12, 0x30, 0xc9, 0x36, 0x26, + 0xe9, 0x59, 0xa1, 0xf1, 0xec, 0xf4, 0x28, 0xdf, 0xba, 0x59, 0x68, 0x12, 0x44, 0x82, 0xf2, 0x4a, + 0x8a, 0x58, 0xb2, 0xbf, 0xe5, 0x95, 0xc0, 0x26, 0x60, 0x13, 0xb0, 0x09, 0xd8, 0x64, 0x6f, 0xd9, + 0x64, 0x08, 0x11, 0xcc, 0x36, 0x42, 0x66, 0xf9, 0x9e, 0x4d, 0x07, 0x28, 0x8b, 0xed, 0x82, 0x52, + 0x40, 0x29, 0xa0, 0x14, 0x50, 0x0a, 0x28, 0x05, 0x94, 0x02, 0x4a, 0x01, 0xa5, 0x88, 0x51, 0x4a, + 0xc8, 0xde, 0x58, 0xc0, 0xdc, 0x77, 0x6d, 0xb8, 0xb2, 0xf6, 0x0b, 0xc0, 0x2d, 0xe0, 0x16, 0x70, + 0x0b, 0xb8, 0x05, 0xdc, 0x02, 0x6e, 0x01, 0xb7, 0x80, 0x5b, 0xc4, 0xb8, 0xa5, 0xef, 0x99, 0x6f, + 0xa6, 0xe3, 0x9a, 0xcf, 0x2e, 0x23, 0x47, 0x96, 0x55, 0x6d, 0x83, 0x56, 0x40, 0x2b, 0xa0, 0x15, + 0xd0, 0x0a, 0x68, 0x05, 0xb4, 0x02, 0x5a, 0x01, 0xad, 0xc4, 0xa7, 0x95, 0xbe, 0x67, 0xd3, 0x6f, + 0x9e, 0x5d, 0x6a, 0x14, 0x7c, 0x82, 0xdd, 0xb3, 0xf2, 0x68, 0x82, 0xdd, 0xb3, 0xa0, 0x12, 0x50, + 0x09, 0xa8, 0x04, 0x54, 0xb2, 0x17, 0x54, 0xe2, 0xf7, 0x39, 0xf1, 0x61, 0x7e, 0x4b, 0x2d, 0x82, + 0x47, 0xc0, 0x23, 0xe0, 0x11, 0xf0, 0x08, 0x78, 0x04, 0x3c, 0x02, 0x1e, 0x01, 0x8f, 0x6c, 0xe5, + 0x11, 0xda, 0xe3, 0xfc, 0x96, 0x5a, 0x04, 0x8f, 0x60, 0xfd, 0x46, 0x11, 0x4a, 0xb0, 0x7e, 0x03, + 0x32, 0x01, 0x99, 0x80, 0x4c, 0x40, 0x26, 0xfb, 0x45, 0x26, 0x94, 0x47, 0xfb, 0x2d, 0xb4, 0x07, + 0x2a, 0x01, 0x95, 0x80, 0x4a, 0x40, 0x25, 0xa0, 0x12, 0x50, 0x09, 0xa8, 0x04, 0x54, 0x22, 0x40, + 0x25, 0x3a, 0x4a, 0xd8, 0xaf, 0x69, 0x17, 0x94, 0x82, 0xb5, 0x1c, 0x79, 0x40, 0xc1, 0x5a, 0x0e, + 0xd8, 0x04, 0x6c, 0x02, 0x36, 0x01, 0x9b, 0xec, 0x15, 0x9b, 0xd0, 0x16, 0xb1, 0x5f, 0xd9, 0x2a, + 0xb8, 0x04, 0x5c, 0x02, 0x2e, 0x01, 0x97, 0x80, 0x4b, 0xc0, 0x25, 0xe0, 0x12, 0x70, 0xc9, 0x56, + 0x2e, 0xa1, 0x2e, 0x19, 0xbb, 0xa2, 0x4d, 0x30, 0x09, 0x56, 0x74, 0x14, 0xc1, 0x04, 0x2b, 0x3a, + 0xa0, 0x13, 0xd0, 0x09, 0xe8, 0x04, 0x74, 0x92, 0x51, 0x3a, 0x39, 0xd0, 0x38, 0x47, 0x8b, 0x35, + 0xcf, 0xf3, 0xb9, 0x39, 0x18, 0x12, 0xa9, 0x69, 0x59, 0x0c, 0xad, 0x57, 0xd6, 0x35, 0x7b, 0x26, + 0x7f, 0x1d, 0x78, 0xdc, 0x43, 0xbf, 0xc7, 0x3c, 0x6b, 0x48, 0x0f, 0xc3, 0x98, 0xe3, 0x78, 0xa6, + 0x6b, 0xd8, 0xec, 0xcd, 0xb1, 0xd8, 0xe1, 0xe2, 0xdf, 0x5d, 0xff, 0xc5, 0xb1, 0x4c, 0xd7, 0xb0, + 0x5e, 0x4d, 0xcf, 0x63, 0x6e, 0x78, 0x38, 0xfe, 0xe1, 0x90, 0xf1, 0x57, 0x16, 0x78, 0x8c, 0x1f, + 0x86, 0xdc, 0xe4, 0x4c, 0xc2, 0x77, 0x17, 0x43, 0x1e, 0xf4, 0x2d, 0xee, 0x8d, 0xc3, 0xc0, 0x7d, + 0x74, 0x4f, 0xad, 0xf1, 0x2d, 0x5c, 0x0d, 0xef, 0xa0, 0xbd, 0xf0, 0xd7, 0x9b, 0xd1, 0x0d, 0x5d, + 0x8e, 0xef, 0xa7, 0x3d, 0xfe, 0xa1, 0x5d, 0x1f, 0xdf, 0x4f, 0xbb, 0x39, 0xbc, 0x9f, 0x03, 0x3d, + 0x83, 0x17, 0xef, 0x93, 0x31, 0x87, 0x57, 0x76, 0x58, 0x75, 0x0e, 0xa7, 0xc0, 0x40, 0x6a, 0x1a, + 0xc0, 0x78, 0x43, 0xb7, 0x7d, 0x20, 0x62, 0x0c, 0x42, 0xd1, 0xf1, 0x6c, 0x16, 0xdf, 0xd3, 0xcf, + 0xbc, 0x8b, 0x3f, 0xb8, 0x2c, 0xe6, 0x20, 0x8b, 0xb9, 0x7f, 0x61, 0xaa, 0x97, 0xa1, 0x78, 0x45, + 0x6a, 0x97, 0xa5, 0x74, 0x65, 0x2a, 0x57, 0xa6, 0x70, 0x75, 0xea, 0xa6, 0x75, 0x00, 0xc2, 0x14, + 0x1d, 0x8d, 0x9c, 0xcb, 0xcc, 0x4e, 0xc0, 0x3a, 0x22, 0xa3, 0x36, 0x9e, 0x88, 0xe5, 0x53, 0x81, + 0x6b, 0x1a, 0x63, 0x1f, 0xf3, 0xf1, 0xe3, 0xe1, 0xc8, 0xb6, 0x0f, 0x47, 0x73, 0x3f, 0x51, 0x1b, + 0x7d, 0x09, 0x58, 0x18, 0xca, 0x58, 0xe9, 0xe8, 0x42, 0x31, 0x3b, 0x2d, 0xc3, 0x4e, 0x61, 0xa7, + 0x8b, 0xb7, 0x73, 0xe5, 0x04, 0x62, 0x03, 0x67, 0x4d, 0x66, 0x87, 0x60, 0xcf, 0x4f, 0x93, 0xe2, + 0xe1, 0xf5, 0x82, 0xbd, 0x26, 0x36, 0x85, 0x95, 0x85, 0x24, 0x15, 0x01, 0x89, 0x48, 0x38, 0x52, + 0x15, 0x8c, 0xc8, 0x84, 0x22, 0x32, 0x81, 0x88, 0x4e, 0x18, 0xd2, 0x9b, 0x92, 0x88, 0x9a, 0x44, + 0x74, 0x61, 0xef, 0xf5, 0x3d, 0x9c, 0x65, 0x50, 0x75, 0x45, 0x76, 0xa9, 0x45, 0xe8, 0xb1, 0xd0, + 0x63, 0xa1, 0xc7, 0x4a, 0xce, 0x1c, 0x71, 0xb2, 0xa4, 0x20, 0xcd, 0xb5, 0xe4, 0x79, 0xe8, 0x5b, + 0x46, 0xcf, 0x35, 0x79, 0xc7, 0x0f, 0xba, 0x9f, 0x2c, 0xbf, 0xdb, 0xf3, 0x3d, 0xe6, 0xf1, 0x70, + 0xf5, 0xaf, 0x07, 0xbf, 0xe5, 0x81, 0xe9, 0x85, 0x16, 0x73, 0xde, 0x58, 0xf0, 0x69, 0xe6, 0xe7, + 0xc5, 0x7f, 0x5a, 0x74, 0x1a, 0xe1, 0xe2, 0x07, 0x26, 0x99, 0xf1, 0xc2, 0xaf, 0x05, 0xf8, 0x97, + 0x6a, 0x6c, 0x6f, 0x9c, 0x90, 0xd7, 0x38, 0x0f, 0xd4, 0xc6, 0xf7, 0xd6, 0xf1, 0xea, 0x2e, 0x1b, + 0x4c, 0xf1, 0x01, 0x4b, 0x7b, 0x7d, 0xd7, 0x55, 0x18, 0x9d, 0x5b, 0xf3, 0x07, 0x5d, 0x63, 0xf7, + 0x81, 0xcd, 0x02, 0x66, 0x5f, 0xbc, 0x8f, 0x9b, 0x4a, 0xf1, 0x82, 0xe2, 0xcc, 0x4c, 0x50, 0x8f, + 0x5b, 0xb3, 0x8d, 0x21, 0x64, 0x21, 0x64, 0x21, 0x64, 0xed, 0x69, 0xc8, 0x8a, 0x7e, 0x3b, 0xd4, + 0x52, 0xb1, 0x62, 0xa1, 0x47, 0xe2, 0x1e, 0xeb, 0x41, 0x87, 0x52, 0xb9, 0xb5, 0x06, 0xc1, 0xfb, + 0x7a, 0x74, 0x3f, 0xed, 0xb1, 0x13, 0xd6, 0xb5, 0x62, 0x21, 0x24, 0xe8, 0x9b, 0x9c, 0xc9, 0x8b, + 0x16, 0x32, 0x2b, 0x41, 0xca, 0x9a, 0x45, 0x05, 0x9a, 0x05, 0x34, 0x0b, 0x68, 0x16, 0x00, 0x40, + 0x00, 0x20, 0x00, 0x10, 0x9a, 0x05, 0x34, 0x0b, 0x68, 0x16, 0xd0, 0x2c, 0x10, 0xb2, 0x10, 0xb2, + 0x10, 0xb2, 0xa0, 0x59, 0xe4, 0x46, 0xb3, 0x48, 0xc9, 0x26, 0xcb, 0x89, 0x64, 0x81, 0x3d, 0x96, + 0x0a, 0x83, 0xb9, 0xbb, 0x2d, 0x96, 0xe3, 0xe1, 0x4b, 0x72, 0xf7, 0xd6, 0x42, 0x67, 0x18, 0x66, + 0x18, 0x3a, 0x2f, 0xde, 0x04, 0xc2, 0x04, 0x77, 0x74, 0x6d, 0x6a, 0x0c, 0xbb, 0xbc, 0xb0, 0xcb, + 0x4b, 0xd1, 0x55, 0x08, 0xef, 0xf2, 0x9a, 0xce, 0x3f, 0x79, 0xd1, 0x74, 0xa6, 0x0d, 0xec, 0xf6, + 0x82, 0x72, 0x9a, 0x37, 0xe5, 0x54, 0x72, 0x23, 0xe4, 0xd2, 0xc4, 0x91, 0x5e, 0xb4, 0x51, 0x30, + 0x15, 0xa4, 0x9c, 0x48, 0x39, 0x77, 0x9f, 0x72, 0xca, 0x9a, 0xde, 0x34, 0x4a, 0xb9, 0xae, 0x6f, + 0xc9, 0xa7, 0x35, 0xab, 0xa3, 0xd6, 0xb4, 0x4d, 0xc5, 0xd1, 0xa1, 0x79, 0x3b, 0x52, 0xd9, 0x44, + 0x29, 0x4d, 0x55, 0x93, 0xc9, 0x52, 0x9b, 0xae, 0x36, 0x13, 0xd6, 0x66, 0xca, 0xfa, 0x4c, 0x5a, + 0xcd, 0xb4, 0x15, 0x4d, 0x9c, 0x4e, 0x5d, 0x5a, 0x9a, 0x79, 0x36, 0xb3, 0x9c, 0xae, 0xe9, 0x2a, + 0xbd, 0x5c, 0xbf, 0x14, 0x45, 0x2b, 0x04, 0x6d, 0x2d, 0xbd, 0x62, 0x7c, 0x44, 0xd0, 0x28, 0xcd, + 0x2b, 0xfc, 0x93, 0xff, 0x68, 0xac, 0xab, 0x40, 0xfd, 0x4a, 0xff, 0xe2, 0x70, 0x54, 0x3e, 0xd0, + 0x36, 0x4b, 0xfc, 0x8a, 0xff, 0xfa, 0x11, 0x2f, 0x91, 0xb5, 0xff, 0xf3, 0x03, 0xe1, 0x50, 0x11, + 0xbe, 0xfa, 0xbf, 0x38, 0x54, 0x47, 0x18, 0xaa, 0x9f, 0x07, 0xe9, 0x68, 0xe5, 0x69, 0x47, 0xf5, + 0x08, 0x14, 0xa6, 0xea, 0x8c, 0x54, 0x60, 0x70, 0x8a, 0x48, 0xb1, 0x42, 0x83, 0x18, 0x35, 0x0c, + 0xa4, 0x03, 0xd2, 0x01, 0xe9, 0x52, 0x8a, 0x74, 0xcc, 0xeb, 0x77, 0x59, 0x40, 0x91, 0x7b, 0xcd, + 0x41, 0x5d, 0x95, 0xa0, 0xad, 0xba, 0xd7, 0xef, 0x0e, 0x1e, 0xf6, 0x67, 0x06, 0x9d, 0xab, 0xcd, + 0x42, 0x2b, 0x70, 0x7a, 0xb4, 0x69, 0xf2, 0x6c, 0xa3, 0x70, 0xaa, 0x70, 0xaa, 0x70, 0xaa, 0x29, + 0x75, 0xaa, 0x21, 0x0f, 0x1c, 0xef, 0x85, 0xd2, 0x9f, 0x9e, 0x65, 0xd0, 0x07, 0x8a, 0x95, 0xc3, + 0xd9, 0xda, 0xa9, 0x22, 0x65, 0x72, 0xe0, 0xf7, 0xe0, 0xf7, 0xe0, 0xf7, 0x12, 0xf7, 0x7b, 0x7d, + 0xc7, 0xe3, 0x47, 0x15, 0x42, 0xbf, 0x77, 0x0a, 0x19, 0x6f, 0x27, 0x0e, 0x0e, 0x32, 0x5e, 0x72, + 0x32, 0x9e, 0xae, 0xa1, 0xaa, 0x56, 0xce, 0xab, 0xe7, 0x27, 0xa7, 0x95, 0xf3, 0x63, 0xe8, 0x79, + 0xfb, 0xa0, 0xe7, 0x2d, 0x6c, 0x67, 0xa3, 0x03, 0xaf, 0xc5, 0x86, 0x81, 0x60, 0x40, 0x30, 0x20, + 0x58, 0x4a, 0x11, 0x4c, 0xfd, 0x45, 0x80, 0xa5, 0xdc, 0x93, 0x02, 0xc2, 0x66, 0x5f, 0x0c, 0x98, + 0x0c, 0xde, 0xa7, 0xc5, 0xad, 0xce, 0xb3, 0xff, 0xb6, 0xb4, 0xed, 0x79, 0xf6, 0x1f, 0x67, 0x5e, + 0x4c, 0x8b, 0x7e, 0xa7, 0xf0, 0x56, 0xda, 0x6e, 0xfd, 0x76, 0xd7, 0xec, 0xf5, 0x1c, 0xef, 0x85, + 0xce, 0x5f, 0x4f, 0x1a, 0x84, 0x9f, 0x86, 0x9f, 0x86, 0x9f, 0x4e, 0xa9, 0x9f, 0x76, 0x6c, 0xe6, + 0x71, 0x87, 0xbf, 0x13, 0xfb, 0x6a, 0x02, 0xd6, 0x2f, 0x5e, 0x8f, 0x6f, 0xed, 0xc2, 0x0c, 0x09, + 0xe7, 0xf2, 0xe4, 0xc1, 0x3f, 0x3f, 0xd4, 0x6e, 0xeb, 0xed, 0xdb, 0x5a, 0xa3, 0x71, 0x7d, 0xf7, + 0xa5, 0xdd, 0x78, 0xb8, 0x6f, 0xdd, 0x5f, 0xde, 0xdf, 0x14, 0x29, 0x8f, 0x33, 0x08, 0xc9, 0xb2, + 0x7d, 0xda, 0x8c, 0x7f, 0xae, 0x1f, 0xbe, 0xdc, 0x36, 0x8a, 0x69, 0xcc, 0x75, 0x75, 0x3d, 0xee, + 0xe7, 0x46, 0xbb, 0xb5, 0x4f, 0x0f, 0x5c, 0xdb, 0xbf, 0xf1, 0xfd, 0xbc, 0x4f, 0x0f, 0x7c, 0xb1, + 0x5f, 0xe3, 0x7b, 0x79, 0xf1, 0x50, 0x4c, 0x99, 0xcc, 0xf3, 0x94, 0xd9, 0x63, 0x64, 0x54, 0xd2, + 0x05, 0xbf, 0xc7, 0xf5, 0xc8, 0x3c, 0x8b, 0x0d, 0x23, 0x7d, 0x40, 0xfa, 0x80, 0xf4, 0x01, 0x32, + 0x8f, 0xac, 0xcc, 0x93, 0x74, 0xfd, 0x87, 0xdd, 0xba, 0x65, 0x1e, 0x38, 0xcf, 0x7d, 0x6e, 0x06, + 0xef, 0x46, 0xe8, 0xfa, 0xdc, 0x20, 0xde, 0xfb, 0xb0, 0xb2, 0x75, 0x38, 0x68, 0x38, 0x68, 0x38, + 0xe8, 0xb4, 0xea, 0x3b, 0xc4, 0x3b, 0x21, 0xf0, 0x42, 0x93, 0x6c, 0x5c, 0xd3, 0xb4, 0xbc, 0x5e, + 0x29, 0x57, 0x4f, 0xab, 0x67, 0x47, 0x27, 0xd5, 0x33, 0x6c, 0x89, 0xa0, 0x1e, 0xb3, 0x92, 0xee, + 0x31, 0x3b, 0xc5, 0x96, 0x88, 0x64, 0xb3, 0xed, 0x9f, 0x19, 0x79, 0x3d, 0x5e, 0xb1, 0x68, 0x57, + 0xd4, 0x8e, 0x86, 0x7a, 0x4f, 0x1b, 0xca, 0x15, 0x1d, 0x4e, 0x7f, 0x3e, 0x54, 0x2a, 0x6d, 0x51, + 0xa0, 0xaf, 0x12, 0x35, 0xff, 0xfb, 0xda, 0xf4, 0xa6, 0xdb, 0xd3, 0x9f, 0xa5, 0x8a, 0x96, 0xcb, + 0x4f, 0x10, 0x99, 0xb2, 0x97, 0x6a, 0x40, 0x4f, 0xb2, 0x89, 0x19, 0xa5, 0x2e, 0xb5, 0x11, 0x39, + 0xea, 0x8e, 0xe8, 0x76, 0xac, 0xb9, 0x2d, 0x75, 0x29, 0x75, 0x96, 0xe9, 0x6e, 0x7c, 0x98, 0xdc, + 0x81, 0x0c, 0x4b, 0x03, 0x20, 0x5b, 0x3d, 0xb2, 0x40, 0x59, 0x3b, 0xa9, 0x02, 0x1f, 0x06, 0x1f, + 0x86, 0xda, 0x49, 0xa8, 0x9d, 0x04, 0x41, 0x10, 0x82, 0x60, 0x16, 0x04, 0x41, 0xd4, 0x4e, 0xca, + 0xbd, 0xd4, 0x88, 0xda, 0x49, 0xa8, 0x9d, 0x04, 0x61, 0x31, 0x33, 0xc2, 0x22, 0x6a, 0x27, 0x01, + 0xe9, 0x80, 0x74, 0x40, 0x3a, 0xe9, 0x99, 0x87, 0xda, 0x49, 0x5a, 0x9c, 0x2b, 0x6a, 0x27, 0xc1, + 0xa9, 0xc2, 0xa9, 0xee, 0xab, 0x53, 0x45, 0xed, 0x24, 0xd4, 0x4e, 0x82, 0xdf, 0x83, 0xdf, 0xdb, + 0x37, 0xbf, 0x87, 0xda, 0x49, 0x69, 0x91, 0xf1, 0x50, 0x3b, 0x09, 0xb5, 0x93, 0x50, 0x3b, 0x69, + 0xaf, 0xf4, 0x3c, 0xd4, 0x4e, 0x02, 0x82, 0x01, 0xc1, 0xf6, 0x1d, 0xc1, 0x50, 0x3b, 0x29, 0x6b, + 0x7e, 0x1b, 0xb5, 0x93, 0xe0, 0xa7, 0xe1, 0xa7, 0xf7, 0xcd, 0x4f, 0xa3, 0x76, 0x12, 0x6a, 0x27, + 0xa1, 0x76, 0x52, 0x8e, 0x1f, 0x18, 0xb5, 0x93, 0xf2, 0xfd, 0xc0, 0xa8, 0x9d, 0xb4, 0x6b, 0x99, + 0x07, 0xb5, 0x93, 0x50, 0x3b, 0x09, 0xe9, 0x03, 0xd2, 0x07, 0xc8, 0x3c, 0xa9, 0x94, 0x79, 0x50, + 0x3b, 0x09, 0xb5, 0x93, 0xe0, 0xa0, 0xe1, 0xa0, 0xf7, 0x54, 0xdf, 0x41, 0xed, 0xa4, 0xf8, 0x37, + 0x86, 0xda, 0x49, 0x33, 0x5f, 0x80, 0x2d, 0x11, 0xa8, 0x9d, 0x44, 0x9e, 0x2b, 0xa3, 0x76, 0x52, + 0xcc, 0xf8, 0x96, 0xf9, 0xda, 0x49, 0x2a, 0x95, 0x2d, 0x0a, 0x3b, 0x2a, 0x9d, 0xd4, 0x1c, 0xde, + 0x73, 0x52, 0x55, 0x47, 0x0e, 0x34, 0x4e, 0xa4, 0x01, 0xd2, 0xc9, 0x6e, 0x56, 0x2e, 0xde, 0x38, + 0x21, 0xaf, 0x71, 0x2e, 0x57, 0xa0, 0x61, 0x10, 0x44, 0xeb, 0x2e, 0x1b, 0xf6, 0x6d, 0xf1, 0x53, + 0xc1, 0xeb, 0xbb, 0xae, 0x44, 0x79, 0x95, 0x5b, 0xf3, 0x87, 0x7a, 0x23, 0xf7, 0x81, 0xcd, 0x02, + 0x66, 0x5f, 0xbc, 0x8f, 0x9b, 0xd0, 0xda, 0xe1, 0x8a, 0x16, 0xbb, 0x3b, 0x4b, 0x2d, 0x4a, 0x55, + 0xbf, 0x49, 0xda, 0x36, 0xc5, 0xac, 0x32, 0xbe, 0x6d, 0xc5, 0xfb, 0x64, 0xcc, 0xc9, 0x20, 0x3b, + 0x09, 0x12, 0x1e, 0x7c, 0x81, 0x11, 0x4f, 0x6a, 0xa4, 0xe3, 0x0d, 0xef, 0xf6, 0xc1, 0x8a, 0x31, + 0x50, 0x45, 0x9f, 0xc7, 0x1f, 0x9d, 0x69, 0x06, 0xcf, 0xe3, 0xbe, 0xeb, 0x26, 0x08, 0xfc, 0xc2, + 0xc2, 0x85, 0x8c, 0x40, 0xa1, 0x28, 0x44, 0xc8, 0x0a, 0x0e, 0xca, 0xc2, 0x82, 0xb2, 0x80, 0xa0, + 0x2e, 0x14, 0xd0, 0x3a, 0x08, 0xd1, 0xb2, 0x47, 0x45, 0x6b, 0x32, 0x3b, 0x04, 0x7b, 0x7e, 0x32, + 0xe0, 0x52, 0x25, 0x2c, 0x25, 0x73, 0x56, 0x69, 0x0d, 0x4e, 0x45, 0x73, 0x23, 0xd2, 0xd8, 0x54, + 0x35, 0x35, 0x32, 0x0d, 0x8d, 0x4c, 0x33, 0xa3, 0xd3, 0xc8, 0xf4, 0x92, 0xaa, 0x6c, 0x25, 0xb0, + 0x45, 0x31, 0xfa, 0x25, 0x30, 0xbd, 0xbe, 0x6b, 0x06, 0x0e, 0x7f, 0x57, 0xaf, 0xcb, 0xb7, 0xa1, + 0x6d, 0x14, 0x1c, 0x45, 0xb1, 0xbe, 0x9d, 0xcb, 0xd5, 0x59, 0x2d, 0x38, 0x4a, 0xb3, 0xdd, 0x90, + 0x62, 0x9b, 0x21, 0xed, 0xf6, 0xc2, 0xe8, 0x01, 0x5b, 0x0f, 0xd7, 0x17, 0xdf, 0x5a, 0xb5, 0x87, + 0x3f, 0xda, 0xcd, 0x9b, 0xfb, 0x56, 0xfb, 0xcb, 0x43, 0xed, 0xee, 0xdb, 0x4d, 0xed, 0xe1, 0xba, + 0xf5, 0x87, 0xea, 0xa4, 0x24, 0xdc, 0x52, 0x48, 0xbc, 0x95, 0x72, 0xf0, 0xcc, 0xa3, 0xc7, 0xad, + 0x7c, 0x3c, 0xfe, 0x42, 0xb0, 0x06, 0xf3, 0x21, 0xbd, 0x4f, 0x98, 0xf7, 0xe7, 0x2b, 0x7f, 0xac, + 0x90, 0x3c, 0xe2, 0xc1, 0x6e, 0x34, 0xde, 0x9f, 0x29, 0x2e, 0x19, 0xcc, 0xb9, 0x63, 0x74, 0xc3, + 0x17, 0xc3, 0xec, 0x73, 0x9f, 0x80, 0x50, 0x66, 0x5b, 0x03, 0x93, 0x80, 0x49, 0xc0, 0x24, 0x92, + 0x33, 0xe7, 0xd9, 0xf7, 0x5d, 0x66, 0x7a, 0x14, 0x3c, 0x52, 0xce, 0x80, 0xfb, 0x61, 0x3f, 0x7a, + 0xcc, 0xe2, 0xcc, 0xa6, 0x73, 0x41, 0x51, 0x8b, 0x70, 0x43, 0x70, 0x43, 0x70, 0x43, 0x92, 0x33, + 0x47, 0xb9, 0x58, 0x93, 0x62, 0x91, 0xa6, 0x64, 0xbd, 0x10, 0x0f, 0x4c, 0x2f, 0xec, 0x3a, 0x9c, + 0xce, 0x0b, 0x45, 0x2d, 0xc2, 0x0b, 0xc1, 0x0b, 0xc1, 0x0b, 0xed, 0x8f, 0x17, 0xda, 0xb7, 0x65, + 0x7d, 0x9f, 0x7b, 0xf2, 0x27, 0x93, 0x11, 0x2f, 0xe8, 0xde, 0x73, 0x4f, 0xea, 0xc0, 0x31, 0x81, + 0x05, 0x7a, 0xa1, 0xc5, 0x6a, 0x99, 0x43, 0x79, 0x94, 0x0e, 0xe3, 0x51, 0x5e, 0x2a, 0xab, 0x60, + 0xa9, 0x0c, 0x4b, 0x65, 0x31, 0x6f, 0x53, 0x7a, 0xa9, 0xec, 0xd9, 0xb4, 0xbe, 0xbf, 0x04, 0x7e, + 0xdf, 0xb3, 0x8d, 0x67, 0xd7, 0xb7, 0xbe, 0x1b, 0x2c, 0x08, 0xfc, 0x20, 0x54, 0x87, 0xaf, 0x75, + 0x0d, 0x83, 0xc1, 0xc0, 0x60, 0x60, 0x30, 0xc9, 0x99, 0x63, 0xf9, 0x7d, 0x8f, 0xb3, 0x40, 0xe9, + 0x78, 0x9b, 0x89, 0x29, 0x29, 0xbc, 0x15, 0x40, 0xf4, 0x9e, 0x06, 0xc1, 0xcb, 0x2c, 0x94, 0xef, + 0x65, 0x10, 0xef, 0xed, 0xa7, 0xae, 0x48, 0xa9, 0x63, 0x0b, 0x3f, 0xc1, 0x7a, 0x13, 0xe9, 0x6b, + 0x16, 0xba, 0x86, 0xa0, 0x7c, 0x56, 0xad, 0x9e, 0x9c, 0x56, 0xab, 0xa5, 0xd3, 0xa3, 0xd3, 0xd2, + 0xf9, 0xf1, 0x71, 0xf9, 0xa4, 0x7c, 0x9c, 0xe2, 0x51, 0xd9, 0xd1, 0x8b, 0x0c, 0x4f, 0x29, 0x56, + 0x87, 0x2c, 0xdf, 0x66, 0xc6, 0x9b, 0xe3, 0xbb, 0xc3, 0x8c, 0x8b, 0x80, 0x4f, 0x16, 0x1b, 0x04, + 0x97, 0x80, 0x4b, 0xc0, 0x25, 0xe0, 0x12, 0x70, 0x09, 0xb8, 0x04, 0x5c, 0x02, 0x2e, 0x89, 0xd9, + 0xcd, 0x43, 0x55, 0x83, 0x8d, 0x35, 0x0e, 0x02, 0x2c, 0x59, 0x68, 0x0f, 0x54, 0x02, 0x2a, 0x01, + 0x95, 0x80, 0x4a, 0x40, 0x25, 0xa0, 0x12, 0x50, 0x09, 0xa8, 0x44, 0x90, 0x4a, 0x42, 0x66, 0xf9, + 0x9e, 0x4d, 0x88, 0x25, 0x93, 0x06, 0xc1, 0x25, 0xe0, 0x12, 0x70, 0x09, 0xb8, 0x04, 0x5c, 0x02, + 0x2e, 0x01, 0x97, 0x80, 0x4b, 0xe2, 0x72, 0x49, 0xe8, 0x05, 0x04, 0x30, 0x32, 0x68, 0x45, 0x8d, + 0x40, 0xca, 0x20, 0x10, 0x10, 0x48, 0xd6, 0x08, 0x44, 0x76, 0x93, 0x57, 0xd4, 0x80, 0xf9, 0x46, + 0x78, 0x88, 0xd3, 0xa0, 0x31, 0x14, 0xf8, 0x8d, 0x63, 0xa4, 0xfc, 0xbd, 0xc7, 0x42, 0x54, 0xf7, + 0xa5, 0x68, 0x78, 0xc1, 0x82, 0x47, 0x3d, 0x8b, 0xd2, 0xbe, 0x0b, 0x73, 0xce, 0x66, 0x96, 0xd3, + 0x35, 0x5d, 0xa5, 0x04, 0x63, 0x29, 0x62, 0x56, 0x08, 0xda, 0x5a, 0xc2, 0xac, 0x0a, 0x8a, 0x06, + 0xcb, 0x0d, 0x47, 0x05, 0xc7, 0x27, 0x67, 0xa5, 0x56, 0xf0, 0x11, 0x86, 0x0a, 0xa7, 0x26, 0xcb, + 0x43, 0x9b, 0xe3, 0x85, 0xdc, 0xf4, 0x38, 0x1d, 0xb8, 0x4d, 0x1a, 0x04, 0xbc, 0x01, 0xde, 0x00, + 0x6f, 0x80, 0x37, 0xc0, 0x1b, 0xe0, 0x0d, 0xf0, 0x06, 0x78, 0x03, 0xbc, 0xe9, 0x80, 0x37, 0xce, + 0x82, 0x37, 0xd3, 0xa5, 0xa4, 0xb7, 0x71, 0x8b, 0xc0, 0x37, 0xe0, 0x1b, 0xf0, 0x2d, 0x75, 0xf8, + 0x16, 0x72, 0x93, 0x1b, 0x44, 0x46, 0x5a, 0xa0, 0x59, 0xe8, 0x8f, 0x9a, 0xfa, 0xe6, 0x8d, 0x62, + 0x43, 0xd1, 0x33, 0x3d, 0x5f, 0x6d, 0x2b, 0x0f, 0x20, 0xae, 0x04, 0x32, 0xd8, 0xf7, 0xd3, 0xba, + 0xf4, 0x6d, 0x48, 0x00, 0xd7, 0xa5, 0x9b, 0xeb, 0xba, 0x26, 0xe1, 0xd9, 0xa9, 0x83, 0xc6, 0x40, + 0x73, 0xa0, 0x39, 0xd0, 0x1c, 0xc4, 0x38, 0x88, 0x71, 0x10, 0xe3, 0xc0, 0x71, 0x10, 0xe3, 0x00, + 0x6d, 0x5a, 0xa0, 0xcd, 0xe0, 0x4e, 0x97, 0x91, 0x92, 0xdb, 0xa8, 0x45, 0xe0, 0x1b, 0xf0, 0x0d, + 0xf8, 0x96, 0x3a, 0x7c, 0x1b, 0xd8, 0x26, 0x77, 0xac, 0xef, 0x21, 0x29, 0xc0, 0x41, 0x8a, 0x83, + 0x14, 0x07, 0x84, 0x83, 0x14, 0x07, 0xaa, 0x4b, 0x05, 0xd5, 0x11, 0x38, 0x96, 0x29, 0xd0, 0x39, + 0x1e, 0x58, 0x0e, 0x2c, 0x07, 0x96, 0x83, 0x14, 0x07, 0x29, 0x0e, 0x52, 0x1c, 0x38, 0x0e, 0x52, + 0x1c, 0xa0, 0x4d, 0x0f, 0xb4, 0x51, 0x4b, 0x71, 0x93, 0x16, 0x81, 0x6f, 0xc0, 0x37, 0xe0, 0x1b, + 0xa4, 0x38, 0x48, 0x71, 0x90, 0xe2, 0x80, 0x70, 0x90, 0xe2, 0x40, 0x75, 0x09, 0x5c, 0x29, 0x5b, + 0xd2, 0x44, 0xf1, 0x10, 0xbd, 0xa8, 0x1d, 0x4d, 0x87, 0xe9, 0x0d, 0xcf, 0x7d, 0x3b, 0x54, 0xa8, + 0x37, 0x54, 0xd0, 0x73, 0xb0, 0x5e, 0x73, 0x70, 0x5f, 0xed, 0xfa, 0xe0, 0xbe, 0x52, 0x5c, 0xed, + 0xa9, 0xc3, 0x2c, 0xc3, 0xf2, 0x83, 0x60, 0x78, 0x04, 0xb4, 0xf1, 0x3c, 0xb2, 0x54, 0xc5, 0xda, + 0x4f, 0x2b, 0xda, 0x44, 0x2d, 0x4a, 0x54, 0x82, 0x52, 0x64, 0x76, 0xd4, 0xa2, 0x44, 0x2d, 0x4a, + 0x0d, 0x70, 0x8c, 0x5a, 0x94, 0x3b, 0x87, 0x5e, 0xd4, 0xa2, 0x2c, 0xa0, 0x16, 0x65, 0x1c, 0x3a, + 0x79, 0xe7, 0x8c, 0x1e, 0x4f, 0x86, 0x8d, 0x82, 0x4f, 0xc0, 0x27, 0xe0, 0x13, 0xf0, 0x09, 0xf8, + 0x04, 0x7c, 0x02, 0x3e, 0x01, 0x9f, 0x08, 0xf0, 0x49, 0xdf, 0x1b, 0xc3, 0x84, 0xf9, 0xec, 0x32, + 0xb2, 0x33, 0xc6, 0xd6, 0xb6, 0x0c, 0x52, 0x01, 0xa9, 0x80, 0x54, 0x40, 0x2a, 0x20, 0x15, 0x90, + 0x0a, 0x48, 0x05, 0xa4, 0x22, 0x4d, 0x2a, 0x83, 0x98, 0xa5, 0x05, 0x54, 0x46, 0x0d, 0x83, 0x53, + 0xc0, 0x29, 0xe0, 0x14, 0x70, 0x0a, 0x38, 0x05, 0x9c, 0x02, 0x4e, 0x01, 0xa7, 0xc4, 0xec, 0xe6, + 0x9e, 0x1f, 0x72, 0x63, 0xc0, 0x14, 0xcf, 0x8c, 0xe0, 0x14, 0xb2, 0xb9, 0xd6, 0x70, 0x1a, 0x19, + 0x88, 0x64, 0xcf, 0x88, 0x04, 0xa7, 0x91, 0xe9, 0x31, 0x4a, 0x4a, 0xe3, 0x5c, 0x6b, 0xa4, 0x78, + 0xfb, 0x43, 0xd3, 0xdb, 0x1f, 0xd3, 0xde, 0xc5, 0x1b, 0x20, 0x0b, 0x73, 0x2f, 0x3b, 0x2f, 0xf0, + 0x96, 0xcf, 0xf0, 0xfa, 0x87, 0xdc, 0x78, 0xe0, 0x0d, 0x5e, 0xbc, 0xc1, 0x8b, 0x77, 0x3d, 0x92, + 0x49, 0x9a, 0xd4, 0xbf, 0x1f, 0xc7, 0x92, 0x81, 0xe2, 0x40, 0x71, 0xa0, 0x38, 0x50, 0x1c, 0x28, + 0x0e, 0x14, 0x07, 0x8a, 0x03, 0xc5, 0xed, 0x1f, 0xc5, 0xe1, 0x7c, 0xb2, 0x9d, 0x72, 0x1c, 0x18, + 0x0e, 0x75, 0x58, 0x12, 0xe5, 0x37, 0x9c, 0x4f, 0xb6, 0x27, 0x10, 0x87, 0x4a, 0x2c, 0xa8, 0xc4, + 0x82, 0x4a, 0x2c, 0x38, 0x9f, 0x4c, 0x3d, 0x64, 0xe0, 0x7c, 0x32, 0xa8, 0x72, 0x50, 0xe5, 0xa0, + 0xca, 0x41, 0x95, 0x83, 0x2a, 0xf7, 0xff, 0xb3, 0x77, 0x2e, 0x3d, 0x8d, 0x23, 0x51, 0x14, 0xde, + 0xf3, 0x2b, 0x90, 0xf7, 0xa1, 0x49, 0x80, 0x00, 0xcb, 0x40, 0xa7, 0x19, 0x34, 0x79, 0x30, 0xc1, + 0x68, 0xd4, 0x0b, 0x14, 0x99, 0xa4, 0xba, 0x65, 0xb5, 0x63, 0x33, 0xb6, 0x83, 0x9a, 0x45, 0xff, + 0xf7, 0x11, 0x79, 0x90, 0x00, 0x21, 0xb8, 0x1e, 0x0e, 0x76, 0xe5, 0x9b, 0x05, 0x1a, 0x89, 0x76, + 0xe1, 0x5b, 0x75, 0x1f, 0xe7, 0x9e, 0xaa, 0x3a, 0x06, 0xd0, 0xc1, 0xca, 0x81, 0xde, 0xf2, 0x47, + 0x6f, 0x7c, 0xa8, 0x0c, 0x56, 0x0e, 0x56, 0x6e, 0x6b, 0xf0, 0x1b, 0xea, 0xc8, 0x70, 0x72, 0x40, + 0x38, 0x38, 0x39, 0x50, 0x9d, 0xc5, 0xa8, 0x8e, 0x0f, 0x95, 0xc1, 0xc9, 0xc1, 0xc9, 0xc1, 0xc9, + 0xc1, 0xc9, 0xc1, 0xc9, 0x01, 0xe8, 0xe0, 0xe4, 0x40, 0x6f, 0xe5, 0x42, 0x6f, 0x7c, 0xb1, 0x0c, + 0x4e, 0x0e, 0x4e, 0x0e, 0x4e, 0x0e, 0x4e, 0x0e, 0x4e, 0x0e, 0x08, 0x07, 0x27, 0x07, 0xaa, 0x2b, + 0x06, 0xaa, 0xe3, 0x8b, 0x65, 0xaf, 0xbf, 0x58, 0x66, 0x40, 0x9b, 0x68, 0x37, 0xcf, 0x2f, 0x97, + 0x5d, 0x45, 0x49, 0xfa, 0x4d, 0x0c, 0xce, 0x44, 0xa1, 0xbf, 0x5f, 0x76, 0x1f, 0x0b, 0x83, 0x72, + 0x51, 0x4b, 0x83, 0xa1, 0x16, 0x85, 0x5a, 0x94, 0x26, 0x66, 0x47, 0x2d, 0x4a, 0xc7, 0xfb, 0x50, + 0x8b, 0x92, 0x0a, 0x52, 0x3a, 0x6f, 0x76, 0x4f, 0x36, 0xdd, 0x7d, 0xb3, 0x7b, 0x62, 0x7f, 0xeb, + 0xcd, 0xee, 0x09, 0xbb, 0x27, 0xf4, 0xd9, 0xa5, 0xe9, 0xb3, 0x51, 0x8b, 0x02, 0xc5, 0x81, 0xe2, + 0x40, 0x71, 0xa0, 0x38, 0x50, 0x1c, 0x28, 0x0e, 0x14, 0x07, 0x8a, 0xdb, 0x3a, 0x14, 0x87, 0x5a, + 0xd4, 0xa7, 0xe2, 0x38, 0x30, 0x1c, 0x67, 0x60, 0x36, 0x8a, 0xdf, 0x50, 0x8b, 0xda, 0x12, 0x10, + 0xc7, 0x29, 0x18, 0x4e, 0xc1, 0x70, 0x0a, 0x06, 0xb5, 0x28, 0xfd, 0x92, 0x81, 0x5a, 0x14, 0xac, + 0x1c, 0xac, 0x1c, 0xac, 0x1c, 0xac, 0x1c, 0xac, 0x1c, 0x80, 0x0e, 0x56, 0x0e, 0xf4, 0x96, 0x3f, + 0x7a, 0x43, 0x2d, 0x0a, 0x56, 0x0e, 0x56, 0x6e, 0x6b, 0xf0, 0x1b, 0x37, 0xd3, 0xe0, 0xe4, 0x80, + 0x70, 0x70, 0x72, 0xa0, 0x3a, 0x8b, 0x51, 0x1d, 0x6a, 0x51, 0x70, 0x72, 0x70, 0x72, 0x70, 0x72, + 0x70, 0x72, 0x70, 0x72, 0x00, 0x3a, 0x38, 0x39, 0xd0, 0x5b, 0xb9, 0xd0, 0x1b, 0x6a, 0x51, 0x70, + 0x72, 0x70, 0x72, 0x70, 0x72, 0x70, 0x72, 0x70, 0x72, 0x40, 0x38, 0x38, 0x39, 0x50, 0x5d, 0x31, + 0x50, 0x1d, 0x6a, 0x51, 0x6f, 0xd4, 0xa2, 0xb4, 0xa5, 0x89, 0x76, 0x73, 0x15, 0x8b, 0x8a, 0x45, + 0xf1, 0xb5, 0xa2, 0xfe, 0xab, 0x3c, 0xcc, 0xd2, 0x83, 0xa6, 0x4e, 0xd4, 0x7c, 0x20, 0x34, 0xa2, + 0xd0, 0x88, 0xd2, 0x44, 0xea, 0x68, 0x44, 0xe9, 0x78, 0x1f, 0x1a, 0x51, 0xf4, 0xda, 0xf4, 0xda, + 0xec, 0x95, 0x68, 0xe1, 0xf6, 0x1a, 0x7d, 0xb6, 0xda, 0x72, 0xb0, 0x55, 0xc2, 0x56, 0x09, 0x4d, + 0x75, 0x69, 0x9a, 0x6a, 0xa4, 0xa1, 0x00, 0x6f, 0x80, 0x37, 0xc0, 0x1b, 0xe0, 0x0d, 0xf0, 0x06, + 0x78, 0x03, 0xbc, 0x01, 0xde, 0xb6, 0x05, 0xbc, 0xa1, 0x08, 0x05, 0x7c, 0x03, 0xbe, 0x6d, 0x0f, + 0x7c, 0x43, 0x11, 0x6a, 0x4b, 0x40, 0x1c, 0x27, 0x5d, 0x38, 0xe9, 0xc2, 0x49, 0x17, 0x14, 0xa1, + 0xf4, 0x4b, 0x06, 0x8a, 0x50, 0xa0, 0x39, 0xd0, 0x1c, 0x64, 0x1c, 0x64, 0x1c, 0x64, 0x1c, 0x38, + 0x0e, 0x32, 0x0e, 0xd0, 0x96, 0x1b, 0x68, 0x43, 0x08, 0x0a, 0xf8, 0x06, 0x7c, 0xdb, 0x1a, 0xf8, + 0xc6, 0xa5, 0x33, 0xa8, 0x38, 0x20, 0x1c, 0x54, 0x1c, 0xa8, 0xce, 0x62, 0x54, 0x87, 0x10, 0x14, + 0x58, 0x0e, 0x2c, 0x07, 0x15, 0x07, 0x15, 0x07, 0x15, 0x07, 0x8e, 0x83, 0x8a, 0x03, 0xb4, 0x95, + 0x02, 0xb4, 0xa1, 0xff, 0x04, 0x7c, 0x03, 0xbe, 0x41, 0xc5, 0x41, 0xc5, 0x41, 0xc5, 0x01, 0xe1, + 0xa0, 0xe2, 0x40, 0x75, 0xc5, 0x40, 0x75, 0xe8, 0x3f, 0xbd, 0xd6, 0x7f, 0xd2, 0x93, 0x1c, 0xda, + 0xcd, 0x53, 0xfb, 0xe9, 0x9f, 0x69, 0xd0, 0x15, 0x58, 0xf8, 0x29, 0x1e, 0xfa, 0x95, 0x51, 0xf2, + 0x53, 0x5f, 0xf8, 0x69, 0x3e, 0x90, 0x9e, 0xf0, 0xd3, 0x3e, 0xc2, 0x4f, 0xa6, 0xa1, 0x3b, 0xc2, + 0x4f, 0x79, 0x67, 0x49, 0x6d, 0x34, 0xbe, 0x74, 0x3b, 0x25, 0xf6, 0x43, 0x1d, 0xdd, 0xa6, 0x67, + 0xe6, 0xf4, 0xa4, 0xc0, 0x39, 0x27, 0x11, 0x0f, 0x22, 0x16, 0xc1, 0x63, 0x45, 0xc4, 0x71, 0x14, + 0x8b, 0x61, 0x65, 0x8e, 0xea, 0xb5, 0x93, 0xd0, 0xbb, 0x23, 0x93, 0x95, 0xc8, 0x4a, 0x64, 0x25, + 0x45, 0xcf, 0x19, 0x44, 0xe3, 0x30, 0x15, 0xb1, 0x16, 0x33, 0x60, 0x80, 0x11, 0x30, 0xd4, 0xb1, + 0x1b, 0x20, 0x4d, 0x4c, 0x76, 0xe8, 0x86, 0xdb, 0x3d, 0xd3, 0x1d, 0x79, 0x1e, 0xbd, 0x9c, 0x81, + 0x0e, 0xdc, 0x68, 0xe7, 0x9d, 0xd7, 0x12, 0xe4, 0xd7, 0x69, 0xe7, 0xb2, 0x2a, 0x9f, 0xd4, 0xd1, + 0xde, 0x16, 0x18, 0xa9, 0xa4, 0xb1, 0x7f, 0x37, 0x4e, 0xbd, 0xf8, 0xb1, 0x92, 0x04, 0x51, 0x5a, + 0xf9, 0x19, 0x7b, 0xe1, 0x38, 0xf0, 0x62, 0x3f, 0x7d, 0xd4, 0xc7, 0x2a, 0x6b, 0xc6, 0x06, 0xad, + 0x80, 0x56, 0x40, 0x2b, 0x8a, 0x9e, 0xe3, 0x0f, 0x45, 0x98, 0xfa, 0xe9, 0x63, 0x2c, 0x7e, 0x98, + 0x68, 0xa4, 0x34, 0x32, 0xb6, 0x73, 0x39, 0x7b, 0x95, 0x33, 0x2f, 0x31, 0xb8, 0x95, 0xea, 0xf6, + 0x2e, 0xcf, 0x6e, 0xdc, 0x46, 0xef, 0x7b, 0xff, 0xba, 0xd5, 0x75, 0xfb, 0x17, 0xbd, 0x46, 0xe7, + 0xa6, 0xd5, 0xe8, 0x5d, 0xba, 0xdf, 0x75, 0x9d, 0x72, 0x52, 0xb8, 0x12, 0x23, 0x7b, 0x22, 0x86, + 0x2a, 0xf3, 0xb2, 0xcd, 0x53, 0x73, 0x6b, 0x7b, 0x47, 0x17, 0x4e, 0x11, 0x20, 0x48, 0x6e, 0x16, + 0xda, 0x6e, 0x5f, 0x75, 0xaf, 0x66, 0xc4, 0x44, 0xad, 0x11, 0x6e, 0x37, 0x9d, 0x17, 0x37, 0x83, + 0x57, 0xd2, 0x09, 0x09, 0x5b, 0xf1, 0xc6, 0x69, 0x64, 0x00, 0xa1, 0x2c, 0x8f, 0x06, 0x26, 0x01, + 0x93, 0x80, 0x49, 0x14, 0x3d, 0xe7, 0x2e, 0x8a, 0x02, 0xe1, 0x85, 0x26, 0xf0, 0x48, 0xb5, 0x04, + 0xe9, 0x47, 0xfc, 0xbe, 0x17, 0x83, 0x54, 0x0c, 0xcd, 0xa5, 0xa0, 0xe7, 0x11, 0x49, 0x43, 0xa4, + 0x21, 0xd2, 0x90, 0xa2, 0xe7, 0x6c, 0xc7, 0xf6, 0xd2, 0x3c, 0x67, 0xc4, 0x62, 0xf0, 0x60, 0x2e, + 0x03, 0x4d, 0x46, 0x23, 0xfb, 0x90, 0x7d, 0xc8, 0x3e, 0x64, 0x9f, 0x0c, 0xd9, 0x27, 0x8d, 0xbd, + 0x30, 0x19, 0xf9, 0xa9, 0xb9, 0x0c, 0xf4, 0x3c, 0x22, 0x59, 0x88, 0x2c, 0x44, 0x16, 0x22, 0x0b, + 0xad, 0x79, 0xc7, 0x71, 0xe8, 0x3d, 0x78, 0x7e, 0xe0, 0xdd, 0x05, 0xc2, 0xdc, 0xe9, 0x9a, 0x55, + 0x83, 0x92, 0x8b, 0xc8, 0x45, 0xe4, 0x22, 0x45, 0xcf, 0xe1, 0x60, 0xcd, 0xab, 0x17, 0xe1, 0x60, + 0x8d, 0xd6, 0x7f, 0x1c, 0xac, 0x29, 0xe4, 0xaa, 0xd8, 0x7e, 0xb0, 0x66, 0x27, 0x47, 0x1f, 0xd5, + 0xbd, 0x82, 0x92, 0xeb, 0xd5, 0x13, 0x47, 0xe5, 0xf0, 0x73, 0x3e, 0x57, 0x4d, 0xe4, 0x8a, 0x67, + 0xf6, 0x25, 0xcb, 0xf6, 0x2f, 0x33, 0x2e, 0xaa, 0xea, 0x62, 0xe6, 0xb4, 0x88, 0x12, 0xcb, 0x67, + 0x7e, 0xd9, 0xb2, 0x2d, 0xd8, 0xc7, 0xd3, 0x9f, 0x61, 0xea, 0x9d, 0xa9, 0xb3, 0x66, 0x9d, 0xf1, + 0x17, 0xdf, 0xca, 0xc8, 0xea, 0xe3, 0x92, 0x5f, 0x6e, 0x5f, 0x20, 0xf8, 0x8c, 0xa2, 0x22, 0x2a, + 0x88, 0x5d, 0x13, 0xa1, 0xab, 0x22, 0x72, 0x6d, 0x04, 0xae, 0x8d, 0xb8, 0xf5, 0x11, 0xb6, 0xd9, + 0xb0, 0x97, 0xfd, 0x32, 0xba, 0xe3, 0x0d, 0x47, 0x7e, 0x58, 0x91, 0x73, 0xdb, 0x37, 0xab, 0xbe, + 0x3c, 0x88, 0xe4, 0xfc, 0xa9, 0xe1, 0x16, 0xe5, 0xb6, 0x54, 0xa7, 0x1d, 0x35, 0xd4, 0x86, 0xea, + 0xb6, 0x9f, 0xc6, 0xda, 0x4e, 0x63, 0xed, 0xa6, 0xb9, 0x36, 0x33, 0x5f, 0x80, 0xa3, 0xdc, 0x4e, + 0xae, 0x72, 0xf4, 0x89, 0xbc, 0x85, 0xca, 0xf2, 0xcf, 0xd3, 0xf7, 0xa1, 0xc2, 0xb3, 0xcd, 0x70, + 0x3c, 0x7a, 0xb2, 0xe0, 0x4f, 0x5e, 0x18, 0x44, 0x22, 0x67, 0x0f, 0x45, 0x32, 0x88, 0xfd, 0x7b, + 0x25, 0xbc, 0xb8, 0xa4, 0x65, 0xb6, 0x18, 0x84, 0xcc, 0x41, 0xe6, 0xb0, 0x36, 0x73, 0x28, 0x93, + 0xe1, 0x8a, 0x24, 0x78, 0x3e, 0x31, 0xef, 0x87, 0x43, 0xf1, 0x5b, 0x3d, 0xda, 0xa7, 0x8f, 0x13, + 0xe7, 0xc4, 0xb9, 0xb5, 0x71, 0x3e, 0xf6, 0xc3, 0xf4, 0xa0, 0xa6, 0x11, 0xe7, 0xc7, 0x0a, 0x8f, + 0xea, 0xb1, 0xca, 0x1a, 0xf4, 0xba, 0x09, 0x16, 0xd9, 0x94, 0xd0, 0x9c, 0x21, 0xd6, 0xd8, 0x24, + 0x2f, 0xa9, 0x23, 0x0c, 0x68, 0x82, 0x1d, 0x36, 0x3d, 0xb5, 0x87, 0xb5, 0xd3, 0xc3, 0xd3, 0xfa, + 0x71, 0xed, 0xf4, 0xa8, 0x40, 0x73, 0xbc, 0x21, 0xee, 0xf5, 0xb6, 0x00, 0xe5, 0x37, 0xf0, 0xc3, + 0x5f, 0xba, 0xbd, 0xfa, 0xd2, 0x18, 0x14, 0x62, 0x0a, 0xb1, 0xb5, 0x85, 0x58, 0x84, 0xe3, 0x91, + 0x88, 0x3d, 0x85, 0xce, 0xd2, 0xaa, 0x2e, 0xfd, 0x15, 0x2b, 0x3f, 0x65, 0x2d, 0xd4, 0x93, 0xc7, + 0xaa, 0xd1, 0x48, 0x23, 0xa4, 0x11, 0x6b, 0xd3, 0x88, 0xde, 0x1d, 0x67, 0x9d, 0xbb, 0xcd, 0x66, + 0xee, 0x34, 0x3f, 0x1b, 0xd2, 0xea, 0x5e, 0x5c, 0x9e, 0x37, 0x5a, 0xfd, 0x66, 0xab, 0xd9, 0x6e, + 0x76, 0xdc, 0xfe, 0x55, 0xaf, 0xeb, 0x76, 0xcf, 0xbb, 0xad, 0xbe, 0xfb, 0xfd, 0xaa, 0xa9, 0xea, + 0x4f, 0x06, 0xae, 0x31, 0x1b, 0xba, 0xaa, 0xfd, 0x64, 0x4e, 0xbf, 0xeb, 0x76, 0x9c, 0xcf, 0x00, + 0xeb, 0x26, 0x6d, 0x68, 0xba, 0x7f, 0x35, 0x7b, 0x9d, 0xa6, 0xbb, 0xe9, 0x33, 0x5a, 0xb7, 0x79, + 0x87, 0x6e, 0x4e, 0xe5, 0x2d, 0xba, 0xbf, 0xf3, 0x06, 0xbf, 0x2a, 0xa3, 0x68, 0xa8, 0x55, 0xd7, + 0x96, 0x87, 0xa1, 0xa0, 0x51, 0xd0, 0xac, 0x2d, 0x68, 0x2f, 0x5c, 0xfd, 0x73, 0x37, 0xb1, 0x14, + 0x9e, 0xfd, 0x2a, 0x7e, 0x78, 0xe3, 0x60, 0xb2, 0x4a, 0x9d, 0x6e, 0xa7, 0xe9, 0x14, 0x20, 0x05, + 0xc5, 0x5e, 0x2a, 0x2a, 0x83, 0xc0, 0x4b, 0x12, 0xf5, 0xfc, 0xb3, 0x34, 0x06, 0xc9, 0x87, 0xe4, + 0x03, 0x9a, 0x2e, 0x3a, 0x9a, 0x5e, 0x28, 0x03, 0xf5, 0x1a, 0x6e, 0xb3, 0x7f, 0xde, 0x6a, 0x5c, + 0x5f, 0x5b, 0x82, 0xa4, 0x27, 0xf2, 0x31, 0x13, 0xab, 0x8e, 0xf6, 0xf7, 0x2f, 0xca, 0x8c, 0xa7, + 0x17, 0x96, 0x9c, 0x58, 0x63, 0x49, 0xb5, 0x6a, 0x8d, 0x29, 0x87, 0xb6, 0x18, 0x52, 0xb7, 0x68, + 0x49, 0xac, 0x89, 0x13, 0x8b, 0x2c, 0xb1, 0xc5, 0x10, 0x4b, 0xec, 0xd0, 0xd3, 0xc5, 0x2b, 0x94, + 0x25, 0xd6, 0x04, 0xc9, 0xa9, 0x35, 0x96, 0xd4, 0x8e, 0xac, 0x89, 0x77, 0x6b, 0x2c, 0x39, 0xb6, + 0xa9, 0x2c, 0xda, 0x62, 0xca, 0x81, 0x9e, 0x25, 0x5b, 0x44, 0x92, 0xa7, 0x22, 0x49, 0x2b, 0x89, + 0xff, 0x33, 0xf4, 0x02, 0x75, 0x8a, 0x6a, 0x79, 0x10, 0x38, 0x2a, 0x38, 0x2a, 0x6b, 0x39, 0x2a, + 0x75, 0x05, 0x49, 0x45, 0xe5, 0xc8, 0x9c, 0x82, 0x3e, 0xf6, 0xef, 0x2a, 0xf7, 0x71, 0x94, 0x46, + 0x83, 0x48, 0x27, 0xec, 0x5f, 0x0c, 0x43, 0xe0, 0x13, 0xf8, 0x90, 0xd3, 0xeb, 0x83, 0xbf, 0x48, + 0xe4, 0xb4, 0x8d, 0x87, 0x3c, 0xaa, 0x17, 0xcd, 0xd2, 0x1f, 0xf2, 0xe8, 0xba, 0x37, 0x87, 0xe5, + 0x37, 0xe2, 0xeb, 0xcd, 0x41, 0xe9, 0x8d, 0xb8, 0x76, 0xdb, 0xb5, 0xa3, 0x7a, 0xf9, 0xd7, 0xe2, + 0xfc, 0xb8, 0x7e, 0x62, 0x81, 0x15, 0x87, 0x27, 0x36, 0xc4, 0x76, 0xad, 0xfc, 0x19, 0xaa, 0xba, + 0x7f, 0xd1, 0xec, 0xb7, 0x1a, 0x1d, 0x1b, 0x96, 0xe3, 0xc0, 0x86, 0x54, 0x6b, 0x85, 0x4f, 0xed, + 0x5b, 0x50, 0xbb, 0xaf, 0xdd, 0x76, 0xb5, 0x6e, 0xc5, 0x5a, 0xf4, 0xdb, 0xad, 0x0b, 0x1b, 0x42, + 0xe3, 0xbc, 0x63, 0x47, 0xba, 0xfd, 0xd7, 0x8e, 0x74, 0x5b, 0xb5, 0x02, 0x9f, 0xd7, 0x6c, 0x30, + 0xc2, 0x82, 0xc8, 0x78, 0x2a, 0x7d, 0x36, 0xd4, 0x8c, 0x7a, 0xf9, 0x1b, 0xbe, 0x43, 0x1b, 0xca, + 0x77, 0xf7, 0xab, 0x0d, 0xad, 0xf7, 0x79, 0xf5, 0xb4, 0xb6, 0xc5, 0x9b, 0x5f, 0xb6, 0x4a, 0x25, + 0xca, 0xde, 0xcb, 0x36, 0x2c, 0x96, 0x28, 0xa1, 0x6f, 0x99, 0x41, 0x2e, 0x71, 0x47, 0x63, 0x71, + 0x9c, 0xbf, 0xc5, 0x63, 0x56, 0xc5, 0x18, 0xa7, 0xe5, 0x27, 0x69, 0x23, 0x4d, 0xb3, 0x29, 0xdf, + 0x39, 0x6d, 0x3f, 0x6c, 0x06, 0x62, 0x24, 0xc2, 0x89, 0xf0, 0x40, 0x38, 0x0e, 0x82, 0x0c, 0xba, + 0x8e, 0x6d, 0xef, 0xb7, 0xfc, 0x43, 0xdd, 0x78, 0x28, 0x62, 0x31, 0x3c, 0x7b, 0x9c, 0x3d, 0xa2, + 0x35, 0x21, 0x92, 0x5e, 0x9a, 0x83, 0x77, 0x3a, 0x99, 0xf4, 0x2f, 0x0d, 0xfa, 0xe3, 0x7a, 0x4f, + 0x7c, 0xdf, 0xbf, 0x56, 0xff, 0xe6, 0x9d, 0x09, 0xce, 0x3a, 0xb1, 0x06, 0x27, 0x74, 0xcd, 0x44, + 0x9a, 0x99, 0xc0, 0xd5, 0x13, 0xf7, 0x76, 0x5a, 0x56, 0x4c, 0x89, 0x13, 0xdd, 0xcf, 0x6e, 0xcd, + 0x7b, 0xc1, 0xe4, 0x8a, 0xd0, 0xfb, 0xb7, 0x5a, 0x16, 0x5b, 0x66, 0x6f, 0x1e, 0x79, 0x67, 0xaa, + 0xd7, 0x2b, 0x97, 0x7e, 0xb8, 0xef, 0x97, 0x65, 0x7f, 0x4f, 0x72, 0x1f, 0x2f, 0xeb, 0x7e, 0x9d, + 0xf4, 0xbe, 0x9c, 0xf4, 0xfe, 0x9b, 0xfc, 0x3e, 0x9b, 0x9c, 0x9b, 0x7f, 0xa4, 0x0c, 0xea, 0x64, + 0xba, 0x41, 0xf9, 0x3c, 0xbd, 0x19, 0x2e, 0x4a, 0x66, 0x14, 0xaa, 0xcd, 0x2c, 0x50, 0x2b, 0xb3, + 0xbd, 0xab, 0xb8, 0x9d, 0x2b, 0xbb, 0x7d, 0xab, 0xbc, 0x5d, 0xab, 0xbc, 0x3d, 0xab, 0xbe, 0x1d, + 0xab, 0x57, 0x8f, 0xb3, 0x0a, 0xcb, 0x3a, 0x83, 0xf9, 0x6a, 0x4a, 0x4a, 0x20, 0xcf, 0x9e, 0xcb, + 0x59, 0x03, 0x79, 0x1f, 0x0d, 0x64, 0x63, 0xae, 0xa8, 0xef, 0x92, 0xb6, 0xe0, 0xf9, 0x37, 0x05, + 0xf0, 0xcb, 0xd3, 0xcf, 0x2f, 0x52, 0x2e, 0xad, 0x51, 0xfd, 0xbb, 0x8b, 0x3f, 0xdf, 0x7e, 0xfa, + 0xeb, 0xfd, 0xa7, 0x9f, 0xfd, 0x99, 0xcf, 0x6f, 0x50, 0xfc, 0x7c, 0x72, 0xa3, 0xd8, 0x1f, 0xca, + 0xc7, 0xfe, 0xfc, 0x41, 0xb9, 0xe0, 0xdf, 0x27, 0xf8, 0x09, 0xfe, 0xd7, 0xaf, 0x23, 0x7d, 0x0c, + 0x68, 0x71, 0x31, 0x5e, 0x78, 0x3f, 0xe4, 0x8e, 0xfe, 0x3c, 0x57, 0x21, 0x09, 0xcd, 0x46, 0xe7, + 0x6a, 0x96, 0x5f, 0xf6, 0xf6, 0xa6, 0xdd, 0xfe, 0x97, 0xb9, 0xf3, 0xf3, 0x95, 0x02, 0xbe, 0x52, + 0xb0, 0x25, 0x41, 0x2a, 0xfd, 0x95, 0x02, 0xb4, 0xc6, 0x77, 0x37, 0xe4, 0xe4, 0xba, 0xce, 0x6e, + 0xcc, 0xe9, 0x8d, 0x39, 0xbf, 0xb9, 0x20, 0x50, 0xa4, 0xb5, 0xd1, 0x1a, 0x57, 0x99, 0x0b, 0x69, + 0x34, 0xa9, 0x89, 0x2a, 0x89, 0x75, 0x62, 0xbd, 0x84, 0xb1, 0x3e, 0xf6, 0xc3, 0xb4, 0x5a, 0xd7, + 0x88, 0xf5, 0x3a, 0x7a, 0xe3, 0x6a, 0xc3, 0xa0, 0x37, 0x9e, 0xfb, 0xd4, 0xd6, 0x8f, 0x8e, 0x0e, + 0x90, 0x1a, 0xff, 0x94, 0xea, 0xfb, 0x20, 0xc2, 0x61, 0x14, 0x6b, 0xd5, 0xdf, 0xc5, 0x10, 0x54, + 0x60, 0x2a, 0x30, 0x68, 0x7b, 0xf3, 0x68, 0xdb, 0x4e, 0x5a, 0x7d, 0x43, 0x87, 0x64, 0x56, 0xb3, + 0xea, 0xc5, 0x3b, 0x22, 0x93, 0xad, 0xcd, 0xe1, 0x90, 0xcc, 0x26, 0x7c, 0x33, 0xbf, 0x23, 0x32, + 0x2b, 0xbd, 0xd1, 0x96, 0x03, 0x32, 0x59, 0x0f, 0x90, 0x18, 0x9c, 0x3f, 0x9d, 0x23, 0x32, 0xeb, + 0xe9, 0xf3, 0x4c, 0x74, 0x79, 0xe6, 0xa3, 0x30, 0x35, 0x8e, 0xc2, 0x18, 0x3f, 0x0a, 0x93, 0xbf, + 0x43, 0x7f, 0x54, 0xa2, 0x14, 0x9d, 0x78, 0x4d, 0xf1, 0x59, 0xe1, 0xb9, 0x3b, 0x6b, 0xe6, 0xe2, + 0xa3, 0x39, 0x50, 0xb7, 0xdd, 0x59, 0x19, 0x30, 0x0a, 0xd6, 0xbe, 0xb4, 0x73, 0x61, 0xcd, 0xf4, + 0xff, 0x66, 0xf6, 0xbc, 0x67, 0x87, 0xe3, 0x27, 0xdf, 0xbc, 0x5f, 0xa2, 0x17, 0x45, 0x6f, 0x5d, + 0xee, 0xb5, 0x6d, 0xce, 0xf2, 0xaf, 0x5e, 0xbc, 0xe9, 0xf2, 0x8b, 0xfc, 0xd9, 0xf9, 0xf3, 0x3f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc4, 0x58, 0x11, 0x83, 0xc0, 0xed, + 0x12, 0x00, + } +) + + +// ΛEnumTypes is a map, keyed by a YANG schema path, of the enumerated types that +// correspond with the leaf. The type is represented as a reflect.Type. The naming +// of the map ensures that there are no clashes with valid YANG identifiers. +var ΛEnumTypes = map[string][]reflect.Type{ + "/components/component/port/breakout-mode/config/channel-speed": []reflect.Type{ + reflect.TypeOf((E_OpenconfigIfEthernet_ETHERNET_SPEED)(0)), + }, + "/components/component/port/breakout-mode/state/channel-speed": []reflect.Type{ + reflect.TypeOf((E_OpenconfigIfEthernet_ETHERNET_SPEED)(0)), + }, + "/components/component/state/oper-status": []reflect.Type{ + reflect.TypeOf((E_OpenconfigPlatformTypes_COMPONENT_OPER_STATUS)(0)), + }, + "/components/component/state/temperature/alarm-severity": []reflect.Type{ + reflect.TypeOf((E_OpenconfigAlarmTypes_OPENCONFIG_ALARM_SEVERITY)(0)), + }, + "/components/component/state/type": []reflect.Type{ + reflect.TypeOf((E_OpenconfigPlatformTypes_OPENCONFIG_SOFTWARE_COMPONENT)(0)), + reflect.TypeOf((E_OpenconfigPlatformTypes_OPENCONFIG_HARDWARE_COMPONENT)(0)), + }, + "/components/component/transceiver/config/ethernet-pmd-preconf": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE)(0)), + }, + "/components/component/transceiver/config/fec-mode": []reflect.Type{ + reflect.TypeOf((E_OpenconfigPlatformTypes_FEC_MODE_TYPE)(0)), + }, + "/components/component/transceiver/config/form-factor-preconf": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE)(0)), + }, + "/components/component/transceiver/state/connector-type": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTransportTypes_FIBER_CONNECTOR_TYPE)(0)), + }, + "/components/component/transceiver/state/ethernet-pmd": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE)(0)), + }, + "/components/component/transceiver/state/ethernet-pmd-preconf": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTransportTypes_ETHERNET_PMD_TYPE)(0)), + }, + "/components/component/transceiver/state/fec-mode": []reflect.Type{ + reflect.TypeOf((E_OpenconfigPlatformTypes_FEC_MODE_TYPE)(0)), + }, + "/components/component/transceiver/state/fec-status": []reflect.Type{ + reflect.TypeOf((E_OpenconfigPlatformTypes_FEC_STATUS_TYPE)(0)), + }, + "/components/component/transceiver/state/form-factor": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE)(0)), + }, + "/components/component/transceiver/state/form-factor-preconf": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTransportTypes_TRANSCEIVER_FORM_FACTOR_TYPE)(0)), + }, + "/components/component/transceiver/state/otn-compliance-code": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTransportTypes_OTN_APPLICATION_CODE)(0)), + }, + "/components/component/transceiver/state/present": []reflect.Type{ + reflect.TypeOf((E_OpenconfigPlatform_Components_Component_Transceiver_State_Present)(0)), + }, + "/components/component/transceiver/state/sonet-sdh-compliance-code": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTransportTypes_SONET_APPLICATION_CODE)(0)), + }, + "/interfaces-state/interface/admin-status": []reflect.Type{ + reflect.TypeOf((E_IETFInterfaces_InterfacesState_Interface_AdminStatus)(0)), + }, + "/interfaces-state/interface/oper-status": []reflect.Type{ + reflect.TypeOf((E_IETFInterfaces_InterfacesState_Interface_OperStatus)(0)), + }, + "/interfaces-state/interface/type": []reflect.Type{ + reflect.TypeOf((E_IETFInterfaces_InterfaceType)(0)), + }, + "/interfaces/interface/config/type": []reflect.Type{ + reflect.TypeOf((E_IETFInterfaces_InterfaceType)(0)), + }, + "/interfaces/interface/ethernet/config/duplex-mode": []reflect.Type{ + reflect.TypeOf((E_OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode)(0)), + }, + "/interfaces/interface/ethernet/config/port-speed": []reflect.Type{ + reflect.TypeOf((E_OpenconfigIfEthernet_ETHERNET_SPEED)(0)), + }, + "/interfaces/interface/ethernet/state/duplex-mode": []reflect.Type{ + reflect.TypeOf((E_OpenconfigInterfaces_Interfaces_Interface_Ethernet_Config_DuplexMode)(0)), + }, + "/interfaces/interface/ethernet/state/negotiated-duplex-mode": []reflect.Type{ + reflect.TypeOf((E_OpenconfigInterfaces_Interfaces_Interface_Ethernet_State_NegotiatedDuplexMode)(0)), + }, + "/interfaces/interface/ethernet/state/negotiated-port-speed": []reflect.Type{ + reflect.TypeOf((E_OpenconfigIfEthernet_ETHERNET_SPEED)(0)), + }, + "/interfaces/interface/ethernet/state/port-speed": []reflect.Type{ + reflect.TypeOf((E_OpenconfigIfEthernet_ETHERNET_SPEED)(0)), + }, + "/interfaces/interface/state/admin-status": []reflect.Type{ + reflect.TypeOf((E_OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus)(0)), + }, + "/interfaces/interface/state/oper-status": []reflect.Type{ + reflect.TypeOf((E_OpenconfigInterfaces_Interfaces_Interface_State_OperStatus)(0)), + }, + "/interfaces/interface/state/type": []reflect.Type{ + reflect.TypeOf((E_IETFInterfaces_InterfaceType)(0)), + }, + "/interfaces/interface/subinterfaces/subinterface/state/admin-status": []reflect.Type{ + reflect.TypeOf((E_OpenconfigInterfaces_Interfaces_Interface_State_AdminStatus)(0)), + }, + "/interfaces/interface/subinterfaces/subinterface/state/oper-status": []reflect.Type{ + reflect.TypeOf((E_OpenconfigInterfaces_Interfaces_Interface_State_OperStatus)(0)), + }, + "/lldp/config/chassis-id-type": []reflect.Type{ + reflect.TypeOf((E_OpenconfigLldp_ChassisIdType)(0)), + }, + "/lldp/config/suppress-tlv-advertisement": []reflect.Type{ + reflect.TypeOf((E_OpenconfigLldpTypes_LLDP_TLV)(0)), + }, + "/lldp/interfaces/interface/neighbors/neighbor/capabilities/capability/name": []reflect.Type{ + reflect.TypeOf((E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY)(0)), + }, + "/lldp/interfaces/interface/neighbors/neighbor/capabilities/capability/state/name": []reflect.Type{ + reflect.TypeOf((E_OpenconfigLldpTypes_LLDP_SYSTEM_CAPABILITY)(0)), + }, + "/lldp/interfaces/interface/neighbors/neighbor/state/chassis-id-type": []reflect.Type{ + reflect.TypeOf((E_OpenconfigLldp_ChassisIdType)(0)), + }, + "/lldp/interfaces/interface/neighbors/neighbor/state/port-id-type": []reflect.Type{ + reflect.TypeOf((E_OpenconfigLldp_PortIdType)(0)), + }, + "/lldp/state/chassis-id-type": []reflect.Type{ + reflect.TypeOf((E_OpenconfigLldp_ChassisIdType)(0)), + }, + "/lldp/state/suppress-tlv-advertisement": []reflect.Type{ + reflect.TypeOf((E_OpenconfigLldpTypes_LLDP_TLV)(0)), + }, + "/terminal-device/logical-channels/channel/config/admin-state": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTerminalDevice_AdminStateType)(0)), + }, + "/terminal-device/logical-channels/channel/config/logical-channel-type": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE)(0)), + }, + "/terminal-device/logical-channels/channel/config/loopback-mode": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTerminalDevice_LoopbackModeType)(0)), + }, + "/terminal-device/logical-channels/channel/config/rate-class": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE)(0)), + }, + "/terminal-device/logical-channels/channel/config/trib-protocol": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE)(0)), + }, + "/terminal-device/logical-channels/channel/ethernet/config/client-als": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls)(0)), + }, + "/terminal-device/logical-channels/channel/ethernet/lldp/neighbors/neighbor/state/chassis-id-type": []reflect.Type{ + reflect.TypeOf((E_OpenconfigLldp_ChassisIdType)(0)), + }, + "/terminal-device/logical-channels/channel/ethernet/lldp/neighbors/neighbor/state/port-id-type": []reflect.Type{ + reflect.TypeOf((E_OpenconfigLldp_PortIdType)(0)), + }, + "/terminal-device/logical-channels/channel/ethernet/state/client-als": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_Ethernet_Config_ClientAls)(0)), + }, + "/terminal-device/logical-channels/channel/logical-channel-assignments/assignment/config/assignment-type": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType)(0)), + }, + "/terminal-device/logical-channels/channel/logical-channel-assignments/assignment/config/mapping": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL)(0)), + }, + "/terminal-device/logical-channels/channel/logical-channel-assignments/assignment/state/assignment-type": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_LogicalChannelAssignments_Assignment_Config_AssignmentType)(0)), + }, + "/terminal-device/logical-channels/channel/logical-channel-assignments/assignment/state/mapping": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTransportTypes_FRAME_MAPPING_PROTOCOL)(0)), + }, + "/terminal-device/logical-channels/channel/otn/config/tributary-slot-granularity": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY)(0)), + }, + "/terminal-device/logical-channels/channel/otn/state/tributary-slot-granularity": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTransportTypes_TRIBUTARY_SLOT_GRANULARITY)(0)), + }, + "/terminal-device/logical-channels/channel/state/admin-state": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTerminalDevice_AdminStateType)(0)), + }, + "/terminal-device/logical-channels/channel/state/link-state": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTerminalDevice_TerminalDevice_LogicalChannels_Channel_State_LinkState)(0)), + }, + "/terminal-device/logical-channels/channel/state/logical-channel-type": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTransportTypes_LOGICAL_ELEMENT_PROTOCOL_TYPE)(0)), + }, + "/terminal-device/logical-channels/channel/state/loopback-mode": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTerminalDevice_LoopbackModeType)(0)), + }, + "/terminal-device/logical-channels/channel/state/rate-class": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTransportTypes_TRIBUTARY_RATE_CLASS_TYPE)(0)), + }, + "/terminal-device/logical-channels/channel/state/trib-protocol": []reflect.Type{ + reflect.TypeOf((E_OpenconfigTransportTypes_TRIBUTARY_PROTOCOL_TYPE)(0)), + }, +} + diff --git a/hackfest/openconfig/openconfig-terminal-device.png b/hackfest/openconfig/openconfig-terminal-device.png new file mode 100644 index 0000000000000000000000000000000000000000..6ed8c7ea9906a8526244c12130db7b23a71e6fb0 Binary files /dev/null and b/hackfest/openconfig/openconfig-terminal-device.png differ diff --git a/hackfest/openconfig/openconfig-terminal-device.tree b/hackfest/openconfig/openconfig-terminal-device.tree new file mode 100644 index 0000000000000000000000000000000000000000..03da8a72e224eb752fea330b5c65321bad1d91d5 --- /dev/null +++ b/hackfest/openconfig/openconfig-terminal-device.tree @@ -0,0 +1,258 @@ +module: openconfig-terminal-device + +--rw terminal-device + +--rw config + +--ro state + +--rw logical-channels + | +--rw channel* [index] + | +--rw index -> ../config/index + | +--rw config + | | +--rw index? uint32 + | | +--rw description? string + | | +--rw admin-state? oc-opt-types:admin-state-type + | | +--rw rate-class? identityref + | | +--rw trib-protocol? identityref + | | +--rw logical-channel-type? identityref + | | +--rw loopback-mode? oc-opt-types:loopback-mode-type + | | +--rw test-signal? boolean + | +--ro state + | | +--ro index? uint32 + | | +--ro description? string + | | +--ro admin-state? oc-opt-types:admin-state-type + | | +--ro rate-class? identityref + | | +--ro trib-protocol? identityref + | | +--ro logical-channel-type? identityref + | | +--ro loopback-mode? oc-opt-types:loopback-mode-type + | | +--ro test-signal? boolean + | | +--ro link-state? enumeration + | +--rw otn + | | +--rw config + | | | +--rw tti-msg-transmit? string + | | | +--rw tti-msg-expected? string + | | | +--rw tti-msg-auto? boolean + | | | +--rw tributary-slot-granularity? identityref + | | +--ro state + | | +--ro tti-msg-transmit? string + | | +--ro tti-msg-expected? string + | | +--ro tti-msg-auto? boolean + | | +--ro tributary-slot-granularity? identityref + | | +--ro tti-msg-recv? string + | | +--ro rdi-msg? string + | | +--ro errored-seconds? yang:counter64 + | | +--ro severely-errored-seconds? yang:counter64 + | | +--ro unavailable-seconds? yang:counter64 + | | +--ro code-violations? yang:counter64 + | | +--ro errored-blocks? yang:counter64 + | | +--ro fec-uncorrectable-blocks? yang:counter64 + | | +--ro fec-uncorrectable-words? yang:counter64 + | | +--ro fec-corrected-bytes? yang:counter64 + | | +--ro fec-corrected-bits? yang:counter64 + | | +--ro background-block-errors? yang:counter64 + | | +--ro pre-fec-ber + | | | +--ro instant? decimal64 + | | | +--ro avg? decimal64 + | | | +--ro min? decimal64 + | | | +--ro max? decimal64 + | | | +--ro interval? oc-types:stat-interval + | | | +--ro min-time? oc-types:timeticks64 + | | | +--ro max-time? oc-types:timeticks64 + | | +--ro post-fec-ber + | | | +--ro instant? decimal64 + | | | +--ro avg? decimal64 + | | | +--ro min? decimal64 + | | | +--ro max? decimal64 + | | | +--ro interval? oc-types:stat-interval + | | | +--ro min-time? oc-types:timeticks64 + | | | +--ro max-time? oc-types:timeticks64 + | | +--ro q-value + | | | +--ro instant? decimal64 + | | | +--ro avg? decimal64 + | | | +--ro min? decimal64 + | | | +--ro max? decimal64 + | | | +--ro interval? oc-types:stat-interval + | | | +--ro min-time? oc-types:timeticks64 + | | | +--ro max-time? oc-types:timeticks64 + | | +--ro esnr + | | +--ro instant? decimal64 + | | +--ro avg? decimal64 + | | +--ro min? decimal64 + | | +--ro max? decimal64 + | | +--ro interval? oc-types:stat-interval + | | +--ro min-time? oc-types:timeticks64 + | | +--ro max-time? oc-types:timeticks64 + | +--rw ethernet + | | +--rw config + | | | +--rw client-als? enumeration + | | | +--rw als-delay? uint32 + | | +--ro state + | | | +--ro client-als? enumeration + | | | +--ro als-delay? uint32 + | | | +--ro in-mac-control-frames? oc-yang:counter64 + | | | +--ro in-mac-pause-frames? oc-yang:counter64 + | | | +--ro in-oversize-frames? oc-yang:counter64 + | | | +--ro in-undersize-frames? oc-yang:counter64 + | | | +--ro in-jabber-frames? oc-yang:counter64 + | | | +--ro in-fragment-frames? oc-yang:counter64 + | | | +--ro in-8021q-frames? oc-yang:counter64 + | | | +--ro in-crc-errors? oc-yang:counter64 + | | | +--ro in-block-errors? oc-yang:counter64 + | | | +--ro out-mac-control-frames? oc-yang:counter64 + | | | +--ro out-mac-pause-frames? oc-yang:counter64 + | | | +--ro out-8021q-frames? oc-yang:counter64 + | | | +--ro in-pcs-bip-errors? oc-yang:counter64 + | | | +--ro in-pcs-errored-seconds? oc-yang:counter64 + | | | +--ro in-pcs-severely-errored-seconds? oc-yang:counter64 + | | | +--ro in-pcs-unavailable-seconds? oc-yang:counter64 + | | | +--ro out-pcs-bip-errors? oc-yang:counter64 + | | | +--ro out-crc-errors? oc-yang:counter64 + | | | +--ro out-block-errors? oc-yang:counter64 + | | +--rw lldp + | | +--rw config + | | | +--rw enabled? boolean + | | | +--rw snooping? boolean + | | +--ro state + | | | +--ro enabled? boolean + | | | +--ro snooping? boolean + | | | +--ro counters + | | | +--ro frame-in? yang:counter64 + | | | +--ro frame-out? yang:counter64 + | | | +--ro frame-error-in? yang:counter64 + | | | +--ro frame-discard? yang:counter64 + | | | +--ro tlv-discard? yang:counter64 + | | | +--ro tlv-unknown? yang:counter64 + | | | +--ro last-clear? yang:date-and-time + | | | +--ro frame-error-out? yang:counter64 + | | +--ro neighbors + | | +--ro neighbor* [id] + | | +--ro id -> ../state/id + | | +--ro config + | | +--ro state + | | | +--ro system-name? string + | | | +--ro system-description? string + | | | +--ro chassis-id? string + | | | +--ro chassis-id-type? oc-lldp-types:chassis-id-type + | | | +--ro id? string + | | | +--ro age? uint64 + | | | +--ro last-update? int64 + | | | +--ro ttl? uint16 + | | | +--ro port-id? string + | | | +--ro port-id-type? oc-lldp-types:port-id-type + | | | +--ro port-description? string + | | | +--ro management-address? string + | | | +--ro management-address-type? string + | | +--ro custom-tlvs + | | +--ro tlv* [type oui oui-subtype] + | | +--ro type -> ../state/type + | | +--ro oui -> ../state/oui + | | +--ro oui-subtype -> ../state/oui-subtype + | | +--ro config + | | +--ro state + | | +--ro type? int32 + | | +--ro oui? string + | | +--ro oui-subtype? string + | | +--ro value? binary + | +--rw ingress + | | +--rw config + | | | +--rw transceiver? -> /oc-platform:components/component/name + | | | +--rw physical-channel* -> /oc-platform:components/component/oc-transceiver:transceiver/physical-channels/channel/index + | | +--ro state + | | +--ro transceiver? -> /oc-platform:components/component/name + | | +--ro physical-channel* -> /oc-platform:components/component/oc-transceiver:transceiver/physical-channels/channel/index + | +--rw logical-channel-assignments + | +--rw assignment* [index] + | +--rw index -> ../config/index + | +--rw config + | | +--rw index? uint32 + | | +--rw description? string + | | +--rw assignment-type? enumeration + | | +--rw logical-channel? -> /terminal-device/logical-channels/channel/index + | | +--rw optical-channel? -> /oc-platform:components/component/name + | | +--rw allocation? decimal64 + | | +--rw tributary-slot-index? int32 + | | +--rw mapping? identityref + | +--ro state + | +--ro index? uint32 + | +--ro description? string + | +--ro assignment-type? enumeration + | +--ro logical-channel? -> /terminal-device/logical-channels/channel/index + | +--ro optical-channel? -> /oc-platform:components/component/name + | +--ro allocation? decimal64 + | +--ro tributary-slot-index? int32 + | +--ro mapping? identityref + +--rw operational-modes + +--ro mode* [mode-id] + +--ro mode-id -> ../state/mode-id + +--ro config + +--ro state + +--ro mode-id? uint16 + +--ro description? string + +--ro vendor-id? string + + augment /oc-platform:components/oc-platform:component: + +--rw optical-channel + +--rw config + | +--rw frequency? oc-opt-types:frequency-type + | +--rw target-output-power? decimal64 + | +--rw operational-mode? uint16 + | +--rw line-port? -> /oc-platform:components/component/name + +--ro state + +--ro frequency? oc-opt-types:frequency-type + +--ro target-output-power? decimal64 + +--ro operational-mode? uint16 + +--ro line-port? -> /oc-platform:components/component/name + +--ro group-id? uint32 + +--ro output-power + | +--ro instant? decimal64 + | +--ro avg? decimal64 + | +--ro min? decimal64 + | +--ro max? decimal64 + | +--ro interval? oc-types:stat-interval + | +--ro min-time? oc-types:timeticks64 + | +--ro max-time? oc-types:timeticks64 + +--ro input-power + | +--ro instant? decimal64 + | +--ro avg? decimal64 + | +--ro min? decimal64 + | +--ro max? decimal64 + | +--ro interval? oc-types:stat-interval + | +--ro min-time? oc-types:timeticks64 + | +--ro max-time? oc-types:timeticks64 + +--ro laser-bias-current + | +--ro instant? decimal64 + | +--ro avg? decimal64 + | +--ro min? decimal64 + | +--ro max? decimal64 + | +--ro interval? oc-types:stat-interval + | +--ro min-time? oc-types:timeticks64 + | +--ro max-time? oc-types:timeticks64 + +--ro chromatic-dispersion + | +--ro instant? decimal64 + | +--ro avg? decimal64 + | +--ro min? decimal64 + | +--ro max? decimal64 + | +--ro interval? oc-types:stat-interval + | +--ro min-time? oc-types:timeticks64 + | +--ro max-time? oc-types:timeticks64 + +--ro polarization-mode-dispersion + | +--ro instant? decimal64 + | +--ro avg? decimal64 + | +--ro min? decimal64 + | +--ro max? decimal64 + | +--ro interval? oc-types:stat-interval + | +--ro min-time? oc-types:timeticks64 + | +--ro max-time? oc-types:timeticks64 + +--ro second-order-polarization-mode-dispersion + | +--ro instant? decimal64 + | +--ro avg? decimal64 + | +--ro min? decimal64 + | +--ro max? decimal64 + | +--ro interval? oc-types:stat-interval + | +--ro min-time? oc-types:timeticks64 + | +--ro max-time? oc-types:timeticks64 + +--ro polarization-dependent-loss + +--ro instant? decimal64 + +--ro avg? decimal64 + +--ro min? decimal64 + +--ro max? decimal64 + +--ro interval? oc-types:stat-interval + +--ro min-time? oc-types:timeticks64 + +--ro max-time? oc-types:timeticks64 diff --git a/hackfest/openconfig/openconfig-terminal-device.uml b/hackfest/openconfig/openconfig-terminal-device.uml new file mode 100644 index 0000000000000000000000000000000000000000..11b945ead0abbc6fb591767ef0f41d62c641b49e --- /dev/null +++ b/hackfest/openconfig/openconfig-terminal-device.uml @@ -0,0 +1,400 @@ +'Download plantuml from http://plantuml.sourceforge.net/ +'Generate png with java -jar plantuml.jar +'Output in img/.png +'If Java spits out memory error increase heap size with java -Xmx1024m -jar plantuml.jar +@startuml img/openconfig-terminal-device.png +hide empty fields +hide empty methods +hide <> circle +hide <> circle +hide <> circle +hide <> stereotype +hide <> circle +page 1x1 +Title openconfig-terminal-device +package "oc-types:openconfig-types" as oc_types_openconfig_types { +} +package "oc-opt-types:openconfig-transport-types" as oc_opt_types_openconfig_transport_types { +} +package "oc-eth:openconfig-if-ethernet" as oc_eth_openconfig_if_ethernet { +} +package "oc-platform:openconfig-platform" as oc_platform_openconfig_platform { +} +package "oc-transceiver:openconfig-platform-transceiver" as oc_transceiver_openconfig_platform_transceiver { +} +package "oc-lldp:openconfig-lldp" as oc_lldp_openconfig_lldp { +} +package "oc-ext:openconfig-extensions" as oc_ext_openconfig_extensions { +} +package "yang:ietf-yang-types" as yang_ietf_yang_types { +} +package "oc-yang:openconfig-yang-types" as oc_yang_openconfig_yang_types { +} +note top of oc_opt_term_openconfig_terminal_device : Namespace: http://openconfig.net/yang/terminal-device \nPrefix: oc-opt-term \nOrganization : \nOpenConfig working group \nContact : \nOpenConfig working group \nwww.openconfig.net \nRevision : 2019-11-28 \n +package "oc-opt-term:openconfig-terminal-device" as oc_opt_term_openconfig_terminal_device { +oc_types_openconfig_types +-- oc_opt_term_openconfig_terminal_device +oc_opt_types_openconfig_transport_types +-- oc_opt_term_openconfig_terminal_device +oc_eth_openconfig_if_ethernet +-- oc_opt_term_openconfig_terminal_device +oc_platform_openconfig_platform +-- oc_opt_term_openconfig_terminal_device +oc_transceiver_openconfig_platform_transceiver +-- oc_opt_term_openconfig_terminal_device +oc_lldp_openconfig_lldp +-- oc_opt_term_openconfig_terminal_device +oc_ext_openconfig_extensions +-- oc_opt_term_openconfig_terminal_device +yang_ietf_yang_types +-- oc_opt_term_openconfig_terminal_device +oc_yang_openconfig_yang_types +-- oc_opt_term_openconfig_terminal_device +class "openconfig-terminal-device" as openconfig_terminal_device << (M, #33CCFF) module>> +class "terminal-input-optical-power" as openconfig_terminal_device_I_terminal_input_optical_power_grouping <<(G,Lime) grouping>> +openconfig_terminal_device_I_terminal_input_optical_power_grouping : input-power : decimal64 {dBm} +class "terminal-ethernet-protocol-config" as openconfig_terminal_device_I_terminal_ethernet_protocol_config_grouping <<(G,Lime) grouping>> +openconfig_terminal_device_I_terminal_ethernet_protocol_config_grouping : client-als : enumeration : {NONE,LASER_SHUTDOWN,ETHERNET,} = ETHERNET +openconfig_terminal_device_I_terminal_ethernet_protocol_config_grouping : als-delay : uint32 = 0 {milliseconds} +class "terminal-ethernet-protocol-state" as openconfig_terminal_device_I_terminal_ethernet_protocol_state_grouping <<(G,Lime) grouping>> +openconfig_terminal_device_I_terminal_ethernet_protocol_state_grouping : oc-eth:ethernet-interface-state-counters {uses} +openconfig_terminal_device_I_terminal_ethernet_protocol_state_grouping : terminal-ethernet-protocol-state-counters {uses} +class "terminal-ethernet-protocol-state-counters" as openconfig_terminal_device_I_terminal_ethernet_protocol_state_counters_grouping <<(G,Lime) grouping>> +openconfig_terminal_device_I_terminal_ethernet_protocol_state_counters_grouping : in-pcs-bip-errors : oc-yang:counter64 +openconfig_terminal_device_I_terminal_ethernet_protocol_state_counters_grouping : in-pcs-errored-seconds : oc-yang:counter64 +openconfig_terminal_device_I_terminal_ethernet_protocol_state_counters_grouping : in-pcs-severely-errored-seconds : oc-yang:counter64 +openconfig_terminal_device_I_terminal_ethernet_protocol_state_counters_grouping : in-pcs-unavailable-seconds : oc-yang:counter64 +openconfig_terminal_device_I_terminal_ethernet_protocol_state_counters_grouping : out-pcs-bip-errors : oc-yang:counter64 +openconfig_terminal_device_I_terminal_ethernet_protocol_state_counters_grouping : out-crc-errors : oc-yang:counter64 +openconfig_terminal_device_I_terminal_ethernet_protocol_state_counters_grouping : out-block-errors : oc-yang:counter64 +class "terminal-ethernet-protocol-top" as openconfig_terminal_device_I_terminal_ethernet_protocol_top_grouping <<(G,Lime) grouping>> +class "ethernet" as openconfig_terminal_device_I_terminal_ethernet_protocol_top_I_ethernet <> +openconfig_terminal_device_I_terminal_ethernet_protocol_top_grouping *-- "1" openconfig_terminal_device_I_terminal_ethernet_protocol_top_I_ethernet +class "config" as openconfig_terminal_device_I_terminal_ethernet_protocol_top_I_ethernet_I_config <> +openconfig_terminal_device_I_terminal_ethernet_protocol_top_I_ethernet *-- "1" openconfig_terminal_device_I_terminal_ethernet_protocol_top_I_ethernet_I_config +openconfig_terminal_device_I_terminal_ethernet_protocol_top_I_ethernet_I_config : terminal-ethernet-protocol-config {uses} +class "state" as openconfig_terminal_device_I_terminal_ethernet_protocol_top_I_ethernet_I_state <> +openconfig_terminal_device_I_terminal_ethernet_protocol_top_I_ethernet *-- "1" openconfig_terminal_device_I_terminal_ethernet_protocol_top_I_ethernet_I_state +note bottom of openconfig_terminal_device_I_terminal_ethernet_protocol_top_I_ethernet_I_state +Config = false +end note +openconfig_terminal_device_I_terminal_ethernet_protocol_top_I_ethernet_I_state : terminal-ethernet-protocol-config {uses} +openconfig_terminal_device_I_terminal_ethernet_protocol_top_I_ethernet_I_state : terminal-ethernet-protocol-state {uses} +openconfig_terminal_device_I_terminal_ethernet_protocol_top_I_ethernet : lldp-logical-channel-top {uses} +class "lldp-logical-channel-top" as openconfig_terminal_device_I_lldp_logical_channel_top_grouping <<(G,Lime) grouping>> +class "lldp" as openconfig_terminal_device_I_lldp_logical_channel_top_I_lldp <> +openconfig_terminal_device_I_lldp_logical_channel_top_grouping *-- "1" openconfig_terminal_device_I_lldp_logical_channel_top_I_lldp +class "config" as openconfig_terminal_device_I_lldp_logical_channel_top_I_lldp_I_config <> +openconfig_terminal_device_I_lldp_logical_channel_top_I_lldp *-- "1" openconfig_terminal_device_I_lldp_logical_channel_top_I_lldp_I_config +openconfig_terminal_device_I_lldp_logical_channel_top_I_lldp_I_config : lldp-logical-channel-config {uses} +class "state" as openconfig_terminal_device_I_lldp_logical_channel_top_I_lldp_I_state <> +openconfig_terminal_device_I_lldp_logical_channel_top_I_lldp *-- "1" openconfig_terminal_device_I_lldp_logical_channel_top_I_lldp_I_state +note bottom of openconfig_terminal_device_I_lldp_logical_channel_top_I_lldp_I_state +Config = false +end note +openconfig_terminal_device_I_lldp_logical_channel_top_I_lldp_I_state : lldp-logical-channel-config {uses} +openconfig_terminal_device_I_lldp_logical_channel_top_I_lldp_I_state : oc-lldp:lldp-interface-state {uses} +openconfig_terminal_device_I_lldp_logical_channel_top_I_lldp : lldp-logical-channel-neighbor-top {uses} +class "lldp-logical-channel-config" as openconfig_terminal_device_I_lldp_logical_channel_config_grouping <<(G,Lime) grouping>> +openconfig_terminal_device_I_lldp_logical_channel_config_grouping : enabled : boolean = false +openconfig_terminal_device_I_lldp_logical_channel_config_grouping : snooping : boolean = false +class "lldp-logical-channel-neighbor-top" as openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_grouping <<(G,Lime) grouping>> +class "neighbors" as openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_I_neighbors <> +openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_grouping *-- "1" openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_I_neighbors +note bottom of openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_I_neighbors +Config = false +end note +class "neighbor" as openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_I_neighbors_I_neighbor << (L, #FF7700) list>> +openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_I_neighbors *-- "0..N" openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_I_neighbors_I_neighbor +openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_I_neighbors_I_neighbor : +id : leafref : ../state/id {key} +class "config" as openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_I_neighbors_I_neighbor_I_config <> +openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_I_neighbors_I_neighbor *-- "1" openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_I_neighbors_I_neighbor_I_config +openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_I_neighbors_I_neighbor_I_config : lldp-logical-channel-neighbor-config {uses} +class "state" as openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_I_neighbors_I_neighbor_I_state <> +openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_I_neighbors_I_neighbor *-- "1" openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_I_neighbors_I_neighbor_I_state +note bottom of openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_I_neighbors_I_neighbor_I_state +Config = false +end note +openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_I_neighbors_I_neighbor_I_state : oc-lldp:lldp-system-info-config {uses} +openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_I_neighbors_I_neighbor_I_state : oc-lldp:lldp-system-info-state {uses} +openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_I_neighbors_I_neighbor_I_state : oc-lldp:lldp-neighbor-config {uses} +openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_I_neighbors_I_neighbor_I_state : oc-lldp:lldp-neighbor-state {uses} +openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_I_neighbors_I_neighbor : oc-lldp:lldp-custom-tlv-top {uses} +class "lldp-logical-channel-neighbor-config" as openconfig_terminal_device_I_lldp_logical_channel_neighbor_config_grouping <<(G,Lime) grouping>> +class "terminal-otn-protocol-config" as openconfig_terminal_device_I_terminal_otn_protocol_config_grouping <<(G,Lime) grouping>> +openconfig_terminal_device_I_terminal_otn_protocol_config_grouping : tti-msg-transmit : string +openconfig_terminal_device_I_terminal_otn_protocol_config_grouping : tti-msg-expected : string +openconfig_terminal_device_I_terminal_otn_protocol_config_grouping : tti-msg-auto : boolean +openconfig_terminal_device_I_terminal_otn_protocol_config_grouping : tributary-slot-granularity : identityref {oc-opt-types:TRIBUTARY_SLOT_GRANULARITY} +class "terminal-otn-protocol-counter-stats" as openconfig_terminal_device_I_terminal_otn_protocol_counter_stats_grouping <<(G,Lime) grouping>> +openconfig_terminal_device_I_terminal_otn_protocol_counter_stats_grouping : errored-seconds : yang:counter64 +openconfig_terminal_device_I_terminal_otn_protocol_counter_stats_grouping : severely-errored-seconds : yang:counter64 +openconfig_terminal_device_I_terminal_otn_protocol_counter_stats_grouping : unavailable-seconds : yang:counter64 +openconfig_terminal_device_I_terminal_otn_protocol_counter_stats_grouping : code-violations : yang:counter64 +openconfig_terminal_device_I_terminal_otn_protocol_counter_stats_grouping : errored-blocks : yang:counter64 +openconfig_terminal_device_I_terminal_otn_protocol_counter_stats_grouping : fec-uncorrectable-blocks : yang:counter64 +openconfig_terminal_device_I_terminal_otn_protocol_counter_stats_grouping : fec-uncorrectable-words : yang:counter64 +openconfig_terminal_device_I_terminal_otn_protocol_counter_stats_grouping : fec-corrected-bytes : yang:counter64 +openconfig_terminal_device_I_terminal_otn_protocol_counter_stats_grouping : fec-corrected-bits : yang:counter64 +openconfig_terminal_device_I_terminal_otn_protocol_counter_stats_grouping : background-block-errors : yang:counter64 +class "terminal-otn-protocol-multi-stats" as openconfig_terminal_device_I_terminal_otn_protocol_multi_stats_grouping <<(G,Lime) grouping>> +class "pre-fec-ber" as openconfig_terminal_device_I_terminal_otn_protocol_multi_stats_I_pre_fec_ber <> +openconfig_terminal_device_I_terminal_otn_protocol_multi_stats_grouping *-- "1" openconfig_terminal_device_I_terminal_otn_protocol_multi_stats_I_pre_fec_ber +openconfig_terminal_device_I_terminal_otn_protocol_multi_stats_I_pre_fec_ber : oc-opt-types:avg-min-max-instant-stats-precision18-ber {uses} +class "post-fec-ber" as openconfig_terminal_device_I_terminal_otn_protocol_multi_stats_I_post_fec_ber <> +openconfig_terminal_device_I_terminal_otn_protocol_multi_stats_grouping *-- "1" openconfig_terminal_device_I_terminal_otn_protocol_multi_stats_I_post_fec_ber +openconfig_terminal_device_I_terminal_otn_protocol_multi_stats_I_post_fec_ber : oc-opt-types:avg-min-max-instant-stats-precision18-ber {uses} +class "q-value" as openconfig_terminal_device_I_terminal_otn_protocol_multi_stats_I_q_value <> +openconfig_terminal_device_I_terminal_otn_protocol_multi_stats_grouping *-- "1" openconfig_terminal_device_I_terminal_otn_protocol_multi_stats_I_q_value +openconfig_terminal_device_I_terminal_otn_protocol_multi_stats_I_q_value : oc-types:avg-min-max-instant-stats-precision2-dB {uses} +class "esnr" as openconfig_terminal_device_I_terminal_otn_protocol_multi_stats_I_esnr <> +openconfig_terminal_device_I_terminal_otn_protocol_multi_stats_grouping *-- "1" openconfig_terminal_device_I_terminal_otn_protocol_multi_stats_I_esnr +openconfig_terminal_device_I_terminal_otn_protocol_multi_stats_I_esnr : oc-types:avg-min-max-instant-stats-precision2-dB {uses} +class "terminal-otn-protocol-state" as openconfig_terminal_device_I_terminal_otn_protocol_state_grouping <<(G,Lime) grouping>> +openconfig_terminal_device_I_terminal_otn_protocol_state_grouping : tti-msg-recv : string +openconfig_terminal_device_I_terminal_otn_protocol_state_grouping : rdi-msg : string +openconfig_terminal_device_I_terminal_otn_protocol_state_grouping : terminal-otn-protocol-counter-stats {uses} +openconfig_terminal_device_I_terminal_otn_protocol_state_grouping : terminal-otn-protocol-multi-stats {uses} +class "terminal-otn-protocol-top" as openconfig_terminal_device_I_terminal_otn_protocol_top_grouping <<(G,Lime) grouping>> +class "otn" as openconfig_terminal_device_I_terminal_otn_protocol_top_I_otn <> +openconfig_terminal_device_I_terminal_otn_protocol_top_grouping *-- "1" openconfig_terminal_device_I_terminal_otn_protocol_top_I_otn +class "config" as openconfig_terminal_device_I_terminal_otn_protocol_top_I_otn_I_config <> +openconfig_terminal_device_I_terminal_otn_protocol_top_I_otn *-- "1" openconfig_terminal_device_I_terminal_otn_protocol_top_I_otn_I_config +openconfig_terminal_device_I_terminal_otn_protocol_top_I_otn_I_config : terminal-otn-protocol-config {uses} +class "state" as openconfig_terminal_device_I_terminal_otn_protocol_top_I_otn_I_state <> +openconfig_terminal_device_I_terminal_otn_protocol_top_I_otn *-- "1" openconfig_terminal_device_I_terminal_otn_protocol_top_I_otn_I_state +note bottom of openconfig_terminal_device_I_terminal_otn_protocol_top_I_otn_I_state +Config = false +end note +openconfig_terminal_device_I_terminal_otn_protocol_top_I_otn_I_state : terminal-otn-protocol-config {uses} +openconfig_terminal_device_I_terminal_otn_protocol_top_I_otn_I_state : terminal-otn-protocol-state {uses} +class "terminal-client-port-assignment-config" as openconfig_terminal_device_I_terminal_client_port_assignment_config_grouping <<(G,Lime) grouping>> +openconfig_terminal_device_I_terminal_client_port_assignment_config_grouping : index : uint32 +openconfig_terminal_device_I_terminal_client_port_assignment_config_grouping : description : string +openconfig_terminal_device_I_terminal_client_port_assignment_config_grouping : logical-channel : leafref : /oc-opt-term:terminal-device/oc-opt-term:logical-channels/oc-opt-term:channel/oc-opt-term:index +openconfig_terminal_device_I_terminal_client_port_assignment_config_grouping : allocation : decimal64 {Gbps} +class "terminal-client-port-assignment-state" as openconfig_terminal_device_I_terminal_client_port_assignment_state_grouping <<(G,Lime) grouping>> +class "terminal-client-port-assignment-top" as openconfig_terminal_device_I_terminal_client_port_assignment_top_grouping <<(G,Lime) grouping>> +class "logical-channel-assignments" as openconfig_terminal_device_I_terminal_client_port_assignment_top_I_logical_channel_assignments <> +openconfig_terminal_device_I_terminal_client_port_assignment_top_grouping *-- "1" openconfig_terminal_device_I_terminal_client_port_assignment_top_I_logical_channel_assignments +class "assignment" as openconfig_terminal_device_I_terminal_client_port_assignment_top_I_logical_channel_assignments_I_assignment << (L, #FF7700) list>> +openconfig_terminal_device_I_terminal_client_port_assignment_top_I_logical_channel_assignments *-- "0..N" openconfig_terminal_device_I_terminal_client_port_assignment_top_I_logical_channel_assignments_I_assignment +openconfig_terminal_device_I_terminal_client_port_assignment_top_I_logical_channel_assignments_I_assignment : +index : leafref : ../config/index {key} +class "config" as openconfig_terminal_device_I_terminal_client_port_assignment_top_I_logical_channel_assignments_I_assignment_I_config <> +openconfig_terminal_device_I_terminal_client_port_assignment_top_I_logical_channel_assignments_I_assignment *-- "1" openconfig_terminal_device_I_terminal_client_port_assignment_top_I_logical_channel_assignments_I_assignment_I_config +openconfig_terminal_device_I_terminal_client_port_assignment_top_I_logical_channel_assignments_I_assignment_I_config : terminal-client-port-assignment-config {uses} +class "state" as openconfig_terminal_device_I_terminal_client_port_assignment_top_I_logical_channel_assignments_I_assignment_I_state <> +openconfig_terminal_device_I_terminal_client_port_assignment_top_I_logical_channel_assignments_I_assignment *-- "1" openconfig_terminal_device_I_terminal_client_port_assignment_top_I_logical_channel_assignments_I_assignment_I_state +note bottom of openconfig_terminal_device_I_terminal_client_port_assignment_top_I_logical_channel_assignments_I_assignment_I_state +Config = false +end note +openconfig_terminal_device_I_terminal_client_port_assignment_top_I_logical_channel_assignments_I_assignment_I_state : terminal-client-port-assignment-config {uses} +openconfig_terminal_device_I_terminal_client_port_assignment_top_I_logical_channel_assignments_I_assignment_I_state : terminal-client-port-assignment-state {uses} +class "terminal-logical-chan-assignment-config" as openconfig_terminal_device_I_terminal_logical_chan_assignment_config_grouping <<(G,Lime) grouping>> +openconfig_terminal_device_I_terminal_logical_chan_assignment_config_grouping : +index : uint32 {key} +openconfig_terminal_device_I_terminal_logical_chan_assignment_config_grouping : description : string +openconfig_terminal_device_I_terminal_logical_chan_assignment_config_grouping : assignment-type : enumeration : {LOGICAL_CHANNEL,OPTICAL_CHANNEL,} +openconfig_terminal_device_I_terminal_logical_chan_assignment_config_grouping : logical-channel : leafref : /oc-opt-term:terminal-device/oc-opt-term:logical-channels/oc-opt-term:channel/oc-opt-term:index +note bottom of openconfig_terminal_device_I_terminal_logical_chan_assignment_config_grouping +Must (logical-channel): +../assignment-type = 'LOGICAL_CHANNEL' + +end note +openconfig_terminal_device_I_terminal_logical_chan_assignment_config_grouping : optical-channel : leafref : /oc-platform:components/oc-platform:component/oc-platform:name +note bottom of openconfig_terminal_device_I_terminal_logical_chan_assignment_config_grouping +Must (optical-channel): +../assignment-type = 'OPTICAL_CHANNEL' + +end note +openconfig_terminal_device_I_terminal_logical_chan_assignment_config_grouping : allocation : decimal64 {Gbps} +openconfig_terminal_device_I_terminal_logical_chan_assignment_config_grouping : tributary-slot-index : int32 +openconfig_terminal_device_I_terminal_logical_chan_assignment_config_grouping : mapping : identityref {oc-opt-types:FRAME_MAPPING_PROTOCOL} +class "terminal-logical-chan-assignment-state" as openconfig_terminal_device_I_terminal_logical_chan_assignment_state_grouping <<(G,Lime) grouping>> +class "terminal-logical-chan-assignment-top" as openconfig_terminal_device_I_terminal_logical_chan_assignment_top_grouping <<(G,Lime) grouping>> +class "logical-channel-assignments" as openconfig_terminal_device_I_terminal_logical_chan_assignment_top_I_logical_channel_assignments <> +openconfig_terminal_device_I_terminal_logical_chan_assignment_top_grouping *-- "1" openconfig_terminal_device_I_terminal_logical_chan_assignment_top_I_logical_channel_assignments +class "assignment" as openconfig_terminal_device_I_terminal_logical_chan_assignment_top_I_logical_channel_assignments_I_assignment << (L, #FF7700) list>> +openconfig_terminal_device_I_terminal_logical_chan_assignment_top_I_logical_channel_assignments *-- "0..N" openconfig_terminal_device_I_terminal_logical_chan_assignment_top_I_logical_channel_assignments_I_assignment +openconfig_terminal_device_I_terminal_logical_chan_assignment_top_I_logical_channel_assignments_I_assignment : +index : leafref : ../config/index {key} +class "config" as openconfig_terminal_device_I_terminal_logical_chan_assignment_top_I_logical_channel_assignments_I_assignment_I_config <> +openconfig_terminal_device_I_terminal_logical_chan_assignment_top_I_logical_channel_assignments_I_assignment *-- "1" openconfig_terminal_device_I_terminal_logical_chan_assignment_top_I_logical_channel_assignments_I_assignment_I_config +openconfig_terminal_device_I_terminal_logical_chan_assignment_top_I_logical_channel_assignments_I_assignment_I_config : terminal-logical-chan-assignment-config {uses} +class "state" as openconfig_terminal_device_I_terminal_logical_chan_assignment_top_I_logical_channel_assignments_I_assignment_I_state <> +openconfig_terminal_device_I_terminal_logical_chan_assignment_top_I_logical_channel_assignments_I_assignment *-- "1" openconfig_terminal_device_I_terminal_logical_chan_assignment_top_I_logical_channel_assignments_I_assignment_I_state +note bottom of openconfig_terminal_device_I_terminal_logical_chan_assignment_top_I_logical_channel_assignments_I_assignment_I_state +Config = false +end note +openconfig_terminal_device_I_terminal_logical_chan_assignment_top_I_logical_channel_assignments_I_assignment_I_state : terminal-logical-chan-assignment-config {uses} +openconfig_terminal_device_I_terminal_logical_chan_assignment_top_I_logical_channel_assignments_I_assignment_I_state : terminal-logical-chan-assignment-state {uses} +class "terminal-logical-channel-ingress-config" as openconfig_terminal_device_I_terminal_logical_channel_ingress_config_grouping <<(G,Lime) grouping>> +openconfig_terminal_device_I_terminal_logical_channel_ingress_config_grouping : transceiver : leafref : /oc-platform:components/oc-platform:component/oc-platform:name +openconfig_terminal_device_I_terminal_logical_channel_ingress_config_grouping : physical-channel []: leafref : /oc-platform:components/oc-platform:component/oc-transceiver:transceiver/oc-transceiver:physical-channels/oc-transceiver:channel/oc-transceiver:index +class "terminal-logical-channel-ingress-state" as openconfig_terminal_device_I_terminal_logical_channel_ingress_state_grouping <<(G,Lime) grouping>> +class "terminal-logical-channel-ingress-top" as openconfig_terminal_device_I_terminal_logical_channel_ingress_top_grouping <<(G,Lime) grouping>> +class "ingress" as openconfig_terminal_device_I_terminal_logical_channel_ingress_top_I_ingress <> +openconfig_terminal_device_I_terminal_logical_channel_ingress_top_grouping *-- "1" openconfig_terminal_device_I_terminal_logical_channel_ingress_top_I_ingress +class "config" as openconfig_terminal_device_I_terminal_logical_channel_ingress_top_I_ingress_I_config <> +openconfig_terminal_device_I_terminal_logical_channel_ingress_top_I_ingress *-- "1" openconfig_terminal_device_I_terminal_logical_channel_ingress_top_I_ingress_I_config +openconfig_terminal_device_I_terminal_logical_channel_ingress_top_I_ingress_I_config : terminal-logical-channel-ingress-config {uses} +class "state" as openconfig_terminal_device_I_terminal_logical_channel_ingress_top_I_ingress_I_state <> +openconfig_terminal_device_I_terminal_logical_channel_ingress_top_I_ingress *-- "1" openconfig_terminal_device_I_terminal_logical_channel_ingress_top_I_ingress_I_state +note bottom of openconfig_terminal_device_I_terminal_logical_channel_ingress_top_I_ingress_I_state +Config = false +end note +openconfig_terminal_device_I_terminal_logical_channel_ingress_top_I_ingress_I_state : terminal-logical-channel-ingress-config {uses} +openconfig_terminal_device_I_terminal_logical_channel_ingress_top_I_ingress_I_state : terminal-logical-channel-ingress-state {uses} +class "terminal-logical-channel-config" as openconfig_terminal_device_I_terminal_logical_channel_config_grouping <<(G,Lime) grouping>> +openconfig_terminal_device_I_terminal_logical_channel_config_grouping : +index : uint32 {key} +openconfig_terminal_device_I_terminal_logical_channel_config_grouping : description : string +openconfig_terminal_device_I_terminal_logical_channel_config_grouping : admin-state : oc-opt-types:admin-state-type +openconfig_terminal_device_I_terminal_logical_channel_config_grouping : rate-class : identityref {oc-opt-types:TRIBUTARY_RATE_CLASS_TYPE} +openconfig_terminal_device_I_terminal_logical_channel_config_grouping : trib-protocol : identityref {oc-opt-types:TRIBUTARY_PROTOCOL_TYPE} +openconfig_terminal_device_I_terminal_logical_channel_config_grouping : logical-channel-type : identityref {oc-opt-types:LOGICAL_ELEMENT_PROTOCOL_TYPE} +openconfig_terminal_device_I_terminal_logical_channel_config_grouping : loopback-mode : oc-opt-types:loopback-mode-type +openconfig_terminal_device_I_terminal_logical_channel_config_grouping : test-signal : boolean +class "terminal-logical-channel-state" as openconfig_terminal_device_I_terminal_logical_channel_state_grouping <<(G,Lime) grouping>> +openconfig_terminal_device_I_terminal_logical_channel_state_grouping : link-state : enumeration : {UP,DOWN,TESTING,} +class "terminal-logical-channel-top" as openconfig_terminal_device_I_terminal_logical_channel_top_grouping <<(G,Lime) grouping>> +class "logical-channels" as openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels <> +openconfig_terminal_device_I_terminal_logical_channel_top_grouping *-- "1" openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels +class "channel" as openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel << (L, #FF7700) list>> +openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels *-- "0..N" openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel +openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel : +index : leafref : ../config/index {key} +class "config" as openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel_I_config <> +openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel *-- "1" openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel_I_config +openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel_I_config : terminal-logical-channel-config {uses} +class "state" as openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel_I_state <> +openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel *-- "1" openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel_I_state +note bottom of openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel_I_state +Config = false +end note +openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel_I_state : terminal-logical-channel-config {uses} +openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel_I_state : terminal-logical-channel-state {uses} +openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel : terminal-otn-protocol-top {uses} +openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel : terminal-ethernet-protocol-top {uses} +openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel : terminal-logical-channel-ingress-top {uses} +openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel : terminal-logical-chan-assignment-top {uses} +class "terminal-optical-channel-config" as openconfig_terminal_device_I_terminal_optical_channel_config_grouping <<(G,Lime) grouping>> +openconfig_terminal_device_I_terminal_optical_channel_config_grouping : frequency : oc-opt-types:frequency-type +openconfig_terminal_device_I_terminal_optical_channel_config_grouping : target-output-power : decimal64 {dBm} +openconfig_terminal_device_I_terminal_optical_channel_config_grouping : operational-mode : uint16 +openconfig_terminal_device_I_terminal_optical_channel_config_grouping : line-port : leafref : /oc-platform:components/oc-platform:component/oc-platform:name +class "terminal-optical-channel-state" as openconfig_terminal_device_I_terminal_optical_channel_state_grouping <<(G,Lime) grouping>> +openconfig_terminal_device_I_terminal_optical_channel_state_grouping : group-id : uint32 +openconfig_terminal_device_I_terminal_optical_channel_state_grouping : oc-transceiver:optical-power-state {uses} +class "chromatic-dispersion" as openconfig_terminal_device_I_terminal_optical_channel_state_I_chromatic_dispersion <> +openconfig_terminal_device_I_terminal_optical_channel_state_grouping *-- "1" openconfig_terminal_device_I_terminal_optical_channel_state_I_chromatic_dispersion +openconfig_terminal_device_I_terminal_optical_channel_state_I_chromatic_dispersion : oc-opt-types:avg-min-max-instant-stats-precision2-ps-nm {uses} +class "polarization-mode-dispersion" as openconfig_terminal_device_I_terminal_optical_channel_state_I_polarization_mode_dispersion <> +openconfig_terminal_device_I_terminal_optical_channel_state_grouping *-- "1" openconfig_terminal_device_I_terminal_optical_channel_state_I_polarization_mode_dispersion +openconfig_terminal_device_I_terminal_optical_channel_state_I_polarization_mode_dispersion : oc-opt-types:avg-min-max-instant-stats-precision2-ps {uses} +class "second-order-polarization-mode-dispersion" as openconfig_terminal_device_I_terminal_optical_channel_state_I_second_order_polarization_mode_dispersion <> +openconfig_terminal_device_I_terminal_optical_channel_state_grouping *-- "1" openconfig_terminal_device_I_terminal_optical_channel_state_I_second_order_polarization_mode_dispersion +openconfig_terminal_device_I_terminal_optical_channel_state_I_second_order_polarization_mode_dispersion : oc-opt-types:avg-min-max-instant-stats-precision2-ps2 {uses} +class "polarization-dependent-loss" as openconfig_terminal_device_I_terminal_optical_channel_state_I_polarization_dependent_loss <> +openconfig_terminal_device_I_terminal_optical_channel_state_grouping *-- "1" openconfig_terminal_device_I_terminal_optical_channel_state_I_polarization_dependent_loss +openconfig_terminal_device_I_terminal_optical_channel_state_I_polarization_dependent_loss : oc-types:avg-min-max-instant-stats-precision2-dB {uses} +class "terminal-optical-channel-top" as openconfig_terminal_device_I_terminal_optical_channel_top_grouping <<(G,Lime) grouping>> +class "optical-channel" as openconfig_terminal_device_I_terminal_optical_channel_top_I_optical_channel <> +openconfig_terminal_device_I_terminal_optical_channel_top_grouping *-- "1" openconfig_terminal_device_I_terminal_optical_channel_top_I_optical_channel +class "config" as openconfig_terminal_device_I_terminal_optical_channel_top_I_optical_channel_I_config <> +openconfig_terminal_device_I_terminal_optical_channel_top_I_optical_channel *-- "1" openconfig_terminal_device_I_terminal_optical_channel_top_I_optical_channel_I_config +openconfig_terminal_device_I_terminal_optical_channel_top_I_optical_channel_I_config : terminal-optical-channel-config {uses} +class "state" as openconfig_terminal_device_I_terminal_optical_channel_top_I_optical_channel_I_state <> +openconfig_terminal_device_I_terminal_optical_channel_top_I_optical_channel *-- "1" openconfig_terminal_device_I_terminal_optical_channel_top_I_optical_channel_I_state +note bottom of openconfig_terminal_device_I_terminal_optical_channel_top_I_optical_channel_I_state +Config = false +end note +openconfig_terminal_device_I_terminal_optical_channel_top_I_optical_channel_I_state : terminal-optical-channel-config {uses} +openconfig_terminal_device_I_terminal_optical_channel_top_I_optical_channel_I_state : terminal-optical-channel-state {uses} +class "terminal-operational-mode-config" as openconfig_terminal_device_I_terminal_operational_mode_config_grouping <<(G,Lime) grouping>> +class "terminal-operational-mode-state" as openconfig_terminal_device_I_terminal_operational_mode_state_grouping <<(G,Lime) grouping>> +openconfig_terminal_device_I_terminal_operational_mode_state_grouping : mode-id : uint16 +openconfig_terminal_device_I_terminal_operational_mode_state_grouping : description : string +openconfig_terminal_device_I_terminal_operational_mode_state_grouping : vendor-id : string +class "terminal-operational-mode-top" as openconfig_terminal_device_I_terminal_operational_mode_top_grouping <<(G,Lime) grouping>> +class "operational-modes" as openconfig_terminal_device_I_terminal_operational_mode_top_I_operational_modes <> +openconfig_terminal_device_I_terminal_operational_mode_top_grouping *-- "1" openconfig_terminal_device_I_terminal_operational_mode_top_I_operational_modes +class "mode" as openconfig_terminal_device_I_terminal_operational_mode_top_I_operational_modes_I_mode << (L, #FF7700) list>> +openconfig_terminal_device_I_terminal_operational_mode_top_I_operational_modes *-- "0..N" openconfig_terminal_device_I_terminal_operational_mode_top_I_operational_modes_I_mode +note bottom of openconfig_terminal_device_I_terminal_operational_mode_top_I_operational_modes_I_mode +Config = false +end note +openconfig_terminal_device_I_terminal_operational_mode_top_I_operational_modes_I_mode : +mode-id : leafref : ../state/mode-id {key} +class "config" as openconfig_terminal_device_I_terminal_operational_mode_top_I_operational_modes_I_mode_I_config <> +openconfig_terminal_device_I_terminal_operational_mode_top_I_operational_modes_I_mode *-- "1" openconfig_terminal_device_I_terminal_operational_mode_top_I_operational_modes_I_mode_I_config +openconfig_terminal_device_I_terminal_operational_mode_top_I_operational_modes_I_mode_I_config : terminal-operational-mode-config {uses} +class "state" as openconfig_terminal_device_I_terminal_operational_mode_top_I_operational_modes_I_mode_I_state <> +openconfig_terminal_device_I_terminal_operational_mode_top_I_operational_modes_I_mode *-- "1" openconfig_terminal_device_I_terminal_operational_mode_top_I_operational_modes_I_mode_I_state +note bottom of openconfig_terminal_device_I_terminal_operational_mode_top_I_operational_modes_I_mode_I_state +Config = false +end note +openconfig_terminal_device_I_terminal_operational_mode_top_I_operational_modes_I_mode_I_state : terminal-operational-mode-config {uses} +openconfig_terminal_device_I_terminal_operational_mode_top_I_operational_modes_I_mode_I_state : terminal-operational-mode-state {uses} +class "terminal-device-config" as openconfig_terminal_device_I_terminal_device_config_grouping <<(G,Lime) grouping>> +class "terminal-device-state" as openconfig_terminal_device_I_terminal_device_state_grouping <<(G,Lime) grouping>> +class "terminal-device-top" as openconfig_terminal_device_I_terminal_device_top_grouping <<(G,Lime) grouping>> +class "terminal-device" as openconfig_terminal_device_I_terminal_device_top_I_terminal_device <> +openconfig_terminal_device_I_terminal_device_top_grouping *-- "1" openconfig_terminal_device_I_terminal_device_top_I_terminal_device +class "config" as openconfig_terminal_device_I_terminal_device_top_I_terminal_device_I_config <> +openconfig_terminal_device_I_terminal_device_top_I_terminal_device *-- "1" openconfig_terminal_device_I_terminal_device_top_I_terminal_device_I_config +openconfig_terminal_device_I_terminal_device_top_I_terminal_device_I_config : terminal-device-config {uses} +class "state" as openconfig_terminal_device_I_terminal_device_top_I_terminal_device_I_state <> +openconfig_terminal_device_I_terminal_device_top_I_terminal_device *-- "1" openconfig_terminal_device_I_terminal_device_top_I_terminal_device_I_state +note bottom of openconfig_terminal_device_I_terminal_device_top_I_terminal_device_I_state +Config = false +end note +openconfig_terminal_device_I_terminal_device_top_I_terminal_device_I_state : terminal-device-config {uses} +openconfig_terminal_device_I_terminal_device_top_I_terminal_device_I_state : terminal-device-state {uses} +openconfig_terminal_device_I_terminal_device_top_I_terminal_device : terminal-logical-channel-top {uses} +openconfig_terminal_device_I_terminal_device_top_I_terminal_device : terminal-operational-mode-top {uses} +class "/oc-platform:components/oc-platform:component" as oc_platform_components_oc_platform_component << (A,CadetBlue) augment>> +openconfig_terminal_device *-- oc_platform_components_oc_platform_component +note bottom of oc_platform_components_oc_platform_component +When: /oc-platform:components/oc-platform:component/oc-platform:state/oc-platform:type = 'OPTICAL_CHANNEL' +end note +oc_platform_components_oc_platform_component : terminal-optical-channel-top {uses} +openconfig_terminal_device_I_terminal_otn_protocol_config_grouping-->oc_opt_types_TRIBUTARY_SLOT_GRANULARITY: tributary-slot-granularity +openconfig_terminal_device_I_terminal_logical_chan_assignment_config_grouping-->oc_opt_types_FRAME_MAPPING_PROTOCOL: mapping +openconfig_terminal_device_I_terminal_logical_channel_config_grouping-->oc_opt_types_TRIBUTARY_RATE_CLASS_TYPE: rate-class +openconfig_terminal_device_I_terminal_logical_channel_config_grouping-->oc_opt_types_TRIBUTARY_PROTOCOL_TYPE: trib-protocol +openconfig_terminal_device_I_terminal_logical_channel_config_grouping-->oc_opt_types_LOGICAL_ELEMENT_PROTOCOL_TYPE: logical-channel-type +} + +openconfig_terminal_device_I_terminal_ethernet_protocol_state_grouping --> openconfig_terminal_device_I_terminal_ethernet_protocol_state_counters_grouping : uses +openconfig_terminal_device_I_terminal_ethernet_protocol_top_I_ethernet_I_config --> openconfig_terminal_device_I_terminal_ethernet_protocol_config_grouping : uses +openconfig_terminal_device_I_terminal_ethernet_protocol_top_I_ethernet_I_state --> openconfig_terminal_device_I_terminal_ethernet_protocol_config_grouping : uses +openconfig_terminal_device_I_terminal_ethernet_protocol_top_I_ethernet_I_state --> openconfig_terminal_device_I_terminal_ethernet_protocol_state_grouping : uses +openconfig_terminal_device_I_terminal_ethernet_protocol_top_I_ethernet --> openconfig_terminal_device_I_lldp_logical_channel_top_grouping : uses +openconfig_terminal_device_I_lldp_logical_channel_top_I_lldp_I_config --> openconfig_terminal_device_I_lldp_logical_channel_config_grouping : uses +openconfig_terminal_device_I_lldp_logical_channel_top_I_lldp_I_state --> openconfig_terminal_device_I_lldp_logical_channel_config_grouping : uses +openconfig_terminal_device_I_lldp_logical_channel_top_I_lldp --> openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_grouping : uses +openconfig_terminal_device_I_lldp_logical_channel_neighbor_top_I_neighbors_I_neighbor_I_config --> openconfig_terminal_device_I_lldp_logical_channel_neighbor_config_grouping : uses +openconfig_terminal_device_I_terminal_otn_protocol_state_grouping --> openconfig_terminal_device_I_terminal_otn_protocol_counter_stats_grouping : uses +openconfig_terminal_device_I_terminal_otn_protocol_state_grouping --> openconfig_terminal_device_I_terminal_otn_protocol_multi_stats_grouping : uses +openconfig_terminal_device_I_terminal_otn_protocol_top_I_otn_I_config --> openconfig_terminal_device_I_terminal_otn_protocol_config_grouping : uses +openconfig_terminal_device_I_terminal_otn_protocol_top_I_otn_I_state --> openconfig_terminal_device_I_terminal_otn_protocol_config_grouping : uses +openconfig_terminal_device_I_terminal_otn_protocol_top_I_otn_I_state --> openconfig_terminal_device_I_terminal_otn_protocol_state_grouping : uses +openconfig_terminal_device_I_terminal_client_port_assignment_top_I_logical_channel_assignments_I_assignment_I_config --> openconfig_terminal_device_I_terminal_client_port_assignment_config_grouping : uses +openconfig_terminal_device_I_terminal_client_port_assignment_top_I_logical_channel_assignments_I_assignment_I_state --> openconfig_terminal_device_I_terminal_client_port_assignment_config_grouping : uses +openconfig_terminal_device_I_terminal_client_port_assignment_top_I_logical_channel_assignments_I_assignment_I_state --> openconfig_terminal_device_I_terminal_client_port_assignment_state_grouping : uses +openconfig_terminal_device_I_terminal_logical_chan_assignment_top_I_logical_channel_assignments_I_assignment_I_config --> openconfig_terminal_device_I_terminal_logical_chan_assignment_config_grouping : uses +openconfig_terminal_device_I_terminal_logical_chan_assignment_top_I_logical_channel_assignments_I_assignment_I_state --> openconfig_terminal_device_I_terminal_logical_chan_assignment_config_grouping : uses +openconfig_terminal_device_I_terminal_logical_chan_assignment_top_I_logical_channel_assignments_I_assignment_I_state --> openconfig_terminal_device_I_terminal_logical_chan_assignment_state_grouping : uses +openconfig_terminal_device_I_terminal_logical_channel_ingress_top_I_ingress_I_config --> openconfig_terminal_device_I_terminal_logical_channel_ingress_config_grouping : uses +openconfig_terminal_device_I_terminal_logical_channel_ingress_top_I_ingress_I_state --> openconfig_terminal_device_I_terminal_logical_channel_ingress_config_grouping : uses +openconfig_terminal_device_I_terminal_logical_channel_ingress_top_I_ingress_I_state --> openconfig_terminal_device_I_terminal_logical_channel_ingress_state_grouping : uses +openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel_I_config --> openconfig_terminal_device_I_terminal_logical_channel_config_grouping : uses +openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel_I_state --> openconfig_terminal_device_I_terminal_logical_channel_config_grouping : uses +openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel_I_state --> openconfig_terminal_device_I_terminal_logical_channel_state_grouping : uses +openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel --> openconfig_terminal_device_I_terminal_otn_protocol_top_grouping : uses +openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel --> openconfig_terminal_device_I_terminal_ethernet_protocol_top_grouping : uses +openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel --> openconfig_terminal_device_I_terminal_logical_channel_ingress_top_grouping : uses +openconfig_terminal_device_I_terminal_logical_channel_top_I_logical_channels_I_channel --> openconfig_terminal_device_I_terminal_logical_chan_assignment_top_grouping : uses +openconfig_terminal_device_I_terminal_optical_channel_top_I_optical_channel_I_config --> openconfig_terminal_device_I_terminal_optical_channel_config_grouping : uses +openconfig_terminal_device_I_terminal_optical_channel_top_I_optical_channel_I_state --> openconfig_terminal_device_I_terminal_optical_channel_config_grouping : uses +openconfig_terminal_device_I_terminal_optical_channel_top_I_optical_channel_I_state --> openconfig_terminal_device_I_terminal_optical_channel_state_grouping : uses +openconfig_terminal_device_I_terminal_operational_mode_top_I_operational_modes_I_mode_I_config --> openconfig_terminal_device_I_terminal_operational_mode_config_grouping : uses +openconfig_terminal_device_I_terminal_operational_mode_top_I_operational_modes_I_mode_I_state --> openconfig_terminal_device_I_terminal_operational_mode_config_grouping : uses +openconfig_terminal_device_I_terminal_operational_mode_top_I_operational_modes_I_mode_I_state --> openconfig_terminal_device_I_terminal_operational_mode_state_grouping : uses +openconfig_terminal_device_I_terminal_device_top_I_terminal_device_I_config --> openconfig_terminal_device_I_terminal_device_config_grouping : uses +openconfig_terminal_device_I_terminal_device_top_I_terminal_device_I_state --> openconfig_terminal_device_I_terminal_device_config_grouping : uses +openconfig_terminal_device_I_terminal_device_top_I_terminal_device_I_state --> openconfig_terminal_device_I_terminal_device_state_grouping : uses +openconfig_terminal_device_I_terminal_device_top_I_terminal_device --> openconfig_terminal_device_I_terminal_logical_channel_top_grouping : uses +openconfig_terminal_device_I_terminal_device_top_I_terminal_device --> openconfig_terminal_device_I_terminal_operational_mode_top_grouping : uses +oc_platform_components_oc_platform_component --> openconfig_terminal_device_I_terminal_optical_channel_top_grouping : uses +center footer + UML Generated : 2020-04-19 01:36 + endfooter +@enduml diff --git a/hackfest/openconfig/openconfig-terminal-device.yang b/hackfest/openconfig/openconfig-terminal-device.yang new file mode 100644 index 0000000000000000000000000000000000000000..6cd0160c6c6f7cd3e9d7bfaba33e020c3451984e --- /dev/null +++ b/hackfest/openconfig/openconfig-terminal-device.yang @@ -0,0 +1,1489 @@ +module openconfig-terminal-device { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/terminal-device"; + + prefix "oc-opt-term"; + + import openconfig-types { prefix oc-types; } + import openconfig-transport-types { prefix oc-opt-types; } + import openconfig-if-ethernet { prefix oc-eth; } + import openconfig-platform { prefix oc-platform; } + import openconfig-platform-transceiver { prefix oc-transceiver; } + import openconfig-lldp { prefix oc-lldp; } + import openconfig-extensions { prefix oc-ext; } + import ietf-yang-types { prefix yang; } + import openconfig-yang-types { prefix oc-yang; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module describes a terminal optics device model for + managing the terminal systems (client and line side) in a + DWDM transport network. + + Elements of the model: + + physical port: corresponds to a physical, pluggable client + port on the terminal device. Examples includes 10G, 40G, 100G + (e.g., 10x10G, 4x25G or 1x100G) and 400G/1T in the future. + Physical client ports will have associated operational state or + PMs. + + physical channel: a physical lane or channel in the + physical client port. Each physical client port has 1 or more + channels. An example is 100GBASE-LR4 client physical port having + 4x25G channels. Channels have their own optical PMs and can be + monitored independently within a client physical port (e.g., + channel power). Physical client channels are defined in the + model as part of a physical client port, and are modeled + primarily for reading their PMs. + + logical channel: a logical grouping of logical grooming elements + that may be assigned to subsequent grooming stages for + multiplexing / de-multiplexing, or to an optical channel for + line side transmission. The logical channels can represent, for + example, an ODU/OTU logical packing of the client + data onto the line side. Tributaries are similarly logical + groupings of demand that can be represented in this structure and + assigned to an optical channel. Note that different types of + logical channels may be present, each with their corresponding + PMs. + + optical channel: corresponds to an optical carrier and is + assigned a wavelength/frequency. Optical channels have PMs + such as power, BER, and operational mode. + + Directionality: + + To maintain simplicity in the model, the configuration is + described from client-to-line direction. The assumption is that + equivalent reverse configuration is implicit, resulting in + the same line-to-client configuration. + + Physical layout: + + The model does not assume a particular physical layout of client + and line ports on the terminal device (e.g., such as number of + ports per linecard, separate linecards for client and line ports, + etc.)."; + + oc-ext:openconfig-version "1.7.2"; + + revision "2019-11-28" { + description + "Additional xpath fixes in when statement"; + reference "1.7.2"; + } + + revision "2019-10-12" { + description + "Fix when statement paths"; + reference "1.7.1"; + } + + revision "2019-08-08" { + description + "Add ALS config to logical-channel/ethernet/config and remove + legacy interfaces augment for this config. Client FEC was + previosuly migrated to the components model and should not + be here anymore."; + reference "1.7.0"; + } + + revision "2019-07-26" { + description + "Add support for LLDP natively on logical-channels."; + reference "1.6.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "1.5.1"; + } + + revision "2018-10-23" { + description + "Adds support of logical-channel tributary slot allocation to + logical-channel-assignments with different channel speeds. + Enables logical channel mapping procedure specification."; + reference "1.5.0"; + } + + revision "2018-08-28" { + description + "Adds terminal device related Ethernet counters"; + reference "1.4.0"; + } + + revision "2018-07-30" { + description + "Adds lldp snooping config leaf and augmented it to oc-lldp"; + reference "1.3.0"; + } + + revision "2018-07-26" { + description + "Adds OTN protocol counter stats of errored-blocks and + fec-uncorrectable-blocks, adds ethernet-config-ext grouping + and uses it to augment oc-eth"; + reference "1.2.0"; + } + + revision "2018-07-17" { + description + "Adds testing enum to link-state"; + reference "1.1.0"; + } + + revision "2017-07-08" { + description + "Adds test-signal"; + reference "1.0.0"; + } + + revision "2016-12-22" { + description + "Fixes and additions to terminal optics model"; + reference "0.4.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + grouping terminal-input-optical-power { + description + "Reusable leaves related to input optical power"; + + leaf input-power { + type decimal64 { + fraction-digits 2; + } + units dBm; + description + "The input optical power of this port in units of 0.01dBm. + If the port is an aggregate of multiple physical channels, + this attribute is the total power or sum of all channels."; + } + } + + grouping terminal-ethernet-protocol-config { + description + "Configuration data for logical channels with Ethernet + framing"; + + leaf client-als { + type enumeration { + enum NONE { + description + "The client port will do nothing when a failure is + detected on the line port or the remote client port"; + } + enum LASER_SHUTDOWN { + description + "The client port will shut down the laser to notify the + subtending Ethernet equipment of the failure detected on + the line port or the remote client port."; + } + enum ETHERNET { + description + "The client port will propagate the local fault or remote + fault signal to the subtending Ethernet equipment."; + } + } + default ETHERNET; + description + "Sets the client port behavior that defines if the actions + of automatic laser shutdown (als), ethernet fault + propagation, or nothing will be done upon the detection + of a failure on the line port or the upstream remote + client port."; + } + + leaf als-delay { + type uint32; + units milliseconds; + default 0; + description + "The timer to delay the client-als actions on the client + port when a local or remote fault is detected on the line + port. The delay will only be valid when the client-als is + set to LASER_SHUTDOWN"; + } + } + + grouping terminal-ethernet-protocol-state { + description + "Ethernet-specific counters when logical channel + is using Ethernet protocol framing, e.g., 10GE, 100GE"; + + uses oc-eth:ethernet-interface-state-counters; + uses terminal-ethernet-protocol-state-counters; + } + + grouping terminal-ethernet-protocol-state-counters { + description + "Ethernet-specific counters for terminal devices when + logical channel is using Ethernet protocol framing, + e.g., 10GE, 100GE"; + + // ingress counters + + leaf in-pcs-bip-errors { + type oc-yang:counter64; + description + "The number of received bit interleaved parity (BIP) errors + at the physical coding sublayer (PCS). If the interface + consists of multiple lanes, this will be the sum of all + errors on the lane"; + } + + leaf in-pcs-errored-seconds { + type oc-yang:counter64; + description + "The number of seconds that physical coding sublayer (PCS) + errors have crossed a sytem defined threshold indicating the + link is erroring"; + } + + leaf in-pcs-severely-errored-seconds { + type oc-yang:counter64; + description + "The number of seconds that physical coding sublayer (PCS) + errors have crossed a system defined threshold indicating the + link is severely erroring"; + } + + leaf in-pcs-unavailable-seconds { + type oc-yang:counter64; + description + "The number of seconds that physical coding sublayer (PCS) + errors have crossed a system defined threshold indicating the + link is unavailable"; + } + + // egress counters + + leaf out-pcs-bip-errors { + type oc-yang:counter64; + description + "The number of transmitted bit interleaved parity (BIP) errors + at the physical coding sublayer (PCS). If the interface + consists of multiple lanes, this will be the sum of all + errors on the lane"; + } + + leaf out-crc-errors { + type oc-yang:counter64; + description + "Number of FCS/CRC error check failures sent on the interface"; + } + + leaf out-block-errors { + type oc-yang:counter64; + description + "The number of transmitted errored blocks. Error detection + codes are capable of detecting whether one or more errors have + occurred in a given sequence of bits – the block. It is + normally not possible to determine the exact number of errored + bits within the block"; + } + } + + grouping terminal-ethernet-protocol-top { + description + "Top-level grouping for data related to Ethernet protocol + framing on logical channels"; + + container ethernet { + description + "Top level container for data related to Ethernet framing + for the logical channel"; + + container config { + description + "Configuration data for Ethernet protocol framing on + logical channels"; + + uses terminal-ethernet-protocol-config; + } + + container state { + config false; + description + "Operational state data for Ethernet protocol framing + on logical channels"; + + uses terminal-ethernet-protocol-config; + uses terminal-ethernet-protocol-state; + } + + uses lldp-logical-channel-top; + } + } + + grouping lldp-logical-channel-top { + description + "Top-level grouping for LLDP data for a logical channel"; + + container lldp { + description + "LLDP data for logical channels"; + + container config { + description + "LLDP configuration data for logical channels"; + + uses lldp-logical-channel-config; + } + + container state { + config false; + description + "LLDP operational state data for logical channels"; + + uses lldp-logical-channel-config; + uses oc-lldp:lldp-interface-state; + } + + uses lldp-logical-channel-neighbor-top; + } + } + + grouping lldp-logical-channel-config { + description + "Configuration data for LLDP for logical-channels"; + + leaf enabled { + type boolean; + default "false"; + description + "Enable or disable the LLDP protocol on the logical channel."; + } + + leaf snooping { + type boolean; + default "false"; + description + "If true, LLDP PDUs are only received and processed on + the logical-channel, but are not originated by the local + agent. The PDUs are not dropped by the logical channel after + processing, but relayed to the downstream link layer + neighbors. The snooping mode is valid only when LLDP is + enabled on the logical channel. The snooping mode is useful + when a logical channel does not want its link layer neighbors + to discover itself since, for example, it is a lower-layer + logical channel."; + } + } + + grouping lldp-logical-channel-neighbor-top { + description + "Top-level grouping for the LLDP neighbor list"; + + container neighbors { + config false; + description + "Enclosing container for list of LLDP neighbors on + a logical channel"; + + list neighbor { + key "id"; + description + "List of LLDP neighbors. If the implementation only + supports one neighbor, this would always be a list with + one item. If the device and neighbor supported multiple + neighbors, which can be achieved via LLDP forwarding, then + this would be supported"; + reference + "IEEE Std 802.1AB-2016, section 7.1, Destination address"; + + leaf id { + type leafref { + path "../state/id"; + } + description + "System generated identifier for the neighbor on + the logical channel."; + } + + container config { + description + "Configuration data "; + + uses lldp-logical-channel-neighbor-config; + } + + container state { + + config false; + + description + "Operational state data "; + + uses oc-lldp:lldp-system-info-config; + uses oc-lldp:lldp-system-info-state; + uses oc-lldp:lldp-neighbor-config; + uses oc-lldp:lldp-neighbor-state; + } + + uses oc-lldp:lldp-custom-tlv-top; + } + } + } + + grouping lldp-logical-channel-neighbor-config { + description + "Configuration data for LLDP neighbors"; + } + + grouping terminal-otn-protocol-config { + description + "OTU configuration when logical channel + framing is using an OTU protocol, e.g., OTU1, OTU3, etc."; + + leaf tti-msg-transmit { + type string; + description + "Trail trace identifier (TTI) message transmitted"; + } + + leaf tti-msg-expected { + type string; + description + "Trail trace identifier (TTI) message expected"; + } + + leaf tti-msg-auto { + type boolean; + description + "Trail trace identifier (TTI) transmit message automatically + created. If true, then setting a custom transmit message + would be invalid."; + } + + leaf tributary-slot-granularity { + type identityref { + base oc-opt-types:TRIBUTARY_SLOT_GRANULARITY; + } + description + "Granularity value of OPUk or OPUCn tributary slots for OTN + signal allocation. The currently defined values follow the + existing ITU-T G.709 standard, which can be extended as + needed in future."; + } + } + + grouping terminal-otn-protocol-counter-stats { + description + "Counter based statistics containers for logical channels + using OTN framing"; + + leaf errored-seconds { + type yang:counter64; + description + "The number of seconds that at least one errored blocks + occurs, at least one code violation occurs, loss of sync is + detected or loss of signal is detected"; + } + + leaf severely-errored-seconds { + type yang:counter64; + description + "The number of seconds that loss of frame is detected OR + the number of errored blocks, code violations, loss of sync + or loss of signal is detected exceeds a predefined + threshold"; + } + + leaf unavailable-seconds { + type yang:counter64; + description + "The number of seconds during which the link is unavailable"; + } + + leaf code-violations { + type yang:counter64; + description + "For ethernet or fiberchannel links, the number of 8b/10b + coding violations. For SONET/SDH, the number of BIP (bit + interleaved parity) errors"; + } + + leaf errored-blocks { + type yang:counter64; + description + "The number of errored blocks. Error detection codes are + capable to detect whether one or more errors have occurred + in a given sequence of bits – the block. It is normally not + possible to determine the exact number of errored bits within + the block."; + reference "ITU-T Rec. G.826"; + } + + leaf fec-uncorrectable-blocks { + type yang:counter64; + description + "The number of blocks that were uncorrectable by the FEC"; + } + + leaf fec-uncorrectable-words { + type yang:counter64; + description + "The number of words that were uncorrectable by the FEC"; + } + + leaf fec-corrected-bytes { + type yang:counter64; + description + "The number of bytes that were corrected by the FEC"; + } + + leaf fec-corrected-bits { + type yang:counter64; + description + "The number of bits that were corrected by the FEC"; + } + + leaf background-block-errors { + type yang:counter64; + description + "The number of background block errors"; + } + } + + grouping terminal-otn-protocol-multi-stats { + description + "Multi-value statistics containers for logical channels using + OTN framing (e.g., max, min, avg, instant)"; + + container pre-fec-ber { + description + "Bit error rate before forward error correction -- computed + value with 18 decimal precision. Note that decimal64 + supports values as small as i x 10^-18 where i is an + integer. Values smaller than this should be reported as 0 + to inidicate error free or near error free performance. + Values include the instantaneous, average, minimum, and + maximum statistics. If avg/min/max statistics are not + supported, the target is expected to just supply the + instant value"; + + uses oc-opt-types:avg-min-max-instant-stats-precision18-ber; + } + + container post-fec-ber { + description + "Bit error rate after forward error correction -- computed + value with 18 decimal precision. Note that decimal64 + supports values as small as i x 10^-18 where i is an + integer. Values smaller than this should be reported as 0 + to inidicate error free or near error free performance. + Values include the instantaneous, average, minimum, and + maximum statistics. If avg/min/max statistics are not + supported, the target is expected to just supply the + instant value"; + + uses oc-opt-types:avg-min-max-instant-stats-precision18-ber; + } + + container q-value { + description + "Quality value (factor) in dB of a channel with two + decimal precision. Values include the instantaneous, + average, minimum, and maximum statistics. If avg/min/max + statistics are not supported, the target is expected + to just supply the instant value"; + + uses oc-types:avg-min-max-instant-stats-precision2-dB; + } + + container esnr { + description + "Electrical signal to noise ratio. Baud rate + normalized signal to noise ratio based on + error vector magnitude in dB with two decimal + precision. Values include the instantaneous, average, + minimum, and maximum statistics. If avg/min/max + statistics are not supported, the target is expected + to just supply the instant value"; + + uses oc-types:avg-min-max-instant-stats-precision2-dB; + } + } + + grouping terminal-otn-protocol-state { + description + "OTU operational state when logical channel + framing is using an OTU protocol, e.g., OTU1, OTU3, etc."; + + + leaf tti-msg-recv { + type string; + description + "Trail trace identifier (TTI) message received"; + } + + leaf rdi-msg { + type string; + description + "Remote defect indication (RDI) message received"; + } + uses terminal-otn-protocol-counter-stats; + uses terminal-otn-protocol-multi-stats; + } + + grouping terminal-otn-protocol-top { + description + "Top-level grouping for data related to OTN protocol framing"; + + container otn { + description + "Top level container for OTU configuration when logical + channel framing is using an OTU protocol, e.g., OTU1, OTU3, + etc."; + + container config { + description + "Configuration data for OTN protocol framing"; + + uses terminal-otn-protocol-config; + } + + container state { + + config false; + + description + "Operational state data for OTN protocol PMs, statistics, + etc."; + + uses terminal-otn-protocol-config; + uses terminal-otn-protocol-state; + } + } + } + + grouping terminal-client-port-assignment-config { + description + "Configuration data for assigning physical client ports to + logical channels"; + + leaf index { + type uint32; + description + "Index of the client port assignment"; + } + + leaf description { + type string; + description + "Descriptive name for the client port-to-logical channel + mapping"; + } + + leaf logical-channel { + type leafref { + path "/oc-opt-term:terminal-device/oc-opt-term:logical-channels" + + "/oc-opt-term:channel/oc-opt-term:index"; + } + description + "Reference to the logical channel for this + assignment"; + } + + leaf allocation { + type decimal64 { + fraction-digits 3; + } + units Gbps; + description + "Allocation of the client physical port to the assigned + logical channel expressed in Gbps. In most cases, + the full client physical port rate is assigned to a single + logical channel."; + } + + } + + grouping terminal-client-port-assignment-state { + description + "Operational state data for assigning physical client ports + to logical channels"; + } + + grouping terminal-client-port-assignment-top { + description + "Top-level grouping for the assigment of client physical ports + to logical channels"; + //TODO: this grouping could be removed, instead reusing a common + //grouping for logical client assignment pointers + + container logical-channel-assignments { + description + "Enclosing container for client port to logical client + mappings"; + + list assignment { + key "index"; + description + "List of assignments to logical clients"; + + leaf index { + type leafref { + path "../config/index"; + } + description + "Reference to the index of this logical client + assignment"; + } + + container config { + description + "Configuration data for the logical client assignment"; + + uses terminal-client-port-assignment-config; + } + + container state { + + config false; + + description + "Operational state data for the logical client + assignment"; + + uses terminal-client-port-assignment-config; + uses terminal-client-port-assignment-state; + } + } + } + } + + + grouping terminal-logical-chan-assignment-config { + description + "Configuration data for assigning client logical channels + to line-side tributaries"; + + leaf index { + type uint32; + description + "Index of the current logical client channel to tributary + mapping"; + } + + leaf description { + type string; + description + "Name assigned to the logical client channel"; + } + + leaf assignment-type { + type enumeration { + enum LOGICAL_CHANNEL { + description + "Subsequent channel is a logical channel"; + } + enum OPTICAL_CHANNEL { + description + "Subsequent channel is a optical channel / carrier"; + } + } + description + "Each logical channel element may be assigned to subsequent + stages of logical elements to implement further grooming, or + can be assigned to a line-side optical channel for + transmission. Each assignment also has an associated + bandwidth allocation."; + } + + leaf logical-channel { + type leafref { + path "/oc-opt-term:terminal-device/" + + "oc-opt-term:logical-channels/oc-opt-term:channel/" + + "oc-opt-term:index"; + } + must "../assignment-type = 'LOGICAL_CHANNEL'" { + description + "The assignment-type must be set to LOGICAL_CHANNEL for + this leaf to be valid"; + } + description + "Reference to another stage of logical channel elements."; + } + + leaf optical-channel { + type leafref { + path "/oc-platform:components/oc-platform:component/" + + "oc-platform:name"; + } + must "../assignment-type = 'OPTICAL_CHANNEL'" { + description + "The assignment-type must be set to OPTICAL_CHANNEL for + this leaf to be valid"; + } + description + "Reference to the line-side optical channel that should + carry the current logical channel element. Use this + reference to exit the logical element stage."; + } + + leaf allocation { + type decimal64 { + fraction-digits 3; + } + units Gbps; + description + "Allocation of the logical client channel to the tributary + or sub-channel, expressed in Gbps. Please note that if the + assignment is to an OTN logical channel, the allocation must + be an integer multiplication to tributary-slot-granularity + of the OTN logical channel."; + } + + leaf tributary-slot-index { + type int32; + description + "Indicates the first tributary slot index allocated to the + client signal or logical channel in the assignment. Valid + only when the assignment is to an OTN logical channel."; + } + + leaf mapping { + type identityref { + base oc-opt-types:FRAME_MAPPING_PROTOCOL; + } + description + "Logical channel mapping procedure. Valid only when the + assignment is to an OTN logical channel."; + } + } + + grouping terminal-logical-chan-assignment-state { + description + "Operational state data for the assignment of logical client + channel to line-side tributary"; + } + + grouping terminal-logical-chan-assignment-top { + description + "Top-level grouping for the list of logical client channel-to- + tributary assignments"; + + container logical-channel-assignments { + //TODO: we need a commonly understood name for this logical + //channel structure + description + "Enclosing container for tributary assignments"; + + list assignment { + key "index"; + description + "Logical channel elements may be assigned directly to + optical channels for line-side transmission, or can be + further groomed into additional stages of logical channel + elements. The grooming can multiplex (i.e., split the + current element into multiple elements in the subsequent + stage) or de-multiplex (i.e., combine the current element + with other elements into the same element in the subsequent + stage) logical elements in each stage. + + Note that to support the ability to groom the logical + elements, the list of logical channel elements should be + populated with an entry for the logical elements at + each stage, starting with the initial assignment from the + respective client physical port. + + Each logical element assignment consists of a pointer to + an element in the next stage, or to an optical channel, + along with a bandwidth allocation for the corresponding + assignment (e.g., to split or combine signal)."; + + leaf index { + type leafref { + path "../config/index"; + } + description + "Reference to the index for the current tributary + assignment"; + } + + container config { + description + "Configuration data for tributary assignments"; + + uses terminal-logical-chan-assignment-config; + } + + container state { + + config false; + + description + "Operational state data for tributary assignments"; + + uses terminal-logical-chan-assignment-config; + uses terminal-logical-chan-assignment-state; + } + } + } + } + + grouping terminal-logical-channel-ingress-config { + description + "Configuration data for ingress signal to logical channel"; + + leaf transceiver { + type leafref { + path "/oc-platform:components/oc-platform:component/" + + "oc-platform:name"; + } + description + "Reference to the transceiver carrying the input signal + for the logical channel. If specific physical channels + are mapped to the logical channel (as opposed to all + physical channels carried by the transceiver), they can be + specified in the list of physical channel references."; + } + + leaf-list physical-channel { + type leafref { + path "/oc-platform:components/oc-platform:component/" + + "oc-transceiver:transceiver/" + + "oc-transceiver:physical-channels/" + + "oc-transceiver:channel/oc-transceiver:index"; + } + description + "This list should be populated with references + to the client physical channels that feed this logical + channel from the transceiver specified in the 'transceiver' + leaf, which must be specified. If this leaf-list is empty, + all physical channels in the transceiver are assumed to be + mapped to the logical channel."; + } + } + + grouping terminal-logical-channel-ingress-state { + description + "Operational state data for ingress signal to logical channel"; + } + + grouping terminal-logical-channel-ingress-top { + description + "Top-level grouping for ingress signal to logical channel"; + + container ingress { + description + "Top-level container for specifying references to the + source of signal for the logical channel, either a + transceiver or individual physical channels"; + + container config { + description + "Configuration data for the signal source for the + logical channel"; + + uses terminal-logical-channel-ingress-config; + } + + container state { + + config false; + + description + "Operational state data for the signal source for the + logical channel"; + + uses terminal-logical-channel-ingress-config; + uses terminal-logical-channel-ingress-state; + } + } + } + + grouping terminal-logical-channel-config { + description + "Configuration data for logical channels"; + + leaf index { + type uint32; + description + "Index of the current logical channel"; + } + + leaf description { + type string; + description + "Description of the logical channel"; + } + + leaf admin-state { + type oc-opt-types:admin-state-type; + description + "Sets the admin state of the logical channel"; + } + + leaf rate-class { + type identityref { + base oc-opt-types:TRIBUTARY_RATE_CLASS_TYPE; + } + description + "Rounded bit rate of the tributary signal. Exact bit rate + will be refined by protocol selection."; + } + + leaf trib-protocol { + type identityref { + base oc-opt-types:TRIBUTARY_PROTOCOL_TYPE; + } + description + "Protocol framing of the tributary signal. If this + LogicalChannel is directly connected to a Client-Port or + Optical-Channel, this is the protocol of the associated port. + If the LogicalChannel is connected to other LogicalChannels, + the TributaryProtocol of the LogicalChannels will define a + specific mapping/demapping or multiplexing/demultiplexing + function. + + Not all protocols are valid, depending on the value + of trib-rate-class. The expectation is that the NMS + will validate that a correct combination of rate class + and protocol are specfied. Basic combinations are: + + rate class: 1G + protocols: 1GE + + rate class: 2.5G + protocols: OC48, STM16 + + rate class: 10G + protocols: 10GE LAN, 10GE WAN, OC192, STM64, OTU2, OTU2e, + OTU1e, ODU2, ODU2e, ODU1e + + rate class: 40G + protocols: 40GE, OC768, STM256, OTU3, ODU3 + + rate class: 100G + protocols: 100GE, 100G MLG, OTU4, OTUCn, ODU4"; + } + + leaf logical-channel-type { + type identityref { + base oc-opt-types:LOGICAL_ELEMENT_PROTOCOL_TYPE; + } + description + "The type / stage of the logical element determines the + configuration and operational state parameters (PMs) + available for the logical element"; + } + + leaf loopback-mode { + type oc-opt-types:loopback-mode-type; + description + "Sets the loopback type on the logical channel. Setting the + mode to something besides NONE activates the loopback in + the specified mode."; + } + + leaf test-signal { + type boolean; + description + "When enabled the logical channel's DSP will generate a pseudo + randmon bit stream (PRBS) which can be used during testing."; + } + } + + + grouping terminal-logical-channel-state { + description + "Operational state data for logical client channels"; + + leaf link-state { + type enumeration { + enum UP { + description + "Logical channel is operationally up"; + } + enum DOWN { + description + "Logical channel is operationally down"; + } + enum TESTING { + description + "Logical channel is under test as a result of + enabling test-signal"; + } + } + description + "Link-state of the Ethernet protocol on the logical channel, + SONET / SDH framed signal, etc."; + } + + } + + grouping terminal-logical-channel-top { + description + "Top-level grouping for logical channels"; + + container logical-channels { + description + "Enclosing container the list of logical channels"; + + list channel { + key "index"; + description + "List of logical channels"; + //TODO: naming for this list of logical elements should be + //revisited. + + leaf index { + type leafref { + path "../config/index"; + } + description + "Reference to the index of the logical channel"; + } + + container config { + description + "Configuration data for logical channels"; + + uses terminal-logical-channel-config; + + } + + container state { + + config false; + + description + "Operational state data for logical channels"; + + uses terminal-logical-channel-config; + uses terminal-logical-channel-state; + } + + uses terminal-otn-protocol-top { + when "./config/logical-channel-type = 'PROT_OTN'" { + description + "Include the OTN protocol data only when the + channel is using OTN framing."; + } + } + uses terminal-ethernet-protocol-top { + when "./config/logical-channel-type = 'PROT_ETHERNET'" { + description + "Include the Ethernet protocol statistics only when the + protocol used by the link is Ethernet."; + } + } + uses terminal-logical-channel-ingress-top; + uses terminal-logical-chan-assignment-top; + } + } + } + + + grouping terminal-optical-channel-config { + description + "Configuration data for describing optical channels"; + + leaf frequency { + type oc-opt-types:frequency-type; + description + "Frequency of the optical channel, expressed in MHz"; + } + + leaf target-output-power { + type decimal64 { + fraction-digits 2; + } + units dBm; + description + "Target output optical power level of the optical channel, + expressed in increments of 0.01 dBm (decibel-milliwats)"; + } + + leaf operational-mode { + type uint16; + description + "Vendor-specific mode identifier -- sets the operational + mode for the channel. The specified operational mode must + exist in the list of supported operational modes supplied + by the device"; + // + // Ideally, this leaf should be a leafref to the supported + // operational modes, but YANG 1.0 does not allow a r/w + // leaf to be a leafref to a r/o leaf. + } + + + leaf line-port { + type leafref { + path "/oc-platform:components/oc-platform:component/" + + "oc-platform:name"; + } + description + "Reference to the line-side physical port that carries + this optical channel. The target port should be + a component in the physical inventory data model."; + } + } + + grouping terminal-optical-channel-state { + description + "Operational state data for optical channels"; + + leaf group-id { + type uint32; + description + "If the device places constraints on which optical + channels must be managed together (e.g., transmitted on the + same line port), it can indicate that by setting the group-id + to the same value across related optical channels."; + } + + uses oc-transceiver:optical-power-state; + + container chromatic-dispersion { + description + "Chromatic Dispersion of an optical channel in + picoseconds / nanometer (ps/nm) as reported by receiver + with two decimal precision. Values include the instantaneous, + average, minimum, and maximum statistics. If avg/min/max + statistics are not supported, the target is expected to just + supply the instant value"; + + uses oc-opt-types:avg-min-max-instant-stats-precision2-ps-nm; + } + + container polarization-mode-dispersion { + description + "Polarization Mode Dispersion of an optical channel + in picosends (ps) as reported by receiver with two decimal + precision. Values include the instantaneous, average, + minimum, and maximum statistics. If avg/min/max statistics + are not supported, the target is expected to just supply the + instant value"; + + uses oc-opt-types:avg-min-max-instant-stats-precision2-ps; + } + + container second-order-polarization-mode-dispersion { + description + "Second Order Polarization Mode Dispersion of an optical + channel in picoseconds squared (ps^2) as reported by + receiver with two decimal precision. Values include the + instantaneous, average, minimum, and maximum statistics. + If avg/min/max statistics are not supported, the target + is expected to just supply the instant value"; + + uses oc-opt-types:avg-min-max-instant-stats-precision2-ps2; + } + + container polarization-dependent-loss { + description + "Polarization Dependent Loss of an optical channel + in dB as reported by receiver with two decimal precision. + Values include the instantaneous, average, minimum, and + maximum statistics. If avg/min/max statistics are not + supported, the target is expected to just supply the + instant value"; + + uses oc-types:avg-min-max-instant-stats-precision2-dB; + } + } + + grouping terminal-optical-channel-top { + description + "Top-level grouping for optical channel data"; + + container optical-channel { + description + "Enclosing container for the list of optical channels"; + + container config { + description + "Configuration data for optical channels"; + + uses terminal-optical-channel-config; + } + + container state { + + config false; + + description + "Operational state data for optical channels"; + + uses terminal-optical-channel-config; + uses terminal-optical-channel-state; + } + } + } + + grouping terminal-operational-mode-config { + description + "Configuration data for vendor-supported operational modes"; + } + + grouping terminal-operational-mode-state { + description + "Operational state data for vendor-supported operational + modes"; + + leaf mode-id { + type uint16; + description + "Two-octet encoding of the vendor-defined operational + mode"; + } + + leaf description { + type string; + description + "Vendor-supplied textual description of the characteristics + of this operational mode to enable operators to select the + appropriate mode for the application."; + } + + //TODO: examples of the kind of info that would be useful to + //report in the operational mode: + //Symbol rate (32G, 40G, 43G, 64G, etc.) + //Modulation (QPSK, 8-QAM, 16-QAM, etc.) + //Differential encoding (on, off/pilot symbol, etc) + //State of polarization tracking mode (default, med. + //high-speed, etc.) + //Pulse shaping (RRC, RC, roll-off factor) + //FEC mode (SD, HD, % OH) + + leaf vendor-id { + type string; + description + "Identifier to represent the vendor / supplier of the + platform and the associated operational mode information"; + } + } + + grouping terminal-operational-mode-top { + description + "Top-level grouping for vendor-supported operational modes"; + + container operational-modes { + description + "Enclosing container for list of operational modes"; + + list mode { + key "mode-id"; + config false; + description + "List of operational modes supported by the platform. + The operational mode provides a platform-defined summary + of information such as symbol rate, modulation, pulse + shaping, etc."; + + leaf mode-id { + type leafref { + path "../state/mode-id"; + } + description + "Reference to mode-id"; + } + + container config { + description + "Configuration data for operational mode"; + + uses terminal-operational-mode-config; + } + + container state { + + config false; + + description + "Operational state data for the platform-defined + operational mode"; + + uses terminal-operational-mode-config; + uses terminal-operational-mode-state; + } + } + } + } + + grouping terminal-device-config { + description + "Configuration data for transport terminal devices at a + device-wide level"; + } + + grouping terminal-device-state { + description + "Operational state data for transport terminal devices at a + device-wide level"; + } + + grouping terminal-device-top { + description + "Top-level grouping for data for terminal devices"; + + container terminal-device { + description + "Top-level container for the terminal device"; + + container config { + description + "Configuration data for global terminal-device"; + + uses terminal-device-config; + } + + container state { + + config false; + + description + "Operational state data for global terminal device"; + + uses terminal-device-config; + uses terminal-device-state; + } + + uses terminal-logical-channel-top; + uses terminal-operational-mode-top; + + } + } + + // data definition statements + + uses terminal-device-top; + + // augment statements + + augment "/oc-platform:components/oc-platform:component" { + when "/oc-platform:components/oc-platform:component/" + + "oc-platform:state/oc-platform:type = 'OPTICAL_CHANNEL'" { + description + "Augment is active when component is of type + OPTICAL_CHANNEL"; + } + description + "Adding optical channel data to physical inventory"; + + uses terminal-optical-channel-top { + } + } +} diff --git a/hackfest/openconfig/terminal.json b/hackfest/openconfig/terminal.json new file mode 100644 index 0000000000000000000000000000000000000000..9c7164f2c1cc240544ac4ab13e532408f198cb30 --- /dev/null +++ b/hackfest/openconfig/terminal.json @@ -0,0 +1,22 @@ +{ + "terminal-device" : { + "logical-channels" : { + "channel" : [ + { + "index" : 1, + "config" : { "index" : 1 }, + "otn" : { + "state" : { + "q-value" : { + "instant" : "5" + }, + "esnr" : { + "instant" : "6" + } + } + } + } + ] + } + } +} diff --git a/hackfest/p4/README.md b/hackfest/p4/README.md new file mode 100644 index 0000000000000000000000000000000000000000..344b88c0826a4d44ded9c8369a5009e73ed211b4 --- /dev/null +++ b/hackfest/p4/README.md @@ -0,0 +1,97 @@ +# Network X 22 Demo - P4 driver, Basic connectivity functionality + +This functional test shows the P4 driver with a basic connectivity test between 2 hosts connected to a single P4 switch, using the TeraFlow Cloud-native SDN Controller. + +## Functional test folder + +This functional test can be found in folder `hackfest/p4` + +## P4 source and Mininet topology + +This test is designed to operate with a mininet deployment that contains 2 hosts and a BMv2 switch, such a topology can be found in the 'hackfest/p4/mininet' folder. +Additionally the P4 source code, along with its compiled artifacts are present in the 'hackfest/p4/p4' folder. + +## Deployment and Dependencies + +To run this functional test, it is assumed you have deployed a MicroK8s-based Kubernetes environment and a TeraFlowSDN +controller instance as described in the [Tutorial: Deployment Guide](./1-0-deployment.md), and you configured the Python +environment as described in +[Tutorial: Run Experiments Guide > 2.1. Configure Python Environment](./2-1-python-environment.md). +Remember to source the scenario settings appropriately, e.g., `cd ~/tfs-ctrl && source my_deploy.sh` in each terminal +you open. + +Additionally mininet with a p4 switch (bmv2 for example) should be installed, we suggest using the mininet packaged in the [Next-Gen SDN Tutorial][https://github.com/opennetworkinglab/ngsdn-tutorial], as it provides an easy way to deploy mininet dockerized and comes with the BMv2Stratum software switch. + +### Next-Gen SDN Tutorial installation + +To install the recommended mininet from the Next-Gen SDN Tutorial follow these steps: + +First of all you should have the following dependencies installed: + +- Docker v1.13.0+ (with docker-compose) +- make +- Python 3 + +Then clone the repo +``` +cd ~ +git clone -b advanced https://github.com/opennetworkinglab/ngsdn-tutorial +``` + +After the repo is downloaded do the following to download the required docker images +``` +cd ~/ngsdn-tutorial +make deps +``` + +Add the following make rule to the ~/ngsdn-tutorial/Makefile +``` +start-simple: NGSDN_TOPO_PY := topo-simple.py +start-simple: _start +``` + +And copy the topology file from ~/tfs-ctrl/hackfest/p4/mininet/topo-simple.py to the ~/ngsdn-tutorial/mininet/ directory. + +## Test Execution + +### Mininet +To execute this functional test, first start mininet: +``` +make start-simple +make mn-cli +``` + +You will be prompted with the mininet cli. Run the following and let it run until the end of the experiment +``` +client ping server +``` + +### Teraflow + +In another terminal cd to the teraflow directory and run the following +``` +hackfest/p4/setup.sh +``` +This will copy the p4 artifacts to the device pod. + +Then you can bootstrap the device to the Teraflow Controller +``` +hackfest/p4/run_test_01_bootstrap.sh +``` + +Install the required rules to the p4 switch +``` +hackfest/p4/run_test_02_create_service.sh +``` +You should now check the mininet terminal. The two hosts should be pinging each other as intended. + +You can remove the rules from the p4 switch +``` +hackfest/p4/run_test_03_delete_service.sh +``` +The two hosts on the mininet terminal, should stop pinging. + +And remove the device from the Teraflow Controller +``` +hackfest/p4/run_test_04_cleanup.sh +``` diff --git a/src/common/orm/__init__.py b/hackfest/p4/__init__.py similarity index 88% rename from src/common/orm/__init__.py rename to hackfest/p4/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/common/orm/__init__.py +++ b/hackfest/p4/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hackfest/p4/deploy_specs.sh b/hackfest/p4/deploy_specs.sh new file mode 100755 index 0000000000000000000000000000000000000000..b988123d5564684bd1bfcb776bab7f187fc628ca --- /dev/null +++ b/hackfest/p4/deploy_specs.sh @@ -0,0 +1,31 @@ +# 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. + +# Set the URL of your local Docker registry where the images will be uploaded to. +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" + +# Set the tag you want to use for your images. +export TFS_IMAGE_TAG="dev" + +# Set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE="tfs" + +# Set additional manifest files to be applied after the deployment +export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml" + +# Set the neew Grafana admin password +export TFS_GRAFANA_PASSWORD="admin123+" diff --git a/hackfest/p4/mininet/topo-simple.py b/hackfest/p4/mininet/topo-simple.py new file mode 100644 index 0000000000000000000000000000000000000000..8a7ccaf62ecb69113e459acfbc99e020df3a02c7 --- /dev/null +++ b/hackfest/p4/mininet/topo-simple.py @@ -0,0 +1,96 @@ +#!/usr/bin/python + +# 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. + +import argparse + +from mininet.cli import CLI +from mininet.log import setLogLevel +from mininet.net import Mininet +from mininet.node import Host +from mininet.topo import Topo +from stratum import StratumBmv2Switch + +CPU_PORT = 255 + +class IPv4Host(Host): + """Host that can be configured with an IPv4 gateway (default route). + """ + + def config(self, mac=None, ip=None, defaultRoute=None, lo='up', gw=None, + **_params): + super(IPv4Host, self).config(mac, ip, defaultRoute, lo, **_params) + self.cmd('arp -s 192.168.1.1 11:22:33:44:55:77') + self.cmd('ip -4 addr flush dev %s' % self.defaultIntf()) + self.cmd('ip -6 addr flush dev %s' % self.defaultIntf()) + self.cmd('ip -4 link set up %s' % self.defaultIntf()) + self.cmd('ip -4 addr add %s dev %s' % (ip, self.defaultIntf())) + if gw: + self.cmd('ip -4 route add default via %s' % gw) + # Disable offload + for attr in ["rx", "tx", "sg"]: + cmd = "/sbin/ethtool --offload %s %s off" % ( + self.defaultIntf(), attr) + self.cmd(cmd) + + def updateIP(): + return ip.split('/')[0] + + self.defaultIntf().updateIP = updateIP + +class TutorialTopo(Topo): + """Basic Server-Client topology with IPv4 hosts""" + + def __init__(self, *args, **kwargs): + Topo.__init__(self, *args, **kwargs) + + # Spines + # gRPC port 50001 + switch1 = self.addSwitch('switch1', cls=StratumBmv2Switch, cpuport=CPU_PORT) + + # IPv4 hosts attached to switch 1 + client = self.addHost('client', cls=IPv4Host, mac="aa:bb:cc:dd:ee:11", + ip='10.0.0.1/24', gw='10.0.0.100') + server = self.addHost('server', cls=IPv4Host, mac="aa:bb:cc:dd:ee:22", + ip='10.0.0.2/24', gw='10.0.0.100') + self.addLink(client, switch1) # port 1 + self.addLink(server, switch1) # port 2 + + +def main(): + net = Mininet(topo=TutorialTopo(), controller=None) + net.start() + client = net.hosts[0] + server = net.hosts[1] + client.setARP('10.0.0.2', 'aa:bb:cc:dd:ee:22') + server.setARP('10.0.0.1', 'aa:bb:cc:dd:ee:11') + CLI(net) + net.stop() + print '#' * 80 + print 'ATTENTION: Mininet was stopped! Perhaps accidentally?' + print 'No worries, it will restart automatically in a few seconds...' + print 'To access again the Mininet CLI, use `make mn-cli`' + print 'To detach from the CLI (without stopping), press Ctrl-D' + print 'To permanently quit Mininet, use `make stop`' + print '#' * 80 + + +if __name__ == "__main__": + parser = argparse.ArgumentParser( + description='Mininet topology script for 2x2 fabric with stratum_bmv2 and IPv4 hosts') + args = parser.parse_args() + setLogLevel('info') + + main() diff --git a/hackfest/p4/p4/bmv2.json b/hackfest/p4/p4/bmv2.json new file mode 100644 index 0000000000000000000000000000000000000000..b1e3fa8ce1f6d19e9c94384d85a7ab5875a614b0 --- /dev/null +++ b/hackfest/p4/p4/bmv2.json @@ -0,0 +1,669 @@ +{ + "header_types" : [ + { + "name" : "scalars_0", + "id" : 0, + "fields" : [ + ["tmp", 1, false], + ["local_metadata_t.is_multicast", 1, false], + ["_padding_0", 6, 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" : 148, + "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.drop", + "id" : 1, + "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" : 2, + "runtime_data" : [ + { + "name" : "port_num", + "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_num" + } + } + ] + }, + { + "name" : "IngressPipeImpl.set_egress_port", + "id" : 3, + "runtime_data" : [ + { + "name" : "port_num", + "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_num" + } + } + ] + }, + { + "name" : "IngressPipeImpl.set_multicast_group", + "id" : 4, + "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" + } + } + ] + }, + { + "name" : "IngressPipeImpl.set_multicast_group", + "id" : 5, + "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" + } + } + ] + }, + { + "name" : "act", + "id" : 6, + "runtime_data" : [], + "primitives" : [ + { + "op" : "assign", + "parameters" : [ + { + "type" : "field", + "value" : ["scalars", "tmp"] + }, + { + "type" : "expression", + "value" : { + "type" : "expression", + "value" : { + "op" : "b2d", + "left" : null, + "right" : { + "type" : "bool", + "value" : true + } + } + } + } + ] + } + ] + }, + { + "name" : "act_0", + "id" : 7, + "runtime_data" : [], + "primitives" : [ + { + "op" : "assign", + "parameters" : [ + { + "type" : "field", + "value" : ["scalars", "tmp"] + }, + { + "type" : "expression", + "value" : { + "type" : "expression", + "value" : { + "op" : "b2d", + "left" : null, + "right" : { + "type" : "bool", + "value" : false + } + } + } + } + ] + } + ] + } + ], + "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" : "hdr.ethernet.dst_addr", + "target" : ["ethernet", "dst_addr"], + "mask" : null + } + ], + "match_type" : "exact", + "type" : "simple", + "max_size" : 1024, + "with_counters" : false, + "support_timeout" : false, + "direct_meters" : null, + "action_ids" : [2, 4, 0], + "actions" : ["IngressPipeImpl.set_egress_port", "IngressPipeImpl.set_multicast_group", "IngressPipeImpl.drop"], + "base_default_next" : null, + "next_tables" : { + "__HIT__" : "tbl_act", + "__MISS__" : "tbl_act_0" + }, + "default_entry" : { + "action_id" : 0, + "action_const" : true, + "action_data" : [], + "action_entry_const" : true + } + }, + { + "name" : "tbl_act", + "id" : 1, + "key" : [], + "match_type" : "exact", + "type" : "simple", + "max_size" : 1024, + "with_counters" : false, + "support_timeout" : false, + "direct_meters" : null, + "action_ids" : [6], + "actions" : ["act"], + "base_default_next" : "node_5", + "next_tables" : { + "act" : "node_5" + }, + "default_entry" : { + "action_id" : 6, + "action_const" : true, + "action_data" : [], + "action_entry_const" : true + } + }, + { + "name" : "tbl_act_0", + "id" : 2, + "key" : [], + "match_type" : "exact", + "type" : "simple", + "max_size" : 1024, + "with_counters" : false, + "support_timeout" : false, + "direct_meters" : null, + "action_ids" : [7], + "actions" : ["act_0"], + "base_default_next" : "node_5", + "next_tables" : { + "act_0" : "node_5" + }, + "default_entry" : { + "action_id" : 7, + "action_const" : true, + "action_data" : [], + "action_entry_const" : true + } + }, + { + "name" : "IngressPipeImpl.l2_ternary_table", + "id" : 3, + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 109, + "column" : 10, + "source_fragment" : "l2_ternary_table" + }, + "key" : [ + { + "match_type" : "ternary", + "name" : "hdr.ethernet.dst_addr", + "target" : ["ethernet", "dst_addr"], + "mask" : null + } + ], + "match_type" : "ternary", + "type" : "simple", + "max_size" : 1024, + "with_counters" : false, + "support_timeout" : false, + "direct_meters" : null, + "action_ids" : [3, 5, 1], + "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" : 1, + "action_const" : true, + "action_data" : [], + "action_entry_const" : true + } + } + ], + "action_profiles" : [], + "conditionals" : [ + { + "name" : "node_5", + "id" : 0, + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 122, + "column" : 12, + "source_fragment" : "!l2_exact_table.apply().hit" + }, + "expression" : { + "type" : "expression", + "value" : { + "op" : "not", + "left" : null, + "right" : { + "type" : "expression", + "value" : { + "op" : "d2b", + "left" : null, + "right" : { + "type" : "field", + "value" : ["scalars", "tmp"] + } + } + } + } + }, + "false_next" : null, + "true_next" : "IngressPipeImpl.l2_ternary_table" + } + ] + }, + { + "name" : "egress", + "id" : 1, + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 134, + "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/hackfest/p4/p4/main.p4 b/hackfest/p4/p4/main.p4 new file mode 100644 index 0000000000000000000000000000000000000000..fb94bdfd24722862831989bad1e173858f5a0d4d --- /dev/null +++ b/hackfest/p4/p4/main.p4 @@ -0,0 +1,162 @@ +/* + * 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 +#include + +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_num) { + standard_metadata.egress_spec = port_num; + } + + 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 = { + hdr.ethernet.dst_addr: exact; + } + actions = { + set_egress_port; + set_multicast_group; + @defaultonly drop; + } + const default_action = drop; + } + + // --- l2_ternary_table ------------------ + + table l2_ternary_table { + key = { + hdr.ethernet.dst_addr: ternary; + } + actions = { + set_egress_port; + set_multicast_group; + @defaultonly drop; + } + const default_action = drop; + } + + apply { + if (!l2_exact_table.apply().hit) { + // ...if an entry is NOT found, apply the ternary one in case + // this is a multicast/broadcast NDP NS packet. + l2_ternary_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/hackfest/p4/p4/p4info.txt b/hackfest/p4/p4/p4info.txt new file mode 100644 index 0000000000000000000000000000000000000000..4048dfcd32bdb5dfd58b89b6b83ab7e1fc0188ca --- /dev/null +++ b/hackfest/p4/p4/p4info.txt @@ -0,0 +1,88 @@ +pkg_info { + arch: "v1model" +} +tables { + preamble { + id: 33605373 + name: "IngressPipeImpl.l2_exact_table" + alias: "l2_exact_table" + } + match_fields { + id: 1 + name: "hdr.ethernet.dst_addr" + bitwidth: 48 + 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 +} +tables { + preamble { + id: 33573501 + name: "IngressPipeImpl.l2_ternary_table" + alias: "l2_ternary_table" + } + match_fields { + id: 1 + name: "hdr.ethernet.dst_addr" + bitwidth: 48 + match_type: TERNARY + } + 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_num" + 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/hackfest/p4/run_test_01_bootstrap.sh b/hackfest/p4/run_test_01_bootstrap.sh new file mode 100755 index 0000000000000000000000000000000000000000..af35fa3dc6cbd4c8ca444e1b9a9a6edc9a16578f --- /dev/null +++ b/hackfest/p4/run_test_01_bootstrap.sh @@ -0,0 +1,22 @@ +#!/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. + +# make sure to source the following scripts: +# - my_deploy.sh +# - tfs_runtime_env_vars.sh + +source tfs_runtime_env_vars.sh +python -m pytest --verbose hackfest/p4/tests/test_functional_bootstrap.py + diff --git a/hackfest/p4/run_test_02_create_service.sh b/hackfest/p4/run_test_02_create_service.sh new file mode 100755 index 0000000000000000000000000000000000000000..1b5c55994534fda87e263c48c7669e2e4cd78108 --- /dev/null +++ b/hackfest/p4/run_test_02_create_service.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. + +source tfs_runtime_env_vars.sh +python -m pytest --verbose hackfest/p4/tests/test_functional_create_service.py diff --git a/hackfest/p4/run_test_03_delete_service.sh b/hackfest/p4/run_test_03_delete_service.sh new file mode 100755 index 0000000000000000000000000000000000000000..d641d8c4f46f83eb6ee6d20bfb90e6efd8d6f34c --- /dev/null +++ b/hackfest/p4/run_test_03_delete_service.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. + +source tfs_runtime_env_vars.sh +python -m pytest --verbose hackfest/p4/tests/test_functional_delete_service.py diff --git a/src/tests/ofc22/show_logs_automation.sh b/hackfest/p4/run_test_04_cleanup.sh similarity index 76% rename from src/tests/ofc22/show_logs_automation.sh rename to hackfest/p4/run_test_04_cleanup.sh index 778cfaa942bcb36a81ccd571afe0f024c32d373d..d87ef1a0071283b7e2e2388c8cf097335d808698 100755 --- a/src/tests/ofc22/show_logs_automation.sh +++ b/hackfest/p4/run_test_04_cleanup.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,5 +13,5 @@ # See the License for the specific language governing permissions and # limitations under the License. -K8S_NAMESPACE="ofc22" -kubectl --namespace $K8S_NAMESPACE logs deployment/automationservice +source tfs_runtime_env_vars.sh +python -m pytest --verbose hackfest/p4/tests/test_functional_cleanup.py diff --git a/hackfest/p4/setup.sh b/hackfest/p4/setup.sh new file mode 100755 index 0000000000000000000000000000000000000000..3ab0faf9ed72c202b97eb6506c46de6d7bf5c3de --- /dev/null +++ b/hackfest/p4/setup.sh @@ -0,0 +1,22 @@ +#! /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. + + +export POD_NAME=$(kubectl get pods -n=tfs | grep device | awk '{print $1}') + +kubectl exec ${POD_NAME} -n=tfs -- mkdir /root/p4 + +kubectl cp hackfest/p4/p4/p4info.txt tfs/${POD_NAME}:/root/p4 +kubectl cp hackfest/p4/p4/bmv2.json tfs/${POD_NAME}:/root/p4 diff --git a/hackfest/p4/tests/.gitignore b/hackfest/p4/tests/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..76cb708d1b532c9b69166e55f36bcb912fd5e370 --- /dev/null +++ b/hackfest/p4/tests/.gitignore @@ -0,0 +1,2 @@ +# Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. +Credentials.py diff --git a/hackfest/p4/tests/BuildDescriptors.py b/hackfest/p4/tests/BuildDescriptors.py new file mode 100644 index 0000000000000000000000000000000000000000..98b78863318a7ad682fc5f970d44d02240b45a26 --- /dev/null +++ b/hackfest/p4/tests/BuildDescriptors.py @@ -0,0 +1,35 @@ +# 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, json, sys +from .Objects import CONTEXTS, DEVICES, LINKS, TOPOLOGIES + +def main(): + with open('tests/ofc22/descriptors_emulated.json', 'w', encoding='UTF-8') as f: + devices = [] + for device,connect_rules in DEVICES: + device = copy.deepcopy(device) + device['device_config']['config_rules'].extend(connect_rules) + devices.append(device) + + f.write(json.dumps({ + 'contexts': CONTEXTS, + 'topologies': TOPOLOGIES, + 'devices': devices, + 'links': LINKS + })) + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/hackfest/p4/tests/LoadDescriptors.py b/hackfest/p4/tests/LoadDescriptors.py new file mode 100644 index 0000000000000000000000000000000000000000..b232935f4675d718d55e67fe3a76012a39398dda --- /dev/null +++ b/hackfest/p4/tests/LoadDescriptors.py @@ -0,0 +1,40 @@ +# 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, logging, sys +from common.Settings import get_setting +from context.client.ContextClient import ContextClient +from common.proto.context_pb2 import Context, Device, Link, Topology +from device.client.DeviceClient import DeviceClient + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +def main(): + context_client = ContextClient( + get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + device_client = DeviceClient( + get_setting('DEVICESERVICE_SERVICE_HOST'), get_setting('DEVICESERVICE_SERVICE_PORT_GRPC')) + + with open('tests/ofc22/descriptors.json', 'r', encoding='UTF-8') as f: + descriptors = json.loads(f.read()) + + for context in descriptors['contexts' ]: context_client.SetContext (Context (**context )) + for topology in descriptors['topologies']: context_client.SetTopology(Topology(**topology)) + for device in descriptors['devices' ]: device_client .AddDevice (Device (**device )) + for link in descriptors['links' ]: context_client.SetLink (Link (**link )) + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/hackfest/p4/tests/Objects.py b/hackfest/p4/tests/Objects.py new file mode 100644 index 0000000000000000000000000000000000000000..97557d7394248cccaede6ccee14728d9c17dd397 --- /dev/null +++ b/hackfest/p4/tests/Objects.py @@ -0,0 +1,311 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +from typing import Dict, List, Tuple +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Device import ( + json_device_connect_rules, json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, + json_device_connect_rules, json_device_id, json_device_p4_disabled, + json_device_emulated_tapi_disabled, json_device_id, json_device_packetrouter_disabled, json_device_tapi_disabled) +from common.tools.object_factory.ConfigRule import ( + json_config_rule_set, json_config_rule_delete) +from common.tools.object_factory.EndPoint import json_endpoint, json_endpoint_id +from common.tools.object_factory.Link import json_link, json_link_id +from common.tools.object_factory.Topology import json_topology, json_topology_id +from common.proto.kpi_sample_types_pb2 import KpiSampleType + +# ----- Context -------------------------------------------------------------------------------------------------------- +CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) +CONTEXT = json_context(DEFAULT_CONTEXT_NAME) + +# ----- Topology ------------------------------------------------------------------------------------------------------- +TOPOLOGY_ID = json_topology_id(DEFAULT_TOPOLOGY_NAME, context_id=CONTEXT_ID) +TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_NAME, context_id=CONTEXT_ID) + +# ----- Monitoring Samples --------------------------------------------------------------------------------------------- +PACKET_PORT_SAMPLE_TYPES = [ + KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED, + KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED, + KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED, + KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED, +] + +# ----- Device Credentials and Settings -------------------------------------------------------------------------------- + + +# ----- Devices -------------------------------------------------------------------------------------------------------- + +CUR_PATH = os.path.dirname(os.path.abspath(__file__)) + +DEVICE_SW1_UUID = 'SW1' +DEVICE_SW1_TIMEOUT = 60 +DEVICE_SW1_ID = json_device_id(DEVICE_SW1_UUID) +DEVICE_SW1 = json_device_p4_disabled(DEVICE_SW1_UUID) + +DEVICE_SW1_DPID = 1 +DEVICE_SW1_NAME = DEVICE_SW1_UUID +DEVICE_SW1_IP_ADDR = 'localhost' +DEVICE_SW1_PORT = '50001' +DEVICE_SW1_VENDOR = 'Open Networking Foundation' +DEVICE_SW1_HW_VER = 'BMv2 simple_switch' +DEVICE_SW1_SW_VER = 'Stratum' + +DEVICE_SW1_BIN_PATH = '/root/p4/bmv2.json' +DEVICE_SW1_INFO_PATH = '/root/p4/p4info.txt' + +DEVICE_SW1_CONNECT_RULES = json_device_connect_rules( + DEVICE_SW1_IP_ADDR, + DEVICE_SW1_PORT, + { + 'id': DEVICE_SW1_DPID, + 'name': DEVICE_SW1_NAME, + 'vendor': DEVICE_SW1_VENDOR, + 'hw_ver': DEVICE_SW1_HW_VER, + 'sw_ver': DEVICE_SW1_SW_VER, + 'timeout': DEVICE_SW1_TIMEOUT, + 'p4bin': DEVICE_SW1_BIN_PATH, + 'p4info': DEVICE_SW1_INFO_PATH + } +) + +DEVICE_SW2_UUID = 'SW2' +DEVICE_SW2_TIMEOUT = 60 +DEVICE_SW2_ID = json_device_id(DEVICE_SW2_UUID) +DEVICE_SW2 = json_device_p4_disabled(DEVICE_SW2_UUID) + +DEVICE_SW2_DPID = 1 +DEVICE_SW2_NAME = DEVICE_SW2_UUID +DEVICE_SW2_IP_ADDR = 'localhost' +DEVICE_SW2_PORT = '50002' +DEVICE_SW2_VENDOR = 'Open Networking Foundation' +DEVICE_SW2_HW_VER = 'BMv2 simple_switch' +DEVICE_SW2_SW_VER = 'Stratum' + +DEVICE_SW2_BIN_PATH = '/root/p4/bmv2.json' +DEVICE_SW2_INFO_PATH = '/root/p4/p4info.txt' + +DEVICE_SW2_CONNECT_RULES = json_device_connect_rules( + DEVICE_SW2_IP_ADDR, + DEVICE_SW2_PORT, + { + 'id': DEVICE_SW2_DPID, + 'name': DEVICE_SW2_NAME, + 'vendor': DEVICE_SW2_VENDOR, + 'hw_ver': DEVICE_SW2_HW_VER, + 'sw_ver': DEVICE_SW2_SW_VER, + 'timeout': DEVICE_SW2_TIMEOUT, + 'p4bin': DEVICE_SW2_BIN_PATH, + 'p4info': DEVICE_SW2_INFO_PATH + } +) + +################################## TABLE ENTRIES ################################## + +DEVICE_SW1_CONFIG_TABLE_ENTRIES = [ + json_config_rule_set( + 'table', + { + 'table-name': 'IngressPipeImpl.l2_exact_table', + 'match-fields': [ + { + 'match-field': 'hdr.ethernet.dst_addr', + 'match-value': 'aa:bb:cc:dd:ee:11' + } + ], + 'action-name': 'IngressPipeImpl.set_egress_port', + 'action-params': [ + { + 'action-param': 'port_num', + 'action-value': '1' + } + ] + } + ), + json_config_rule_set( + 'table', + { + 'table-name': 'IngressPipeImpl.l2_exact_table', + 'match-fields': [ + { + 'match-field': 'hdr.ethernet.dst_addr', + 'match-value': 'aa:bb:cc:dd:ee:22' + } + ], + 'action-name': 'IngressPipeImpl.set_egress_port', + 'action-params': [ + { + 'action-param': 'port_num', + 'action-value': '2' + } + ] + } + ) +] + +DEVICE_SW2_CONFIG_TABLE_ENTRIES = DEVICE_SW1_CONFIG_TABLE_ENTRIES + + +""" +DEVICE_SW1_CONFIG_TABLE_ENTRIES = [ + json_config_rule_set( + 'table', + { + 'table-name': 'IngressPipeImpl.l2_ternary_table', + 'match-fields': [ + { + 'match-field': 'hdr.ethernet.dst_addr', + 'match-value': 'aa:bb:cc:dd:ee:11 &&& ff:ff:ff:ff:ff:ff' + } + ], + 'action-name': 'IngressPipeImpl.set_egress_port', + 'action-params': [ + { + 'action-param': 'port_num', + 'action-value': '1' + } + ], + 'priority': 1 + } + ), + json_config_rule_set( + 'table', + { + 'table-name': 'IngressPipeImpl.l2_ternary_table', + 'match-fields': [ + { + 'match-field': 'hdr.ethernet.dst_addr', + 'match-value': 'aa:bb:cc:dd:ee:22 &&& ff:ff:ff:ff:ff:ff' + } + ], + 'action-name': 'IngressPipeImpl.set_egress_port', + 'action-params': [ + { + 'action-param': 'port_num', + 'action-value': '2' + } + ], + 'priority': 1 + } + ), +] +""" + +################################## TABLE DECONF ################################## + +DEVICE_SW1_DECONF_TABLE_ENTRIES = [ + json_config_rule_delete( + 'table', + { + 'table-name': 'IngressPipeImpl.l2_exact_table', + 'match-fields': [ + { + 'match-field': 'hdr.ethernet.dst_addr', + 'match-value': 'aa:bb:cc:dd:ee:11' + } + ], + 'action-name': 'IngressPipeImpl.set_egress_port', + 'action-params': [ + { + 'action-param': 'port_num', + 'action-value': '1' + } + ] + } + ), + json_config_rule_delete( + 'table', + { + 'table-name': 'IngressPipeImpl.l2_exact_table', + 'match-fields': [ + { + 'match-field': 'hdr.ethernet.dst_addr', + 'match-value': 'aa:bb:cc:dd:ee:22' + } + ], + 'action-name': 'IngressPipeImpl.set_egress_port', + 'action-params': [ + { + 'action-param': 'port_num', + 'action-value': '2' + } + ] + } + ) +] + +DEVICE_SW2_DECONF_TABLE_ENTRIES = DEVICE_SW1_DECONF_TABLE_ENTRIES + + +""" +DEVICE_SW1_DECONF_TABLE_ENTRIES = [ + json_config_rule_delete( + 'table', + { + 'table-name': 'IngressPipeImpl.l2_ternary_table', + 'match-fields': [ + { + 'match-field': 'hdr.ethernet.dst_addr', + 'match-value': 'aa:bb:cc:dd:ee:11 &&& ff:ff:ff:ff:ff:ff' + } + ], + 'action-name': 'IngressPipeImpl.set_egress_port', + 'action-params': [ + { + 'action-param': 'port_num', + 'action-value': '1' + } + ], + 'priority': 1 + } + ), + json_config_rule_delete( + 'table', + { + 'table-name': 'IngressPipeImpl.l2_ternary_table', + 'match-fields': [ + { + 'match-field': 'hdr.ethernet.dst_addr', + 'match-value': 'aa:bb:cc:dd:ee:22 &&& ff:ff:ff:ff:ff:ff' + } + ], + 'action-name': 'IngressPipeImpl.set_egress_port', + 'action-params': [ + { + 'action-param': 'port_num', + 'action-value': '2' + } + ], + 'priority': 1 + } + ), +] +""" + +# ----- Links ---------------------------------------------------------------------------------------------------------- + +# ----- WIM Service Settings ------------------------------------------------------------------------------------------- + +# ----- Object Collections --------------------------------------------------------------------------------------------- + +CONTEXTS = [CONTEXT] +TOPOLOGIES = [TOPOLOGY] + +DEVICES = [ + (DEVICE_SW1, DEVICE_SW1_CONNECT_RULES, DEVICE_SW1_CONFIG_TABLE_ENTRIES, DEVICE_SW1_DECONF_TABLE_ENTRIES), + (DEVICE_SW2, DEVICE_SW2_CONNECT_RULES, DEVICE_SW2_CONFIG_TABLE_ENTRIES, DEVICE_SW2_DECONF_TABLE_ENTRIES), +] + +LINKS = [] diff --git a/src/common/orm/backend/redis/__init__.py b/hackfest/p4/tests/__init__.py similarity index 88% rename from src/common/orm/backend/redis/__init__.py rename to hackfest/p4/tests/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/common/orm/backend/redis/__init__.py +++ b/hackfest/p4/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/hackfest/p4/tests/test_functional_bootstrap.py b/hackfest/p4/tests/test_functional_bootstrap.py new file mode 100644 index 0000000000000000000000000000000000000000..8ad3c8a9cc0b77c3276d0debcbcf6dfdcad4fdc8 --- /dev/null +++ b/hackfest/p4/tests/test_functional_bootstrap.py @@ -0,0 +1,95 @@ +# 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.Settings import get_setting +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.Link import json_link_id +from common.tools.object_factory.Topology import json_topology_id +from context.client.ContextClient import ContextClient +from context.client.EventsCollector import EventsCollector +from common.proto.context_pb2 import ConfigActionEnum, Context, ContextId, Device, Empty, Link, Topology, DeviceOperationalStatusEnum +from device.client.DeviceClient import DeviceClient +from .Objects import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +@pytest.fixture(scope='session') +def context_client(): + _client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def device_client(): + _client = DeviceClient(get_setting('DEVICESERVICE_SERVICE_HOST'), get_setting('DEVICESERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + +def test_prepare_scenario(context_client : ContextClient): # pylint: disable=redefined-outer-name + + # ----- Create Contexts and Topologies ----------------------------------------------------------------------------- + for context in CONTEXTS: + context_uuid = context['context_id']['context_uuid']['uuid'] + LOGGER.info('Adding Context {:s}'.format(context_uuid)) + response = context_client.SetContext(Context(**context)) + assert response.context_uuid.uuid == context_uuid + + for topology in TOPOLOGIES: + context_uuid = topology['topology_id']['context_id']['context_uuid']['uuid'] + topology_uuid = topology['topology_id']['topology_uuid']['uuid'] + LOGGER.info('Adding Topology {:s}/{:s}'.format(context_uuid, topology_uuid)) + response = context_client.SetTopology(Topology(**topology)) + assert response.context_id.context_uuid.uuid == context_uuid + assert response.topology_uuid.uuid == topology_uuid + context_id = json_context_id(context_uuid) + +def test_scenario_ready(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure scenario is ready ------------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(CONTEXTS) + + response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) + assert len(response.topologies) == len(TOPOLOGIES) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 + +def test_devices_bootstraping( + context_client : ContextClient, device_client : DeviceClient): # pylint: disable=redefined-outer-name + + # ----- Create Devices --------------------------------------------------------------- + for device, connect_rules, config_rules, _ in DEVICES: + device_uuid = device['device_id']['device_uuid']['uuid'] + LOGGER.info('Adding Device {:s}'.format(device_uuid)) + + device_p4_with_connect_rules = copy.deepcopy(device) + device_p4_with_connect_rules['device_config']['config_rules'].extend(connect_rules) + response = device_client.AddDevice(Device(**device_p4_with_connect_rules)) + assert response.device_uuid.uuid == device_uuid + +def test_devices_bootstrapped(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure bevices are created ----------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(CONTEXTS) + + response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) + assert len(response.topologies) == len(TOPOLOGIES) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(DEVICES) diff --git a/hackfest/p4/tests/test_functional_cleanup.py b/hackfest/p4/tests/test_functional_cleanup.py new file mode 100644 index 0000000000000000000000000000000000000000..5e84f47e203fb1048cf01e61c1ca089c3a5b0dd9 --- /dev/null +++ b/hackfest/p4/tests/test_functional_cleanup.py @@ -0,0 +1,76 @@ +# 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.Settings import get_setting +from common.tests.EventTools import EVENT_REMOVE, 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.Link import json_link_id +from common.tools.object_factory.Topology import json_topology_id +from context.client.ContextClient import ContextClient +from context.client.EventsCollector import EventsCollector +from common.proto.context_pb2 import ConfigActionEnum, ContextId, Device, DeviceId, Empty, LinkId, TopologyId, DeviceOperationalStatusEnum +from device.client.DeviceClient import DeviceClient +from .Objects import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + + +@pytest.fixture(scope='session') +def context_client(): + _client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def device_client(): + _client = DeviceClient(get_setting('DEVICESERVICE_SERVICE_HOST'), get_setting('DEVICESERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + +def test_scenario_cleanup( + context_client : ContextClient, device_client : DeviceClient): # pylint: disable=redefined-outer-name + + # ----- Delete Devices and Validate Collected Events --------------------------------------------------------------- + for device, _, _, deconf_rules in DEVICES: + + device_id = device['device_id'] + device_uuid = device_id['device_uuid']['uuid'] + LOGGER.info('Deleting Device {:s}'.format(device_uuid)) + device_client.DeleteDevice(DeviceId(**device_id)) + #expected_events.append(('DeviceEvent', EVENT_REMOVE, json_device_id(device_uuid))) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 + + # ----- Delete Topologies and Validate Collected Events ------------------------------------------------------------ + for topology in TOPOLOGIES: + topology_id = topology['topology_id'] + context_uuid = topology_id['context_id']['context_uuid']['uuid'] + topology_uuid = topology_id['topology_uuid']['uuid'] + LOGGER.info('Deleting Topology {:s}/{:s}'.format(context_uuid, topology_uuid)) + context_client.RemoveTopology(TopologyId(**topology_id)) + context_id = json_context_id(context_uuid) + #expected_events.append(('TopologyEvent', EVENT_REMOVE, json_topology_id(topology_uuid, context_id=context_id))) + + # ----- Delete Contexts and Validate Collected Events -------------------------------------------------------------- + for context in CONTEXTS: + context_id = context['context_id'] + context_uuid = context_id['context_uuid']['uuid'] + LOGGER.info('Deleting Context {:s}'.format(context_uuid)) + context_client.RemoveContext(ContextId(**context_id)) + #expected_events.append(('ContextEvent', EVENT_REMOVE, json_context_id(context_uuid))) diff --git a/hackfest/p4/tests/test_functional_create_service.py b/hackfest/p4/tests/test_functional_create_service.py new file mode 100644 index 0000000000000000000000000000000000000000..73200b893c197fa3d4d98aeb368679f96c59641f --- /dev/null +++ b/hackfest/p4/tests/test_functional_create_service.py @@ -0,0 +1,62 @@ +# 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.Settings import get_setting +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.Link import json_link_id +from common.tools.object_factory.Topology import json_topology_id +from context.client.ContextClient import ContextClient +from context.client.EventsCollector import EventsCollector +from common.proto.context_pb2 import Context, ContextId, Device, Empty, Link, Topology +from device.client.DeviceClient import DeviceClient +from .Objects import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES +from common.proto.context_pb2 import ConfigActionEnum, Device, DeviceId,\ + DeviceOperationalStatusEnum + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +@pytest.fixture(scope='session') +def context_client(): + _client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def device_client(): + _client = DeviceClient(get_setting('DEVICESERVICE_SERVICE_HOST'), get_setting('DEVICESERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + +def test_rules_entry( + context_client : ContextClient, device_client : DeviceClient): # pylint: disable=redefined-outer-name + + # ----- Create Devices --------------------------------------------------------------- + for device, connect_rules, config_rules, _ in DEVICES: + # Enable device + device_p4_with_operational_status = copy.deepcopy(device) + device_p4_with_operational_status['device_operational_status'] = \ + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED + device_client.ConfigureDevice(Device(**device_p4_with_operational_status)) + + device_data = context_client.GetDevice(DeviceId(**json_device_id('SW1'))) + + # Insert table entries + device_p4_with_config_rules = copy.deepcopy(device) + device_p4_with_config_rules['device_config']['config_rules'].extend(config_rules) + device_client.ConfigureDevice(Device(**device_p4_with_config_rules)) diff --git a/hackfest/p4/tests/test_functional_delete_service.py b/hackfest/p4/tests/test_functional_delete_service.py new file mode 100644 index 0000000000000000000000000000000000000000..4a03ed1589909d78025a87a5929bfd174f704767 --- /dev/null +++ b/hackfest/p4/tests/test_functional_delete_service.py @@ -0,0 +1,58 @@ +# 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.Settings import get_setting +from common.tests.EventTools import EVENT_REMOVE, 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.Link import json_link_id +from common.tools.object_factory.Topology import json_topology_id +from context.client.ContextClient import ContextClient +from context.client.EventsCollector import EventsCollector +from common.proto.context_pb2 import ConfigActionEnum, ContextId, Device, DeviceId, Empty, LinkId, TopologyId, DeviceOperationalStatusEnum +from device.client.DeviceClient import DeviceClient +from .Objects import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + + +@pytest.fixture(scope='session') +def context_client(): + _client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def device_client(): + _client = DeviceClient(get_setting('DEVICESERVICE_SERVICE_HOST'), get_setting('DEVICESERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + +def test_rules_delete( + context_client : ContextClient, device_client : DeviceClient): # pylint: disable=redefined-outer-name + + # ----- Delete Devices and Validate Collected Events --------------------------------------------------------------- + for device, _, _, deconf_rules in DEVICES: + + device_p4_with_deconf_rules = copy.deepcopy(device) + device_p4_with_deconf_rules['device_config']['config_rules'].extend(deconf_rules) + device_client.ConfigureDevice(Device(**device_p4_with_deconf_rules)) + + device_p4_with_operational_status = copy.deepcopy(device) + device_p4_with_operational_status['device_operational_status'] = \ + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED + device_client.ConfigureDevice(Device(**device_p4_with_operational_status)) diff --git a/hackfest/restconf/commands.txt b/hackfest/restconf/commands.txt new file mode 100644 index 0000000000000000000000000000000000000000..2eac80cf60d58675981983c722bb7d2fdcbd84bf --- /dev/null +++ b/hackfest/restconf/commands.txt @@ -0,0 +1,48 @@ +== RESTCONF + +=== YANG2SWAGGER + +$ cd ~/tfs-ctrl/hackfest/restconf +(if needed) +$ wget https://github.com/bartoszm/yang2swagger/releases/download/1.1.11/swagger-generator-cli-1.1.11-executable.jar + +Generate swagger files: +$ java -jar swagger-generator-cli-1.1.11-executable.jar -yang-dir ../yang/ -output topology.yaml topology +$ java -jar swagger-generator-cli-1.1.11-executable.jar -yang-dir ../yang/ -output connection.yaml connection + + + +=== SERVER +$ cd ~/tfs-ctrl/hackfest/restconf +(if needed) +$ wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.11/swagger-codegen-cli-3.0.11.jar -O swagger-codegen-cli.jar + +Create the server: +$ mkdir ~/tfs-ctrl/hackfest/restconf/server +$ java -jar swagger-codegen-cli.jar generate -i connection.yaml -l python-flask -o server + +Run the server: +$ cd ~/tfs-ctrl/hackfest/restconf/server +$ pip3 install -r requirements.txt +(Open ~/tfs-ctrl/hackfest/restconf/server/swagger_server/swagger/swagger.yaml and modify all: "name: connection_id" for "name: connection-id") +RUN AUTOGENERATED SERVER +$ python3 -m swagger_server + +(you have the solution in ~/tfs-ctrl/hackfest/restconf/connectionserver ) + +RUN CURL AS CLIENT (In another window) +$ cd ~/tfs-ctrl/hackfest/restconf/ +$ curl -X POST -H "Content-Type: application/yang-data+json" http://127.0.0.1:8080/data/connection/ -d@conn1.json +$ curl -X GET -H "Content-Type: application/yang-data+json" http://127.0.0.1:8080/data/connection=0/ +$ curl -X DELETE -H "Content-Type: application/yang-data+json" http://127.0.0.1:8080/data/connection=0/ + + +=== Exercise: RESTCONF TOPOLOGY === +$ mkdir ~/tfs-ctrl/hackfest/restconf/topologyserver +$ java -jar swagger-codegen-cli.jar generate -i topology.yaml -l python-flask -o topologyserver +$ cd ~/tfs-ctrl/hackfest/restconf/topologyserver +(Open ~/tfs-ctrl/hackfest/restconf/topologyserver/swagger_server/swagger/swagger.yaml and modify all: "name: link_id" for "name: link-id", same for node and port) +$ python3 -m swagger_server + +RUN CURL AS CLIENT (In another window) +$curl -X GET -H "Content-Type: application/yang-data+json" http://127.0.0.1:8080/data/topology/ diff --git a/hackfest/restconf/conn1.json b/hackfest/restconf/conn1.json new file mode 100644 index 0000000000000000000000000000000000000000..e541b477c2bef70d2f02ab988e2c599e20405c67 --- /dev/null +++ b/hackfest/restconf/conn1.json @@ -0,0 +1,7 @@ +{ + "source-node" : "node1", + "target-node" : "node2", + "source-port" : "node1portA", + "target-port" : "node2portA", + "bandwidth" : 10 +} \ No newline at end of file diff --git a/hackfest/restconf/connection.yaml b/hackfest/restconf/connection.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c704ed742d475b609af9f20ba2adf76a50624f14 --- /dev/null +++ b/hackfest/restconf/connection.yaml @@ -0,0 +1,152 @@ +# 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. + +--- +swagger: "2.0" +info: + description: "connection API generated from yang definitions" + version: "1.0" + title: "connection API" +host: "localhost:1234" +consumes: +- "application/yang-data+json" +produces: +- "application/yang-data+json" +paths: + /data/connection/: + post: + tags: + - "connection" + description: "creates connection.Connection" + parameters: + - in: "body" + name: "connection.Connection.body-param" + description: "connection.Connection to be added to list" + required: false + schema: + $ref: "#/definitions/connection.Connection" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + /data/connection={connection-id}/: + get: + tags: + - "connection" + description: "returns connection.Connection" + parameters: + - name: "connection-id" + in: "path" + description: "Id of connection" + required: true + type: "string" + responses: + 200: + description: "connection.Connection" + schema: + $ref: "#/definitions/connection.Connection" + 400: + description: "Internal error" + post: + tags: + - "connection" + description: "creates connection.Connection" + parameters: + - name: "connection-id" + in: "path" + description: "Id of connection" + required: true + type: "string" + - in: "body" + name: "connection.Connection.body-param" + description: "connection.Connection to be added to list" + required: false + schema: + $ref: "#/definitions/connection.Connection" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "connection" + description: "creates or updates connection.Connection" + parameters: + - name: "connection-id" + in: "path" + description: "Id of connection" + required: true + type: "string" + - in: "body" + name: "connection.Connection.body-param" + description: "connection.Connection to be added or updated" + required: false + schema: + $ref: "#/definitions/connection.Connection" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "connection" + description: "removes connection.Connection" + parameters: + - name: "connection-id" + in: "path" + description: "Id of connection" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" +definitions: + connection.Connection: + type: "object" + properties: + target-port: + type: "string" + x-path: "/topology:topology/topology:node/topology:port/topology:port-id" + source-port: + type: "string" + x-path: "/topology:topology/topology:node/topology:port/topology:port-id" + target-node: + type: "string" + x-path: "/topology:topology/topology:node/topology:node-id" + connection-id: + type: "string" + bandwidth: + type: "integer" + format: "int64" + source-node: + type: "string" + x-path: "/topology:topology/topology:node/topology:node-id" + layer-protocol-name: + $ref: "#/definitions/topology.LayerProtocolName" + topology.LayerProtocolName: + type: "string" + enum: + - "ETH" + - "OPTICAL" diff --git a/hackfest/restconf/connectionserver/.dockerignore b/hackfest/restconf/connectionserver/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..cdd823e64e7e91ae85da84f22410ecb7eb370ae2 --- /dev/null +++ b/hackfest/restconf/connectionserver/.dockerignore @@ -0,0 +1,72 @@ +.travis.yaml +.swagger-codegen-ignore +README.md +tox.ini +git_push.sh +test-requirements.txt +setup.py + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.python-version + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/hackfest/restconf/connectionserver/.gitignore b/hackfest/restconf/connectionserver/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..a655050c2631466828b5b8bfc59ae27f9ac02dc5 --- /dev/null +++ b/hackfest/restconf/connectionserver/.gitignore @@ -0,0 +1,64 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.python-version + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/hackfest/restconf/connectionserver/.swagger-codegen-ignore b/hackfest/restconf/connectionserver/.swagger-codegen-ignore new file mode 100644 index 0000000000000000000000000000000000000000..c5fa491b4c557bf997d5dd21797de782545dc9e5 --- /dev/null +++ b/hackfest/restconf/connectionserver/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/hackfest/restconf/connectionserver/.swagger-codegen/VERSION b/hackfest/restconf/connectionserver/.swagger-codegen/VERSION new file mode 100644 index 0000000000000000000000000000000000000000..e4a0720dd5141073dced1d64dddb6afd14bf26d3 --- /dev/null +++ b/hackfest/restconf/connectionserver/.swagger-codegen/VERSION @@ -0,0 +1 @@ +3.0.11 \ No newline at end of file diff --git a/hackfest/restconf/connectionserver/.travis.yml b/hackfest/restconf/connectionserver/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..dd6c4450aa902ae68479c3d76d45145e18d6052e --- /dev/null +++ b/hackfest/restconf/connectionserver/.travis.yml @@ -0,0 +1,13 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "3.2" + - "3.3" + - "3.4" + - "3.5" + #- "3.5-dev" # 3.5 development branch + #- "nightly" # points to the latest development branch e.g. 3.6-dev +# command to install dependencies +install: "pip install -r requirements.txt" +# command to run tests +script: nosetests diff --git a/hackfest/restconf/connectionserver/Dockerfile b/hackfest/restconf/connectionserver/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..f9243a5ad0d025c5481e5a81bac213f716242100 --- /dev/null +++ b/hackfest/restconf/connectionserver/Dockerfile @@ -0,0 +1,16 @@ +FROM python:3.6-alpine + +RUN mkdir -p /usr/src/app +WORKDIR /usr/src/app + +COPY requirements.txt /usr/src/app/ + +RUN pip3 install --no-cache-dir -r requirements.txt + +COPY . /usr/src/app + +EXPOSE 8080 + +ENTRYPOINT ["python3"] + +CMD ["-m", "swagger_server"] \ No newline at end of file diff --git a/hackfest/restconf/connectionserver/README.md b/hackfest/restconf/connectionserver/README.md new file mode 100644 index 0000000000000000000000000000000000000000..857c30a462c3dbad326a7d0a6b7b278f36fb9bd9 --- /dev/null +++ b/hackfest/restconf/connectionserver/README.md @@ -0,0 +1,49 @@ +# Swagger generated server + +## Overview +This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the +[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This +is an example of building a swagger-enabled Flask server. + +This example uses the [Connexion](https://github.com/zalando/connexion) library on top of Flask. + +## Requirements +Python 3.5.2+ + +## Usage +To run the server, please execute the following from the root directory: + +``` +pip3 install -r requirements.txt +python3 -m swagger_server +``` + +and open your browser to here: + +``` +http://localhost:8080/ui/ +``` + +Your Swagger definition lives here: + +``` +http://localhost:8080/swagger.json +``` + +To launch the integration tests, use tox: +``` +sudo pip install tox +tox +``` + +## Running with Docker + +To run the server on a Docker container, please execute the following from the root directory: + +```bash +# building the image +docker build -t swagger_server . + +# starting up a container +docker run -p 8080:8080 swagger_server +``` \ No newline at end of file diff --git a/hackfest/restconf/connectionserver/git_push.sh b/hackfest/restconf/connectionserver/git_push.sh new file mode 100755 index 0000000000000000000000000000000000000000..160f6f213999c7ae67839fbd6fc2ba0b72675832 --- /dev/null +++ b/hackfest/restconf/connectionserver/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/hackfest/restconf/connectionserver/requirements.txt b/hackfest/restconf/connectionserver/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..b5bc506572753f5a29d2c1115a6ac15f34f09be8 --- /dev/null +++ b/hackfest/restconf/connectionserver/requirements.txt @@ -0,0 +1,3 @@ +connexion == 2.2.0 +python_dateutil == 2.6.0 +setuptools >= 21.0.0 diff --git a/hackfest/restconf/connectionserver/setup.py b/hackfest/restconf/connectionserver/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..ba555c8a10b6e535508e81429887aa00e30d3c1a --- /dev/null +++ b/hackfest/restconf/connectionserver/setup.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +import sys +from setuptools import setup, find_packages + +NAME = "swagger_server" +VERSION = "1.0.0" +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = ["connexion"] + +setup( + name=NAME, + version=VERSION, + description="connection API", + author_email="", + url="", + keywords=["Swagger", "connection API"], + install_requires=REQUIRES, + packages=find_packages(), + package_data={'': ['swagger/swagger.yaml']}, + include_package_data=True, + entry_points={ + 'console_scripts': ['swagger_server=swagger_server.__main__:main']}, + long_description="""\ + connection API generated from yang definitions + """ +) diff --git a/hackfest/restconf/connectionserver/swagger_server/__init__.py b/hackfest/restconf/connectionserver/swagger_server/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/hackfest/restconf/connectionserver/swagger_server/__main__.py b/hackfest/restconf/connectionserver/swagger_server/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..db49e4dcca3214b032f8dbd2a64f064dd685b389 --- /dev/null +++ b/hackfest/restconf/connectionserver/swagger_server/__main__.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 + +import connexion + +from swagger_server import encoder + + +def main(): + app = connexion.App(__name__, specification_dir='./swagger/') + app.app.json_encoder = encoder.JSONEncoder + app.app.config['JSON_SORT_KEYS']=False + app.add_api('swagger.yaml', arguments={'title': 'connection API'}, pythonic_params=True) + app.run(port=8080) + + +if __name__ == '__main__': + main() diff --git a/hackfest/restconf/connectionserver/swagger_server/controllers/__init__.py b/hackfest/restconf/connectionserver/swagger_server/controllers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/hackfest/restconf/connectionserver/swagger_server/controllers/authorization_controller.py b/hackfest/restconf/connectionserver/swagger_server/controllers/authorization_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..2f7b0bb3e281b3fb9efb588dfc8ba4c8cc3a59ed --- /dev/null +++ b/hackfest/restconf/connectionserver/swagger_server/controllers/authorization_controller.py @@ -0,0 +1,6 @@ +from typing import List +""" +controller generated to handled auth operation described at: +https://connexion.readthedocs.io/en/latest/security.html +""" + diff --git a/hackfest/restconf/connectionserver/swagger_server/controllers/connection_controller.py b/hackfest/restconf/connectionserver/swagger_server/controllers/connection_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..8caa1e2ebe210c03791c13511cd555f333c5cf61 --- /dev/null +++ b/hackfest/restconf/connectionserver/swagger_server/controllers/connection_controller.py @@ -0,0 +1,89 @@ +import connexion +import six +import swagger_server.database as database + +from swagger_server.models.connection_connection import ConnectionConnection # noqa: E501 +from swagger_server import util + + +def data_connection_post(body=None): # noqa: E501 + """data_connection_post + + creates connection.Connection # noqa: E501 + + :param body: connection.Connection to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = ConnectionConnection.from_dict(connexion.request.get_json()) + body.connection_id=str(database.last_connection_id) + database.connection[str(database.last_connection_id)] = body + database.last_connection_id+=1 + return body + + +def data_connectionconnection_id_delete(connection_id): # noqa: E501 + """data_connectionconnection_id_delete + + removes connection.Connection # noqa: E501 + + :param connection_id: Id of connection + :type connection_id: str + + :rtype: None + """ + del database.connection[connection_id] + return 'ok' + + + +def data_connectionconnection_id_get(connection_id): # noqa: E501 + """data_connectionconnection_id_get + + returns connection.Connection # noqa: E501 + + :param connection_id: Id of connection + :type connection_id: str + + :rtype: ConnectionConnection + """ + print(database.connection) + if connection_id in database.connection: + return database.connection[connection_id] + return "Error", 400 + + +def data_connectionconnection_id_post(connection_id, body=None): # noqa: E501 + """data_connectionconnection_id_post + + creates connection.Connection # noqa: E501 + + :param connection_id: Id of connection + :type connection_id: str + :param body: connection.Connection to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = ConnectionConnection.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_connectionconnection_id_put(connection_id, body=None): # noqa: E501 + """data_connectionconnection_id_put + + creates or updates connection.Connection # noqa: E501 + + :param connection_id: Id of connection + :type connection_id: str + :param body: connection.Connection to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = ConnectionConnection.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' diff --git a/src/common/orm/Exceptions.py b/hackfest/restconf/connectionserver/swagger_server/database.py similarity index 65% rename from src/common/orm/Exceptions.py rename to hackfest/restconf/connectionserver/swagger_server/database.py index cf91bd2f7a628a86fa45f7eb687b3292e00d0f8e..8794f873f7b810ce45e4e04698eed3f3f92d6a8c 100644 --- a/src/common/orm/Exceptions.py +++ b/hackfest/restconf/connectionserver/swagger_server/database.py @@ -1,10 +1,11 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +#!/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 +# 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, @@ -12,8 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -class ConstraintException(Exception): - pass -class MutexException(Exception): - pass +from swagger_server.models.connection_connection import ConnectionConnection + +connection = {} +last_connection_id = 0 + diff --git a/hackfest/restconf/connectionserver/swagger_server/encoder.py b/hackfest/restconf/connectionserver/swagger_server/encoder.py new file mode 100644 index 0000000000000000000000000000000000000000..61ba4721961a65d38af5d5ce2948b0abe9c7aa58 --- /dev/null +++ b/hackfest/restconf/connectionserver/swagger_server/encoder.py @@ -0,0 +1,20 @@ +from connexion.apps.flask_app import FlaskJSONEncoder +import six + +from swagger_server.models.base_model_ import Model + + +class JSONEncoder(FlaskJSONEncoder): + include_nulls = False + + def default(self, o): + if isinstance(o, Model): + dikt = {} + for attr, _ in six.iteritems(o.swagger_types): + value = getattr(o, attr) + if value is None and not self.include_nulls: + continue + attr = o.attribute_map[attr] + dikt[attr] = value + return dikt + return FlaskJSONEncoder.default(self, o) diff --git a/hackfest/restconf/connectionserver/swagger_server/models/__init__.py b/hackfest/restconf/connectionserver/swagger_server/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4df84643893fc3e509f355a8d47e4e1c653f8109 --- /dev/null +++ b/hackfest/restconf/connectionserver/swagger_server/models/__init__.py @@ -0,0 +1,7 @@ +# coding: utf-8 + +# flake8: noqa +from __future__ import absolute_import +# import models into model package +from swagger_server.models.connection_connection import ConnectionConnection +from swagger_server.models.topology_layer_protocol_name import TopologyLayerProtocolName diff --git a/hackfest/restconf/connectionserver/swagger_server/models/base_model_.py b/hackfest/restconf/connectionserver/swagger_server/models/base_model_.py new file mode 100644 index 0000000000000000000000000000000000000000..97999c3d3237c287013b2139acb9858a52b454e8 --- /dev/null +++ b/hackfest/restconf/connectionserver/swagger_server/models/base_model_.py @@ -0,0 +1,69 @@ +import pprint + +import six +import typing + +from swagger_server import util + +T = typing.TypeVar('T') + + +class Model(object): + # swaggerTypes: The key is attribute name and the + # value is attribute type. + swagger_types = {} + + # attributeMap: The key is attribute name and the + # value is json key in definition. + attribute_map = {} + + @classmethod + def from_dict(cls: typing.Type[T], dikt) -> T: + """Returns the dict as a model""" + return util.deserialize_model(dikt, cls) + + def to_dict(self): + """Returns the model properties as a dict + + :rtype: dict + """ + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model + + :rtype: str + """ + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/hackfest/restconf/connectionserver/swagger_server/models/connection_connection.py b/hackfest/restconf/connectionserver/swagger_server/models/connection_connection.py new file mode 100644 index 0000000000000000000000000000000000000000..6d6ab83afa2600cd4f42b12dee80a572f9bf8024 --- /dev/null +++ b/hackfest/restconf/connectionserver/swagger_server/models/connection_connection.py @@ -0,0 +1,219 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from swagger_server.models.base_model_ import Model +from swagger_server.models.topology_layer_protocol_name import TopologyLayerProtocolName # noqa: F401,E501 +from swagger_server import util + + +class ConnectionConnection(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, target_port: str=None, source_port: str=None, target_node: str=None, connection_id: str=None, bandwidth: int=None, source_node: str=None, layer_protocol_name: TopologyLayerProtocolName=None): # noqa: E501 + """ConnectionConnection - a model defined in Swagger + + :param target_port: The target_port of this ConnectionConnection. # noqa: E501 + :type target_port: str + :param source_port: The source_port of this ConnectionConnection. # noqa: E501 + :type source_port: str + :param target_node: The target_node of this ConnectionConnection. # noqa: E501 + :type target_node: str + :param connection_id: The connection_id of this ConnectionConnection. # noqa: E501 + :type connection_id: str + :param bandwidth: The bandwidth of this ConnectionConnection. # noqa: E501 + :type bandwidth: int + :param source_node: The source_node of this ConnectionConnection. # noqa: E501 + :type source_node: str + :param layer_protocol_name: The layer_protocol_name of this ConnectionConnection. # noqa: E501 + :type layer_protocol_name: TopologyLayerProtocolName + """ + self.swagger_types = { + 'target_port': str, + 'source_port': str, + 'target_node': str, + 'connection_id': str, + 'bandwidth': int, + 'source_node': str, + 'layer_protocol_name': TopologyLayerProtocolName + } + + self.attribute_map = { + 'target_port': 'target-port', + 'source_port': 'source-port', + 'target_node': 'target-node', + 'connection_id': 'connection-id', + 'bandwidth': 'bandwidth', + 'source_node': 'source-node', + 'layer_protocol_name': 'layer-protocol-name' + } + self._target_port = target_port + self._source_port = source_port + self._target_node = target_node + self._connection_id = connection_id + self._bandwidth = bandwidth + self._source_node = source_node + self._layer_protocol_name = layer_protocol_name + + @classmethod + def from_dict(cls, dikt) -> 'ConnectionConnection': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The connection.Connection of this ConnectionConnection. # noqa: E501 + :rtype: ConnectionConnection + """ + return util.deserialize_model(dikt, cls) + + @property + def target_port(self) -> str: + """Gets the target_port of this ConnectionConnection. + + + :return: The target_port of this ConnectionConnection. + :rtype: str + """ + return self._target_port + + @target_port.setter + def target_port(self, target_port: str): + """Sets the target_port of this ConnectionConnection. + + + :param target_port: The target_port of this ConnectionConnection. + :type target_port: str + """ + + self._target_port = target_port + + @property + def source_port(self) -> str: + """Gets the source_port of this ConnectionConnection. + + + :return: The source_port of this ConnectionConnection. + :rtype: str + """ + return self._source_port + + @source_port.setter + def source_port(self, source_port: str): + """Sets the source_port of this ConnectionConnection. + + + :param source_port: The source_port of this ConnectionConnection. + :type source_port: str + """ + + self._source_port = source_port + + @property + def target_node(self) -> str: + """Gets the target_node of this ConnectionConnection. + + + :return: The target_node of this ConnectionConnection. + :rtype: str + """ + return self._target_node + + @target_node.setter + def target_node(self, target_node: str): + """Sets the target_node of this ConnectionConnection. + + + :param target_node: The target_node of this ConnectionConnection. + :type target_node: str + """ + + self._target_node = target_node + + @property + def connection_id(self) -> str: + """Gets the connection_id of this ConnectionConnection. + + + :return: The connection_id of this ConnectionConnection. + :rtype: str + """ + return self._connection_id + + @connection_id.setter + def connection_id(self, connection_id: str): + """Sets the connection_id of this ConnectionConnection. + + + :param connection_id: The connection_id of this ConnectionConnection. + :type connection_id: str + """ + + self._connection_id = connection_id + + @property + def bandwidth(self) -> int: + """Gets the bandwidth of this ConnectionConnection. + + + :return: The bandwidth of this ConnectionConnection. + :rtype: int + """ + return self._bandwidth + + @bandwidth.setter + def bandwidth(self, bandwidth: int): + """Sets the bandwidth of this ConnectionConnection. + + + :param bandwidth: The bandwidth of this ConnectionConnection. + :type bandwidth: int + """ + + self._bandwidth = bandwidth + + @property + def source_node(self) -> str: + """Gets the source_node of this ConnectionConnection. + + + :return: The source_node of this ConnectionConnection. + :rtype: str + """ + return self._source_node + + @source_node.setter + def source_node(self, source_node: str): + """Sets the source_node of this ConnectionConnection. + + + :param source_node: The source_node of this ConnectionConnection. + :type source_node: str + """ + + self._source_node = source_node + + @property + def layer_protocol_name(self) -> TopologyLayerProtocolName: + """Gets the layer_protocol_name of this ConnectionConnection. + + + :return: The layer_protocol_name of this ConnectionConnection. + :rtype: TopologyLayerProtocolName + """ + return self._layer_protocol_name + + @layer_protocol_name.setter + def layer_protocol_name(self, layer_protocol_name: TopologyLayerProtocolName): + """Sets the layer_protocol_name of this ConnectionConnection. + + + :param layer_protocol_name: The layer_protocol_name of this ConnectionConnection. + :type layer_protocol_name: TopologyLayerProtocolName + """ + + self._layer_protocol_name = layer_protocol_name diff --git a/hackfest/restconf/connectionserver/swagger_server/models/topology_layer_protocol_name.py b/hackfest/restconf/connectionserver/swagger_server/models/topology_layer_protocol_name.py new file mode 100644 index 0000000000000000000000000000000000000000..2ea9beed2bf84b9288fb5829ebcabd2440d5a81b --- /dev/null +++ b/hackfest/restconf/connectionserver/swagger_server/models/topology_layer_protocol_name.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from swagger_server.models.base_model_ import Model +from swagger_server import util + + +class TopologyLayerProtocolName(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + ETH = "ETH" + OPTICAL = "OPTICAL" + def __init__(self): # noqa: E501 + """TopologyLayerProtocolName - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TopologyLayerProtocolName': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The topology.LayerProtocolName of this TopologyLayerProtocolName. # noqa: E501 + :rtype: TopologyLayerProtocolName + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/restconf/connectionserver/swagger_server/swagger/swagger.yaml b/hackfest/restconf/connectionserver/swagger_server/swagger/swagger.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0dc82659c4bc88794451dd262a45c9b4ef209c2d --- /dev/null +++ b/hackfest/restconf/connectionserver/swagger_server/swagger/swagger.yaml @@ -0,0 +1,188 @@ +# 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. + +openapi: 3.0.1 +info: + title: connection API + description: connection API generated from yang definitions + version: "1.0" +servers: +- url: //localhost:1234/ +paths: + /data/connection/: + post: + tags: + - connection + description: creates connection.Connection + operationId: data_connection_post + requestBody: + description: connection.Connection to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/connection.Connection' + required: false + responses: + 201: + description: Object created + content: {} + 400: + description: Internal error + content: {} + 409: + description: Object already exists + content: {} + x-openapi-router-controller: swagger_server.controllers.connection_controller + /data/connection={connection-id}/: + get: + tags: + - connection + description: returns connection.Connection + operationId: data_connectionconnection_id_get + parameters: + - name: connection-id + in: path + description: Id of connection + required: true + schema: + type: string + responses: + 200: + description: connection.Connection + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/connection.Connection' + 400: + description: Internal error + content: {} + x-openapi-router-controller: swagger_server.controllers.connection_controller + put: + tags: + - connection + description: creates or updates connection.Connection + operationId: data_connectionconnection_id_put + parameters: + - name: connection-id + in: path + description: Id of connection + required: true + schema: + type: string + requestBody: + description: connection.Connection to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/connection.Connection' + required: false + responses: + 201: + description: Object created + content: {} + 204: + description: Object modified + content: {} + 400: + description: Internal error + content: {} + x-openapi-router-controller: swagger_server.controllers.connection_controller + post: + tags: + - connection + description: creates connection.Connection + operationId: data_connectionconnection_id_post + parameters: + - name: connection-id + in: path + description: Id of connection + required: true + schema: + type: string + requestBody: + description: connection.Connection to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/connection.Connection' + required: false + responses: + 201: + description: Object created + content: {} + 400: + description: Internal error + content: {} + 409: + description: Object already exists + content: {} + x-openapi-router-controller: swagger_server.controllers.connection_controller + delete: + tags: + - connection + description: removes connection.Connection + operationId: data_connectionconnection_id_delete + parameters: + - name: connection-id + in: path + description: Id of connection + required: true + schema: + type: string + responses: + 204: + description: Object deleted + content: {} + 400: + description: Internal error + content: {} + x-openapi-router-controller: swagger_server.controllers.connection_controller +components: + schemas: + connection.Connection: + type: object + properties: + target-port: + type: string + x-path: /topology:topology/topology:node/topology:port/topology:port-id + source-port: + type: string + x-path: /topology:topology/topology:node/topology:port/topology:port-id + target-node: + type: string + x-path: /topology:topology/topology:node/topology:node-id + connection-id: + type: string + bandwidth: + type: integer + format: int64 + source-node: + type: string + x-path: /topology:topology/topology:node/topology:node-id + layer-protocol-name: + $ref: '#/components/schemas/topology.LayerProtocolName' + example: + target-port: target-port + source-port: source-port + target-node: target-node + connection-id: connection-id + bandwidth: 0 + source-node: source-node + layer-protocol-name: ETH + topology.LayerProtocolName: + type: string + enum: + - ETH + - OPTICAL + diff --git a/hackfest/restconf/connectionserver/swagger_server/test/__init__.py b/hackfest/restconf/connectionserver/swagger_server/test/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..644506301ce077f2e881fcda3454b6cba362ab5e --- /dev/null +++ b/hackfest/restconf/connectionserver/swagger_server/test/__init__.py @@ -0,0 +1,16 @@ +import logging + +import connexion +from flask_testing import TestCase + +from swagger_server.encoder import JSONEncoder + + +class BaseTestCase(TestCase): + + def create_app(self): + logging.getLogger('connexion.operation').setLevel('ERROR') + app = connexion.App(__name__, specification_dir='../swagger/') + app.app.json_encoder = JSONEncoder + app.add_api('swagger.yaml') + return app.app diff --git a/hackfest/restconf/connectionserver/swagger_server/test/test_connection_controller.py b/hackfest/restconf/connectionserver/swagger_server/test/test_connection_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..325dad4852c3583f0067499c177b56b1d7c569b7 --- /dev/null +++ b/hackfest/restconf/connectionserver/swagger_server/test/test_connection_controller.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +from __future__ import absolute_import + +from flask import json +from six import BytesIO + +from swagger_server.models.connection_connection import ConnectionConnection # noqa: E501 +from swagger_server.test import BaseTestCase + + +class TestConnectionController(BaseTestCase): + """ConnectionController integration test stubs""" + + def test_data_connection_post(self): + """Test case for data_connection_post + + + """ + body = ConnectionConnection() + response = self.client.open( + '/data/connection/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_connectionconnection_id_delete(self): + """Test case for data_connectionconnection_id_delete + + + """ + response = self.client.open( + '/data/connection={connection-id}/'.format(connection_id='connection_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_connectionconnection_id_get(self): + """Test case for data_connectionconnection_id_get + + + """ + response = self.client.open( + '/data/connection={connection-id}/'.format(connection_id='connection_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_connectionconnection_id_post(self): + """Test case for data_connectionconnection_id_post + + + """ + body = ConnectionConnection() + response = self.client.open( + '/data/connection={connection-id}/'.format(connection_id='connection_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_connectionconnection_id_put(self): + """Test case for data_connectionconnection_id_put + + + """ + body = ConnectionConnection() + response = self.client.open( + '/data/connection={connection-id}/'.format(connection_id='connection_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + +if __name__ == '__main__': + import unittest + unittest.main() diff --git a/hackfest/restconf/connectionserver/swagger_server/util.py b/hackfest/restconf/connectionserver/swagger_server/util.py new file mode 100644 index 0000000000000000000000000000000000000000..527d1424c3d5563073b18b4da1a9904b2cb6b62b --- /dev/null +++ b/hackfest/restconf/connectionserver/swagger_server/util.py @@ -0,0 +1,141 @@ +import datetime + +import six +import typing + + +def _deserialize(data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if klass in six.integer_types or klass in (float, str, bool): + return _deserialize_primitive(data, klass) + elif klass == object: + return _deserialize_object(data) + elif klass == datetime.date: + return deserialize_date(data) + elif klass == datetime.datetime: + return deserialize_datetime(data) + elif type(klass) == typing.GenericMeta: + if klass.__extra__ == list: + return _deserialize_list(data, klass.__args__[0]) + if klass.__extra__ == dict: + return _deserialize_dict(data, klass.__args__[1]) + else: + return deserialize_model(data, klass) + + +def _deserialize_primitive(data, klass): + """Deserializes to primitive type. + + :param data: data to deserialize. + :param klass: class literal. + + :return: int, long, float, str, bool. + :rtype: int | long | float | str | bool + """ + try: + value = klass(data) + except UnicodeEncodeError: + value = six.u(data) + except TypeError: + value = data + return value + + +def _deserialize_object(value): + """Return a original value. + + :return: object. + """ + return value + + +def deserialize_date(string): + """Deserializes string to date. + + :param string: str. + :type string: str + :return: date. + :rtype: date + """ + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + + +def deserialize_datetime(string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :type string: str + :return: datetime. + :rtype: datetime + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + + +def deserialize_model(data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :type data: dict | list + :param klass: class literal. + :return: model object. + """ + instance = klass() + + if not instance.swagger_types: + return data + + for attr, attr_type in six.iteritems(instance.swagger_types): + if data is not None \ + and instance.attribute_map[attr] in data \ + and isinstance(data, (list, dict)): + value = data[instance.attribute_map[attr]] + setattr(instance, attr, _deserialize(value, attr_type)) + + return instance + + +def _deserialize_list(data, boxed_type): + """Deserializes a list and its elements. + + :param data: list to deserialize. + :type data: list + :param boxed_type: class literal. + + :return: deserialized list. + :rtype: list + """ + return [_deserialize(sub_data, boxed_type) + for sub_data in data] + + +def _deserialize_dict(data, boxed_type): + """Deserializes a dict and its elements. + + :param data: dict to deserialize. + :type data: dict + :param boxed_type: class literal. + + :return: deserialized dict. + :rtype: dict + """ + return {k: _deserialize(v, boxed_type) + for k, v in six.iteritems(data)} diff --git a/hackfest/restconf/connectionserver/test-requirements.txt b/hackfest/restconf/connectionserver/test-requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..7f8d96e6b40e853d658f88fa745ddcf37ff7644c --- /dev/null +++ b/hackfest/restconf/connectionserver/test-requirements.txt @@ -0,0 +1,6 @@ +flask_testing==0.6.1 +coverage>=4.0.3 +nose>=1.3.7 +pluggy>=0.3.1 +py>=1.4.31 +randomize>=0.13 diff --git a/hackfest/restconf/connectionserver/tox.ini b/hackfest/restconf/connectionserver/tox.ini new file mode 100644 index 0000000000000000000000000000000000000000..3e0b644eec48f0d6d63f028c28315ca0eda5896f --- /dev/null +++ b/hackfest/restconf/connectionserver/tox.ini @@ -0,0 +1,10 @@ +[tox] +envlist = py35 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + nosetests \ + [] \ No newline at end of file diff --git a/hackfest/restconf/swagger-codegen-cli.jar b/hackfest/restconf/swagger-codegen-cli.jar new file mode 100644 index 0000000000000000000000000000000000000000..25f1f6f6f77e43fc78812bd60428b859a48433f9 Binary files /dev/null and b/hackfest/restconf/swagger-codegen-cli.jar differ diff --git a/hackfest/restconf/swagger-generator-cli-1.1.11-executable.jar b/hackfest/restconf/swagger-generator-cli-1.1.11-executable.jar new file mode 100644 index 0000000000000000000000000000000000000000..d5aebe2734e7488f597418e724ed1abb611ad2d8 Binary files /dev/null and b/hackfest/restconf/swagger-generator-cli-1.1.11-executable.jar differ diff --git a/hackfest/restconf/topology.yaml b/hackfest/restconf/topology.yaml new file mode 100644 index 0000000000000000000000000000000000000000..71f1067445fa5037569f2a5bfce49365b29a6303 --- /dev/null +++ b/hackfest/restconf/topology.yaml @@ -0,0 +1,454 @@ +# 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. + +--- +swagger: "2.0" +info: + description: "topology API generated from yang definitions" + version: "1.0" + title: "topology API" +host: "localhost:1234" +consumes: +- "application/yang-data+json" +produces: +- "application/yang-data+json" +paths: + /data/topology/: + get: + tags: + - "topology" + description: "returns topology.Topology" + parameters: [] + responses: + 200: + description: "topology.Topology" + schema: + $ref: "#/definitions/topology.Topology" + 400: + description: "Internal error" + post: + tags: + - "topology" + description: "creates topology.Topology" + parameters: + - in: "body" + name: "topology.Topology.body-param" + description: "topology.Topology to be added to list" + required: false + schema: + $ref: "#/definitions/topology.Topology" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "topology" + description: "creates or updates topology.Topology" + parameters: + - in: "body" + name: "topology.Topology.body-param" + description: "topology.Topology to be added or updated" + required: false + schema: + $ref: "#/definitions/topology.Topology" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "topology" + description: "removes topology.Topology" + parameters: [] + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/topology/link/: + post: + tags: + - "topology" + description: "creates topology.Link" + parameters: + - in: "body" + name: "topology.Link.body-param" + description: "topology.Link to be added to list" + required: false + schema: + $ref: "#/definitions/topology.Link" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + /data/topology/link={link-id}/: + get: + tags: + - "topology" + description: "returns topology.Link" + parameters: + - name: "link-id" + in: "path" + description: "Id of link" + required: true + type: "string" + responses: + 200: + description: "topology.Link" + schema: + $ref: "#/definitions/topology.Link" + 400: + description: "Internal error" + post: + tags: + - "topology" + description: "creates topology.Link" + parameters: + - name: "link-id" + in: "path" + description: "Id of link" + required: true + type: "string" + - in: "body" + name: "topology.Link.body-param" + description: "topology.Link to be added to list" + required: false + schema: + $ref: "#/definitions/topology.Link" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "topology" + description: "creates or updates topology.Link" + parameters: + - name: "link-id" + in: "path" + description: "Id of link" + required: true + type: "string" + - in: "body" + name: "topology.Link.body-param" + description: "topology.Link to be added or updated" + required: false + schema: + $ref: "#/definitions/topology.Link" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "topology" + description: "removes topology.Link" + parameters: + - name: "link-id" + in: "path" + description: "Id of link" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/topology/node/: + post: + tags: + - "topology" + description: "creates topology.Node" + parameters: + - in: "body" + name: "topology.Node.body-param" + description: "topology.Node to be added to list" + required: false + schema: + $ref: "#/definitions/topology.Node" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + /data/topology/node={node-id}/: + get: + tags: + - "topology" + description: "returns topology.Node" + parameters: + - name: "node-id" + in: "path" + description: "Id of node" + required: true + type: "string" + responses: + 200: + description: "topology.Node" + schema: + $ref: "#/definitions/topology.Node" + 400: + description: "Internal error" + post: + tags: + - "topology" + description: "creates topology.Node" + parameters: + - name: "node-id" + in: "path" + description: "Id of node" + required: true + type: "string" + - in: "body" + name: "topology.Node.body-param" + description: "topology.Node to be added to list" + required: false + schema: + $ref: "#/definitions/topology.Node" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "topology" + description: "creates or updates topology.Node" + parameters: + - name: "node-id" + in: "path" + description: "Id of node" + required: true + type: "string" + - in: "body" + name: "topology.Node.body-param" + description: "topology.Node to be added or updated" + required: false + schema: + $ref: "#/definitions/topology.Node" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "topology" + description: "removes topology.Node" + parameters: + - name: "node-id" + in: "path" + description: "Id of node" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/topology/node={node-id}/port/: + post: + tags: + - "topology" + description: "creates topology.Port" + parameters: + - name: "node-id" + in: "path" + description: "Id of node" + required: true + type: "string" + - in: "body" + name: "topology.Port.body-param" + description: "topology.Port to be added to list" + required: false + schema: + $ref: "#/definitions/topology.Port" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + /data/topology/node={node-id}/port={port-id}/: + get: + tags: + - "topology" + description: "returns topology.Port" + parameters: + - name: "node-id" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "port-id" + in: "path" + description: "Id of port" + required: true + type: "string" + responses: + 200: + description: "topology.Port" + schema: + $ref: "#/definitions/topology.Port" + 400: + description: "Internal error" + post: + tags: + - "topology" + description: "creates topology.Port" + parameters: + - name: "node-id" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "port-id" + in: "path" + description: "Id of port" + required: true + type: "string" + - in: "body" + name: "topology.Port.body-param" + description: "topology.Port to be added to list" + required: false + schema: + $ref: "#/definitions/topology.Port" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "topology" + description: "creates or updates topology.Port" + parameters: + - name: "node-id" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "port-id" + in: "path" + description: "Id of port" + required: true + type: "string" + - in: "body" + name: "topology.Port.body-param" + description: "topology.Port to be added or updated" + required: false + schema: + $ref: "#/definitions/topology.Port" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "topology" + description: "removes topology.Port" + parameters: + - name: "node-id" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "port-id" + in: "path" + description: "Id of port" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" +definitions: + topology.LayerProtocolName: + type: "string" + enum: + - "ETH" + - "OPTICAL" + topology.Link: + type: "object" + properties: + target-port: + type: "string" + x-path: "/topology/node/port/port-id" + source-port: + type: "string" + x-path: "/topology/node/port/port-id" + target-node: + type: "string" + x-path: "/topology/node/node-id" + link-id: + type: "string" + source-node: + type: "string" + x-path: "/topology/node/node-id" + topology.Node: + type: "object" + properties: + node-id: + type: "string" + port: + type: "array" + items: + $ref: "#/definitions/topology.Port" + topology.Port: + type: "object" + properties: + layer-protocol-name: + $ref: "#/definitions/topology.LayerProtocolName" + port-id: + type: "string" + topology.Topology: + type: "object" + properties: + link: + type: "array" + items: + $ref: "#/definitions/topology.Link" + node: + type: "array" + items: + $ref: "#/definitions/topology.Node" diff --git a/hackfest/restconf/topologyserver/.dockerignore b/hackfest/restconf/topologyserver/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..cdd823e64e7e91ae85da84f22410ecb7eb370ae2 --- /dev/null +++ b/hackfest/restconf/topologyserver/.dockerignore @@ -0,0 +1,72 @@ +.travis.yaml +.swagger-codegen-ignore +README.md +tox.ini +git_push.sh +test-requirements.txt +setup.py + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.python-version + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/hackfest/restconf/topologyserver/.gitignore b/hackfest/restconf/topologyserver/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..a655050c2631466828b5b8bfc59ae27f9ac02dc5 --- /dev/null +++ b/hackfest/restconf/topologyserver/.gitignore @@ -0,0 +1,64 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.python-version + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/hackfest/restconf/topologyserver/.swagger-codegen-ignore b/hackfest/restconf/topologyserver/.swagger-codegen-ignore new file mode 100644 index 0000000000000000000000000000000000000000..c5fa491b4c557bf997d5dd21797de782545dc9e5 --- /dev/null +++ b/hackfest/restconf/topologyserver/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/hackfest/restconf/topologyserver/.swagger-codegen/VERSION b/hackfest/restconf/topologyserver/.swagger-codegen/VERSION new file mode 100644 index 0000000000000000000000000000000000000000..e4a0720dd5141073dced1d64dddb6afd14bf26d3 --- /dev/null +++ b/hackfest/restconf/topologyserver/.swagger-codegen/VERSION @@ -0,0 +1 @@ +3.0.11 \ No newline at end of file diff --git a/hackfest/restconf/topologyserver/.travis.yml b/hackfest/restconf/topologyserver/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..dd6c4450aa902ae68479c3d76d45145e18d6052e --- /dev/null +++ b/hackfest/restconf/topologyserver/.travis.yml @@ -0,0 +1,13 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "3.2" + - "3.3" + - "3.4" + - "3.5" + #- "3.5-dev" # 3.5 development branch + #- "nightly" # points to the latest development branch e.g. 3.6-dev +# command to install dependencies +install: "pip install -r requirements.txt" +# command to run tests +script: nosetests diff --git a/hackfest/restconf/topologyserver/Dockerfile b/hackfest/restconf/topologyserver/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..f9243a5ad0d025c5481e5a81bac213f716242100 --- /dev/null +++ b/hackfest/restconf/topologyserver/Dockerfile @@ -0,0 +1,16 @@ +FROM python:3.6-alpine + +RUN mkdir -p /usr/src/app +WORKDIR /usr/src/app + +COPY requirements.txt /usr/src/app/ + +RUN pip3 install --no-cache-dir -r requirements.txt + +COPY . /usr/src/app + +EXPOSE 8080 + +ENTRYPOINT ["python3"] + +CMD ["-m", "swagger_server"] \ No newline at end of file diff --git a/hackfest/restconf/topologyserver/README.md b/hackfest/restconf/topologyserver/README.md new file mode 100644 index 0000000000000000000000000000000000000000..857c30a462c3dbad326a7d0a6b7b278f36fb9bd9 --- /dev/null +++ b/hackfest/restconf/topologyserver/README.md @@ -0,0 +1,49 @@ +# Swagger generated server + +## Overview +This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the +[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This +is an example of building a swagger-enabled Flask server. + +This example uses the [Connexion](https://github.com/zalando/connexion) library on top of Flask. + +## Requirements +Python 3.5.2+ + +## Usage +To run the server, please execute the following from the root directory: + +``` +pip3 install -r requirements.txt +python3 -m swagger_server +``` + +and open your browser to here: + +``` +http://localhost:8080/ui/ +``` + +Your Swagger definition lives here: + +``` +http://localhost:8080/swagger.json +``` + +To launch the integration tests, use tox: +``` +sudo pip install tox +tox +``` + +## Running with Docker + +To run the server on a Docker container, please execute the following from the root directory: + +```bash +# building the image +docker build -t swagger_server . + +# starting up a container +docker run -p 8080:8080 swagger_server +``` \ No newline at end of file diff --git a/hackfest/restconf/topologyserver/git_push.sh b/hackfest/restconf/topologyserver/git_push.sh new file mode 100755 index 0000000000000000000000000000000000000000..160f6f213999c7ae67839fbd6fc2ba0b72675832 --- /dev/null +++ b/hackfest/restconf/topologyserver/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/hackfest/restconf/topologyserver/requirements.txt b/hackfest/restconf/topologyserver/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..b5bc506572753f5a29d2c1115a6ac15f34f09be8 --- /dev/null +++ b/hackfest/restconf/topologyserver/requirements.txt @@ -0,0 +1,3 @@ +connexion == 2.2.0 +python_dateutil == 2.6.0 +setuptools >= 21.0.0 diff --git a/hackfest/restconf/topologyserver/setup.py b/hackfest/restconf/topologyserver/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..69a77b68664be2b9e6d2375fbcedbf88c3c1da06 --- /dev/null +++ b/hackfest/restconf/topologyserver/setup.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +import sys +from setuptools import setup, find_packages + +NAME = "swagger_server" +VERSION = "1.0.0" +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = ["connexion"] + +setup( + name=NAME, + version=VERSION, + description="topology API", + author_email="", + url="", + keywords=["Swagger", "topology API"], + install_requires=REQUIRES, + packages=find_packages(), + package_data={'': ['swagger/swagger.yaml']}, + include_package_data=True, + entry_points={ + 'console_scripts': ['swagger_server=swagger_server.__main__:main']}, + long_description="""\ + topology API generated from yang definitions + """ +) diff --git a/hackfest/restconf/topologyserver/swagger_server/__init__.py b/hackfest/restconf/topologyserver/swagger_server/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/hackfest/restconf/topologyserver/swagger_server/__main__.py b/hackfest/restconf/topologyserver/swagger_server/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..752351aee00ec887d121457a3bba84206c731374 --- /dev/null +++ b/hackfest/restconf/topologyserver/swagger_server/__main__.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 + +import connexion + +from swagger_server import encoder + + +def main(): + app = connexion.App(__name__, specification_dir='./swagger/') + app.app.json_encoder = encoder.JSONEncoder + app.add_api('swagger.yaml', arguments={'title': 'topology API'}, pythonic_params=True) + app.run(port=8080) + + +if __name__ == '__main__': + main() diff --git a/hackfest/restconf/topologyserver/swagger_server/controllers/__init__.py b/hackfest/restconf/topologyserver/swagger_server/controllers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/hackfest/restconf/topologyserver/swagger_server/controllers/authorization_controller.py b/hackfest/restconf/topologyserver/swagger_server/controllers/authorization_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..2f7b0bb3e281b3fb9efb588dfc8ba4c8cc3a59ed --- /dev/null +++ b/hackfest/restconf/topologyserver/swagger_server/controllers/authorization_controller.py @@ -0,0 +1,6 @@ +from typing import List +""" +controller generated to handled auth operation described at: +https://connexion.readthedocs.io/en/latest/security.html +""" + diff --git a/hackfest/restconf/topologyserver/swagger_server/controllers/topology_controller.py b/hackfest/restconf/topologyserver/swagger_server/controllers/topology_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..068c9385d00c4a3191a7729dffde45735474c0ef --- /dev/null +++ b/hackfest/restconf/topologyserver/swagger_server/controllers/topology_controller.py @@ -0,0 +1,295 @@ +import connexion +import six + +from swagger_server.models.topology_link import TopologyLink # noqa: E501 +from swagger_server.models.topology_node import TopologyNode # noqa: E501 +from swagger_server.models.topology_port import TopologyPort # noqa: E501 +from swagger_server.models.topology_topology import TopologyTopology # noqa: E501 +from swagger_server import util + + +def data_topology_delete(): # noqa: E501 + """data_topology_delete + + removes topology.Topology # noqa: E501 + + + :rtype: None + """ + return 'do some magic!' + + +def data_topology_get(): # noqa: E501 + """data_topology_get + + returns topology.Topology # noqa: E501 + + + :rtype: TopologyTopology + """ + return 'do some magic!' + + +def data_topology_link_post(body=None): # noqa: E501 + """data_topology_link_post + + creates topology.Link # noqa: E501 + + :param body: topology.Link to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TopologyLink.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_topology_linklink_id_delete(link_id): # noqa: E501 + """data_topology_linklink_id_delete + + removes topology.Link # noqa: E501 + + :param link_id: Id of link + :type link_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_topology_linklink_id_get(link_id): # noqa: E501 + """data_topology_linklink_id_get + + returns topology.Link # noqa: E501 + + :param link_id: Id of link + :type link_id: str + + :rtype: TopologyLink + """ + return 'do some magic!' + + +def data_topology_linklink_id_post(link_id, body=None): # noqa: E501 + """data_topology_linklink_id_post + + creates topology.Link # noqa: E501 + + :param link_id: Id of link + :type link_id: str + :param body: topology.Link to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TopologyLink.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_topology_linklink_id_put(link_id, body=None): # noqa: E501 + """data_topology_linklink_id_put + + creates or updates topology.Link # noqa: E501 + + :param link_id: Id of link + :type link_id: str + :param body: topology.Link to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TopologyLink.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_topology_node_post(body=None): # noqa: E501 + """data_topology_node_post + + creates topology.Node # noqa: E501 + + :param body: topology.Node to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TopologyNode.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_topology_nodenode_id_delete(node_id): # noqa: E501 + """data_topology_nodenode_id_delete + + removes topology.Node # noqa: E501 + + :param node_id: Id of node + :type node_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_topology_nodenode_id_get(node_id): # noqa: E501 + """data_topology_nodenode_id_get + + returns topology.Node # noqa: E501 + + :param node_id: Id of node + :type node_id: str + + :rtype: TopologyNode + """ + return 'do some magic!' + + +def data_topology_nodenode_id_port_post(node_id, body=None): # noqa: E501 + """data_topology_nodenode_id_port_post + + creates topology.Port # noqa: E501 + + :param node_id: Id of node + :type node_id: str + :param body: topology.Port to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TopologyPort.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_topology_nodenode_id_portport_id_delete(node_id, port_id): # noqa: E501 + """data_topology_nodenode_id_portport_id_delete + + removes topology.Port # noqa: E501 + + :param node_id: Id of node + :type node_id: str + :param port_id: Id of port + :type port_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_topology_nodenode_id_portport_id_get(node_id, port_id): # noqa: E501 + """data_topology_nodenode_id_portport_id_get + + returns topology.Port # noqa: E501 + + :param node_id: Id of node + :type node_id: str + :param port_id: Id of port + :type port_id: str + + :rtype: TopologyPort + """ + return 'do some magic!' + + +def data_topology_nodenode_id_portport_id_post(node_id, port_id, body=None): # noqa: E501 + """data_topology_nodenode_id_portport_id_post + + creates topology.Port # noqa: E501 + + :param node_id: Id of node + :type node_id: str + :param port_id: Id of port + :type port_id: str + :param body: topology.Port to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TopologyPort.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_topology_nodenode_id_portport_id_put(node_id, port_id, body=None): # noqa: E501 + """data_topology_nodenode_id_portport_id_put + + creates or updates topology.Port # noqa: E501 + + :param node_id: Id of node + :type node_id: str + :param port_id: Id of port + :type port_id: str + :param body: topology.Port to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TopologyPort.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_topology_nodenode_id_post(node_id, body=None): # noqa: E501 + """data_topology_nodenode_id_post + + creates topology.Node # noqa: E501 + + :param node_id: Id of node + :type node_id: str + :param body: topology.Node to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TopologyNode.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_topology_nodenode_id_put(node_id, body=None): # noqa: E501 + """data_topology_nodenode_id_put + + creates or updates topology.Node # noqa: E501 + + :param node_id: Id of node + :type node_id: str + :param body: topology.Node to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TopologyNode.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_topology_post(body=None): # noqa: E501 + """data_topology_post + + creates topology.Topology # noqa: E501 + + :param body: topology.Topology to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TopologyTopology.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_topology_put(body=None): # noqa: E501 + """data_topology_put + + creates or updates topology.Topology # noqa: E501 + + :param body: topology.Topology to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TopologyTopology.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' diff --git a/hackfest/restconf/topologyserver/swagger_server/encoder.py b/hackfest/restconf/topologyserver/swagger_server/encoder.py new file mode 100644 index 0000000000000000000000000000000000000000..61ba4721961a65d38af5d5ce2948b0abe9c7aa58 --- /dev/null +++ b/hackfest/restconf/topologyserver/swagger_server/encoder.py @@ -0,0 +1,20 @@ +from connexion.apps.flask_app import FlaskJSONEncoder +import six + +from swagger_server.models.base_model_ import Model + + +class JSONEncoder(FlaskJSONEncoder): + include_nulls = False + + def default(self, o): + if isinstance(o, Model): + dikt = {} + for attr, _ in six.iteritems(o.swagger_types): + value = getattr(o, attr) + if value is None and not self.include_nulls: + continue + attr = o.attribute_map[attr] + dikt[attr] = value + return dikt + return FlaskJSONEncoder.default(self, o) diff --git a/hackfest/restconf/topologyserver/swagger_server/models/__init__.py b/hackfest/restconf/topologyserver/swagger_server/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a2b223948a5b83c2ad25221d89643579e1e75f2a --- /dev/null +++ b/hackfest/restconf/topologyserver/swagger_server/models/__init__.py @@ -0,0 +1,10 @@ +# coding: utf-8 + +# flake8: noqa +from __future__ import absolute_import +# import models into model package +from swagger_server.models.topology_layer_protocol_name import TopologyLayerProtocolName +from swagger_server.models.topology_link import TopologyLink +from swagger_server.models.topology_node import TopologyNode +from swagger_server.models.topology_port import TopologyPort +from swagger_server.models.topology_topology import TopologyTopology diff --git a/hackfest/restconf/topologyserver/swagger_server/models/base_model_.py b/hackfest/restconf/topologyserver/swagger_server/models/base_model_.py new file mode 100644 index 0000000000000000000000000000000000000000..97999c3d3237c287013b2139acb9858a52b454e8 --- /dev/null +++ b/hackfest/restconf/topologyserver/swagger_server/models/base_model_.py @@ -0,0 +1,69 @@ +import pprint + +import six +import typing + +from swagger_server import util + +T = typing.TypeVar('T') + + +class Model(object): + # swaggerTypes: The key is attribute name and the + # value is attribute type. + swagger_types = {} + + # attributeMap: The key is attribute name and the + # value is json key in definition. + attribute_map = {} + + @classmethod + def from_dict(cls: typing.Type[T], dikt) -> T: + """Returns the dict as a model""" + return util.deserialize_model(dikt, cls) + + def to_dict(self): + """Returns the model properties as a dict + + :rtype: dict + """ + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model + + :rtype: str + """ + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/hackfest/restconf/topologyserver/swagger_server/models/topology_layer_protocol_name.py b/hackfest/restconf/topologyserver/swagger_server/models/topology_layer_protocol_name.py new file mode 100644 index 0000000000000000000000000000000000000000..2ea9beed2bf84b9288fb5829ebcabd2440d5a81b --- /dev/null +++ b/hackfest/restconf/topologyserver/swagger_server/models/topology_layer_protocol_name.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from swagger_server.models.base_model_ import Model +from swagger_server import util + + +class TopologyLayerProtocolName(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + ETH = "ETH" + OPTICAL = "OPTICAL" + def __init__(self): # noqa: E501 + """TopologyLayerProtocolName - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TopologyLayerProtocolName': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The topology.LayerProtocolName of this TopologyLayerProtocolName. # noqa: E501 + :rtype: TopologyLayerProtocolName + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/restconf/topologyserver/swagger_server/models/topology_link.py b/hackfest/restconf/topologyserver/swagger_server/models/topology_link.py new file mode 100644 index 0000000000000000000000000000000000000000..536e45c4201db476de7792d94711cd600803f17d --- /dev/null +++ b/hackfest/restconf/topologyserver/swagger_server/models/topology_link.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from swagger_server.models.base_model_ import Model +from swagger_server import util + + +class TopologyLink(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, target_port: str=None, source_port: str=None, target_node: str=None, link_id: str=None, source_node: str=None): # noqa: E501 + """TopologyLink - a model defined in Swagger + + :param target_port: The target_port of this TopologyLink. # noqa: E501 + :type target_port: str + :param source_port: The source_port of this TopologyLink. # noqa: E501 + :type source_port: str + :param target_node: The target_node of this TopologyLink. # noqa: E501 + :type target_node: str + :param link_id: The link_id of this TopologyLink. # noqa: E501 + :type link_id: str + :param source_node: The source_node of this TopologyLink. # noqa: E501 + :type source_node: str + """ + self.swagger_types = { + 'target_port': str, + 'source_port': str, + 'target_node': str, + 'link_id': str, + 'source_node': str + } + + self.attribute_map = { + 'target_port': 'target-port', + 'source_port': 'source-port', + 'target_node': 'target-node', + 'link_id': 'link-id', + 'source_node': 'source-node' + } + self._target_port = target_port + self._source_port = source_port + self._target_node = target_node + self._link_id = link_id + self._source_node = source_node + + @classmethod + def from_dict(cls, dikt) -> 'TopologyLink': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The topology.Link of this TopologyLink. # noqa: E501 + :rtype: TopologyLink + """ + return util.deserialize_model(dikt, cls) + + @property + def target_port(self) -> str: + """Gets the target_port of this TopologyLink. + + + :return: The target_port of this TopologyLink. + :rtype: str + """ + return self._target_port + + @target_port.setter + def target_port(self, target_port: str): + """Sets the target_port of this TopologyLink. + + + :param target_port: The target_port of this TopologyLink. + :type target_port: str + """ + + self._target_port = target_port + + @property + def source_port(self) -> str: + """Gets the source_port of this TopologyLink. + + + :return: The source_port of this TopologyLink. + :rtype: str + """ + return self._source_port + + @source_port.setter + def source_port(self, source_port: str): + """Sets the source_port of this TopologyLink. + + + :param source_port: The source_port of this TopologyLink. + :type source_port: str + """ + + self._source_port = source_port + + @property + def target_node(self) -> str: + """Gets the target_node of this TopologyLink. + + + :return: The target_node of this TopologyLink. + :rtype: str + """ + return self._target_node + + @target_node.setter + def target_node(self, target_node: str): + """Sets the target_node of this TopologyLink. + + + :param target_node: The target_node of this TopologyLink. + :type target_node: str + """ + + self._target_node = target_node + + @property + def link_id(self) -> str: + """Gets the link_id of this TopologyLink. + + + :return: The link_id of this TopologyLink. + :rtype: str + """ + return self._link_id + + @link_id.setter + def link_id(self, link_id: str): + """Sets the link_id of this TopologyLink. + + + :param link_id: The link_id of this TopologyLink. + :type link_id: str + """ + + self._link_id = link_id + + @property + def source_node(self) -> str: + """Gets the source_node of this TopologyLink. + + + :return: The source_node of this TopologyLink. + :rtype: str + """ + return self._source_node + + @source_node.setter + def source_node(self, source_node: str): + """Sets the source_node of this TopologyLink. + + + :param source_node: The source_node of this TopologyLink. + :type source_node: str + """ + + self._source_node = source_node diff --git a/hackfest/restconf/topologyserver/swagger_server/models/topology_node.py b/hackfest/restconf/topologyserver/swagger_server/models/topology_node.py new file mode 100644 index 0000000000000000000000000000000000000000..811038a0c5876b6e46f0555866bf46af71930f75 --- /dev/null +++ b/hackfest/restconf/topologyserver/swagger_server/models/topology_node.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from swagger_server.models.base_model_ import Model +from swagger_server.models.topology_port import TopologyPort # noqa: F401,E501 +from swagger_server import util + + +class TopologyNode(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, node_id: str=None, port: List[TopologyPort]=None): # noqa: E501 + """TopologyNode - a model defined in Swagger + + :param node_id: The node_id of this TopologyNode. # noqa: E501 + :type node_id: str + :param port: The port of this TopologyNode. # noqa: E501 + :type port: List[TopologyPort] + """ + self.swagger_types = { + 'node_id': str, + 'port': List[TopologyPort] + } + + self.attribute_map = { + 'node_id': 'node-id', + 'port': 'port' + } + self._node_id = node_id + self._port = port + + @classmethod + def from_dict(cls, dikt) -> 'TopologyNode': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The topology.Node of this TopologyNode. # noqa: E501 + :rtype: TopologyNode + """ + return util.deserialize_model(dikt, cls) + + @property + def node_id(self) -> str: + """Gets the node_id of this TopologyNode. + + + :return: The node_id of this TopologyNode. + :rtype: str + """ + return self._node_id + + @node_id.setter + def node_id(self, node_id: str): + """Sets the node_id of this TopologyNode. + + + :param node_id: The node_id of this TopologyNode. + :type node_id: str + """ + + self._node_id = node_id + + @property + def port(self) -> List[TopologyPort]: + """Gets the port of this TopologyNode. + + + :return: The port of this TopologyNode. + :rtype: List[TopologyPort] + """ + return self._port + + @port.setter + def port(self, port: List[TopologyPort]): + """Sets the port of this TopologyNode. + + + :param port: The port of this TopologyNode. + :type port: List[TopologyPort] + """ + + self._port = port diff --git a/hackfest/restconf/topologyserver/swagger_server/models/topology_port.py b/hackfest/restconf/topologyserver/swagger_server/models/topology_port.py new file mode 100644 index 0000000000000000000000000000000000000000..7f6431baa9db534a2775171702db1c34cefcad15 --- /dev/null +++ b/hackfest/restconf/topologyserver/swagger_server/models/topology_port.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from swagger_server.models.base_model_ import Model +from swagger_server.models.topology_layer_protocol_name import TopologyLayerProtocolName # noqa: F401,E501 +from swagger_server import util + + +class TopologyPort(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, layer_protocol_name: TopologyLayerProtocolName=None, port_id: str=None): # noqa: E501 + """TopologyPort - a model defined in Swagger + + :param layer_protocol_name: The layer_protocol_name of this TopologyPort. # noqa: E501 + :type layer_protocol_name: TopologyLayerProtocolName + :param port_id: The port_id of this TopologyPort. # noqa: E501 + :type port_id: str + """ + self.swagger_types = { + 'layer_protocol_name': TopologyLayerProtocolName, + 'port_id': str + } + + self.attribute_map = { + 'layer_protocol_name': 'layer-protocol-name', + 'port_id': 'port-id' + } + self._layer_protocol_name = layer_protocol_name + self._port_id = port_id + + @classmethod + def from_dict(cls, dikt) -> 'TopologyPort': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The topology.Port of this TopologyPort. # noqa: E501 + :rtype: TopologyPort + """ + return util.deserialize_model(dikt, cls) + + @property + def layer_protocol_name(self) -> TopologyLayerProtocolName: + """Gets the layer_protocol_name of this TopologyPort. + + + :return: The layer_protocol_name of this TopologyPort. + :rtype: TopologyLayerProtocolName + """ + return self._layer_protocol_name + + @layer_protocol_name.setter + def layer_protocol_name(self, layer_protocol_name: TopologyLayerProtocolName): + """Sets the layer_protocol_name of this TopologyPort. + + + :param layer_protocol_name: The layer_protocol_name of this TopologyPort. + :type layer_protocol_name: TopologyLayerProtocolName + """ + + self._layer_protocol_name = layer_protocol_name + + @property + def port_id(self) -> str: + """Gets the port_id of this TopologyPort. + + + :return: The port_id of this TopologyPort. + :rtype: str + """ + return self._port_id + + @port_id.setter + def port_id(self, port_id: str): + """Sets the port_id of this TopologyPort. + + + :param port_id: The port_id of this TopologyPort. + :type port_id: str + """ + + self._port_id = port_id diff --git a/hackfest/restconf/topologyserver/swagger_server/models/topology_topology.py b/hackfest/restconf/topologyserver/swagger_server/models/topology_topology.py new file mode 100644 index 0000000000000000000000000000000000000000..5f90f6fa52aade6732fdf9c0949b31e1550a6541 --- /dev/null +++ b/hackfest/restconf/topologyserver/swagger_server/models/topology_topology.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from swagger_server.models.base_model_ import Model +from swagger_server.models.topology_link import TopologyLink # noqa: F401,E501 +from swagger_server.models.topology_node import TopologyNode # noqa: F401,E501 +from swagger_server import util + + +class TopologyTopology(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, link: List[TopologyLink]=None, node: List[TopologyNode]=None): # noqa: E501 + """TopologyTopology - a model defined in Swagger + + :param link: The link of this TopologyTopology. # noqa: E501 + :type link: List[TopologyLink] + :param node: The node of this TopologyTopology. # noqa: E501 + :type node: List[TopologyNode] + """ + self.swagger_types = { + 'link': List[TopologyLink], + 'node': List[TopologyNode] + } + + self.attribute_map = { + 'link': 'link', + 'node': 'node' + } + self._link = link + self._node = node + + @classmethod + def from_dict(cls, dikt) -> 'TopologyTopology': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The topology.Topology of this TopologyTopology. # noqa: E501 + :rtype: TopologyTopology + """ + return util.deserialize_model(dikt, cls) + + @property + def link(self) -> List[TopologyLink]: + """Gets the link of this TopologyTopology. + + + :return: The link of this TopologyTopology. + :rtype: List[TopologyLink] + """ + return self._link + + @link.setter + def link(self, link: List[TopologyLink]): + """Sets the link of this TopologyTopology. + + + :param link: The link of this TopologyTopology. + :type link: List[TopologyLink] + """ + + self._link = link + + @property + def node(self) -> List[TopologyNode]: + """Gets the node of this TopologyTopology. + + + :return: The node of this TopologyTopology. + :rtype: List[TopologyNode] + """ + return self._node + + @node.setter + def node(self, node: List[TopologyNode]): + """Sets the node of this TopologyTopology. + + + :param node: The node of this TopologyTopology. + :type node: List[TopologyNode] + """ + + self._node = node diff --git a/hackfest/restconf/topologyserver/swagger_server/swagger/swagger.yaml b/hackfest/restconf/topologyserver/swagger_server/swagger/swagger.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f8ed88ea8ec21ce3d1e780285b0dd8a34f822c0d --- /dev/null +++ b/hackfest/restconf/topologyserver/swagger_server/swagger/swagger.yaml @@ -0,0 +1,606 @@ +# 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. + +openapi: 3.0.1 +info: + title: topology API + description: topology API generated from yang definitions + version: "1.0" +servers: +- url: //localhost:1234/ +paths: + /data/topology/: + get: + tags: + - topology + description: returns topology.Topology + operationId: data_topology_get + responses: + 200: + description: topology.Topology + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/topology.Topology' + 400: + description: Internal error + content: {} + x-openapi-router-controller: swagger_server.controllers.topology_controller + put: + tags: + - topology + description: creates or updates topology.Topology + operationId: data_topology_put + requestBody: + description: topology.Topology to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/topology.Topology' + required: false + responses: + 201: + description: Object created + content: {} + 204: + description: Object modified + content: {} + 400: + description: Internal error + content: {} + x-openapi-router-controller: swagger_server.controllers.topology_controller + post: + tags: + - topology + description: creates topology.Topology + operationId: data_topology_post + requestBody: + description: topology.Topology to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/topology.Topology' + required: false + responses: + 201: + description: Object created + content: {} + 400: + description: Internal error + content: {} + 409: + description: Object already exists + content: {} + x-openapi-router-controller: swagger_server.controllers.topology_controller + delete: + tags: + - topology + description: removes topology.Topology + operationId: data_topology_delete + responses: + 204: + description: Object deleted + content: {} + 400: + description: Internal error + content: {} + x-openapi-router-controller: swagger_server.controllers.topology_controller + /data/topology/link/: + post: + tags: + - topology + description: creates topology.Link + operationId: data_topology_link_post + requestBody: + description: topology.Link to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/topology.Link' + required: false + responses: + 201: + description: Object created + content: {} + 400: + description: Internal error + content: {} + 409: + description: Object already exists + content: {} + x-openapi-router-controller: swagger_server.controllers.topology_controller + /data/topology/link={link-id}/: + get: + tags: + - topology + description: returns topology.Link + operationId: data_topology_linklink_id_get + parameters: + - name: link-id + in: path + description: Id of link + required: true + schema: + type: string + responses: + 200: + description: topology.Link + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/topology.Link' + 400: + description: Internal error + content: {} + x-openapi-router-controller: swagger_server.controllers.topology_controller + put: + tags: + - topology + description: creates or updates topology.Link + operationId: data_topology_linklink_id_put + parameters: + - name: link-id + in: path + description: Id of link + required: true + schema: + type: string + requestBody: + description: topology.Link to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/topology.Link' + required: false + responses: + 201: + description: Object created + content: {} + 204: + description: Object modified + content: {} + 400: + description: Internal error + content: {} + x-openapi-router-controller: swagger_server.controllers.topology_controller + post: + tags: + - topology + description: creates topology.Link + operationId: data_topology_linklink_id_post + parameters: + - name: link-id + in: path + description: Id of link + required: true + schema: + type: string + requestBody: + description: topology.Link to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/topology.Link' + required: false + responses: + 201: + description: Object created + content: {} + 400: + description: Internal error + content: {} + 409: + description: Object already exists + content: {} + x-openapi-router-controller: swagger_server.controllers.topology_controller + delete: + tags: + - topology + description: removes topology.Link + operationId: data_topology_linklink_id_delete + parameters: + - name: link-id + in: path + description: Id of link + required: true + schema: + type: string + responses: + 204: + description: Object deleted + content: {} + 400: + description: Internal error + content: {} + x-openapi-router-controller: swagger_server.controllers.topology_controller + /data/topology/node/: + post: + tags: + - topology + description: creates topology.Node + operationId: data_topology_node_post + requestBody: + description: topology.Node to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/topology.Node' + required: false + responses: + 201: + description: Object created + content: {} + 400: + description: Internal error + content: {} + 409: + description: Object already exists + content: {} + x-openapi-router-controller: swagger_server.controllers.topology_controller + /data/topology/node={node-id}/: + get: + tags: + - topology + description: returns topology.Node + operationId: data_topology_nodenode_id_get + parameters: + - name: node-id + in: path + description: Id of node + required: true + schema: + type: string + responses: + 200: + description: topology.Node + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/topology.Node' + 400: + description: Internal error + content: {} + x-openapi-router-controller: swagger_server.controllers.topology_controller + put: + tags: + - topology + description: creates or updates topology.Node + operationId: data_topology_nodenode_id_put + parameters: + - name: node-id + in: path + description: Id of node + required: true + schema: + type: string + requestBody: + description: topology.Node to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/topology.Node' + required: false + responses: + 201: + description: Object created + content: {} + 204: + description: Object modified + content: {} + 400: + description: Internal error + content: {} + x-openapi-router-controller: swagger_server.controllers.topology_controller + post: + tags: + - topology + description: creates topology.Node + operationId: data_topology_nodenode_id_post + parameters: + - name: node-id + in: path + description: Id of node + required: true + schema: + type: string + requestBody: + description: topology.Node to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/topology.Node' + required: false + responses: + 201: + description: Object created + content: {} + 400: + description: Internal error + content: {} + 409: + description: Object already exists + content: {} + x-openapi-router-controller: swagger_server.controllers.topology_controller + delete: + tags: + - topology + description: removes topology.Node + operationId: data_topology_nodenode_id_delete + parameters: + - name: node-id + in: path + description: Id of node + required: true + schema: + type: string + responses: + 204: + description: Object deleted + content: {} + 400: + description: Internal error + content: {} + x-openapi-router-controller: swagger_server.controllers.topology_controller + /data/topology/node={node-id}/port/: + post: + tags: + - topology + description: creates topology.Port + operationId: data_topology_nodenode_id_port_post + parameters: + - name: node-id + in: path + description: Id of node + required: true + schema: + type: string + requestBody: + description: topology.Port to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/topology.Port' + required: false + responses: + 201: + description: Object created + content: {} + 400: + description: Internal error + content: {} + 409: + description: Object already exists + content: {} + x-openapi-router-controller: swagger_server.controllers.topology_controller + /data/topology/node={node-id}/port={port-id}/: + get: + tags: + - topology + description: returns topology.Port + operationId: data_topology_nodenode_id_portport_id_get + parameters: + - name: node-id + in: path + description: Id of node + required: true + schema: + type: string + - name: port-id + in: path + description: Id of port + required: true + schema: + type: string + responses: + 200: + description: topology.Port + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/topology.Port' + 400: + description: Internal error + content: {} + x-openapi-router-controller: swagger_server.controllers.topology_controller + put: + tags: + - topology + description: creates or updates topology.Port + operationId: data_topology_nodenode_id_portport_id_put + parameters: + - name: node-id + in: path + description: Id of node + required: true + schema: + type: string + - name: port-id + in: path + description: Id of port + required: true + schema: + type: string + requestBody: + description: topology.Port to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/topology.Port' + required: false + responses: + 201: + description: Object created + content: {} + 204: + description: Object modified + content: {} + 400: + description: Internal error + content: {} + x-openapi-router-controller: swagger_server.controllers.topology_controller + post: + tags: + - topology + description: creates topology.Port + operationId: data_topology_nodenode_id_portport_id_post + parameters: + - name: node-id + in: path + description: Id of node + required: true + schema: + type: string + - name: port-id + in: path + description: Id of port + required: true + schema: + type: string + requestBody: + description: topology.Port to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/topology.Port' + required: false + responses: + 201: + description: Object created + content: {} + 400: + description: Internal error + content: {} + 409: + description: Object already exists + content: {} + x-openapi-router-controller: swagger_server.controllers.topology_controller + delete: + tags: + - topology + description: removes topology.Port + operationId: data_topology_nodenode_id_portport_id_delete + parameters: + - name: node-id + in: path + description: Id of node + required: true + schema: + type: string + - name: port-id + in: path + description: Id of port + required: true + schema: + type: string + responses: + 204: + description: Object deleted + content: {} + 400: + description: Internal error + content: {} + x-openapi-router-controller: swagger_server.controllers.topology_controller +components: + schemas: + topology.LayerProtocolName: + type: string + enum: + - ETH + - OPTICAL + topology.Link: + type: object + properties: + target-port: + type: string + x-path: /topology/node/port/port-id + source-port: + type: string + x-path: /topology/node/port/port-id + target-node: + type: string + x-path: /topology/node/node-id + link-id: + type: string + source-node: + type: string + x-path: /topology/node/node-id + example: + target-port: target-port + source-port: source-port + target-node: target-node + link-id: link-id + source-node: source-node + topology.Node: + type: object + properties: + node-id: + type: string + port: + type: array + items: + $ref: '#/components/schemas/topology.Port' + example: + node-id: node-id + port: + - layer-protocol-name: ETH + port-id: port-id + - layer-protocol-name: ETH + port-id: port-id + topology.Port: + type: object + properties: + layer-protocol-name: + $ref: '#/components/schemas/topology.LayerProtocolName' + port-id: + type: string + example: + layer-protocol-name: ETH + port-id: port-id + topology.Topology: + type: object + properties: + link: + type: array + items: + $ref: '#/components/schemas/topology.Link' + node: + type: array + items: + $ref: '#/components/schemas/topology.Node' + example: + node: + - node-id: node-id + port: + - layer-protocol-name: ETH + port-id: port-id + - layer-protocol-name: ETH + port-id: port-id + - node-id: node-id + port: + - layer-protocol-name: ETH + port-id: port-id + - layer-protocol-name: ETH + port-id: port-id + link: + - target-port: target-port + source-port: source-port + target-node: target-node + link-id: link-id + source-node: source-node + - target-port: target-port + source-port: source-port + target-node: target-node + link-id: link-id + source-node: source-node + diff --git a/hackfest/restconf/topologyserver/swagger_server/test/__init__.py b/hackfest/restconf/topologyserver/swagger_server/test/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..644506301ce077f2e881fcda3454b6cba362ab5e --- /dev/null +++ b/hackfest/restconf/topologyserver/swagger_server/test/__init__.py @@ -0,0 +1,16 @@ +import logging + +import connexion +from flask_testing import TestCase + +from swagger_server.encoder import JSONEncoder + + +class BaseTestCase(TestCase): + + def create_app(self): + logging.getLogger('connexion.operation').setLevel('ERROR') + app = connexion.App(__name__, specification_dir='../swagger/') + app.app.json_encoder = JSONEncoder + app.add_api('swagger.yaml') + return app.app diff --git a/hackfest/restconf/topologyserver/swagger_server/test/test_topology_controller.py b/hackfest/restconf/topologyserver/swagger_server/test/test_topology_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..69c6a2fa734c174df514d09a58c6db25be4b63c3 --- /dev/null +++ b/hackfest/restconf/topologyserver/swagger_server/test/test_topology_controller.py @@ -0,0 +1,263 @@ +# coding: utf-8 + +from __future__ import absolute_import + +from flask import json +from six import BytesIO + +from swagger_server.models.topology_link import TopologyLink # noqa: E501 +from swagger_server.models.topology_node import TopologyNode # noqa: E501 +from swagger_server.models.topology_port import TopologyPort # noqa: E501 +from swagger_server.models.topology_topology import TopologyTopology # noqa: E501 +from swagger_server.test import BaseTestCase + + +class TestTopologyController(BaseTestCase): + """TopologyController integration test stubs""" + + def test_data_topology_delete(self): + """Test case for data_topology_delete + + + """ + response = self.client.open( + '/data/topology/', + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_topology_get(self): + """Test case for data_topology_get + + + """ + response = self.client.open( + '/data/topology/', + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_topology_link_post(self): + """Test case for data_topology_link_post + + + """ + body = TopologyLink() + response = self.client.open( + '/data/topology/link/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_topology_linklink_id_delete(self): + """Test case for data_topology_linklink_id_delete + + + """ + response = self.client.open( + '/data/topology/link={link-id}/'.format(link_id='link_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_topology_linklink_id_get(self): + """Test case for data_topology_linklink_id_get + + + """ + response = self.client.open( + '/data/topology/link={link-id}/'.format(link_id='link_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_topology_linklink_id_post(self): + """Test case for data_topology_linklink_id_post + + + """ + body = TopologyLink() + response = self.client.open( + '/data/topology/link={link-id}/'.format(link_id='link_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_topology_linklink_id_put(self): + """Test case for data_topology_linklink_id_put + + + """ + body = TopologyLink() + response = self.client.open( + '/data/topology/link={link-id}/'.format(link_id='link_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_topology_node_post(self): + """Test case for data_topology_node_post + + + """ + body = TopologyNode() + response = self.client.open( + '/data/topology/node/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_topology_nodenode_id_delete(self): + """Test case for data_topology_nodenode_id_delete + + + """ + response = self.client.open( + '/data/topology/node={node-id}/'.format(node_id='node_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_topology_nodenode_id_get(self): + """Test case for data_topology_nodenode_id_get + + + """ + response = self.client.open( + '/data/topology/node={node-id}/'.format(node_id='node_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_topology_nodenode_id_port_post(self): + """Test case for data_topology_nodenode_id_port_post + + + """ + body = TopologyPort() + response = self.client.open( + '/data/topology/node={node-id}/port/'.format(node_id='node_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_topology_nodenode_id_portport_id_delete(self): + """Test case for data_topology_nodenode_id_portport_id_delete + + + """ + response = self.client.open( + '/data/topology/node={node-id}/port={port-id}/'.format(node_id='node_id_example', port_id='port_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_topology_nodenode_id_portport_id_get(self): + """Test case for data_topology_nodenode_id_portport_id_get + + + """ + response = self.client.open( + '/data/topology/node={node-id}/port={port-id}/'.format(node_id='node_id_example', port_id='port_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_topology_nodenode_id_portport_id_post(self): + """Test case for data_topology_nodenode_id_portport_id_post + + + """ + body = TopologyPort() + response = self.client.open( + '/data/topology/node={node-id}/port={port-id}/'.format(node_id='node_id_example', port_id='port_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_topology_nodenode_id_portport_id_put(self): + """Test case for data_topology_nodenode_id_portport_id_put + + + """ + body = TopologyPort() + response = self.client.open( + '/data/topology/node={node-id}/port={port-id}/'.format(node_id='node_id_example', port_id='port_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_topology_nodenode_id_post(self): + """Test case for data_topology_nodenode_id_post + + + """ + body = TopologyNode() + response = self.client.open( + '/data/topology/node={node-id}/'.format(node_id='node_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_topology_nodenode_id_put(self): + """Test case for data_topology_nodenode_id_put + + + """ + body = TopologyNode() + response = self.client.open( + '/data/topology/node={node-id}/'.format(node_id='node_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_topology_post(self): + """Test case for data_topology_post + + + """ + body = TopologyTopology() + response = self.client.open( + '/data/topology/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_topology_put(self): + """Test case for data_topology_put + + + """ + body = TopologyTopology() + response = self.client.open( + '/data/topology/', + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + +if __name__ == '__main__': + import unittest + unittest.main() diff --git a/hackfest/restconf/topologyserver/swagger_server/util.py b/hackfest/restconf/topologyserver/swagger_server/util.py new file mode 100644 index 0000000000000000000000000000000000000000..527d1424c3d5563073b18b4da1a9904b2cb6b62b --- /dev/null +++ b/hackfest/restconf/topologyserver/swagger_server/util.py @@ -0,0 +1,141 @@ +import datetime + +import six +import typing + + +def _deserialize(data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if klass in six.integer_types or klass in (float, str, bool): + return _deserialize_primitive(data, klass) + elif klass == object: + return _deserialize_object(data) + elif klass == datetime.date: + return deserialize_date(data) + elif klass == datetime.datetime: + return deserialize_datetime(data) + elif type(klass) == typing.GenericMeta: + if klass.__extra__ == list: + return _deserialize_list(data, klass.__args__[0]) + if klass.__extra__ == dict: + return _deserialize_dict(data, klass.__args__[1]) + else: + return deserialize_model(data, klass) + + +def _deserialize_primitive(data, klass): + """Deserializes to primitive type. + + :param data: data to deserialize. + :param klass: class literal. + + :return: int, long, float, str, bool. + :rtype: int | long | float | str | bool + """ + try: + value = klass(data) + except UnicodeEncodeError: + value = six.u(data) + except TypeError: + value = data + return value + + +def _deserialize_object(value): + """Return a original value. + + :return: object. + """ + return value + + +def deserialize_date(string): + """Deserializes string to date. + + :param string: str. + :type string: str + :return: date. + :rtype: date + """ + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + + +def deserialize_datetime(string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :type string: str + :return: datetime. + :rtype: datetime + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + + +def deserialize_model(data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :type data: dict | list + :param klass: class literal. + :return: model object. + """ + instance = klass() + + if not instance.swagger_types: + return data + + for attr, attr_type in six.iteritems(instance.swagger_types): + if data is not None \ + and instance.attribute_map[attr] in data \ + and isinstance(data, (list, dict)): + value = data[instance.attribute_map[attr]] + setattr(instance, attr, _deserialize(value, attr_type)) + + return instance + + +def _deserialize_list(data, boxed_type): + """Deserializes a list and its elements. + + :param data: list to deserialize. + :type data: list + :param boxed_type: class literal. + + :return: deserialized list. + :rtype: list + """ + return [_deserialize(sub_data, boxed_type) + for sub_data in data] + + +def _deserialize_dict(data, boxed_type): + """Deserializes a dict and its elements. + + :param data: dict to deserialize. + :type data: dict + :param boxed_type: class literal. + + :return: deserialized dict. + :rtype: dict + """ + return {k: _deserialize(v, boxed_type) + for k, v in six.iteritems(data)} diff --git a/hackfest/restconf/topologyserver/test-requirements.txt b/hackfest/restconf/topologyserver/test-requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..7f8d96e6b40e853d658f88fa745ddcf37ff7644c --- /dev/null +++ b/hackfest/restconf/topologyserver/test-requirements.txt @@ -0,0 +1,6 @@ +flask_testing==0.6.1 +coverage>=4.0.3 +nose>=1.3.7 +pluggy>=0.3.1 +py>=1.4.31 +randomize>=0.13 diff --git a/hackfest/restconf/topologyserver/tox.ini b/hackfest/restconf/topologyserver/tox.ini new file mode 100644 index 0000000000000000000000000000000000000000..3e0b644eec48f0d6d63f028c28315ca0eda5896f --- /dev/null +++ b/hackfest/restconf/topologyserver/tox.ini @@ -0,0 +1,10 @@ +[tox] +envlist = py35 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + nosetests \ + [] \ No newline at end of file diff --git a/hackfest/tapi/client/cs1.json b/hackfest/tapi/client/cs1.json new file mode 100644 index 0000000000000000000000000000000000000000..06290e137a280bb01b9de5adf98c4aaa9b73c122 --- /dev/null +++ b/hackfest/tapi/client/cs1.json @@ -0,0 +1,28 @@ +{ + "tapi-connectivity:connectivity-service": [ + { + "uuid" : "cs1", + "service-type":"POINT_TO_POINT_CONNECTIVITY", + "connectivity-constraint": { + "requested-capacity": {"total-size": { "value": "50", "unit": "GHz" }}, + "connectivity-direction": "UNIDIRECTIONAL" + }, + "end-point": [ + { + "local-id": "csep-1", + "layer-protocol-name": "PHOTONIC_MEDIA", + "service-interface-point": { + "service-interface-point-uuid": "node-1-port-13-input" + } + }, + { + "local-id":"csep-2", + "layer-protocol-name":"PHOTONIC_MEDIA", + "service-interface-point": { + "service-interface-point-uuid": "node-2-port-14-output" + } + } + ] + } + ] +} diff --git a/hackfest/tapi/client/tapi-client.sh b/hackfest/tapi/client/tapi-client.sh new file mode 100755 index 0000000000000000000000000000000000000000..084d63dee8cb0ef7653bf2d615e50d3e63d8c73e --- /dev/null +++ b/hackfest/tapi/client/tapi-client.sh @@ -0,0 +1,65 @@ +# 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. + +#Example CURL for TAPI 2.0 + +#Get Context +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/config/context/ + +#Get Service Interface Points +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/config/context/service-interface-point/ + +#Get SIP sip-pe1-uni1 +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/config/context/service-interface-point/sip-pe1-uni1/ + +#Get topologies +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/config/context/topology/ + +#Get topology topo-nwk +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/config/context/topology/topo-nwk/ + +#Get nodes +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/config/context/topology/topo-nwk/node/ + +#Get node 1 +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/config/context/topology/topo-nwk/node/node-pe-1/ + +#Get NEP list +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/config/context/topology/topo-nwk/node/node-pe-1/owned-node-edge-point/ + +#Get NEP NEP_PE_01_UNI1 +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/config/context/topology/topo-nwk/node/node-pe-1/owned-node-edge-point/NEP_PE_01_UNI1/ + +#Get links +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/config/context/topology/topo-nwk/link/ + +#Get link 1-3 +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/config/context/topology/topo-nwk/link/PE1_NNI3_PI3_NNI1/ + +#Create Connectivity Service +curl -X POST -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/config/context/connectivity-service/cs1/ -d @cs1.json + +#Get Connectivity Services +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/config/context/connectivity-service/ + +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/config/context/connectivity-service/cs1/ + +#Get connection +curl -X GET -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/config/context/connection/cs1/ + +#Delete Connectivity Services +curl -X DELETE -H "Content-Type: application/json" http://127.0.0.1:8080/restconf/config/context/connectivity-service/cs1/ + + + diff --git a/hackfest/tapi/codegen-config.json b/hackfest/tapi/codegen-config.json new file mode 100644 index 0000000000000000000000000000000000000000..be1ca6ac0958b42ec611cf9ff1a5cc228e4e7273 --- /dev/null +++ b/hackfest/tapi/codegen-config.json @@ -0,0 +1,4 @@ +{ + "packageName": "tapi_server", + "packageVersion": "2.1.3" +} diff --git a/hackfest/tapi/server/.dockerignore b/hackfest/tapi/server/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..cdd823e64e7e91ae85da84f22410ecb7eb370ae2 --- /dev/null +++ b/hackfest/tapi/server/.dockerignore @@ -0,0 +1,72 @@ +.travis.yaml +.swagger-codegen-ignore +README.md +tox.ini +git_push.sh +test-requirements.txt +setup.py + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.python-version + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/hackfest/tapi/server/.gitignore b/hackfest/tapi/server/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..a655050c2631466828b5b8bfc59ae27f9ac02dc5 --- /dev/null +++ b/hackfest/tapi/server/.gitignore @@ -0,0 +1,64 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.python-version + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/hackfest/tapi/server/.swagger-codegen-ignore b/hackfest/tapi/server/.swagger-codegen-ignore new file mode 100644 index 0000000000000000000000000000000000000000..c5fa491b4c557bf997d5dd21797de782545dc9e5 --- /dev/null +++ b/hackfest/tapi/server/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/hackfest/tapi/server/.swagger-codegen/VERSION b/hackfest/tapi/server/.swagger-codegen/VERSION new file mode 100644 index 0000000000000000000000000000000000000000..053a355ae8764725498657904f6aa8f694204d4a --- /dev/null +++ b/hackfest/tapi/server/.swagger-codegen/VERSION @@ -0,0 +1 @@ +3.0.35 \ No newline at end of file diff --git a/hackfest/tapi/server/.travis.yml b/hackfest/tapi/server/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..dd6c4450aa902ae68479c3d76d45145e18d6052e --- /dev/null +++ b/hackfest/tapi/server/.travis.yml @@ -0,0 +1,13 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "3.2" + - "3.3" + - "3.4" + - "3.5" + #- "3.5-dev" # 3.5 development branch + #- "nightly" # points to the latest development branch e.g. 3.6-dev +# command to install dependencies +install: "pip install -r requirements.txt" +# command to run tests +script: nosetests diff --git a/hackfest/tapi/server/Acknowledgements.txt b/hackfest/tapi/server/Acknowledgements.txt new file mode 100644 index 0000000000000000000000000000000000000000..288a31e12df8aef0f2c8098c64a2f48b9fc11faf --- /dev/null +++ b/hackfest/tapi/server/Acknowledgements.txt @@ -0,0 +1,3 @@ +# [Ref-1]: https://github.com/OpenNetworkingFoundation/TAPI +# [Ref-2]: https://github.com/OpenNetworkingFoundation/TAPI/tree/v2.1.3/YANG +# [Ref-3]: https://github.com/OpenNetworkingFoundation/TAPI/tree/develop/RI diff --git a/hackfest/tapi/server/Dockerfile b/hackfest/tapi/server/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..c9fdfe31e488e27eb023f38f521d65dc0896b11f --- /dev/null +++ b/hackfest/tapi/server/Dockerfile @@ -0,0 +1,16 @@ +FROM python:3.6-alpine + +RUN mkdir -p /usr/src/app +WORKDIR /usr/src/app + +COPY requirements.txt /usr/src/app/ + +RUN pip3 install --no-cache-dir -r requirements.txt + +COPY . /usr/src/app + +EXPOSE 8080 + +ENTRYPOINT ["python3"] + +CMD ["-m", "tapi_server"] \ No newline at end of file diff --git a/hackfest/tapi/server/README.md b/hackfest/tapi/server/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3ddda50fb38fe89c346c95bc08914665da155a19 --- /dev/null +++ b/hackfest/tapi/server/README.md @@ -0,0 +1,49 @@ +# Swagger generated server + +## Overview +This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the +[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This +is an example of building a swagger-enabled Flask server. + +This example uses the [Connexion](https://github.com/zalando/connexion) library on top of Flask. + +## Requirements +Python 3.5.2+ + +## Usage +To run the server, please execute the following from the root directory: + +``` +pip3 install -r requirements.txt +python3 -m tapi_server +``` + +and open your browser to here: + +``` +http://localhost:8080/ui/ +``` + +Your Swagger definition lives here: + +``` +http://localhost:8080/swagger.json +``` + +To launch the integration tests, use tox: +``` +sudo pip install tox +tox +``` + +## Running with Docker + +To run the server on a Docker container, please execute the following from the root directory: + +```bash +# building the image +docker build -t tapi_server . + +# starting up a container +docker run -p 8080:8080 tapi_server +``` \ No newline at end of file diff --git a/hackfest/tapi/server/git_push.sh b/hackfest/tapi/server/git_push.sh new file mode 100755 index 0000000000000000000000000000000000000000..160f6f213999c7ae67839fbd6fc2ba0b72675832 --- /dev/null +++ b/hackfest/tapi/server/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/hackfest/tapi/server/requirements.txt b/hackfest/tapi/server/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..62c7fffac8b5bc20011c481e6ae3601eca6d4a08 --- /dev/null +++ b/hackfest/tapi/server/requirements.txt @@ -0,0 +1,5 @@ +connexion >= 2.6.0 +connexion[swagger-ui] >= 2.6.0 +python_dateutil == 2.6.0 +setuptools >= 21.0.0 +swagger-ui-bundle >= 0.0.2 diff --git a/hackfest/tapi/server/run.sh b/hackfest/tapi/server/run.sh new file mode 100755 index 0000000000000000000000000000000000000000..9beaec828efcf9fefec935b35f573ee1e3aa5007 --- /dev/null +++ b/hackfest/tapi/server/run.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. + + +python3 -m tapi_server 8080 database/mini-ols-context.json diff --git a/hackfest/tapi/server/setup.py b/hackfest/tapi/server/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..eaf66f499a8e6311a6b5ea1946b6448b1144388b --- /dev/null +++ b/hackfest/tapi/server/setup.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +import sys +from setuptools import setup, find_packages + +NAME = "tapi_server" +VERSION = "2.1.3" +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = [ + "connexion", + "swagger-ui-bundle>=0.0.2" +] + +setup( + name=NAME, + version=VERSION, + description="tapi-notification,tapi-connectivity,tapi-topology,tapi-common,tapi-path-computation API", + author_email="", + url="", + keywords=["Swagger", "tapi-notification,tapi-connectivity,tapi-topology,tapi-common,tapi-path-computation API"], + install_requires=REQUIRES, + packages=find_packages(), + package_data={'': ['swagger/swagger.yaml']}, + include_package_data=True, + entry_points={ + 'console_scripts': ['tapi_server=tapi_server.__main__:main']}, + long_description="""\ + This module contains TAPI Notification Model definitions. Source: TapiNotification.uml - The TAPI YANG models included in this TAPI release are a *normative* part of the TAPI SDK. - The YANG specifications have been generated from the corresponding UML model using the [ONF EAGLE UML2YANG mapping tool] <https://urldefense.com/v3/__https://github.com/OpenNetworkingFoundation/EagleUmlYang__;!!OSsGDw!d_dJlNtYLmD585It0DKukzB2TS5KZqBZQ-pdI1D-6c6c5hRDotd6G4QHf0bG$ > and further edited manually to comply with the [ONF IISOMI UML2YANG mapping guidelines] <https://urldefense.com/v3/__https://wiki.opennetworking.org/display/OIMT/UML*-*YANG*Guidelines__;Kysr!!OSsGDw!d_dJlNtYLmD585It0DKukzB2TS5KZqBZQ-pdI1D-6c6c5hRDotd6G8IIivez$ > - Status of YANG model artifacts can be determined by referring to the corresponding UML artifacts. As described in the UML models, some artifacts are considered *experimental*, and thus the corresponding YANG artifacts. - The ONF TAPI release process does not guarantee backward compatibility of YANG models across major versions of TAPI releases. The YANG model backward compatibility criteria are outlined in section 11 of <https://urldefense.com/v3/__https://tools.ietf.org/html/rfc7950__;!!OSsGDw!d_dJlNtYLmD585It0DKukzB2TS5KZqBZQ-pdI1D-6c6c5hRDotd6G3bKxRf2$ >. YANG models included in this release may not be backward compatible with previous TAPI releases. Copyright (c) 2018 Open Networking Foundation (ONF). All rights reserved. License: This module is distributed under the Apache License 2.0, This module contains TAPI Connectivity Model definitions. Source: TapiConnectivity.uml - The TAPI YANG models included in this TAPI release are a *normative* part of the TAPI SDK. - The YANG specifications have been generated from the corresponding UML model using the [ONF EAGLE UML2YANG mapping tool] <https://urldefense.com/v3/__https://github.com/OpenNetworkingFoundation/EagleUmlYang__;!!OSsGDw!bx-l35NqfQHpJ8R_DmXfi2NX2ll5dMl9VbK5aS_m3ZShiVoz74Ur_6pxiNxl$ > and further edited manually to comply with the [ONF IISOMI UML2YANG mapping guidelines] <https://urldefense.com/v3/__https://wiki.opennetworking.org/display/OIMT/UML*-*YANG*Guidelines__;Kysr!!OSsGDw!bx-l35NqfQHpJ8R_DmXfi2NX2ll5dMl9VbK5aS_m3ZShiVoz74Ur_wxKUbJ_$ > - Status of YANG model artifacts can be determined by referring to the corresponding UML artifacts. As described in the UML models, some artifacts are considered *experimental*, and thus the corresponding YANG artifacts. - The ONF TAPI release process does not guarantee backward compatibility of YANG models across major versions of TAPI releases. The YANG model backward compatibility criteria are outlined in section 11 of <https://urldefense.com/v3/__https://tools.ietf.org/html/rfc7950__;!!OSsGDw!bx-l35NqfQHpJ8R_DmXfi2NX2ll5dMl9VbK5aS_m3ZShiVoz74Ur_zcAY1P4$ >. YANG models included in this release may not be backward compatible with previous TAPI releases. Copyright (c) 2018 Open Networking Foundation (ONF). All rights reserved. License: This module is distributed under the Apache License 2.0., This module contains TAPI Topology Model definitions. Source: TapiTopology.uml - The TAPI YANG models included in this TAPI release are a *normative* part of the TAPI SDK. - The YANG specifications have been generated from the corresponding UML model using the [ONF EAGLE UML2YANG mapping tool] <https://urldefense.com/v3/__https://github.com/OpenNetworkingFoundation/EagleUmlYang__;!!OSsGDw!bx-l35NqfQHpJ8R_DmXfi2NX2ll5dMl9VbK5aS_m3ZShiVoz74Ur_6pxiNxl$ > and further edited manually to comply with the [ONF IISOMI UML2YANG mapping guidelines] <https://urldefense.com/v3/__https://wiki.opennetworking.org/display/OIMT/UML*-*YANG*Guidelines__;Kysr!!OSsGDw!bx-l35NqfQHpJ8R_DmXfi2NX2ll5dMl9VbK5aS_m3ZShiVoz74Ur_wxKUbJ_$ > - Status of YANG model artifacts can be determined by referring to the corresponding UML artifacts. As described in the UML models, some artifacts are considered *experimental*, and thus the corresponding YANG artifacts. - The ONF TAPI release process does not guarantee backward compatibility of YANG models across major versions of TAPI releases. The YANG model backward compatibility criteria are outlined in section 11 of <https://urldefense.com/v3/__https://tools.ietf.org/html/rfc7950__;!!OSsGDw!bx-l35NqfQHpJ8R_DmXfi2NX2ll5dMl9VbK5aS_m3ZShiVoz74Ur_zcAY1P4$ >. YANG models included in this release may not be backward compatible with previous TAPI releases. Copyright (c) 2018 Open Networking Foundation (ONF). All rights reserved. License: This module is distributed under the Apache License 2.0., This module contains TAPI Common Model definitions. Source: TapiCommon.uml - The TAPI YANG models included in this TAPI release are a *normative* part of the TAPI SDK. - The YANG specifications have been generated from the corresponding UML model using the [ONF EAGLE UML2YANG mapping tool] <https://github.com/OpenNetworkingFoundation/EagleUmlYang> and further edited manually to comply with the [ONF IISOMI UML2YANG mapping guidelines] <https://wiki.opennetworking.org/display/OIMT/UML+-+YANG+Guidelines> - Status of YANG model artifacts can be determined by referring to the corresponding UML artifacts. As described in the UML models, some artifacts are considered *experimental*, and thus the corresponding YANG artifacts. - The ONF TAPI release process does not guarantee backward compatibility of YANG models across major versions of TAPI releases. The YANG model backward compatibility criteria are outlined in section 11 of <https://tools.ietf.org/html/rfc7950>. YANG models included in this release may not be backward compatible with previous TAPI releases. Copyright (c) 2018 Open Networking Foundation (ONF). All rights reserved. License: This module is distributed under the Apache License 2.0., This module contains TAPI Path Computation Model definitions. Source: TapiPathComputation.uml - The TAPI YANG models included in this TAPI release are a *normative* part of the TAPI SDK. - The YANG specifications have been generated from the corresponding UML model using the [ONF EAGLE UML2YANG mapping tool] <https://github.com/OpenNetworkingFoundation/EagleUmlYang> and further edited manually to comply with the [ONF IISOMI UML2YANG mapping guidelines] <https://wiki.opennetworking.org/display/OIMT/UML+-+YANG+Guidelines> - Status of YANG model artifacts can be determined by referring to the corresponding UML artifacts. As described in the UML models, some artifacts are considered *experimental*, and thus the corresponding YANG artifacts. - The ONF TAPI release process does not guarantee backward compatibility of YANG models across major versions of TAPI releases. The YANG model backward compatibility criteria are outlined in section 11 of <https://tools.ietf.org/html/rfc7950>. YANG models included in this release may not be backward compatible with previous TAPI releases. Copyright (c) 2018 Open Networking Foundation (ONF). All rights reserved. License: This module is distributed under the Apache License 2.0. + """ +) diff --git a/hackfest/tapi/server/tapi_server/__init__.py b/hackfest/tapi/server/tapi_server/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/hackfest/tapi/server/tapi_server/__main__.py b/hackfest/tapi/server/tapi_server/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..14a73dae3984d35a9750e998c718a14f01e64261 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/__main__.py @@ -0,0 +1,41 @@ +#!/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 connexion +import json +import sys + +from flask import current_app +from tapi_server import encoder +from tapi_server.models.tapi_common_context import TapiCommonContext +from tapi_server import database + + +def main(): + app = connexion.App(__name__, specification_dir='./swagger/') + app.app.json_encoder = encoder.JSONEncoder + app.add_api('swagger.yaml', + arguments={'title': 'tapi-notification,tapi-connectivity,tapi-topology,tapi-common,tapi-path-computation API'}, + base_path='/restconf', + pythonic_params=True) + with app.app.app_context(): + with current_app.open_resource(sys.argv[2], 'r') as f: + data = json.load(f) + database.context = TapiCommonContext.from_dict(data) + app.run(port=sys.argv[1]) + +if __name__ == '__main__': + main() diff --git a/hackfest/tapi/server/tapi_server/controllers/__init__.py b/hackfest/tapi/server/tapi_server/controllers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/hackfest/tapi/server/tapi_server/controllers/authorization_controller.py b/hackfest/tapi/server/tapi_server/controllers/authorization_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..2f7b0bb3e281b3fb9efb588dfc8ba4c8cc3a59ed --- /dev/null +++ b/hackfest/tapi/server/tapi_server/controllers/authorization_controller.py @@ -0,0 +1,6 @@ +from typing import List +""" +controller generated to handled auth operation described at: +https://connexion.readthedocs.io/en/latest/security.html +""" + diff --git a/hackfest/tapi/server/tapi_server/controllers/tapi_common_controller.py b/hackfest/tapi/server/tapi_server/controllers/tapi_common_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..e6ad1e658b5a8300613882ca23e8bb5a0c4f4980 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/controllers/tapi_common_controller.py @@ -0,0 +1,477 @@ +import connexion +import six + +from tapi_server.models.operations_tapicommongetserviceinterfacepointdetails_body import OperationsTapicommongetserviceinterfacepointdetailsBody # noqa: E501 +from tapi_server.models.operations_tapicommonupdateserviceinterfacepoint_body import OperationsTapicommonupdateserviceinterfacepointBody # noqa: E501 +from tapi_server.models.tapi_common_bandwidth_profile_wrapper import TapiCommonBandwidthProfileWrapper # noqa: E501 +from tapi_server.models.tapi_common_capacity_value_wrapper import TapiCommonCapacityValueWrapper # noqa: E501 +from tapi_server.models.tapi_common_capacity_wrapper import TapiCommonCapacityWrapper # noqa: E501 +from tapi_server.models.tapi_common_context_wrapper import TapiCommonContextWrapper # noqa: E501 +from tapi_server.models.tapi_common_get_service_interface_point_details import TapiCommonGetServiceInterfacePointDetails # noqa: E501 +from tapi_server.models.tapi_common_get_service_interface_point_list import TapiCommonGetServiceInterfacePointList # noqa: E501 +from tapi_server.models.tapi_common_name_and_value_wrapper import TapiCommonNameAndValueWrapper # noqa: E501 +from tapi_server.models.tapi_common_service_interface_point_wrapper import TapiCommonServiceInterfacePointWrapper # noqa: E501 +from tapi_server import util + +from tapi_server.models.tapi_common_getserviceinterfacepointdetails_output import TapiCommonGetserviceinterfacepointdetailsOutput +from tapi_server.models.tapi_common_getserviceinterfacepointlist_output import TapiCommonGetserviceinterfacepointlistOutput +from tapi_server import database + + +def data_tapi_commoncontext_delete(): # noqa: E501 + """removes tapi.common.Context + + none # noqa: E501 + + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_get(): # noqa: E501 + """returns tapi.common.Context + + none # noqa: E501 + + + :rtype: TapiCommonContextWrapper + """ + return database.context + + +def data_tapi_commoncontext_name_post(body=None): # noqa: E501 + """creates tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param body: tapi.common.NameAndValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonNameAndValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_namevalue_name_delete(value_name): # noqa: E501 + """removes tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param value_name: Id of name + :type value_name: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_namevalue_name_get(value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_namevalue_name_put(value_name, body=None): # noqa: E501 + """creates or updates tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param value_name: Id of name + :type value_name: str + :param body: tapi.common.NameAndValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonNameAndValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_post(body=None): # noqa: E501 + """creates tapi.common.Context + + none # noqa: E501 + + :param body: tapi.common.Context to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonContextWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_put(body=None): # noqa: E501 + """creates or updates tapi.common.Context + + none # noqa: E501 + + :param body: tapi.common.Context to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonContextWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_service_interface_point_post(body=None): # noqa: E501 + """creates tapi.common.ServiceInterfacePoint + + none # noqa: E501 + + :param body: tapi.common.ServiceInterfacePoint to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonServiceInterfacePointWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_service_interface_pointuuid_available_capacity_bandwidth_profile_committed_burst_size_get(uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of service-interface-point + :type uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_service_interface_pointuuid_available_capacity_bandwidth_profile_committed_information_rate_get(uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of service-interface-point + :type uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_service_interface_pointuuid_available_capacity_bandwidth_profile_get(uuid): # noqa: E501 + """returns tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of service-interface-point + :type uuid: str + + :rtype: TapiCommonBandwidthProfileWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_service_interface_pointuuid_available_capacity_bandwidth_profile_peak_burst_size_get(uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of service-interface-point + :type uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_service_interface_pointuuid_available_capacity_bandwidth_profile_peak_information_rate_get(uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of service-interface-point + :type uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_service_interface_pointuuid_available_capacity_get(uuid): # noqa: E501 + """returns tapi.common.Capacity + + Capacity available to be assigned. # noqa: E501 + + :param uuid: Id of service-interface-point + :type uuid: str + + :rtype: TapiCommonCapacityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_service_interface_pointuuid_available_capacity_total_size_get(uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of service-interface-point + :type uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_service_interface_pointuuid_delete(uuid): # noqa: E501 + """removes tapi.common.ServiceInterfacePoint + + none # noqa: E501 + + :param uuid: Id of service-interface-point + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_service_interface_pointuuid_get(uuid): # noqa: E501 + """returns tapi.common.ServiceInterfacePoint + + none # noqa: E501 + + :param uuid: Id of service-interface-point + :type uuid: str + + :rtype: TapiCommonServiceInterfacePointWrapper + """ + return database.service_interface_point(uuid) + + +def data_tapi_commoncontext_service_interface_pointuuid_name_post(uuid, body=None): # noqa: E501 + """creates tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of service-interface-point + :type uuid: str + :param body: tapi.common.NameAndValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonNameAndValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_service_interface_pointuuid_namevalue_name_delete(uuid, value_name): # noqa: E501 + """removes tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of service-interface-point + :type uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_service_interface_pointuuid_namevalue_name_get(uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of service-interface-point + :type uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_service_interface_pointuuid_namevalue_name_put(uuid, value_name, body=None): # noqa: E501 + """creates or updates tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of service-interface-point + :type uuid: str + :param value_name: Id of name + :type value_name: str + :param body: tapi.common.NameAndValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonNameAndValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_service_interface_pointuuid_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.common.ServiceInterfacePoint + + none # noqa: E501 + + :param uuid: Id of service-interface-point + :type uuid: str + :param body: tapi.common.ServiceInterfacePoint to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonServiceInterfacePointWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get(uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of service-interface-point + :type uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get(uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of service-interface-point + :type uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_bandwidth_profile_get(uuid): # noqa: E501 + """returns tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of service-interface-point + :type uuid: str + + :rtype: TapiCommonBandwidthProfileWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get(uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of service-interface-point + :type uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get(uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of service-interface-point + :type uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_get(uuid): # noqa: E501 + """returns tapi.common.Capacity + + An optimistic view of the capacity of the TopologicalEntity assuming that any shared capacity is available to be taken. # noqa: E501 + + :param uuid: Id of service-interface-point + :type uuid: str + + :rtype: TapiCommonCapacityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_total_size_get(uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of service-interface-point + :type uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def operations_tapi_commonget_service_interface_point_details_post(body=None): # noqa: E501 + """operates on tapi.common.GetServiceInterfacePointDetails + + operates on tapi.common.GetServiceInterfacePointDetails # noqa: E501 + + :param body: + :type body: dict | bytes + + :rtype: TapiCommonGetServiceInterfacePointDetails + """ + if connexion.request.is_json: + body = OperationsTapicommongetserviceinterfacepointdetailsBody.from_dict(connexion.request.get_json()) # noqa: E501 + return TapiCommonGetServiceInterfacePointDetails(TapiCommonGetserviceinterfacepointdetailsOutput( + database.service_interface_point(body.input.sip_id_or_name))) + + +def operations_tapi_commonget_service_interface_point_list_post(): # noqa: E501 + """operations_tapi_commonget_service_interface_point_list_post + + # noqa: E501 + + + :rtype: TapiCommonGetServiceInterfacePointList + """ + return TapiCommonGetServiceInterfacePointList(TapiCommonGetserviceinterfacepointlistOutput( + database.service_interface_point_list())) + + +def operations_tapi_commonupdate_service_interface_point_post(body=None): # noqa: E501 + """operates on tapi.common.UpdateServiceInterfacePoint + + operates on tapi.common.UpdateServiceInterfacePoint # noqa: E501 + + :param body: + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = OperationsTapicommonupdateserviceinterfacepointBody.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' diff --git a/hackfest/tapi/server/tapi_server/controllers/tapi_connectivity_controller.py b/hackfest/tapi/server/tapi_server/controllers/tapi_connectivity_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..dc0118b7ac437c6fb151ff7326bda7b29a2ec26b --- /dev/null +++ b/hackfest/tapi/server/tapi_server/controllers/tapi_connectivity_controller.py @@ -0,0 +1,2886 @@ +import connexion +import six + +from tapi_server.models.operations_tapiconnectivitycreateconnectivityservice_body import OperationsTapiconnectivitycreateconnectivityserviceBody # noqa: E501 +from tapi_server.models.operations_tapiconnectivitydeleteconnectivityservice_body import OperationsTapiconnectivitydeleteconnectivityserviceBody # noqa: E501 +from tapi_server.models.operations_tapiconnectivitygetconnectiondetails_body import OperationsTapiconnectivitygetconnectiondetailsBody # noqa: E501 +from tapi_server.models.operations_tapiconnectivitygetconnectionendpointdetails_body import OperationsTapiconnectivitygetconnectionendpointdetailsBody # noqa: E501 +from tapi_server.models.operations_tapiconnectivitygetconnectivityservicedetails_body import OperationsTapiconnectivitygetconnectivityservicedetailsBody # noqa: E501 +from tapi_server.models.operations_tapiconnectivityupdateconnectivityservice_body import OperationsTapiconnectivityupdateconnectivityserviceBody # noqa: E501 +from tapi_server.models.tapi_common_bandwidth_profile_wrapper import TapiCommonBandwidthProfileWrapper # noqa: E501 +from tapi_server.models.tapi_common_capacity_value_wrapper import TapiCommonCapacityValueWrapper # noqa: E501 +from tapi_server.models.tapi_common_capacity_wrapper import TapiCommonCapacityWrapper # noqa: E501 +from tapi_server.models.tapi_common_name_and_value_wrapper import TapiCommonNameAndValueWrapper # noqa: E501 +from tapi_server.models.tapi_common_service_interface_point_ref_wrapper import TapiCommonServiceInterfacePointRefWrapper # noqa: E501 +from tapi_server.models.tapi_common_time_range_wrapper import TapiCommonTimeRangeWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_cep_list_wrapper import TapiConnectivityCepListWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_cep_role_wrapper import TapiConnectivityCepRoleWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_connection_end_point_ref_wrapper import TapiConnectivityConnectionEndPointRefWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_connection_end_point_wrapper import TapiConnectivityConnectionEndPointWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_connection_ref_wrapper import TapiConnectivityConnectionRefWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_connection_spec_reference_wrapper import TapiConnectivityConnectionSpecReferenceWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_connection_wrapper import TapiConnectivityConnectionWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_connectivity_context_wrapper import TapiConnectivityConnectivityContextWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_connectivity_service_end_point_ref_wrapper import TapiConnectivityConnectivityServiceEndPointRefWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_connectivity_service_end_point_wrapper import TapiConnectivityConnectivityServiceEndPointWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_connectivity_service_ref_wrapper import TapiConnectivityConnectivityServiceRefWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_connectivity_service_wrapper import TapiConnectivityConnectivityServiceWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_create_connectivity_service import TapiConnectivityCreateConnectivityService # noqa: E501 +from tapi_server.models.tapi_connectivity_get_connection_details import TapiConnectivityGetConnectionDetails # noqa: E501 +from tapi_server.models.tapi_connectivity_get_connection_end_point_details import TapiConnectivityGetConnectionEndPointDetails # noqa: E501 +from tapi_server.models.tapi_connectivity_get_connectivity_service_details import TapiConnectivityGetConnectivityServiceDetails # noqa: E501 +from tapi_server.models.tapi_connectivity_get_connectivity_service_list import TapiConnectivityGetConnectivityServiceList # noqa: E501 +from tapi_server.models.tapi_connectivity_resilience_route_wrapper import TapiConnectivityResilienceRouteWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_route_ref_wrapper import TapiConnectivityRouteRefWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_route_wrapper import TapiConnectivityRouteWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_switch_control_ref_wrapper import TapiConnectivitySwitchControlRefWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_switch_control_wrapper import TapiConnectivitySwitchControlWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_switch_wrapper import TapiConnectivitySwitchWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_update_connectivity_service import TapiConnectivityUpdateConnectivityService # noqa: E501 +from tapi_server.models.tapi_path_computation_value_or_priority_wrapper import TapiPathComputationValueOrPriorityWrapper # noqa: E501 +from tapi_server.models.tapi_topology_cost_characteristic_wrapper import TapiTopologyCostCharacteristicWrapper # noqa: E501 +from tapi_server.models.tapi_topology_latency_characteristic_wrapper import TapiTopologyLatencyCharacteristicWrapper # noqa: E501 +from tapi_server.models.tapi_topology_link_ref_wrapper import TapiTopologyLinkRefWrapper # noqa: E501 +from tapi_server.models.tapi_topology_node_edge_point_ref_wrapper import TapiTopologyNodeEdgePointRefWrapper # noqa: E501 +from tapi_server.models.tapi_topology_resilience_type_wrapper import TapiTopologyResilienceTypeWrapper # noqa: E501 +from tapi_server.models.tapi_topology_risk_characteristic_wrapper import TapiTopologyRiskCharacteristicWrapper # noqa: E501 +from tapi_server import util + +from tapi_server.models.tapi_connectivity_connection import TapiConnectivityConnection +from tapi_server.models.tapi_connectivity_connection_end_point_ref import TapiConnectivityConnectionEndPointRef +from tapi_server.models.tapi_connectivity_connection_ref import TapiConnectivityConnectionRef +from tapi_server.models.tapi_connectivity_connectivity_context import TapiConnectivityConnectivityContext +from tapi_server.models.tapi_connectivity_getconnectiondetails_output import TapiConnectivityGetconnectiondetailsOutput +from tapi_server.models.tapi_connectivity_getconnectionendpointdetails_output import TapiConnectivityGetconnectionendpointdetailsOutput +from tapi_server.models.tapi_connectivity_getconnectivityservicedetails_output import TapiConnectivityGetconnectivityservicedetailsOutput +from tapi_server.models.tapi_connectivity_getconnectivityservicelist_output import TapiConnectivityGetconnectivityservicelistOutput +from tapi_server import database + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_connection_end_pointtopology_uuidnode_uuidnode_edge_point_uuidconnection_end_point_uuid_get(uuid, topology_uuid, node_uuid, node_edge_point_uuid, connection_end_point_uuid): # noqa: E501 + """returns tapi.connectivity.ConnectionEndPointRef + + none # noqa: E501 + + :param uuid: Id of connection + :type uuid: str + :param topology_uuid: Id of connection-end-point + :type topology_uuid: str + :param node_uuid: Id of connection-end-point + :type node_uuid: str + :param node_edge_point_uuid: Id of connection-end-point + :type node_edge_point_uuid: str + :param connection_end_point_uuid: Id of connection-end-point + :type connection_end_point_uuid: str + + :rtype: TapiConnectivityConnectionEndPointRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_connection_spec_reference_get(uuid): # noqa: E501 + """returns tapi.connectivity.ConnectionSpecReference + + Provides the reference to the spec that defines the connection type and cepRoles. # noqa: E501 + + :param uuid: Id of connection + :type uuid: str + + :rtype: TapiConnectivityConnectionSpecReferenceWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_get(uuid): # noqa: E501 + """returns tapi.connectivity.Connection + + none # noqa: E501 + + :param uuid: Id of connection + :type uuid: str + + :rtype: TapiConnectivityConnectionWrapper + """ + return database.connection(uuid) + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_lower_connectionconnection_uuid_get(uuid, connection_uuid): # noqa: E501 + """returns tapi.connectivity.ConnectionRef + + An Connection object supports a recursive aggregation relationship such that the internal construction of an Connection can be exposed as multiple lower level Connection objects (partitioning). Aggregation is used as for the Node/Topology to allow changes in hierarchy. Connection aggregation reflects Node/Topology aggregation. The FC represents a Cross-Connection in an NE. The Cross-Connection in an NE is not necessarily the lowest level of FC partitioning. # noqa: E501 + + :param uuid: Id of connection + :type uuid: str + :param connection_uuid: Id of lower-connection + :type connection_uuid: str + + :rtype: TapiConnectivityConnectionRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_namevalue_name_get(uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of connection + :type uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_routelocal_id_connection_end_pointtopology_uuidnode_uuidnode_edge_point_uuidconnection_end_point_uuid_get(uuid, local_id, topology_uuid, node_uuid, node_edge_point_uuid, connection_end_point_uuid): # noqa: E501 + """returns tapi.connectivity.ConnectionEndPointRef + + none # noqa: E501 + + :param uuid: Id of connection + :type uuid: str + :param local_id: Id of route + :type local_id: str + :param topology_uuid: Id of connection-end-point + :type topology_uuid: str + :param node_uuid: Id of connection-end-point + :type node_uuid: str + :param node_edge_point_uuid: Id of connection-end-point + :type node_edge_point_uuid: str + :param connection_end_point_uuid: Id of connection-end-point + :type connection_end_point_uuid: str + + :rtype: TapiConnectivityConnectionEndPointRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_routelocal_id_get(uuid, local_id): # noqa: E501 + """returns tapi.connectivity.Route + + none # noqa: E501 + + :param uuid: Id of connection + :type uuid: str + :param local_id: Id of route + :type local_id: str + + :rtype: TapiConnectivityRouteWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_routelocal_id_namevalue_name_get(uuid, local_id, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of connection + :type uuid: str + :param local_id: Id of route + :type local_id: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_routelocal_id_resilience_route_pac_get(uuid, local_id): # noqa: E501 + """returns tapi.connectivity.ResilienceRoute + + Provides optional resilience and state attributes to the Route. # noqa: E501 + + :param uuid: Id of connection + :type uuid: str + :param local_id: Id of route + :type local_id: str + + :rtype: TapiConnectivityResilienceRouteWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_routelocal_id_resilience_route_pac_namevalue_name_get(uuid, local_id, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of connection + :type uuid: str + :param local_id: Id of route + :type local_id: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_supported_client_linktopology_uuidlink_uuid_get(uuid, topology_uuid, link_uuid): # noqa: E501 + """returns tapi.topology.LinkRef + + none # noqa: E501 + + :param uuid: Id of connection + :type uuid: str + :param topology_uuid: Id of supported-client-link + :type topology_uuid: str + :param link_uuid: Id of supported-client-link + :type link_uuid: str + + :rtype: TapiTopologyLinkRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_get(uuid, switch_control_uuid): # noqa: E501 + """returns tapi.connectivity.SwitchControl + + none # noqa: E501 + + :param uuid: Id of connection + :type uuid: str + :param switch_control_uuid: Id of switch-control + :type switch_control_uuid: str + + :rtype: TapiConnectivitySwitchControlWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_namevalue_name_get(uuid, switch_control_uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of connection + :type uuid: str + :param switch_control_uuid: Id of switch-control + :type switch_control_uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_resilience_type_get(uuid, switch_control_uuid): # noqa: E501 + """returns tapi.topology.ResilienceType + + none # noqa: E501 + + :param uuid: Id of connection + :type uuid: str + :param switch_control_uuid: Id of switch-control + :type switch_control_uuid: str + + :rtype: TapiTopologyResilienceTypeWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_sub_switch_controlconnection_uuidsub_switch_control_switch_control_uuid_get(uuid, switch_control_uuid, connection_uuid, sub_switch_control_switch_control_uuid): # noqa: E501 + """returns tapi.connectivity.SwitchControlRef + + none # noqa: E501 + + :param uuid: Id of connection + :type uuid: str + :param switch_control_uuid: Id of switch-control + :type switch_control_uuid: str + :param connection_uuid: Id of sub-switch-control + :type connection_uuid: str + :param sub_switch_control_switch_control_uuid: Id of sub-switch-control + :type sub_switch_control_switch_control_uuid: str + + :rtype: TapiConnectivitySwitchControlRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_switchlocal_id_get(uuid, switch_control_uuid, local_id): # noqa: E501 + """returns tapi.connectivity.Switch + + none # noqa: E501 + + :param uuid: Id of connection + :type uuid: str + :param switch_control_uuid: Id of switch-control + :type switch_control_uuid: str + :param local_id: Id of switch + :type local_id: str + + :rtype: TapiConnectivitySwitchWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_switchlocal_id_namevalue_name_get(uuid, switch_control_uuid, local_id, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of connection + :type uuid: str + :param switch_control_uuid: Id of switch-control + :type switch_control_uuid: str + :param local_id: Id of switch + :type local_id: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_switchlocal_id_selected_connection_end_pointtopology_uuidnode_uuidnode_edge_point_uuidconnection_end_point_uuid_get(uuid, switch_control_uuid, local_id, topology_uuid, node_uuid, node_edge_point_uuid, connection_end_point_uuid): # noqa: E501 + """returns tapi.connectivity.ConnectionEndPointRef + + none # noqa: E501 + + :param uuid: Id of connection + :type uuid: str + :param switch_control_uuid: Id of switch-control + :type switch_control_uuid: str + :param local_id: Id of switch + :type local_id: str + :param topology_uuid: Id of selected-connection-end-point + :type topology_uuid: str + :param node_uuid: Id of selected-connection-end-point + :type node_uuid: str + :param node_edge_point_uuid: Id of selected-connection-end-point + :type node_edge_point_uuid: str + :param connection_end_point_uuid: Id of selected-connection-end-point + :type connection_end_point_uuid: str + + :rtype: TapiConnectivityConnectionEndPointRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_switchlocal_id_selected_routeconnection_uuidroute_local_id_get(uuid, switch_control_uuid, local_id, connection_uuid, route_local_id): # noqa: E501 + """returns tapi.connectivity.RouteRef + + none # noqa: E501 + + :param uuid: Id of connection + :type uuid: str + :param switch_control_uuid: Id of switch-control + :type switch_control_uuid: str + :param local_id: Id of switch + :type local_id: str + :param connection_uuid: Id of selected-route + :type connection_uuid: str + :param route_local_id: Id of selected-route + :type route_local_id: str + + :rtype: TapiConnectivityRouteRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_service_post(body=None): # noqa: E501 + """creates tapi.connectivity.ConnectivityService + + none # noqa: E501 + + :param body: tapi.connectivity.ConnectivityService to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + raw_body = connexion.request.get_json() + if "tapi-connectivity:connectivity-service" in raw_body: + raw_body["connectivity-service"] = raw_body.pop("tapi-connectivity:connectivity-service") + if isinstance(raw_body["connectivity-service"], list) and len(raw_body["connectivity-service"]) > 0: + raw_body["connectivity-service"] = raw_body["connectivity-service"][0] + body = TapiConnectivityConnectivityServiceWrapper.from_dict(raw_body) # noqa: E501 + + connection = TapiConnectivityConnection( + uuid=body.connectivity_service.uuid, + connection_end_point=[ + TapiConnectivityConnectionEndPointRef( + node_edge_point_uuid="node-1-port-3", connection_end_point_uuid="cep13"), + TapiConnectivityConnectionEndPointRef( + node_edge_point_uuid="node-3-port-2", connection_end_point_uuid="cep32"), + ] + ) + connection_ref = TapiConnectivityConnectionRef(connection.uuid) + body.connectivity_service.connection = [ connection_ref ] + + if database.context.connectivity_context is None: + database.context.connectivity_context = TapiConnectivityConnectivityContext( + connectivity_service=[], connection=[] + ) + + database.context.connectivity_context.connection.append(connection) + database.context.connectivity_context.connectivity_service.append(body.connectivity_service) + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_connectionconnection_uuid_get(uuid, connection_uuid): # noqa: E501 + """returns tapi.connectivity.ConnectionRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param connection_uuid: Id of connection + :type connection_uuid: str + + :rtype: TapiConnectivityConnectionRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_coroute_inclusion_delete(uuid): # noqa: E501 + """removes tapi.connectivity.ConnectivityServiceRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_coroute_inclusion_get(uuid): # noqa: E501 + """returns tapi.connectivity.ConnectivityServiceRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: TapiConnectivityConnectivityServiceRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_coroute_inclusion_post(uuid, body=None): # noqa: E501 + """creates tapi.connectivity.ConnectivityServiceRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.connectivity.ConnectivityServiceRef to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiConnectivityConnectivityServiceRefWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_coroute_inclusion_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.connectivity.ConnectivityServiceRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.connectivity.ConnectivityServiceRef to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiConnectivityConnectivityServiceRefWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_cost_characteristic_post(uuid, body=None): # noqa: E501 + """creates tapi.topology.CostCharacteristic + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.topology.CostCharacteristic to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiTopologyCostCharacteristicWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_cost_characteristiccost_name_delete(uuid, cost_name): # noqa: E501 + """removes tapi.topology.CostCharacteristic + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param cost_name: Id of cost-characteristic + :type cost_name: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_cost_characteristiccost_name_get(uuid, cost_name): # noqa: E501 + """returns tapi.topology.CostCharacteristic + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param cost_name: Id of cost-characteristic + :type cost_name: str + + :rtype: TapiTopologyCostCharacteristicWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_cost_characteristiccost_name_put(uuid, cost_name, body=None): # noqa: E501 + """creates or updates tapi.topology.CostCharacteristic + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param cost_name: Id of cost-characteristic + :type cost_name: str + :param body: tapi.topology.CostCharacteristic to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiTopologyCostCharacteristicWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_delete(uuid): # noqa: E501 + """removes tapi.connectivity.ConnectivityService + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: None + """ + if database.context.connectivity_context is None: + database.context.connectivity_context = TapiConnectivityConnectivityContext( + connectivity_service=[], connection=[] + ) + + database.context.connectivity_context.connectivity_service = [ + connectivity_service + for connectivity_service in database.context.connectivity_context.connectivity_service + if connectivity_service.uuid != uuid # keep items with different uuid + ] + database.context.connectivity_context.connection = [ + connection + for connection in database.context.connectivity_context.connection + if connection.uuid != uuid # keep items with different uuid + ] + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_diversity_exclusion_post(uuid, body=None): # noqa: E501 + """creates tapi.connectivity.ConnectivityServiceRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.connectivity.ConnectivityServiceRef to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiConnectivityConnectivityServiceRefWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_diversity_exclusionconnectivity_service_uuid_delete(uuid, connectivity_service_uuid): # noqa: E501 + """removes tapi.connectivity.ConnectivityServiceRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param connectivity_service_uuid: Id of diversity-exclusion + :type connectivity_service_uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_diversity_exclusionconnectivity_service_uuid_get(uuid, connectivity_service_uuid): # noqa: E501 + """returns tapi.connectivity.ConnectivityServiceRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param connectivity_service_uuid: Id of diversity-exclusion + :type connectivity_service_uuid: str + + :rtype: TapiConnectivityConnectivityServiceRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_diversity_exclusionconnectivity_service_uuid_put(uuid, connectivity_service_uuid, body=None): # noqa: E501 + """creates or updates tapi.connectivity.ConnectivityServiceRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param connectivity_service_uuid: Id of diversity-exclusion + :type connectivity_service_uuid: str + :param body: tapi.connectivity.ConnectivityServiceRef to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiConnectivityConnectivityServiceRefWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_point_post(uuid, body=None): # noqa: E501 + """creates tapi.connectivity.ConnectivityServiceEndPoint + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.connectivity.ConnectivityServiceEndPoint to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiConnectivityConnectivityServiceEndPointWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_delete(uuid, local_id): # noqa: E501 + """removes tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_get(uuid, local_id): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_post(uuid, local_id, body=None): # noqa: E501 + """creates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.CapacityValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_put(uuid, local_id, body=None): # noqa: E501 + """creates or updates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.CapacityValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_delete(uuid, local_id): # noqa: E501 + """removes tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_get(uuid, local_id): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_post(uuid, local_id, body=None): # noqa: E501 + """creates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.CapacityValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_put(uuid, local_id, body=None): # noqa: E501 + """creates or updates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.CapacityValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_delete(uuid, local_id): # noqa: E501 + """removes tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_get(uuid, local_id): # noqa: E501 + """returns tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: TapiCommonBandwidthProfileWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_delete(uuid, local_id): # noqa: E501 + """removes tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_get(uuid, local_id): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_post(uuid, local_id, body=None): # noqa: E501 + """creates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.CapacityValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_put(uuid, local_id, body=None): # noqa: E501 + """creates or updates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.CapacityValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_delete(uuid, local_id): # noqa: E501 + """removes tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_get(uuid, local_id): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_post(uuid, local_id, body=None): # noqa: E501 + """creates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.CapacityValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_put(uuid, local_id, body=None): # noqa: E501 + """creates or updates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.CapacityValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_post(uuid, local_id, body=None): # noqa: E501 + """creates tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.BandwidthProfile to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonBandwidthProfileWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_put(uuid, local_id, body=None): # noqa: E501 + """creates or updates tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.BandwidthProfile to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonBandwidthProfileWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_delete(uuid, local_id): # noqa: E501 + """removes tapi.common.Capacity + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_get(uuid, local_id): # noqa: E501 + """returns tapi.common.Capacity + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: TapiCommonCapacityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_post(uuid, local_id, body=None): # noqa: E501 + """creates tapi.common.Capacity + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.Capacity to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_put(uuid, local_id, body=None): # noqa: E501 + """creates or updates tapi.common.Capacity + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.Capacity to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_total_size_delete(uuid, local_id): # noqa: E501 + """removes tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_total_size_get(uuid, local_id): # noqa: E501 + """returns tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_total_size_post(uuid, local_id, body=None): # noqa: E501 + """creates tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.CapacityValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_total_size_put(uuid, local_id, body=None): # noqa: E501 + """creates or updates tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.CapacityValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_connection_end_pointtopology_uuidnode_uuidnode_edge_point_uuidconnection_end_point_uuid_get(uuid, local_id, topology_uuid, node_uuid, node_edge_point_uuid, connection_end_point_uuid): # noqa: E501 + """returns tapi.connectivity.ConnectionEndPointRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param topology_uuid: Id of connection-end-point + :type topology_uuid: str + :param node_uuid: Id of connection-end-point + :type node_uuid: str + :param node_edge_point_uuid: Id of connection-end-point + :type node_edge_point_uuid: str + :param connection_end_point_uuid: Id of connection-end-point + :type connection_end_point_uuid: str + + :rtype: TapiConnectivityConnectionEndPointRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_delete(uuid, local_id): # noqa: E501 + """removes tapi.connectivity.ConnectivityServiceEndPoint + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_get(uuid, local_id): # noqa: E501 + """returns tapi.connectivity.ConnectivityServiceEndPoint + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: TapiConnectivityConnectivityServiceEndPointWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_name_post(uuid, local_id, body=None): # noqa: E501 + """creates tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.NameAndValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonNameAndValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_namevalue_name_delete(uuid, local_id, value_name): # noqa: E501 + """removes tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param value_name: Id of name + :type value_name: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_namevalue_name_get(uuid, local_id, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_namevalue_name_put(uuid, local_id, value_name, body=None): # noqa: E501 + """creates or updates tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param value_name: Id of name + :type value_name: str + :param body: tapi.common.NameAndValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonNameAndValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_peer_fwd_connectivity_service_end_point_delete(uuid, local_id): # noqa: E501 + """removes tapi.connectivity.ConnectivityServiceEndPointRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_peer_fwd_connectivity_service_end_point_get(uuid, local_id): # noqa: E501 + """returns tapi.connectivity.ConnectivityServiceEndPointRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: TapiConnectivityConnectivityServiceEndPointRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_peer_fwd_connectivity_service_end_point_post(uuid, local_id, body=None): # noqa: E501 + """creates tapi.connectivity.ConnectivityServiceEndPointRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.connectivity.ConnectivityServiceEndPointRef to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiConnectivityConnectivityServiceEndPointRefWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_peer_fwd_connectivity_service_end_point_put(uuid, local_id, body=None): # noqa: E501 + """creates or updates tapi.connectivity.ConnectivityServiceEndPointRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.connectivity.ConnectivityServiceEndPointRef to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiConnectivityConnectivityServiceEndPointRefWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_protecting_connectivity_service_end_point_delete(uuid, local_id): # noqa: E501 + """removes tapi.connectivity.ConnectivityServiceEndPointRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_protecting_connectivity_service_end_point_get(uuid, local_id): # noqa: E501 + """returns tapi.connectivity.ConnectivityServiceEndPointRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: TapiConnectivityConnectivityServiceEndPointRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_protecting_connectivity_service_end_point_post(uuid, local_id, body=None): # noqa: E501 + """creates tapi.connectivity.ConnectivityServiceEndPointRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.connectivity.ConnectivityServiceEndPointRef to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiConnectivityConnectivityServiceEndPointRefWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_protecting_connectivity_service_end_point_put(uuid, local_id, body=None): # noqa: E501 + """creates or updates tapi.connectivity.ConnectivityServiceEndPointRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.connectivity.ConnectivityServiceEndPointRef to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiConnectivityConnectivityServiceEndPointRefWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_put(uuid, local_id, body=None): # noqa: E501 + """creates or updates tapi.connectivity.ConnectivityServiceEndPoint + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.connectivity.ConnectivityServiceEndPoint to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiConnectivityConnectivityServiceEndPointWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_server_connectivity_service_end_point_delete(uuid, local_id): # noqa: E501 + """removes tapi.connectivity.ConnectivityServiceEndPointRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_server_connectivity_service_end_point_get(uuid, local_id): # noqa: E501 + """returns tapi.connectivity.ConnectivityServiceEndPointRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: TapiConnectivityConnectivityServiceEndPointRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_server_connectivity_service_end_point_post(uuid, local_id, body=None): # noqa: E501 + """creates tapi.connectivity.ConnectivityServiceEndPointRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.connectivity.ConnectivityServiceEndPointRef to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiConnectivityConnectivityServiceEndPointRefWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_server_connectivity_service_end_point_put(uuid, local_id, body=None): # noqa: E501 + """creates or updates tapi.connectivity.ConnectivityServiceEndPointRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.connectivity.ConnectivityServiceEndPointRef to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiConnectivityConnectivityServiceEndPointRefWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_service_interface_point_delete(uuid, local_id): # noqa: E501 + """removes tapi.common.ServiceInterfacePointRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_service_interface_point_get(uuid, local_id): # noqa: E501 + """returns tapi.common.ServiceInterfacePointRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: TapiCommonServiceInterfacePointRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_service_interface_point_post(uuid, local_id, body=None): # noqa: E501 + """creates tapi.common.ServiceInterfacePointRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.ServiceInterfacePointRef to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonServiceInterfacePointRefWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_service_interface_point_put(uuid, local_id, body=None): # noqa: E501 + """creates or updates tapi.common.ServiceInterfacePointRef + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.ServiceInterfacePointRef to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonServiceInterfacePointRefWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_get(uuid): # noqa: E501 + """returns tapi.connectivity.ConnectivityService + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: TapiConnectivityConnectivityServiceWrapper + """ + if database.context.connectivity_context is None: + database.context.connectivity_context = TapiConnectivityConnectivityContext( + connectivity_service=[], connection=[] + ) + return database.connectivity_service(uuid) + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_latency_characteristic_post(uuid, body=None): # noqa: E501 + """creates tapi.topology.LatencyCharacteristic + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.topology.LatencyCharacteristic to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiTopologyLatencyCharacteristicWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_latency_characteristictraffic_property_name_delete(uuid, traffic_property_name): # noqa: E501 + """removes tapi.topology.LatencyCharacteristic + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param traffic_property_name: Id of latency-characteristic + :type traffic_property_name: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_latency_characteristictraffic_property_name_get(uuid, traffic_property_name): # noqa: E501 + """returns tapi.topology.LatencyCharacteristic + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param traffic_property_name: Id of latency-characteristic + :type traffic_property_name: str + + :rtype: TapiTopologyLatencyCharacteristicWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_latency_characteristictraffic_property_name_put(uuid, traffic_property_name, body=None): # noqa: E501 + """creates or updates tapi.topology.LatencyCharacteristic + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param traffic_property_name: Id of latency-characteristic + :type traffic_property_name: str + :param body: tapi.topology.LatencyCharacteristic to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiTopologyLatencyCharacteristicWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_cost_delete(uuid): # noqa: E501 + """removes tapi.path.computation.ValueOrPriority + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_cost_get(uuid): # noqa: E501 + """returns tapi.path.computation.ValueOrPriority + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: TapiPathComputationValueOrPriorityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_cost_post(uuid, body=None): # noqa: E501 + """creates tapi.path.computation.ValueOrPriority + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.path.computation.ValueOrPriority to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationValueOrPriorityWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_cost_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.path.computation.ValueOrPriority + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.path.computation.ValueOrPriority to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationValueOrPriorityWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_delay_delete(uuid): # noqa: E501 + """removes tapi.path.computation.ValueOrPriority + + Delay unit is microseconds. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_delay_get(uuid): # noqa: E501 + """returns tapi.path.computation.ValueOrPriority + + Delay unit is microseconds. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: TapiPathComputationValueOrPriorityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_delay_post(uuid, body=None): # noqa: E501 + """creates tapi.path.computation.ValueOrPriority + + Delay unit is microseconds. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.path.computation.ValueOrPriority to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationValueOrPriorityWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_delay_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.path.computation.ValueOrPriority + + Delay unit is microseconds. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.path.computation.ValueOrPriority to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationValueOrPriorityWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_hops_delete(uuid): # noqa: E501 + """removes tapi.path.computation.ValueOrPriority + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_hops_get(uuid): # noqa: E501 + """returns tapi.path.computation.ValueOrPriority + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: TapiPathComputationValueOrPriorityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_hops_post(uuid, body=None): # noqa: E501 + """creates tapi.path.computation.ValueOrPriority + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.path.computation.ValueOrPriority to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationValueOrPriorityWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_hops_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.path.computation.ValueOrPriority + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.path.computation.ValueOrPriority to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationValueOrPriorityWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_name_post(uuid, body=None): # noqa: E501 + """creates tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.common.NameAndValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonNameAndValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_namevalue_name_delete(uuid, value_name): # noqa: E501 + """removes tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_namevalue_name_get(uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_namevalue_name_put(uuid, value_name, body=None): # noqa: E501 + """creates or updates tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param value_name: Id of name + :type value_name: str + :param body: tapi.common.NameAndValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonNameAndValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.connectivity.ConnectivityService + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.connectivity.ConnectivityService to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiConnectivityConnectivityServiceWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_burst_size_delete(uuid): # noqa: E501 + """removes tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_burst_size_get(uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_burst_size_post(uuid, body=None): # noqa: E501 + """creates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.common.CapacityValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_burst_size_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.common.CapacityValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_information_rate_delete(uuid): # noqa: E501 + """removes tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_information_rate_get(uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_information_rate_post(uuid, body=None): # noqa: E501 + """creates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.common.CapacityValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_information_rate_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.common.CapacityValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_delete(uuid): # noqa: E501 + """removes tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_get(uuid): # noqa: E501 + """returns tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: TapiCommonBandwidthProfileWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_burst_size_delete(uuid): # noqa: E501 + """removes tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_burst_size_get(uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_burst_size_post(uuid, body=None): # noqa: E501 + """creates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.common.CapacityValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_burst_size_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.common.CapacityValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_information_rate_delete(uuid): # noqa: E501 + """removes tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_information_rate_get(uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_information_rate_post(uuid, body=None): # noqa: E501 + """creates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.common.CapacityValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_information_rate_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.common.CapacityValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_post(uuid, body=None): # noqa: E501 + """creates tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.common.BandwidthProfile to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonBandwidthProfileWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.common.BandwidthProfile to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonBandwidthProfileWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_delete(uuid): # noqa: E501 + """removes tapi.common.Capacity + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_get(uuid): # noqa: E501 + """returns tapi.common.Capacity + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: TapiCommonCapacityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_post(uuid, body=None): # noqa: E501 + """creates tapi.common.Capacity + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.common.Capacity to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.common.Capacity + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.common.Capacity to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_total_size_delete(uuid): # noqa: E501 + """removes tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_total_size_get(uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_total_size_post(uuid, body=None): # noqa: E501 + """creates tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.common.CapacityValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_total_size_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.common.CapacityValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_resilience_type_delete(uuid): # noqa: E501 + """removes tapi.topology.ResilienceType + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_resilience_type_get(uuid): # noqa: E501 + """returns tapi.topology.ResilienceType + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: TapiTopologyResilienceTypeWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_resilience_type_post(uuid, body=None): # noqa: E501 + """creates tapi.topology.ResilienceType + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.topology.ResilienceType to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiTopologyResilienceTypeWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_resilience_type_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.topology.ResilienceType + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.topology.ResilienceType to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiTopologyResilienceTypeWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_risk_diversity_characteristic_post(uuid, body=None): # noqa: E501 + """creates tapi.topology.RiskCharacteristic + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.topology.RiskCharacteristic to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiTopologyRiskCharacteristicWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_risk_diversity_characteristicrisk_characteristic_name_delete(uuid, risk_characteristic_name): # noqa: E501 + """removes tapi.topology.RiskCharacteristic + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param risk_characteristic_name: Id of risk-diversity-characteristic + :type risk_characteristic_name: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_risk_diversity_characteristicrisk_characteristic_name_get(uuid, risk_characteristic_name): # noqa: E501 + """returns tapi.topology.RiskCharacteristic + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param risk_characteristic_name: Id of risk-diversity-characteristic + :type risk_characteristic_name: str + + :rtype: TapiTopologyRiskCharacteristicWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_risk_diversity_characteristicrisk_characteristic_name_put(uuid, risk_characteristic_name, body=None): # noqa: E501 + """creates or updates tapi.topology.RiskCharacteristic + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param risk_characteristic_name: Id of risk-diversity-characteristic + :type risk_characteristic_name: str + :param body: tapi.topology.RiskCharacteristic to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiTopologyRiskCharacteristicWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_schedule_delete(uuid): # noqa: E501 + """removes tapi.common.TimeRange + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_schedule_get(uuid): # noqa: E501 + """returns tapi.common.TimeRange + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + + :rtype: TapiCommonTimeRangeWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_schedule_post(uuid, body=None): # noqa: E501 + """creates tapi.common.TimeRange + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.common.TimeRange to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonTimeRangeWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_schedule_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.common.TimeRange + + none # noqa: E501 + + :param uuid: Id of connectivity-service + :type uuid: str + :param body: tapi.common.TimeRange to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonTimeRangeWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_delete(): # noqa: E501 + """removes tapi.connectivity.ConnectivityContext + + Augments the base TAPI Context with ConnectivityService information # noqa: E501 + + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_get(): # noqa: E501 + """returns tapi.connectivity.ConnectivityContext + + Augments the base TAPI Context with ConnectivityService information # noqa: E501 + + + :rtype: TapiConnectivityConnectivityContextWrapper + """ + if database.context.connectivity_context is None: + database.context.connectivity_context = TapiConnectivityConnectivityContext( + connectivity_service=[], connection=[] + ) + return database.connectivity_context() + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_post(body=None): # noqa: E501 + """creates tapi.connectivity.ConnectivityContext + + Augments the base TAPI Context with ConnectivityService information # noqa: E501 + + :param body: tapi.connectivity.ConnectivityContext to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + #body = TapiConnectivityConnectivityContextWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + raw_body = connexion.request.get_json() + if "tapi-connectivity:connectivity-service" in raw_body: + raw_body["connectivity-service"] = raw_body.pop("tapi-connectivity:connectivity-service") + if isinstance(raw_body["connectivity-service"], list) and len(raw_body["connectivity-service"]) > 0: + raw_body["connectivity-service"] = raw_body["connectivity-service"][0] + + connectivity_service = raw_body["connectivity-service"] + if "connectivity-constraint" in connectivity_service: + connectivity_constraint = connectivity_service.pop("connectivity-constraint") + if "requested-capacity" in connectivity_constraint: + connectivity_service["requested-capacity"] = connectivity_constraint.pop("requested-capacity") + if "connectivity-direction" in connectivity_constraint: + connectivity_service["connectivity-direction"] = connectivity_constraint.pop("connectivity-direction") + + body = TapiConnectivityConnectivityServiceWrapper.from_dict(raw_body) # noqa: E501 + + connection = TapiConnectivityConnection( + uuid=body.connectivity_service.uuid, + connection_end_point=[ + TapiConnectivityConnectionEndPointRef( + node_edge_point_uuid="node-1-port-3", connection_end_point_uuid="cep13"), + TapiConnectivityConnectionEndPointRef( + node_edge_point_uuid="node-3-port-2", connection_end_point_uuid="cep32"), + ] + ) + connection_ref = TapiConnectivityConnectionRef(connection.uuid) + body.connectivity_service.connection = [ connection_ref ] + + if database.context.connectivity_context is None: + database.context.connectivity_context = TapiConnectivityConnectivityContext( + connectivity_service=[], connection=[] + ) + + database.context.connectivity_context.connection.append(connection) + database.context.connectivity_context.connectivity_service.append(body.connectivity_service) + + +def data_tapi_commoncontext_tapi_connectivityconnectivity_context_put(body=None): # noqa: E501 + """creates or updates tapi.connectivity.ConnectivityContext + + Augments the base TAPI Context with ConnectivityService information # noqa: E501 + + :param body: tapi.connectivity.ConnectivityContext to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiConnectivityConnectivityContextWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_aggregated_connection_end_pointtopology_uuidaggregated_connection_end_point_node_uuidnode_edge_point_uuidaggregated_connection_end_point_connection_end_point_uuid_get(uuid, node_uuid, owned_node_edge_point_uuid, connection_end_point_uuid, topology_uuid, aggregated_connection_end_point_node_uuid, node_edge_point_uuid, aggregated_connection_end_point_connection_end_point_uuid): # noqa: E501 + """returns tapi.connectivity.ConnectionEndPointRef + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + :param connection_end_point_uuid: Id of connection-end-point + :type connection_end_point_uuid: str + :param topology_uuid: Id of aggregated-connection-end-point + :type topology_uuid: str + :param aggregated_connection_end_point_node_uuid: Id of aggregated-connection-end-point + :type aggregated_connection_end_point_node_uuid: str + :param node_edge_point_uuid: Id of aggregated-connection-end-point + :type node_edge_point_uuid: str + :param aggregated_connection_end_point_connection_end_point_uuid: Id of aggregated-connection-end-point + :type aggregated_connection_end_point_connection_end_point_uuid: str + + :rtype: TapiConnectivityConnectionEndPointRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_cep_role_connection_spec_reference_get(uuid, node_uuid, owned_node_edge_point_uuid, connection_end_point_uuid): # noqa: E501 + """returns tapi.connectivity.ConnectionSpecReference + + The reference to the spec that defines the cep role. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + :param connection_end_point_uuid: Id of connection-end-point + :type connection_end_point_uuid: str + + :rtype: TapiConnectivityConnectionSpecReferenceWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_cep_role_get(uuid, node_uuid, owned_node_edge_point_uuid, connection_end_point_uuid): # noqa: E501 + """returns tapi.connectivity.CepRole + + Defines the role of the CEP in the context of the connection spec. There may be many cep role - connection spec combinations for a particular CEP where each corresponds to a specific connection associated with the CEP. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + :param connection_end_point_uuid: Id of connection-end-point + :type connection_end_point_uuid: str + + :rtype: TapiConnectivityCepRoleWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_client_node_edge_pointtopology_uuidclient_node_edge_point_node_uuidnode_edge_point_uuid_get(uuid, node_uuid, owned_node_edge_point_uuid, connection_end_point_uuid, topology_uuid, client_node_edge_point_node_uuid, node_edge_point_uuid): # noqa: E501 + """returns tapi.topology.NodeEdgePointRef + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + :param connection_end_point_uuid: Id of connection-end-point + :type connection_end_point_uuid: str + :param topology_uuid: Id of client-node-edge-point + :type topology_uuid: str + :param client_node_edge_point_node_uuid: Id of client-node-edge-point + :type client_node_edge_point_node_uuid: str + :param node_edge_point_uuid: Id of client-node-edge-point + :type node_edge_point_uuid: str + + :rtype: TapiTopologyNodeEdgePointRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_get(uuid, node_uuid, owned_node_edge_point_uuid, connection_end_point_uuid): # noqa: E501 + """returns tapi.connectivity.ConnectionEndPoint + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + :param connection_end_point_uuid: Id of connection-end-point + :type connection_end_point_uuid: str + + :rtype: TapiConnectivityConnectionEndPointWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_namevalue_name_get(uuid, node_uuid, owned_node_edge_point_uuid, connection_end_point_uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + :param connection_end_point_uuid: Id of connection-end-point + :type connection_end_point_uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_parent_node_edge_point_get(uuid, node_uuid, owned_node_edge_point_uuid, connection_end_point_uuid): # noqa: E501 + """returns tapi.topology.NodeEdgePointRef + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + :param connection_end_point_uuid: Id of connection-end-point + :type connection_end_point_uuid: str + + :rtype: TapiTopologyNodeEdgePointRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_get(uuid, node_uuid, owned_node_edge_point_uuid): # noqa: E501 + """returns tapi.connectivity.CepList + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + + :rtype: TapiConnectivityCepListWrapper + """ + return database.connection_end_point_list(uuid, node_uuid, owned_node_edge_point_uuid) + + +def operations_tapi_connectivitycreate_connectivity_service_post(body=None): # noqa: E501 + """operates on tapi.connectivity.CreateConnectivityService + + operates on tapi.connectivity.CreateConnectivityService # noqa: E501 + + :param body: + :type body: dict | bytes + + :rtype: TapiConnectivityCreateConnectivityService + """ + if connexion.request.is_json: + body = OperationsTapiconnectivitycreateconnectivityserviceBody.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def operations_tapi_connectivitydelete_connectivity_service_post(body=None): # noqa: E501 + """operates on tapi.connectivity.DeleteConnectivityService + + operates on tapi.connectivity.DeleteConnectivityService # noqa: E501 + + :param body: + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = OperationsTapiconnectivitydeleteconnectivityserviceBody.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def operations_tapi_connectivityget_connection_details_post(body=None): # noqa: E501 + """operates on tapi.connectivity.GetConnectionDetails + + operates on tapi.connectivity.GetConnectionDetails # noqa: E501 + + :param body: + :type body: dict | bytes + + :rtype: TapiConnectivityGetConnectionDetails + """ + if connexion.request.is_json: + body = OperationsTapiconnectivitygetconnectiondetailsBody.from_dict(connexion.request.get_json()) # noqa: E501 + return TapiConnectivityGetConnectionDetails(TapiConnectivityGetconnectiondetailsOutput( + database.connection(body.input.connection_id_or_name))) + + +def operations_tapi_connectivityget_connection_end_point_details_post(body=None): # noqa: E501 + """operates on tapi.connectivity.GetConnectionEndPointDetails + + operates on tapi.connectivity.GetConnectionEndPointDetails # noqa: E501 + + :param body: + :type body: dict | bytes + + :rtype: TapiConnectivityGetConnectionEndPointDetails + """ + if connexion.request.is_json: + body = OperationsTapiconnectivitygetconnectionendpointdetailsBody.from_dict(connexion.request.get_json()) # noqa: E501 + return TapiConnectivityGetConnectionEndPointDetails(TapiConnectivityGetconnectionendpointdetailsOutput( + database.connection_end_point(body.input.topology_id_or_name, + body.input.node_id_or_name, + body.input.nep_id_or_name, + body.input.cep_id_or_name))) + + +def operations_tapi_connectivityget_connectivity_service_details_post(body=None): # noqa: E501 + """operates on tapi.connectivity.GetConnectivityServiceDetails + + operates on tapi.connectivity.GetConnectivityServiceDetails # noqa: E501 + + :param body: + :type body: dict | bytes + + :rtype: TapiConnectivityGetConnectivityServiceDetails + """ + if connexion.request.is_json: + body = OperationsTapiconnectivitygetconnectivityservicedetailsBody.from_dict(connexion.request.get_json()) # noqa: E501 + return TapiConnectivityGetConnectivityServiceDetails(TapiConnectivityGetconnectivityservicedetailsOutput( + database.connectivity_service(body.input.service_id_or_name))) + + +def operations_tapi_connectivityget_connectivity_service_list_post(): # noqa: E501 + """operations_tapi_connectivityget_connectivity_service_list_post + + # noqa: E501 + + + :rtype: TapiConnectivityGetConnectivityServiceList + """ + return TapiConnectivityGetConnectivityServiceList(TapiConnectivityGetconnectivityservicelistOutput( + database.connectivity_service_list())) + + +def operations_tapi_connectivityupdate_connectivity_service_post(body=None): # noqa: E501 + """operates on tapi.connectivity.UpdateConnectivityService + + operates on tapi.connectivity.UpdateConnectivityService # noqa: E501 + + :param body: + :type body: dict | bytes + + :rtype: TapiConnectivityUpdateConnectivityService + """ + if connexion.request.is_json: + body = OperationsTapiconnectivityupdateconnectivityserviceBody.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' diff --git a/hackfest/tapi/server/tapi_server/controllers/tapi_notification_controller.py b/hackfest/tapi/server/tapi_server/controllers/tapi_notification_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..efb0dfd3ed866bec279be72b8e4774b78b332081 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/controllers/tapi_notification_controller.py @@ -0,0 +1,664 @@ +import connexion +import six + +from tapi_server.models.operations_tapinotificationcreatenotificationsubscriptionservice_body import OperationsTapinotificationcreatenotificationsubscriptionserviceBody # noqa: E501 +from tapi_server.models.operations_tapinotificationdeletenotificationsubscriptionservice_body import OperationsTapinotificationdeletenotificationsubscriptionserviceBody # noqa: E501 +from tapi_server.models.operations_tapinotificationgetnotificationlist_body import OperationsTapinotificationgetnotificationlistBody # noqa: E501 +from tapi_server.models.operations_tapinotificationgetnotificationsubscriptionservicedetails_body import OperationsTapinotificationgetnotificationsubscriptionservicedetailsBody # noqa: E501 +from tapi_server.models.operations_tapinotificationupdatenotificationsubscriptionservice_body import OperationsTapinotificationupdatenotificationsubscriptionserviceBody # noqa: E501 +from tapi_server.models.tapi_common_name_and_value_wrapper import TapiCommonNameAndValueWrapper # noqa: E501 +from tapi_server.models.tapi_notification_alarm_info_wrapper import TapiNotificationAlarmInfoWrapper # noqa: E501 +from tapi_server.models.tapi_notification_create_notification_subscription_service import TapiNotificationCreateNotificationSubscriptionService # noqa: E501 +from tapi_server.models.tapi_notification_delete_notification_subscription_service import TapiNotificationDeleteNotificationSubscriptionService # noqa: E501 +from tapi_server.models.tapi_notification_get_notification_list import TapiNotificationGetNotificationList # noqa: E501 +from tapi_server.models.tapi_notification_get_notification_subscription_service_details import TapiNotificationGetNotificationSubscriptionServiceDetails # noqa: E501 +from tapi_server.models.tapi_notification_get_notification_subscription_service_list import TapiNotificationGetNotificationSubscriptionServiceList # noqa: E501 +from tapi_server.models.tapi_notification_get_supported_notification_types import TapiNotificationGetSupportedNotificationTypes # noqa: E501 +from tapi_server.models.tapi_notification_name_and_value_change_wrapper import TapiNotificationNameAndValueChangeWrapper # noqa: E501 +from tapi_server.models.tapi_notification_notification_channel_wrapper import TapiNotificationNotificationChannelWrapper # noqa: E501 +from tapi_server.models.tapi_notification_notification_context_wrapper import TapiNotificationNotificationContextWrapper # noqa: E501 +from tapi_server.models.tapi_notification_notification_subscription_service_wrapper import TapiNotificationNotificationSubscriptionServiceWrapper # noqa: E501 +from tapi_server.models.tapi_notification_notification_wrapper import TapiNotificationNotificationWrapper # noqa: E501 +from tapi_server.models.tapi_notification_subscription_filter_wrapper import TapiNotificationSubscriptionFilterWrapper # noqa: E501 +from tapi_server.models.tapi_notification_tca_info_wrapper import TapiNotificationTcaInfoWrapper # noqa: E501 +from tapi_server.models.tapi_notification_update_notification_subscription_service import TapiNotificationUpdateNotificationSubscriptionService # noqa: E501 +from tapi_server import util + + +def data_tapi_commoncontext_tapi_notificationnotification_context_delete(): # noqa: E501 + """removes tapi.notification.NotificationContext + + Augments the base TAPI Context with NotificationService information # noqa: E501 + + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_get(): # noqa: E501 + """returns tapi.notification.NotificationContext + + Augments the base TAPI Context with NotificationService information # noqa: E501 + + + :rtype: TapiNotificationNotificationContextWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscription_post(body=None): # noqa: E501 + """creates tapi.notification.NotificationSubscriptionService + + none # noqa: E501 + + :param body: tapi.notification.NotificationSubscriptionService to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiNotificationNotificationSubscriptionServiceWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_delete(uuid): # noqa: E501 + """removes tapi.notification.NotificationSubscriptionService + + none # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_get(uuid): # noqa: E501 + """returns tapi.notification.NotificationSubscriptionService + + none # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + + :rtype: TapiNotificationNotificationSubscriptionServiceWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_name_post(uuid, body=None): # noqa: E501 + """creates tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + :param body: tapi.common.NameAndValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonNameAndValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_namevalue_name_delete(uuid, value_name): # noqa: E501 + """removes tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_namevalue_name_get(uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_namevalue_name_put(uuid, value_name, body=None): # noqa: E501 + """creates or updates tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + :param value_name: Id of name + :type value_name: str + :param body: tapi.common.NameAndValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonNameAndValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notification_channel_get(uuid): # noqa: E501 + """returns tapi.notification.NotificationChannel + + none # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + + :rtype: TapiNotificationNotificationChannelWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notification_channel_namevalue_name_get(uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_additional_infovalue_name_get(uuid, notification_uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + none # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + :param notification_uuid: Id of notification + :type notification_uuid: str + :param value_name: Id of additional-info + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_alarm_info_get(uuid, notification_uuid): # noqa: E501 + """returns tapi.notification.AlarmInfo + + none # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + :param notification_uuid: Id of notification + :type notification_uuid: str + + :rtype: TapiNotificationAlarmInfoWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_changed_attributesvalue_name_get(uuid, notification_uuid, value_name): # noqa: E501 + """returns tapi.notification.NameAndValueChange + + none # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + :param notification_uuid: Id of notification + :type notification_uuid: str + :param value_name: Id of changed-attributes + :type value_name: str + + :rtype: TapiNotificationNameAndValueChangeWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_get(uuid, notification_uuid): # noqa: E501 + """returns tapi.notification.Notification + + none # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + :param notification_uuid: Id of notification + :type notification_uuid: str + + :rtype: TapiNotificationNotificationWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_namevalue_name_get(uuid, notification_uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + :param notification_uuid: Id of notification + :type notification_uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_target_object_namevalue_name_get(uuid, notification_uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + none # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + :param notification_uuid: Id of notification + :type notification_uuid: str + :param value_name: Id of target-object-name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_tca_info_get(uuid, notification_uuid): # noqa: E501 + """returns tapi.notification.TcaInfo + + none # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + :param notification_uuid: Id of notification + :type notification_uuid: str + + :rtype: TapiNotificationTcaInfoWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.notification.NotificationSubscriptionService + + none # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + :param body: tapi.notification.NotificationSubscriptionService to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiNotificationNotificationSubscriptionServiceWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_delete(uuid): # noqa: E501 + """removes tapi.notification.SubscriptionFilter + + none # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_get(uuid): # noqa: E501 + """returns tapi.notification.SubscriptionFilter + + none # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + + :rtype: TapiNotificationSubscriptionFilterWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_name_post(uuid, body=None): # noqa: E501 + """creates tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + :param body: tapi.common.NameAndValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonNameAndValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_namevalue_name_delete(uuid, value_name): # noqa: E501 + """removes tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_namevalue_name_get(uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_namevalue_name_put(uuid, value_name, body=None): # noqa: E501 + """creates or updates tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + :param value_name: Id of name + :type value_name: str + :param body: tapi.common.NameAndValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonNameAndValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_post(uuid, body=None): # noqa: E501 + """creates tapi.notification.SubscriptionFilter + + none # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + :param body: tapi.notification.SubscriptionFilter to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiNotificationSubscriptionFilterWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.notification.SubscriptionFilter + + none # noqa: E501 + + :param uuid: Id of notif-subscription + :type uuid: str + :param body: tapi.notification.SubscriptionFilter to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiNotificationSubscriptionFilterWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_additional_infovalue_name_get(uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + none # noqa: E501 + + :param uuid: Id of notification + :type uuid: str + :param value_name: Id of additional-info + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_alarm_info_get(uuid): # noqa: E501 + """returns tapi.notification.AlarmInfo + + none # noqa: E501 + + :param uuid: Id of notification + :type uuid: str + + :rtype: TapiNotificationAlarmInfoWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_changed_attributesvalue_name_get(uuid, value_name): # noqa: E501 + """returns tapi.notification.NameAndValueChange + + none # noqa: E501 + + :param uuid: Id of notification + :type uuid: str + :param value_name: Id of changed-attributes + :type value_name: str + + :rtype: TapiNotificationNameAndValueChangeWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_get(uuid): # noqa: E501 + """returns tapi.notification.Notification + + none # noqa: E501 + + :param uuid: Id of notification + :type uuid: str + + :rtype: TapiNotificationNotificationWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_namevalue_name_get(uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of notification + :type uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_target_object_namevalue_name_get(uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + none # noqa: E501 + + :param uuid: Id of notification + :type uuid: str + :param value_name: Id of target-object-name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_tca_info_get(uuid): # noqa: E501 + """returns tapi.notification.TcaInfo + + none # noqa: E501 + + :param uuid: Id of notification + :type uuid: str + + :rtype: TapiNotificationTcaInfoWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_post(body=None): # noqa: E501 + """creates tapi.notification.NotificationContext + + Augments the base TAPI Context with NotificationService information # noqa: E501 + + :param body: tapi.notification.NotificationContext to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiNotificationNotificationContextWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_notificationnotification_context_put(body=None): # noqa: E501 + """creates or updates tapi.notification.NotificationContext + + Augments the base TAPI Context with NotificationService information # noqa: E501 + + :param body: tapi.notification.NotificationContext to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiNotificationNotificationContextWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def operations_tapi_notificationcreate_notification_subscription_service_post(body=None): # noqa: E501 + """operates on tapi.notification.CreateNotificationSubscriptionService + + operates on tapi.notification.CreateNotificationSubscriptionService # noqa: E501 + + :param body: + :type body: dict | bytes + + :rtype: TapiNotificationCreateNotificationSubscriptionService + """ + if connexion.request.is_json: + body = OperationsTapinotificationcreatenotificationsubscriptionserviceBody.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def operations_tapi_notificationdelete_notification_subscription_service_post(body=None): # noqa: E501 + """operates on tapi.notification.DeleteNotificationSubscriptionService + + operates on tapi.notification.DeleteNotificationSubscriptionService # noqa: E501 + + :param body: + :type body: dict | bytes + + :rtype: TapiNotificationDeleteNotificationSubscriptionService + """ + if connexion.request.is_json: + body = OperationsTapinotificationdeletenotificationsubscriptionserviceBody.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def operations_tapi_notificationget_notification_list_post(body=None): # noqa: E501 + """operates on tapi.notification.GetNotificationList + + operates on tapi.notification.GetNotificationList # noqa: E501 + + :param body: + :type body: dict | bytes + + :rtype: TapiNotificationGetNotificationList + """ + if connexion.request.is_json: + body = OperationsTapinotificationgetnotificationlistBody.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def operations_tapi_notificationget_notification_subscription_service_details_post(body=None): # noqa: E501 + """operates on tapi.notification.GetNotificationSubscriptionServiceDetails + + operates on tapi.notification.GetNotificationSubscriptionServiceDetails # noqa: E501 + + :param body: + :type body: dict | bytes + + :rtype: TapiNotificationGetNotificationSubscriptionServiceDetails + """ + if connexion.request.is_json: + body = OperationsTapinotificationgetnotificationsubscriptionservicedetailsBody.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def operations_tapi_notificationget_notification_subscription_service_list_post(): # noqa: E501 + """operations_tapi_notificationget_notification_subscription_service_list_post + + # noqa: E501 + + + :rtype: TapiNotificationGetNotificationSubscriptionServiceList + """ + return 'do some magic!' + + +def operations_tapi_notificationget_supported_notification_types_post(): # noqa: E501 + """operations_tapi_notificationget_supported_notification_types_post + + # noqa: E501 + + + :rtype: TapiNotificationGetSupportedNotificationTypes + """ + return 'do some magic!' + + +def operations_tapi_notificationupdate_notification_subscription_service_post(body=None): # noqa: E501 + """operates on tapi.notification.UpdateNotificationSubscriptionService + + operates on tapi.notification.UpdateNotificationSubscriptionService # noqa: E501 + + :param body: + :type body: dict | bytes + + :rtype: TapiNotificationUpdateNotificationSubscriptionService + """ + if connexion.request.is_json: + body = OperationsTapinotificationupdatenotificationsubscriptionserviceBody.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' diff --git a/hackfest/tapi/server/tapi_server/controllers/tapi_path_computation_controller.py b/hackfest/tapi/server/tapi_server/controllers/tapi_path_computation_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..012d1f915c0da0334e589c15023a27a37854754f --- /dev/null +++ b/hackfest/tapi/server/tapi_server/controllers/tapi_path_computation_controller.py @@ -0,0 +1,1841 @@ +import connexion +import six + +from tapi_server.models.operations_tapipathcomputationcomputep2ppath_body import OperationsTapipathcomputationcomputep2ppathBody # noqa: E501 +from tapi_server.models.operations_tapipathcomputationdeletep2ppath_body import OperationsTapipathcomputationdeletep2ppathBody # noqa: E501 +from tapi_server.models.operations_tapipathcomputationoptimizep2ppath_body import OperationsTapipathcomputationoptimizep2ppathBody # noqa: E501 +from tapi_server.models.tapi_common_bandwidth_profile_wrapper import TapiCommonBandwidthProfileWrapper # noqa: E501 +from tapi_server.models.tapi_common_capacity_value_wrapper import TapiCommonCapacityValueWrapper # noqa: E501 +from tapi_server.models.tapi_common_capacity_wrapper import TapiCommonCapacityWrapper # noqa: E501 +from tapi_server.models.tapi_common_name_and_value_wrapper import TapiCommonNameAndValueWrapper # noqa: E501 +from tapi_server.models.tapi_common_service_interface_point_ref_wrapper import TapiCommonServiceInterfacePointRefWrapper # noqa: E501 +from tapi_server.models.tapi_path_computation_compute_p2_p_path import TapiPathComputationComputeP2PPath # noqa: E501 +from tapi_server.models.tapi_path_computation_delete_p2_p_path import TapiPathComputationDeleteP2PPath # noqa: E501 +from tapi_server.models.tapi_path_computation_optimize_p2_ppath import TapiPathComputationOptimizeP2Ppath # noqa: E501 +from tapi_server.models.tapi_path_computation_path_computation_context_wrapper import TapiPathComputationPathComputationContextWrapper # noqa: E501 +from tapi_server.models.tapi_path_computation_path_computation_service_wrapper import TapiPathComputationPathComputationServiceWrapper # noqa: E501 +from tapi_server.models.tapi_path_computation_path_objective_function_wrapper import TapiPathComputationPathObjectiveFunctionWrapper # noqa: E501 +from tapi_server.models.tapi_path_computation_path_optimization_constraint_wrapper import TapiPathComputationPathOptimizationConstraintWrapper # noqa: E501 +from tapi_server.models.tapi_path_computation_path_ref_wrapper import TapiPathComputationPathRefWrapper # noqa: E501 +from tapi_server.models.tapi_path_computation_path_service_end_point_wrapper import TapiPathComputationPathServiceEndPointWrapper # noqa: E501 +from tapi_server.models.tapi_path_computation_path_wrapper import TapiPathComputationPathWrapper # noqa: E501 +from tapi_server.models.tapi_path_computation_routing_constraint_wrapper import TapiPathComputationRoutingConstraintWrapper # noqa: E501 +from tapi_server.models.tapi_path_computation_topology_constraint_wrapper import TapiPathComputationTopologyConstraintWrapper # noqa: E501 +from tapi_server.models.tapi_path_computation_value_or_priority_wrapper import TapiPathComputationValueOrPriorityWrapper # noqa: E501 +from tapi_server.models.tapi_topology_cost_characteristic_wrapper import TapiTopologyCostCharacteristicWrapper # noqa: E501 +from tapi_server.models.tapi_topology_latency_characteristic_wrapper import TapiTopologyLatencyCharacteristicWrapper # noqa: E501 +from tapi_server.models.tapi_topology_link_ref_wrapper import TapiTopologyLinkRefWrapper # noqa: E501 +from tapi_server.models.tapi_topology_risk_characteristic_wrapper import TapiTopologyRiskCharacteristicWrapper # noqa: E501 +from tapi_server import util + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_delete(): # noqa: E501 + """removes tapi.path.computation.PathComputationContext + + Augments the base TAPI Context with PathComputationService information # noqa: E501 + + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_get(): # noqa: E501 + """returns tapi.path.computation.PathComputationContext + + Augments the base TAPI Context with PathComputationService information # noqa: E501 + + + :rtype: TapiPathComputationPathComputationContextWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_service_post(body=None): # noqa: E501 + """creates tapi.path.computation.PathComputationService + + none # noqa: E501 + + :param body: tapi.path.computation.PathComputationService to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationPathComputationServiceWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_delete(uuid): # noqa: E501 + """removes tapi.path.computation.PathComputationService + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_point_post(uuid, body=None): # noqa: E501 + """creates tapi.path.computation.PathServiceEndPoint + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param body: tapi.path.computation.PathServiceEndPoint to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationPathServiceEndPointWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_delete(uuid, local_id): # noqa: E501 + """removes tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_get(uuid, local_id): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_post(uuid, local_id, body=None): # noqa: E501 + """creates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.CapacityValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_put(uuid, local_id, body=None): # noqa: E501 + """creates or updates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.CapacityValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_delete(uuid, local_id): # noqa: E501 + """removes tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_get(uuid, local_id): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_post(uuid, local_id, body=None): # noqa: E501 + """creates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.CapacityValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_put(uuid, local_id, body=None): # noqa: E501 + """creates or updates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.CapacityValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_delete(uuid, local_id): # noqa: E501 + """removes tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_get(uuid, local_id): # noqa: E501 + """returns tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: TapiCommonBandwidthProfileWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_delete(uuid, local_id): # noqa: E501 + """removes tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_get(uuid, local_id): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_post(uuid, local_id, body=None): # noqa: E501 + """creates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.CapacityValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_put(uuid, local_id, body=None): # noqa: E501 + """creates or updates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.CapacityValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_delete(uuid, local_id): # noqa: E501 + """removes tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_get(uuid, local_id): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_post(uuid, local_id, body=None): # noqa: E501 + """creates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.CapacityValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_put(uuid, local_id, body=None): # noqa: E501 + """creates or updates tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.CapacityValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_post(uuid, local_id, body=None): # noqa: E501 + """creates tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.BandwidthProfile to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonBandwidthProfileWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_put(uuid, local_id, body=None): # noqa: E501 + """creates or updates tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.BandwidthProfile to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonBandwidthProfileWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_delete(uuid, local_id): # noqa: E501 + """removes tapi.common.Capacity + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_get(uuid, local_id): # noqa: E501 + """returns tapi.common.Capacity + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: TapiCommonCapacityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_post(uuid, local_id, body=None): # noqa: E501 + """creates tapi.common.Capacity + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.Capacity to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_put(uuid, local_id, body=None): # noqa: E501 + """creates or updates tapi.common.Capacity + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.Capacity to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_total_size_delete(uuid, local_id): # noqa: E501 + """removes tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_total_size_get(uuid, local_id): # noqa: E501 + """returns tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_total_size_post(uuid, local_id, body=None): # noqa: E501 + """creates tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.CapacityValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_total_size_put(uuid, local_id, body=None): # noqa: E501 + """creates or updates tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.CapacityValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonCapacityValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_delete(uuid, local_id): # noqa: E501 + """removes tapi.path.computation.PathServiceEndPoint + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_get(uuid, local_id): # noqa: E501 + """returns tapi.path.computation.PathServiceEndPoint + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: TapiPathComputationPathServiceEndPointWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_name_post(uuid, local_id, body=None): # noqa: E501 + """creates tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.NameAndValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonNameAndValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_namevalue_name_delete(uuid, local_id, value_name): # noqa: E501 + """removes tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param value_name: Id of name + :type value_name: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_namevalue_name_get(uuid, local_id, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_namevalue_name_put(uuid, local_id, value_name, body=None): # noqa: E501 + """creates or updates tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param value_name: Id of name + :type value_name: str + :param body: tapi.common.NameAndValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonNameAndValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_put(uuid, local_id, body=None): # noqa: E501 + """creates or updates tapi.path.computation.PathServiceEndPoint + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.path.computation.PathServiceEndPoint to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationPathServiceEndPointWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_service_interface_point_delete(uuid, local_id): # noqa: E501 + """removes tapi.common.ServiceInterfacePointRef + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_service_interface_point_get(uuid, local_id): # noqa: E501 + """returns tapi.common.ServiceInterfacePointRef + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + + :rtype: TapiCommonServiceInterfacePointRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_service_interface_point_post(uuid, local_id, body=None): # noqa: E501 + """creates tapi.common.ServiceInterfacePointRef + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.ServiceInterfacePointRef to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonServiceInterfacePointRefWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_service_interface_point_put(uuid, local_id, body=None): # noqa: E501 + """creates or updates tapi.common.ServiceInterfacePointRef + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param local_id: Id of end-point + :type local_id: str + :param body: tapi.common.ServiceInterfacePointRef to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonServiceInterfacePointRefWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_get(uuid): # noqa: E501 + """returns tapi.path.computation.PathComputationService + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + + :rtype: TapiPathComputationPathComputationServiceWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_name_post(uuid, body=None): # noqa: E501 + """creates tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param body: tapi.common.NameAndValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonNameAndValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_namevalue_name_delete(uuid, value_name): # noqa: E501 + """removes tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_namevalue_name_get(uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_namevalue_name_put(uuid, value_name, body=None): # noqa: E501 + """creates or updates tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param value_name: Id of name + :type value_name: str + :param body: tapi.common.NameAndValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonNameAndValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_delete(uuid): # noqa: E501 + """removes tapi.path.computation.PathObjectiveFunction + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_get(uuid): # noqa: E501 + """returns tapi.path.computation.PathObjectiveFunction + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + + :rtype: TapiPathComputationPathObjectiveFunctionWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_name_post(uuid, body=None): # noqa: E501 + """creates tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param body: tapi.common.NameAndValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonNameAndValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_namevalue_name_delete(uuid, value_name): # noqa: E501 + """removes tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_namevalue_name_get(uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_namevalue_name_put(uuid, value_name, body=None): # noqa: E501 + """creates or updates tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param value_name: Id of name + :type value_name: str + :param body: tapi.common.NameAndValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonNameAndValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_post(uuid, body=None): # noqa: E501 + """creates tapi.path.computation.PathObjectiveFunction + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param body: tapi.path.computation.PathObjectiveFunction to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationPathObjectiveFunctionWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.path.computation.PathObjectiveFunction + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param body: tapi.path.computation.PathObjectiveFunction to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationPathObjectiveFunctionWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_delete(uuid): # noqa: E501 + """removes tapi.path.computation.PathOptimizationConstraint + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_get(uuid): # noqa: E501 + """returns tapi.path.computation.PathOptimizationConstraint + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + + :rtype: TapiPathComputationPathOptimizationConstraintWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_name_post(uuid, body=None): # noqa: E501 + """creates tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param body: tapi.common.NameAndValue to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonNameAndValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_namevalue_name_delete(uuid, value_name): # noqa: E501 + """removes tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_namevalue_name_get(uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_namevalue_name_put(uuid, value_name, body=None): # noqa: E501 + """creates or updates tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param value_name: Id of name + :type value_name: str + :param body: tapi.common.NameAndValue to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiCommonNameAndValueWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_post(uuid, body=None): # noqa: E501 + """creates tapi.path.computation.PathOptimizationConstraint + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param body: tapi.path.computation.PathOptimizationConstraint to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationPathOptimizationConstraintWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.path.computation.PathOptimizationConstraint + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param body: tapi.path.computation.PathOptimizationConstraint to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationPathOptimizationConstraintWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_pathpath_uuid_get(uuid, path_uuid): # noqa: E501 + """returns tapi.path.computation.PathRef + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param path_uuid: Id of path + :type path_uuid: str + + :rtype: TapiPathComputationPathRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.path.computation.PathComputationService + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param body: tapi.path.computation.PathComputationService to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationPathComputationServiceWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_cost_characteristic_post(uuid, body=None): # noqa: E501 + """creates tapi.topology.CostCharacteristic + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param body: tapi.topology.CostCharacteristic to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiTopologyCostCharacteristicWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_cost_characteristiccost_name_delete(uuid, cost_name): # noqa: E501 + """removes tapi.topology.CostCharacteristic + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param cost_name: Id of cost-characteristic + :type cost_name: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_cost_characteristiccost_name_get(uuid, cost_name): # noqa: E501 + """returns tapi.topology.CostCharacteristic + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param cost_name: Id of cost-characteristic + :type cost_name: str + + :rtype: TapiTopologyCostCharacteristicWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_cost_characteristiccost_name_put(uuid, cost_name, body=None): # noqa: E501 + """creates or updates tapi.topology.CostCharacteristic + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param cost_name: Id of cost-characteristic + :type cost_name: str + :param body: tapi.topology.CostCharacteristic to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiTopologyCostCharacteristicWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_delete(uuid): # noqa: E501 + """removes tapi.path.computation.RoutingConstraint + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_get(uuid): # noqa: E501 + """returns tapi.path.computation.RoutingConstraint + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + + :rtype: TapiPathComputationRoutingConstraintWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_latency_characteristic_post(uuid, body=None): # noqa: E501 + """creates tapi.topology.LatencyCharacteristic + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param body: tapi.topology.LatencyCharacteristic to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiTopologyLatencyCharacteristicWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_latency_characteristictraffic_property_name_delete(uuid, traffic_property_name): # noqa: E501 + """removes tapi.topology.LatencyCharacteristic + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param traffic_property_name: Id of latency-characteristic + :type traffic_property_name: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_latency_characteristictraffic_property_name_get(uuid, traffic_property_name): # noqa: E501 + """returns tapi.topology.LatencyCharacteristic + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param traffic_property_name: Id of latency-characteristic + :type traffic_property_name: str + + :rtype: TapiTopologyLatencyCharacteristicWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_latency_characteristictraffic_property_name_put(uuid, traffic_property_name, body=None): # noqa: E501 + """creates or updates tapi.topology.LatencyCharacteristic + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param traffic_property_name: Id of latency-characteristic + :type traffic_property_name: str + :param body: tapi.topology.LatencyCharacteristic to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiTopologyLatencyCharacteristicWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_cost_delete(uuid): # noqa: E501 + """removes tapi.path.computation.ValueOrPriority + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_cost_get(uuid): # noqa: E501 + """returns tapi.path.computation.ValueOrPriority + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + + :rtype: TapiPathComputationValueOrPriorityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_cost_post(uuid, body=None): # noqa: E501 + """creates tapi.path.computation.ValueOrPriority + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param body: tapi.path.computation.ValueOrPriority to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationValueOrPriorityWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_cost_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.path.computation.ValueOrPriority + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param body: tapi.path.computation.ValueOrPriority to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationValueOrPriorityWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_delay_delete(uuid): # noqa: E501 + """removes tapi.path.computation.ValueOrPriority + + Delay unit is microseconds. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_delay_get(uuid): # noqa: E501 + """returns tapi.path.computation.ValueOrPriority + + Delay unit is microseconds. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + + :rtype: TapiPathComputationValueOrPriorityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_delay_post(uuid, body=None): # noqa: E501 + """creates tapi.path.computation.ValueOrPriority + + Delay unit is microseconds. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param body: tapi.path.computation.ValueOrPriority to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationValueOrPriorityWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_delay_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.path.computation.ValueOrPriority + + Delay unit is microseconds. # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param body: tapi.path.computation.ValueOrPriority to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationValueOrPriorityWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_hops_delete(uuid): # noqa: E501 + """removes tapi.path.computation.ValueOrPriority + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_hops_get(uuid): # noqa: E501 + """returns tapi.path.computation.ValueOrPriority + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + + :rtype: TapiPathComputationValueOrPriorityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_hops_post(uuid, body=None): # noqa: E501 + """creates tapi.path.computation.ValueOrPriority + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param body: tapi.path.computation.ValueOrPriority to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationValueOrPriorityWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_hops_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.path.computation.ValueOrPriority + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param body: tapi.path.computation.ValueOrPriority to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationValueOrPriorityWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_post(uuid, body=None): # noqa: E501 + """creates tapi.path.computation.RoutingConstraint + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param body: tapi.path.computation.RoutingConstraint to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationRoutingConstraintWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.path.computation.RoutingConstraint + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param body: tapi.path.computation.RoutingConstraint to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationRoutingConstraintWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_risk_diversity_characteristic_post(uuid, body=None): # noqa: E501 + """creates tapi.topology.RiskCharacteristic + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param body: tapi.topology.RiskCharacteristic to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiTopologyRiskCharacteristicWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_risk_diversity_characteristicrisk_characteristic_name_delete(uuid, risk_characteristic_name): # noqa: E501 + """removes tapi.topology.RiskCharacteristic + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param risk_characteristic_name: Id of risk-diversity-characteristic + :type risk_characteristic_name: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_risk_diversity_characteristicrisk_characteristic_name_get(uuid, risk_characteristic_name): # noqa: E501 + """returns tapi.topology.RiskCharacteristic + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param risk_characteristic_name: Id of risk-diversity-characteristic + :type risk_characteristic_name: str + + :rtype: TapiTopologyRiskCharacteristicWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_risk_diversity_characteristicrisk_characteristic_name_put(uuid, risk_characteristic_name, body=None): # noqa: E501 + """creates or updates tapi.topology.RiskCharacteristic + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param risk_characteristic_name: Id of risk-diversity-characteristic + :type risk_characteristic_name: str + :param body: tapi.topology.RiskCharacteristic to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiTopologyRiskCharacteristicWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_topology_constraint_delete(uuid): # noqa: E501 + """removes tapi.path.computation.TopologyConstraint + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_topology_constraint_get(uuid): # noqa: E501 + """returns tapi.path.computation.TopologyConstraint + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + + :rtype: TapiPathComputationTopologyConstraintWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_topology_constraint_post(uuid, body=None): # noqa: E501 + """creates tapi.path.computation.TopologyConstraint + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param body: tapi.path.computation.TopologyConstraint to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationTopologyConstraintWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_topology_constraint_put(uuid, body=None): # noqa: E501 + """creates or updates tapi.path.computation.TopologyConstraint + + none # noqa: E501 + + :param uuid: Id of path-comp-service + :type uuid: str + :param body: tapi.path.computation.TopologyConstraint to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationTopologyConstraintWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_get(uuid): # noqa: E501 + """returns tapi.path.computation.Path + + none # noqa: E501 + + :param uuid: Id of path + :type uuid: str + + :rtype: TapiPathComputationPathWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_linktopology_uuidlink_uuid_get(uuid, topology_uuid, link_uuid): # noqa: E501 + """returns tapi.topology.LinkRef + + none # noqa: E501 + + :param uuid: Id of path + :type uuid: str + :param topology_uuid: Id of link + :type topology_uuid: str + :param link_uuid: Id of link + :type link_uuid: str + + :rtype: TapiTopologyLinkRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_namevalue_name_get(uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of path + :type uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_cost_characteristiccost_name_get(uuid, cost_name): # noqa: E501 + """returns tapi.topology.CostCharacteristic + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :param uuid: Id of path + :type uuid: str + :param cost_name: Id of cost-characteristic + :type cost_name: str + + :rtype: TapiTopologyCostCharacteristicWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_get(uuid): # noqa: E501 + """returns tapi.path.computation.RoutingConstraint + + none # noqa: E501 + + :param uuid: Id of path + :type uuid: str + + :rtype: TapiPathComputationRoutingConstraintWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_latency_characteristictraffic_property_name_get(uuid, traffic_property_name): # noqa: E501 + """returns tapi.topology.LatencyCharacteristic + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :param uuid: Id of path + :type uuid: str + :param traffic_property_name: Id of latency-characteristic + :type traffic_property_name: str + + :rtype: TapiTopologyLatencyCharacteristicWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_max_allowed_cost_get(uuid): # noqa: E501 + """returns tapi.path.computation.ValueOrPriority + + none # noqa: E501 + + :param uuid: Id of path + :type uuid: str + + :rtype: TapiPathComputationValueOrPriorityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_max_allowed_delay_get(uuid): # noqa: E501 + """returns tapi.path.computation.ValueOrPriority + + Delay unit is microseconds. # noqa: E501 + + :param uuid: Id of path + :type uuid: str + + :rtype: TapiPathComputationValueOrPriorityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_max_allowed_hops_get(uuid): # noqa: E501 + """returns tapi.path.computation.ValueOrPriority + + none # noqa: E501 + + :param uuid: Id of path + :type uuid: str + + :rtype: TapiPathComputationValueOrPriorityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_risk_diversity_characteristicrisk_characteristic_name_get(uuid, risk_characteristic_name): # noqa: E501 + """returns tapi.topology.RiskCharacteristic + + none # noqa: E501 + + :param uuid: Id of path + :type uuid: str + :param risk_characteristic_name: Id of risk-diversity-characteristic + :type risk_characteristic_name: str + + :rtype: TapiTopologyRiskCharacteristicWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_post(body=None): # noqa: E501 + """creates tapi.path.computation.PathComputationContext + + Augments the base TAPI Context with PathComputationService information # noqa: E501 + + :param body: tapi.path.computation.PathComputationContext to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationPathComputationContextWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_path_computationpath_computation_context_put(body=None): # noqa: E501 + """creates or updates tapi.path.computation.PathComputationContext + + Augments the base TAPI Context with PathComputationService information # noqa: E501 + + :param body: tapi.path.computation.PathComputationContext to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiPathComputationPathComputationContextWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def operations_tapi_path_computationcompute_p_2_p_path_post(body=None): # noqa: E501 + """operates on tapi.path.computation.ComputeP2PPath + + operates on tapi.path.computation.ComputeP2PPath # noqa: E501 + + :param body: + :type body: dict | bytes + + :rtype: TapiPathComputationComputeP2PPath + """ + if connexion.request.is_json: + body = OperationsTapipathcomputationcomputep2ppathBody.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def operations_tapi_path_computationdelete_p_2_p_path_post(body=None): # noqa: E501 + """operates on tapi.path.computation.DeleteP2PPath + + operates on tapi.path.computation.DeleteP2PPath # noqa: E501 + + :param body: + :type body: dict | bytes + + :rtype: TapiPathComputationDeleteP2PPath + """ + if connexion.request.is_json: + body = OperationsTapipathcomputationdeletep2ppathBody.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def operations_tapi_path_computationoptimize_p_2_ppath_post(body=None): # noqa: E501 + """operates on tapi.path.computation.OptimizeP2Ppath + + operates on tapi.path.computation.OptimizeP2Ppath # noqa: E501 + + :param body: + :type body: dict | bytes + + :rtype: TapiPathComputationOptimizeP2Ppath + """ + if connexion.request.is_json: + body = OperationsTapipathcomputationoptimizep2ppathBody.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' diff --git a/hackfest/tapi/server/tapi_server/controllers/tapi_topology_controller.py b/hackfest/tapi/server/tapi_server/controllers/tapi_topology_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..536be48d38978f220df04f7d4cd2f479ef7fa14d --- /dev/null +++ b/hackfest/tapi/server/tapi_server/controllers/tapi_topology_controller.py @@ -0,0 +1,2193 @@ +import connexion +import six + +from tapi_server.models.operations_tapitopologygetlinkdetails_body import OperationsTapitopologygetlinkdetailsBody # noqa: E501 +from tapi_server.models.operations_tapitopologygetnodedetails_body import OperationsTapitopologygetnodedetailsBody # noqa: E501 +from tapi_server.models.operations_tapitopologygetnodeedgepointdetails_body import OperationsTapitopologygetnodeedgepointdetailsBody # noqa: E501 +from tapi_server.models.operations_tapitopologygettopologydetails_body import OperationsTapitopologygettopologydetailsBody # noqa: E501 +from tapi_server.models.tapi_common_bandwidth_profile_wrapper import TapiCommonBandwidthProfileWrapper # noqa: E501 +from tapi_server.models.tapi_common_capacity_value_wrapper import TapiCommonCapacityValueWrapper # noqa: E501 +from tapi_server.models.tapi_common_capacity_wrapper import TapiCommonCapacityWrapper # noqa: E501 +from tapi_server.models.tapi_common_name_and_value_wrapper import TapiCommonNameAndValueWrapper # noqa: E501 +from tapi_server.models.tapi_common_service_interface_point_ref_wrapper import TapiCommonServiceInterfacePointRefWrapper # noqa: E501 +from tapi_server.models.tapi_topology_connection_spec_reference_wrapper import TapiTopologyConnectionSpecReferenceWrapper # noqa: E501 +from tapi_server.models.tapi_topology_cost_characteristic_wrapper import TapiTopologyCostCharacteristicWrapper # noqa: E501 +from tapi_server.models.tapi_topology_get_link_details import TapiTopologyGetLinkDetails # noqa: E501 +from tapi_server.models.tapi_topology_get_node_details import TapiTopologyGetNodeDetails # noqa: E501 +from tapi_server.models.tapi_topology_get_node_edge_point_details import TapiTopologyGetNodeEdgePointDetails # noqa: E501 +from tapi_server.models.tapi_topology_get_topology_details import TapiTopologyGetTopologyDetails # noqa: E501 +from tapi_server.models.tapi_topology_get_topology_list import TapiTopologyGetTopologyList # noqa: E501 +from tapi_server.models.tapi_topology_inter_rule_group_wrapper import TapiTopologyInterRuleGroupWrapper # noqa: E501 +from tapi_server.models.tapi_topology_latency_characteristic_wrapper import TapiTopologyLatencyCharacteristicWrapper # noqa: E501 +from tapi_server.models.tapi_topology_link_wrapper import TapiTopologyLinkWrapper # noqa: E501 +from tapi_server.models.tapi_topology_network_topology_service_wrapper import TapiTopologyNetworkTopologyServiceWrapper # noqa: E501 +from tapi_server.models.tapi_topology_node_edge_point_ref_wrapper import TapiTopologyNodeEdgePointRefWrapper # noqa: E501 +from tapi_server.models.tapi_topology_node_owned_node_edge_point_wrapper import TapiTopologyNodeOwnedNodeEdgePointWrapper # noqa: E501 +from tapi_server.models.tapi_topology_node_rule_group_ref_wrapper import TapiTopologyNodeRuleGroupRefWrapper # noqa: E501 +from tapi_server.models.tapi_topology_node_rule_group_wrapper import TapiTopologyNodeRuleGroupWrapper # noqa: E501 +from tapi_server.models.tapi_topology_port_role_rule_wrapper import TapiTopologyPortRoleRuleWrapper # noqa: E501 +from tapi_server.models.tapi_topology_resilience_type_wrapper import TapiTopologyResilienceTypeWrapper # noqa: E501 +from tapi_server.models.tapi_topology_risk_characteristic_wrapper import TapiTopologyRiskCharacteristicWrapper # noqa: E501 +from tapi_server.models.tapi_topology_rule_wrapper import TapiTopologyRuleWrapper # noqa: E501 +from tapi_server.models.tapi_topology_signal_property_rule_wrapper import TapiTopologySignalPropertyRuleWrapper # noqa: E501 +from tapi_server.models.tapi_topology_topology_context_wrapper import TapiTopologyTopologyContextWrapper # noqa: E501 +from tapi_server.models.tapi_topology_topology_node_wrapper import TapiTopologyTopologyNodeWrapper # noqa: E501 +from tapi_server.models.tapi_topology_topology_ref_wrapper import TapiTopologyTopologyRefWrapper # noqa: E501 +from tapi_server.models.tapi_topology_topology_wrapper import TapiTopologyTopologyWrapper # noqa: E501 +from tapi_server.models.tapi_topology_validation_mechanism_wrapper import TapiTopologyValidationMechanismWrapper # noqa: E501 +from tapi_server import util + +from tapi_server.models.tapi_topology_getlinkdetails_output import TapiTopologyGetlinkdetailsOutput +from tapi_server.models.tapi_topology_getnodeedgepointdetails_output import TapiTopologyGetnodeedgepointdetailsOutput +from tapi_server.models.tapi_topology_getnodedetails_output import TapiTopologyGetnodedetailsOutput +from tapi_server.models.tapi_topology_gettopologylist_output import TapiTopologyGettopologylistOutput +from tapi_server.models.tapi_topology_gettopologydetails_output import TapiTopologyGettopologydetailsOutput +from tapi_server import database + + +def data_tapi_commoncontext_tapi_topologytopology_context_delete(): # noqa: E501 + """removes tapi.topology.context.TopologyContext + + Augments the base TAPI Context with TopologyService information # noqa: E501 + + + :rtype: None + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_get(): # noqa: E501 + """returns tapi.topology.context.TopologyContext + + Augments the base TAPI Context with TopologyService information # noqa: E501 + + + :rtype: TapiTopologyTopologyContextWrapper + """ + return database.context.topology_context + + +def data_tapi_commoncontext_tapi_topologytopology_context_nw_topology_service_get(): # noqa: E501 + """returns tapi.topology.NetworkTopologyService + + none # noqa: E501 + + + :rtype: TapiTopologyNetworkTopologyServiceWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_nw_topology_service_namevalue_name_get(value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_nw_topology_service_topologytopology_uuid_get(topology_uuid): # noqa: E501 + """returns tapi.topology.TopologyRef + + none # noqa: E501 + + :param topology_uuid: Id of topology + :type topology_uuid: str + + :rtype: TapiTopologyTopologyRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_post(body=None): # noqa: E501 + """creates tapi.topology.context.TopologyContext + + Augments the base TAPI Context with TopologyService information # noqa: E501 + + :param body: tapi.topology.TopologyContext to be added to list + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiTopologyTopologyContextWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_put(body=None): # noqa: E501 + """creates or updates tapi.topology.context.TopologyContext + + Augments the base TAPI Context with TopologyService information # noqa: E501 + + :param body: tapi.topology.TopologyContext to be added or updated + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = TapiTopologyTopologyContextWrapper.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_get(uuid): # noqa: E501 + """returns tapi.topology.topologycontext.Topology + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + + :rtype: TapiTopologyTopologyWrapper + """ + return database.topology(uuid) + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_bandwidth_profile_committed_burst_size_get(uuid, link_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param link_uuid: Id of link + :type link_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_bandwidth_profile_committed_information_rate_get(uuid, link_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param link_uuid: Id of link + :type link_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_bandwidth_profile_get(uuid, link_uuid): # noqa: E501 + """returns tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param link_uuid: Id of link + :type link_uuid: str + + :rtype: TapiCommonBandwidthProfileWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_bandwidth_profile_peak_burst_size_get(uuid, link_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param link_uuid: Id of link + :type link_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_bandwidth_profile_peak_information_rate_get(uuid, link_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param link_uuid: Id of link + :type link_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_get(uuid, link_uuid): # noqa: E501 + """returns tapi.common.Capacity + + Capacity available to be assigned. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param link_uuid: Id of link + :type link_uuid: str + + :rtype: TapiCommonCapacityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_total_size_get(uuid, link_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param link_uuid: Id of link + :type link_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_cost_characteristiccost_name_get(uuid, link_uuid, cost_name): # noqa: E501 + """returns tapi.topology.CostCharacteristic + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param link_uuid: Id of link + :type link_uuid: str + :param cost_name: Id of cost-characteristic + :type cost_name: str + + :rtype: TapiTopologyCostCharacteristicWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_get(uuid, link_uuid): # noqa: E501 + """returns tapi.topology.Link + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param link_uuid: Id of link + :type link_uuid: str + + :rtype: TapiTopologyLinkWrapper + """ + return database.link(uuid, link_uuid) + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_latency_characteristictraffic_property_name_get(uuid, link_uuid, traffic_property_name): # noqa: E501 + """returns tapi.topology.LatencyCharacteristic + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param link_uuid: Id of link + :type link_uuid: str + :param traffic_property_name: Id of latency-characteristic + :type traffic_property_name: str + + :rtype: TapiTopologyLatencyCharacteristicWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_namevalue_name_get(uuid, link_uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param link_uuid: Id of link + :type link_uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_node_edge_pointtopology_uuidnode_uuidnode_edge_point_uuid_get(uuid, link_uuid, topology_uuid, node_uuid, node_edge_point_uuid): # noqa: E501 + """returns tapi.topology.NodeEdgePointRef + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param link_uuid: Id of link + :type link_uuid: str + :param topology_uuid: Id of node-edge-point + :type topology_uuid: str + :param node_uuid: Id of node-edge-point + :type node_uuid: str + :param node_edge_point_uuid: Id of node-edge-point + :type node_edge_point_uuid: str + + :rtype: TapiTopologyNodeEdgePointRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_resilience_type_get(uuid, link_uuid): # noqa: E501 + """returns tapi.topology.ResilienceType + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param link_uuid: Id of link + :type link_uuid: str + + :rtype: TapiTopologyResilienceTypeWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_risk_characteristicrisk_characteristic_name_get(uuid, link_uuid, risk_characteristic_name): # noqa: E501 + """returns tapi.topology.RiskCharacteristic + + A list of risk characteristics for consideration in an analysis of shared risk. Each element of the list represents a specific risk consideration. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param link_uuid: Id of link + :type link_uuid: str + :param risk_characteristic_name: Id of risk-characteristic + :type risk_characteristic_name: str + + :rtype: TapiTopologyRiskCharacteristicWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get(uuid, link_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param link_uuid: Id of link + :type link_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get(uuid, link_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param link_uuid: Id of link + :type link_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_bandwidth_profile_get(uuid, link_uuid): # noqa: E501 + """returns tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param link_uuid: Id of link + :type link_uuid: str + + :rtype: TapiCommonBandwidthProfileWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get(uuid, link_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param link_uuid: Id of link + :type link_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get(uuid, link_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param link_uuid: Id of link + :type link_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_get(uuid, link_uuid): # noqa: E501 + """returns tapi.common.Capacity + + An optimistic view of the capacity of the TopologicalEntity assuming that any shared capacity is available to be taken. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param link_uuid: Id of link + :type link_uuid: str + + :rtype: TapiCommonCapacityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_total_size_get(uuid, link_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param link_uuid: Id of link + :type link_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_validation_mechanismvalidation_mechanism_get(uuid, link_uuid, validation_mechanism): # noqa: E501 + """returns tapi.topology.ValidationMechanism + + Provides details of the specific validation mechanism(s) used to confirm the presence of an intended topologicalEntity. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param link_uuid: Id of link + :type link_uuid: str + :param validation_mechanism: Id of validation-mechanism + :type validation_mechanism: str + + :rtype: TapiTopologyValidationMechanismWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_namevalue_name_get(uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_aggregated_node_edge_pointtopology_uuidaggregated_node_edge_point_node_uuidnode_edge_point_uuid_get(uuid, node_uuid, topology_uuid, aggregated_node_edge_point_node_uuid, node_edge_point_uuid): # noqa: E501 + """returns tapi.topology.NodeEdgePointRef + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param topology_uuid: Id of aggregated-node-edge-point + :type topology_uuid: str + :param aggregated_node_edge_point_node_uuid: Id of aggregated-node-edge-point + :type aggregated_node_edge_point_node_uuid: str + :param node_edge_point_uuid: Id of aggregated-node-edge-point + :type node_edge_point_uuid: str + + :rtype: TapiTopologyNodeEdgePointRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_bandwidth_profile_committed_burst_size_get(uuid, node_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_bandwidth_profile_committed_information_rate_get(uuid, node_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_bandwidth_profile_get(uuid, node_uuid): # noqa: E501 + """returns tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + + :rtype: TapiCommonBandwidthProfileWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_bandwidth_profile_peak_burst_size_get(uuid, node_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_bandwidth_profile_peak_information_rate_get(uuid, node_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_get(uuid, node_uuid): # noqa: E501 + """returns tapi.common.Capacity + + Capacity available to be assigned. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + + :rtype: TapiCommonCapacityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_total_size_get(uuid, node_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_cost_characteristiccost_name_get(uuid, node_uuid, cost_name): # noqa: E501 + """returns tapi.topology.CostCharacteristic + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param cost_name: Id of cost-characteristic + :type cost_name: str + + :rtype: TapiTopologyCostCharacteristicWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_encap_topology_get(uuid, node_uuid): # noqa: E501 + """returns tapi.topology.TopologyRef + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + + :rtype: TapiTopologyTopologyRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_get(uuid, node_uuid): # noqa: E501 + """returns tapi.topology.topology.Node + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + + :rtype: TapiTopologyTopologyNodeWrapper + """ + return database.node(uuid, node_uuid) + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_latency_characteristictraffic_property_name_get(uuid, node_uuid, traffic_property_name): # noqa: E501 + """returns tapi.topology.LatencyCharacteristic + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param traffic_property_name: Id of latency-characteristic + :type traffic_property_name: str + + :rtype: TapiTopologyLatencyCharacteristicWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_namevalue_name_get(uuid, node_uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_bandwidth_profile_committed_burst_size_get(uuid, node_uuid, node_rule_group_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_bandwidth_profile_committed_information_rate_get(uuid, node_uuid, node_rule_group_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_bandwidth_profile_get(uuid, node_uuid, node_rule_group_uuid): # noqa: E501 + """returns tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + + :rtype: TapiCommonBandwidthProfileWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_bandwidth_profile_peak_burst_size_get(uuid, node_uuid, node_rule_group_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_bandwidth_profile_peak_information_rate_get(uuid, node_uuid, node_rule_group_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_get(uuid, node_uuid, node_rule_group_uuid): # noqa: E501 + """returns tapi.common.Capacity + + Capacity available to be assigned. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + + :rtype: TapiCommonCapacityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_total_size_get(uuid, node_uuid, node_rule_group_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_cost_characteristiccost_name_get(uuid, node_uuid, node_rule_group_uuid, cost_name): # noqa: E501 + """returns tapi.topology.CostCharacteristic + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param cost_name: Id of cost-characteristic + :type cost_name: str + + :rtype: TapiTopologyCostCharacteristicWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_get(uuid, node_uuid, node_rule_group_uuid): # noqa: E501 + """returns tapi.topology.NodeRuleGroup + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + + :rtype: TapiTopologyNodeRuleGroupWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_associated_node_rule_grouptopology_uuidassociated_node_rule_group_node_uuidassociated_node_rule_group_node_rule_group_uuid_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid, topology_uuid, associated_node_rule_group_node_uuid, associated_node_rule_group_node_rule_group_uuid): # noqa: E501 + """returns tapi.topology.NodeRuleGroupRef + + The NodeRuleGroups that the InterRuleGroup constrains interconnection between. The CEPs of the NEPs of a referenced NodeRuleGroup can interconnect to the CEPs of the NEPs of another referenced NodeRuleGroup constrained by the rules of the InterRuleGroup. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + :param topology_uuid: Id of associated-node-rule-group + :type topology_uuid: str + :param associated_node_rule_group_node_uuid: Id of associated-node-rule-group + :type associated_node_rule_group_node_uuid: str + :param associated_node_rule_group_node_rule_group_uuid: Id of associated-node-rule-group + :type associated_node_rule_group_node_rule_group_uuid: str + + :rtype: TapiTopologyNodeRuleGroupRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_bandwidth_profile_committed_burst_size_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_bandwidth_profile_committed_information_rate_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_bandwidth_profile_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid): # noqa: E501 + """returns tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + + :rtype: TapiCommonBandwidthProfileWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_bandwidth_profile_peak_burst_size_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_bandwidth_profile_peak_information_rate_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid): # noqa: E501 + """returns tapi.common.Capacity + + Capacity available to be assigned. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + + :rtype: TapiCommonCapacityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_total_size_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_cost_characteristiccost_name_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid, cost_name): # noqa: E501 + """returns tapi.topology.CostCharacteristic + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + :param cost_name: Id of cost-characteristic + :type cost_name: str + + :rtype: TapiTopologyCostCharacteristicWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid): # noqa: E501 + """returns tapi.topology.InterRuleGroup + + Nested NodeRuleGroups may have InterRuleGroups. The Superior NodeRuleGroup contains the nested NodeRuleGroups and their associated InterRuleGroups. This is equivalent to the Node-Topology hierarchy. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + + :rtype: TapiTopologyInterRuleGroupWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_latency_characteristictraffic_property_name_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid, traffic_property_name): # noqa: E501 + """returns tapi.topology.LatencyCharacteristic + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + :param traffic_property_name: Id of latency-characteristic + :type traffic_property_name: str + + :rtype: TapiTopologyLatencyCharacteristicWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_namevalue_name_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_risk_characteristicrisk_characteristic_name_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid, risk_characteristic_name): # noqa: E501 + """returns tapi.topology.RiskCharacteristic + + A list of risk characteristics for consideration in an analysis of shared risk. Each element of the list represents a specific risk consideration. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + :param risk_characteristic_name: Id of risk-characteristic + :type risk_characteristic_name: str + + :rtype: TapiTopologyRiskCharacteristicWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_rulelocal_id_cep_port_role_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid, local_id): # noqa: E501 + """returns tapi.topology.PortRoleRule + + Indicates the port role to which the rule applies. The port role is interpreted in the context of the connection type which is identified by the connection spec. The port role is not meaningful in the absence of a connection spec reference. If a node rule group carries a port role, that role applies also to the associated inter rule where the combination of the roles in the node rule groups at the ends of the inter group rule define the connection orientation. For example a root-and-leaf connection may be used in a node where a node rule group collects one set of NEPs has the port role 'root' and another node rule group collects another set of NEPs has the port role 'leaf' where these are joined by an inter rule group. This combination specifies an allowed orientation of the root-and-leaf connection. No port role statement means all port roles are allowed. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + :param local_id: Id of rule + :type local_id: str + + :rtype: TapiTopologyPortRoleRuleWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_rulelocal_id_connection_spec_reference_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid, local_id): # noqa: E501 + """returns tapi.topology.ConnectionSpecReference + + Identifies the type of connection that the rule applies to. If the attribute is not present then the rule applies to all types of connection supported by the device. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + :param local_id: Id of rule + :type local_id: str + + :rtype: TapiTopologyConnectionSpecReferenceWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_rulelocal_id_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid, local_id): # noqa: E501 + """returns tapi.topology.Rule + + The list of rules of the InterRuleGroup. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + :param local_id: Id of rule + :type local_id: str + + :rtype: TapiTopologyRuleWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_rulelocal_id_namevalue_name_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid, local_id, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + :param local_id: Id of rule + :type local_id: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_rulelocal_id_signal_property_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid, local_id): # noqa: E501 + """returns tapi.topology.SignalPropertyRule + + The rule only applies to signals with the properties listed. If the attribute is not present then the rule applies to all signals. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + :param local_id: Id of rule + :type local_id: str + + :rtype: TapiTopologySignalPropertyRuleWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_bandwidth_profile_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid): # noqa: E501 + """returns tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + + :rtype: TapiCommonBandwidthProfileWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid): # noqa: E501 + """returns tapi.common.Capacity + + An optimistic view of the capacity of the TopologicalEntity assuming that any shared capacity is available to be taken. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + + :rtype: TapiCommonCapacityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_total_size_get(uuid, node_uuid, node_rule_group_uuid, inter_rule_group_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param inter_rule_group_uuid: Id of inter-rule-group + :type inter_rule_group_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_latency_characteristictraffic_property_name_get(uuid, node_uuid, node_rule_group_uuid, traffic_property_name): # noqa: E501 + """returns tapi.topology.LatencyCharacteristic + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param traffic_property_name: Id of latency-characteristic + :type traffic_property_name: str + + :rtype: TapiTopologyLatencyCharacteristicWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_namevalue_name_get(uuid, node_uuid, node_rule_group_uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_node_edge_pointtopology_uuidnode_edge_point_node_uuidnode_edge_point_uuid_get(uuid, node_uuid, node_rule_group_uuid, topology_uuid, node_edge_point_node_uuid, node_edge_point_uuid): # noqa: E501 + """returns tapi.topology.NodeEdgePointRef + + NEPs and their client CEPs that the rules apply to. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param topology_uuid: Id of node-edge-point + :type topology_uuid: str + :param node_edge_point_node_uuid: Id of node-edge-point + :type node_edge_point_node_uuid: str + :param node_edge_point_uuid: Id of node-edge-point + :type node_edge_point_uuid: str + + :rtype: TapiTopologyNodeEdgePointRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_node_rule_grouptopology_uuidnode_rule_group_node_uuidnode_rule_group_node_rule_group_uuid_get(uuid, node_uuid, node_rule_group_uuid, topology_uuid, node_rule_group_node_uuid, node_rule_group_node_rule_group_uuid): # noqa: E501 + """returns tapi.topology.NodeRuleGroupRef + + NodeRuleGroups may be nested such that finer grained rules may be applied. A nested rule group should have a subset of the NEPs of the superior rule group. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param topology_uuid: Id of node-rule-group + :type topology_uuid: str + :param node_rule_group_node_uuid: Id of node-rule-group + :type node_rule_group_node_uuid: str + :param node_rule_group_node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_node_rule_group_uuid: str + + :rtype: TapiTopologyNodeRuleGroupRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_risk_characteristicrisk_characteristic_name_get(uuid, node_uuid, node_rule_group_uuid, risk_characteristic_name): # noqa: E501 + """returns tapi.topology.RiskCharacteristic + + A list of risk characteristics for consideration in an analysis of shared risk. Each element of the list represents a specific risk consideration. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param risk_characteristic_name: Id of risk-characteristic + :type risk_characteristic_name: str + + :rtype: TapiTopologyRiskCharacteristicWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_rulelocal_id_cep_port_role_get(uuid, node_uuid, node_rule_group_uuid, local_id): # noqa: E501 + """returns tapi.topology.PortRoleRule + + Indicates the port role to which the rule applies. The port role is interpreted in the context of the connection type which is identified by the connection spec. The port role is not meaningful in the absence of a connection spec reference. If a node rule group carries a port role, that role applies also to the associated inter rule where the combination of the roles in the node rule groups at the ends of the inter group rule define the connection orientation. For example a root-and-leaf connection may be used in a node where a node rule group collects one set of NEPs has the port role 'root' and another node rule group collects another set of NEPs has the port role 'leaf' where these are joined by an inter rule group. This combination specifies an allowed orientation of the root-and-leaf connection. No port role statement means all port roles are allowed. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param local_id: Id of rule + :type local_id: str + + :rtype: TapiTopologyPortRoleRuleWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_rulelocal_id_connection_spec_reference_get(uuid, node_uuid, node_rule_group_uuid, local_id): # noqa: E501 + """returns tapi.topology.ConnectionSpecReference + + Identifies the type of connection that the rule applies to. If the attribute is not present then the rule applies to all types of connection supported by the device. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param local_id: Id of rule + :type local_id: str + + :rtype: TapiTopologyConnectionSpecReferenceWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_rulelocal_id_get(uuid, node_uuid, node_rule_group_uuid, local_id): # noqa: E501 + """returns tapi.topology.Rule + + The list of rules of the NodeRuleGroup. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param local_id: Id of rule + :type local_id: str + + :rtype: TapiTopologyRuleWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_rulelocal_id_namevalue_name_get(uuid, node_uuid, node_rule_group_uuid, local_id, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param local_id: Id of rule + :type local_id: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_rulelocal_id_signal_property_get(uuid, node_uuid, node_rule_group_uuid, local_id): # noqa: E501 + """returns tapi.topology.SignalPropertyRule + + The rule only applies to signals with the properties listed. If the attribute is not present then the rule applies to all signals. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + :param local_id: Id of rule + :type local_id: str + + :rtype: TapiTopologySignalPropertyRuleWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get(uuid, node_uuid, node_rule_group_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get(uuid, node_uuid, node_rule_group_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_bandwidth_profile_get(uuid, node_uuid, node_rule_group_uuid): # noqa: E501 + """returns tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + + :rtype: TapiCommonBandwidthProfileWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get(uuid, node_uuid, node_rule_group_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get(uuid, node_uuid, node_rule_group_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_get(uuid, node_uuid, node_rule_group_uuid): # noqa: E501 + """returns tapi.common.Capacity + + An optimistic view of the capacity of the TopologicalEntity assuming that any shared capacity is available to be taken. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + + :rtype: TapiCommonCapacityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_total_size_get(uuid, node_uuid, node_rule_group_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param node_rule_group_uuid: Id of node-rule-group + :type node_rule_group_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_aggregated_node_edge_pointtopology_uuidaggregated_node_edge_point_node_uuidnode_edge_point_uuid_get(uuid, node_uuid, owned_node_edge_point_uuid, topology_uuid, aggregated_node_edge_point_node_uuid, node_edge_point_uuid): # noqa: E501 + """returns tapi.topology.NodeEdgePointRef + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + :param topology_uuid: Id of aggregated-node-edge-point + :type topology_uuid: str + :param aggregated_node_edge_point_node_uuid: Id of aggregated-node-edge-point + :type aggregated_node_edge_point_node_uuid: str + :param node_edge_point_uuid: Id of aggregated-node-edge-point + :type node_edge_point_uuid: str + + :rtype: TapiTopologyNodeEdgePointRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_bandwidth_profile_committed_burst_size_get(uuid, node_uuid, owned_node_edge_point_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_bandwidth_profile_committed_information_rate_get(uuid, node_uuid, owned_node_edge_point_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_bandwidth_profile_get(uuid, node_uuid, owned_node_edge_point_uuid): # noqa: E501 + """returns tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + + :rtype: TapiCommonBandwidthProfileWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_bandwidth_profile_peak_burst_size_get(uuid, node_uuid, owned_node_edge_point_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_bandwidth_profile_peak_information_rate_get(uuid, node_uuid, owned_node_edge_point_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_get(uuid, node_uuid, owned_node_edge_point_uuid): # noqa: E501 + """returns tapi.common.Capacity + + Capacity available to be assigned. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + + :rtype: TapiCommonCapacityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_total_size_get(uuid, node_uuid, owned_node_edge_point_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_get(uuid, node_uuid, owned_node_edge_point_uuid): # noqa: E501 + """returns tapi.topology.node.OwnedNodeEdgePoint + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + + :rtype: TapiTopologyNodeOwnedNodeEdgePointWrapper + """ + return database.node_edge_point(uuid, node_uuid, owned_node_edge_point_uuid) + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_mapped_service_interface_pointservice_interface_point_uuid_get(uuid, node_uuid, owned_node_edge_point_uuid, service_interface_point_uuid): # noqa: E501 + """returns tapi.common.ServiceInterfacePointRef + + NodeEdgePoint mapped to more than ServiceInterfacePoint (slicing/virtualizing) or a ServiceInterfacePoint mapped to more than one NodeEdgePoint (load balancing/Resilience) should be considered experimental # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + :param service_interface_point_uuid: Id of mapped-service-interface-point + :type service_interface_point_uuid: str + + :rtype: TapiCommonServiceInterfacePointRefWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_namevalue_name_get(uuid, node_uuid, owned_node_edge_point_uuid, value_name): # noqa: E501 + """returns tapi.common.NameAndValue + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + :param value_name: Id of name + :type value_name: str + + :rtype: TapiCommonNameAndValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get(uuid, node_uuid, owned_node_edge_point_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get(uuid, node_uuid, owned_node_edge_point_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_bandwidth_profile_get(uuid, node_uuid, owned_node_edge_point_uuid): # noqa: E501 + """returns tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + + :rtype: TapiCommonBandwidthProfileWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get(uuid, node_uuid, owned_node_edge_point_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get(uuid, node_uuid, owned_node_edge_point_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_get(uuid, node_uuid, owned_node_edge_point_uuid): # noqa: E501 + """returns tapi.common.Capacity + + An optimistic view of the capacity of the TopologicalEntity assuming that any shared capacity is available to be taken. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + + :rtype: TapiCommonCapacityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_total_size_get(uuid, node_uuid, owned_node_edge_point_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + :param owned_node_edge_point_uuid: Id of owned-node-edge-point + :type owned_node_edge_point_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get(uuid, node_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get(uuid, node_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_bandwidth_profile_get(uuid, node_uuid): # noqa: E501 + """returns tapi.common.BandwidthProfile + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + + :rtype: TapiCommonBandwidthProfileWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get(uuid, node_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get(uuid, node_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + none # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_get(uuid, node_uuid): # noqa: E501 + """returns tapi.common.Capacity + + An optimistic view of the capacity of the TopologicalEntity assuming that any shared capacity is available to be taken. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + + :rtype: TapiCommonCapacityWrapper + """ + return 'do some magic!' + + +def data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_total_size_get(uuid, node_uuid): # noqa: E501 + """returns tapi.common.CapacityValue + + Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile, this is expected to same as the committedInformationRate. # noqa: E501 + + :param uuid: Id of topology + :type uuid: str + :param node_uuid: Id of node + :type node_uuid: str + + :rtype: TapiCommonCapacityValueWrapper + """ + return 'do some magic!' + + +def operations_tapi_topologyget_link_details_post(body=None): # noqa: E501 + """operates on tapi.topology.GetLinkDetails + + operates on tapi.topology.GetLinkDetails # noqa: E501 + + :param body: + :type body: dict | bytes + + :rtype: TapiTopologyGetLinkDetails + """ + if connexion.request.is_json: + body = OperationsTapitopologygetlinkdetailsBody.from_dict(connexion.request.get_json()) # noqa: E501 + + return TapiTopologyGetLinkDetails(TapiTopologyGetlinkdetailsOutput( + database.link(body.input.topology_id_or_name, body.input.link_id_or_name))) + + +def operations_tapi_topologyget_node_details_post(body=None): # noqa: E501 + """operates on tapi.topology.GetNodeDetails + + operates on tapi.topology.GetNodeDetails # noqa: E501 + + :param body: + :type body: dict | bytes + + :rtype: TapiTopologyGetNodeDetails + """ + if connexion.request.is_json: + body = OperationsTapitopologygetnodedetailsBody.from_dict(connexion.request.get_json()) # noqa: E501 + return TapiTopologyGetNodeDetails(TapiTopologyGetnodedetailsOutput( + database.node(body.input.topology_id_or_name, + body.input.node_id_or_name))) + + +def operations_tapi_topologyget_node_edge_point_details_post(body=None): # noqa: E501 + """operates on tapi.topology.GetNodeEdgePointDetails + + operates on tapi.topology.GetNodeEdgePointDetails # noqa: E501 + + :param body: + :type body: dict | bytes + + :rtype: TapiTopologyGetNodeEdgePointDetails + """ + if connexion.request.is_json: + body = OperationsTapitopologygetnodeedgepointdetailsBody.from_dict(connexion.request.get_json()) # noqa: E501 + + return TapiTopologyGetNodeEdgePointDetails(TapiTopologyGetnodeedgepointdetailsOutput( + database.node_edge_point(body.input.topology_id_or_name, + body.input.node_id_or_name, + body.input.nep_id_or_name))) + + +def operations_tapi_topologyget_topology_details_post(body=None): # noqa: E501 + """operates on tapi.topology.GetTopologyDetails + + operates on tapi.topology.GetTopologyDetails # noqa: E501 + + :param body: + :type body: dict | bytes + + :rtype: TapiTopologyGetTopologyDetails + """ + if connexion.request.is_json: + body = OperationsTapitopologygettopologydetailsBody.from_dict(connexion.request.get_json()) # noqa: E501 + + return TapiTopologyGetTopologyDetails(TapiTopologyGettopologydetailsOutput( + database.topology(body.input.topology_id_or_name))) + + +def operations_tapi_topologyget_topology_list_post(): # noqa: E501 + """operations_tapi_topologyget_topology_list_post + + # noqa: E501 + + + :rtype: TapiTopologyGetTopologyList + """ + return TapiTopologyGetTopologyList(TapiTopologyGettopologylistOutput( + database.topology_list())) diff --git a/hackfest/tapi/server/tapi_server/database.py b/hackfest/tapi/server/tapi_server/database.py new file mode 100644 index 0000000000000000000000000000000000000000..f1450ab5a56658933a1f001dcf5fbb6a0b7754da --- /dev/null +++ b/hackfest/tapi/server/tapi_server/database.py @@ -0,0 +1,220 @@ +#!/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. + + +from tapi_server.models.tapi_common_context import TapiCommonContext +from tapi_server.models.tapi_connectivity_cep_list import TapiConnectivityCepList +from tapi_server.models.tapi_connectivity_connectivity_context import TapiConnectivityConnectivityContext + +context = TapiCommonContext() + +def service_interface_point_list (): + """Retrieve all ServiceInterfacePoints + + :rtype: List(ServiceInterfacePoint) + """ + return context.service_interface_point + + +def service_interface_point (sip_uuid): + """Retrieve ServiceInterfacePoint by ID + + :param sip_uuid: ID of ServiceInterfacePoint + :type sip_uuid: str + + :rtype: ServiceInterfacePoint + """ + for sip in context.service_interface_point: + if sip.uuid == sip_uuid: + return sip + + +def topology_list (): + """Retrieve all Topology + + :rtype: List(Topology) + """ + return context.topology_context.topology + + +def topology (topo_uuid): + """Retrieve Topology by ID + + :param topo_uuid: ID of Topology + :type topo_uuid: str + + :rtype: Topology + """ + for topo in context.topology_context.topology: + if topo.uuid == topo_uuid: + return topo + + +def node (topo_uuid, node_uuid): + """Retrieve Node by ID + + :param topo_uuid: ID of Topology + :type topo_uuid: str + :param node_uuid: ID of Node + :type node_uuid: str + + :rtype: Node + """ + for topo in context.topology_context.topology: + if topo.uuid == topo_uuid: + for node in topo.node: + if node.uuid == node_uuid: + return node + + +def link (topo_uuid, link_uuid): + """Retrieve Link by ID + + :param topo_uuid: ID of Topology + :type topo_uuid: str + :param link_uuid: ID of Link + :type link_uuid: str + + :rtype: Link + """ + for topo in context.topology_context.topology: + if topo.uuid == topo_uuid: + for link in topo.link: + if link.uuid == link_uuid: + return link + + +def node_edge_point (topo_uuid, node_uuid, nep_uuid): + """Retrieve NodeEdgePoint by ID + + :param topo_uuid: ID of Topology + :type uuid: str + :param node_uuid: ID of Node + :type node_uuid: str + :param nep_uuid: ID of NodeEdgePoint + :type nep_uuid: str + + :rtype: NodeEdgePoint + """ + for topo in context.topology_context.topology: + if topo.uuid == topo_uuid: + for node in topo.node: + if node.uuid == node_uuid: + for nep in node.owned_node_edge_point: + if nep.uuid == nep_uuid: + return nep + +def connection_end_point_list (topo_uuid, node_uuid, nep_uuid): + """Retrieve NodeEdgePoint by ID + + :param topo_uuid: ID of Topology + :type uuid: str + :param node_uuid: ID of Node + :type node_uuid: str + :param nep_uuid: ID of NodeEdgePoint + :type nep_uuid: str + + :rtype: List[ConnectionEndPoint] + """ + for topo in context.topology_context.topology: + if topo.uuid == topo_uuid: + for node in topo.node: + if node.uuid == node_uuid: + for nep in node.owned_node_edge_point: + if nep.uuid == nep_uuid: + if not hasattr(nep, "cep_list"): + nep.cep_list = TapiConnectivityCepList(connection_end_point=[]) + return nep.cep_list.connection_end_point + +def connection_end_point (topo_uuid, node_uuid, nep_uuid, cep_uuid): + """Retrieve NodeEdgePoint by ID + + :param topo_uuid: ID of Topology + :type uuid: str + :param node_uuid: ID of Node + :type node_uuid: str + :param nep_uuid: ID of NodeEdgePoint + :type nep_uuid: str + :param cep_uuid: ID of ConnectionEndPoint + :type cep_uuid: str + + :rtype: ConnectionEndPoint + """ + for topo in context.topology_context.topology: + if topo.uuid == topo_uuid: + for node in topo.node: + if node.uuid == node_uuid: + for nep in node.owned_node_edge_point: + if nep.uuid == nep_uuid: + if not hasattr(nep, "cep_list"): + nep.cep_list = TapiConnectivityCepList(connection_end_point=[]) + for cep in nep.cep_list.connection_end_point: + if cep.uuid == cep_uuid: + return cep + +def connectivity_context (): + """Retrieve ConnectivityContext + + :rtype: TapiConnectivityConnectivityContext + """ + if context.connectivity_context is None: + context.connectivity_context = TapiConnectivityConnectivityContext( + connectivity_service=[], connection=[] + ) + return context.connectivity_context + +def connectivity_service_list (): + """Retrieve all ConnectivityService + + :rtype: List(ConnectivityService) + """ + if context.connectivity_context is None: + context.connectivity_context = TapiConnectivityConnectivityContext( + connectivity_service=[], connection=[] + ) + return context.connectivity_context.connectivity_service + + +def connectivity_service (cs_uuid): + """Retrieve ConnectivityService by ID + + :param cs_uuid: ID of ConnectivityService + :type cs_uuid: str + + :rtype: Topology + """ + if context.connectivity_context is None: + context.connectivity_context = TapiConnectivityConnectivityContext( + connectivity_service=[], connection=[] + ) + for cs in context.connectivity_context.connectivity_service: + if cs.uuid == cs_uuid: + return cs + +def connection (conn_uuid): + """Retrieve Connection by ID + + :param conn_uuid: ID of Connection + :type conn_uuid: str + + :rtype: Connection + """ + if context.connectivity_context is None: + context.connectivity_context = TapiConnectivityConnectivityContext( + connectivity_service=[], connection=[] + ) + for conn in context.connectivity_context.connection: + if conn.uuid == conn_uuid: + return conn diff --git a/hackfest/tapi/server/tapi_server/database/mini-ols-context.json b/hackfest/tapi/server/tapi_server/database/mini-ols-context.json new file mode 100644 index 0000000000000000000000000000000000000000..59a4fb7cfb54df9a101ac5eda848f36553791704 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/database/mini-ols-context.json @@ -0,0 +1,728 @@ +{ + "uuid": "ols-ctx", + "service-interface-point": [ + { + "uuid": "node-4-port-16-output", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "OUTPUT" + }, + { + "uuid": "node-3-port-16-output", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "OUTPUT" + }, + { + "uuid": "node-1-port-14-output", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "OUTPUT" + }, + { + "uuid": "node-4-port-14-input", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "INPUT" + }, + { + "uuid": "node-3-port-13-input", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "INPUT" + }, + { + "uuid": "node-3-port-18-output", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "OUTPUT" + }, + { + "uuid": "node-2-port-15-input", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "INPUT" + }, + { + "uuid": "node-2-port-17-output", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "OUTPUT" + }, + { + "uuid": "node-1-port-15-input", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "INPUT" + }, + { + "uuid": "node-2-port-13-output", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "OUTPUT" + }, + { + "uuid": "node-4-port-13-output", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "OUTPUT" + }, + { + "uuid": "node-4-port-13-input", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "INPUT" + }, + { + "uuid": "node-1-port-17-input", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "INPUT" + }, + { + "uuid": "node-3-port-13-output", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "OUTPUT" + }, + { + "uuid": "node-3-port-17-output", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "OUTPUT" + }, + { + "uuid": "node-1-port-13-output", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "OUTPUT" + }, + { + "uuid": "node-4-port-15-output", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "OUTPUT" + }, + { + "uuid": "node-4-port-14-output", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "OUTPUT" + }, + { + "uuid": "node-4-port-17-output", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "OUTPUT" + }, + { + "uuid": "node-2-port-14-input", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "INPUT" + }, + { + "uuid": "node-3-port-14-input", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "INPUT" + }, + { + "uuid": "node-3-port-17-input", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "INPUT" + }, + { + "uuid": "node-1-port-17-output", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "OUTPUT" + }, + { + "uuid": "node-4-port-16-input", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "INPUT" + }, + { + "uuid": "node-3-port-14-output", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "OUTPUT" + }, + { + "uuid": "node-1-port-14-input", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "INPUT" + }, + { + "uuid": "node-1-port-13-input", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "INPUT" + }, + { + "uuid": "node-2-port-14-output", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "OUTPUT" + }, + { + "uuid": "node-3-port-15-output", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "OUTPUT" + }, + { + "uuid": "node-3-port-16-input", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "INPUT" + }, + { + "uuid": "node-3-port-18-input", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "INPUT" + }, + { + "uuid": "node-4-port-17-input", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "INPUT" + }, + { + "uuid": "node-3-port-15-input", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "INPUT" + }, + { + "uuid": "node-2-port-15-output", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "OUTPUT" + }, + { + "uuid": "node-2-port-17-input", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "INPUT" + }, + { + "uuid": "node-2-port-13-input", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "INPUT" + }, + { + "uuid": "node-4-port-15-input", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "INPUT" + }, + { + "uuid": "node-1-port-15-output", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "direction": "OUTPUT" + } + ], + "topology-context": { + "nw-topology-service": { + "uuid": "ols-ctx", + "topology": [{"topology-uuid": "ols-topo"}] + }, + "topology": [ + { + "uuid": "ols-topo", + "layer-protocol-name": ["PHOTONIC_MEDIA", "DSR"], + "node": [ + { + "uuid": "node-1", + "owned-node-edge-point": [ + { + "uuid": "node-1-port-13", + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": [ + {"service-interface-point-uuid": "node-1-port-13-output"}, + {"service-interface-point-uuid": "node-1-port-13-input"} + ], + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"] + }, + { + "uuid": "node-1-port-14", + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": [ + {"service-interface-point-uuid": "node-1-port-14-output"}, + {"service-interface-point-uuid": "node-1-port-14-input"} + ], + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"] + }, + { + "uuid": "node-1-port-15", + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": [ + {"service-interface-point-uuid": "node-1-port-15-input"}, + {"service-interface-point-uuid": "node-1-port-15-output"} + ], + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"] + }, + { + "uuid": "node-1-port-17", + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": [ + {"service-interface-point-uuid": "node-1-port-17-input"}, + {"service-interface-point-uuid": "node-1-port-17-output"} + ], + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"] + }, + { + "uuid": "node-1-port-3", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + }, + { + "uuid": "node-1-port-4", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + } + ] + }, + { + "uuid": "node-2", + "owned-node-edge-point": [ + { + "uuid": "node-2-port-13", + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": [ + {"service-interface-point-uuid": "node-2-port-13-output"}, + {"service-interface-point-uuid": "node-2-port-13-input"} + ], + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"] + }, + { + "uuid": "node-2-port-14", + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": [ + {"service-interface-point-uuid": "node-2-port-14-input"}, + {"service-interface-point-uuid": "node-2-port-14-output"} + ], + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"] + }, + { + "uuid": "node-2-port-15", + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": [ + {"service-interface-point-uuid": "node-2-port-15-input"}, + {"service-interface-point-uuid": "node-2-port-15-output"} + ], + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"] + }, + { + "uuid": "node-2-port-17", + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": [ + {"service-interface-point-uuid": "node-2-port-17-output"}, + {"service-interface-point-uuid": "node-2-port-17-input"} + ], + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"] + }, + { + "uuid": "node-2-port-3", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + }, + { + "uuid": "node-2-port-4", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + } + ] + }, + { + "uuid": "node-3", + "owned-node-edge-point": [ + { + "uuid": "node-3-port-13", + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": [ + {"service-interface-point-uuid": "node-3-port-13-input"}, + {"service-interface-point-uuid": "node-3-port-13-output"} + ], + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"] + }, + { + "uuid": "node-3-port-14", + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": [ + {"service-interface-point-uuid": "node-3-port-14-input"}, + {"service-interface-point-uuid": "node-3-port-14-output"} + ], + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"] + }, + { + "uuid": "node-3-port-15", + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": [ + {"service-interface-point-uuid": "node-3-port-15-output"}, + {"service-interface-point-uuid": "node-3-port-15-input"} + ], + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"] + }, + { + "uuid": "node-3-port-16", + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": [ + {"service-interface-point-uuid": "node-3-port-16-output"}, + {"service-interface-point-uuid": "node-3-port-16-input"} + ], + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"] + }, + { + "uuid": "node-3-port-17", + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": [ + {"service-interface-point-uuid": "node-3-port-17-output"}, + {"service-interface-point-uuid": "node-3-port-17-input"} + ], + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"] + }, + { + "uuid": "node-3-port-18", + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": [ + {"service-interface-point-uuid": "node-3-port-18-output"}, + {"service-interface-point-uuid": "node-3-port-18-input"} + ], + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"] + }, + { + "uuid": "node-3-port-1", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + }, + { + "uuid": "node-3-port-2", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + }, + { + "uuid": "node-3-port-4", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + } + ] + }, + { + "uuid": "node-4", + "owned-node-edge-point": [ + { + "uuid": "node-4-port-13", + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": [ + {"service-interface-point-uuid": "node-4-port-13-output"}, + {"service-interface-point-uuid": "node-4-port-13-input"} + ], + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"] + }, + { + "uuid": "node-4-port-14", + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": [ + {"service-interface-point-uuid": "node-4-port-14-input"}, + {"service-interface-point-uuid": "node-4-port-14-output"} + ], + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"] + }, + { + "uuid": "node-4-port-15", + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": [ + {"service-interface-point-uuid": "node-4-port-15-output"}, + {"service-interface-point-uuid": "node-4-port-15-input"} + ], + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"] + }, + { + "uuid": "node-4-port-16", + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": [ + {"service-interface-point-uuid": "node-4-port-16-output"}, + {"service-interface-point-uuid": "node-4-port-16-input"} + ], + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"] + }, + { + "uuid": "node-4-port-17", + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": [ + {"service-interface-point-uuid": "node-4-port-17-output"}, + {"service-interface-point-uuid": "node-4-port-17-input"} + ], + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"] + }, + { + "uuid": "node-4-port-1", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + }, + { + "uuid": "node-4-port-2", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + }, + { + "uuid": "node-4-port-3", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": ["tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC"], + "link-port-direction": "UNIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + } + ] + } + ], + "link": [ + { + "uuid": "link-1:3-3:1", + "direction": "UNIDIRECTIONAL", + "cost-characteristic": [{"cost-name": "te-metric", "cost-value": 1}], + "node-edge-point": [ + {"topology-uuid": "ols-topo", "node-uuid": "node-1", "node-edge-point-uuid": "node-1-port-3"}, + {"topology-uuid": "ols-topo", "node-uuid": "node-3", "node-edge-point-uuid": "node-3-port-1"} + ], + "layer-protocol-name": ["PHOTONIC_MEDIA"] + }, + { + "uuid": "link-1:4-4:1", + "direction": "UNIDIRECTIONAL", + "cost-characteristic": [{"cost-name": "te-metric", "cost-value": 1}], + "node-edge-point": [ + {"topology-uuid": "ols-topo", "node-uuid": "node-1", "node-edge-point-uuid": "node-1-port-4"}, + {"topology-uuid": "ols-topo", "node-uuid": "node-4", "node-edge-point-uuid": "node-4-port-1"} + ], + "layer-protocol-name": ["PHOTONIC_MEDIA"] + }, + { + "uuid": "link-2:3-3:2", + "direction": "UNIDIRECTIONAL", + "cost-characteristic": [{"cost-name": "te-metric", "cost-value": 1}], + "node-edge-point": [ + {"topology-uuid": "ols-topo", "node-uuid": "node-2", "node-edge-point-uuid": "node-2-port-3"}, + {"topology-uuid": "ols-topo", "node-uuid": "node-3", "node-edge-point-uuid": "node-3-port-2"} + ], + "layer-protocol-name": ["PHOTONIC_MEDIA"] + }, + { + "uuid": "link-2:4-4:2", + "direction": "UNIDIRECTIONAL", + "cost-characteristic": [{"cost-name": "te-metric", "cost-value": 1}], + "node-edge-point": [ + {"topology-uuid": "ols-topo", "node-uuid": "node-2", "node-edge-point-uuid": "node-2-port-4"}, + {"topology-uuid": "ols-topo", "node-uuid": "node-4", "node-edge-point-uuid": "node-4-port-2"} + ], + "layer-protocol-name": ["PHOTONIC_MEDIA"] + }, + { + "uuid": "link-3:1-1:3", + "direction": "UNIDIRECTIONAL", + "cost-characteristic": [{"cost-name": "te-metric", "cost-value": 1}], + "node-edge-point": [ + {"topology-uuid": "ols-topo", "node-uuid": "node-3", "node-edge-point-uuid": "node-3-port-1"}, + {"topology-uuid": "ols-topo", "node-uuid": "node-1", "node-edge-point-uuid": "node-1-port-3"} + ], + "layer-protocol-name": ["PHOTONIC_MEDIA"] + }, + { + "uuid": "link-3:2-2:3", + "direction": "UNIDIRECTIONAL", + "cost-characteristic": [{"cost-name": "te-metric", "cost-value": 1}], + "node-edge-point": [ + {"topology-uuid": "ols-topo", "node-uuid": "node-3", "node-edge-point-uuid": "node-3-port-2"}, + {"topology-uuid": "ols-topo", "node-uuid": "node-2", "node-edge-point-uuid": "node-2-port-3"} + ], + "layer-protocol-name": ["PHOTONIC_MEDIA"] + }, + { + "uuid": "link-3:4-4:3", + "direction": "UNIDIRECTIONAL", + "cost-characteristic": [{"cost-name": "te-metric", "cost-value": 1}], + "node-edge-point": [ + {"topology-uuid": "ols-topo", "node-uuid": "node-3", "node-edge-point-uuid": "node-3-port-4"}, + {"topology-uuid": "ols-topo", "node-uuid": "node-4", "node-edge-point-uuid": "node-4-port-3"} + ], + "layer-protocol-name": ["PHOTONIC_MEDIA"] + }, + { + "uuid": "link-4:1-1:4", + "direction": "UNIDIRECTIONAL", + "cost-characteristic": [{"cost-name": "te-metric", "cost-value": 1}], + "node-edge-point": [ + {"topology-uuid": "ols-topo", "node-uuid": "node-4", "node-edge-point-uuid": "node-4-port-1"}, + {"topology-uuid": "ols-topo", "node-uuid": "node-1", "node-edge-point-uuid": "node-1-port-4"} + ], + "layer-protocol-name": ["PHOTONIC_MEDIA"] + }, + { + "uuid": "link-4:2-2:4", + "direction": "UNIDIRECTIONAL", + "cost-characteristic": [{"cost-name": "te-metric", "cost-value": 1}], + "node-edge-point": [ + {"topology-uuid": "ols-topo", "node-uuid": "node-4", "node-edge-point-uuid": "node-4-port-2"}, + {"topology-uuid": "ols-topo", "node-uuid": "node-2", "node-edge-point-uuid": "node-2-port-4"} + ], + "layer-protocol-name": ["PHOTONIC_MEDIA"] + }, + { + "uuid": "link-4:3-3:4", + "direction": "UNIDIRECTIONAL", + "cost-characteristic": [{"cost-name": "te-metric", "cost-value": 1}], + "node-edge-point": [ + {"topology-uuid": "ols-topo", "node-uuid": "node-4", "node-edge-point-uuid": "node-4-port-3"}, + {"topology-uuid": "ols-topo", "node-uuid": "node-3", "node-edge-point-uuid": "node-3-port-4"} + ], + "layer-protocol-name": ["PHOTONIC_MEDIA"] + } + ] + } + ] + }, + "connectivity-context": { + "connectivity-service": [], + "connection": [] + } +} diff --git a/hackfest/tapi/server/tapi_server/database/odu_context.json b/hackfest/tapi/server/tapi_server/database/odu_context.json new file mode 100644 index 0000000000000000000000000000000000000000..20f4c96a5e0a2a7be15d96fee188a5bf3a2d9652 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/database/odu_context.json @@ -0,0 +1,1817 @@ +{ + "uuid": "ctx-ref", + "name": + [ + { + "value-name": "name", + "value": "REFERENCE_CONTEXT" + } + ], + + "service-interface-point": + [ + { + "uuid": "sip-pe1-uni1", + "name": + [ + { + "value-name": "name", + "value": "PE_01_UNI_01" + } + ], + + "layer-protocol-name": + [ + "ETH" + ], + + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "total-potential-capacity": + { + "total-size": + { + "value": "10", + "unit": "GBPS" + } + }, + + "available-capacity": + { + "total-size": + { + "value": "10", + "unit": "GBPS" + } + } + }, + + { + "uuid": "sip-pe1-uni2", + "name": + [ + { + "value-name": "name", + "value": "PE_01_UNI_02" + } + ], + + "layer-protocol-name": + [ + "ETH" + ], + + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "total-potential-capacity": + { + "total-size": + { + "value": "10", + "unit": "GBPS" + } + }, + + "available-capacity": + { + "total-size": + { + "value": "10", + "unit": "GBPS" + } + } + }, + + { + "uuid": "sip-pe2-uni1", + "name": + [ + { + "value-name": "name", + "value": "PE_02_UNI_01" + } + ], + + "layer-protocol-name": + [ + "ETH" + ], + + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "total-potential-capacity": + { + "total-size": + { + "value": "10", + "unit": "GBPS" + } + }, + + "available-capacity": + { + "total-size": + { + "value": "10", + "unit": "GBPS" + } + } + }, + + { + "uuid": "sip-pe2-uni2", + "name": + [ + { + "value-name": "name", + "value": "PE_02_UNI_02" + } + ], + + "layer-protocol-name": + [ + "ETH" + ], + + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "total-potential-capacity": + { + "total-size": + { + "value": "10", + "unit": "GBPS" + } + }, + + "available-capacity": + { + "total-size": + { + "value": "10", + "unit": "GBPS" + } + } + }, + + { + "uuid": "sip-pe3-uni1", + "name": + [ + { + "value-name": "name", + "value": "PE_03_UNI_01" + } + ], + + "layer-protocol-name": + [ + "ETH" + ], + + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "total-potential-capacity": + { + "total-size": + { + "value": "10", + "unit": "GBPS" + } + }, + + "available-capacity": + { + "total-size": + { + "value": "10", + "unit": "GBPS" + } + } + }, + + { + "uuid": "sip-pe3-uni2", + "name": + [ + { + "value-name": "name", + "value": "PE_03_UNI_02" + } + ], + + "layer-protocol-name": + [ + "ETH" + ], + + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "total-potential-capacity": + { + "total-size": + { + "value": "10", + "unit": "GBPS" + } + }, + + "available-capacity": + { + "total-size": + { + "value": "10", + "unit": "GBPS" + } + } + } + ], + + "topology-context": { + "topology": + [ + { + "uuid": "topo-nwk", + "name": + [ + { + "value-name": "name", + "value": "NETWORK_TOPOLOGY" + } + ], + + "node": + [ + { + "uuid": "node-mul-pe-1", + "name": + [ + { + "value-name": "name", + "value": "PE_01_MULTILAYER_NODE" + } + ], + + "layer-protocol-name": + [ + "ETH", + "ODU" + ], + + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "encap-topology": "/restconf/config/context/topology/topo-pe1", + "owned-node-edge-point": + [ + + ], + + "aggregated-node-edge-point": + [ + "/restconf/config/context/topology/topo-pe1/node/node-eth-pe-1/owned-node-edge-point/nep-pe1-eth-uni1", + "/restconf/config/context/topology/topo-pe1/node/node-eth-pe-1/owned-node-edge-point/nep-pe1-eth-uni2", + "/restconf/config/context/topology/topo-pe1/node/node-odu-pe-1/owned-node-edge-point/nep-pe1-odu4-nni1", + "/restconf/config/context/topology/topo-pe1/node/node-odu-pe-1/owned-node-edge-point/nep-pe1-odu4-nni2" + ] + }, + + { + "uuid": "node-mul-pe-2", + "name": + [ + { + "value-name": "name", + "value": "PE_02_MULTILAYER_NODE" + } + ], + + "layer-protocol-name": + [ + "ETH", + "ODU" + ], + + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "encap-topology": "/restconf/config/context/topology/topo-pe2", + "owned-node-edge-point": + [ + + ], + + "aggregated-node-edge-point": + [ + "/restconf/config/context/topology/topo-pe2/node/node-eth-pe-2/owned-node-edge-point/nep-pe2-eth-uni1", + "/restconf/config/context/topology/topo-pe2/node/node-eth-pe-2/owned-node-edge-point/nep-pe2-eth-uni2", + "/restconf/config/context/topology/topo-pe2/node/node-odu-pe-2/owned-node-edge-point/nep-pe2-odu4-nni1", + "/restconf/config/context/topology/topo-pe2/node/node-odu-pe-2/owned-node-edge-point/nep-pe2-odu4-nni2" + ] + }, + + { + "uuid": "node-mul-pe-3", + "name": + [ + { + "value-name": "name", + "value": "PE_03_MULTILAYER_NODE" + } + ], + + "layer-protocol-name": + [ + "ETH", + "ODU" + ], + + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "encap-topology": "/restconf/config/context/topology/topo-pe3", + "owned-node-edge-point": + [ + + ], + + "aggregated-node-edge-point": + [ + "/restconf/config/context/topology/topo-pe3/node/node-eth-pe-3/owned-node-edge-point/nep-pe3-eth-uni1", + "/restconf/config/context/topology/topo-pe2/node/node-eth-pe-3/owned-node-edge-point/nep-pe3-eth-uni2", + "/restconf/config/context/topology/topo-pe3/node/node-odu-pe-3/owned-node-edge-point/nep-pe3-odu4-nni1", + "/restconf/config/context/topology/topo-pe3/node/node-odu-pe-3/owned-node-edge-point/nep-pe3-odu4-nni2", + "/restconf/config/context/topology/topo-pe3/node/node-odu-pe-3/owned-node-edge-point/nep-pe3-odu4-nni3" + ] + }, + + { + "uuid": "node-odu-pi-4", + "name": + [ + { + "value-name": "name", + "value": "PI_04_ODU_NODE" + } + ], + + "layer-protocol-name": + [ + "ODU" + ], + + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "aggregated-node-edge-point": + [ + "/restconf/config/context/topology/topo-nwk/node/node-odu-pi-4/owned-node-edge-point/nep-pi4-odu4-nni1", + "/restconf/config/context/topology/topo-nwk/node/node-odu-pi-4/owned-node-edge-point/nep-pi4-odu4-nni2", + "/restconf/config/context/topology/topo-nwk/node/node-odu-pi-4/owned-node-edge-point/nep-pi4-odu4-nni3" + ], + + "owned-node-edge-point": + [ + { + "uuid": "nep-pi4-odu4-nni1", + "name": + [ + { + "value-name": "name", + "value": "PI_04_ODU4_NNI_01" + } + ], + + "layer-protocol-name": "ODU", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + }, + + { + "uuid": "nep-pi4-odu4-nni2", + "name": + [ + { + "value-name": "name", + "value": "PI_04_ODU4_NNI_02" + } + ], + + "layer-protocol-name": "ODU", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + }, + + { + "uuid": "nep-pi4-odu4-nni3", + "name": + [ + { + "value-name": "name", + "value": "PI_04_ODU4_NNI_03" + } + ], + + "layer-protocol-name": "ODU", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + } + ] + } + ], + + "link": + [ + { + "uuid": "link-pe1-odu4-nni1-pi4-odu4-nni2", + "name": + [ + { + "value-name": "name", + "value": "PE_01_ODU4_NNI_01-PI_04_ODU4_NNI_02" + } + ], + + "layer-protocol-name": + [ + "ODU" + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "direction": "BIDIRECTIONAL", + "resilience-type": + { + "protection-type": "NO_PROTECTON", + "restoration-policy": "NA" + }, + + "total-potential-capacity": + { + "total-size": + { + "value": "100", + "unit": "GBPS" + } + }, + + "available-capacity": + { + "total-size": + { + "value": "90", + "unit": "GBPS" + } + }, + + "cost-characteristic": + [ + { + "cost-name": "hop_count", + "cost-value": "1" + } + ], + + "latency-characteristic": + [ + { + "traffic-property-name": "FixedLatency", + "fixed-latency-characteristic": "1" + } + ], + + "node-edge-point": + [ + "/restconf/config/context/topology/topo-pe1/node/node-odu-pe-1/owned-node-edge-point/nep-pe1-odu4-nni1", + "/restconf/config/context/topology/topo-nwk/node/node-odu-pi-4/owned-node-edge-point/nep-pi4-odu4-nni2" + ] + }, + + { + "uuid": "link-pe2-odu4-nni2-pi4-odu4-nni1", + "name": + [ + { + "value-name": "name", + "value": "PE_02_ODU4_NNI_02-PI_04_ODU4_NNI_01" + } + ], + + "layer-protocol-name": + [ + "ODU" + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "direction": "BIDIRECTIONAL", + "resilience-type": + { + "protection-type": "NO_PROTECTON", + "restoration-policy": "NA" + }, + + "total-potential-capacity": + { + "total-size": + { + "value": "100", + "unit": "GBPS" + } + }, + + "available-capacity": + { + "total-size": + { + "value": "90", + "unit": "GBPS" + } + }, + + "cost-characteristic": + [ + { + "cost-name": "hop_count", + "cost-value": "1" + } + ], + + "latency-characteristic": + [ + { + "traffic-property-name": "FixedLatency", + "fixed-latency-characteristic": "1" + } + ], + + "node-edge-point": + [ + "/restconf/config/context/topology/topo-pe2/node/node-odu-pe-2/owned-node-edge-point/nep-pe2-odu4-nni2", + "/restconf/config/context/topology/topo-nwk/node/node-odu-pi-4/owned-node-edge-point/nep-pi4-odu4-nni1" + ] + }, + + { + "uuid": "link-pe3-odu4-nni3-pi4-odu4-nni3", + "name": + [ + { + "value-name": "name", + "value": "PE_03_ODU4_NNI_03-PI_04_ODU4_NNI_03" + } + ], + + "layer-protocol-name": + [ + "ODU" + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "direction": "BIDIRECTIONAL", + "resilience-type": + { + "protection-type": "NO_PROTECTON", + "restoration-policy": "NA" + }, + + "total-potential-capacity": + { + "total-size": + { + "value": "100", + "unit": "GBPS" + } + }, + + "available-capacity": + { + "total-size": + { + "value": "100", + "unit": "GBPS" + } + }, + + "cost-characteristic": + [ + { + "cost-name": "hop_count", + "cost-value": "1" + } + ], + + "latency-characteristic": + [ + { + "traffic-property-name": "FixedLatency", + "fixed-latency-characteristic": "1" + } + ], + + "node-edge-point": + [ + "/restconf/config/context/topology/topo-pe3/node/node-odu-pe-3/owned-node-edge-point/nep-pe3-odu4-nni3", + "/restconf/config/context/topology/topo-nwk/node/node-odu-pi-4/owned-node-edge-point/nep-pi4-odu4-nni3" + ] + }, + + { + "uuid": "link-pe1-odu4-nni2-pe3-odu4-nni1", + "name": + [ + { + "value-name": "name", + "value": "PE_01_ODU4_NNI_02-PE_03_ODU4_NNI_01" + } + ], + + "layer-protocol-name": + [ + "ODU" + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "direction": "BIDIRECTIONAL", + "resilience-type": + { + "protection-type": "NO_PROTECTON", + "restoration-policy": "NA" + }, + + "total-potential-capacity": + { + "total-size": + { + "value": "100", + "unit": "GBPS" + } + }, + + "available-capacity": + { + "total-size": + { + "value": "100", + "unit": "GBPS" + } + }, + + "cost-characteristic": + [ + { + "cost-name": "hop_count", + "cost-value": "1" + } + ], + + "latency-characteristic": + [ + { + "traffic-property-name": "FixedLatency", + "fixed-latency-characteristic": "1" + } + ], + + "node-edge-point": + [ + "/restconf/config/context/topology/topo-pe1/node/node-odu-pe-1/owned-node-edge-point/nep-pe1-odu4-nni2", + "/restconf/config/context/topology/topo-pe3/node/node-odu-pe-3/owned-node-edge-point/nep-pe3-odu4-nni1" + ] + }, + + { + "uuid": "link-pe2-odu4-nni1-pe3-odu4-nni2", + "name": + [ + { + "value-name": "name", + "value": "PE_02_ODU4_NNI_01-PE_03_ODU4_NNI_02" + } + ], + + "layer-protocol-name": + [ + "ODU" + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "direction": "BIDIRECTIONAL", + "resilience-type": + { + "protection-type": "NO_PROTECTON", + "restoration-policy": "NA" + }, + + "total-potential-capacity": + { + "total-size": + { + "value": "100", + "unit": "GBPS" + } + }, + + "available-capacity": + { + "total-size": + { + "value": "100", + "unit": "GBPS" + } + }, + + "cost-characteristic": + [ + { + "cost-name": "hop_count", + "cost-value": "1" + } + ], + + "latency-characteristic": + [ + { + "traffic-property-name": "FixedLatency", + "fixed-latency-characteristic": "1" + } + ], + + "node-edge-point": + [ + "/restconf/config/context/topology/topo-pe2/node/node-odu-pe-2/owned-node-edge-point/nep-pe2-odu4-nni1", + "/restconf/config/context/topology/topo-pe3/node/node-odu-pe-3/owned-node-edge-point/nep-pe3-odu4-nni2" + ] + }, + + { + "uuid": "link-pe1-odu2-nni1-pe2-odu2-nni2", + "name": + [ + { + "value-name": "name", + "value": "PE_01_ODU2_NNI_01-PE_02_ODU2_NNI_02" + } + ], + + "layer-protocol-name": + [ + "ODU" + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "direction": "BIDIRECTIONAL", + "resilience-type": + { + "protection-type": "NO_PROTECTON", + "restoration-policy": "NA" + }, + + "total-potential-capacity": + { + "total-size": + { + "value": "10", + "unit": "GBPS" + } + }, + + "available-capacity": + { + "total-size": + { + "value": "10", + "unit": "GBPS" + } + }, + + "cost-characteristic": + [ + { + "cost-name": "hop_count", + "cost-value": "3" + } + ], + + "latency-characteristic": + [ + { + "traffic-property-name": "FixedLatency", + "fixed-latency-characteristic": "3" + } + ], + + "node-edge-point": + [ + "/restconf/config/context/topology/topo-pe1/node/node-odu-pe-1/owned-node-edge-point/nep-pe1-odu2-nni1", + "/restconf/config/context/topology/topo-pe2/node/node-odu-pe-2/owned-node-edge-point/nep-pe2-odu2-nni2" + ] + }, + + { + "uuid": "link-pe1-odu2-clt1-pe2-odu2-clt1", + "name": + [ + { + "value-name": "name", + "value": "PE_01_ODU2_CLT_01-PE_02_ODU2_CLT_01" + } + ], + + "layer-protocol-name": + [ + "ETH" + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "direction": "BIDIRECTIONAL", + "resilience-type": + { + "protection-type": "NO_PROTECTON", + "restoration-policy": "NA" + }, + + "total-potential-capacity": + { + "total-size": + { + "value": "10", + "unit": "GBPS" + } + }, + + "available-capacity": + { + "total-size": + { + "value": "0", + "unit": "GBPS" + } + }, + + "cost-characteristic": + [ + { + "cost-name": "hop_count", + "cost-value": "5" + } + ], + + "latency-characteristic": + [ + { + "traffic-property-name": "FixedLatency", + "fixed-latency-characteristic": "7" + } + ], + + "node-edge-point": + [ + "/restconf/config/context/topology/topo-pe1/node/node-eth-pe-1/owned-node-edge-point/nep-pe1-odu2-clt1", + "/restconf/config/context/topology/topo-pe2/node/node-eth-pe-2/owned-node-edge-point/nep-pe2-odu2-clt1" + ] + } + ] + }, + + { + "uuid": "topo-pe1", + "name": + [ + { + "value-name": "name", + "value": "PE_01_INTERNAL_TOPOLOGY" + } + ], + + "node": + [ + { + "uuid": "node-eth-pe-1", + "name": + [ + { + "value-name": "name", + "value": "PE_01_ETH_NODE" + } + ], + + "layer-protocol-name": + [ + "ETH" + ], + + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "aggregated-node-edge-point": + [ + "/restconf/config/context/topology/topo-pe1/node/node-eth-pe-1/owned-node-edge-point/nep-pe1-eth-uni1", + "/restconf/config/context/topology/topo-pe1/node/node-eth-pe-1/owned-node-edge-point/nep-pe1-eth-uni2", + "/restconf/config/context/topology/topo-pe1/node/node-eth-pe-1/owned-node-edge-point/nep-pe1-eth-pool", + "/restconf/config/context/topology/topo-pe1/node/node-eth-pe-1/owned-node-edge-point/nep-pe1-odu2-clt1" + ], + + "owned-node-edge-point": + [ + { + "uuid": "nep-pe1-eth-uni1", + "name": + [ + { + "value-name": "name", + "value": "PE_01_ETH_UNI_01" + } + ], + + "layer-protocol-name": "ETH", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": + [ + "/restconf/config/context/service-interface-point/sip-pe1-uni1" + ] + }, + + { + "uuid": "nep-pe1-eth-uni2", + "name": + [ + { + "value-name": "name", + "value": "PE_01_ETH_UNI_02" + } + ], + + "layer-protocol-name": "ETH", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": + [ + "/restconf/config/context/service-interface-point/sip-pe1-uni2" + ] + }, + + { + "uuid": "nep-pe1-eth-pool", + "name": + [ + { + "value-name": "name", + "value": "PE_01_ETH_NEP_POOL" + } + ], + + "layer-protocol-name": "ETH", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "aggregated-node-edge-point": + [ + "/restconf/config/context/topology/topo-pe1/node/node-eth-pe-1/owned-node-edge-point/nep-pe1-odu2-clt1" + ] + }, + + { + "uuid": "nep-pe1-odu2-clt1", + "name": + [ + { + "value-name": "name", + "value": "PE_01_ODU2_CLT_01" + } + ], + + "layer-protocol-name": "ETH", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + } + ] + }, + + { + "uuid": "node-odu-pe-1", + "name": + [ + { + "value-name": "name", + "value": "PE_01_ODU_NODE" + } + ], + + "layer-protocol-name": + [ + "ODU" + ], + + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "aggregated-node-edge-point": + [ + "/restconf/config/context/topology/topo-pe1/node/node-odu-pe-1/owned-node-edge-point/nep-pe1-odu4-nni1", + "/restconf/config/context/topology/topo-pe1/node/node-odu-pe-1/owned-node-edge-point/nep-pe1-odu4-nni2", + "/restconf/config/context/topology/topo-pe1/node/node-odu-pe-1/owned-node-edge-point/nep-pe1-odu2-nni1", + "/restconf/config/context/topology/topo-pe1/node/node-odu-pe-1/owned-node-edge-point/nep-pe1-odu2-pool" + ], + + "owned-node-edge-point": + [ + { + "uuid": "nep-pe1-odu4-nni1", + "name": + [ + { + "value-name": "name", + "value": "PE_01_ODU4_NNI_01" + } + ], + + "layer-protocol-name": "ODU", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + }, + + { + "uuid": "nep-pe1-odu4-nni2", + "name": + [ + { + "value-name": "name", + "value": "PE_01_ODU4_NNI_02" + } + ], + + "layer-protocol-name": "ODU", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + }, + + { + "uuid": "nep-pe1-odu2-nni1", + "name": + [ + { + "value-name": "name", + "value": "PE_01_ODU2_NNI_01" + } + ], + + "layer-protocol-name": "ODU", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + }, + + { + "uuid": "nep-pe1-odu2-pool", + "name": + [ + { + "value-name": "name", + "value": "PE_01_ODU2_TTP_POOL" + } + ], + + "layer-protocol-name": "ODU", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + } + ] + } + ], + + "link": + [ + { + "uuid": "link-pe1-eth-pool-pe1-odu2-pool", + "name": + [ + { + "value-name": "name", + "value": "PE_01_ETH_POOL-PE_01_ODU2_POOL" + } + ], + + "layer-protocol-name": + [ + "ETH", + "ODU" + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "direction": "BIDIRECTIONAL", + "resilience-type": + { + "protection-type": "NO_PROTECTON", + "restoration-policy": "NA" + }, + + "total-potential-capacity": + { + "total-size": + { + "value": "200", + "unit": "GBPS" + } + }, + + "available-capacity": + { + "total-size": + { + "value": "190", + "unit": "GBPS" + } + }, + + "cost-characteristic": + [ + { + "cost-name": "hop_count", + "cost-value": "1" + } + ], + + "latency-characteristic": + [ + { + "traffic-property-name": "FixedLatency", + "fixed-latency-characteristic": "2" + } + ], + + "node-edge-point": + [ + "/restconf/config/context/topology/topo-pe1/node/node-eth-pe-1/owned-node-edge-point/nep-pe1-eth-pool", + "/restconf/config/context/topology/topo-pe1/node/node-odu-pe-1/owned-node-edge-point/nep-pe1-odu2-pool" + ] + } + ] + }, + + { + "uuid": "topo-pe2", + "name": + [ + { + "value-name": "name", + "value": "PE_02_INTERNAL_TOPOLOGY" + } + ], + + "node": + [ + { + "uuid": "node-eth-pe-2", + "name": + [ + { + "value-name": "name", + "value": "PE_02_ETH_NODE" + } + ], + + "layer-protocol-name": + [ + "ETH" + ], + + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "aggregated-node-edge-point": + [ + "/restconf/config/context/topology/topo-pe2/node/node-eth-pe-2/owned-node-edge-point/nep-pe2-eth-uni1", + "/restconf/config/context/topology/topo-pe2/node/node-eth-pe-2/owned-node-edge-point/nep-pe2-eth-uni2", + "/restconf/config/context/topology/topo-pe2/node/node-eth-pe-2/owned-node-edge-point/nep-pe2-eth-pool", + "/restconf/config/context/topology/topo-pe2/node/node-eth-pe-2/owned-node-edge-point/nep-pe2-odu2-clt1" + ], + + "owned-node-edge-point": + [ + { + "uuid": "nep-pe2-eth-uni1", + "name": + [ + { + "value-name": "name", + "value": "PE_02_ETH_UNI_01" + } + ], + + "layer-protocol-name": "ETH", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": + [ + "/restconf/config/context/service-interface-point/sip-pe2-uni1" + ] + }, + + { + "uuid": "nep-pe2-eth-uni2", + "name": + [ + { + "value-name": "name", + "value": "PE_02_ETH_UNI_02" + } + ], + + "layer-protocol-name": "ETH", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": + [ + "/restconf/config/context/service-interface-point/sip-pe2-uni2" + ] + }, + + { + "uuid": "nep-pe2-eth-pool", + "name": + [ + { + "value-name": "name", + "value": "PE_02_ETH_NEP_POOL" + } + ], + + "layer-protocol-name": "ETH", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "aggregated-node-edge-point": + [ + "/restconf/config/context/topology/topo-pe2/node/node-eth-pe-2/owned-node-edge-point/nep-pe2-odu2-clt1" + ] + }, + + { + "uuid": "nep-pe2-odu2-clt1", + "name": + [ + { + "value-name": "name", + "value": "PE_02_ODU2_CLT_01" + } + ], + + "layer-protocol-name": "ETH", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + } + ] + }, + + { + "uuid": "node-odu-pe-2", + "name": + [ + { + "value-name": "name", + "value": "PE_02_ODU_NODE" + } + ], + + "layer-protocol-name": + [ + "ODU" + ], + + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "aggregated-node-edge-point": + [ + "/restconf/config/context/topology/topo-pe2/node/node-odu-pe-2/owned-node-edge-point/nep-pe2-odu4-nni1", + "/restconf/config/context/topology/topo-pe2/node/node-odu-pe-2/owned-node-edge-point/nep-pe2-odu4-nni2", + "/restconf/config/context/topology/topo-pe2/node/node-odu-pe-2/owned-node-edge-point/nep-pe2-odu2-nni1", + "/restconf/config/context/topology/topo-pe2/node/node-odu-pe-2/owned-node-edge-point/nep-pe2-odu2-pool" + ], + + "owned-node-edge-point": + [ + { + "uuid": "nep-pe2-odu4-nni1", + "name": + [ + { + "value-name": "name", + "value": "PE_02_ODU4_NNI_01" + } + ], + + "layer-protocol-name": "ODU", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + }, + + { + "uuid": "nep-pe2-odu4-nni2", + "name": + [ + { + "value-name": "name", + "value": "PE_02_ODU4_NNI_02" + } + ], + + "layer-protocol-name": "ODU", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + }, + + { + "uuid": "nep-pe2-odu2-nni2", + "name": + [ + { + "value-name": "name", + "value": "PE_02_ODU2_NNI_02" + } + ], + + "layer-protocol-name": "ODU", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + }, + + { + "uuid": "nep-pe2-odu2-pool", + "name": + [ + { + "value-name": "name", + "value": "PE_02_ODU2_TTP_POOL" + } + ], + + "layer-protocol-name": "ODU", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + } + ] + } + ], + + "link": + [ + { + "uuid": "link-pe2-eth-pool-pe2-odu2-pool", + "name": + [ + { + "value-name": "name", + "value": "PE_02_ETH_POOL-PE_02_ODU2_POOL" + } + ], + + "layer-protocol-name": + [ + "ETH", + "ODU" + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "direction": "BIDIRECTIONAL", + "resilience-type": + { + "protection-type": "NO_PROTECTON", + "restoration-policy": "NA" + }, + + "total-potential-capacity": + { + "total-size": + { + "value": "200", + "unit": "GBPS" + } + }, + + "available-capacity": + { + "total-size": + { + "value": "190", + "unit": "GBPS" + } + }, + + "cost-characteristic": + [ + { + "cost-name": "hop_count", + "cost-value": "1" + } + ], + + "latency-characteristic": + [ + { + "traffic-property-name": "FixedLatency", + "fixed-latency-characteristic": "2" + } + ], + + "node-edge-point": + [ + "/restconf/config/context/topology/topo-pe2/node/node-eth-pe-2/owned-node-edge-point/nep-pe2-eth-pool", + "/restconf/config/context/topology/topo-pe2/node/node-odu-pe-2/owned-node-edge-point/nep-pe2-odu2-pool" + ] + } + ] + }, + + { + "uuid": "topo-pe3", + "name": + [ + { + "value-name": "name", + "value": "PE_03_INTERNAL_TOPOLOGY" + } + ], + + "node": + [ + { + "uuid": "node-eth-pe-3", + "name": + [ + { + "value-name": "name", + "value": "PE_03_ETH_NODE" + } + ], + + "layer-protocol-name": + [ + "ETH" + ], + + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "aggregated-node-edge-point": + [ + "/restconf/config/context/topology/topo-pe3/node/node-eth-pe-3/owned-node-edge-point/nep-pe3-eth-uni1", + "/restconf/config/context/topology/topo-pe3/node/node-eth-pe-3/owned-node-edge-point/nep-pe3-eth-uni2", + "/restconf/config/context/topology/topo-pe3/node/node-eth-pe-3/owned-node-edge-point/nep-pe3-eth-pool" + ], + + "owned-node-edge-point": + [ + { + "uuid": "nep-pe3-eth-uni1", + "name": + [ + { + "value-name": "name", + "value": "PE_03_ETH_UNI_01" + } + ], + + "layer-protocol-name": "ETH", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": + [ + "/restconf/config/context/service-interface-point/sip-pe3-uni1" + ] + }, + + { + "uuid": "nep-pe3-eth-uni2", + "name": + [ + { + "value-name": "name", + "value": "PE_03_ETH_UNI_02" + } + ], + + "layer-protocol-name": "ETH", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "mapped-service-interface-point": + [ + "/restconf/config/context/service-interface-point/sip-pe3-uni2" + ] + }, + + { + "uuid": "nep-pe3-eth-pool", + "name": + [ + { + "value-name": "name", + "value": "PE_03_ETH_NEP_POOL" + } + ], + + "layer-protocol-name": "ETH", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC", + "aggregated-node-edge-point": + [ + + ] + } + ] + }, + + { + "uuid": "node-odu-pe-3", + "name": + [ + { + "value-name": "name", + "value": "PE_03_ODU_NODE" + } + ], + + "layer-protocol-name": + [ + "ODU" + ], + + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "aggregated-node-edge-point": + [ + "/restconf/config/context/topology/topo-pe3/node/node-odu-pe-3/owned-node-edge-point/nep-pe3-odu4-nni1", + "/restconf/config/context/topology/topo-pe3/node/node-odu-pe-3/owned-node-edge-point/nep-pe3-odu4-nni2", + "/restconf/config/context/topology/topo-pe3/node/node-odu-pe-3/owned-node-edge-point/nep-pe3-odu2-pool" + ], + + "owned-node-edge-point": + [ + { + "uuid": "nep-pe3-odu4-nni1", + "name": + [ + { + "value-name": "name", + "value": "PE_03_ODU4_NNI_01" + } + ], + + "layer-protocol-name": "ODU", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + }, + + { + "uuid": "nep-pe3-odu4-nni2", + "name": + [ + { + "value-name": "name", + "value": "PE_03_ODU4_NNI_02" + } + ], + + "layer-protocol-name": "ODU", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + }, + + { + "uuid": "nep-pe3-odu2-pool", + "name": + [ + { + "value-name": "name", + "value": "PE_03_ODU2_TTP_POOL" + } + ], + + "layer-protocol-name": "ODU", + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "BIDIRECTIONAL", + "link-port-role": "SYMMETRIC" + } + ] + } + ], + + "link": + [ + { + "uuid": "link-pe3-eth-pool-pe3-odu2-pool", + "name": + [ + { + "value-name": "name", + "value": "PE_03_ETH_POOL-PE_03_ODU2_POOL" + } + ], + + "layer-protocol-name": + [ + "ETH", + "ODU" + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "direction": "BIDIRECTIONAL", + "resilience-type": + { + "protection-type": "NO_PROTECTON", + "restoration-policy": "NA" + }, + + "total-potential-capacity": + { + "total-size": + { + "value": "200", + "unit": "GBPS" + } + }, + + "available-capacity": + { + "total-size": + { + "value": "200", + "unit": "GBPS" + } + }, + + "cost-characteristic": + [ + { + "cost-name": "hop_count", + "cost-value": "1" + } + ], + + "latency-characteristic": + [ + { + "traffic-property-name": "FixedLatency", + "fixed-latency-characteristic": "2" + } + ], + + "node-edge-point": + [ + "/restconf/config/context/topology/topo-pe3/node/node-eth-pe-3/owned-node-edge-point/nep-pe3-eth-pool", + "/restconf/config/context/topology/topo-pe3/node/node-odu-pe-3/owned-node-edge-point/nep-pe3-odu2-pool" + ] + } + ] + } + ] + }, + + "connection": + [ + + ], + + "connectivity-service": + [ + + ] +} \ No newline at end of file diff --git a/hackfest/tapi/server/tapi_server/database/ols_context.json b/hackfest/tapi/server/tapi_server/database/ols_context.json new file mode 100644 index 0000000000000000000000000000000000000000..a85e6da73cb61564952cdd6855b62f0078c5a992 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/database/ols_context.json @@ -0,0 +1,720 @@ +{ + "uuid": "ctx-ols", + "name": [ + { + "value-name": "name", + "value": "OLS_DOMAIN" + } + ], + "service-interface-point": [ + { + "uuid": "sip-nni-1", + "name": [ + { + "value-name": "name", + "value": "RDM_1_ADD_DROP_INTERFACES" + } + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "layer-protocol-name": [ + "PHOTONIC_MEDIA" + ], + "supported-layer-protocol-qualifier": [ + "PHOTONIC_LAYER_QUALIFIER_NMCA" + ], + "total-potential-capacity": { + "total-size": { + "value": "100", + "unit": "GHz" + } + }, + "available-capacity": { + "total-size": { + "value": "100", + "unit": "GHz" + } + } + }, + { + "uuid": "sip-nni-2", + "name": [ + { + "value-name": "name", + "value": "ROADM_2_ADD_DROP_INTERFACES" + } + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "layer-protocol-name": [ + "PHOTONIC_MEDIA" + ], + "supported-layer-protocol-qualifier": [ + "PHOTONIC_LAYER_QUALIFIER_NMCA" + ], + "total-potential-capacity": { + "total-size": { + "value": "100", + "unit": "GHz" + } + }, + "available-capacity": { + "total-size": { + "value": "100", + "unit": "GHz" + } + } + }, + { + "uuid": "sip-nni-3", + "name": [ + { + "value-name": "name", + "value": "ROADM_3_ADD_DROP_INTERFACES" + } + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "layer-protocol-name": [ + "PHOTONIC_MEDIA" + ], + "supported-layer-protocol-qualifier": [ + "PHOTONIC_LAYER_QUALIFIER_NMCA" + ], + "total-potential-capacity": { + "total-size": { + "value": "100", + "unit": "GHz" + } + }, + "available-capacity": { + "total-size": { + "value": "100", + "unit": "GHz" + } + } + } + ], + "topology-context": { + "topology": [ + { + "uuid": "top-ols", + "name": [ + { + "value-name": "name", + "value": "OLS_TOPOLOGY" + } + ], + "node": [ + { + "uuid": "node-rdm-1", + "name": [ + { + "value-name": "name", + "value": "ROADM_1" + } + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "layer-protocol-name": [ + "PHOTONIC_MEDIA" + ], + "owned-node-edge-point": [ + { + "uuid": "nep-rdm-1-adddrp-1", + "name": [ + { + "value-name": "name", + "value": "ROADM_1_ADD_DROP_PORT_1" + } + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "UNIDENTIFIED_OR_UNKNOWN", + "link-port-role": "UNKNOWN", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": [ + "PHOTONIC_LAYER_QUALIFIER_OMS" + ], + "total-potential-capacity": { + "total-size": { + "value": "100", + "unit": "GHz" + } + }, + "available-capacity": { + "total-size": { + "value": "100", + "unit": "GHz" + } + }, + "mapped-service-interface-point": [ + { + "service-interface-point-uuid": "sip-nni-1" + } + ] + }, + { + "uuid": "nep-rdm-1-deg-1", + "name": [ + { + "value-name": "name", + "value": "ROADM_1_DEGREE_PORT" + } + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "UNIDENTIFIED_OR_UNKNOWN", + "link-port-role": "UNKNOWN", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": [ + "PHOTONIC_LAYER_QUALIFIER_OTS" + ], + "total-potential-capacity": { + "total-size": { + "value": "8000", + "unit": "GHz" + } + }, + "available-capacity": { + "total-size": { + "value": "8000", + "unit": "GHz" + } + }, + "mapped-service-interface-point": [] + } + ], + "aggregated-node-edge-point": [ + { + "topology-uuid": "top-ols", + "node-uuid": "node-rdm-1", + "node-edge-point-uuid": "nep-rdm-1-adddrp-1" + }, + { + "topology-uuid": "top-ols", + "node-uuid": "node-rdm-1", + "node-edge-point-uuid": "nep-rdm-1-deg-1" + } + ] + }, + { + "uuid": "node-rdm-2", + "name": [ + { + "value-name": "name", + "value": "ROADM_2" + } + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "layer-protocol-name": [ + "PHOTONIC_MEDIA" + ], + "owned-node-edge-point": [ + { + "uuid": "nep-rdm-2-adddrp-1", + "name": [ + { + "value-name": "name", + "value": "ROADM_2_ADD_DROP_PORT_1" + } + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "UNIDENTIFIED_OR_UNKNOWN", + "link-port-role": "UNKNOWN", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": [ + "PHOTONIC_LAYER_QUALIFIER_OMS" + ], + "total-potential-capacity": { + "total-size": { + "value": "100", + "unit": "GHz" + } + }, + "available-capacity": { + "total-size": { + "value": "100", + "unit": "GHz" + } + }, + "mapped-service-interface-point": [ + { + "service-interface-point-uuid": "sip-nni-2" + } + ] + }, + { + "uuid": "nep-rdm-2-deg-1", + "name": [ + { + "value-name": "name", + "value": "ROADM_2_DEGREE_PORT" + } + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "UNIDENTIFIED_OR_UNKNOWN", + "link-port-role": "UNKNOWN", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": [ + "PHOTONIC_LAYER_QUALIFIER_OTS" + ], + "total-potential-capacity": { + "total-size": { + "value": "8000", + "unit": "GHz" + } + }, + "available-capacity": { + "total-size": { + "value": "8000", + "unit": "GHz" + } + }, + "mapped-service-interface-point": [] + } + ], + "aggregated-node-edge-point": [ + { + "topology-uuid": "top-ols", + "node-uuid": "node-rdm-2", + "node-edge-point-uuid": "nep-rdm-2-adddrp-1" + }, + { + "topology-uuid": "top-ols", + "node-uuid": "node-rdm-2", + "node-edge-point-uuid": "nep-rdm-2-deg-1" + } + ] + }, + { + "uuid": "node-rdm-3", + "name": [ + { + "value-name": "name", + "value": "ROADM_3" + } + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "layer-protocol-name": [ + "PHOTONIC_MEDIA" + ], + "owned-node-edge-point": [ + { + "uuid": "nep-rdm-3-adddrp-1", + "name": [ + { + "value-name": "name", + "value": "ROADM_3_ADD_DROP_PORT_1" + } + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "UNIDENTIFIED_OR_UNKNOWN", + "link-port-role": "UNKNOWN", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": [ + "PHOTONIC_LAYER_QUALIFIER_OMS" + ], + "total-potential-capacity": { + "total-size": { + "value": "100", + "unit": "GHz" + } + }, + "available-capacity": { + "total-size": { + "value": "100", + "unit": "GHz" + } + }, + "mapped-service-interface-point": [ + { + "service-interface-point-uuid": "sip-nni-3" + } + ] + }, + { + "uuid": "nep-rdm-3-deg-1", + "name": [ + { + "value-name": "name", + "value": "ROADM_3_DEGREE_PORT" + } + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "UNIDENTIFIED_OR_UNKNOWN", + "link-port-role": "UNKNOWN", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": [ + "PHOTONIC_LAYER_QUALIFIER_OTS" + ], + "total-potential-capacity": { + "total-size": { + "value": "8000", + "unit": "GHz" + } + }, + "available-capacity": { + "total-size": { + "value": "8000", + "unit": "GHz" + } + }, + "mapped-service-interface-point": [] + } + ], + "aggregated-node-edge-point": [ + { + "topology-uuid": "top-ols", + "node-uuid": "node-rdm-3", + "node-edge-point-uuid": "nep-rdm-3-adddrp-1" + }, + { + "topology-uuid": "top-ols", + "node-uuid": "node-rdm-3", + "node-edge-point-uuid": "nep-rdm-3-deg-1" + } + ] + }, + { + "uuid": "node-rdm-4", + "name": [ + { + "value-name": "name", + "value": "ROADM_4" + } + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "layer-protocol-name": [ + "PHOTONIC_MEDIA" + ], + "owned-node-edge-point": [ + { + "uuid": "nep-rdm-4-deg-1", + "name": [ + { + "value-name": "name", + "value": "ROADM_4_DEGREE_PORT_1" + } + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "UNIDENTIFIED_OR_UNKNOWN", + "link-port-role": "UNKNOWN", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": [ + "PHOTONIC_LAYER_QUALIFIER_OTS" + ], + "total-potential-capacity": { + "total-size": { + "value": "8000", + "unit": "GHz" + } + }, + "available-capacity": { + "total-size": { + "value": "8000", + "unit": "GHz" + } + }, + "mapped-service-interface-point": [] + }, + { + "uuid": "nep-rdm-4-deg-2", + "name": [ + { + "value-name": "name", + "value": "ROADM_4_DEGREE_PORT_2" + } + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "UNIDENTIFIED_OR_UNKNOWN", + "link-port-role": "UNKNOWN", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": [ + "PHOTONIC_LAYER_QUALIFIER_OTS" + ], + "total-potential-capacity": { + "total-size": { + "value": "8000", + "unit": "GHz" + } + }, + "available-capacity": { + "total-size": { + "value": "8000", + "unit": "GHz" + } + }, + "mapped-service-interface-point": [] + }, + { + "uuid": "nep-rdm-4-deg-3", + "name": [ + { + "value-name": "name", + "value": "ROADM_4_DEGREE_PORT_3" + } + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "termination-state": "LP_CAN_NEVER_TERMINATE", + "termination-direction": "BIDIRECTIONAL", + "link-port-direction": "UNIDENTIFIED_OR_UNKNOWN", + "link-port-role": "UNKNOWN", + "layer-protocol-name": "PHOTONIC_MEDIA", + "supported-cep-layer-protocol-qualifier": [ + "PHOTONIC_LAYER_QUALIFIER_OTS" + ], + "total-potential-capacity": { + "total-size": { + "value": "8000", + "unit": "GHz" + } + }, + "available-capacity": { + "total-size": { + "value": "8000", + "unit": "GHz" + } + }, + "mapped-service-interface-point": [] + } + ], + "aggregated-node-edge-point": [ + { + "topology-uuid": "top-ols", + "node-uuid": "node-rdm-4", + "node-edge-point-uuid": "nep-rdm-4-deg-1" + }, + { + "topology-uuid": "top-ols", + "node-uuid": "node-rdm-4", + "node-edge-point-uuid": "nep-rdm-4-deg-2" + }, + { + "topology-uuid": "top-ols", + "node-uuid": "node-rdm-4", + "node-edge-point-uuid": "nep-rdm-4-deg-3" + } + ] + } + ], + "link": [ + { + "uuid": "link-rdm-1-deg-1-rdm-4-deg-1", + "name": [ + { + "value-name": "name", + "value": "RDM_1_DEG_1_RDM_4_DEG_1" + } + ], + "layer-protocol-name": [ + "PHOTONIC_MEDIA" + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "direction": "BIDIRECTIONAL", + "resilience-type": { + "protection-type": "NO_PROTECTON", + "restoration-policy": "NA" + }, + "total-potential-capacity": { + "total-size": { + "value": "8000", + "unit": "GHz" + } + }, + "available-capacity": { + "total-size": { + "value": "8000", + "unit": "GHz" + } + }, + "cost-characteristic": [ + { + "cost-name": "hop_count", + "cost-value": "1" + } + ], + "latency-characteristic": [ + { + "traffic-property-name": "FixedLatency", + "fixed-latency-characteristic": "1" + } + ], + "node-edge-point": [ + { + "topology-uuid": "top-ols", + "node-uuid": "node-rdm-1", + "node-edge-point-uuid": "nep-rdm-1-deg-1" + }, + { + "topology-uuid": "top-ols", + "node-uuid": "node-rdm-4", + "node-edge-point-uuid": "nep-rdm-4-deg-1" + } + ] + }, + { + "uuid": "link-rdm-2-deg-1-rdm-4-deg-2", + "name": [ + { + "value-name": "name", + "value": "RDM_2_DEG_1_RDM_4_DEG_2" + } + ], + "layer-protocol-name": [ + "PHOTONIC_MEDIA" + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "direction": "BIDIRECTIONAL", + "resilience-type": { + "protection-type": "NO_PROTECTON", + "restoration-policy": "NA" + }, + "total-potential-capacity": { + "total-size": { + "value": "8000", + "unit": "GHz" + } + }, + "available-capacity": { + "total-size": { + "value": "8000", + "unit": "GHz" + } + }, + "cost-characteristic": [ + { + "cost-name": "hop_count", + "cost-value": "1" + } + ], + "latency-characteristic": [ + { + "traffic-property-name": "FixedLatency", + "fixed-latency-characteristic": "1" + } + ], + "node-edge-point": [ + { + "topology-uuid": "top-ols", + "node-uuid": "node-rdm-2", + "node-edge-point-uuid": "nep-rdm-2-deg-1" + }, + { + "topology-uuid": "top-ols", + "node-uuid": "node-rdm-4", + "node-edge-point-uuid": "nep-rdm-4-deg-2" + } + ] + }, + { + "uuid": "link-rdm-3-deg-1-rdm-4-deg-3", + "name": [ + { + "value-name": "name", + "value": "RDM_3_DEG_1_RDM_4_DEG_3" + } + ], + "layer-protocol-name": [ + "PHOTONIC_MEDIA" + ], + "administrative-state": "UNLOCKED", + "operational-state": "ENABLED", + "lifecycle-state": "INSTALLED", + "direction": "BIDIRECTIONAL", + "resilience-type": { + "protection-type": "NO_PROTECTON", + "restoration-policy": "NA" + }, + "total-potential-capacity": { + "total-size": { + "value": "8000", + "unit": "GHz" + } + }, + "available-capacity": { + "total-size": { + "value": "8000", + "unit": "GHz" + } + }, + "cost-characteristic": [ + { + "cost-name": "hop_count", + "cost-value": "1" + } + ], + "latency-characteristic": [ + { + "traffic-property-name": "FixedLatency", + "fixed-latency-characteristic": "1" + } + ], + "node-edge-point": [ + { + "topology-uuid": "top-ols", + "node-uuid": "node-rdm-3", + "node-edge-point-uuid": "nep-rdm-3-deg-1" + }, + { + "topology-uuid": "top-ols", + "node-uuid": "node-rdm-4", + "node-edge-point-uuid": "nep-rdm-4-deg-3" + } + ] + } + ] + } + ] + }, + "connectivity-context": { + "connection": [], + "connectivity-service": [] + } +} \ No newline at end of file diff --git a/hackfest/tapi/server/tapi_server/encoder.py b/hackfest/tapi/server/tapi_server/encoder.py new file mode 100644 index 0000000000000000000000000000000000000000..482f44a6747204933187eaa533144f5927128611 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/encoder.py @@ -0,0 +1,20 @@ +from connexion.apps.flask_app import FlaskJSONEncoder +import six + +from tapi_server.models.base_model_ import Model + + +class JSONEncoder(FlaskJSONEncoder): + include_nulls = False + + def default(self, o): + if isinstance(o, Model): + dikt = {} + for attr, _ in six.iteritems(o.swagger_types): + value = getattr(o, attr) + if value is None and not self.include_nulls: + continue + attr = o.attribute_map[attr] + dikt[attr] = value + return dikt + return FlaskJSONEncoder.default(self, o) diff --git a/hackfest/tapi/server/tapi_server/models/__init__.py b/hackfest/tapi/server/tapi_server/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6dddec801015b0180a55e0f7f96d222a2be8e961 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/__init__.py @@ -0,0 +1,276 @@ +# coding: utf-8 + +# flake8: noqa +from __future__ import absolute_import +# import models into model package +from tapi_server.models.operations_tapicommongetserviceinterfacepointdetails_body import OperationsTapicommongetserviceinterfacepointdetailsBody +from tapi_server.models.operations_tapicommonupdateserviceinterfacepoint_body import OperationsTapicommonupdateserviceinterfacepointBody +from tapi_server.models.operations_tapiconnectivitycreateconnectivityservice_body import OperationsTapiconnectivitycreateconnectivityserviceBody +from tapi_server.models.operations_tapiconnectivitydeleteconnectivityservice_body import OperationsTapiconnectivitydeleteconnectivityserviceBody +from tapi_server.models.operations_tapiconnectivitygetconnectiondetails_body import OperationsTapiconnectivitygetconnectiondetailsBody +from tapi_server.models.operations_tapiconnectivitygetconnectionendpointdetails_body import OperationsTapiconnectivitygetconnectionendpointdetailsBody +from tapi_server.models.operations_tapiconnectivitygetconnectivityservicedetails_body import OperationsTapiconnectivitygetconnectivityservicedetailsBody +from tapi_server.models.operations_tapiconnectivityupdateconnectivityservice_body import OperationsTapiconnectivityupdateconnectivityserviceBody +from tapi_server.models.operations_tapinotificationcreatenotificationsubscriptionservice_body import OperationsTapinotificationcreatenotificationsubscriptionserviceBody +from tapi_server.models.operations_tapinotificationdeletenotificationsubscriptionservice_body import OperationsTapinotificationdeletenotificationsubscriptionserviceBody +from tapi_server.models.operations_tapinotificationgetnotificationlist_body import OperationsTapinotificationgetnotificationlistBody +from tapi_server.models.operations_tapinotificationgetnotificationsubscriptionservicedetails_body import OperationsTapinotificationgetnotificationsubscriptionservicedetailsBody +from tapi_server.models.operations_tapinotificationupdatenotificationsubscriptionservice_body import OperationsTapinotificationupdatenotificationsubscriptionserviceBody +from tapi_server.models.operations_tapipathcomputationcomputep2ppath_body import OperationsTapipathcomputationcomputep2ppathBody +from tapi_server.models.operations_tapipathcomputationdeletep2ppath_body import OperationsTapipathcomputationdeletep2ppathBody +from tapi_server.models.operations_tapipathcomputationoptimizep2ppath_body import OperationsTapipathcomputationoptimizep2ppathBody +from tapi_server.models.operations_tapitopologygetlinkdetails_body import OperationsTapitopologygetlinkdetailsBody +from tapi_server.models.operations_tapitopologygetnodedetails_body import OperationsTapitopologygetnodedetailsBody +from tapi_server.models.operations_tapitopologygetnodeedgepointdetails_body import OperationsTapitopologygetnodeedgepointdetailsBody +from tapi_server.models.operations_tapitopologygettopologydetails_body import OperationsTapitopologygettopologydetailsBody +from tapi_server.models.tapi_common_admin_state_pac import TapiCommonAdminStatePac +from tapi_server.models.tapi_common_administrative_state import TapiCommonAdministrativeState +from tapi_server.models.tapi_common_bandwidth_profile import TapiCommonBandwidthProfile +from tapi_server.models.tapi_common_bandwidth_profile_type import TapiCommonBandwidthProfileType +from tapi_server.models.tapi_common_bandwidth_profile_wrapper import TapiCommonBandwidthProfileWrapper +from tapi_server.models.tapi_common_capacity import TapiCommonCapacity +from tapi_server.models.tapi_common_capacity_pac import TapiCommonCapacityPac +from tapi_server.models.tapi_common_capacity_unit import TapiCommonCapacityUnit +from tapi_server.models.tapi_common_capacity_value import TapiCommonCapacityValue +from tapi_server.models.tapi_common_capacity_value_wrapper import TapiCommonCapacityValueWrapper +from tapi_server.models.tapi_common_capacity_wrapper import TapiCommonCapacityWrapper +from tapi_server.models.tapi_common_context import TapiCommonContext +from tapi_server.models.tapi_common_context_wrapper import TapiCommonContextWrapper +from tapi_server.models.tapi_common_directive_value import TapiCommonDirectiveValue +from tapi_server.models.tapi_common_forwarding_direction import TapiCommonForwardingDirection +from tapi_server.models.tapi_common_get_service_interface_point_details import TapiCommonGetServiceInterfacePointDetails +from tapi_server.models.tapi_common_get_service_interface_point_list import TapiCommonGetServiceInterfacePointList +from tapi_server.models.tapi_common_getserviceinterfacepointdetails_input import TapiCommonGetserviceinterfacepointdetailsInput +from tapi_server.models.tapi_common_getserviceinterfacepointdetails_output import TapiCommonGetserviceinterfacepointdetailsOutput +from tapi_server.models.tapi_common_getserviceinterfacepointlist_output import TapiCommonGetserviceinterfacepointlistOutput +from tapi_server.models.tapi_common_global_class import TapiCommonGlobalClass +from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName +from tapi_server.models.tapi_common_lifecycle_state import TapiCommonLifecycleState +from tapi_server.models.tapi_common_local_class import TapiCommonLocalClass +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue +from tapi_server.models.tapi_common_name_and_value_wrapper import TapiCommonNameAndValueWrapper +from tapi_server.models.tapi_common_operational_state import TapiCommonOperationalState +from tapi_server.models.tapi_common_operational_state_pac import TapiCommonOperationalStatePac +from tapi_server.models.tapi_common_port_direction import TapiCommonPortDirection +from tapi_server.models.tapi_common_port_role import TapiCommonPortRole +from tapi_server.models.tapi_common_service_interface_point import TapiCommonServiceInterfacePoint +from tapi_server.models.tapi_common_service_interface_point_ref import TapiCommonServiceInterfacePointRef +from tapi_server.models.tapi_common_service_interface_point_ref_wrapper import TapiCommonServiceInterfacePointRefWrapper +from tapi_server.models.tapi_common_service_interface_point_wrapper import TapiCommonServiceInterfacePointWrapper +from tapi_server.models.tapi_common_tapi_context import TapiCommonTapiContext +from tapi_server.models.tapi_common_termination_direction import TapiCommonTerminationDirection +from tapi_server.models.tapi_common_termination_pac import TapiCommonTerminationPac +from tapi_server.models.tapi_common_termination_state import TapiCommonTerminationState +from tapi_server.models.tapi_common_time_range import TapiCommonTimeRange +from tapi_server.models.tapi_common_time_range_wrapper import TapiCommonTimeRangeWrapper +from tapi_server.models.tapi_common_updateserviceinterfacepoint_input import TapiCommonUpdateserviceinterfacepointInput +from tapi_server.models.tapi_connectivity_cep_list import TapiConnectivityCepList +from tapi_server.models.tapi_connectivity_cep_list_wrapper import TapiConnectivityCepListWrapper +from tapi_server.models.tapi_connectivity_cep_role import TapiConnectivityCepRole +from tapi_server.models.tapi_connectivity_cep_role_wrapper import TapiConnectivityCepRoleWrapper +from tapi_server.models.tapi_connectivity_connection import TapiConnectivityConnection +from tapi_server.models.tapi_connectivity_connection_end_point import TapiConnectivityConnectionEndPoint +from tapi_server.models.tapi_connectivity_connection_end_point_ref import TapiConnectivityConnectionEndPointRef +from tapi_server.models.tapi_connectivity_connection_end_point_ref_wrapper import TapiConnectivityConnectionEndPointRefWrapper +from tapi_server.models.tapi_connectivity_connection_end_point_wrapper import TapiConnectivityConnectionEndPointWrapper +from tapi_server.models.tapi_connectivity_connection_ref import TapiConnectivityConnectionRef +from tapi_server.models.tapi_connectivity_connection_ref_wrapper import TapiConnectivityConnectionRefWrapper +from tapi_server.models.tapi_connectivity_connection_spec_reference import TapiConnectivityConnectionSpecReference +from tapi_server.models.tapi_connectivity_connection_spec_reference_wrapper import TapiConnectivityConnectionSpecReferenceWrapper +from tapi_server.models.tapi_connectivity_connection_wrapper import TapiConnectivityConnectionWrapper +from tapi_server.models.tapi_connectivity_connectivity_constraint import TapiConnectivityConnectivityConstraint +from tapi_server.models.tapi_connectivity_connectivity_context import TapiConnectivityConnectivityContext +from tapi_server.models.tapi_connectivity_connectivity_context_wrapper import TapiConnectivityConnectivityContextWrapper +from tapi_server.models.tapi_connectivity_connectivity_service import TapiConnectivityConnectivityService +from tapi_server.models.tapi_connectivity_connectivity_service_end_point import TapiConnectivityConnectivityServiceEndPoint +from tapi_server.models.tapi_connectivity_connectivity_service_end_point_ref import TapiConnectivityConnectivityServiceEndPointRef +from tapi_server.models.tapi_connectivity_connectivity_service_end_point_ref_wrapper import TapiConnectivityConnectivityServiceEndPointRefWrapper +from tapi_server.models.tapi_connectivity_connectivity_service_end_point_wrapper import TapiConnectivityConnectivityServiceEndPointWrapper +from tapi_server.models.tapi_connectivity_connectivity_service_ref import TapiConnectivityConnectivityServiceRef +from tapi_server.models.tapi_connectivity_connectivity_service_ref_wrapper import TapiConnectivityConnectivityServiceRefWrapper +from tapi_server.models.tapi_connectivity_connectivity_service_wrapper import TapiConnectivityConnectivityServiceWrapper +from tapi_server.models.tapi_connectivity_context_augmentation3 import TapiConnectivityContextAugmentation3 +from tapi_server.models.tapi_connectivity_coordinate_type import TapiConnectivityCoordinateType +from tapi_server.models.tapi_connectivity_create_connectivity_service import TapiConnectivityCreateConnectivityService +from tapi_server.models.tapi_connectivity_createconnectivityservice_input import TapiConnectivityCreateconnectivityserviceInput +from tapi_server.models.tapi_connectivity_createconnectivityservice_output import TapiConnectivityCreateconnectivityserviceOutput +from tapi_server.models.tapi_connectivity_deleteconnectivityservice_input import TapiConnectivityDeleteconnectivityserviceInput +from tapi_server.models.tapi_connectivity_get_connection_details import TapiConnectivityGetConnectionDetails +from tapi_server.models.tapi_connectivity_get_connection_end_point_details import TapiConnectivityGetConnectionEndPointDetails +from tapi_server.models.tapi_connectivity_get_connectivity_service_details import TapiConnectivityGetConnectivityServiceDetails +from tapi_server.models.tapi_connectivity_get_connectivity_service_list import TapiConnectivityGetConnectivityServiceList +from tapi_server.models.tapi_connectivity_getconnectiondetails_input import TapiConnectivityGetconnectiondetailsInput +from tapi_server.models.tapi_connectivity_getconnectiondetails_output import TapiConnectivityGetconnectiondetailsOutput +from tapi_server.models.tapi_connectivity_getconnectionendpointdetails_input import TapiConnectivityGetconnectionendpointdetailsInput +from tapi_server.models.tapi_connectivity_getconnectionendpointdetails_output import TapiConnectivityGetconnectionendpointdetailsOutput +from tapi_server.models.tapi_connectivity_getconnectivityservicedetails_input import TapiConnectivityGetconnectivityservicedetailsInput +from tapi_server.models.tapi_connectivity_getconnectivityservicedetails_output import TapiConnectivityGetconnectivityservicedetailsOutput +from tapi_server.models.tapi_connectivity_getconnectivityservicelist_output import TapiConnectivityGetconnectivityservicelistOutput +from tapi_server.models.tapi_connectivity_owned_node_edge_point_augmentation1 import TapiConnectivityOwnedNodeEdgePointAugmentation1 +from tapi_server.models.tapi_connectivity_protection_role import TapiConnectivityProtectionRole +from tapi_server.models.tapi_connectivity_resilience_constraint import TapiConnectivityResilienceConstraint +from tapi_server.models.tapi_connectivity_resilience_route import TapiConnectivityResilienceRoute +from tapi_server.models.tapi_connectivity_resilience_route_wrapper import TapiConnectivityResilienceRouteWrapper +from tapi_server.models.tapi_connectivity_reversion_mode import TapiConnectivityReversionMode +from tapi_server.models.tapi_connectivity_route import TapiConnectivityRoute +from tapi_server.models.tapi_connectivity_route_ref import TapiConnectivityRouteRef +from tapi_server.models.tapi_connectivity_route_ref_wrapper import TapiConnectivityRouteRefWrapper +from tapi_server.models.tapi_connectivity_route_wrapper import TapiConnectivityRouteWrapper +from tapi_server.models.tapi_connectivity_selection_control import TapiConnectivitySelectionControl +from tapi_server.models.tapi_connectivity_selection_reason import TapiConnectivitySelectionReason +from tapi_server.models.tapi_connectivity_service_type import TapiConnectivityServiceType +from tapi_server.models.tapi_connectivity_switch import TapiConnectivitySwitch +from tapi_server.models.tapi_connectivity_switch_control import TapiConnectivitySwitchControl +from tapi_server.models.tapi_connectivity_switch_control_ref import TapiConnectivitySwitchControlRef +from tapi_server.models.tapi_connectivity_switch_control_ref_wrapper import TapiConnectivitySwitchControlRefWrapper +from tapi_server.models.tapi_connectivity_switch_control_wrapper import TapiConnectivitySwitchControlWrapper +from tapi_server.models.tapi_connectivity_switch_wrapper import TapiConnectivitySwitchWrapper +from tapi_server.models.tapi_connectivity_update_connectivity_service import TapiConnectivityUpdateConnectivityService +from tapi_server.models.tapi_connectivity_updateconnectivityservice_input import TapiConnectivityUpdateconnectivityserviceInput +from tapi_server.models.tapi_connectivity_updateconnectivityservice_output import TapiConnectivityUpdateconnectivityserviceOutput +from tapi_server.models.tapi_notification_alarm_info import TapiNotificationAlarmInfo +from tapi_server.models.tapi_notification_alarm_info_wrapper import TapiNotificationAlarmInfoWrapper +from tapi_server.models.tapi_notification_context_augmentation1 import TapiNotificationContextAugmentation1 +from tapi_server.models.tapi_notification_create_notification_subscription_service import TapiNotificationCreateNotificationSubscriptionService +from tapi_server.models.tapi_notification_createnotificationsubscriptionservice_input import TapiNotificationCreatenotificationsubscriptionserviceInput +from tapi_server.models.tapi_notification_createnotificationsubscriptionservice_output import TapiNotificationCreatenotificationsubscriptionserviceOutput +from tapi_server.models.tapi_notification_delete_notification_subscription_service import TapiNotificationDeleteNotificationSubscriptionService +from tapi_server.models.tapi_notification_deletenotificationsubscriptionservice_input import TapiNotificationDeletenotificationsubscriptionserviceInput +from tapi_server.models.tapi_notification_deletenotificationsubscriptionservice_output import TapiNotificationDeletenotificationsubscriptionserviceOutput +from tapi_server.models.tapi_notification_get_notification_list import TapiNotificationGetNotificationList +from tapi_server.models.tapi_notification_get_notification_subscription_service_details import TapiNotificationGetNotificationSubscriptionServiceDetails +from tapi_server.models.tapi_notification_get_notification_subscription_service_list import TapiNotificationGetNotificationSubscriptionServiceList +from tapi_server.models.tapi_notification_get_supported_notification_types import TapiNotificationGetSupportedNotificationTypes +from tapi_server.models.tapi_notification_getnotificationlist_input import TapiNotificationGetnotificationlistInput +from tapi_server.models.tapi_notification_getnotificationlist_output import TapiNotificationGetnotificationlistOutput +from tapi_server.models.tapi_notification_getnotificationsubscriptionservicedetails_input import TapiNotificationGetnotificationsubscriptionservicedetailsInput +from tapi_server.models.tapi_notification_getnotificationsubscriptionservicedetails_output import TapiNotificationGetnotificationsubscriptionservicedetailsOutput +from tapi_server.models.tapi_notification_getnotificationsubscriptionservicelist_output import TapiNotificationGetnotificationsubscriptionservicelistOutput +from tapi_server.models.tapi_notification_getsupportednotificationtypes_output import TapiNotificationGetsupportednotificationtypesOutput +from tapi_server.models.tapi_notification_name_and_value_change import TapiNotificationNameAndValueChange +from tapi_server.models.tapi_notification_name_and_value_change_wrapper import TapiNotificationNameAndValueChangeWrapper +from tapi_server.models.tapi_notification_notification import TapiNotificationNotification +from tapi_server.models.tapi_notification_notification_channel import TapiNotificationNotificationChannel +from tapi_server.models.tapi_notification_notification_channel_wrapper import TapiNotificationNotificationChannelWrapper +from tapi_server.models.tapi_notification_notification_context import TapiNotificationNotificationContext +from tapi_server.models.tapi_notification_notification_context_wrapper import TapiNotificationNotificationContextWrapper +from tapi_server.models.tapi_notification_notification_subscription_service import TapiNotificationNotificationSubscriptionService +from tapi_server.models.tapi_notification_notification_subscription_service_wrapper import TapiNotificationNotificationSubscriptionServiceWrapper +from tapi_server.models.tapi_notification_notification_type import TapiNotificationNotificationType +from tapi_server.models.tapi_notification_notification_wrapper import TapiNotificationNotificationWrapper +from tapi_server.models.tapi_notification_object_type import TapiNotificationObjectType +from tapi_server.models.tapi_notification_perceived_severity_type import TapiNotificationPerceivedSeverityType +from tapi_server.models.tapi_notification_perceived_tca_severity import TapiNotificationPerceivedTcaSeverity +from tapi_server.models.tapi_notification_service_affecting import TapiNotificationServiceAffecting +from tapi_server.models.tapi_notification_source_indicator import TapiNotificationSourceIndicator +from tapi_server.models.tapi_notification_subscription_filter import TapiNotificationSubscriptionFilter +from tapi_server.models.tapi_notification_subscription_filter_wrapper import TapiNotificationSubscriptionFilterWrapper +from tapi_server.models.tapi_notification_subscription_state import TapiNotificationSubscriptionState +from tapi_server.models.tapi_notification_tca_info import TapiNotificationTcaInfo +from tapi_server.models.tapi_notification_tca_info_wrapper import TapiNotificationTcaInfoWrapper +from tapi_server.models.tapi_notification_threshold_crossing_type import TapiNotificationThresholdCrossingType +from tapi_server.models.tapi_notification_update_notification_subscription_service import TapiNotificationUpdateNotificationSubscriptionService +from tapi_server.models.tapi_notification_updatenotificationsubscriptionservice_input import TapiNotificationUpdatenotificationsubscriptionserviceInput +from tapi_server.models.tapi_notification_updatenotificationsubscriptionservice_output import TapiNotificationUpdatenotificationsubscriptionserviceOutput +from tapi_server.models.tapi_path_computation_compute_p2_p_path import TapiPathComputationComputeP2PPath +from tapi_server.models.tapi_path_computation_computep2ppath_input import TapiPathComputationComputep2ppathInput +from tapi_server.models.tapi_path_computation_computep2ppath_output import TapiPathComputationComputep2ppathOutput +from tapi_server.models.tapi_path_computation_context_augmentation2 import TapiPathComputationContextAugmentation2 +from tapi_server.models.tapi_path_computation_delete_p2_p_path import TapiPathComputationDeleteP2PPath +from tapi_server.models.tapi_path_computation_deletep2ppath_input import TapiPathComputationDeletep2ppathInput +from tapi_server.models.tapi_path_computation_deletep2ppath_output import TapiPathComputationDeletep2ppathOutput +from tapi_server.models.tapi_path_computation_diversity_policy import TapiPathComputationDiversityPolicy +from tapi_server.models.tapi_path_computation_optimize_p2_ppath import TapiPathComputationOptimizeP2Ppath +from tapi_server.models.tapi_path_computation_optimizep2ppath_input import TapiPathComputationOptimizep2ppathInput +from tapi_server.models.tapi_path_computation_optimizep2ppath_output import TapiPathComputationOptimizep2ppathOutput +from tapi_server.models.tapi_path_computation_path import TapiPathComputationPath +from tapi_server.models.tapi_path_computation_path_computation_context import TapiPathComputationPathComputationContext +from tapi_server.models.tapi_path_computation_path_computation_context_wrapper import TapiPathComputationPathComputationContextWrapper +from tapi_server.models.tapi_path_computation_path_computation_service import TapiPathComputationPathComputationService +from tapi_server.models.tapi_path_computation_path_computation_service_wrapper import TapiPathComputationPathComputationServiceWrapper +from tapi_server.models.tapi_path_computation_path_objective_function import TapiPathComputationPathObjectiveFunction +from tapi_server.models.tapi_path_computation_path_objective_function_wrapper import TapiPathComputationPathObjectiveFunctionWrapper +from tapi_server.models.tapi_path_computation_path_optimization_constraint import TapiPathComputationPathOptimizationConstraint +from tapi_server.models.tapi_path_computation_path_optimization_constraint_wrapper import TapiPathComputationPathOptimizationConstraintWrapper +from tapi_server.models.tapi_path_computation_path_ref import TapiPathComputationPathRef +from tapi_server.models.tapi_path_computation_path_ref_wrapper import TapiPathComputationPathRefWrapper +from tapi_server.models.tapi_path_computation_path_service_end_point import TapiPathComputationPathServiceEndPoint +from tapi_server.models.tapi_path_computation_path_service_end_point_wrapper import TapiPathComputationPathServiceEndPointWrapper +from tapi_server.models.tapi_path_computation_path_wrapper import TapiPathComputationPathWrapper +from tapi_server.models.tapi_path_computation_route_objective_function import TapiPathComputationRouteObjectiveFunction +from tapi_server.models.tapi_path_computation_routing_constraint import TapiPathComputationRoutingConstraint +from tapi_server.models.tapi_path_computation_routing_constraint_wrapper import TapiPathComputationRoutingConstraintWrapper +from tapi_server.models.tapi_path_computation_topology_constraint import TapiPathComputationTopologyConstraint +from tapi_server.models.tapi_path_computation_topology_constraint_wrapper import TapiPathComputationTopologyConstraintWrapper +from tapi_server.models.tapi_path_computation_value_or_priority import TapiPathComputationValueOrPriority +from tapi_server.models.tapi_path_computation_value_or_priority_wrapper import TapiPathComputationValueOrPriorityWrapper +from tapi_server.models.tapi_topology_connection_spec_reference import TapiTopologyConnectionSpecReference +from tapi_server.models.tapi_topology_connection_spec_reference_wrapper import TapiTopologyConnectionSpecReferenceWrapper +from tapi_server.models.tapi_topology_context_augmentation4 import TapiTopologyContextAugmentation4 +from tapi_server.models.tapi_topology_cost_characteristic import TapiTopologyCostCharacteristic +from tapi_server.models.tapi_topology_cost_characteristic_wrapper import TapiTopologyCostCharacteristicWrapper +from tapi_server.models.tapi_topology_forwarding_rule import TapiTopologyForwardingRule +from tapi_server.models.tapi_topology_get_link_details import TapiTopologyGetLinkDetails +from tapi_server.models.tapi_topology_get_node_details import TapiTopologyGetNodeDetails +from tapi_server.models.tapi_topology_get_node_edge_point_details import TapiTopologyGetNodeEdgePointDetails +from tapi_server.models.tapi_topology_get_topology_details import TapiTopologyGetTopologyDetails +from tapi_server.models.tapi_topology_get_topology_list import TapiTopologyGetTopologyList +from tapi_server.models.tapi_topology_getlinkdetails_input import TapiTopologyGetlinkdetailsInput +from tapi_server.models.tapi_topology_getlinkdetails_output import TapiTopologyGetlinkdetailsOutput +from tapi_server.models.tapi_topology_getnodedetails_input import TapiTopologyGetnodedetailsInput +from tapi_server.models.tapi_topology_getnodedetails_output import TapiTopologyGetnodedetailsOutput +from tapi_server.models.tapi_topology_getnodeedgepointdetails_input import TapiTopologyGetnodeedgepointdetailsInput +from tapi_server.models.tapi_topology_getnodeedgepointdetails_output import TapiTopologyGetnodeedgepointdetailsOutput +from tapi_server.models.tapi_topology_gettopologydetails_input import TapiTopologyGettopologydetailsInput +from tapi_server.models.tapi_topology_gettopologydetails_output import TapiTopologyGettopologydetailsOutput +from tapi_server.models.tapi_topology_gettopologylist_output import TapiTopologyGettopologylistOutput +from tapi_server.models.tapi_topology_inter_rule_group import TapiTopologyInterRuleGroup +from tapi_server.models.tapi_topology_inter_rule_group_wrapper import TapiTopologyInterRuleGroupWrapper +from tapi_server.models.tapi_topology_latency_characteristic import TapiTopologyLatencyCharacteristic +from tapi_server.models.tapi_topology_latency_characteristic_wrapper import TapiTopologyLatencyCharacteristicWrapper +from tapi_server.models.tapi_topology_layer_protocol_transition_pac import TapiTopologyLayerProtocolTransitionPac +from tapi_server.models.tapi_topology_link import TapiTopologyLink +from tapi_server.models.tapi_topology_link_ref import TapiTopologyLinkRef +from tapi_server.models.tapi_topology_link_ref_wrapper import TapiTopologyLinkRefWrapper +from tapi_server.models.tapi_topology_link_wrapper import TapiTopologyLinkWrapper +from tapi_server.models.tapi_topology_network_topology_service import TapiTopologyNetworkTopologyService +from tapi_server.models.tapi_topology_network_topology_service_wrapper import TapiTopologyNetworkTopologyServiceWrapper +from tapi_server.models.tapi_topology_node import TapiTopologyNode +from tapi_server.models.tapi_topology_node_edge_point import TapiTopologyNodeEdgePoint +from tapi_server.models.tapi_topology_node_edge_point_ref import TapiTopologyNodeEdgePointRef +from tapi_server.models.tapi_topology_node_edge_point_ref_wrapper import TapiTopologyNodeEdgePointRefWrapper +from tapi_server.models.tapi_topology_node_owned_node_edge_point import TapiTopologyNodeOwnedNodeEdgePoint +from tapi_server.models.tapi_topology_node_owned_node_edge_point_wrapper import TapiTopologyNodeOwnedNodeEdgePointWrapper +from tapi_server.models.tapi_topology_node_ref import TapiTopologyNodeRef +from tapi_server.models.tapi_topology_node_rule_group import TapiTopologyNodeRuleGroup +from tapi_server.models.tapi_topology_node_rule_group_ref import TapiTopologyNodeRuleGroupRef +from tapi_server.models.tapi_topology_node_rule_group_ref_wrapper import TapiTopologyNodeRuleGroupRefWrapper +from tapi_server.models.tapi_topology_node_rule_group_wrapper import TapiTopologyNodeRuleGroupWrapper +from tapi_server.models.tapi_topology_port_role_rule import TapiTopologyPortRoleRule +from tapi_server.models.tapi_topology_port_role_rule_wrapper import TapiTopologyPortRoleRuleWrapper +from tapi_server.models.tapi_topology_protection_type import TapiTopologyProtectionType +from tapi_server.models.tapi_topology_resilience_type import TapiTopologyResilienceType +from tapi_server.models.tapi_topology_resilience_type_wrapper import TapiTopologyResilienceTypeWrapper +from tapi_server.models.tapi_topology_restoration_policy import TapiTopologyRestorationPolicy +from tapi_server.models.tapi_topology_risk_characteristic import TapiTopologyRiskCharacteristic +from tapi_server.models.tapi_topology_risk_characteristic_wrapper import TapiTopologyRiskCharacteristicWrapper +from tapi_server.models.tapi_topology_risk_parameter_pac import TapiTopologyRiskParameterPac +from tapi_server.models.tapi_topology_rule import TapiTopologyRule +from tapi_server.models.tapi_topology_rule_type import TapiTopologyRuleType +from tapi_server.models.tapi_topology_rule_wrapper import TapiTopologyRuleWrapper +from tapi_server.models.tapi_topology_signal_property_rule import TapiTopologySignalPropertyRule +from tapi_server.models.tapi_topology_signal_property_rule_wrapper import TapiTopologySignalPropertyRuleWrapper +from tapi_server.models.tapi_topology_topology import TapiTopologyTopology +from tapi_server.models.tapi_topology_topology_context import TapiTopologyTopologyContext +from tapi_server.models.tapi_topology_topology_context_wrapper import TapiTopologyTopologyContextWrapper +from tapi_server.models.tapi_topology_topology_node import TapiTopologyTopologyNode +from tapi_server.models.tapi_topology_topology_node_wrapper import TapiTopologyTopologyNodeWrapper +from tapi_server.models.tapi_topology_topology_ref import TapiTopologyTopologyRef +from tapi_server.models.tapi_topology_topology_ref_wrapper import TapiTopologyTopologyRefWrapper +from tapi_server.models.tapi_topology_topology_wrapper import TapiTopologyTopologyWrapper +from tapi_server.models.tapi_topology_transfer_cost_pac import TapiTopologyTransferCostPac +from tapi_server.models.tapi_topology_transfer_integrity_pac import TapiTopologyTransferIntegrityPac +from tapi_server.models.tapi_topology_transfer_timing_pac import TapiTopologyTransferTimingPac +from tapi_server.models.tapi_topology_validation_mechanism import TapiTopologyValidationMechanism +from tapi_server.models.tapi_topology_validation_mechanism_wrapper import TapiTopologyValidationMechanismWrapper +from tapi_server.models.tapi_topology_validation_pac import TapiTopologyValidationPac diff --git a/hackfest/tapi/server/tapi_server/models/base_model_.py b/hackfest/tapi/server/tapi_server/models/base_model_.py new file mode 100644 index 0000000000000000000000000000000000000000..8274e46d4ed03120aad7c3a501cc1aa63caf784a --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/base_model_.py @@ -0,0 +1,69 @@ +import pprint + +import six +import typing + +from tapi_server import util + +T = typing.TypeVar('T') + + +class Model(object): + # swaggerTypes: The key is attribute name and the + # value is attribute type. + swagger_types = {} + + # attributeMap: The key is attribute name and the + # value is json key in definition. + attribute_map = {} + + @classmethod + def from_dict(cls: typing.Type[T], dikt) -> T: + """Returns the dict as a model""" + return util.deserialize_model(dikt, cls) + + def to_dict(self): + """Returns the model properties as a dict + + :rtype: dict + """ + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model + + :rtype: str + """ + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/hackfest/tapi/server/tapi_server/models/operations_tapicommongetserviceinterfacepointdetails_body.py b/hackfest/tapi/server/tapi_server/models/operations_tapicommongetserviceinterfacepointdetails_body.py new file mode 100644 index 0000000000000000000000000000000000000000..7aedb617cd747956699e865fcd36b36760df40f4 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/operations_tapicommongetserviceinterfacepointdetails_body.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_getserviceinterfacepointdetails_input import TapiCommonGetserviceinterfacepointdetailsInput # noqa: F401,E501 +from tapi_server import util + + +class OperationsTapicommongetserviceinterfacepointdetailsBody(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, input: TapiCommonGetserviceinterfacepointdetailsInput=None): # noqa: E501 + """OperationsTapicommongetserviceinterfacepointdetailsBody - a model defined in Swagger + + :param input: The input of this OperationsTapicommongetserviceinterfacepointdetailsBody. # noqa: E501 + :type input: TapiCommonGetserviceinterfacepointdetailsInput + """ + self.swagger_types = { + 'input': TapiCommonGetserviceinterfacepointdetailsInput + } + + self.attribute_map = { + 'input': 'input' + } + self._input = input + + @classmethod + def from_dict(cls, dikt) -> 'OperationsTapicommongetserviceinterfacepointdetailsBody': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The operations_tapicommongetserviceinterfacepointdetails_body of this OperationsTapicommongetserviceinterfacepointdetailsBody. # noqa: E501 + :rtype: OperationsTapicommongetserviceinterfacepointdetailsBody + """ + return util.deserialize_model(dikt, cls) + + @property + def input(self) -> TapiCommonGetserviceinterfacepointdetailsInput: + """Gets the input of this OperationsTapicommongetserviceinterfacepointdetailsBody. + + + :return: The input of this OperationsTapicommongetserviceinterfacepointdetailsBody. + :rtype: TapiCommonGetserviceinterfacepointdetailsInput + """ + return self._input + + @input.setter + def input(self, input: TapiCommonGetserviceinterfacepointdetailsInput): + """Sets the input of this OperationsTapicommongetserviceinterfacepointdetailsBody. + + + :param input: The input of this OperationsTapicommongetserviceinterfacepointdetailsBody. + :type input: TapiCommonGetserviceinterfacepointdetailsInput + """ + + self._input = input diff --git a/hackfest/tapi/server/tapi_server/models/operations_tapicommonupdateserviceinterfacepoint_body.py b/hackfest/tapi/server/tapi_server/models/operations_tapicommonupdateserviceinterfacepoint_body.py new file mode 100644 index 0000000000000000000000000000000000000000..2e5574299100758bd6ffb18bec9e4ddcbf5abf35 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/operations_tapicommonupdateserviceinterfacepoint_body.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_updateserviceinterfacepoint_input import TapiCommonUpdateserviceinterfacepointInput # noqa: F401,E501 +from tapi_server import util + + +class OperationsTapicommonupdateserviceinterfacepointBody(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, input: TapiCommonUpdateserviceinterfacepointInput=None): # noqa: E501 + """OperationsTapicommonupdateserviceinterfacepointBody - a model defined in Swagger + + :param input: The input of this OperationsTapicommonupdateserviceinterfacepointBody. # noqa: E501 + :type input: TapiCommonUpdateserviceinterfacepointInput + """ + self.swagger_types = { + 'input': TapiCommonUpdateserviceinterfacepointInput + } + + self.attribute_map = { + 'input': 'input' + } + self._input = input + + @classmethod + def from_dict(cls, dikt) -> 'OperationsTapicommonupdateserviceinterfacepointBody': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The operations_tapicommonupdateserviceinterfacepoint_body of this OperationsTapicommonupdateserviceinterfacepointBody. # noqa: E501 + :rtype: OperationsTapicommonupdateserviceinterfacepointBody + """ + return util.deserialize_model(dikt, cls) + + @property + def input(self) -> TapiCommonUpdateserviceinterfacepointInput: + """Gets the input of this OperationsTapicommonupdateserviceinterfacepointBody. + + + :return: The input of this OperationsTapicommonupdateserviceinterfacepointBody. + :rtype: TapiCommonUpdateserviceinterfacepointInput + """ + return self._input + + @input.setter + def input(self, input: TapiCommonUpdateserviceinterfacepointInput): + """Sets the input of this OperationsTapicommonupdateserviceinterfacepointBody. + + + :param input: The input of this OperationsTapicommonupdateserviceinterfacepointBody. + :type input: TapiCommonUpdateserviceinterfacepointInput + """ + + self._input = input diff --git a/hackfest/tapi/server/tapi_server/models/operations_tapiconnectivitycreateconnectivityservice_body.py b/hackfest/tapi/server/tapi_server/models/operations_tapiconnectivitycreateconnectivityservice_body.py new file mode 100644 index 0000000000000000000000000000000000000000..f48baa1e698c0d26ff6a61f54ab47756eea29ba9 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/operations_tapiconnectivitycreateconnectivityservice_body.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_createconnectivityservice_input import TapiConnectivityCreateconnectivityserviceInput # noqa: F401,E501 +from tapi_server import util + + +class OperationsTapiconnectivitycreateconnectivityserviceBody(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, input: TapiConnectivityCreateconnectivityserviceInput=None): # noqa: E501 + """OperationsTapiconnectivitycreateconnectivityserviceBody - a model defined in Swagger + + :param input: The input of this OperationsTapiconnectivitycreateconnectivityserviceBody. # noqa: E501 + :type input: TapiConnectivityCreateconnectivityserviceInput + """ + self.swagger_types = { + 'input': TapiConnectivityCreateconnectivityserviceInput + } + + self.attribute_map = { + 'input': 'input' + } + self._input = input + + @classmethod + def from_dict(cls, dikt) -> 'OperationsTapiconnectivitycreateconnectivityserviceBody': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The operations_tapiconnectivitycreateconnectivityservice_body of this OperationsTapiconnectivitycreateconnectivityserviceBody. # noqa: E501 + :rtype: OperationsTapiconnectivitycreateconnectivityserviceBody + """ + return util.deserialize_model(dikt, cls) + + @property + def input(self) -> TapiConnectivityCreateconnectivityserviceInput: + """Gets the input of this OperationsTapiconnectivitycreateconnectivityserviceBody. + + + :return: The input of this OperationsTapiconnectivitycreateconnectivityserviceBody. + :rtype: TapiConnectivityCreateconnectivityserviceInput + """ + return self._input + + @input.setter + def input(self, input: TapiConnectivityCreateconnectivityserviceInput): + """Sets the input of this OperationsTapiconnectivitycreateconnectivityserviceBody. + + + :param input: The input of this OperationsTapiconnectivitycreateconnectivityserviceBody. + :type input: TapiConnectivityCreateconnectivityserviceInput + """ + + self._input = input diff --git a/hackfest/tapi/server/tapi_server/models/operations_tapiconnectivitydeleteconnectivityservice_body.py b/hackfest/tapi/server/tapi_server/models/operations_tapiconnectivitydeleteconnectivityservice_body.py new file mode 100644 index 0000000000000000000000000000000000000000..43ada2c16556ccbfe6582783ad2c79d25e794af0 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/operations_tapiconnectivitydeleteconnectivityservice_body.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_deleteconnectivityservice_input import TapiConnectivityDeleteconnectivityserviceInput # noqa: F401,E501 +from tapi_server import util + + +class OperationsTapiconnectivitydeleteconnectivityserviceBody(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, input: TapiConnectivityDeleteconnectivityserviceInput=None): # noqa: E501 + """OperationsTapiconnectivitydeleteconnectivityserviceBody - a model defined in Swagger + + :param input: The input of this OperationsTapiconnectivitydeleteconnectivityserviceBody. # noqa: E501 + :type input: TapiConnectivityDeleteconnectivityserviceInput + """ + self.swagger_types = { + 'input': TapiConnectivityDeleteconnectivityserviceInput + } + + self.attribute_map = { + 'input': 'input' + } + self._input = input + + @classmethod + def from_dict(cls, dikt) -> 'OperationsTapiconnectivitydeleteconnectivityserviceBody': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The operations_tapiconnectivitydeleteconnectivityservice_body of this OperationsTapiconnectivitydeleteconnectivityserviceBody. # noqa: E501 + :rtype: OperationsTapiconnectivitydeleteconnectivityserviceBody + """ + return util.deserialize_model(dikt, cls) + + @property + def input(self) -> TapiConnectivityDeleteconnectivityserviceInput: + """Gets the input of this OperationsTapiconnectivitydeleteconnectivityserviceBody. + + + :return: The input of this OperationsTapiconnectivitydeleteconnectivityserviceBody. + :rtype: TapiConnectivityDeleteconnectivityserviceInput + """ + return self._input + + @input.setter + def input(self, input: TapiConnectivityDeleteconnectivityserviceInput): + """Sets the input of this OperationsTapiconnectivitydeleteconnectivityserviceBody. + + + :param input: The input of this OperationsTapiconnectivitydeleteconnectivityserviceBody. + :type input: TapiConnectivityDeleteconnectivityserviceInput + """ + + self._input = input diff --git a/hackfest/tapi/server/tapi_server/models/operations_tapiconnectivitygetconnectiondetails_body.py b/hackfest/tapi/server/tapi_server/models/operations_tapiconnectivitygetconnectiondetails_body.py new file mode 100644 index 0000000000000000000000000000000000000000..07d1b21df5bfcc276c8390d94abbe9134cdd3a3b --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/operations_tapiconnectivitygetconnectiondetails_body.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_getconnectiondetails_input import TapiConnectivityGetconnectiondetailsInput # noqa: F401,E501 +from tapi_server import util + + +class OperationsTapiconnectivitygetconnectiondetailsBody(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, input: TapiConnectivityGetconnectiondetailsInput=None): # noqa: E501 + """OperationsTapiconnectivitygetconnectiondetailsBody - a model defined in Swagger + + :param input: The input of this OperationsTapiconnectivitygetconnectiondetailsBody. # noqa: E501 + :type input: TapiConnectivityGetconnectiondetailsInput + """ + self.swagger_types = { + 'input': TapiConnectivityGetconnectiondetailsInput + } + + self.attribute_map = { + 'input': 'input' + } + self._input = input + + @classmethod + def from_dict(cls, dikt) -> 'OperationsTapiconnectivitygetconnectiondetailsBody': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The operations_tapiconnectivitygetconnectiondetails_body of this OperationsTapiconnectivitygetconnectiondetailsBody. # noqa: E501 + :rtype: OperationsTapiconnectivitygetconnectiondetailsBody + """ + return util.deserialize_model(dikt, cls) + + @property + def input(self) -> TapiConnectivityGetconnectiondetailsInput: + """Gets the input of this OperationsTapiconnectivitygetconnectiondetailsBody. + + + :return: The input of this OperationsTapiconnectivitygetconnectiondetailsBody. + :rtype: TapiConnectivityGetconnectiondetailsInput + """ + return self._input + + @input.setter + def input(self, input: TapiConnectivityGetconnectiondetailsInput): + """Sets the input of this OperationsTapiconnectivitygetconnectiondetailsBody. + + + :param input: The input of this OperationsTapiconnectivitygetconnectiondetailsBody. + :type input: TapiConnectivityGetconnectiondetailsInput + """ + + self._input = input diff --git a/hackfest/tapi/server/tapi_server/models/operations_tapiconnectivitygetconnectionendpointdetails_body.py b/hackfest/tapi/server/tapi_server/models/operations_tapiconnectivitygetconnectionendpointdetails_body.py new file mode 100644 index 0000000000000000000000000000000000000000..6543435bb6ce69f876c1c43c8d3bf574112bbfdc --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/operations_tapiconnectivitygetconnectionendpointdetails_body.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_getconnectionendpointdetails_input import TapiConnectivityGetconnectionendpointdetailsInput # noqa: F401,E501 +from tapi_server import util + + +class OperationsTapiconnectivitygetconnectionendpointdetailsBody(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, input: TapiConnectivityGetconnectionendpointdetailsInput=None): # noqa: E501 + """OperationsTapiconnectivitygetconnectionendpointdetailsBody - a model defined in Swagger + + :param input: The input of this OperationsTapiconnectivitygetconnectionendpointdetailsBody. # noqa: E501 + :type input: TapiConnectivityGetconnectionendpointdetailsInput + """ + self.swagger_types = { + 'input': TapiConnectivityGetconnectionendpointdetailsInput + } + + self.attribute_map = { + 'input': 'input' + } + self._input = input + + @classmethod + def from_dict(cls, dikt) -> 'OperationsTapiconnectivitygetconnectionendpointdetailsBody': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The operations_tapiconnectivitygetconnectionendpointdetails_body of this OperationsTapiconnectivitygetconnectionendpointdetailsBody. # noqa: E501 + :rtype: OperationsTapiconnectivitygetconnectionendpointdetailsBody + """ + return util.deserialize_model(dikt, cls) + + @property + def input(self) -> TapiConnectivityGetconnectionendpointdetailsInput: + """Gets the input of this OperationsTapiconnectivitygetconnectionendpointdetailsBody. + + + :return: The input of this OperationsTapiconnectivitygetconnectionendpointdetailsBody. + :rtype: TapiConnectivityGetconnectionendpointdetailsInput + """ + return self._input + + @input.setter + def input(self, input: TapiConnectivityGetconnectionendpointdetailsInput): + """Sets the input of this OperationsTapiconnectivitygetconnectionendpointdetailsBody. + + + :param input: The input of this OperationsTapiconnectivitygetconnectionendpointdetailsBody. + :type input: TapiConnectivityGetconnectionendpointdetailsInput + """ + + self._input = input diff --git a/hackfest/tapi/server/tapi_server/models/operations_tapiconnectivitygetconnectivityservicedetails_body.py b/hackfest/tapi/server/tapi_server/models/operations_tapiconnectivitygetconnectivityservicedetails_body.py new file mode 100644 index 0000000000000000000000000000000000000000..ee223091c715cf1905b62a9d3dba8ed778138088 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/operations_tapiconnectivitygetconnectivityservicedetails_body.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_getconnectivityservicedetails_input import TapiConnectivityGetconnectivityservicedetailsInput # noqa: F401,E501 +from tapi_server import util + + +class OperationsTapiconnectivitygetconnectivityservicedetailsBody(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, input: TapiConnectivityGetconnectivityservicedetailsInput=None): # noqa: E501 + """OperationsTapiconnectivitygetconnectivityservicedetailsBody - a model defined in Swagger + + :param input: The input of this OperationsTapiconnectivitygetconnectivityservicedetailsBody. # noqa: E501 + :type input: TapiConnectivityGetconnectivityservicedetailsInput + """ + self.swagger_types = { + 'input': TapiConnectivityGetconnectivityservicedetailsInput + } + + self.attribute_map = { + 'input': 'input' + } + self._input = input + + @classmethod + def from_dict(cls, dikt) -> 'OperationsTapiconnectivitygetconnectivityservicedetailsBody': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The operations_tapiconnectivitygetconnectivityservicedetails_body of this OperationsTapiconnectivitygetconnectivityservicedetailsBody. # noqa: E501 + :rtype: OperationsTapiconnectivitygetconnectivityservicedetailsBody + """ + return util.deserialize_model(dikt, cls) + + @property + def input(self) -> TapiConnectivityGetconnectivityservicedetailsInput: + """Gets the input of this OperationsTapiconnectivitygetconnectivityservicedetailsBody. + + + :return: The input of this OperationsTapiconnectivitygetconnectivityservicedetailsBody. + :rtype: TapiConnectivityGetconnectivityservicedetailsInput + """ + return self._input + + @input.setter + def input(self, input: TapiConnectivityGetconnectivityservicedetailsInput): + """Sets the input of this OperationsTapiconnectivitygetconnectivityservicedetailsBody. + + + :param input: The input of this OperationsTapiconnectivitygetconnectivityservicedetailsBody. + :type input: TapiConnectivityGetconnectivityservicedetailsInput + """ + + self._input = input diff --git a/hackfest/tapi/server/tapi_server/models/operations_tapiconnectivityupdateconnectivityservice_body.py b/hackfest/tapi/server/tapi_server/models/operations_tapiconnectivityupdateconnectivityservice_body.py new file mode 100644 index 0000000000000000000000000000000000000000..fb22c93f630536f7f22d9f586cf09adb23432e8e --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/operations_tapiconnectivityupdateconnectivityservice_body.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_updateconnectivityservice_input import TapiConnectivityUpdateconnectivityserviceInput # noqa: F401,E501 +from tapi_server import util + + +class OperationsTapiconnectivityupdateconnectivityserviceBody(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, input: TapiConnectivityUpdateconnectivityserviceInput=None): # noqa: E501 + """OperationsTapiconnectivityupdateconnectivityserviceBody - a model defined in Swagger + + :param input: The input of this OperationsTapiconnectivityupdateconnectivityserviceBody. # noqa: E501 + :type input: TapiConnectivityUpdateconnectivityserviceInput + """ + self.swagger_types = { + 'input': TapiConnectivityUpdateconnectivityserviceInput + } + + self.attribute_map = { + 'input': 'input' + } + self._input = input + + @classmethod + def from_dict(cls, dikt) -> 'OperationsTapiconnectivityupdateconnectivityserviceBody': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The operations_tapiconnectivityupdateconnectivityservice_body of this OperationsTapiconnectivityupdateconnectivityserviceBody. # noqa: E501 + :rtype: OperationsTapiconnectivityupdateconnectivityserviceBody + """ + return util.deserialize_model(dikt, cls) + + @property + def input(self) -> TapiConnectivityUpdateconnectivityserviceInput: + """Gets the input of this OperationsTapiconnectivityupdateconnectivityserviceBody. + + + :return: The input of this OperationsTapiconnectivityupdateconnectivityserviceBody. + :rtype: TapiConnectivityUpdateconnectivityserviceInput + """ + return self._input + + @input.setter + def input(self, input: TapiConnectivityUpdateconnectivityserviceInput): + """Sets the input of this OperationsTapiconnectivityupdateconnectivityserviceBody. + + + :param input: The input of this OperationsTapiconnectivityupdateconnectivityserviceBody. + :type input: TapiConnectivityUpdateconnectivityserviceInput + """ + + self._input = input diff --git a/hackfest/tapi/server/tapi_server/models/operations_tapinotificationcreatenotificationsubscriptionservice_body.py b/hackfest/tapi/server/tapi_server/models/operations_tapinotificationcreatenotificationsubscriptionservice_body.py new file mode 100644 index 0000000000000000000000000000000000000000..43a6f7b5a6d58a9f33c6b47b24c5cbcbc20bebda --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/operations_tapinotificationcreatenotificationsubscriptionservice_body.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_createnotificationsubscriptionservice_input import TapiNotificationCreatenotificationsubscriptionserviceInput # noqa: F401,E501 +from tapi_server import util + + +class OperationsTapinotificationcreatenotificationsubscriptionserviceBody(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, input: TapiNotificationCreatenotificationsubscriptionserviceInput=None): # noqa: E501 + """OperationsTapinotificationcreatenotificationsubscriptionserviceBody - a model defined in Swagger + + :param input: The input of this OperationsTapinotificationcreatenotificationsubscriptionserviceBody. # noqa: E501 + :type input: TapiNotificationCreatenotificationsubscriptionserviceInput + """ + self.swagger_types = { + 'input': TapiNotificationCreatenotificationsubscriptionserviceInput + } + + self.attribute_map = { + 'input': 'input' + } + self._input = input + + @classmethod + def from_dict(cls, dikt) -> 'OperationsTapinotificationcreatenotificationsubscriptionserviceBody': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The operations_tapinotificationcreatenotificationsubscriptionservice_body of this OperationsTapinotificationcreatenotificationsubscriptionserviceBody. # noqa: E501 + :rtype: OperationsTapinotificationcreatenotificationsubscriptionserviceBody + """ + return util.deserialize_model(dikt, cls) + + @property + def input(self) -> TapiNotificationCreatenotificationsubscriptionserviceInput: + """Gets the input of this OperationsTapinotificationcreatenotificationsubscriptionserviceBody. + + + :return: The input of this OperationsTapinotificationcreatenotificationsubscriptionserviceBody. + :rtype: TapiNotificationCreatenotificationsubscriptionserviceInput + """ + return self._input + + @input.setter + def input(self, input: TapiNotificationCreatenotificationsubscriptionserviceInput): + """Sets the input of this OperationsTapinotificationcreatenotificationsubscriptionserviceBody. + + + :param input: The input of this OperationsTapinotificationcreatenotificationsubscriptionserviceBody. + :type input: TapiNotificationCreatenotificationsubscriptionserviceInput + """ + + self._input = input diff --git a/hackfest/tapi/server/tapi_server/models/operations_tapinotificationdeletenotificationsubscriptionservice_body.py b/hackfest/tapi/server/tapi_server/models/operations_tapinotificationdeletenotificationsubscriptionservice_body.py new file mode 100644 index 0000000000000000000000000000000000000000..ec9af03045ce0dbd64334a3bfba074fa7c7a2faa --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/operations_tapinotificationdeletenotificationsubscriptionservice_body.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_deletenotificationsubscriptionservice_input import TapiNotificationDeletenotificationsubscriptionserviceInput # noqa: F401,E501 +from tapi_server import util + + +class OperationsTapinotificationdeletenotificationsubscriptionserviceBody(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, input: TapiNotificationDeletenotificationsubscriptionserviceInput=None): # noqa: E501 + """OperationsTapinotificationdeletenotificationsubscriptionserviceBody - a model defined in Swagger + + :param input: The input of this OperationsTapinotificationdeletenotificationsubscriptionserviceBody. # noqa: E501 + :type input: TapiNotificationDeletenotificationsubscriptionserviceInput + """ + self.swagger_types = { + 'input': TapiNotificationDeletenotificationsubscriptionserviceInput + } + + self.attribute_map = { + 'input': 'input' + } + self._input = input + + @classmethod + def from_dict(cls, dikt) -> 'OperationsTapinotificationdeletenotificationsubscriptionserviceBody': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The operations_tapinotificationdeletenotificationsubscriptionservice_body of this OperationsTapinotificationdeletenotificationsubscriptionserviceBody. # noqa: E501 + :rtype: OperationsTapinotificationdeletenotificationsubscriptionserviceBody + """ + return util.deserialize_model(dikt, cls) + + @property + def input(self) -> TapiNotificationDeletenotificationsubscriptionserviceInput: + """Gets the input of this OperationsTapinotificationdeletenotificationsubscriptionserviceBody. + + + :return: The input of this OperationsTapinotificationdeletenotificationsubscriptionserviceBody. + :rtype: TapiNotificationDeletenotificationsubscriptionserviceInput + """ + return self._input + + @input.setter + def input(self, input: TapiNotificationDeletenotificationsubscriptionserviceInput): + """Sets the input of this OperationsTapinotificationdeletenotificationsubscriptionserviceBody. + + + :param input: The input of this OperationsTapinotificationdeletenotificationsubscriptionserviceBody. + :type input: TapiNotificationDeletenotificationsubscriptionserviceInput + """ + + self._input = input diff --git a/hackfest/tapi/server/tapi_server/models/operations_tapinotificationgetnotificationlist_body.py b/hackfest/tapi/server/tapi_server/models/operations_tapinotificationgetnotificationlist_body.py new file mode 100644 index 0000000000000000000000000000000000000000..257a824eebcdbb57d74af2b04244986f7997282a --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/operations_tapinotificationgetnotificationlist_body.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_getnotificationlist_input import TapiNotificationGetnotificationlistInput # noqa: F401,E501 +from tapi_server import util + + +class OperationsTapinotificationgetnotificationlistBody(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, input: TapiNotificationGetnotificationlistInput=None): # noqa: E501 + """OperationsTapinotificationgetnotificationlistBody - a model defined in Swagger + + :param input: The input of this OperationsTapinotificationgetnotificationlistBody. # noqa: E501 + :type input: TapiNotificationGetnotificationlistInput + """ + self.swagger_types = { + 'input': TapiNotificationGetnotificationlistInput + } + + self.attribute_map = { + 'input': 'input' + } + self._input = input + + @classmethod + def from_dict(cls, dikt) -> 'OperationsTapinotificationgetnotificationlistBody': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The operations_tapinotificationgetnotificationlist_body of this OperationsTapinotificationgetnotificationlistBody. # noqa: E501 + :rtype: OperationsTapinotificationgetnotificationlistBody + """ + return util.deserialize_model(dikt, cls) + + @property + def input(self) -> TapiNotificationGetnotificationlistInput: + """Gets the input of this OperationsTapinotificationgetnotificationlistBody. + + + :return: The input of this OperationsTapinotificationgetnotificationlistBody. + :rtype: TapiNotificationGetnotificationlistInput + """ + return self._input + + @input.setter + def input(self, input: TapiNotificationGetnotificationlistInput): + """Sets the input of this OperationsTapinotificationgetnotificationlistBody. + + + :param input: The input of this OperationsTapinotificationgetnotificationlistBody. + :type input: TapiNotificationGetnotificationlistInput + """ + + self._input = input diff --git a/hackfest/tapi/server/tapi_server/models/operations_tapinotificationgetnotificationsubscriptionservicedetails_body.py b/hackfest/tapi/server/tapi_server/models/operations_tapinotificationgetnotificationsubscriptionservicedetails_body.py new file mode 100644 index 0000000000000000000000000000000000000000..6fefb3a1038b67ae936cee91360afd425c99969b --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/operations_tapinotificationgetnotificationsubscriptionservicedetails_body.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_getnotificationsubscriptionservicedetails_input import TapiNotificationGetnotificationsubscriptionservicedetailsInput # noqa: F401,E501 +from tapi_server import util + + +class OperationsTapinotificationgetnotificationsubscriptionservicedetailsBody(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, input: TapiNotificationGetnotificationsubscriptionservicedetailsInput=None): # noqa: E501 + """OperationsTapinotificationgetnotificationsubscriptionservicedetailsBody - a model defined in Swagger + + :param input: The input of this OperationsTapinotificationgetnotificationsubscriptionservicedetailsBody. # noqa: E501 + :type input: TapiNotificationGetnotificationsubscriptionservicedetailsInput + """ + self.swagger_types = { + 'input': TapiNotificationGetnotificationsubscriptionservicedetailsInput + } + + self.attribute_map = { + 'input': 'input' + } + self._input = input + + @classmethod + def from_dict(cls, dikt) -> 'OperationsTapinotificationgetnotificationsubscriptionservicedetailsBody': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The operations_tapinotificationgetnotificationsubscriptionservicedetails_body of this OperationsTapinotificationgetnotificationsubscriptionservicedetailsBody. # noqa: E501 + :rtype: OperationsTapinotificationgetnotificationsubscriptionservicedetailsBody + """ + return util.deserialize_model(dikt, cls) + + @property + def input(self) -> TapiNotificationGetnotificationsubscriptionservicedetailsInput: + """Gets the input of this OperationsTapinotificationgetnotificationsubscriptionservicedetailsBody. + + + :return: The input of this OperationsTapinotificationgetnotificationsubscriptionservicedetailsBody. + :rtype: TapiNotificationGetnotificationsubscriptionservicedetailsInput + """ + return self._input + + @input.setter + def input(self, input: TapiNotificationGetnotificationsubscriptionservicedetailsInput): + """Sets the input of this OperationsTapinotificationgetnotificationsubscriptionservicedetailsBody. + + + :param input: The input of this OperationsTapinotificationgetnotificationsubscriptionservicedetailsBody. + :type input: TapiNotificationGetnotificationsubscriptionservicedetailsInput + """ + + self._input = input diff --git a/hackfest/tapi/server/tapi_server/models/operations_tapinotificationupdatenotificationsubscriptionservice_body.py b/hackfest/tapi/server/tapi_server/models/operations_tapinotificationupdatenotificationsubscriptionservice_body.py new file mode 100644 index 0000000000000000000000000000000000000000..68baf4d2b0f86444cd8dd651c38e5460d9dd095e --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/operations_tapinotificationupdatenotificationsubscriptionservice_body.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_updatenotificationsubscriptionservice_input import TapiNotificationUpdatenotificationsubscriptionserviceInput # noqa: F401,E501 +from tapi_server import util + + +class OperationsTapinotificationupdatenotificationsubscriptionserviceBody(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, input: TapiNotificationUpdatenotificationsubscriptionserviceInput=None): # noqa: E501 + """OperationsTapinotificationupdatenotificationsubscriptionserviceBody - a model defined in Swagger + + :param input: The input of this OperationsTapinotificationupdatenotificationsubscriptionserviceBody. # noqa: E501 + :type input: TapiNotificationUpdatenotificationsubscriptionserviceInput + """ + self.swagger_types = { + 'input': TapiNotificationUpdatenotificationsubscriptionserviceInput + } + + self.attribute_map = { + 'input': 'input' + } + self._input = input + + @classmethod + def from_dict(cls, dikt) -> 'OperationsTapinotificationupdatenotificationsubscriptionserviceBody': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The operations_tapinotificationupdatenotificationsubscriptionservice_body of this OperationsTapinotificationupdatenotificationsubscriptionserviceBody. # noqa: E501 + :rtype: OperationsTapinotificationupdatenotificationsubscriptionserviceBody + """ + return util.deserialize_model(dikt, cls) + + @property + def input(self) -> TapiNotificationUpdatenotificationsubscriptionserviceInput: + """Gets the input of this OperationsTapinotificationupdatenotificationsubscriptionserviceBody. + + + :return: The input of this OperationsTapinotificationupdatenotificationsubscriptionserviceBody. + :rtype: TapiNotificationUpdatenotificationsubscriptionserviceInput + """ + return self._input + + @input.setter + def input(self, input: TapiNotificationUpdatenotificationsubscriptionserviceInput): + """Sets the input of this OperationsTapinotificationupdatenotificationsubscriptionserviceBody. + + + :param input: The input of this OperationsTapinotificationupdatenotificationsubscriptionserviceBody. + :type input: TapiNotificationUpdatenotificationsubscriptionserviceInput + """ + + self._input = input diff --git a/hackfest/tapi/server/tapi_server/models/operations_tapipathcomputationcomputep2ppath_body.py b/hackfest/tapi/server/tapi_server/models/operations_tapipathcomputationcomputep2ppath_body.py new file mode 100644 index 0000000000000000000000000000000000000000..c18dcc4a67b22ca066d39099a5fab21f7881ea47 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/operations_tapipathcomputationcomputep2ppath_body.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_computep2ppath_input import TapiPathComputationComputep2ppathInput # noqa: F401,E501 +from tapi_server import util + + +class OperationsTapipathcomputationcomputep2ppathBody(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, input: TapiPathComputationComputep2ppathInput=None): # noqa: E501 + """OperationsTapipathcomputationcomputep2ppathBody - a model defined in Swagger + + :param input: The input of this OperationsTapipathcomputationcomputep2ppathBody. # noqa: E501 + :type input: TapiPathComputationComputep2ppathInput + """ + self.swagger_types = { + 'input': TapiPathComputationComputep2ppathInput + } + + self.attribute_map = { + 'input': 'input' + } + self._input = input + + @classmethod + def from_dict(cls, dikt) -> 'OperationsTapipathcomputationcomputep2ppathBody': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The operations_tapipathcomputationcomputep2ppath_body of this OperationsTapipathcomputationcomputep2ppathBody. # noqa: E501 + :rtype: OperationsTapipathcomputationcomputep2ppathBody + """ + return util.deserialize_model(dikt, cls) + + @property + def input(self) -> TapiPathComputationComputep2ppathInput: + """Gets the input of this OperationsTapipathcomputationcomputep2ppathBody. + + + :return: The input of this OperationsTapipathcomputationcomputep2ppathBody. + :rtype: TapiPathComputationComputep2ppathInput + """ + return self._input + + @input.setter + def input(self, input: TapiPathComputationComputep2ppathInput): + """Sets the input of this OperationsTapipathcomputationcomputep2ppathBody. + + + :param input: The input of this OperationsTapipathcomputationcomputep2ppathBody. + :type input: TapiPathComputationComputep2ppathInput + """ + + self._input = input diff --git a/hackfest/tapi/server/tapi_server/models/operations_tapipathcomputationdeletep2ppath_body.py b/hackfest/tapi/server/tapi_server/models/operations_tapipathcomputationdeletep2ppath_body.py new file mode 100644 index 0000000000000000000000000000000000000000..a7ac8ce61783786629120bec45ceacfb26b03eb0 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/operations_tapipathcomputationdeletep2ppath_body.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_deletep2ppath_input import TapiPathComputationDeletep2ppathInput # noqa: F401,E501 +from tapi_server import util + + +class OperationsTapipathcomputationdeletep2ppathBody(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, input: TapiPathComputationDeletep2ppathInput=None): # noqa: E501 + """OperationsTapipathcomputationdeletep2ppathBody - a model defined in Swagger + + :param input: The input of this OperationsTapipathcomputationdeletep2ppathBody. # noqa: E501 + :type input: TapiPathComputationDeletep2ppathInput + """ + self.swagger_types = { + 'input': TapiPathComputationDeletep2ppathInput + } + + self.attribute_map = { + 'input': 'input' + } + self._input = input + + @classmethod + def from_dict(cls, dikt) -> 'OperationsTapipathcomputationdeletep2ppathBody': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The operations_tapipathcomputationdeletep2ppath_body of this OperationsTapipathcomputationdeletep2ppathBody. # noqa: E501 + :rtype: OperationsTapipathcomputationdeletep2ppathBody + """ + return util.deserialize_model(dikt, cls) + + @property + def input(self) -> TapiPathComputationDeletep2ppathInput: + """Gets the input of this OperationsTapipathcomputationdeletep2ppathBody. + + + :return: The input of this OperationsTapipathcomputationdeletep2ppathBody. + :rtype: TapiPathComputationDeletep2ppathInput + """ + return self._input + + @input.setter + def input(self, input: TapiPathComputationDeletep2ppathInput): + """Sets the input of this OperationsTapipathcomputationdeletep2ppathBody. + + + :param input: The input of this OperationsTapipathcomputationdeletep2ppathBody. + :type input: TapiPathComputationDeletep2ppathInput + """ + + self._input = input diff --git a/hackfest/tapi/server/tapi_server/models/operations_tapipathcomputationoptimizep2ppath_body.py b/hackfest/tapi/server/tapi_server/models/operations_tapipathcomputationoptimizep2ppath_body.py new file mode 100644 index 0000000000000000000000000000000000000000..33e7f86648abc07991b13f04567b6d7c4e717ced --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/operations_tapipathcomputationoptimizep2ppath_body.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_optimizep2ppath_input import TapiPathComputationOptimizep2ppathInput # noqa: F401,E501 +from tapi_server import util + + +class OperationsTapipathcomputationoptimizep2ppathBody(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, input: TapiPathComputationOptimizep2ppathInput=None): # noqa: E501 + """OperationsTapipathcomputationoptimizep2ppathBody - a model defined in Swagger + + :param input: The input of this OperationsTapipathcomputationoptimizep2ppathBody. # noqa: E501 + :type input: TapiPathComputationOptimizep2ppathInput + """ + self.swagger_types = { + 'input': TapiPathComputationOptimizep2ppathInput + } + + self.attribute_map = { + 'input': 'input' + } + self._input = input + + @classmethod + def from_dict(cls, dikt) -> 'OperationsTapipathcomputationoptimizep2ppathBody': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The operations_tapipathcomputationoptimizep2ppath_body of this OperationsTapipathcomputationoptimizep2ppathBody. # noqa: E501 + :rtype: OperationsTapipathcomputationoptimizep2ppathBody + """ + return util.deserialize_model(dikt, cls) + + @property + def input(self) -> TapiPathComputationOptimizep2ppathInput: + """Gets the input of this OperationsTapipathcomputationoptimizep2ppathBody. + + + :return: The input of this OperationsTapipathcomputationoptimizep2ppathBody. + :rtype: TapiPathComputationOptimizep2ppathInput + """ + return self._input + + @input.setter + def input(self, input: TapiPathComputationOptimizep2ppathInput): + """Sets the input of this OperationsTapipathcomputationoptimizep2ppathBody. + + + :param input: The input of this OperationsTapipathcomputationoptimizep2ppathBody. + :type input: TapiPathComputationOptimizep2ppathInput + """ + + self._input = input diff --git a/hackfest/tapi/server/tapi_server/models/operations_tapitopologygetlinkdetails_body.py b/hackfest/tapi/server/tapi_server/models/operations_tapitopologygetlinkdetails_body.py new file mode 100644 index 0000000000000000000000000000000000000000..389a4d7f51dce713d94ee4273026cf7da5b8a900 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/operations_tapitopologygetlinkdetails_body.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_getlinkdetails_input import TapiTopologyGetlinkdetailsInput # noqa: F401,E501 +from tapi_server import util + + +class OperationsTapitopologygetlinkdetailsBody(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, input: TapiTopologyGetlinkdetailsInput=None): # noqa: E501 + """OperationsTapitopologygetlinkdetailsBody - a model defined in Swagger + + :param input: The input of this OperationsTapitopologygetlinkdetailsBody. # noqa: E501 + :type input: TapiTopologyGetlinkdetailsInput + """ + self.swagger_types = { + 'input': TapiTopologyGetlinkdetailsInput + } + + self.attribute_map = { + 'input': 'input' + } + self._input = input + + @classmethod + def from_dict(cls, dikt) -> 'OperationsTapitopologygetlinkdetailsBody': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The operations_tapitopologygetlinkdetails_body of this OperationsTapitopologygetlinkdetailsBody. # noqa: E501 + :rtype: OperationsTapitopologygetlinkdetailsBody + """ + return util.deserialize_model(dikt, cls) + + @property + def input(self) -> TapiTopologyGetlinkdetailsInput: + """Gets the input of this OperationsTapitopologygetlinkdetailsBody. + + + :return: The input of this OperationsTapitopologygetlinkdetailsBody. + :rtype: TapiTopologyGetlinkdetailsInput + """ + return self._input + + @input.setter + def input(self, input: TapiTopologyGetlinkdetailsInput): + """Sets the input of this OperationsTapitopologygetlinkdetailsBody. + + + :param input: The input of this OperationsTapitopologygetlinkdetailsBody. + :type input: TapiTopologyGetlinkdetailsInput + """ + + self._input = input diff --git a/hackfest/tapi/server/tapi_server/models/operations_tapitopologygetnodedetails_body.py b/hackfest/tapi/server/tapi_server/models/operations_tapitopologygetnodedetails_body.py new file mode 100644 index 0000000000000000000000000000000000000000..cd83d5b34aed1bb7564bfcaffb98c7351fbcaeab --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/operations_tapitopologygetnodedetails_body.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_getnodedetails_input import TapiTopologyGetnodedetailsInput # noqa: F401,E501 +from tapi_server import util + + +class OperationsTapitopologygetnodedetailsBody(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, input: TapiTopologyGetnodedetailsInput=None): # noqa: E501 + """OperationsTapitopologygetnodedetailsBody - a model defined in Swagger + + :param input: The input of this OperationsTapitopologygetnodedetailsBody. # noqa: E501 + :type input: TapiTopologyGetnodedetailsInput + """ + self.swagger_types = { + 'input': TapiTopologyGetnodedetailsInput + } + + self.attribute_map = { + 'input': 'input' + } + self._input = input + + @classmethod + def from_dict(cls, dikt) -> 'OperationsTapitopologygetnodedetailsBody': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The operations_tapitopologygetnodedetails_body of this OperationsTapitopologygetnodedetailsBody. # noqa: E501 + :rtype: OperationsTapitopologygetnodedetailsBody + """ + return util.deserialize_model(dikt, cls) + + @property + def input(self) -> TapiTopologyGetnodedetailsInput: + """Gets the input of this OperationsTapitopologygetnodedetailsBody. + + + :return: The input of this OperationsTapitopologygetnodedetailsBody. + :rtype: TapiTopologyGetnodedetailsInput + """ + return self._input + + @input.setter + def input(self, input: TapiTopologyGetnodedetailsInput): + """Sets the input of this OperationsTapitopologygetnodedetailsBody. + + + :param input: The input of this OperationsTapitopologygetnodedetailsBody. + :type input: TapiTopologyGetnodedetailsInput + """ + + self._input = input diff --git a/hackfest/tapi/server/tapi_server/models/operations_tapitopologygetnodeedgepointdetails_body.py b/hackfest/tapi/server/tapi_server/models/operations_tapitopologygetnodeedgepointdetails_body.py new file mode 100644 index 0000000000000000000000000000000000000000..dd43956fae60bed31beed4b0a49ccba555a0a732 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/operations_tapitopologygetnodeedgepointdetails_body.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_getnodeedgepointdetails_input import TapiTopologyGetnodeedgepointdetailsInput # noqa: F401,E501 +from tapi_server import util + + +class OperationsTapitopologygetnodeedgepointdetailsBody(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, input: TapiTopologyGetnodeedgepointdetailsInput=None): # noqa: E501 + """OperationsTapitopologygetnodeedgepointdetailsBody - a model defined in Swagger + + :param input: The input of this OperationsTapitopologygetnodeedgepointdetailsBody. # noqa: E501 + :type input: TapiTopologyGetnodeedgepointdetailsInput + """ + self.swagger_types = { + 'input': TapiTopologyGetnodeedgepointdetailsInput + } + + self.attribute_map = { + 'input': 'input' + } + self._input = input + + @classmethod + def from_dict(cls, dikt) -> 'OperationsTapitopologygetnodeedgepointdetailsBody': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The operations_tapitopologygetnodeedgepointdetails_body of this OperationsTapitopologygetnodeedgepointdetailsBody. # noqa: E501 + :rtype: OperationsTapitopologygetnodeedgepointdetailsBody + """ + return util.deserialize_model(dikt, cls) + + @property + def input(self) -> TapiTopologyGetnodeedgepointdetailsInput: + """Gets the input of this OperationsTapitopologygetnodeedgepointdetailsBody. + + + :return: The input of this OperationsTapitopologygetnodeedgepointdetailsBody. + :rtype: TapiTopologyGetnodeedgepointdetailsInput + """ + return self._input + + @input.setter + def input(self, input: TapiTopologyGetnodeedgepointdetailsInput): + """Sets the input of this OperationsTapitopologygetnodeedgepointdetailsBody. + + + :param input: The input of this OperationsTapitopologygetnodeedgepointdetailsBody. + :type input: TapiTopologyGetnodeedgepointdetailsInput + """ + + self._input = input diff --git a/hackfest/tapi/server/tapi_server/models/operations_tapitopologygettopologydetails_body.py b/hackfest/tapi/server/tapi_server/models/operations_tapitopologygettopologydetails_body.py new file mode 100644 index 0000000000000000000000000000000000000000..f5a0f2d932ddb6b3f082b5a61269bfd3d2fc8508 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/operations_tapitopologygettopologydetails_body.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_gettopologydetails_input import TapiTopologyGettopologydetailsInput # noqa: F401,E501 +from tapi_server import util + + +class OperationsTapitopologygettopologydetailsBody(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, input: TapiTopologyGettopologydetailsInput=None): # noqa: E501 + """OperationsTapitopologygettopologydetailsBody - a model defined in Swagger + + :param input: The input of this OperationsTapitopologygettopologydetailsBody. # noqa: E501 + :type input: TapiTopologyGettopologydetailsInput + """ + self.swagger_types = { + 'input': TapiTopologyGettopologydetailsInput + } + + self.attribute_map = { + 'input': 'input' + } + self._input = input + + @classmethod + def from_dict(cls, dikt) -> 'OperationsTapitopologygettopologydetailsBody': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The operations_tapitopologygettopologydetails_body of this OperationsTapitopologygettopologydetailsBody. # noqa: E501 + :rtype: OperationsTapitopologygettopologydetailsBody + """ + return util.deserialize_model(dikt, cls) + + @property + def input(self) -> TapiTopologyGettopologydetailsInput: + """Gets the input of this OperationsTapitopologygettopologydetailsBody. + + + :return: The input of this OperationsTapitopologygettopologydetailsBody. + :rtype: TapiTopologyGettopologydetailsInput + """ + return self._input + + @input.setter + def input(self, input: TapiTopologyGettopologydetailsInput): + """Sets the input of this OperationsTapitopologygettopologydetailsBody. + + + :param input: The input of this OperationsTapitopologygettopologydetailsBody. + :type input: TapiTopologyGettopologydetailsInput + """ + + self._input = input diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_admin_state_pac.py b/hackfest/tapi/server/tapi_server/models/tapi_common_admin_state_pac.py new file mode 100644 index 0000000000000000000000000000000000000000..1db830d31415b70a9a19bb0a3ba740153e886594 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_admin_state_pac.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_administrative_state import TapiCommonAdministrativeState # noqa: F401,E501 +from tapi_server.models.tapi_common_lifecycle_state import TapiCommonLifecycleState # noqa: F401,E501 +from tapi_server.models.tapi_common_operational_state import TapiCommonOperationalState # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonAdminStatePac(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, operational_state: TapiCommonOperationalState=None, lifecycle_state: TapiCommonLifecycleState=None, administrative_state: TapiCommonAdministrativeState=None): # noqa: E501 + """TapiCommonAdminStatePac - a model defined in Swagger + + :param operational_state: The operational_state of this TapiCommonAdminStatePac. # noqa: E501 + :type operational_state: TapiCommonOperationalState + :param lifecycle_state: The lifecycle_state of this TapiCommonAdminStatePac. # noqa: E501 + :type lifecycle_state: TapiCommonLifecycleState + :param administrative_state: The administrative_state of this TapiCommonAdminStatePac. # noqa: E501 + :type administrative_state: TapiCommonAdministrativeState + """ + self.swagger_types = { + 'operational_state': TapiCommonOperationalState, + 'lifecycle_state': TapiCommonLifecycleState, + 'administrative_state': TapiCommonAdministrativeState + } + + self.attribute_map = { + 'operational_state': 'operational-state', + 'lifecycle_state': 'lifecycle-state', + 'administrative_state': 'administrative-state' + } + self._operational_state = operational_state + self._lifecycle_state = lifecycle_state + self._administrative_state = administrative_state + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonAdminStatePac': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.AdminStatePac of this TapiCommonAdminStatePac. # noqa: E501 + :rtype: TapiCommonAdminStatePac + """ + return util.deserialize_model(dikt, cls) + + @property + def operational_state(self) -> TapiCommonOperationalState: + """Gets the operational_state of this TapiCommonAdminStatePac. + + + :return: The operational_state of this TapiCommonAdminStatePac. + :rtype: TapiCommonOperationalState + """ + return self._operational_state + + @operational_state.setter + def operational_state(self, operational_state: TapiCommonOperationalState): + """Sets the operational_state of this TapiCommonAdminStatePac. + + + :param operational_state: The operational_state of this TapiCommonAdminStatePac. + :type operational_state: TapiCommonOperationalState + """ + + self._operational_state = operational_state + + @property + def lifecycle_state(self) -> TapiCommonLifecycleState: + """Gets the lifecycle_state of this TapiCommonAdminStatePac. + + + :return: The lifecycle_state of this TapiCommonAdminStatePac. + :rtype: TapiCommonLifecycleState + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state: TapiCommonLifecycleState): + """Sets the lifecycle_state of this TapiCommonAdminStatePac. + + + :param lifecycle_state: The lifecycle_state of this TapiCommonAdminStatePac. + :type lifecycle_state: TapiCommonLifecycleState + """ + + self._lifecycle_state = lifecycle_state + + @property + def administrative_state(self) -> TapiCommonAdministrativeState: + """Gets the administrative_state of this TapiCommonAdminStatePac. + + + :return: The administrative_state of this TapiCommonAdminStatePac. + :rtype: TapiCommonAdministrativeState + """ + return self._administrative_state + + @administrative_state.setter + def administrative_state(self, administrative_state: TapiCommonAdministrativeState): + """Sets the administrative_state of this TapiCommonAdminStatePac. + + + :param administrative_state: The administrative_state of this TapiCommonAdminStatePac. + :type administrative_state: TapiCommonAdministrativeState + """ + + self._administrative_state = administrative_state diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_administrative_state.py b/hackfest/tapi/server/tapi_server/models/tapi_common_administrative_state.py new file mode 100644 index 0000000000000000000000000000000000000000..f49d7d8e1d886866b0d336f58f2ea96d534d68ed --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_administrative_state.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiCommonAdministrativeState(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + LOCKED = "LOCKED" + UNLOCKED = "UNLOCKED" + def __init__(self): # noqa: E501 + """TapiCommonAdministrativeState - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonAdministrativeState': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.AdministrativeState of this TapiCommonAdministrativeState. # noqa: E501 + :rtype: TapiCommonAdministrativeState + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_bandwidth_profile.py b/hackfest/tapi/server/tapi_server/models/tapi_common_bandwidth_profile.py new file mode 100644 index 0000000000000000000000000000000000000000..7be05a67dc09ec117179de6a66cc3cbec315c20b --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_bandwidth_profile.py @@ -0,0 +1,224 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_bandwidth_profile_type import TapiCommonBandwidthProfileType # noqa: F401,E501 +from tapi_server.models.tapi_common_capacity_value import TapiCommonCapacityValue # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonBandwidthProfile(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, committed_information_rate: TapiCommonCapacityValue=None, coupling_flag: bool=False, bw_profile_type: TapiCommonBandwidthProfileType=None, peak_information_rate: TapiCommonCapacityValue=None, committed_burst_size: TapiCommonCapacityValue=None, peak_burst_size: TapiCommonCapacityValue=None, color_aware: bool=False): # noqa: E501 + """TapiCommonBandwidthProfile - a model defined in Swagger + + :param committed_information_rate: The committed_information_rate of this TapiCommonBandwidthProfile. # noqa: E501 + :type committed_information_rate: TapiCommonCapacityValue + :param coupling_flag: The coupling_flag of this TapiCommonBandwidthProfile. # noqa: E501 + :type coupling_flag: bool + :param bw_profile_type: The bw_profile_type of this TapiCommonBandwidthProfile. # noqa: E501 + :type bw_profile_type: TapiCommonBandwidthProfileType + :param peak_information_rate: The peak_information_rate of this TapiCommonBandwidthProfile. # noqa: E501 + :type peak_information_rate: TapiCommonCapacityValue + :param committed_burst_size: The committed_burst_size of this TapiCommonBandwidthProfile. # noqa: E501 + :type committed_burst_size: TapiCommonCapacityValue + :param peak_burst_size: The peak_burst_size of this TapiCommonBandwidthProfile. # noqa: E501 + :type peak_burst_size: TapiCommonCapacityValue + :param color_aware: The color_aware of this TapiCommonBandwidthProfile. # noqa: E501 + :type color_aware: bool + """ + self.swagger_types = { + 'committed_information_rate': TapiCommonCapacityValue, + 'coupling_flag': bool, + 'bw_profile_type': TapiCommonBandwidthProfileType, + 'peak_information_rate': TapiCommonCapacityValue, + 'committed_burst_size': TapiCommonCapacityValue, + 'peak_burst_size': TapiCommonCapacityValue, + 'color_aware': bool + } + + self.attribute_map = { + 'committed_information_rate': 'committed-information-rate', + 'coupling_flag': 'coupling-flag', + 'bw_profile_type': 'bw-profile-type', + 'peak_information_rate': 'peak-information-rate', + 'committed_burst_size': 'committed-burst-size', + 'peak_burst_size': 'peak-burst-size', + 'color_aware': 'color-aware' + } + self._committed_information_rate = committed_information_rate + self._coupling_flag = coupling_flag + self._bw_profile_type = bw_profile_type + self._peak_information_rate = peak_information_rate + self._committed_burst_size = committed_burst_size + self._peak_burst_size = peak_burst_size + self._color_aware = color_aware + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonBandwidthProfile': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.BandwidthProfile of this TapiCommonBandwidthProfile. # noqa: E501 + :rtype: TapiCommonBandwidthProfile + """ + return util.deserialize_model(dikt, cls) + + @property + def committed_information_rate(self) -> TapiCommonCapacityValue: + """Gets the committed_information_rate of this TapiCommonBandwidthProfile. + + + :return: The committed_information_rate of this TapiCommonBandwidthProfile. + :rtype: TapiCommonCapacityValue + """ + return self._committed_information_rate + + @committed_information_rate.setter + def committed_information_rate(self, committed_information_rate: TapiCommonCapacityValue): + """Sets the committed_information_rate of this TapiCommonBandwidthProfile. + + + :param committed_information_rate: The committed_information_rate of this TapiCommonBandwidthProfile. + :type committed_information_rate: TapiCommonCapacityValue + """ + + self._committed_information_rate = committed_information_rate + + @property + def coupling_flag(self) -> bool: + """Gets the coupling_flag of this TapiCommonBandwidthProfile. + + none # noqa: E501 + + :return: The coupling_flag of this TapiCommonBandwidthProfile. + :rtype: bool + """ + return self._coupling_flag + + @coupling_flag.setter + def coupling_flag(self, coupling_flag: bool): + """Sets the coupling_flag of this TapiCommonBandwidthProfile. + + none # noqa: E501 + + :param coupling_flag: The coupling_flag of this TapiCommonBandwidthProfile. + :type coupling_flag: bool + """ + + self._coupling_flag = coupling_flag + + @property + def bw_profile_type(self) -> TapiCommonBandwidthProfileType: + """Gets the bw_profile_type of this TapiCommonBandwidthProfile. + + + :return: The bw_profile_type of this TapiCommonBandwidthProfile. + :rtype: TapiCommonBandwidthProfileType + """ + return self._bw_profile_type + + @bw_profile_type.setter + def bw_profile_type(self, bw_profile_type: TapiCommonBandwidthProfileType): + """Sets the bw_profile_type of this TapiCommonBandwidthProfile. + + + :param bw_profile_type: The bw_profile_type of this TapiCommonBandwidthProfile. + :type bw_profile_type: TapiCommonBandwidthProfileType + """ + + self._bw_profile_type = bw_profile_type + + @property + def peak_information_rate(self) -> TapiCommonCapacityValue: + """Gets the peak_information_rate of this TapiCommonBandwidthProfile. + + + :return: The peak_information_rate of this TapiCommonBandwidthProfile. + :rtype: TapiCommonCapacityValue + """ + return self._peak_information_rate + + @peak_information_rate.setter + def peak_information_rate(self, peak_information_rate: TapiCommonCapacityValue): + """Sets the peak_information_rate of this TapiCommonBandwidthProfile. + + + :param peak_information_rate: The peak_information_rate of this TapiCommonBandwidthProfile. + :type peak_information_rate: TapiCommonCapacityValue + """ + + self._peak_information_rate = peak_information_rate + + @property + def committed_burst_size(self) -> TapiCommonCapacityValue: + """Gets the committed_burst_size of this TapiCommonBandwidthProfile. + + + :return: The committed_burst_size of this TapiCommonBandwidthProfile. + :rtype: TapiCommonCapacityValue + """ + return self._committed_burst_size + + @committed_burst_size.setter + def committed_burst_size(self, committed_burst_size: TapiCommonCapacityValue): + """Sets the committed_burst_size of this TapiCommonBandwidthProfile. + + + :param committed_burst_size: The committed_burst_size of this TapiCommonBandwidthProfile. + :type committed_burst_size: TapiCommonCapacityValue + """ + + self._committed_burst_size = committed_burst_size + + @property + def peak_burst_size(self) -> TapiCommonCapacityValue: + """Gets the peak_burst_size of this TapiCommonBandwidthProfile. + + + :return: The peak_burst_size of this TapiCommonBandwidthProfile. + :rtype: TapiCommonCapacityValue + """ + return self._peak_burst_size + + @peak_burst_size.setter + def peak_burst_size(self, peak_burst_size: TapiCommonCapacityValue): + """Sets the peak_burst_size of this TapiCommonBandwidthProfile. + + + :param peak_burst_size: The peak_burst_size of this TapiCommonBandwidthProfile. + :type peak_burst_size: TapiCommonCapacityValue + """ + + self._peak_burst_size = peak_burst_size + + @property + def color_aware(self) -> bool: + """Gets the color_aware of this TapiCommonBandwidthProfile. + + none # noqa: E501 + + :return: The color_aware of this TapiCommonBandwidthProfile. + :rtype: bool + """ + return self._color_aware + + @color_aware.setter + def color_aware(self, color_aware: bool): + """Sets the color_aware of this TapiCommonBandwidthProfile. + + none # noqa: E501 + + :param color_aware: The color_aware of this TapiCommonBandwidthProfile. + :type color_aware: bool + """ + + self._color_aware = color_aware diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_bandwidth_profile_type.py b/hackfest/tapi/server/tapi_server/models/tapi_common_bandwidth_profile_type.py new file mode 100644 index 0000000000000000000000000000000000000000..fb1de346e30a4217e99f442b8c56c35b752e406d --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_bandwidth_profile_type.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiCommonBandwidthProfileType(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + MEF_10_X = "MEF_10.x" + RFC_2697 = "RFC_2697" + RFC_2698 = "RFC_2698" + RFC_4115 = "RFC_4115" + def __init__(self): # noqa: E501 + """TapiCommonBandwidthProfileType - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonBandwidthProfileType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.BandwidthProfileType of this TapiCommonBandwidthProfileType. # noqa: E501 + :rtype: TapiCommonBandwidthProfileType + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_bandwidth_profile_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_common_bandwidth_profile_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..7404280b0aaaa97f8276a41d4015c54e54f3dde8 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_bandwidth_profile_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_bandwidth_profile import TapiCommonBandwidthProfile # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonBandwidthProfileWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, bandwidth_profile: TapiCommonBandwidthProfile=None): # noqa: E501 + """TapiCommonBandwidthProfileWrapper - a model defined in Swagger + + :param bandwidth_profile: The bandwidth_profile of this TapiCommonBandwidthProfileWrapper. # noqa: E501 + :type bandwidth_profile: TapiCommonBandwidthProfile + """ + self.swagger_types = { + 'bandwidth_profile': TapiCommonBandwidthProfile + } + + self.attribute_map = { + 'bandwidth_profile': 'bandwidth-profile' + } + self._bandwidth_profile = bandwidth_profile + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonBandwidthProfileWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.BandwidthProfileWrapper of this TapiCommonBandwidthProfileWrapper. # noqa: E501 + :rtype: TapiCommonBandwidthProfileWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def bandwidth_profile(self) -> TapiCommonBandwidthProfile: + """Gets the bandwidth_profile of this TapiCommonBandwidthProfileWrapper. + + + :return: The bandwidth_profile of this TapiCommonBandwidthProfileWrapper. + :rtype: TapiCommonBandwidthProfile + """ + return self._bandwidth_profile + + @bandwidth_profile.setter + def bandwidth_profile(self, bandwidth_profile: TapiCommonBandwidthProfile): + """Sets the bandwidth_profile of this TapiCommonBandwidthProfileWrapper. + + + :param bandwidth_profile: The bandwidth_profile of this TapiCommonBandwidthProfileWrapper. + :type bandwidth_profile: TapiCommonBandwidthProfile + """ + + self._bandwidth_profile = bandwidth_profile diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_capacity.py b/hackfest/tapi/server/tapi_server/models/tapi_common_capacity.py new file mode 100644 index 0000000000000000000000000000000000000000..9738d256fda1a0c4b69fbae71dd6e541f9d27df7 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_capacity.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_bandwidth_profile import TapiCommonBandwidthProfile # noqa: F401,E501 +from tapi_server.models.tapi_common_capacity_value import TapiCommonCapacityValue # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonCapacity(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, bandwidth_profile: TapiCommonBandwidthProfile=None, total_size: TapiCommonCapacityValue=None): # noqa: E501 + """TapiCommonCapacity - a model defined in Swagger + + :param bandwidth_profile: The bandwidth_profile of this TapiCommonCapacity. # noqa: E501 + :type bandwidth_profile: TapiCommonBandwidthProfile + :param total_size: The total_size of this TapiCommonCapacity. # noqa: E501 + :type total_size: TapiCommonCapacityValue + """ + self.swagger_types = { + 'bandwidth_profile': TapiCommonBandwidthProfile, + 'total_size': TapiCommonCapacityValue + } + + self.attribute_map = { + 'bandwidth_profile': 'bandwidth-profile', + 'total_size': 'total-size' + } + self._bandwidth_profile = bandwidth_profile + self._total_size = total_size + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonCapacity': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.Capacity of this TapiCommonCapacity. # noqa: E501 + :rtype: TapiCommonCapacity + """ + return util.deserialize_model(dikt, cls) + + @property + def bandwidth_profile(self) -> TapiCommonBandwidthProfile: + """Gets the bandwidth_profile of this TapiCommonCapacity. + + + :return: The bandwidth_profile of this TapiCommonCapacity. + :rtype: TapiCommonBandwidthProfile + """ + return self._bandwidth_profile + + @bandwidth_profile.setter + def bandwidth_profile(self, bandwidth_profile: TapiCommonBandwidthProfile): + """Sets the bandwidth_profile of this TapiCommonCapacity. + + + :param bandwidth_profile: The bandwidth_profile of this TapiCommonCapacity. + :type bandwidth_profile: TapiCommonBandwidthProfile + """ + + self._bandwidth_profile = bandwidth_profile + + @property + def total_size(self) -> TapiCommonCapacityValue: + """Gets the total_size of this TapiCommonCapacity. + + + :return: The total_size of this TapiCommonCapacity. + :rtype: TapiCommonCapacityValue + """ + return self._total_size + + @total_size.setter + def total_size(self, total_size: TapiCommonCapacityValue): + """Sets the total_size of this TapiCommonCapacity. + + + :param total_size: The total_size of this TapiCommonCapacity. + :type total_size: TapiCommonCapacityValue + """ + + self._total_size = total_size diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_capacity_pac.py b/hackfest/tapi/server/tapi_server/models/tapi_common_capacity_pac.py new file mode 100644 index 0000000000000000000000000000000000000000..148735e381b2904cb7b2c462e879359db9b98695 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_capacity_pac.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_capacity import TapiCommonCapacity # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonCapacityPac(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, available_capacity: TapiCommonCapacity=None, total_potential_capacity: TapiCommonCapacity=None): # noqa: E501 + """TapiCommonCapacityPac - a model defined in Swagger + + :param available_capacity: The available_capacity of this TapiCommonCapacityPac. # noqa: E501 + :type available_capacity: TapiCommonCapacity + :param total_potential_capacity: The total_potential_capacity of this TapiCommonCapacityPac. # noqa: E501 + :type total_potential_capacity: TapiCommonCapacity + """ + self.swagger_types = { + 'available_capacity': TapiCommonCapacity, + 'total_potential_capacity': TapiCommonCapacity + } + + self.attribute_map = { + 'available_capacity': 'available-capacity', + 'total_potential_capacity': 'total-potential-capacity' + } + self._available_capacity = available_capacity + self._total_potential_capacity = total_potential_capacity + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonCapacityPac': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.CapacityPac of this TapiCommonCapacityPac. # noqa: E501 + :rtype: TapiCommonCapacityPac + """ + return util.deserialize_model(dikt, cls) + + @property + def available_capacity(self) -> TapiCommonCapacity: + """Gets the available_capacity of this TapiCommonCapacityPac. + + + :return: The available_capacity of this TapiCommonCapacityPac. + :rtype: TapiCommonCapacity + """ + return self._available_capacity + + @available_capacity.setter + def available_capacity(self, available_capacity: TapiCommonCapacity): + """Sets the available_capacity of this TapiCommonCapacityPac. + + + :param available_capacity: The available_capacity of this TapiCommonCapacityPac. + :type available_capacity: TapiCommonCapacity + """ + + self._available_capacity = available_capacity + + @property + def total_potential_capacity(self) -> TapiCommonCapacity: + """Gets the total_potential_capacity of this TapiCommonCapacityPac. + + + :return: The total_potential_capacity of this TapiCommonCapacityPac. + :rtype: TapiCommonCapacity + """ + return self._total_potential_capacity + + @total_potential_capacity.setter + def total_potential_capacity(self, total_potential_capacity: TapiCommonCapacity): + """Sets the total_potential_capacity of this TapiCommonCapacityPac. + + + :param total_potential_capacity: The total_potential_capacity of this TapiCommonCapacityPac. + :type total_potential_capacity: TapiCommonCapacity + """ + + self._total_potential_capacity = total_potential_capacity diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_capacity_unit.py b/hackfest/tapi/server/tapi_server/models/tapi_common_capacity_unit.py new file mode 100644 index 0000000000000000000000000000000000000000..9a2a33f1b961839473928153c108b384465eaf0a --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_capacity_unit.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiCommonCapacityUnit(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + TB = "TB" + TBPS = "TBPS" + GB = "GB" + GBPS = "GBPS" + MB = "MB" + MBPS = "MBPS" + KB = "KB" + KBPS = "KBPS" + GHZ = "GHz" + MHZ = "MHz" + def __init__(self): # noqa: E501 + """TapiCommonCapacityUnit - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonCapacityUnit': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.CapacityUnit of this TapiCommonCapacityUnit. # noqa: E501 + :rtype: TapiCommonCapacityUnit + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_capacity_value.py b/hackfest/tapi/server/tapi_server/models/tapi_common_capacity_value.py new file mode 100644 index 0000000000000000000000000000000000000000..adc65eff8d91b4af6947842612de6c418ee07098 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_capacity_value.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_capacity_unit import TapiCommonCapacityUnit # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonCapacityValue(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, value: int=None, unit: TapiCommonCapacityUnit=None): # noqa: E501 + """TapiCommonCapacityValue - a model defined in Swagger + + :param value: The value of this TapiCommonCapacityValue. # noqa: E501 + :type value: int + :param unit: The unit of this TapiCommonCapacityValue. # noqa: E501 + :type unit: TapiCommonCapacityUnit + """ + self.swagger_types = { + 'value': int, + 'unit': TapiCommonCapacityUnit + } + + self.attribute_map = { + 'value': 'value', + 'unit': 'unit' + } + self._value = value + self._unit = unit + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonCapacityValue': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.CapacityValue of this TapiCommonCapacityValue. # noqa: E501 + :rtype: TapiCommonCapacityValue + """ + return util.deserialize_model(dikt, cls) + + @property + def value(self) -> int: + """Gets the value of this TapiCommonCapacityValue. + + none # noqa: E501 + + :return: The value of this TapiCommonCapacityValue. + :rtype: int + """ + return self._value + + @value.setter + def value(self, value: int): + """Sets the value of this TapiCommonCapacityValue. + + none # noqa: E501 + + :param value: The value of this TapiCommonCapacityValue. + :type value: int + """ + + self._value = value + + @property + def unit(self) -> TapiCommonCapacityUnit: + """Gets the unit of this TapiCommonCapacityValue. + + + :return: The unit of this TapiCommonCapacityValue. + :rtype: TapiCommonCapacityUnit + """ + return self._unit + + @unit.setter + def unit(self, unit: TapiCommonCapacityUnit): + """Sets the unit of this TapiCommonCapacityValue. + + + :param unit: The unit of this TapiCommonCapacityValue. + :type unit: TapiCommonCapacityUnit + """ + + self._unit = unit diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_capacity_value_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_common_capacity_value_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..fc7007f031a6c4714a406f5ce058e91ea529bdd1 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_capacity_value_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_capacity_value import TapiCommonCapacityValue # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonCapacityValueWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, committed_burst_size: TapiCommonCapacityValue=None): # noqa: E501 + """TapiCommonCapacityValueWrapper - a model defined in Swagger + + :param committed_burst_size: The committed_burst_size of this TapiCommonCapacityValueWrapper. # noqa: E501 + :type committed_burst_size: TapiCommonCapacityValue + """ + self.swagger_types = { + 'committed_burst_size': TapiCommonCapacityValue + } + + self.attribute_map = { + 'committed_burst_size': 'committed-burst-size' + } + self._committed_burst_size = committed_burst_size + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonCapacityValueWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.CapacityValueWrapper of this TapiCommonCapacityValueWrapper. # noqa: E501 + :rtype: TapiCommonCapacityValueWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def committed_burst_size(self) -> TapiCommonCapacityValue: + """Gets the committed_burst_size of this TapiCommonCapacityValueWrapper. + + + :return: The committed_burst_size of this TapiCommonCapacityValueWrapper. + :rtype: TapiCommonCapacityValue + """ + return self._committed_burst_size + + @committed_burst_size.setter + def committed_burst_size(self, committed_burst_size: TapiCommonCapacityValue): + """Sets the committed_burst_size of this TapiCommonCapacityValueWrapper. + + + :param committed_burst_size: The committed_burst_size of this TapiCommonCapacityValueWrapper. + :type committed_burst_size: TapiCommonCapacityValue + """ + + self._committed_burst_size = committed_burst_size diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_capacity_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_common_capacity_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..dcb62680e3845e494d7e8ca5b0bdd84cdd478554 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_capacity_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_capacity import TapiCommonCapacity # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonCapacityWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, available_capacity: TapiCommonCapacity=None): # noqa: E501 + """TapiCommonCapacityWrapper - a model defined in Swagger + + :param available_capacity: The available_capacity of this TapiCommonCapacityWrapper. # noqa: E501 + :type available_capacity: TapiCommonCapacity + """ + self.swagger_types = { + 'available_capacity': TapiCommonCapacity + } + + self.attribute_map = { + 'available_capacity': 'available-capacity' + } + self._available_capacity = available_capacity + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonCapacityWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.CapacityWrapper of this TapiCommonCapacityWrapper. # noqa: E501 + :rtype: TapiCommonCapacityWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def available_capacity(self) -> TapiCommonCapacity: + """Gets the available_capacity of this TapiCommonCapacityWrapper. + + + :return: The available_capacity of this TapiCommonCapacityWrapper. + :rtype: TapiCommonCapacity + """ + return self._available_capacity + + @available_capacity.setter + def available_capacity(self, available_capacity: TapiCommonCapacity): + """Sets the available_capacity of this TapiCommonCapacityWrapper. + + + :param available_capacity: The available_capacity of this TapiCommonCapacityWrapper. + :type available_capacity: TapiCommonCapacity + """ + + self._available_capacity = available_capacity diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_context.py b/hackfest/tapi/server/tapi_server/models/tapi_common_context.py new file mode 100644 index 0000000000000000000000000000000000000000..8d3c849c56762693d7d0691b2a877e549cea695c --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_context.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_service_interface_point import TapiCommonServiceInterfacePoint # noqa: F401,E501 +from tapi_server.models.tapi_common_tapi_context import TapiCommonTapiContext # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_connectivity_context import TapiConnectivityConnectivityContext # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_context_augmentation3 import TapiConnectivityContextAugmentation3 # noqa: F401,E501 +from tapi_server.models.tapi_notification_context_augmentation1 import TapiNotificationContextAugmentation1 # noqa: F401,E501 +from tapi_server.models.tapi_notification_notification_context import TapiNotificationNotificationContext # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_context_augmentation2 import TapiPathComputationContextAugmentation2 # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_path_computation_context import TapiPathComputationPathComputationContext # noqa: F401,E501 +from tapi_server.models.tapi_topology_context_augmentation4 import TapiTopologyContextAugmentation4 # noqa: F401,E501 +from tapi_server.models.tapi_topology_topology_context import TapiTopologyTopologyContext # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonContext(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, connectivity_context: TapiConnectivityConnectivityContext=None, notification_context: TapiNotificationNotificationContext=None, path_computation_context: TapiPathComputationPathComputationContext=None, topology_context: TapiTopologyTopologyContext=None, service_interface_point: List[TapiCommonServiceInterfacePoint]=None): # noqa: E501 + """TapiCommonContext - a model defined in Swagger + + :param connectivity_context: The connectivity_context of this TapiCommonContext. # noqa: E501 + :type connectivity_context: TapiConnectivityConnectivityContext + :param notification_context: The notification_context of this TapiCommonContext. # noqa: E501 + :type notification_context: TapiNotificationNotificationContext + :param path_computation_context: The path_computation_context of this TapiCommonContext. # noqa: E501 + :type path_computation_context: TapiPathComputationPathComputationContext + :param topology_context: The topology_context of this TapiCommonContext. # noqa: E501 + :type topology_context: TapiTopologyTopologyContext + :param service_interface_point: The service_interface_point of this TapiCommonContext. # noqa: E501 + :type service_interface_point: List[TapiCommonServiceInterfacePoint] + """ + self.swagger_types = { + 'connectivity_context': TapiConnectivityConnectivityContext, + 'notification_context': TapiNotificationNotificationContext, + 'path_computation_context': TapiPathComputationPathComputationContext, + 'topology_context': TapiTopologyTopologyContext, + 'service_interface_point': List[TapiCommonServiceInterfacePoint] + } + + self.attribute_map = { + 'connectivity_context': 'connectivity-context', + 'notification_context': 'notification-context', + 'path_computation_context': 'path-computation-context', + 'topology_context': 'topology-context', + 'service_interface_point': 'service-interface-point' + } + self._connectivity_context = connectivity_context + self._notification_context = notification_context + self._path_computation_context = path_computation_context + self._topology_context = topology_context + self._service_interface_point = service_interface_point + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonContext': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.Context of this TapiCommonContext. # noqa: E501 + :rtype: TapiCommonContext + """ + return util.deserialize_model(dikt, cls) + + @property + def connectivity_context(self) -> TapiConnectivityConnectivityContext: + """Gets the connectivity_context of this TapiCommonContext. + + + :return: The connectivity_context of this TapiCommonContext. + :rtype: TapiConnectivityConnectivityContext + """ + return self._connectivity_context + + @connectivity_context.setter + def connectivity_context(self, connectivity_context: TapiConnectivityConnectivityContext): + """Sets the connectivity_context of this TapiCommonContext. + + + :param connectivity_context: The connectivity_context of this TapiCommonContext. + :type connectivity_context: TapiConnectivityConnectivityContext + """ + + self._connectivity_context = connectivity_context + + @property + def notification_context(self) -> TapiNotificationNotificationContext: + """Gets the notification_context of this TapiCommonContext. + + + :return: The notification_context of this TapiCommonContext. + :rtype: TapiNotificationNotificationContext + """ + return self._notification_context + + @notification_context.setter + def notification_context(self, notification_context: TapiNotificationNotificationContext): + """Sets the notification_context of this TapiCommonContext. + + + :param notification_context: The notification_context of this TapiCommonContext. + :type notification_context: TapiNotificationNotificationContext + """ + + self._notification_context = notification_context + + @property + def path_computation_context(self) -> TapiPathComputationPathComputationContext: + """Gets the path_computation_context of this TapiCommonContext. + + + :return: The path_computation_context of this TapiCommonContext. + :rtype: TapiPathComputationPathComputationContext + """ + return self._path_computation_context + + @path_computation_context.setter + def path_computation_context(self, path_computation_context: TapiPathComputationPathComputationContext): + """Sets the path_computation_context of this TapiCommonContext. + + + :param path_computation_context: The path_computation_context of this TapiCommonContext. + :type path_computation_context: TapiPathComputationPathComputationContext + """ + + self._path_computation_context = path_computation_context + + @property + def topology_context(self) -> TapiTopologyTopologyContext: + """Gets the topology_context of this TapiCommonContext. + + + :return: The topology_context of this TapiCommonContext. + :rtype: TapiTopologyTopologyContext + """ + return self._topology_context + + @topology_context.setter + def topology_context(self, topology_context: TapiTopologyTopologyContext): + """Sets the topology_context of this TapiCommonContext. + + + :param topology_context: The topology_context of this TapiCommonContext. + :type topology_context: TapiTopologyTopologyContext + """ + + self._topology_context = topology_context + + @property + def service_interface_point(self) -> List[TapiCommonServiceInterfacePoint]: + """Gets the service_interface_point of this TapiCommonContext. + + none # noqa: E501 + + :return: The service_interface_point of this TapiCommonContext. + :rtype: List[TapiCommonServiceInterfacePoint] + """ + return self._service_interface_point + + @service_interface_point.setter + def service_interface_point(self, service_interface_point: List[TapiCommonServiceInterfacePoint]): + """Sets the service_interface_point of this TapiCommonContext. + + none # noqa: E501 + + :param service_interface_point: The service_interface_point of this TapiCommonContext. + :type service_interface_point: List[TapiCommonServiceInterfacePoint] + """ + + self._service_interface_point = service_interface_point diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_context_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_common_context_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..d8b98d3e92693c5febe3055cd721441ab2fc6502 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_context_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_context import TapiCommonContext # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonContextWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, tapi_commoncontext: TapiCommonContext=None): # noqa: E501 + """TapiCommonContextWrapper - a model defined in Swagger + + :param tapi_commoncontext: The tapi_commoncontext of this TapiCommonContextWrapper. # noqa: E501 + :type tapi_commoncontext: TapiCommonContext + """ + self.swagger_types = { + 'tapi_commoncontext': TapiCommonContext + } + + self.attribute_map = { + 'tapi_commoncontext': 'tapi-common:context' + } + self._tapi_commoncontext = tapi_commoncontext + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonContextWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.ContextWrapper of this TapiCommonContextWrapper. # noqa: E501 + :rtype: TapiCommonContextWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def tapi_commoncontext(self) -> TapiCommonContext: + """Gets the tapi_commoncontext of this TapiCommonContextWrapper. + + + :return: The tapi_commoncontext of this TapiCommonContextWrapper. + :rtype: TapiCommonContext + """ + return self._tapi_commoncontext + + @tapi_commoncontext.setter + def tapi_commoncontext(self, tapi_commoncontext: TapiCommonContext): + """Sets the tapi_commoncontext of this TapiCommonContextWrapper. + + + :param tapi_commoncontext: The tapi_commoncontext of this TapiCommonContextWrapper. + :type tapi_commoncontext: TapiCommonContext + """ + + self._tapi_commoncontext = tapi_commoncontext diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_directive_value.py b/hackfest/tapi/server/tapi_server/models/tapi_common_directive_value.py new file mode 100644 index 0000000000000000000000000000000000000000..66d4360cb64df3b8c3deb28b6ddb9a15a47df20c --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_directive_value.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiCommonDirectiveValue(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + MINIMIZE = "MINIMIZE" + MAXIMIZE = "MAXIMIZE" + ALLOW = "ALLOW" + DISALLOW = "DISALLOW" + DONT_CARE = "DONT_CARE" + def __init__(self): # noqa: E501 + """TapiCommonDirectiveValue - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonDirectiveValue': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.DirectiveValue of this TapiCommonDirectiveValue. # noqa: E501 + :rtype: TapiCommonDirectiveValue + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_forwarding_direction.py b/hackfest/tapi/server/tapi_server/models/tapi_common_forwarding_direction.py new file mode 100644 index 0000000000000000000000000000000000000000..732f5c8cb1f33aa259f0f27807fd67655067a9fa --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_forwarding_direction.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiCommonForwardingDirection(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + BIDIRECTIONAL = "BIDIRECTIONAL" + UNIDIRECTIONAL = "UNIDIRECTIONAL" + UNDEFINED_OR_UNKNOWN = "UNDEFINED_OR_UNKNOWN" + def __init__(self): # noqa: E501 + """TapiCommonForwardingDirection - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonForwardingDirection': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.ForwardingDirection of this TapiCommonForwardingDirection. # noqa: E501 + :rtype: TapiCommonForwardingDirection + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_get_service_interface_point_details.py b/hackfest/tapi/server/tapi_server/models/tapi_common_get_service_interface_point_details.py new file mode 100644 index 0000000000000000000000000000000000000000..7ea77a174df105083f8f49a9651616177b140802 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_get_service_interface_point_details.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_getserviceinterfacepointdetails_output import TapiCommonGetserviceinterfacepointdetailsOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonGetServiceInterfacePointDetails(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiCommonGetserviceinterfacepointdetailsOutput=None): # noqa: E501 + """TapiCommonGetServiceInterfacePointDetails - a model defined in Swagger + + :param output: The output of this TapiCommonGetServiceInterfacePointDetails. # noqa: E501 + :type output: TapiCommonGetserviceinterfacepointdetailsOutput + """ + self.swagger_types = { + 'output': TapiCommonGetserviceinterfacepointdetailsOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonGetServiceInterfacePointDetails': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.GetServiceInterfacePointDetails of this TapiCommonGetServiceInterfacePointDetails. # noqa: E501 + :rtype: TapiCommonGetServiceInterfacePointDetails + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiCommonGetserviceinterfacepointdetailsOutput: + """Gets the output of this TapiCommonGetServiceInterfacePointDetails. + + + :return: The output of this TapiCommonGetServiceInterfacePointDetails. + :rtype: TapiCommonGetserviceinterfacepointdetailsOutput + """ + return self._output + + @output.setter + def output(self, output: TapiCommonGetserviceinterfacepointdetailsOutput): + """Sets the output of this TapiCommonGetServiceInterfacePointDetails. + + + :param output: The output of this TapiCommonGetServiceInterfacePointDetails. + :type output: TapiCommonGetserviceinterfacepointdetailsOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_get_service_interface_point_list.py b/hackfest/tapi/server/tapi_server/models/tapi_common_get_service_interface_point_list.py new file mode 100644 index 0000000000000000000000000000000000000000..932a146708384e6bc217dbafdb98e935c23f2985 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_get_service_interface_point_list.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_getserviceinterfacepointlist_output import TapiCommonGetserviceinterfacepointlistOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonGetServiceInterfacePointList(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiCommonGetserviceinterfacepointlistOutput=None): # noqa: E501 + """TapiCommonGetServiceInterfacePointList - a model defined in Swagger + + :param output: The output of this TapiCommonGetServiceInterfacePointList. # noqa: E501 + :type output: TapiCommonGetserviceinterfacepointlistOutput + """ + self.swagger_types = { + 'output': TapiCommonGetserviceinterfacepointlistOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonGetServiceInterfacePointList': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.GetServiceInterfacePointList of this TapiCommonGetServiceInterfacePointList. # noqa: E501 + :rtype: TapiCommonGetServiceInterfacePointList + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiCommonGetserviceinterfacepointlistOutput: + """Gets the output of this TapiCommonGetServiceInterfacePointList. + + + :return: The output of this TapiCommonGetServiceInterfacePointList. + :rtype: TapiCommonGetserviceinterfacepointlistOutput + """ + return self._output + + @output.setter + def output(self, output: TapiCommonGetserviceinterfacepointlistOutput): + """Sets the output of this TapiCommonGetServiceInterfacePointList. + + + :param output: The output of this TapiCommonGetServiceInterfacePointList. + :type output: TapiCommonGetserviceinterfacepointlistOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_getserviceinterfacepointdetails_input.py b/hackfest/tapi/server/tapi_server/models/tapi_common_getserviceinterfacepointdetails_input.py new file mode 100644 index 0000000000000000000000000000000000000000..771db02acfbe711ef8bc7a325009c076e9e16e6f --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_getserviceinterfacepointdetails_input.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiCommonGetserviceinterfacepointdetailsInput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, sip_id_or_name: str=None): # noqa: E501 + """TapiCommonGetserviceinterfacepointdetailsInput - a model defined in Swagger + + :param sip_id_or_name: The sip_id_or_name of this TapiCommonGetserviceinterfacepointdetailsInput. # noqa: E501 + :type sip_id_or_name: str + """ + self.swagger_types = { + 'sip_id_or_name': str + } + + self.attribute_map = { + 'sip_id_or_name': 'sip-id-or-name' + } + self._sip_id_or_name = sip_id_or_name + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonGetserviceinterfacepointdetailsInput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.getserviceinterfacepointdetails.Input of this TapiCommonGetserviceinterfacepointdetailsInput. # noqa: E501 + :rtype: TapiCommonGetserviceinterfacepointdetailsInput + """ + return util.deserialize_model(dikt, cls) + + @property + def sip_id_or_name(self) -> str: + """Gets the sip_id_or_name of this TapiCommonGetserviceinterfacepointdetailsInput. + + none # noqa: E501 + + :return: The sip_id_or_name of this TapiCommonGetserviceinterfacepointdetailsInput. + :rtype: str + """ + return self._sip_id_or_name + + @sip_id_or_name.setter + def sip_id_or_name(self, sip_id_or_name: str): + """Sets the sip_id_or_name of this TapiCommonGetserviceinterfacepointdetailsInput. + + none # noqa: E501 + + :param sip_id_or_name: The sip_id_or_name of this TapiCommonGetserviceinterfacepointdetailsInput. + :type sip_id_or_name: str + """ + + self._sip_id_or_name = sip_id_or_name diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_getserviceinterfacepointdetails_output.py b/hackfest/tapi/server/tapi_server/models/tapi_common_getserviceinterfacepointdetails_output.py new file mode 100644 index 0000000000000000000000000000000000000000..6e3ac4e946aec8b75685d27a7710228cbdd57801 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_getserviceinterfacepointdetails_output.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_service_interface_point import TapiCommonServiceInterfacePoint # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonGetserviceinterfacepointdetailsOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, sip: TapiCommonServiceInterfacePoint=None): # noqa: E501 + """TapiCommonGetserviceinterfacepointdetailsOutput - a model defined in Swagger + + :param sip: The sip of this TapiCommonGetserviceinterfacepointdetailsOutput. # noqa: E501 + :type sip: TapiCommonServiceInterfacePoint + """ + self.swagger_types = { + 'sip': TapiCommonServiceInterfacePoint + } + + self.attribute_map = { + 'sip': 'sip' + } + self._sip = sip + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonGetserviceinterfacepointdetailsOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.getserviceinterfacepointdetails.Output of this TapiCommonGetserviceinterfacepointdetailsOutput. # noqa: E501 + :rtype: TapiCommonGetserviceinterfacepointdetailsOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def sip(self) -> TapiCommonServiceInterfacePoint: + """Gets the sip of this TapiCommonGetserviceinterfacepointdetailsOutput. + + + :return: The sip of this TapiCommonGetserviceinterfacepointdetailsOutput. + :rtype: TapiCommonServiceInterfacePoint + """ + return self._sip + + @sip.setter + def sip(self, sip: TapiCommonServiceInterfacePoint): + """Sets the sip of this TapiCommonGetserviceinterfacepointdetailsOutput. + + + :param sip: The sip of this TapiCommonGetserviceinterfacepointdetailsOutput. + :type sip: TapiCommonServiceInterfacePoint + """ + + self._sip = sip diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_getserviceinterfacepointlist_output.py b/hackfest/tapi/server/tapi_server/models/tapi_common_getserviceinterfacepointlist_output.py new file mode 100644 index 0000000000000000000000000000000000000000..4ecf4ee651eb7c04108a98eb36240bbcfab591f0 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_getserviceinterfacepointlist_output.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_service_interface_point import TapiCommonServiceInterfacePoint # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonGetserviceinterfacepointlistOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, sip: List[TapiCommonServiceInterfacePoint]=None): # noqa: E501 + """TapiCommonGetserviceinterfacepointlistOutput - a model defined in Swagger + + :param sip: The sip of this TapiCommonGetserviceinterfacepointlistOutput. # noqa: E501 + :type sip: List[TapiCommonServiceInterfacePoint] + """ + self.swagger_types = { + 'sip': List[TapiCommonServiceInterfacePoint] + } + + self.attribute_map = { + 'sip': 'sip' + } + self._sip = sip + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonGetserviceinterfacepointlistOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.getserviceinterfacepointlist.Output of this TapiCommonGetserviceinterfacepointlistOutput. # noqa: E501 + :rtype: TapiCommonGetserviceinterfacepointlistOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def sip(self) -> List[TapiCommonServiceInterfacePoint]: + """Gets the sip of this TapiCommonGetserviceinterfacepointlistOutput. + + none # noqa: E501 + + :return: The sip of this TapiCommonGetserviceinterfacepointlistOutput. + :rtype: List[TapiCommonServiceInterfacePoint] + """ + return self._sip + + @sip.setter + def sip(self, sip: List[TapiCommonServiceInterfacePoint]): + """Sets the sip of this TapiCommonGetserviceinterfacepointlistOutput. + + none # noqa: E501 + + :param sip: The sip of this TapiCommonGetserviceinterfacepointlistOutput. + :type sip: List[TapiCommonServiceInterfacePoint] + """ + + self._sip = sip diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_global_class.py b/hackfest/tapi/server/tapi_server/models/tapi_common_global_class.py new file mode 100644 index 0000000000000000000000000000000000000000..001206c56f55eadcf3793f895f1c3ff47b32a0a0 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_global_class.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonGlobalClass(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: List[TapiCommonNameAndValue]=None, uuid: str=None): # noqa: E501 + """TapiCommonGlobalClass - a model defined in Swagger + + :param name: The name of this TapiCommonGlobalClass. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param uuid: The uuid of this TapiCommonGlobalClass. # noqa: E501 + :type uuid: str + """ + self.swagger_types = { + 'name': List[TapiCommonNameAndValue], + 'uuid': str + } + + self.attribute_map = { + 'name': 'name', + 'uuid': 'uuid' + } + self._name = name + self._uuid = uuid + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonGlobalClass': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.GlobalClass of this TapiCommonGlobalClass. # noqa: E501 + :rtype: TapiCommonGlobalClass + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiCommonGlobalClass. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiCommonGlobalClass. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiCommonGlobalClass. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiCommonGlobalClass. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def uuid(self) -> str: + """Gets the uuid of this TapiCommonGlobalClass. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :return: The uuid of this TapiCommonGlobalClass. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid: str): + """Sets the uuid of this TapiCommonGlobalClass. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :param uuid: The uuid of this TapiCommonGlobalClass. + :type uuid: str + """ + + self._uuid = uuid diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_layer_protocol_name.py b/hackfest/tapi/server/tapi_server/models/tapi_common_layer_protocol_name.py new file mode 100644 index 0000000000000000000000000000000000000000..81b6030c92f5d0552d8627e56a46c1c8eb0351c2 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_layer_protocol_name.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiCommonLayerProtocolName(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + ODU = "ODU" + ETH = "ETH" + DSR = "DSR" + PHOTONIC_MEDIA = "PHOTONIC_MEDIA" + def __init__(self): # noqa: E501 + """TapiCommonLayerProtocolName - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonLayerProtocolName': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.LayerProtocolName of this TapiCommonLayerProtocolName. # noqa: E501 + :rtype: TapiCommonLayerProtocolName + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_lifecycle_state.py b/hackfest/tapi/server/tapi_server/models/tapi_common_lifecycle_state.py new file mode 100644 index 0000000000000000000000000000000000000000..10943fcb1ce0f07b472d7c7098259099e5651c4e --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_lifecycle_state.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiCommonLifecycleState(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + PLANNED = "PLANNED" + POTENTIAL_AVAILABLE = "POTENTIAL_AVAILABLE" + POTENTIAL_BUSY = "POTENTIAL_BUSY" + INSTALLED = "INSTALLED" + PENDING_REMOVAL = "PENDING_REMOVAL" + def __init__(self): # noqa: E501 + """TapiCommonLifecycleState - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonLifecycleState': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.LifecycleState of this TapiCommonLifecycleState. # noqa: E501 + :rtype: TapiCommonLifecycleState + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_local_class.py b/hackfest/tapi/server/tapi_server/models/tapi_common_local_class.py new file mode 100644 index 0000000000000000000000000000000000000000..19b3124eb6de3220d1c6c4e586891fe760537bd3 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_local_class.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonLocalClass(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: List[TapiCommonNameAndValue]=None, local_id: str=None): # noqa: E501 + """TapiCommonLocalClass - a model defined in Swagger + + :param name: The name of this TapiCommonLocalClass. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param local_id: The local_id of this TapiCommonLocalClass. # noqa: E501 + :type local_id: str + """ + self.swagger_types = { + 'name': List[TapiCommonNameAndValue], + 'local_id': str + } + + self.attribute_map = { + 'name': 'name', + 'local_id': 'local-id' + } + self._name = name + self._local_id = local_id + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonLocalClass': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.LocalClass of this TapiCommonLocalClass. # noqa: E501 + :rtype: TapiCommonLocalClass + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiCommonLocalClass. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiCommonLocalClass. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiCommonLocalClass. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiCommonLocalClass. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def local_id(self) -> str: + """Gets the local_id of this TapiCommonLocalClass. + + none # noqa: E501 + + :return: The local_id of this TapiCommonLocalClass. + :rtype: str + """ + return self._local_id + + @local_id.setter + def local_id(self, local_id: str): + """Sets the local_id of this TapiCommonLocalClass. + + none # noqa: E501 + + :param local_id: The local_id of this TapiCommonLocalClass. + :type local_id: str + """ + + self._local_id = local_id diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_name_and_value.py b/hackfest/tapi/server/tapi_server/models/tapi_common_name_and_value.py new file mode 100644 index 0000000000000000000000000000000000000000..2afdd42e15f201f9345b2bfe74c3a9dd851abeb9 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_name_and_value.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiCommonNameAndValue(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, value_name: str=None, value: str=None): # noqa: E501 + """TapiCommonNameAndValue - a model defined in Swagger + + :param value_name: The value_name of this TapiCommonNameAndValue. # noqa: E501 + :type value_name: str + :param value: The value of this TapiCommonNameAndValue. # noqa: E501 + :type value: str + """ + self.swagger_types = { + 'value_name': str, + 'value': str + } + + self.attribute_map = { + 'value_name': 'value-name', + 'value': 'value' + } + self._value_name = value_name + self._value = value + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonNameAndValue': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.NameAndValue of this TapiCommonNameAndValue. # noqa: E501 + :rtype: TapiCommonNameAndValue + """ + return util.deserialize_model(dikt, cls) + + @property + def value_name(self) -> str: + """Gets the value_name of this TapiCommonNameAndValue. + + The name of the value. The value need not have a name. # noqa: E501 + + :return: The value_name of this TapiCommonNameAndValue. + :rtype: str + """ + return self._value_name + + @value_name.setter + def value_name(self, value_name: str): + """Sets the value_name of this TapiCommonNameAndValue. + + The name of the value. The value need not have a name. # noqa: E501 + + :param value_name: The value_name of this TapiCommonNameAndValue. + :type value_name: str + """ + + self._value_name = value_name + + @property + def value(self) -> str: + """Gets the value of this TapiCommonNameAndValue. + + The value # noqa: E501 + + :return: The value of this TapiCommonNameAndValue. + :rtype: str + """ + return self._value + + @value.setter + def value(self, value: str): + """Sets the value of this TapiCommonNameAndValue. + + The value # noqa: E501 + + :param value: The value of this TapiCommonNameAndValue. + :type value: str + """ + + self._value = value diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_name_and_value_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_common_name_and_value_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..7499e4beb479776717395f648961e4601a8df38f --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_name_and_value_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonNameAndValueWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: TapiCommonNameAndValue=None): # noqa: E501 + """TapiCommonNameAndValueWrapper - a model defined in Swagger + + :param name: The name of this TapiCommonNameAndValueWrapper. # noqa: E501 + :type name: TapiCommonNameAndValue + """ + self.swagger_types = { + 'name': TapiCommonNameAndValue + } + + self.attribute_map = { + 'name': 'name' + } + self._name = name + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonNameAndValueWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.NameAndValueWrapper of this TapiCommonNameAndValueWrapper. # noqa: E501 + :rtype: TapiCommonNameAndValueWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> TapiCommonNameAndValue: + """Gets the name of this TapiCommonNameAndValueWrapper. + + + :return: The name of this TapiCommonNameAndValueWrapper. + :rtype: TapiCommonNameAndValue + """ + return self._name + + @name.setter + def name(self, name: TapiCommonNameAndValue): + """Sets the name of this TapiCommonNameAndValueWrapper. + + + :param name: The name of this TapiCommonNameAndValueWrapper. + :type name: TapiCommonNameAndValue + """ + + self._name = name diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_operational_state.py b/hackfest/tapi/server/tapi_server/models/tapi_common_operational_state.py new file mode 100644 index 0000000000000000000000000000000000000000..5553d96409131e764ccde232fcca50c686609eef --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_operational_state.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiCommonOperationalState(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + DISABLED = "DISABLED" + ENABLED = "ENABLED" + def __init__(self): # noqa: E501 + """TapiCommonOperationalState - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonOperationalState': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.OperationalState of this TapiCommonOperationalState. # noqa: E501 + :rtype: TapiCommonOperationalState + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_operational_state_pac.py b/hackfest/tapi/server/tapi_server/models/tapi_common_operational_state_pac.py new file mode 100644 index 0000000000000000000000000000000000000000..1eb91f23c7d9f59b10f79c7781ccf3a57419c44e --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_operational_state_pac.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_lifecycle_state import TapiCommonLifecycleState # noqa: F401,E501 +from tapi_server.models.tapi_common_operational_state import TapiCommonOperationalState # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonOperationalStatePac(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, operational_state: TapiCommonOperationalState=None, lifecycle_state: TapiCommonLifecycleState=None): # noqa: E501 + """TapiCommonOperationalStatePac - a model defined in Swagger + + :param operational_state: The operational_state of this TapiCommonOperationalStatePac. # noqa: E501 + :type operational_state: TapiCommonOperationalState + :param lifecycle_state: The lifecycle_state of this TapiCommonOperationalStatePac. # noqa: E501 + :type lifecycle_state: TapiCommonLifecycleState + """ + self.swagger_types = { + 'operational_state': TapiCommonOperationalState, + 'lifecycle_state': TapiCommonLifecycleState + } + + self.attribute_map = { + 'operational_state': 'operational-state', + 'lifecycle_state': 'lifecycle-state' + } + self._operational_state = operational_state + self._lifecycle_state = lifecycle_state + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonOperationalStatePac': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.OperationalStatePac of this TapiCommonOperationalStatePac. # noqa: E501 + :rtype: TapiCommonOperationalStatePac + """ + return util.deserialize_model(dikt, cls) + + @property + def operational_state(self) -> TapiCommonOperationalState: + """Gets the operational_state of this TapiCommonOperationalStatePac. + + + :return: The operational_state of this TapiCommonOperationalStatePac. + :rtype: TapiCommonOperationalState + """ + return self._operational_state + + @operational_state.setter + def operational_state(self, operational_state: TapiCommonOperationalState): + """Sets the operational_state of this TapiCommonOperationalStatePac. + + + :param operational_state: The operational_state of this TapiCommonOperationalStatePac. + :type operational_state: TapiCommonOperationalState + """ + + self._operational_state = operational_state + + @property + def lifecycle_state(self) -> TapiCommonLifecycleState: + """Gets the lifecycle_state of this TapiCommonOperationalStatePac. + + + :return: The lifecycle_state of this TapiCommonOperationalStatePac. + :rtype: TapiCommonLifecycleState + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state: TapiCommonLifecycleState): + """Sets the lifecycle_state of this TapiCommonOperationalStatePac. + + + :param lifecycle_state: The lifecycle_state of this TapiCommonOperationalStatePac. + :type lifecycle_state: TapiCommonLifecycleState + """ + + self._lifecycle_state = lifecycle_state diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_port_direction.py b/hackfest/tapi/server/tapi_server/models/tapi_common_port_direction.py new file mode 100644 index 0000000000000000000000000000000000000000..7cd3a818343084e62c7dd16a098fe6dd5f499130 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_port_direction.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiCommonPortDirection(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + BIDIRECTIONAL = "BIDIRECTIONAL" + INPUT = "INPUT" + OUTPUT = "OUTPUT" + UNIDENTIFIED_OR_UNKNOWN = "UNIDENTIFIED_OR_UNKNOWN" + def __init__(self): # noqa: E501 + """TapiCommonPortDirection - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonPortDirection': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.PortDirection of this TapiCommonPortDirection. # noqa: E501 + :rtype: TapiCommonPortDirection + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_port_role.py b/hackfest/tapi/server/tapi_server/models/tapi_common_port_role.py new file mode 100644 index 0000000000000000000000000000000000000000..87de03b783e314711c665bc03612a3b17e61f4cf --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_port_role.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiCommonPortRole(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + SYMMETRIC = "SYMMETRIC" + ROOT = "ROOT" + LEAF = "LEAF" + TRUNK = "TRUNK" + UNKNOWN = "UNKNOWN" + def __init__(self): # noqa: E501 + """TapiCommonPortRole - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonPortRole': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.PortRole of this TapiCommonPortRole. # noqa: E501 + :rtype: TapiCommonPortRole + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_service_interface_point.py b/hackfest/tapi/server/tapi_server/models/tapi_common_service_interface_point.py new file mode 100644 index 0000000000000000000000000000000000000000..cbc788a2cc03cb5a16048cfbb8f8f42c11a786bd --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_service_interface_point.py @@ -0,0 +1,312 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_admin_state_pac import TapiCommonAdminStatePac # noqa: F401,E501 +from tapi_server.models.tapi_common_administrative_state import TapiCommonAdministrativeState # noqa: F401,E501 +from tapi_server.models.tapi_common_capacity import TapiCommonCapacity # noqa: F401,E501 +from tapi_server.models.tapi_common_capacity_pac import TapiCommonCapacityPac # noqa: F401,E501 +from tapi_server.models.tapi_common_global_class import TapiCommonGlobalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501 +from tapi_server.models.tapi_common_lifecycle_state import TapiCommonLifecycleState # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_common_operational_state import TapiCommonOperationalState # noqa: F401,E501 +from tapi_server.models.tapi_common_port_direction import TapiCommonPortDirection # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonServiceInterfacePoint(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, available_capacity: TapiCommonCapacity=None, total_potential_capacity: TapiCommonCapacity=None, name: List[TapiCommonNameAndValue]=None, uuid: str=None, operational_state: TapiCommonOperationalState=None, lifecycle_state: TapiCommonLifecycleState=None, administrative_state: TapiCommonAdministrativeState=None, supported_layer_protocol_qualifier: List[str]=None, layer_protocol_name: TapiCommonLayerProtocolName=None, direction: TapiCommonPortDirection=None): # noqa: E501 + """TapiCommonServiceInterfacePoint - a model defined in Swagger + + :param available_capacity: The available_capacity of this TapiCommonServiceInterfacePoint. # noqa: E501 + :type available_capacity: TapiCommonCapacity + :param total_potential_capacity: The total_potential_capacity of this TapiCommonServiceInterfacePoint. # noqa: E501 + :type total_potential_capacity: TapiCommonCapacity + :param name: The name of this TapiCommonServiceInterfacePoint. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param uuid: The uuid of this TapiCommonServiceInterfacePoint. # noqa: E501 + :type uuid: str + :param operational_state: The operational_state of this TapiCommonServiceInterfacePoint. # noqa: E501 + :type operational_state: TapiCommonOperationalState + :param lifecycle_state: The lifecycle_state of this TapiCommonServiceInterfacePoint. # noqa: E501 + :type lifecycle_state: TapiCommonLifecycleState + :param administrative_state: The administrative_state of this TapiCommonServiceInterfacePoint. # noqa: E501 + :type administrative_state: TapiCommonAdministrativeState + :param supported_layer_protocol_qualifier: The supported_layer_protocol_qualifier of this TapiCommonServiceInterfacePoint. # noqa: E501 + :type supported_layer_protocol_qualifier: List[str] + :param layer_protocol_name: The layer_protocol_name of this TapiCommonServiceInterfacePoint. # noqa: E501 + :type layer_protocol_name: TapiCommonLayerProtocolName + :param direction: The direction of this TapiCommonServiceInterfacePoint. # noqa: E501 + :type direction: TapiCommonPortDirection + """ + self.swagger_types = { + 'available_capacity': TapiCommonCapacity, + 'total_potential_capacity': TapiCommonCapacity, + 'name': List[TapiCommonNameAndValue], + 'uuid': str, + 'operational_state': TapiCommonOperationalState, + 'lifecycle_state': TapiCommonLifecycleState, + 'administrative_state': TapiCommonAdministrativeState, + 'supported_layer_protocol_qualifier': List[str], + 'layer_protocol_name': TapiCommonLayerProtocolName, + 'direction': TapiCommonPortDirection + } + + self.attribute_map = { + 'available_capacity': 'available-capacity', + 'total_potential_capacity': 'total-potential-capacity', + 'name': 'name', + 'uuid': 'uuid', + 'operational_state': 'operational-state', + 'lifecycle_state': 'lifecycle-state', + 'administrative_state': 'administrative-state', + 'supported_layer_protocol_qualifier': 'supported-layer-protocol-qualifier', + 'layer_protocol_name': 'layer-protocol-name', + 'direction': 'direction' + } + self._available_capacity = available_capacity + self._total_potential_capacity = total_potential_capacity + self._name = name + self._uuid = uuid + self._operational_state = operational_state + self._lifecycle_state = lifecycle_state + self._administrative_state = administrative_state + self._supported_layer_protocol_qualifier = supported_layer_protocol_qualifier + self._layer_protocol_name = layer_protocol_name + self._direction = direction + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonServiceInterfacePoint': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.ServiceInterfacePoint of this TapiCommonServiceInterfacePoint. # noqa: E501 + :rtype: TapiCommonServiceInterfacePoint + """ + return util.deserialize_model(dikt, cls) + + @property + def available_capacity(self) -> TapiCommonCapacity: + """Gets the available_capacity of this TapiCommonServiceInterfacePoint. + + + :return: The available_capacity of this TapiCommonServiceInterfacePoint. + :rtype: TapiCommonCapacity + """ + return self._available_capacity + + @available_capacity.setter + def available_capacity(self, available_capacity: TapiCommonCapacity): + """Sets the available_capacity of this TapiCommonServiceInterfacePoint. + + + :param available_capacity: The available_capacity of this TapiCommonServiceInterfacePoint. + :type available_capacity: TapiCommonCapacity + """ + + self._available_capacity = available_capacity + + @property + def total_potential_capacity(self) -> TapiCommonCapacity: + """Gets the total_potential_capacity of this TapiCommonServiceInterfacePoint. + + + :return: The total_potential_capacity of this TapiCommonServiceInterfacePoint. + :rtype: TapiCommonCapacity + """ + return self._total_potential_capacity + + @total_potential_capacity.setter + def total_potential_capacity(self, total_potential_capacity: TapiCommonCapacity): + """Sets the total_potential_capacity of this TapiCommonServiceInterfacePoint. + + + :param total_potential_capacity: The total_potential_capacity of this TapiCommonServiceInterfacePoint. + :type total_potential_capacity: TapiCommonCapacity + """ + + self._total_potential_capacity = total_potential_capacity + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiCommonServiceInterfacePoint. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiCommonServiceInterfacePoint. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiCommonServiceInterfacePoint. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiCommonServiceInterfacePoint. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def uuid(self) -> str: + """Gets the uuid of this TapiCommonServiceInterfacePoint. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :return: The uuid of this TapiCommonServiceInterfacePoint. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid: str): + """Sets the uuid of this TapiCommonServiceInterfacePoint. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :param uuid: The uuid of this TapiCommonServiceInterfacePoint. + :type uuid: str + """ + + self._uuid = uuid + + @property + def operational_state(self) -> TapiCommonOperationalState: + """Gets the operational_state of this TapiCommonServiceInterfacePoint. + + + :return: The operational_state of this TapiCommonServiceInterfacePoint. + :rtype: TapiCommonOperationalState + """ + return self._operational_state + + @operational_state.setter + def operational_state(self, operational_state: TapiCommonOperationalState): + """Sets the operational_state of this TapiCommonServiceInterfacePoint. + + + :param operational_state: The operational_state of this TapiCommonServiceInterfacePoint. + :type operational_state: TapiCommonOperationalState + """ + + self._operational_state = operational_state + + @property + def lifecycle_state(self) -> TapiCommonLifecycleState: + """Gets the lifecycle_state of this TapiCommonServiceInterfacePoint. + + + :return: The lifecycle_state of this TapiCommonServiceInterfacePoint. + :rtype: TapiCommonLifecycleState + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state: TapiCommonLifecycleState): + """Sets the lifecycle_state of this TapiCommonServiceInterfacePoint. + + + :param lifecycle_state: The lifecycle_state of this TapiCommonServiceInterfacePoint. + :type lifecycle_state: TapiCommonLifecycleState + """ + + self._lifecycle_state = lifecycle_state + + @property + def administrative_state(self) -> TapiCommonAdministrativeState: + """Gets the administrative_state of this TapiCommonServiceInterfacePoint. + + + :return: The administrative_state of this TapiCommonServiceInterfacePoint. + :rtype: TapiCommonAdministrativeState + """ + return self._administrative_state + + @administrative_state.setter + def administrative_state(self, administrative_state: TapiCommonAdministrativeState): + """Sets the administrative_state of this TapiCommonServiceInterfacePoint. + + + :param administrative_state: The administrative_state of this TapiCommonServiceInterfacePoint. + :type administrative_state: TapiCommonAdministrativeState + """ + + self._administrative_state = administrative_state + + @property + def supported_layer_protocol_qualifier(self) -> List[str]: + """Gets the supported_layer_protocol_qualifier of this TapiCommonServiceInterfacePoint. + + none # noqa: E501 + + :return: The supported_layer_protocol_qualifier of this TapiCommonServiceInterfacePoint. + :rtype: List[str] + """ + return self._supported_layer_protocol_qualifier + + @supported_layer_protocol_qualifier.setter + def supported_layer_protocol_qualifier(self, supported_layer_protocol_qualifier: List[str]): + """Sets the supported_layer_protocol_qualifier of this TapiCommonServiceInterfacePoint. + + none # noqa: E501 + + :param supported_layer_protocol_qualifier: The supported_layer_protocol_qualifier of this TapiCommonServiceInterfacePoint. + :type supported_layer_protocol_qualifier: List[str] + """ + + self._supported_layer_protocol_qualifier = supported_layer_protocol_qualifier + + @property + def layer_protocol_name(self) -> TapiCommonLayerProtocolName: + """Gets the layer_protocol_name of this TapiCommonServiceInterfacePoint. + + + :return: The layer_protocol_name of this TapiCommonServiceInterfacePoint. + :rtype: TapiCommonLayerProtocolName + """ + return self._layer_protocol_name + + @layer_protocol_name.setter + def layer_protocol_name(self, layer_protocol_name: TapiCommonLayerProtocolName): + """Sets the layer_protocol_name of this TapiCommonServiceInterfacePoint. + + + :param layer_protocol_name: The layer_protocol_name of this TapiCommonServiceInterfacePoint. + :type layer_protocol_name: TapiCommonLayerProtocolName + """ + + self._layer_protocol_name = layer_protocol_name + + @property + def direction(self) -> TapiCommonPortDirection: + """Gets the direction of this TapiCommonServiceInterfacePoint. + + + :return: The direction of this TapiCommonServiceInterfacePoint. + :rtype: TapiCommonPortDirection + """ + return self._direction + + @direction.setter + def direction(self, direction: TapiCommonPortDirection): + """Sets the direction of this TapiCommonServiceInterfacePoint. + + + :param direction: The direction of this TapiCommonServiceInterfacePoint. + :type direction: TapiCommonPortDirection + """ + + self._direction = direction diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_service_interface_point_ref.py b/hackfest/tapi/server/tapi_server/models/tapi_common_service_interface_point_ref.py new file mode 100644 index 0000000000000000000000000000000000000000..8d94e5e01080e69a4a555fc607c19870e2ff0d52 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_service_interface_point_ref.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiCommonServiceInterfacePointRef(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, service_interface_point_uuid: str=None): # noqa: E501 + """TapiCommonServiceInterfacePointRef - a model defined in Swagger + + :param service_interface_point_uuid: The service_interface_point_uuid of this TapiCommonServiceInterfacePointRef. # noqa: E501 + :type service_interface_point_uuid: str + """ + self.swagger_types = { + 'service_interface_point_uuid': str + } + + self.attribute_map = { + 'service_interface_point_uuid': 'service-interface-point-uuid' + } + self._service_interface_point_uuid = service_interface_point_uuid + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonServiceInterfacePointRef': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.ServiceInterfacePointRef of this TapiCommonServiceInterfacePointRef. # noqa: E501 + :rtype: TapiCommonServiceInterfacePointRef + """ + return util.deserialize_model(dikt, cls) + + @property + def service_interface_point_uuid(self) -> str: + """Gets the service_interface_point_uuid of this TapiCommonServiceInterfacePointRef. + + none # noqa: E501 + + :return: The service_interface_point_uuid of this TapiCommonServiceInterfacePointRef. + :rtype: str + """ + return self._service_interface_point_uuid + + @service_interface_point_uuid.setter + def service_interface_point_uuid(self, service_interface_point_uuid: str): + """Sets the service_interface_point_uuid of this TapiCommonServiceInterfacePointRef. + + none # noqa: E501 + + :param service_interface_point_uuid: The service_interface_point_uuid of this TapiCommonServiceInterfacePointRef. + :type service_interface_point_uuid: str + """ + + self._service_interface_point_uuid = service_interface_point_uuid diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_service_interface_point_ref_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_common_service_interface_point_ref_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..3375982f20136bb6e6407abe59e031dd5e9414e8 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_service_interface_point_ref_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_service_interface_point_ref import TapiCommonServiceInterfacePointRef # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonServiceInterfacePointRefWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, service_interface_point: TapiCommonServiceInterfacePointRef=None): # noqa: E501 + """TapiCommonServiceInterfacePointRefWrapper - a model defined in Swagger + + :param service_interface_point: The service_interface_point of this TapiCommonServiceInterfacePointRefWrapper. # noqa: E501 + :type service_interface_point: TapiCommonServiceInterfacePointRef + """ + self.swagger_types = { + 'service_interface_point': TapiCommonServiceInterfacePointRef + } + + self.attribute_map = { + 'service_interface_point': 'service-interface-point' + } + self._service_interface_point = service_interface_point + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonServiceInterfacePointRefWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.ServiceInterfacePointRefWrapper of this TapiCommonServiceInterfacePointRefWrapper. # noqa: E501 + :rtype: TapiCommonServiceInterfacePointRefWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def service_interface_point(self) -> TapiCommonServiceInterfacePointRef: + """Gets the service_interface_point of this TapiCommonServiceInterfacePointRefWrapper. + + + :return: The service_interface_point of this TapiCommonServiceInterfacePointRefWrapper. + :rtype: TapiCommonServiceInterfacePointRef + """ + return self._service_interface_point + + @service_interface_point.setter + def service_interface_point(self, service_interface_point: TapiCommonServiceInterfacePointRef): + """Sets the service_interface_point of this TapiCommonServiceInterfacePointRefWrapper. + + + :param service_interface_point: The service_interface_point of this TapiCommonServiceInterfacePointRefWrapper. + :type service_interface_point: TapiCommonServiceInterfacePointRef + """ + + self._service_interface_point = service_interface_point diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_service_interface_point_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_common_service_interface_point_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..b4596f121cf6263fb35c7e1fb578cb6b755b28b1 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_service_interface_point_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_service_interface_point import TapiCommonServiceInterfacePoint # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonServiceInterfacePointWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, service_interface_point: TapiCommonServiceInterfacePoint=None): # noqa: E501 + """TapiCommonServiceInterfacePointWrapper - a model defined in Swagger + + :param service_interface_point: The service_interface_point of this TapiCommonServiceInterfacePointWrapper. # noqa: E501 + :type service_interface_point: TapiCommonServiceInterfacePoint + """ + self.swagger_types = { + 'service_interface_point': TapiCommonServiceInterfacePoint + } + + self.attribute_map = { + 'service_interface_point': 'service-interface-point' + } + self._service_interface_point = service_interface_point + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonServiceInterfacePointWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.ServiceInterfacePointWrapper of this TapiCommonServiceInterfacePointWrapper. # noqa: E501 + :rtype: TapiCommonServiceInterfacePointWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def service_interface_point(self) -> TapiCommonServiceInterfacePoint: + """Gets the service_interface_point of this TapiCommonServiceInterfacePointWrapper. + + + :return: The service_interface_point of this TapiCommonServiceInterfacePointWrapper. + :rtype: TapiCommonServiceInterfacePoint + """ + return self._service_interface_point + + @service_interface_point.setter + def service_interface_point(self, service_interface_point: TapiCommonServiceInterfacePoint): + """Sets the service_interface_point of this TapiCommonServiceInterfacePointWrapper. + + + :param service_interface_point: The service_interface_point of this TapiCommonServiceInterfacePointWrapper. + :type service_interface_point: TapiCommonServiceInterfacePoint + """ + + self._service_interface_point = service_interface_point diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_tapi_context.py b/hackfest/tapi/server/tapi_server/models/tapi_common_tapi_context.py new file mode 100644 index 0000000000000000000000000000000000000000..72fda0fe64f24648c3442ede0a0c87394299a549 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_tapi_context.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_global_class import TapiCommonGlobalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_common_service_interface_point import TapiCommonServiceInterfacePoint # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonTapiContext(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: List[TapiCommonNameAndValue]=None, uuid: str=None, service_interface_point: List[TapiCommonServiceInterfacePoint]=None): # noqa: E501 + """TapiCommonTapiContext - a model defined in Swagger + + :param name: The name of this TapiCommonTapiContext. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param uuid: The uuid of this TapiCommonTapiContext. # noqa: E501 + :type uuid: str + :param service_interface_point: The service_interface_point of this TapiCommonTapiContext. # noqa: E501 + :type service_interface_point: List[TapiCommonServiceInterfacePoint] + """ + self.swagger_types = { + 'name': List[TapiCommonNameAndValue], + 'uuid': str, + 'service_interface_point': List[TapiCommonServiceInterfacePoint] + } + + self.attribute_map = { + 'name': 'name', + 'uuid': 'uuid', + 'service_interface_point': 'service-interface-point' + } + self._name = name + self._uuid = uuid + self._service_interface_point = service_interface_point + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonTapiContext': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.TapiContext of this TapiCommonTapiContext. # noqa: E501 + :rtype: TapiCommonTapiContext + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiCommonTapiContext. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiCommonTapiContext. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiCommonTapiContext. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiCommonTapiContext. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def uuid(self) -> str: + """Gets the uuid of this TapiCommonTapiContext. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :return: The uuid of this TapiCommonTapiContext. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid: str): + """Sets the uuid of this TapiCommonTapiContext. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :param uuid: The uuid of this TapiCommonTapiContext. + :type uuid: str + """ + + self._uuid = uuid + + @property + def service_interface_point(self) -> List[TapiCommonServiceInterfacePoint]: + """Gets the service_interface_point of this TapiCommonTapiContext. + + none # noqa: E501 + + :return: The service_interface_point of this TapiCommonTapiContext. + :rtype: List[TapiCommonServiceInterfacePoint] + """ + return self._service_interface_point + + @service_interface_point.setter + def service_interface_point(self, service_interface_point: List[TapiCommonServiceInterfacePoint]): + """Sets the service_interface_point of this TapiCommonTapiContext. + + none # noqa: E501 + + :param service_interface_point: The service_interface_point of this TapiCommonTapiContext. + :type service_interface_point: List[TapiCommonServiceInterfacePoint] + """ + + self._service_interface_point = service_interface_point diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_termination_direction.py b/hackfest/tapi/server/tapi_server/models/tapi_common_termination_direction.py new file mode 100644 index 0000000000000000000000000000000000000000..8b14272c0922c987e114fc6a26efdf8e16b70a3e --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_termination_direction.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiCommonTerminationDirection(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + BIDIRECTIONAL = "BIDIRECTIONAL" + SINK = "SINK" + SOURCE = "SOURCE" + UNDEFINED_OR_UNKNOWN = "UNDEFINED_OR_UNKNOWN" + def __init__(self): # noqa: E501 + """TapiCommonTerminationDirection - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonTerminationDirection': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.TerminationDirection of this TapiCommonTerminationDirection. # noqa: E501 + :rtype: TapiCommonTerminationDirection + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_termination_pac.py b/hackfest/tapi/server/tapi_server/models/tapi_common_termination_pac.py new file mode 100644 index 0000000000000000000000000000000000000000..75d0812216efe9e9e81a575b0b9af217cd8b7710 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_termination_pac.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_termination_direction import TapiCommonTerminationDirection # noqa: F401,E501 +from tapi_server.models.tapi_common_termination_state import TapiCommonTerminationState # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonTerminationPac(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, termination_direction: TapiCommonTerminationDirection=None, termination_state: TapiCommonTerminationState=None): # noqa: E501 + """TapiCommonTerminationPac - a model defined in Swagger + + :param termination_direction: The termination_direction of this TapiCommonTerminationPac. # noqa: E501 + :type termination_direction: TapiCommonTerminationDirection + :param termination_state: The termination_state of this TapiCommonTerminationPac. # noqa: E501 + :type termination_state: TapiCommonTerminationState + """ + self.swagger_types = { + 'termination_direction': TapiCommonTerminationDirection, + 'termination_state': TapiCommonTerminationState + } + + self.attribute_map = { + 'termination_direction': 'termination-direction', + 'termination_state': 'termination-state' + } + self._termination_direction = termination_direction + self._termination_state = termination_state + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonTerminationPac': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.TerminationPac of this TapiCommonTerminationPac. # noqa: E501 + :rtype: TapiCommonTerminationPac + """ + return util.deserialize_model(dikt, cls) + + @property + def termination_direction(self) -> TapiCommonTerminationDirection: + """Gets the termination_direction of this TapiCommonTerminationPac. + + + :return: The termination_direction of this TapiCommonTerminationPac. + :rtype: TapiCommonTerminationDirection + """ + return self._termination_direction + + @termination_direction.setter + def termination_direction(self, termination_direction: TapiCommonTerminationDirection): + """Sets the termination_direction of this TapiCommonTerminationPac. + + + :param termination_direction: The termination_direction of this TapiCommonTerminationPac. + :type termination_direction: TapiCommonTerminationDirection + """ + + self._termination_direction = termination_direction + + @property + def termination_state(self) -> TapiCommonTerminationState: + """Gets the termination_state of this TapiCommonTerminationPac. + + + :return: The termination_state of this TapiCommonTerminationPac. + :rtype: TapiCommonTerminationState + """ + return self._termination_state + + @termination_state.setter + def termination_state(self, termination_state: TapiCommonTerminationState): + """Sets the termination_state of this TapiCommonTerminationPac. + + + :param termination_state: The termination_state of this TapiCommonTerminationPac. + :type termination_state: TapiCommonTerminationState + """ + + self._termination_state = termination_state diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_termination_state.py b/hackfest/tapi/server/tapi_server/models/tapi_common_termination_state.py new file mode 100644 index 0000000000000000000000000000000000000000..8b90b76ac8713d9d3f1bc14d52be6a8c9566b938 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_termination_state.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiCommonTerminationState(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + LP_CAN_NEVER_TERMINATE = "LP_CAN_NEVER_TERMINATE" + LT_NOT_TERMINATED = "LT_NOT_TERMINATED" + TERMINATED_SERVER_TO_CLIENT_FLOW = "TERMINATED_SERVER_TO_CLIENT_FLOW" + TERMINATED_CLIENT_TO_SERVER_FLOW = "TERMINATED_CLIENT_TO_SERVER_FLOW" + TERMINATED_BIDIRECTIONAL = "TERMINATED_BIDIRECTIONAL" + LT_PERMENANTLY_TERMINATED = "LT_PERMENANTLY_TERMINATED" + TERMINATION_STATE_UNKNOWN = "TERMINATION_STATE_UNKNOWN" + def __init__(self): # noqa: E501 + """TapiCommonTerminationState - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonTerminationState': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.TerminationState of this TapiCommonTerminationState. # noqa: E501 + :rtype: TapiCommonTerminationState + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_time_range.py b/hackfest/tapi/server/tapi_server/models/tapi_common_time_range.py new file mode 100644 index 0000000000000000000000000000000000000000..d4b33cea32c7caeb998485e60ac612e2c6d52267 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_time_range.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiCommonTimeRange(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, end_time: str=None, start_time: str=None): # noqa: E501 + """TapiCommonTimeRange - a model defined in Swagger + + :param end_time: The end_time of this TapiCommonTimeRange. # noqa: E501 + :type end_time: str + :param start_time: The start_time of this TapiCommonTimeRange. # noqa: E501 + :type start_time: str + """ + self.swagger_types = { + 'end_time': str, + 'start_time': str + } + + self.attribute_map = { + 'end_time': 'end-time', + 'start_time': 'start-time' + } + self._end_time = end_time + self._start_time = start_time + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonTimeRange': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.TimeRange of this TapiCommonTimeRange. # noqa: E501 + :rtype: TapiCommonTimeRange + """ + return util.deserialize_model(dikt, cls) + + @property + def end_time(self) -> str: + """Gets the end_time of this TapiCommonTimeRange. + + none # noqa: E501 + + :return: The end_time of this TapiCommonTimeRange. + :rtype: str + """ + return self._end_time + + @end_time.setter + def end_time(self, end_time: str): + """Sets the end_time of this TapiCommonTimeRange. + + none # noqa: E501 + + :param end_time: The end_time of this TapiCommonTimeRange. + :type end_time: str + """ + + self._end_time = end_time + + @property + def start_time(self) -> str: + """Gets the start_time of this TapiCommonTimeRange. + + none # noqa: E501 + + :return: The start_time of this TapiCommonTimeRange. + :rtype: str + """ + return self._start_time + + @start_time.setter + def start_time(self, start_time: str): + """Sets the start_time of this TapiCommonTimeRange. + + none # noqa: E501 + + :param start_time: The start_time of this TapiCommonTimeRange. + :type start_time: str + """ + + self._start_time = start_time diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_time_range_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_common_time_range_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..839c40f06015d24bfd6b0a5a74f025cc09633b6d --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_time_range_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_time_range import TapiCommonTimeRange # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonTimeRangeWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, schedule: TapiCommonTimeRange=None): # noqa: E501 + """TapiCommonTimeRangeWrapper - a model defined in Swagger + + :param schedule: The schedule of this TapiCommonTimeRangeWrapper. # noqa: E501 + :type schedule: TapiCommonTimeRange + """ + self.swagger_types = { + 'schedule': TapiCommonTimeRange + } + + self.attribute_map = { + 'schedule': 'schedule' + } + self._schedule = schedule + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonTimeRangeWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.TimeRangeWrapper of this TapiCommonTimeRangeWrapper. # noqa: E501 + :rtype: TapiCommonTimeRangeWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def schedule(self) -> TapiCommonTimeRange: + """Gets the schedule of this TapiCommonTimeRangeWrapper. + + + :return: The schedule of this TapiCommonTimeRangeWrapper. + :rtype: TapiCommonTimeRange + """ + return self._schedule + + @schedule.setter + def schedule(self, schedule: TapiCommonTimeRange): + """Sets the schedule of this TapiCommonTimeRangeWrapper. + + + :param schedule: The schedule of this TapiCommonTimeRangeWrapper. + :type schedule: TapiCommonTimeRange + """ + + self._schedule = schedule diff --git a/hackfest/tapi/server/tapi_server/models/tapi_common_updateserviceinterfacepoint_input.py b/hackfest/tapi/server/tapi_server/models/tapi_common_updateserviceinterfacepoint_input.py new file mode 100644 index 0000000000000000000000000000000000000000..d2013ae157886c02b4c5d3614a7ddf35c941558a --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_common_updateserviceinterfacepoint_input.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_administrative_state import TapiCommonAdministrativeState # noqa: F401,E501 +from tapi_server import util + + +class TapiCommonUpdateserviceinterfacepointInput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, sip_id_or_name: str=None, state: TapiCommonAdministrativeState=None): # noqa: E501 + """TapiCommonUpdateserviceinterfacepointInput - a model defined in Swagger + + :param sip_id_or_name: The sip_id_or_name of this TapiCommonUpdateserviceinterfacepointInput. # noqa: E501 + :type sip_id_or_name: str + :param state: The state of this TapiCommonUpdateserviceinterfacepointInput. # noqa: E501 + :type state: TapiCommonAdministrativeState + """ + self.swagger_types = { + 'sip_id_or_name': str, + 'state': TapiCommonAdministrativeState + } + + self.attribute_map = { + 'sip_id_or_name': 'sip-id-or-name', + 'state': 'state' + } + self._sip_id_or_name = sip_id_or_name + self._state = state + + @classmethod + def from_dict(cls, dikt) -> 'TapiCommonUpdateserviceinterfacepointInput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.common.updateserviceinterfacepoint.Input of this TapiCommonUpdateserviceinterfacepointInput. # noqa: E501 + :rtype: TapiCommonUpdateserviceinterfacepointInput + """ + return util.deserialize_model(dikt, cls) + + @property + def sip_id_or_name(self) -> str: + """Gets the sip_id_or_name of this TapiCommonUpdateserviceinterfacepointInput. + + none # noqa: E501 + + :return: The sip_id_or_name of this TapiCommonUpdateserviceinterfacepointInput. + :rtype: str + """ + return self._sip_id_or_name + + @sip_id_or_name.setter + def sip_id_or_name(self, sip_id_or_name: str): + """Sets the sip_id_or_name of this TapiCommonUpdateserviceinterfacepointInput. + + none # noqa: E501 + + :param sip_id_or_name: The sip_id_or_name of this TapiCommonUpdateserviceinterfacepointInput. + :type sip_id_or_name: str + """ + + self._sip_id_or_name = sip_id_or_name + + @property + def state(self) -> TapiCommonAdministrativeState: + """Gets the state of this TapiCommonUpdateserviceinterfacepointInput. + + + :return: The state of this TapiCommonUpdateserviceinterfacepointInput. + :rtype: TapiCommonAdministrativeState + """ + return self._state + + @state.setter + def state(self, state: TapiCommonAdministrativeState): + """Sets the state of this TapiCommonUpdateserviceinterfacepointInput. + + + :param state: The state of this TapiCommonUpdateserviceinterfacepointInput. + :type state: TapiCommonAdministrativeState + """ + + self._state = state diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_cep_list.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_cep_list.py new file mode 100644 index 0000000000000000000000000000000000000000..62c3fd0448704abca16a24f5b5ad7d6fa5056604 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_cep_list.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connection_end_point import TapiConnectivityConnectionEndPoint # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityCepList(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, connection_end_point: List[TapiConnectivityConnectionEndPoint]=None): # noqa: E501 + """TapiConnectivityCepList - a model defined in Swagger + + :param connection_end_point: The connection_end_point of this TapiConnectivityCepList. # noqa: E501 + :type connection_end_point: List[TapiConnectivityConnectionEndPoint] + """ + self.swagger_types = { + 'connection_end_point': List[TapiConnectivityConnectionEndPoint] + } + + self.attribute_map = { + 'connection_end_point': 'connection-end-point' + } + self._connection_end_point = connection_end_point + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityCepList': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.CepList of this TapiConnectivityCepList. # noqa: E501 + :rtype: TapiConnectivityCepList + """ + return util.deserialize_model(dikt, cls) + + @property + def connection_end_point(self) -> List[TapiConnectivityConnectionEndPoint]: + """Gets the connection_end_point of this TapiConnectivityCepList. + + none # noqa: E501 + + :return: The connection_end_point of this TapiConnectivityCepList. + :rtype: List[TapiConnectivityConnectionEndPoint] + """ + return self._connection_end_point + + @connection_end_point.setter + def connection_end_point(self, connection_end_point: List[TapiConnectivityConnectionEndPoint]): + """Sets the connection_end_point of this TapiConnectivityCepList. + + none # noqa: E501 + + :param connection_end_point: The connection_end_point of this TapiConnectivityCepList. + :type connection_end_point: List[TapiConnectivityConnectionEndPoint] + """ + + self._connection_end_point = connection_end_point diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_cep_list_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_cep_list_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..1a8af9dcc89795d30e1f0547062dc327e1092715 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_cep_list_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_cep_list import TapiConnectivityCepList # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityCepListWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, tapi_connectivitycep_list: TapiConnectivityCepList=None): # noqa: E501 + """TapiConnectivityCepListWrapper - a model defined in Swagger + + :param tapi_connectivitycep_list: The tapi_connectivitycep_list of this TapiConnectivityCepListWrapper. # noqa: E501 + :type tapi_connectivitycep_list: TapiConnectivityCepList + """ + self.swagger_types = { + 'tapi_connectivitycep_list': TapiConnectivityCepList + } + + self.attribute_map = { + 'tapi_connectivitycep_list': 'tapi-connectivity:cep-list' + } + self._tapi_connectivitycep_list = tapi_connectivitycep_list + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityCepListWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.CepListWrapper of this TapiConnectivityCepListWrapper. # noqa: E501 + :rtype: TapiConnectivityCepListWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def tapi_connectivitycep_list(self) -> TapiConnectivityCepList: + """Gets the tapi_connectivitycep_list of this TapiConnectivityCepListWrapper. + + + :return: The tapi_connectivitycep_list of this TapiConnectivityCepListWrapper. + :rtype: TapiConnectivityCepList + """ + return self._tapi_connectivitycep_list + + @tapi_connectivitycep_list.setter + def tapi_connectivitycep_list(self, tapi_connectivitycep_list: TapiConnectivityCepList): + """Sets the tapi_connectivitycep_list of this TapiConnectivityCepListWrapper. + + + :param tapi_connectivitycep_list: The tapi_connectivitycep_list of this TapiConnectivityCepListWrapper. + :type tapi_connectivitycep_list: TapiConnectivityCepList + """ + + self._tapi_connectivitycep_list = tapi_connectivitycep_list diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_cep_role.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_cep_role.py new file mode 100644 index 0000000000000000000000000000000000000000..a6fb10194c7bef2338bf5e250d75df55595de399 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_cep_role.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connection_spec_reference import TapiConnectivityConnectionSpecReference # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityCepRole(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, role_name: str=None, connection_spec_reference: TapiConnectivityConnectionSpecReference=None): # noqa: E501 + """TapiConnectivityCepRole - a model defined in Swagger + + :param role_name: The role_name of this TapiConnectivityCepRole. # noqa: E501 + :type role_name: str + :param connection_spec_reference: The connection_spec_reference of this TapiConnectivityCepRole. # noqa: E501 + :type connection_spec_reference: TapiConnectivityConnectionSpecReference + """ + self.swagger_types = { + 'role_name': str, + 'connection_spec_reference': TapiConnectivityConnectionSpecReference + } + + self.attribute_map = { + 'role_name': 'role-name', + 'connection_spec_reference': 'connection-spec-reference' + } + self._role_name = role_name + self._connection_spec_reference = connection_spec_reference + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityCepRole': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.CepRole of this TapiConnectivityCepRole. # noqa: E501 + :rtype: TapiConnectivityCepRole + """ + return util.deserialize_model(dikt, cls) + + @property + def role_name(self) -> str: + """Gets the role_name of this TapiConnectivityCepRole. + + The name of the cep role in the context of the referenced spec. # noqa: E501 + + :return: The role_name of this TapiConnectivityCepRole. + :rtype: str + """ + return self._role_name + + @role_name.setter + def role_name(self, role_name: str): + """Sets the role_name of this TapiConnectivityCepRole. + + The name of the cep role in the context of the referenced spec. # noqa: E501 + + :param role_name: The role_name of this TapiConnectivityCepRole. + :type role_name: str + """ + + self._role_name = role_name + + @property + def connection_spec_reference(self) -> TapiConnectivityConnectionSpecReference: + """Gets the connection_spec_reference of this TapiConnectivityCepRole. + + + :return: The connection_spec_reference of this TapiConnectivityCepRole. + :rtype: TapiConnectivityConnectionSpecReference + """ + return self._connection_spec_reference + + @connection_spec_reference.setter + def connection_spec_reference(self, connection_spec_reference: TapiConnectivityConnectionSpecReference): + """Sets the connection_spec_reference of this TapiConnectivityCepRole. + + + :param connection_spec_reference: The connection_spec_reference of this TapiConnectivityCepRole. + :type connection_spec_reference: TapiConnectivityConnectionSpecReference + """ + + self._connection_spec_reference = connection_spec_reference diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_cep_role_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_cep_role_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..f50a3ae02764e8a0343e72e7842043f4772e129d --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_cep_role_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_cep_role import TapiConnectivityCepRole # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityCepRoleWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, cep_role: TapiConnectivityCepRole=None): # noqa: E501 + """TapiConnectivityCepRoleWrapper - a model defined in Swagger + + :param cep_role: The cep_role of this TapiConnectivityCepRoleWrapper. # noqa: E501 + :type cep_role: TapiConnectivityCepRole + """ + self.swagger_types = { + 'cep_role': TapiConnectivityCepRole + } + + self.attribute_map = { + 'cep_role': 'cep-role' + } + self._cep_role = cep_role + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityCepRoleWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.CepRoleWrapper of this TapiConnectivityCepRoleWrapper. # noqa: E501 + :rtype: TapiConnectivityCepRoleWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def cep_role(self) -> TapiConnectivityCepRole: + """Gets the cep_role of this TapiConnectivityCepRoleWrapper. + + + :return: The cep_role of this TapiConnectivityCepRoleWrapper. + :rtype: TapiConnectivityCepRole + """ + return self._cep_role + + @cep_role.setter + def cep_role(self, cep_role: TapiConnectivityCepRole): + """Sets the cep_role of this TapiConnectivityCepRoleWrapper. + + + :param cep_role: The cep_role of this TapiConnectivityCepRoleWrapper. + :type cep_role: TapiConnectivityCepRole + """ + + self._cep_role = cep_role diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection.py new file mode 100644 index 0000000000000000000000000000000000000000..f7445787c94b8605a80e1ea24a8b8d5661357dcd --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection.py @@ -0,0 +1,375 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_forwarding_direction import TapiCommonForwardingDirection # noqa: F401,E501 +from tapi_server.models.tapi_common_global_class import TapiCommonGlobalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501 +from tapi_server.models.tapi_common_lifecycle_state import TapiCommonLifecycleState # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_common_operational_state import TapiCommonOperationalState # noqa: F401,E501 +from tapi_server.models.tapi_common_operational_state_pac import TapiCommonOperationalStatePac # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_connection_end_point_ref import TapiConnectivityConnectionEndPointRef # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_connection_ref import TapiConnectivityConnectionRef # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_connection_spec_reference import TapiConnectivityConnectionSpecReference # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_route import TapiConnectivityRoute # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_switch_control import TapiConnectivitySwitchControl # noqa: F401,E501 +from tapi_server.models.tapi_topology_link_ref import TapiTopologyLinkRef # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityConnection(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, operational_state: TapiCommonOperationalState=None, lifecycle_state: TapiCommonLifecycleState=None, name: List[TapiCommonNameAndValue]=None, uuid: str=None, supported_client_link: List[TapiTopologyLinkRef]=None, lower_connection: List[TapiConnectivityConnectionRef]=None, switch_control: List[TapiConnectivitySwitchControl]=None, route: List[TapiConnectivityRoute]=None, connection_spec_reference: TapiConnectivityConnectionSpecReference=None, layer_protocol_name: TapiCommonLayerProtocolName=None, connection_end_point: List[TapiConnectivityConnectionEndPointRef]=None, direction: TapiCommonForwardingDirection=None): # noqa: E501 + """TapiConnectivityConnection - a model defined in Swagger + + :param operational_state: The operational_state of this TapiConnectivityConnection. # noqa: E501 + :type operational_state: TapiCommonOperationalState + :param lifecycle_state: The lifecycle_state of this TapiConnectivityConnection. # noqa: E501 + :type lifecycle_state: TapiCommonLifecycleState + :param name: The name of this TapiConnectivityConnection. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param uuid: The uuid of this TapiConnectivityConnection. # noqa: E501 + :type uuid: str + :param supported_client_link: The supported_client_link of this TapiConnectivityConnection. # noqa: E501 + :type supported_client_link: List[TapiTopologyLinkRef] + :param lower_connection: The lower_connection of this TapiConnectivityConnection. # noqa: E501 + :type lower_connection: List[TapiConnectivityConnectionRef] + :param switch_control: The switch_control of this TapiConnectivityConnection. # noqa: E501 + :type switch_control: List[TapiConnectivitySwitchControl] + :param route: The route of this TapiConnectivityConnection. # noqa: E501 + :type route: List[TapiConnectivityRoute] + :param connection_spec_reference: The connection_spec_reference of this TapiConnectivityConnection. # noqa: E501 + :type connection_spec_reference: TapiConnectivityConnectionSpecReference + :param layer_protocol_name: The layer_protocol_name of this TapiConnectivityConnection. # noqa: E501 + :type layer_protocol_name: TapiCommonLayerProtocolName + :param connection_end_point: The connection_end_point of this TapiConnectivityConnection. # noqa: E501 + :type connection_end_point: List[TapiConnectivityConnectionEndPointRef] + :param direction: The direction of this TapiConnectivityConnection. # noqa: E501 + :type direction: TapiCommonForwardingDirection + """ + self.swagger_types = { + 'operational_state': TapiCommonOperationalState, + 'lifecycle_state': TapiCommonLifecycleState, + 'name': List[TapiCommonNameAndValue], + 'uuid': str, + 'supported_client_link': List[TapiTopologyLinkRef], + 'lower_connection': List[TapiConnectivityConnectionRef], + 'switch_control': List[TapiConnectivitySwitchControl], + 'route': List[TapiConnectivityRoute], + 'connection_spec_reference': TapiConnectivityConnectionSpecReference, + 'layer_protocol_name': TapiCommonLayerProtocolName, + 'connection_end_point': List[TapiConnectivityConnectionEndPointRef], + 'direction': TapiCommonForwardingDirection + } + + self.attribute_map = { + 'operational_state': 'operational-state', + 'lifecycle_state': 'lifecycle-state', + 'name': 'name', + 'uuid': 'uuid', + 'supported_client_link': 'supported-client-link', + 'lower_connection': 'lower-connection', + 'switch_control': 'switch-control', + 'route': 'route', + 'connection_spec_reference': 'connection-spec-reference', + 'layer_protocol_name': 'layer-protocol-name', + 'connection_end_point': 'connection-end-point', + 'direction': 'direction' + } + self._operational_state = operational_state + self._lifecycle_state = lifecycle_state + self._name = name + self._uuid = uuid + self._supported_client_link = supported_client_link + self._lower_connection = lower_connection + self._switch_control = switch_control + self._route = route + self._connection_spec_reference = connection_spec_reference + self._layer_protocol_name = layer_protocol_name + self._connection_end_point = connection_end_point + self._direction = direction + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityConnection': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.Connection of this TapiConnectivityConnection. # noqa: E501 + :rtype: TapiConnectivityConnection + """ + return util.deserialize_model(dikt, cls) + + @property + def operational_state(self) -> TapiCommonOperationalState: + """Gets the operational_state of this TapiConnectivityConnection. + + + :return: The operational_state of this TapiConnectivityConnection. + :rtype: TapiCommonOperationalState + """ + return self._operational_state + + @operational_state.setter + def operational_state(self, operational_state: TapiCommonOperationalState): + """Sets the operational_state of this TapiConnectivityConnection. + + + :param operational_state: The operational_state of this TapiConnectivityConnection. + :type operational_state: TapiCommonOperationalState + """ + + self._operational_state = operational_state + + @property + def lifecycle_state(self) -> TapiCommonLifecycleState: + """Gets the lifecycle_state of this TapiConnectivityConnection. + + + :return: The lifecycle_state of this TapiConnectivityConnection. + :rtype: TapiCommonLifecycleState + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state: TapiCommonLifecycleState): + """Sets the lifecycle_state of this TapiConnectivityConnection. + + + :param lifecycle_state: The lifecycle_state of this TapiConnectivityConnection. + :type lifecycle_state: TapiCommonLifecycleState + """ + + self._lifecycle_state = lifecycle_state + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiConnectivityConnection. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiConnectivityConnection. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiConnectivityConnection. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiConnectivityConnection. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def uuid(self) -> str: + """Gets the uuid of this TapiConnectivityConnection. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :return: The uuid of this TapiConnectivityConnection. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid: str): + """Sets the uuid of this TapiConnectivityConnection. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :param uuid: The uuid of this TapiConnectivityConnection. + :type uuid: str + """ + + self._uuid = uuid + + @property + def supported_client_link(self) -> List[TapiTopologyLinkRef]: + """Gets the supported_client_link of this TapiConnectivityConnection. + + none # noqa: E501 + + :return: The supported_client_link of this TapiConnectivityConnection. + :rtype: List[TapiTopologyLinkRef] + """ + return self._supported_client_link + + @supported_client_link.setter + def supported_client_link(self, supported_client_link: List[TapiTopologyLinkRef]): + """Sets the supported_client_link of this TapiConnectivityConnection. + + none # noqa: E501 + + :param supported_client_link: The supported_client_link of this TapiConnectivityConnection. + :type supported_client_link: List[TapiTopologyLinkRef] + """ + + self._supported_client_link = supported_client_link + + @property + def lower_connection(self) -> List[TapiConnectivityConnectionRef]: + """Gets the lower_connection of this TapiConnectivityConnection. + + An Connection object supports a recursive aggregation relationship such that the internal construction of an Connection can be exposed as multiple lower level Connection objects (partitioning). Aggregation is used as for the Node/Topology to allow changes in hierarchy. Connection aggregation reflects Node/Topology aggregation. The FC represents a Cross-Connection in an NE. The Cross-Connection in an NE is not necessarily the lowest level of FC partitioning. # noqa: E501 + + :return: The lower_connection of this TapiConnectivityConnection. + :rtype: List[TapiConnectivityConnectionRef] + """ + return self._lower_connection + + @lower_connection.setter + def lower_connection(self, lower_connection: List[TapiConnectivityConnectionRef]): + """Sets the lower_connection of this TapiConnectivityConnection. + + An Connection object supports a recursive aggregation relationship such that the internal construction of an Connection can be exposed as multiple lower level Connection objects (partitioning). Aggregation is used as for the Node/Topology to allow changes in hierarchy. Connection aggregation reflects Node/Topology aggregation. The FC represents a Cross-Connection in an NE. The Cross-Connection in an NE is not necessarily the lowest level of FC partitioning. # noqa: E501 + + :param lower_connection: The lower_connection of this TapiConnectivityConnection. + :type lower_connection: List[TapiConnectivityConnectionRef] + """ + + self._lower_connection = lower_connection + + @property + def switch_control(self) -> List[TapiConnectivitySwitchControl]: + """Gets the switch_control of this TapiConnectivityConnection. + + none # noqa: E501 + + :return: The switch_control of this TapiConnectivityConnection. + :rtype: List[TapiConnectivitySwitchControl] + """ + return self._switch_control + + @switch_control.setter + def switch_control(self, switch_control: List[TapiConnectivitySwitchControl]): + """Sets the switch_control of this TapiConnectivityConnection. + + none # noqa: E501 + + :param switch_control: The switch_control of this TapiConnectivityConnection. + :type switch_control: List[TapiConnectivitySwitchControl] + """ + + self._switch_control = switch_control + + @property + def route(self) -> List[TapiConnectivityRoute]: + """Gets the route of this TapiConnectivityConnection. + + none # noqa: E501 + + :return: The route of this TapiConnectivityConnection. + :rtype: List[TapiConnectivityRoute] + """ + return self._route + + @route.setter + def route(self, route: List[TapiConnectivityRoute]): + """Sets the route of this TapiConnectivityConnection. + + none # noqa: E501 + + :param route: The route of this TapiConnectivityConnection. + :type route: List[TapiConnectivityRoute] + """ + + self._route = route + + @property + def connection_spec_reference(self) -> TapiConnectivityConnectionSpecReference: + """Gets the connection_spec_reference of this TapiConnectivityConnection. + + + :return: The connection_spec_reference of this TapiConnectivityConnection. + :rtype: TapiConnectivityConnectionSpecReference + """ + return self._connection_spec_reference + + @connection_spec_reference.setter + def connection_spec_reference(self, connection_spec_reference: TapiConnectivityConnectionSpecReference): + """Sets the connection_spec_reference of this TapiConnectivityConnection. + + + :param connection_spec_reference: The connection_spec_reference of this TapiConnectivityConnection. + :type connection_spec_reference: TapiConnectivityConnectionSpecReference + """ + + self._connection_spec_reference = connection_spec_reference + + @property + def layer_protocol_name(self) -> TapiCommonLayerProtocolName: + """Gets the layer_protocol_name of this TapiConnectivityConnection. + + + :return: The layer_protocol_name of this TapiConnectivityConnection. + :rtype: TapiCommonLayerProtocolName + """ + return self._layer_protocol_name + + @layer_protocol_name.setter + def layer_protocol_name(self, layer_protocol_name: TapiCommonLayerProtocolName): + """Sets the layer_protocol_name of this TapiConnectivityConnection. + + + :param layer_protocol_name: The layer_protocol_name of this TapiConnectivityConnection. + :type layer_protocol_name: TapiCommonLayerProtocolName + """ + + self._layer_protocol_name = layer_protocol_name + + @property + def connection_end_point(self) -> List[TapiConnectivityConnectionEndPointRef]: + """Gets the connection_end_point of this TapiConnectivityConnection. + + none # noqa: E501 + + :return: The connection_end_point of this TapiConnectivityConnection. + :rtype: List[TapiConnectivityConnectionEndPointRef] + """ + return self._connection_end_point + + @connection_end_point.setter + def connection_end_point(self, connection_end_point: List[TapiConnectivityConnectionEndPointRef]): + """Sets the connection_end_point of this TapiConnectivityConnection. + + none # noqa: E501 + + :param connection_end_point: The connection_end_point of this TapiConnectivityConnection. + :type connection_end_point: List[TapiConnectivityConnectionEndPointRef] + """ + + self._connection_end_point = connection_end_point + + @property + def direction(self) -> TapiCommonForwardingDirection: + """Gets the direction of this TapiConnectivityConnection. + + + :return: The direction of this TapiConnectivityConnection. + :rtype: TapiCommonForwardingDirection + """ + return self._direction + + @direction.setter + def direction(self, direction: TapiCommonForwardingDirection): + """Sets the direction of this TapiConnectivityConnection. + + + :param direction: The direction of this TapiConnectivityConnection. + :type direction: TapiCommonForwardingDirection + """ + + self._direction = direction diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_end_point.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_end_point.py new file mode 100644 index 0000000000000000000000000000000000000000..19dff9cb6cf0858f1dd585ac154ebc4c57a5705d --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_end_point.py @@ -0,0 +1,426 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_global_class import TapiCommonGlobalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501 +from tapi_server.models.tapi_common_lifecycle_state import TapiCommonLifecycleState # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_common_operational_state import TapiCommonOperationalState # noqa: F401,E501 +from tapi_server.models.tapi_common_operational_state_pac import TapiCommonOperationalStatePac # noqa: F401,E501 +from tapi_server.models.tapi_common_port_direction import TapiCommonPortDirection # noqa: F401,E501 +from tapi_server.models.tapi_common_port_role import TapiCommonPortRole # noqa: F401,E501 +from tapi_server.models.tapi_common_termination_direction import TapiCommonTerminationDirection # noqa: F401,E501 +from tapi_server.models.tapi_common_termination_pac import TapiCommonTerminationPac # noqa: F401,E501 +from tapi_server.models.tapi_common_termination_state import TapiCommonTerminationState # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_cep_role import TapiConnectivityCepRole # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_connection_end_point_ref import TapiConnectivityConnectionEndPointRef # noqa: F401,E501 +from tapi_server.models.tapi_topology_node_edge_point_ref import TapiTopologyNodeEdgePointRef # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityConnectionEndPoint(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, operational_state: TapiCommonOperationalState=None, lifecycle_state: TapiCommonLifecycleState=None, termination_direction: TapiCommonTerminationDirection=None, termination_state: TapiCommonTerminationState=None, name: List[TapiCommonNameAndValue]=None, uuid: str=None, client_node_edge_point: List[TapiTopologyNodeEdgePointRef]=None, connection_port_role: TapiCommonPortRole=None, layer_protocol_name: TapiCommonLayerProtocolName=None, layer_protocol_qualifier: str=None, parent_node_edge_point: TapiTopologyNodeEdgePointRef=None, cep_role: List[TapiConnectivityCepRole]=None, aggregated_connection_end_point: List[TapiConnectivityConnectionEndPointRef]=None, connection_port_direction: TapiCommonPortDirection=None): # noqa: E501 + """TapiConnectivityConnectionEndPoint - a model defined in Swagger + + :param operational_state: The operational_state of this TapiConnectivityConnectionEndPoint. # noqa: E501 + :type operational_state: TapiCommonOperationalState + :param lifecycle_state: The lifecycle_state of this TapiConnectivityConnectionEndPoint. # noqa: E501 + :type lifecycle_state: TapiCommonLifecycleState + :param termination_direction: The termination_direction of this TapiConnectivityConnectionEndPoint. # noqa: E501 + :type termination_direction: TapiCommonTerminationDirection + :param termination_state: The termination_state of this TapiConnectivityConnectionEndPoint. # noqa: E501 + :type termination_state: TapiCommonTerminationState + :param name: The name of this TapiConnectivityConnectionEndPoint. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param uuid: The uuid of this TapiConnectivityConnectionEndPoint. # noqa: E501 + :type uuid: str + :param client_node_edge_point: The client_node_edge_point of this TapiConnectivityConnectionEndPoint. # noqa: E501 + :type client_node_edge_point: List[TapiTopologyNodeEdgePointRef] + :param connection_port_role: The connection_port_role of this TapiConnectivityConnectionEndPoint. # noqa: E501 + :type connection_port_role: TapiCommonPortRole + :param layer_protocol_name: The layer_protocol_name of this TapiConnectivityConnectionEndPoint. # noqa: E501 + :type layer_protocol_name: TapiCommonLayerProtocolName + :param layer_protocol_qualifier: The layer_protocol_qualifier of this TapiConnectivityConnectionEndPoint. # noqa: E501 + :type layer_protocol_qualifier: str + :param parent_node_edge_point: The parent_node_edge_point of this TapiConnectivityConnectionEndPoint. # noqa: E501 + :type parent_node_edge_point: TapiTopologyNodeEdgePointRef + :param cep_role: The cep_role of this TapiConnectivityConnectionEndPoint. # noqa: E501 + :type cep_role: List[TapiConnectivityCepRole] + :param aggregated_connection_end_point: The aggregated_connection_end_point of this TapiConnectivityConnectionEndPoint. # noqa: E501 + :type aggregated_connection_end_point: List[TapiConnectivityConnectionEndPointRef] + :param connection_port_direction: The connection_port_direction of this TapiConnectivityConnectionEndPoint. # noqa: E501 + :type connection_port_direction: TapiCommonPortDirection + """ + self.swagger_types = { + 'operational_state': TapiCommonOperationalState, + 'lifecycle_state': TapiCommonLifecycleState, + 'termination_direction': TapiCommonTerminationDirection, + 'termination_state': TapiCommonTerminationState, + 'name': List[TapiCommonNameAndValue], + 'uuid': str, + 'client_node_edge_point': List[TapiTopologyNodeEdgePointRef], + 'connection_port_role': TapiCommonPortRole, + 'layer_protocol_name': TapiCommonLayerProtocolName, + 'layer_protocol_qualifier': str, + 'parent_node_edge_point': TapiTopologyNodeEdgePointRef, + 'cep_role': List[TapiConnectivityCepRole], + 'aggregated_connection_end_point': List[TapiConnectivityConnectionEndPointRef], + 'connection_port_direction': TapiCommonPortDirection + } + + self.attribute_map = { + 'operational_state': 'operational-state', + 'lifecycle_state': 'lifecycle-state', + 'termination_direction': 'termination-direction', + 'termination_state': 'termination-state', + 'name': 'name', + 'uuid': 'uuid', + 'client_node_edge_point': 'client-node-edge-point', + 'connection_port_role': 'connection-port-role', + 'layer_protocol_name': 'layer-protocol-name', + 'layer_protocol_qualifier': 'layer-protocol-qualifier', + 'parent_node_edge_point': 'parent-node-edge-point', + 'cep_role': 'cep-role', + 'aggregated_connection_end_point': 'aggregated-connection-end-point', + 'connection_port_direction': 'connection-port-direction' + } + self._operational_state = operational_state + self._lifecycle_state = lifecycle_state + self._termination_direction = termination_direction + self._termination_state = termination_state + self._name = name + self._uuid = uuid + self._client_node_edge_point = client_node_edge_point + self._connection_port_role = connection_port_role + self._layer_protocol_name = layer_protocol_name + self._layer_protocol_qualifier = layer_protocol_qualifier + self._parent_node_edge_point = parent_node_edge_point + self._cep_role = cep_role + self._aggregated_connection_end_point = aggregated_connection_end_point + self._connection_port_direction = connection_port_direction + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityConnectionEndPoint': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ConnectionEndPoint of this TapiConnectivityConnectionEndPoint. # noqa: E501 + :rtype: TapiConnectivityConnectionEndPoint + """ + return util.deserialize_model(dikt, cls) + + @property + def operational_state(self) -> TapiCommonOperationalState: + """Gets the operational_state of this TapiConnectivityConnectionEndPoint. + + + :return: The operational_state of this TapiConnectivityConnectionEndPoint. + :rtype: TapiCommonOperationalState + """ + return self._operational_state + + @operational_state.setter + def operational_state(self, operational_state: TapiCommonOperationalState): + """Sets the operational_state of this TapiConnectivityConnectionEndPoint. + + + :param operational_state: The operational_state of this TapiConnectivityConnectionEndPoint. + :type operational_state: TapiCommonOperationalState + """ + + self._operational_state = operational_state + + @property + def lifecycle_state(self) -> TapiCommonLifecycleState: + """Gets the lifecycle_state of this TapiConnectivityConnectionEndPoint. + + + :return: The lifecycle_state of this TapiConnectivityConnectionEndPoint. + :rtype: TapiCommonLifecycleState + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state: TapiCommonLifecycleState): + """Sets the lifecycle_state of this TapiConnectivityConnectionEndPoint. + + + :param lifecycle_state: The lifecycle_state of this TapiConnectivityConnectionEndPoint. + :type lifecycle_state: TapiCommonLifecycleState + """ + + self._lifecycle_state = lifecycle_state + + @property + def termination_direction(self) -> TapiCommonTerminationDirection: + """Gets the termination_direction of this TapiConnectivityConnectionEndPoint. + + + :return: The termination_direction of this TapiConnectivityConnectionEndPoint. + :rtype: TapiCommonTerminationDirection + """ + return self._termination_direction + + @termination_direction.setter + def termination_direction(self, termination_direction: TapiCommonTerminationDirection): + """Sets the termination_direction of this TapiConnectivityConnectionEndPoint. + + + :param termination_direction: The termination_direction of this TapiConnectivityConnectionEndPoint. + :type termination_direction: TapiCommonTerminationDirection + """ + + self._termination_direction = termination_direction + + @property + def termination_state(self) -> TapiCommonTerminationState: + """Gets the termination_state of this TapiConnectivityConnectionEndPoint. + + + :return: The termination_state of this TapiConnectivityConnectionEndPoint. + :rtype: TapiCommonTerminationState + """ + return self._termination_state + + @termination_state.setter + def termination_state(self, termination_state: TapiCommonTerminationState): + """Sets the termination_state of this TapiConnectivityConnectionEndPoint. + + + :param termination_state: The termination_state of this TapiConnectivityConnectionEndPoint. + :type termination_state: TapiCommonTerminationState + """ + + self._termination_state = termination_state + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiConnectivityConnectionEndPoint. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiConnectivityConnectionEndPoint. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiConnectivityConnectionEndPoint. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiConnectivityConnectionEndPoint. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def uuid(self) -> str: + """Gets the uuid of this TapiConnectivityConnectionEndPoint. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :return: The uuid of this TapiConnectivityConnectionEndPoint. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid: str): + """Sets the uuid of this TapiConnectivityConnectionEndPoint. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :param uuid: The uuid of this TapiConnectivityConnectionEndPoint. + :type uuid: str + """ + + self._uuid = uuid + + @property + def client_node_edge_point(self) -> List[TapiTopologyNodeEdgePointRef]: + """Gets the client_node_edge_point of this TapiConnectivityConnectionEndPoint. + + none # noqa: E501 + + :return: The client_node_edge_point of this TapiConnectivityConnectionEndPoint. + :rtype: List[TapiTopologyNodeEdgePointRef] + """ + return self._client_node_edge_point + + @client_node_edge_point.setter + def client_node_edge_point(self, client_node_edge_point: List[TapiTopologyNodeEdgePointRef]): + """Sets the client_node_edge_point of this TapiConnectivityConnectionEndPoint. + + none # noqa: E501 + + :param client_node_edge_point: The client_node_edge_point of this TapiConnectivityConnectionEndPoint. + :type client_node_edge_point: List[TapiTopologyNodeEdgePointRef] + """ + + self._client_node_edge_point = client_node_edge_point + + @property + def connection_port_role(self) -> TapiCommonPortRole: + """Gets the connection_port_role of this TapiConnectivityConnectionEndPoint. + + + :return: The connection_port_role of this TapiConnectivityConnectionEndPoint. + :rtype: TapiCommonPortRole + """ + return self._connection_port_role + + @connection_port_role.setter + def connection_port_role(self, connection_port_role: TapiCommonPortRole): + """Sets the connection_port_role of this TapiConnectivityConnectionEndPoint. + + + :param connection_port_role: The connection_port_role of this TapiConnectivityConnectionEndPoint. + :type connection_port_role: TapiCommonPortRole + """ + + self._connection_port_role = connection_port_role + + @property + def layer_protocol_name(self) -> TapiCommonLayerProtocolName: + """Gets the layer_protocol_name of this TapiConnectivityConnectionEndPoint. + + + :return: The layer_protocol_name of this TapiConnectivityConnectionEndPoint. + :rtype: TapiCommonLayerProtocolName + """ + return self._layer_protocol_name + + @layer_protocol_name.setter + def layer_protocol_name(self, layer_protocol_name: TapiCommonLayerProtocolName): + """Sets the layer_protocol_name of this TapiConnectivityConnectionEndPoint. + + + :param layer_protocol_name: The layer_protocol_name of this TapiConnectivityConnectionEndPoint. + :type layer_protocol_name: TapiCommonLayerProtocolName + """ + + self._layer_protocol_name = layer_protocol_name + + @property + def layer_protocol_qualifier(self) -> str: + """Gets the layer_protocol_qualifier of this TapiConnectivityConnectionEndPoint. + + none # noqa: E501 + + :return: The layer_protocol_qualifier of this TapiConnectivityConnectionEndPoint. + :rtype: str + """ + return self._layer_protocol_qualifier + + @layer_protocol_qualifier.setter + def layer_protocol_qualifier(self, layer_protocol_qualifier: str): + """Sets the layer_protocol_qualifier of this TapiConnectivityConnectionEndPoint. + + none # noqa: E501 + + :param layer_protocol_qualifier: The layer_protocol_qualifier of this TapiConnectivityConnectionEndPoint. + :type layer_protocol_qualifier: str + """ + + self._layer_protocol_qualifier = layer_protocol_qualifier + + @property + def parent_node_edge_point(self) -> TapiTopologyNodeEdgePointRef: + """Gets the parent_node_edge_point of this TapiConnectivityConnectionEndPoint. + + + :return: The parent_node_edge_point of this TapiConnectivityConnectionEndPoint. + :rtype: TapiTopologyNodeEdgePointRef + """ + return self._parent_node_edge_point + + @parent_node_edge_point.setter + def parent_node_edge_point(self, parent_node_edge_point: TapiTopologyNodeEdgePointRef): + """Sets the parent_node_edge_point of this TapiConnectivityConnectionEndPoint. + + + :param parent_node_edge_point: The parent_node_edge_point of this TapiConnectivityConnectionEndPoint. + :type parent_node_edge_point: TapiTopologyNodeEdgePointRef + """ + + self._parent_node_edge_point = parent_node_edge_point + + @property + def cep_role(self) -> List[TapiConnectivityCepRole]: + """Gets the cep_role of this TapiConnectivityConnectionEndPoint. + + Defines the role of the CEP in the context of the connection spec. There may be many cep role - connection spec combinations for a particular CEP where each corresponds to a specific connection associated with the CEP. # noqa: E501 + + :return: The cep_role of this TapiConnectivityConnectionEndPoint. + :rtype: List[TapiConnectivityCepRole] + """ + return self._cep_role + + @cep_role.setter + def cep_role(self, cep_role: List[TapiConnectivityCepRole]): + """Sets the cep_role of this TapiConnectivityConnectionEndPoint. + + Defines the role of the CEP in the context of the connection spec. There may be many cep role - connection spec combinations for a particular CEP where each corresponds to a specific connection associated with the CEP. # noqa: E501 + + :param cep_role: The cep_role of this TapiConnectivityConnectionEndPoint. + :type cep_role: List[TapiConnectivityCepRole] + """ + + self._cep_role = cep_role + + @property + def aggregated_connection_end_point(self) -> List[TapiConnectivityConnectionEndPointRef]: + """Gets the aggregated_connection_end_point of this TapiConnectivityConnectionEndPoint. + + none # noqa: E501 + + :return: The aggregated_connection_end_point of this TapiConnectivityConnectionEndPoint. + :rtype: List[TapiConnectivityConnectionEndPointRef] + """ + return self._aggregated_connection_end_point + + @aggregated_connection_end_point.setter + def aggregated_connection_end_point(self, aggregated_connection_end_point: List[TapiConnectivityConnectionEndPointRef]): + """Sets the aggregated_connection_end_point of this TapiConnectivityConnectionEndPoint. + + none # noqa: E501 + + :param aggregated_connection_end_point: The aggregated_connection_end_point of this TapiConnectivityConnectionEndPoint. + :type aggregated_connection_end_point: List[TapiConnectivityConnectionEndPointRef] + """ + + self._aggregated_connection_end_point = aggregated_connection_end_point + + @property + def connection_port_direction(self) -> TapiCommonPortDirection: + """Gets the connection_port_direction of this TapiConnectivityConnectionEndPoint. + + + :return: The connection_port_direction of this TapiConnectivityConnectionEndPoint. + :rtype: TapiCommonPortDirection + """ + return self._connection_port_direction + + @connection_port_direction.setter + def connection_port_direction(self, connection_port_direction: TapiCommonPortDirection): + """Sets the connection_port_direction of this TapiConnectivityConnectionEndPoint. + + + :param connection_port_direction: The connection_port_direction of this TapiConnectivityConnectionEndPoint. + :type connection_port_direction: TapiCommonPortDirection + """ + + self._connection_port_direction = connection_port_direction diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_end_point_ref.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_end_point_ref.py new file mode 100644 index 0000000000000000000000000000000000000000..5427e65c842e923a7d0ee5980c3fc50b5476ff31 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_end_point_ref.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_node_edge_point_ref import TapiTopologyNodeEdgePointRef # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityConnectionEndPointRef(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, node_edge_point_uuid: str=None, connection_end_point_uuid: str=None): # noqa: E501 + """TapiConnectivityConnectionEndPointRef - a model defined in Swagger + + :param node_edge_point_uuid: The node_edge_point_uuid of this TapiConnectivityConnectionEndPointRef. # noqa: E501 + :type node_edge_point_uuid: str + :param connection_end_point_uuid: The connection_end_point_uuid of this TapiConnectivityConnectionEndPointRef. # noqa: E501 + :type connection_end_point_uuid: str + """ + self.swagger_types = { + 'node_edge_point_uuid': str, + 'connection_end_point_uuid': str + } + + self.attribute_map = { + 'node_edge_point_uuid': 'node-edge-point-uuid', + 'connection_end_point_uuid': 'connection-end-point-uuid' + } + self._node_edge_point_uuid = node_edge_point_uuid + self._connection_end_point_uuid = connection_end_point_uuid + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityConnectionEndPointRef': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ConnectionEndPointRef of this TapiConnectivityConnectionEndPointRef. # noqa: E501 + :rtype: TapiConnectivityConnectionEndPointRef + """ + return util.deserialize_model(dikt, cls) + + @property + def node_edge_point_uuid(self) -> str: + """Gets the node_edge_point_uuid of this TapiConnectivityConnectionEndPointRef. + + none # noqa: E501 + + :return: The node_edge_point_uuid of this TapiConnectivityConnectionEndPointRef. + :rtype: str + """ + return self._node_edge_point_uuid + + @node_edge_point_uuid.setter + def node_edge_point_uuid(self, node_edge_point_uuid: str): + """Sets the node_edge_point_uuid of this TapiConnectivityConnectionEndPointRef. + + none # noqa: E501 + + :param node_edge_point_uuid: The node_edge_point_uuid of this TapiConnectivityConnectionEndPointRef. + :type node_edge_point_uuid: str + """ + + self._node_edge_point_uuid = node_edge_point_uuid + + @property + def connection_end_point_uuid(self) -> str: + """Gets the connection_end_point_uuid of this TapiConnectivityConnectionEndPointRef. + + none # noqa: E501 + + :return: The connection_end_point_uuid of this TapiConnectivityConnectionEndPointRef. + :rtype: str + """ + return self._connection_end_point_uuid + + @connection_end_point_uuid.setter + def connection_end_point_uuid(self, connection_end_point_uuid: str): + """Sets the connection_end_point_uuid of this TapiConnectivityConnectionEndPointRef. + + none # noqa: E501 + + :param connection_end_point_uuid: The connection_end_point_uuid of this TapiConnectivityConnectionEndPointRef. + :type connection_end_point_uuid: str + """ + + self._connection_end_point_uuid = connection_end_point_uuid diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_end_point_ref_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_end_point_ref_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..11fe0103da2145d4f07c1a0f0bd6ae951b214cd1 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_end_point_ref_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connection_end_point_ref import TapiConnectivityConnectionEndPointRef # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityConnectionEndPointRefWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, connection_end_point: TapiConnectivityConnectionEndPointRef=None): # noqa: E501 + """TapiConnectivityConnectionEndPointRefWrapper - a model defined in Swagger + + :param connection_end_point: The connection_end_point of this TapiConnectivityConnectionEndPointRefWrapper. # noqa: E501 + :type connection_end_point: TapiConnectivityConnectionEndPointRef + """ + self.swagger_types = { + 'connection_end_point': TapiConnectivityConnectionEndPointRef + } + + self.attribute_map = { + 'connection_end_point': 'connection-end-point' + } + self._connection_end_point = connection_end_point + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityConnectionEndPointRefWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ConnectionEndPointRefWrapper of this TapiConnectivityConnectionEndPointRefWrapper. # noqa: E501 + :rtype: TapiConnectivityConnectionEndPointRefWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def connection_end_point(self) -> TapiConnectivityConnectionEndPointRef: + """Gets the connection_end_point of this TapiConnectivityConnectionEndPointRefWrapper. + + + :return: The connection_end_point of this TapiConnectivityConnectionEndPointRefWrapper. + :rtype: TapiConnectivityConnectionEndPointRef + """ + return self._connection_end_point + + @connection_end_point.setter + def connection_end_point(self, connection_end_point: TapiConnectivityConnectionEndPointRef): + """Sets the connection_end_point of this TapiConnectivityConnectionEndPointRefWrapper. + + + :param connection_end_point: The connection_end_point of this TapiConnectivityConnectionEndPointRefWrapper. + :type connection_end_point: TapiConnectivityConnectionEndPointRef + """ + + self._connection_end_point = connection_end_point diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_end_point_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_end_point_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..fd2655643793a6400eae6a43b3175d226b031247 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_end_point_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connection_end_point import TapiConnectivityConnectionEndPoint # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityConnectionEndPointWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, connection_end_point: TapiConnectivityConnectionEndPoint=None): # noqa: E501 + """TapiConnectivityConnectionEndPointWrapper - a model defined in Swagger + + :param connection_end_point: The connection_end_point of this TapiConnectivityConnectionEndPointWrapper. # noqa: E501 + :type connection_end_point: TapiConnectivityConnectionEndPoint + """ + self.swagger_types = { + 'connection_end_point': TapiConnectivityConnectionEndPoint + } + + self.attribute_map = { + 'connection_end_point': 'connection-end-point' + } + self._connection_end_point = connection_end_point + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityConnectionEndPointWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ConnectionEndPointWrapper of this TapiConnectivityConnectionEndPointWrapper. # noqa: E501 + :rtype: TapiConnectivityConnectionEndPointWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def connection_end_point(self) -> TapiConnectivityConnectionEndPoint: + """Gets the connection_end_point of this TapiConnectivityConnectionEndPointWrapper. + + + :return: The connection_end_point of this TapiConnectivityConnectionEndPointWrapper. + :rtype: TapiConnectivityConnectionEndPoint + """ + return self._connection_end_point + + @connection_end_point.setter + def connection_end_point(self, connection_end_point: TapiConnectivityConnectionEndPoint): + """Sets the connection_end_point of this TapiConnectivityConnectionEndPointWrapper. + + + :param connection_end_point: The connection_end_point of this TapiConnectivityConnectionEndPointWrapper. + :type connection_end_point: TapiConnectivityConnectionEndPoint + """ + + self._connection_end_point = connection_end_point diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_ref.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_ref.py new file mode 100644 index 0000000000000000000000000000000000000000..80d2e90e40819da52be9d209cb6a68467eca88db --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_ref.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiConnectivityConnectionRef(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, connection_uuid: str=None): # noqa: E501 + """TapiConnectivityConnectionRef - a model defined in Swagger + + :param connection_uuid: The connection_uuid of this TapiConnectivityConnectionRef. # noqa: E501 + :type connection_uuid: str + """ + self.swagger_types = { + 'connection_uuid': str + } + + self.attribute_map = { + 'connection_uuid': 'connection-uuid' + } + self._connection_uuid = connection_uuid + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityConnectionRef': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ConnectionRef of this TapiConnectivityConnectionRef. # noqa: E501 + :rtype: TapiConnectivityConnectionRef + """ + return util.deserialize_model(dikt, cls) + + @property + def connection_uuid(self) -> str: + """Gets the connection_uuid of this TapiConnectivityConnectionRef. + + none # noqa: E501 + + :return: The connection_uuid of this TapiConnectivityConnectionRef. + :rtype: str + """ + return self._connection_uuid + + @connection_uuid.setter + def connection_uuid(self, connection_uuid: str): + """Sets the connection_uuid of this TapiConnectivityConnectionRef. + + none # noqa: E501 + + :param connection_uuid: The connection_uuid of this TapiConnectivityConnectionRef. + :type connection_uuid: str + """ + + self._connection_uuid = connection_uuid diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_ref_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_ref_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..415bfb1db5ff8286a412d428fbe8ed6e8484b549 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_ref_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connection_ref import TapiConnectivityConnectionRef # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityConnectionRefWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, lower_connection: TapiConnectivityConnectionRef=None): # noqa: E501 + """TapiConnectivityConnectionRefWrapper - a model defined in Swagger + + :param lower_connection: The lower_connection of this TapiConnectivityConnectionRefWrapper. # noqa: E501 + :type lower_connection: TapiConnectivityConnectionRef + """ + self.swagger_types = { + 'lower_connection': TapiConnectivityConnectionRef + } + + self.attribute_map = { + 'lower_connection': 'lower-connection' + } + self._lower_connection = lower_connection + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityConnectionRefWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ConnectionRefWrapper of this TapiConnectivityConnectionRefWrapper. # noqa: E501 + :rtype: TapiConnectivityConnectionRefWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def lower_connection(self) -> TapiConnectivityConnectionRef: + """Gets the lower_connection of this TapiConnectivityConnectionRefWrapper. + + + :return: The lower_connection of this TapiConnectivityConnectionRefWrapper. + :rtype: TapiConnectivityConnectionRef + """ + return self._lower_connection + + @lower_connection.setter + def lower_connection(self, lower_connection: TapiConnectivityConnectionRef): + """Sets the lower_connection of this TapiConnectivityConnectionRefWrapper. + + + :param lower_connection: The lower_connection of this TapiConnectivityConnectionRefWrapper. + :type lower_connection: TapiConnectivityConnectionRef + """ + + self._lower_connection = lower_connection diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_spec_reference.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_spec_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..9e423d754a31e5df242595e35da2f0a62a1d2b76 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_spec_reference.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiConnectivityConnectionSpecReference(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, connection_spec_name: str=None, connection_spec_id: str=None): # noqa: E501 + """TapiConnectivityConnectionSpecReference - a model defined in Swagger + + :param connection_spec_name: The connection_spec_name of this TapiConnectivityConnectionSpecReference. # noqa: E501 + :type connection_spec_name: str + :param connection_spec_id: The connection_spec_id of this TapiConnectivityConnectionSpecReference. # noqa: E501 + :type connection_spec_id: str + """ + self.swagger_types = { + 'connection_spec_name': str, + 'connection_spec_id': str + } + + self.attribute_map = { + 'connection_spec_name': 'connection-spec-name', + 'connection_spec_id': 'connection-spec-id' + } + self._connection_spec_name = connection_spec_name + self._connection_spec_id = connection_spec_id + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityConnectionSpecReference': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ConnectionSpecReference of this TapiConnectivityConnectionSpecReference. # noqa: E501 + :rtype: TapiConnectivityConnectionSpecReference + """ + return util.deserialize_model(dikt, cls) + + @property + def connection_spec_name(self) -> str: + """Gets the connection_spec_name of this TapiConnectivityConnectionSpecReference. + + The name of the connection spec. This can be used alone (with no spec reference) where there is only a paper spec. # noqa: E501 + + :return: The connection_spec_name of this TapiConnectivityConnectionSpecReference. + :rtype: str + """ + return self._connection_spec_name + + @connection_spec_name.setter + def connection_spec_name(self, connection_spec_name: str): + """Sets the connection_spec_name of this TapiConnectivityConnectionSpecReference. + + The name of the connection spec. This can be used alone (with no spec reference) where there is only a paper spec. # noqa: E501 + + :param connection_spec_name: The connection_spec_name of this TapiConnectivityConnectionSpecReference. + :type connection_spec_name: str + """ + + self._connection_spec_name = connection_spec_name + + @property + def connection_spec_id(self) -> str: + """Gets the connection_spec_id of this TapiConnectivityConnectionSpecReference. + + The reference to a formal spec. This reference need not be provided (e.g., where there is no formal machine interpretable spec for the type of connection). # noqa: E501 + + :return: The connection_spec_id of this TapiConnectivityConnectionSpecReference. + :rtype: str + """ + return self._connection_spec_id + + @connection_spec_id.setter + def connection_spec_id(self, connection_spec_id: str): + """Sets the connection_spec_id of this TapiConnectivityConnectionSpecReference. + + The reference to a formal spec. This reference need not be provided (e.g., where there is no formal machine interpretable spec for the type of connection). # noqa: E501 + + :param connection_spec_id: The connection_spec_id of this TapiConnectivityConnectionSpecReference. + :type connection_spec_id: str + """ + + self._connection_spec_id = connection_spec_id diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_spec_reference_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_spec_reference_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..877ef242826fd9a7ff5400c99b249f1f0c28d27b --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_spec_reference_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connection_spec_reference import TapiConnectivityConnectionSpecReference # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityConnectionSpecReferenceWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, connection_spec_reference: TapiConnectivityConnectionSpecReference=None): # noqa: E501 + """TapiConnectivityConnectionSpecReferenceWrapper - a model defined in Swagger + + :param connection_spec_reference: The connection_spec_reference of this TapiConnectivityConnectionSpecReferenceWrapper. # noqa: E501 + :type connection_spec_reference: TapiConnectivityConnectionSpecReference + """ + self.swagger_types = { + 'connection_spec_reference': TapiConnectivityConnectionSpecReference + } + + self.attribute_map = { + 'connection_spec_reference': 'connection-spec-reference' + } + self._connection_spec_reference = connection_spec_reference + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityConnectionSpecReferenceWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ConnectionSpecReferenceWrapper of this TapiConnectivityConnectionSpecReferenceWrapper. # noqa: E501 + :rtype: TapiConnectivityConnectionSpecReferenceWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def connection_spec_reference(self) -> TapiConnectivityConnectionSpecReference: + """Gets the connection_spec_reference of this TapiConnectivityConnectionSpecReferenceWrapper. + + + :return: The connection_spec_reference of this TapiConnectivityConnectionSpecReferenceWrapper. + :rtype: TapiConnectivityConnectionSpecReference + """ + return self._connection_spec_reference + + @connection_spec_reference.setter + def connection_spec_reference(self, connection_spec_reference: TapiConnectivityConnectionSpecReference): + """Sets the connection_spec_reference of this TapiConnectivityConnectionSpecReferenceWrapper. + + + :param connection_spec_reference: The connection_spec_reference of this TapiConnectivityConnectionSpecReferenceWrapper. + :type connection_spec_reference: TapiConnectivityConnectionSpecReference + """ + + self._connection_spec_reference = connection_spec_reference diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..fbdf9c64bab9a5cda5335ba481b044d75417f283 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connection_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connection import TapiConnectivityConnection # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityConnectionWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, connection: TapiConnectivityConnection=None): # noqa: E501 + """TapiConnectivityConnectionWrapper - a model defined in Swagger + + :param connection: The connection of this TapiConnectivityConnectionWrapper. # noqa: E501 + :type connection: TapiConnectivityConnection + """ + self.swagger_types = { + 'connection': TapiConnectivityConnection + } + + self.attribute_map = { + 'connection': 'connection' + } + self._connection = connection + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityConnectionWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ConnectionWrapper of this TapiConnectivityConnectionWrapper. # noqa: E501 + :rtype: TapiConnectivityConnectionWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def connection(self) -> TapiConnectivityConnection: + """Gets the connection of this TapiConnectivityConnectionWrapper. + + + :return: The connection of this TapiConnectivityConnectionWrapper. + :rtype: TapiConnectivityConnection + """ + return self._connection + + @connection.setter + def connection(self, connection: TapiConnectivityConnection): + """Sets the connection of this TapiConnectivityConnectionWrapper. + + + :param connection: The connection of this TapiConnectivityConnectionWrapper. + :type connection: TapiConnectivityConnection + """ + + self._connection = connection diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_constraint.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_constraint.py new file mode 100644 index 0000000000000000000000000000000000000000..bd3a88a780b8b533e280bd813bf6910cb6269c4a --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_constraint.py @@ -0,0 +1,310 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_capacity import TapiCommonCapacity # noqa: F401,E501 +from tapi_server.models.tapi_common_forwarding_direction import TapiCommonForwardingDirection # noqa: F401,E501 +from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501 +from tapi_server.models.tapi_common_time_range import TapiCommonTimeRange # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_connectivity_service_ref import TapiConnectivityConnectivityServiceRef # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_service_type import TapiConnectivityServiceType # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityConnectivityConstraint(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, service_layer: TapiCommonLayerProtocolName=None, schedule: TapiCommonTimeRange=None, connectivity_direction: TapiCommonForwardingDirection=None, requested_capacity: TapiCommonCapacity=None, diversity_exclusion: List[TapiConnectivityConnectivityServiceRef]=None, connection_inclusion: List[str]=None, service_level: str=None, service_type: TapiConnectivityServiceType=None, connection_exclusion: List[str]=None, coroute_inclusion: TapiConnectivityConnectivityServiceRef=None): # noqa: E501 + """TapiConnectivityConnectivityConstraint - a model defined in Swagger + + :param service_layer: The service_layer of this TapiConnectivityConnectivityConstraint. # noqa: E501 + :type service_layer: TapiCommonLayerProtocolName + :param schedule: The schedule of this TapiConnectivityConnectivityConstraint. # noqa: E501 + :type schedule: TapiCommonTimeRange + :param connectivity_direction: The connectivity_direction of this TapiConnectivityConnectivityConstraint. # noqa: E501 + :type connectivity_direction: TapiCommonForwardingDirection + :param requested_capacity: The requested_capacity of this TapiConnectivityConnectivityConstraint. # noqa: E501 + :type requested_capacity: TapiCommonCapacity + :param diversity_exclusion: The diversity_exclusion of this TapiConnectivityConnectivityConstraint. # noqa: E501 + :type diversity_exclusion: List[TapiConnectivityConnectivityServiceRef] + :param connection_inclusion: The connection_inclusion of this TapiConnectivityConnectivityConstraint. # noqa: E501 + :type connection_inclusion: List[str] + :param service_level: The service_level of this TapiConnectivityConnectivityConstraint. # noqa: E501 + :type service_level: str + :param service_type: The service_type of this TapiConnectivityConnectivityConstraint. # noqa: E501 + :type service_type: TapiConnectivityServiceType + :param connection_exclusion: The connection_exclusion of this TapiConnectivityConnectivityConstraint. # noqa: E501 + :type connection_exclusion: List[str] + :param coroute_inclusion: The coroute_inclusion of this TapiConnectivityConnectivityConstraint. # noqa: E501 + :type coroute_inclusion: TapiConnectivityConnectivityServiceRef + """ + self.swagger_types = { + 'service_layer': TapiCommonLayerProtocolName, + 'schedule': TapiCommonTimeRange, + 'connectivity_direction': TapiCommonForwardingDirection, + 'requested_capacity': TapiCommonCapacity, + 'diversity_exclusion': List[TapiConnectivityConnectivityServiceRef], + 'connection_inclusion': List[str], + 'service_level': str, + 'service_type': TapiConnectivityServiceType, + 'connection_exclusion': List[str], + 'coroute_inclusion': TapiConnectivityConnectivityServiceRef + } + + self.attribute_map = { + 'service_layer': 'service-layer', + 'schedule': 'schedule', + 'connectivity_direction': 'connectivity-direction', + 'requested_capacity': 'requested-capacity', + 'diversity_exclusion': 'diversity-exclusion', + 'connection_inclusion': 'connection-inclusion', + 'service_level': 'service-level', + 'service_type': 'service-type', + 'connection_exclusion': 'connection-exclusion', + 'coroute_inclusion': 'coroute-inclusion' + } + self._service_layer = service_layer + self._schedule = schedule + self._connectivity_direction = connectivity_direction + self._requested_capacity = requested_capacity + self._diversity_exclusion = diversity_exclusion + self._connection_inclusion = connection_inclusion + self._service_level = service_level + self._service_type = service_type + self._connection_exclusion = connection_exclusion + self._coroute_inclusion = coroute_inclusion + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityConnectivityConstraint': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ConnectivityConstraint of this TapiConnectivityConnectivityConstraint. # noqa: E501 + :rtype: TapiConnectivityConnectivityConstraint + """ + return util.deserialize_model(dikt, cls) + + @property + def service_layer(self) -> TapiCommonLayerProtocolName: + """Gets the service_layer of this TapiConnectivityConnectivityConstraint. + + + :return: The service_layer of this TapiConnectivityConnectivityConstraint. + :rtype: TapiCommonLayerProtocolName + """ + return self._service_layer + + @service_layer.setter + def service_layer(self, service_layer: TapiCommonLayerProtocolName): + """Sets the service_layer of this TapiConnectivityConnectivityConstraint. + + + :param service_layer: The service_layer of this TapiConnectivityConnectivityConstraint. + :type service_layer: TapiCommonLayerProtocolName + """ + + self._service_layer = service_layer + + @property + def schedule(self) -> TapiCommonTimeRange: + """Gets the schedule of this TapiConnectivityConnectivityConstraint. + + + :return: The schedule of this TapiConnectivityConnectivityConstraint. + :rtype: TapiCommonTimeRange + """ + return self._schedule + + @schedule.setter + def schedule(self, schedule: TapiCommonTimeRange): + """Sets the schedule of this TapiConnectivityConnectivityConstraint. + + + :param schedule: The schedule of this TapiConnectivityConnectivityConstraint. + :type schedule: TapiCommonTimeRange + """ + + self._schedule = schedule + + @property + def connectivity_direction(self) -> TapiCommonForwardingDirection: + """Gets the connectivity_direction of this TapiConnectivityConnectivityConstraint. + + + :return: The connectivity_direction of this TapiConnectivityConnectivityConstraint. + :rtype: TapiCommonForwardingDirection + """ + return self._connectivity_direction + + @connectivity_direction.setter + def connectivity_direction(self, connectivity_direction: TapiCommonForwardingDirection): + """Sets the connectivity_direction of this TapiConnectivityConnectivityConstraint. + + + :param connectivity_direction: The connectivity_direction of this TapiConnectivityConnectivityConstraint. + :type connectivity_direction: TapiCommonForwardingDirection + """ + + self._connectivity_direction = connectivity_direction + + @property + def requested_capacity(self) -> TapiCommonCapacity: + """Gets the requested_capacity of this TapiConnectivityConnectivityConstraint. + + + :return: The requested_capacity of this TapiConnectivityConnectivityConstraint. + :rtype: TapiCommonCapacity + """ + return self._requested_capacity + + @requested_capacity.setter + def requested_capacity(self, requested_capacity: TapiCommonCapacity): + """Sets the requested_capacity of this TapiConnectivityConnectivityConstraint. + + + :param requested_capacity: The requested_capacity of this TapiConnectivityConnectivityConstraint. + :type requested_capacity: TapiCommonCapacity + """ + + self._requested_capacity = requested_capacity + + @property + def diversity_exclusion(self) -> List[TapiConnectivityConnectivityServiceRef]: + """Gets the diversity_exclusion of this TapiConnectivityConnectivityConstraint. + + none # noqa: E501 + + :return: The diversity_exclusion of this TapiConnectivityConnectivityConstraint. + :rtype: List[TapiConnectivityConnectivityServiceRef] + """ + return self._diversity_exclusion + + @diversity_exclusion.setter + def diversity_exclusion(self, diversity_exclusion: List[TapiConnectivityConnectivityServiceRef]): + """Sets the diversity_exclusion of this TapiConnectivityConnectivityConstraint. + + none # noqa: E501 + + :param diversity_exclusion: The diversity_exclusion of this TapiConnectivityConnectivityConstraint. + :type diversity_exclusion: List[TapiConnectivityConnectivityServiceRef] + """ + + self._diversity_exclusion = diversity_exclusion + + @property + def connection_inclusion(self) -> List[str]: + """Gets the connection_inclusion of this TapiConnectivityConnectivityConstraint. + + A ConnectivityService may use one or more existing Connections. A common traditional strategy is to set up “stranded” connectivity in the core of the network as “express channels” (this is essentially a serial compound link, but can be treated as simple connections) A connection inclusion capability allows for adoption of a discovered Connections. A ConnectivityService is requested with a connection inclusion constraint that identifies a connection (or chain of connections) that is bounded by CEPs that each belong to a NEP that references a SIP that is referenced by a CSEP of the ConnectivityService such that all CSEPs are satisfied by CEPs of the existing Connection. will allow discovered Connections with no stated intent to be associated with an intent via the ConnectivityService. # noqa: E501 + + :return: The connection_inclusion of this TapiConnectivityConnectivityConstraint. + :rtype: List[str] + """ + return self._connection_inclusion + + @connection_inclusion.setter + def connection_inclusion(self, connection_inclusion: List[str]): + """Sets the connection_inclusion of this TapiConnectivityConnectivityConstraint. + + A ConnectivityService may use one or more existing Connections. A common traditional strategy is to set up “stranded” connectivity in the core of the network as “express channels” (this is essentially a serial compound link, but can be treated as simple connections) A connection inclusion capability allows for adoption of a discovered Connections. A ConnectivityService is requested with a connection inclusion constraint that identifies a connection (or chain of connections) that is bounded by CEPs that each belong to a NEP that references a SIP that is referenced by a CSEP of the ConnectivityService such that all CSEPs are satisfied by CEPs of the existing Connection. will allow discovered Connections with no stated intent to be associated with an intent via the ConnectivityService. # noqa: E501 + + :param connection_inclusion: The connection_inclusion of this TapiConnectivityConnectivityConstraint. + :type connection_inclusion: List[str] + """ + + self._connection_inclusion = connection_inclusion + + @property + def service_level(self) -> str: + """Gets the service_level of this TapiConnectivityConnectivityConstraint. + + An abstract value the meaning of which is mutually agreed – typically represents metrics such as - Class of service, priority, resiliency, availability # noqa: E501 + + :return: The service_level of this TapiConnectivityConnectivityConstraint. + :rtype: str + """ + return self._service_level + + @service_level.setter + def service_level(self, service_level: str): + """Sets the service_level of this TapiConnectivityConnectivityConstraint. + + An abstract value the meaning of which is mutually agreed – typically represents metrics such as - Class of service, priority, resiliency, availability # noqa: E501 + + :param service_level: The service_level of this TapiConnectivityConnectivityConstraint. + :type service_level: str + """ + + self._service_level = service_level + + @property + def service_type(self) -> TapiConnectivityServiceType: + """Gets the service_type of this TapiConnectivityConnectivityConstraint. + + + :return: The service_type of this TapiConnectivityConnectivityConstraint. + :rtype: TapiConnectivityServiceType + """ + return self._service_type + + @service_type.setter + def service_type(self, service_type: TapiConnectivityServiceType): + """Sets the service_type of this TapiConnectivityConnectivityConstraint. + + + :param service_type: The service_type of this TapiConnectivityConnectivityConstraint. + :type service_type: TapiConnectivityServiceType + """ + + self._service_type = service_type + + @property + def connection_exclusion(self) -> List[str]: + """Gets the connection_exclusion of this TapiConnectivityConnectivityConstraint. + + none # noqa: E501 + + :return: The connection_exclusion of this TapiConnectivityConnectivityConstraint. + :rtype: List[str] + """ + return self._connection_exclusion + + @connection_exclusion.setter + def connection_exclusion(self, connection_exclusion: List[str]): + """Sets the connection_exclusion of this TapiConnectivityConnectivityConstraint. + + none # noqa: E501 + + :param connection_exclusion: The connection_exclusion of this TapiConnectivityConnectivityConstraint. + :type connection_exclusion: List[str] + """ + + self._connection_exclusion = connection_exclusion + + @property + def coroute_inclusion(self) -> TapiConnectivityConnectivityServiceRef: + """Gets the coroute_inclusion of this TapiConnectivityConnectivityConstraint. + + + :return: The coroute_inclusion of this TapiConnectivityConnectivityConstraint. + :rtype: TapiConnectivityConnectivityServiceRef + """ + return self._coroute_inclusion + + @coroute_inclusion.setter + def coroute_inclusion(self, coroute_inclusion: TapiConnectivityConnectivityServiceRef): + """Sets the coroute_inclusion of this TapiConnectivityConnectivityConstraint. + + + :param coroute_inclusion: The coroute_inclusion of this TapiConnectivityConnectivityConstraint. + :type coroute_inclusion: TapiConnectivityConnectivityServiceRef + """ + + self._coroute_inclusion = coroute_inclusion diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_context.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_context.py new file mode 100644 index 0000000000000000000000000000000000000000..2d2bc5119df6540d5264a956465e442669e1a5d2 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_context.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connection import TapiConnectivityConnection # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_connectivity_service import TapiConnectivityConnectivityService # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityConnectivityContext(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, connectivity_service: List[TapiConnectivityConnectivityService]=None, connection: List[TapiConnectivityConnection]=None): # noqa: E501 + """TapiConnectivityConnectivityContext - a model defined in Swagger + + :param connectivity_service: The connectivity_service of this TapiConnectivityConnectivityContext. # noqa: E501 + :type connectivity_service: List[TapiConnectivityConnectivityService] + :param connection: The connection of this TapiConnectivityConnectivityContext. # noqa: E501 + :type connection: List[TapiConnectivityConnection] + """ + self.swagger_types = { + 'connectivity_service': List[TapiConnectivityConnectivityService], + 'connection': List[TapiConnectivityConnection] + } + + self.attribute_map = { + 'connectivity_service': 'connectivity-service', + 'connection': 'connection' + } + self._connectivity_service = connectivity_service + self._connection = connection + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityConnectivityContext': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ConnectivityContext of this TapiConnectivityConnectivityContext. # noqa: E501 + :rtype: TapiConnectivityConnectivityContext + """ + return util.deserialize_model(dikt, cls) + + @property + def connectivity_service(self) -> List[TapiConnectivityConnectivityService]: + """Gets the connectivity_service of this TapiConnectivityConnectivityContext. + + none # noqa: E501 + + :return: The connectivity_service of this TapiConnectivityConnectivityContext. + :rtype: List[TapiConnectivityConnectivityService] + """ + return self._connectivity_service + + @connectivity_service.setter + def connectivity_service(self, connectivity_service: List[TapiConnectivityConnectivityService]): + """Sets the connectivity_service of this TapiConnectivityConnectivityContext. + + none # noqa: E501 + + :param connectivity_service: The connectivity_service of this TapiConnectivityConnectivityContext. + :type connectivity_service: List[TapiConnectivityConnectivityService] + """ + + self._connectivity_service = connectivity_service + + @property + def connection(self) -> List[TapiConnectivityConnection]: + """Gets the connection of this TapiConnectivityConnectivityContext. + + none # noqa: E501 + + :return: The connection of this TapiConnectivityConnectivityContext. + :rtype: List[TapiConnectivityConnection] + """ + return self._connection + + @connection.setter + def connection(self, connection: List[TapiConnectivityConnection]): + """Sets the connection of this TapiConnectivityConnectivityContext. + + none # noqa: E501 + + :param connection: The connection of this TapiConnectivityConnectivityContext. + :type connection: List[TapiConnectivityConnection] + """ + + self._connection = connection diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_context_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_context_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..f13e4ceddaa31a405eaa0e0b4e1d028bf0d7166a --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_context_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connectivity_context import TapiConnectivityConnectivityContext # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityConnectivityContextWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, tapi_connectivityconnectivity_context: TapiConnectivityConnectivityContext=None): # noqa: E501 + """TapiConnectivityConnectivityContextWrapper - a model defined in Swagger + + :param tapi_connectivityconnectivity_context: The tapi_connectivityconnectivity_context of this TapiConnectivityConnectivityContextWrapper. # noqa: E501 + :type tapi_connectivityconnectivity_context: TapiConnectivityConnectivityContext + """ + self.swagger_types = { + 'tapi_connectivityconnectivity_context': TapiConnectivityConnectivityContext + } + + self.attribute_map = { + 'tapi_connectivityconnectivity_context': 'tapi-connectivity:connectivity-context' + } + self._tapi_connectivityconnectivity_context = tapi_connectivityconnectivity_context + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityConnectivityContextWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ConnectivityContextWrapper of this TapiConnectivityConnectivityContextWrapper. # noqa: E501 + :rtype: TapiConnectivityConnectivityContextWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def tapi_connectivityconnectivity_context(self) -> TapiConnectivityConnectivityContext: + """Gets the tapi_connectivityconnectivity_context of this TapiConnectivityConnectivityContextWrapper. + + + :return: The tapi_connectivityconnectivity_context of this TapiConnectivityConnectivityContextWrapper. + :rtype: TapiConnectivityConnectivityContext + """ + return self._tapi_connectivityconnectivity_context + + @tapi_connectivityconnectivity_context.setter + def tapi_connectivityconnectivity_context(self, tapi_connectivityconnectivity_context: TapiConnectivityConnectivityContext): + """Sets the tapi_connectivityconnectivity_context of this TapiConnectivityConnectivityContextWrapper. + + + :param tapi_connectivityconnectivity_context: The tapi_connectivityconnectivity_context of this TapiConnectivityConnectivityContextWrapper. + :type tapi_connectivityconnectivity_context: TapiConnectivityConnectivityContext + """ + + self._tapi_connectivityconnectivity_context = tapi_connectivityconnectivity_context diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service.py new file mode 100644 index 0000000000000000000000000000000000000000..7d913435c2bd40b8bf5fbf9e652c991cd5f8ee4f --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service.py @@ -0,0 +1,1343 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_admin_state_pac import TapiCommonAdminStatePac # noqa: F401,E501 +from tapi_server.models.tapi_common_administrative_state import TapiCommonAdministrativeState # noqa: F401,E501 +from tapi_server.models.tapi_common_capacity import TapiCommonCapacity # noqa: F401,E501 +from tapi_server.models.tapi_common_forwarding_direction import TapiCommonForwardingDirection # noqa: F401,E501 +from tapi_server.models.tapi_common_global_class import TapiCommonGlobalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501 +from tapi_server.models.tapi_common_lifecycle_state import TapiCommonLifecycleState # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_common_operational_state import TapiCommonOperationalState # noqa: F401,E501 +from tapi_server.models.tapi_common_time_range import TapiCommonTimeRange # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_connection_ref import TapiConnectivityConnectionRef # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_connectivity_constraint import TapiConnectivityConnectivityConstraint # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_connectivity_service_end_point import TapiConnectivityConnectivityServiceEndPoint # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_connectivity_service_ref import TapiConnectivityConnectivityServiceRef # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_coordinate_type import TapiConnectivityCoordinateType # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_resilience_constraint import TapiConnectivityResilienceConstraint # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_reversion_mode import TapiConnectivityReversionMode # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_service_type import TapiConnectivityServiceType # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_diversity_policy import TapiPathComputationDiversityPolicy # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_route_objective_function import TapiPathComputationRouteObjectiveFunction # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_routing_constraint import TapiPathComputationRoutingConstraint # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_topology_constraint import TapiPathComputationTopologyConstraint # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_value_or_priority import TapiPathComputationValueOrPriority # noqa: F401,E501 +from tapi_server.models.tapi_topology_cost_characteristic import TapiTopologyCostCharacteristic # noqa: F401,E501 +from tapi_server.models.tapi_topology_latency_characteristic import TapiTopologyLatencyCharacteristic # noqa: F401,E501 +from tapi_server.models.tapi_topology_resilience_type import TapiTopologyResilienceType # noqa: F401,E501 +from tapi_server.models.tapi_topology_risk_characteristic import TapiTopologyRiskCharacteristic # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityConnectivityService(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: List[TapiCommonNameAndValue]=None, uuid: str=None, service_layer: TapiCommonLayerProtocolName=None, schedule: TapiCommonTimeRange=None, connectivity_direction: TapiCommonForwardingDirection=None, requested_capacity: TapiCommonCapacity=None, diversity_exclusion: List[TapiConnectivityConnectivityServiceRef]=None, connection_inclusion: List[str]=None, service_level: str=None, service_type: TapiConnectivityServiceType=None, connection_exclusion: List[str]=None, coroute_inclusion: TapiConnectivityConnectivityServiceRef=None, is_lock_out: bool=False, max_switch_times: int=None, restoration_coordinate_type: TapiConnectivityCoordinateType=None, is_coordinated_switching_both_ends: bool=False, hold_off_time: int=None, is_frozen: bool=False, wait_to_revert_time: int=15, resilience_type: TapiTopologyResilienceType=None, preferred_restoration_layer: List[TapiCommonLayerProtocolName]=None, restore_priority: int=None, reversion_mode: TapiConnectivityReversionMode=None, is_exclusive: bool=True, max_allowed_cost: TapiPathComputationValueOrPriority=None, diversity_policy: TapiPathComputationDiversityPolicy=None, route_objective_function: TapiPathComputationRouteObjectiveFunction=None, cost_characteristic: List[TapiTopologyCostCharacteristic]=None, max_allowed_hops: TapiPathComputationValueOrPriority=None, max_allowed_delay: TapiPathComputationValueOrPriority=None, latency_characteristic: List[TapiTopologyLatencyCharacteristic]=None, risk_diversity_characteristic: List[TapiTopologyRiskCharacteristic]=None, route_direction: TapiCommonForwardingDirection=None, include_node: List[str]=None, exclude_link: List[str]=None, avoid_topology: List[str]=None, exclude_path: List[str]=None, include_link: List[str]=None, preferred_transport_layer: List[TapiCommonLayerProtocolName]=None, exclude_node: List[str]=None, include_topology: List[str]=None, include_path: List[str]=None, operational_state: TapiCommonOperationalState=None, lifecycle_state: TapiCommonLifecycleState=None, administrative_state: TapiCommonAdministrativeState=None, end_point: List[TapiConnectivityConnectivityServiceEndPoint]=None, connection: List[TapiConnectivityConnectionRef]=None): # noqa: E501 + """TapiConnectivityConnectivityService - a model defined in Swagger + + :param name: The name of this TapiConnectivityConnectivityService. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param uuid: The uuid of this TapiConnectivityConnectivityService. # noqa: E501 + :type uuid: str + :param service_layer: The service_layer of this TapiConnectivityConnectivityService. # noqa: E501 + :type service_layer: TapiCommonLayerProtocolName + :param schedule: The schedule of this TapiConnectivityConnectivityService. # noqa: E501 + :type schedule: TapiCommonTimeRange + :param connectivity_direction: The connectivity_direction of this TapiConnectivityConnectivityService. # noqa: E501 + :type connectivity_direction: TapiCommonForwardingDirection + :param requested_capacity: The requested_capacity of this TapiConnectivityConnectivityService. # noqa: E501 + :type requested_capacity: TapiCommonCapacity + :param diversity_exclusion: The diversity_exclusion of this TapiConnectivityConnectivityService. # noqa: E501 + :type diversity_exclusion: List[TapiConnectivityConnectivityServiceRef] + :param connection_inclusion: The connection_inclusion of this TapiConnectivityConnectivityService. # noqa: E501 + :type connection_inclusion: List[str] + :param service_level: The service_level of this TapiConnectivityConnectivityService. # noqa: E501 + :type service_level: str + :param service_type: The service_type of this TapiConnectivityConnectivityService. # noqa: E501 + :type service_type: TapiConnectivityServiceType + :param connection_exclusion: The connection_exclusion of this TapiConnectivityConnectivityService. # noqa: E501 + :type connection_exclusion: List[str] + :param coroute_inclusion: The coroute_inclusion of this TapiConnectivityConnectivityService. # noqa: E501 + :type coroute_inclusion: TapiConnectivityConnectivityServiceRef + :param is_lock_out: The is_lock_out of this TapiConnectivityConnectivityService. # noqa: E501 + :type is_lock_out: bool + :param max_switch_times: The max_switch_times of this TapiConnectivityConnectivityService. # noqa: E501 + :type max_switch_times: int + :param restoration_coordinate_type: The restoration_coordinate_type of this TapiConnectivityConnectivityService. # noqa: E501 + :type restoration_coordinate_type: TapiConnectivityCoordinateType + :param is_coordinated_switching_both_ends: The is_coordinated_switching_both_ends of this TapiConnectivityConnectivityService. # noqa: E501 + :type is_coordinated_switching_both_ends: bool + :param hold_off_time: The hold_off_time of this TapiConnectivityConnectivityService. # noqa: E501 + :type hold_off_time: int + :param is_frozen: The is_frozen of this TapiConnectivityConnectivityService. # noqa: E501 + :type is_frozen: bool + :param wait_to_revert_time: The wait_to_revert_time of this TapiConnectivityConnectivityService. # noqa: E501 + :type wait_to_revert_time: int + :param resilience_type: The resilience_type of this TapiConnectivityConnectivityService. # noqa: E501 + :type resilience_type: TapiTopologyResilienceType + :param preferred_restoration_layer: The preferred_restoration_layer of this TapiConnectivityConnectivityService. # noqa: E501 + :type preferred_restoration_layer: List[TapiCommonLayerProtocolName] + :param restore_priority: The restore_priority of this TapiConnectivityConnectivityService. # noqa: E501 + :type restore_priority: int + :param reversion_mode: The reversion_mode of this TapiConnectivityConnectivityService. # noqa: E501 + :type reversion_mode: TapiConnectivityReversionMode + :param is_exclusive: The is_exclusive of this TapiConnectivityConnectivityService. # noqa: E501 + :type is_exclusive: bool + :param max_allowed_cost: The max_allowed_cost of this TapiConnectivityConnectivityService. # noqa: E501 + :type max_allowed_cost: TapiPathComputationValueOrPriority + :param diversity_policy: The diversity_policy of this TapiConnectivityConnectivityService. # noqa: E501 + :type diversity_policy: TapiPathComputationDiversityPolicy + :param route_objective_function: The route_objective_function of this TapiConnectivityConnectivityService. # noqa: E501 + :type route_objective_function: TapiPathComputationRouteObjectiveFunction + :param cost_characteristic: The cost_characteristic of this TapiConnectivityConnectivityService. # noqa: E501 + :type cost_characteristic: List[TapiTopologyCostCharacteristic] + :param max_allowed_hops: The max_allowed_hops of this TapiConnectivityConnectivityService. # noqa: E501 + :type max_allowed_hops: TapiPathComputationValueOrPriority + :param max_allowed_delay: The max_allowed_delay of this TapiConnectivityConnectivityService. # noqa: E501 + :type max_allowed_delay: TapiPathComputationValueOrPriority + :param latency_characteristic: The latency_characteristic of this TapiConnectivityConnectivityService. # noqa: E501 + :type latency_characteristic: List[TapiTopologyLatencyCharacteristic] + :param risk_diversity_characteristic: The risk_diversity_characteristic of this TapiConnectivityConnectivityService. # noqa: E501 + :type risk_diversity_characteristic: List[TapiTopologyRiskCharacteristic] + :param route_direction: The route_direction of this TapiConnectivityConnectivityService. # noqa: E501 + :type route_direction: TapiCommonForwardingDirection + :param include_node: The include_node of this TapiConnectivityConnectivityService. # noqa: E501 + :type include_node: List[str] + :param exclude_link: The exclude_link of this TapiConnectivityConnectivityService. # noqa: E501 + :type exclude_link: List[str] + :param avoid_topology: The avoid_topology of this TapiConnectivityConnectivityService. # noqa: E501 + :type avoid_topology: List[str] + :param exclude_path: The exclude_path of this TapiConnectivityConnectivityService. # noqa: E501 + :type exclude_path: List[str] + :param include_link: The include_link of this TapiConnectivityConnectivityService. # noqa: E501 + :type include_link: List[str] + :param preferred_transport_layer: The preferred_transport_layer of this TapiConnectivityConnectivityService. # noqa: E501 + :type preferred_transport_layer: List[TapiCommonLayerProtocolName] + :param exclude_node: The exclude_node of this TapiConnectivityConnectivityService. # noqa: E501 + :type exclude_node: List[str] + :param include_topology: The include_topology of this TapiConnectivityConnectivityService. # noqa: E501 + :type include_topology: List[str] + :param include_path: The include_path of this TapiConnectivityConnectivityService. # noqa: E501 + :type include_path: List[str] + :param operational_state: The operational_state of this TapiConnectivityConnectivityService. # noqa: E501 + :type operational_state: TapiCommonOperationalState + :param lifecycle_state: The lifecycle_state of this TapiConnectivityConnectivityService. # noqa: E501 + :type lifecycle_state: TapiCommonLifecycleState + :param administrative_state: The administrative_state of this TapiConnectivityConnectivityService. # noqa: E501 + :type administrative_state: TapiCommonAdministrativeState + :param end_point: The end_point of this TapiConnectivityConnectivityService. # noqa: E501 + :type end_point: List[TapiConnectivityConnectivityServiceEndPoint] + :param connection: The connection of this TapiConnectivityConnectivityService. # noqa: E501 + :type connection: List[TapiConnectivityConnectionRef] + """ + self.swagger_types = { + 'name': List[TapiCommonNameAndValue], + 'uuid': str, + 'service_layer': TapiCommonLayerProtocolName, + 'schedule': TapiCommonTimeRange, + 'connectivity_direction': TapiCommonForwardingDirection, + 'requested_capacity': TapiCommonCapacity, + 'diversity_exclusion': List[TapiConnectivityConnectivityServiceRef], + 'connection_inclusion': List[str], + 'service_level': str, + 'service_type': TapiConnectivityServiceType, + 'connection_exclusion': List[str], + 'coroute_inclusion': TapiConnectivityConnectivityServiceRef, + 'is_lock_out': bool, + 'max_switch_times': int, + 'restoration_coordinate_type': TapiConnectivityCoordinateType, + 'is_coordinated_switching_both_ends': bool, + 'hold_off_time': int, + 'is_frozen': bool, + 'wait_to_revert_time': int, + 'resilience_type': TapiTopologyResilienceType, + 'preferred_restoration_layer': List[TapiCommonLayerProtocolName], + 'restore_priority': int, + 'reversion_mode': TapiConnectivityReversionMode, + 'is_exclusive': bool, + 'max_allowed_cost': TapiPathComputationValueOrPriority, + 'diversity_policy': TapiPathComputationDiversityPolicy, + 'route_objective_function': TapiPathComputationRouteObjectiveFunction, + 'cost_characteristic': List[TapiTopologyCostCharacteristic], + 'max_allowed_hops': TapiPathComputationValueOrPriority, + 'max_allowed_delay': TapiPathComputationValueOrPriority, + 'latency_characteristic': List[TapiTopologyLatencyCharacteristic], + 'risk_diversity_characteristic': List[TapiTopologyRiskCharacteristic], + 'route_direction': TapiCommonForwardingDirection, + 'include_node': List[str], + 'exclude_link': List[str], + 'avoid_topology': List[str], + 'exclude_path': List[str], + 'include_link': List[str], + 'preferred_transport_layer': List[TapiCommonLayerProtocolName], + 'exclude_node': List[str], + 'include_topology': List[str], + 'include_path': List[str], + 'operational_state': TapiCommonOperationalState, + 'lifecycle_state': TapiCommonLifecycleState, + 'administrative_state': TapiCommonAdministrativeState, + 'end_point': List[TapiConnectivityConnectivityServiceEndPoint], + 'connection': List[TapiConnectivityConnectionRef] + } + + self.attribute_map = { + 'name': 'name', + 'uuid': 'uuid', + 'service_layer': 'service-layer', + 'schedule': 'schedule', + 'connectivity_direction': 'connectivity-direction', + 'requested_capacity': 'requested-capacity', + 'diversity_exclusion': 'diversity-exclusion', + 'connection_inclusion': 'connection-inclusion', + 'service_level': 'service-level', + 'service_type': 'service-type', + 'connection_exclusion': 'connection-exclusion', + 'coroute_inclusion': 'coroute-inclusion', + 'is_lock_out': 'is-lock-out', + 'max_switch_times': 'max-switch-times', + 'restoration_coordinate_type': 'restoration-coordinate-type', + 'is_coordinated_switching_both_ends': 'is-coordinated-switching-both-ends', + 'hold_off_time': 'hold-off-time', + 'is_frozen': 'is-frozen', + 'wait_to_revert_time': 'wait-to-revert-time', + 'resilience_type': 'resilience-type', + 'preferred_restoration_layer': 'preferred-restoration-layer', + 'restore_priority': 'restore-priority', + 'reversion_mode': 'reversion-mode', + 'is_exclusive': 'is-exclusive', + 'max_allowed_cost': 'max-allowed-cost', + 'diversity_policy': 'diversity-policy', + 'route_objective_function': 'route-objective-function', + 'cost_characteristic': 'cost-characteristic', + 'max_allowed_hops': 'max-allowed-hops', + 'max_allowed_delay': 'max-allowed-delay', + 'latency_characteristic': 'latency-characteristic', + 'risk_diversity_characteristic': 'risk-diversity-characteristic', + 'route_direction': 'route-direction', + 'include_node': 'include-node', + 'exclude_link': 'exclude-link', + 'avoid_topology': 'avoid-topology', + 'exclude_path': 'exclude-path', + 'include_link': 'include-link', + 'preferred_transport_layer': 'preferred-transport-layer', + 'exclude_node': 'exclude-node', + 'include_topology': 'include-topology', + 'include_path': 'include-path', + 'operational_state': 'operational-state', + 'lifecycle_state': 'lifecycle-state', + 'administrative_state': 'administrative-state', + 'end_point': 'end-point', + 'connection': 'connection' + } + self._name = name + self._uuid = uuid + self._service_layer = service_layer + self._schedule = schedule + self._connectivity_direction = connectivity_direction + self._requested_capacity = requested_capacity + self._diversity_exclusion = diversity_exclusion + self._connection_inclusion = connection_inclusion + self._service_level = service_level + self._service_type = service_type + self._connection_exclusion = connection_exclusion + self._coroute_inclusion = coroute_inclusion + self._is_lock_out = is_lock_out + self._max_switch_times = max_switch_times + self._restoration_coordinate_type = restoration_coordinate_type + self._is_coordinated_switching_both_ends = is_coordinated_switching_both_ends + self._hold_off_time = hold_off_time + self._is_frozen = is_frozen + self._wait_to_revert_time = wait_to_revert_time + self._resilience_type = resilience_type + self._preferred_restoration_layer = preferred_restoration_layer + self._restore_priority = restore_priority + self._reversion_mode = reversion_mode + self._is_exclusive = is_exclusive + self._max_allowed_cost = max_allowed_cost + self._diversity_policy = diversity_policy + self._route_objective_function = route_objective_function + self._cost_characteristic = cost_characteristic + self._max_allowed_hops = max_allowed_hops + self._max_allowed_delay = max_allowed_delay + self._latency_characteristic = latency_characteristic + self._risk_diversity_characteristic = risk_diversity_characteristic + self._route_direction = route_direction + self._include_node = include_node + self._exclude_link = exclude_link + self._avoid_topology = avoid_topology + self._exclude_path = exclude_path + self._include_link = include_link + self._preferred_transport_layer = preferred_transport_layer + self._exclude_node = exclude_node + self._include_topology = include_topology + self._include_path = include_path + self._operational_state = operational_state + self._lifecycle_state = lifecycle_state + self._administrative_state = administrative_state + self._end_point = end_point + self._connection = connection + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityConnectivityService': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ConnectivityService of this TapiConnectivityConnectivityService. # noqa: E501 + :rtype: TapiConnectivityConnectivityService + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiConnectivityConnectivityService. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiConnectivityConnectivityService. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiConnectivityConnectivityService. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiConnectivityConnectivityService. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def uuid(self) -> str: + """Gets the uuid of this TapiConnectivityConnectivityService. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :return: The uuid of this TapiConnectivityConnectivityService. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid: str): + """Sets the uuid of this TapiConnectivityConnectivityService. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :param uuid: The uuid of this TapiConnectivityConnectivityService. + :type uuid: str + """ + + self._uuid = uuid + + @property + def service_layer(self) -> TapiCommonLayerProtocolName: + """Gets the service_layer of this TapiConnectivityConnectivityService. + + + :return: The service_layer of this TapiConnectivityConnectivityService. + :rtype: TapiCommonLayerProtocolName + """ + return self._service_layer + + @service_layer.setter + def service_layer(self, service_layer: TapiCommonLayerProtocolName): + """Sets the service_layer of this TapiConnectivityConnectivityService. + + + :param service_layer: The service_layer of this TapiConnectivityConnectivityService. + :type service_layer: TapiCommonLayerProtocolName + """ + + self._service_layer = service_layer + + @property + def schedule(self) -> TapiCommonTimeRange: + """Gets the schedule of this TapiConnectivityConnectivityService. + + + :return: The schedule of this TapiConnectivityConnectivityService. + :rtype: TapiCommonTimeRange + """ + return self._schedule + + @schedule.setter + def schedule(self, schedule: TapiCommonTimeRange): + """Sets the schedule of this TapiConnectivityConnectivityService. + + + :param schedule: The schedule of this TapiConnectivityConnectivityService. + :type schedule: TapiCommonTimeRange + """ + + self._schedule = schedule + + @property + def connectivity_direction(self) -> TapiCommonForwardingDirection: + """Gets the connectivity_direction of this TapiConnectivityConnectivityService. + + + :return: The connectivity_direction of this TapiConnectivityConnectivityService. + :rtype: TapiCommonForwardingDirection + """ + return self._connectivity_direction + + @connectivity_direction.setter + def connectivity_direction(self, connectivity_direction: TapiCommonForwardingDirection): + """Sets the connectivity_direction of this TapiConnectivityConnectivityService. + + + :param connectivity_direction: The connectivity_direction of this TapiConnectivityConnectivityService. + :type connectivity_direction: TapiCommonForwardingDirection + """ + + self._connectivity_direction = connectivity_direction + + @property + def requested_capacity(self) -> TapiCommonCapacity: + """Gets the requested_capacity of this TapiConnectivityConnectivityService. + + + :return: The requested_capacity of this TapiConnectivityConnectivityService. + :rtype: TapiCommonCapacity + """ + return self._requested_capacity + + @requested_capacity.setter + def requested_capacity(self, requested_capacity: TapiCommonCapacity): + """Sets the requested_capacity of this TapiConnectivityConnectivityService. + + + :param requested_capacity: The requested_capacity of this TapiConnectivityConnectivityService. + :type requested_capacity: TapiCommonCapacity + """ + + self._requested_capacity = requested_capacity + + @property + def diversity_exclusion(self) -> List[TapiConnectivityConnectivityServiceRef]: + """Gets the diversity_exclusion of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :return: The diversity_exclusion of this TapiConnectivityConnectivityService. + :rtype: List[TapiConnectivityConnectivityServiceRef] + """ + return self._diversity_exclusion + + @diversity_exclusion.setter + def diversity_exclusion(self, diversity_exclusion: List[TapiConnectivityConnectivityServiceRef]): + """Sets the diversity_exclusion of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :param diversity_exclusion: The diversity_exclusion of this TapiConnectivityConnectivityService. + :type diversity_exclusion: List[TapiConnectivityConnectivityServiceRef] + """ + + self._diversity_exclusion = diversity_exclusion + + @property + def connection_inclusion(self) -> List[str]: + """Gets the connection_inclusion of this TapiConnectivityConnectivityService. + + A ConnectivityService may use one or more existing Connections. A common traditional strategy is to set up “stranded” connectivity in the core of the network as “express channels” (this is essentially a serial compound link, but can be treated as simple connections) A connection inclusion capability allows for adoption of a discovered Connections. A ConnectivityService is requested with a connection inclusion constraint that identifies a connection (or chain of connections) that is bounded by CEPs that each belong to a NEP that references a SIP that is referenced by a CSEP of the ConnectivityService such that all CSEPs are satisfied by CEPs of the existing Connection. will allow discovered Connections with no stated intent to be associated with an intent via the ConnectivityService. # noqa: E501 + + :return: The connection_inclusion of this TapiConnectivityConnectivityService. + :rtype: List[str] + """ + return self._connection_inclusion + + @connection_inclusion.setter + def connection_inclusion(self, connection_inclusion: List[str]): + """Sets the connection_inclusion of this TapiConnectivityConnectivityService. + + A ConnectivityService may use one or more existing Connections. A common traditional strategy is to set up “stranded” connectivity in the core of the network as “express channels” (this is essentially a serial compound link, but can be treated as simple connections) A connection inclusion capability allows for adoption of a discovered Connections. A ConnectivityService is requested with a connection inclusion constraint that identifies a connection (or chain of connections) that is bounded by CEPs that each belong to a NEP that references a SIP that is referenced by a CSEP of the ConnectivityService such that all CSEPs are satisfied by CEPs of the existing Connection. will allow discovered Connections with no stated intent to be associated with an intent via the ConnectivityService. # noqa: E501 + + :param connection_inclusion: The connection_inclusion of this TapiConnectivityConnectivityService. + :type connection_inclusion: List[str] + """ + + self._connection_inclusion = connection_inclusion + + @property + def service_level(self) -> str: + """Gets the service_level of this TapiConnectivityConnectivityService. + + An abstract value the meaning of which is mutually agreed – typically represents metrics such as - Class of service, priority, resiliency, availability # noqa: E501 + + :return: The service_level of this TapiConnectivityConnectivityService. + :rtype: str + """ + return self._service_level + + @service_level.setter + def service_level(self, service_level: str): + """Sets the service_level of this TapiConnectivityConnectivityService. + + An abstract value the meaning of which is mutually agreed – typically represents metrics such as - Class of service, priority, resiliency, availability # noqa: E501 + + :param service_level: The service_level of this TapiConnectivityConnectivityService. + :type service_level: str + """ + + self._service_level = service_level + + @property + def service_type(self) -> TapiConnectivityServiceType: + """Gets the service_type of this TapiConnectivityConnectivityService. + + + :return: The service_type of this TapiConnectivityConnectivityService. + :rtype: TapiConnectivityServiceType + """ + return self._service_type + + @service_type.setter + def service_type(self, service_type: TapiConnectivityServiceType): + """Sets the service_type of this TapiConnectivityConnectivityService. + + + :param service_type: The service_type of this TapiConnectivityConnectivityService. + :type service_type: TapiConnectivityServiceType + """ + + self._service_type = service_type + + @property + def connection_exclusion(self) -> List[str]: + """Gets the connection_exclusion of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :return: The connection_exclusion of this TapiConnectivityConnectivityService. + :rtype: List[str] + """ + return self._connection_exclusion + + @connection_exclusion.setter + def connection_exclusion(self, connection_exclusion: List[str]): + """Sets the connection_exclusion of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :param connection_exclusion: The connection_exclusion of this TapiConnectivityConnectivityService. + :type connection_exclusion: List[str] + """ + + self._connection_exclusion = connection_exclusion + + @property + def coroute_inclusion(self) -> TapiConnectivityConnectivityServiceRef: + """Gets the coroute_inclusion of this TapiConnectivityConnectivityService. + + + :return: The coroute_inclusion of this TapiConnectivityConnectivityService. + :rtype: TapiConnectivityConnectivityServiceRef + """ + return self._coroute_inclusion + + @coroute_inclusion.setter + def coroute_inclusion(self, coroute_inclusion: TapiConnectivityConnectivityServiceRef): + """Sets the coroute_inclusion of this TapiConnectivityConnectivityService. + + + :param coroute_inclusion: The coroute_inclusion of this TapiConnectivityConnectivityService. + :type coroute_inclusion: TapiConnectivityConnectivityServiceRef + """ + + self._coroute_inclusion = coroute_inclusion + + @property + def is_lock_out(self) -> bool: + """Gets the is_lock_out of this TapiConnectivityConnectivityService. + + The resource is configured to temporarily not be available for use in the protection scheme(s) it is part of. This overrides all other protection control states including forced. If the item is locked out then it cannot be used under any circumstances. Note: Only relevant when part of a protection scheme. # noqa: E501 + + :return: The is_lock_out of this TapiConnectivityConnectivityService. + :rtype: bool + """ + return self._is_lock_out + + @is_lock_out.setter + def is_lock_out(self, is_lock_out: bool): + """Sets the is_lock_out of this TapiConnectivityConnectivityService. + + The resource is configured to temporarily not be available for use in the protection scheme(s) it is part of. This overrides all other protection control states including forced. If the item is locked out then it cannot be used under any circumstances. Note: Only relevant when part of a protection scheme. # noqa: E501 + + :param is_lock_out: The is_lock_out of this TapiConnectivityConnectivityService. + :type is_lock_out: bool + """ + + self._is_lock_out = is_lock_out + + @property + def max_switch_times(self) -> int: + """Gets the max_switch_times of this TapiConnectivityConnectivityService. + + Used to limit the maximum swtich times. When work fault disappears , and traffic return to the original work path, switch counter reset. # noqa: E501 + + :return: The max_switch_times of this TapiConnectivityConnectivityService. + :rtype: int + """ + return self._max_switch_times + + @max_switch_times.setter + def max_switch_times(self, max_switch_times: int): + """Sets the max_switch_times of this TapiConnectivityConnectivityService. + + Used to limit the maximum swtich times. When work fault disappears , and traffic return to the original work path, switch counter reset. # noqa: E501 + + :param max_switch_times: The max_switch_times of this TapiConnectivityConnectivityService. + :type max_switch_times: int + """ + + self._max_switch_times = max_switch_times + + @property + def restoration_coordinate_type(self) -> TapiConnectivityCoordinateType: + """Gets the restoration_coordinate_type of this TapiConnectivityConnectivityService. + + + :return: The restoration_coordinate_type of this TapiConnectivityConnectivityService. + :rtype: TapiConnectivityCoordinateType + """ + return self._restoration_coordinate_type + + @restoration_coordinate_type.setter + def restoration_coordinate_type(self, restoration_coordinate_type: TapiConnectivityCoordinateType): + """Sets the restoration_coordinate_type of this TapiConnectivityConnectivityService. + + + :param restoration_coordinate_type: The restoration_coordinate_type of this TapiConnectivityConnectivityService. + :type restoration_coordinate_type: TapiConnectivityCoordinateType + """ + + self._restoration_coordinate_type = restoration_coordinate_type + + @property + def is_coordinated_switching_both_ends(self) -> bool: + """Gets the is_coordinated_switching_both_ends of this TapiConnectivityConnectivityService. + + Is operating such that switching at both ends of each flow acorss the FC is coordinated at both ingress and egress ends. # noqa: E501 + + :return: The is_coordinated_switching_both_ends of this TapiConnectivityConnectivityService. + :rtype: bool + """ + return self._is_coordinated_switching_both_ends + + @is_coordinated_switching_both_ends.setter + def is_coordinated_switching_both_ends(self, is_coordinated_switching_both_ends: bool): + """Sets the is_coordinated_switching_both_ends of this TapiConnectivityConnectivityService. + + Is operating such that switching at both ends of each flow acorss the FC is coordinated at both ingress and egress ends. # noqa: E501 + + :param is_coordinated_switching_both_ends: The is_coordinated_switching_both_ends of this TapiConnectivityConnectivityService. + :type is_coordinated_switching_both_ends: bool + """ + + self._is_coordinated_switching_both_ends = is_coordinated_switching_both_ends + + @property + def hold_off_time(self) -> int: + """Gets the hold_off_time of this TapiConnectivityConnectivityService. + + This attribute indicates the time, in milliseconds, between declaration of signal degrade or signal fail, and the initialization of the protection switching algorithm. # noqa: E501 + + :return: The hold_off_time of this TapiConnectivityConnectivityService. + :rtype: int + """ + return self._hold_off_time + + @hold_off_time.setter + def hold_off_time(self, hold_off_time: int): + """Sets the hold_off_time of this TapiConnectivityConnectivityService. + + This attribute indicates the time, in milliseconds, between declaration of signal degrade or signal fail, and the initialization of the protection switching algorithm. # noqa: E501 + + :param hold_off_time: The hold_off_time of this TapiConnectivityConnectivityService. + :type hold_off_time: int + """ + + self._hold_off_time = hold_off_time + + @property + def is_frozen(self) -> bool: + """Gets the is_frozen of this TapiConnectivityConnectivityService. + + Temporarily prevents any switch action to be taken and, as such, freezes the current state. Until the freeze is cleared, additional near-end external commands are rejected and fault condition changes and received APS messages are ignored. All administrative controls of any aspect of protection are rejected. # noqa: E501 + + :return: The is_frozen of this TapiConnectivityConnectivityService. + :rtype: bool + """ + return self._is_frozen + + @is_frozen.setter + def is_frozen(self, is_frozen: bool): + """Sets the is_frozen of this TapiConnectivityConnectivityService. + + Temporarily prevents any switch action to be taken and, as such, freezes the current state. Until the freeze is cleared, additional near-end external commands are rejected and fault condition changes and received APS messages are ignored. All administrative controls of any aspect of protection are rejected. # noqa: E501 + + :param is_frozen: The is_frozen of this TapiConnectivityConnectivityService. + :type is_frozen: bool + """ + + self._is_frozen = is_frozen + + @property + def wait_to_revert_time(self) -> int: + """Gets the wait_to_revert_time of this TapiConnectivityConnectivityService. + + If the protection system is revertive, this attribute specifies the time, in minutes, to wait after a fault clears on a higher priority (preferred) resource before reverting to the preferred resource. # noqa: E501 + + :return: The wait_to_revert_time of this TapiConnectivityConnectivityService. + :rtype: int + """ + return self._wait_to_revert_time + + @wait_to_revert_time.setter + def wait_to_revert_time(self, wait_to_revert_time: int): + """Sets the wait_to_revert_time of this TapiConnectivityConnectivityService. + + If the protection system is revertive, this attribute specifies the time, in minutes, to wait after a fault clears on a higher priority (preferred) resource before reverting to the preferred resource. # noqa: E501 + + :param wait_to_revert_time: The wait_to_revert_time of this TapiConnectivityConnectivityService. + :type wait_to_revert_time: int + """ + + self._wait_to_revert_time = wait_to_revert_time + + @property + def resilience_type(self) -> TapiTopologyResilienceType: + """Gets the resilience_type of this TapiConnectivityConnectivityService. + + + :return: The resilience_type of this TapiConnectivityConnectivityService. + :rtype: TapiTopologyResilienceType + """ + return self._resilience_type + + @resilience_type.setter + def resilience_type(self, resilience_type: TapiTopologyResilienceType): + """Sets the resilience_type of this TapiConnectivityConnectivityService. + + + :param resilience_type: The resilience_type of this TapiConnectivityConnectivityService. + :type resilience_type: TapiTopologyResilienceType + """ + + self._resilience_type = resilience_type + + @property + def preferred_restoration_layer(self) -> List[TapiCommonLayerProtocolName]: + """Gets the preferred_restoration_layer of this TapiConnectivityConnectivityService. + + Indicate which layer this resilience parameters package configured for. # noqa: E501 + + :return: The preferred_restoration_layer of this TapiConnectivityConnectivityService. + :rtype: List[TapiCommonLayerProtocolName] + """ + return self._preferred_restoration_layer + + @preferred_restoration_layer.setter + def preferred_restoration_layer(self, preferred_restoration_layer: List[TapiCommonLayerProtocolName]): + """Sets the preferred_restoration_layer of this TapiConnectivityConnectivityService. + + Indicate which layer this resilience parameters package configured for. # noqa: E501 + + :param preferred_restoration_layer: The preferred_restoration_layer of this TapiConnectivityConnectivityService. + :type preferred_restoration_layer: List[TapiCommonLayerProtocolName] + """ + + self._preferred_restoration_layer = preferred_restoration_layer + + @property + def restore_priority(self) -> int: + """Gets the restore_priority of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :return: The restore_priority of this TapiConnectivityConnectivityService. + :rtype: int + """ + return self._restore_priority + + @restore_priority.setter + def restore_priority(self, restore_priority: int): + """Sets the restore_priority of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :param restore_priority: The restore_priority of this TapiConnectivityConnectivityService. + :type restore_priority: int + """ + + self._restore_priority = restore_priority + + @property + def reversion_mode(self) -> TapiConnectivityReversionMode: + """Gets the reversion_mode of this TapiConnectivityConnectivityService. + + + :return: The reversion_mode of this TapiConnectivityConnectivityService. + :rtype: TapiConnectivityReversionMode + """ + return self._reversion_mode + + @reversion_mode.setter + def reversion_mode(self, reversion_mode: TapiConnectivityReversionMode): + """Sets the reversion_mode of this TapiConnectivityConnectivityService. + + + :param reversion_mode: The reversion_mode of this TapiConnectivityConnectivityService. + :type reversion_mode: TapiConnectivityReversionMode + """ + + self._reversion_mode = reversion_mode + + @property + def is_exclusive(self) -> bool: + """Gets the is_exclusive of this TapiConnectivityConnectivityService. + + To distinguish if the resources are to be exclusive to the service # noqa: E501 + + :return: The is_exclusive of this TapiConnectivityConnectivityService. + :rtype: bool + """ + return self._is_exclusive + + @is_exclusive.setter + def is_exclusive(self, is_exclusive: bool): + """Sets the is_exclusive of this TapiConnectivityConnectivityService. + + To distinguish if the resources are to be exclusive to the service # noqa: E501 + + :param is_exclusive: The is_exclusive of this TapiConnectivityConnectivityService. + :type is_exclusive: bool + """ + + self._is_exclusive = is_exclusive + + @property + def max_allowed_cost(self) -> TapiPathComputationValueOrPriority: + """Gets the max_allowed_cost of this TapiConnectivityConnectivityService. + + + :return: The max_allowed_cost of this TapiConnectivityConnectivityService. + :rtype: TapiPathComputationValueOrPriority + """ + return self._max_allowed_cost + + @max_allowed_cost.setter + def max_allowed_cost(self, max_allowed_cost: TapiPathComputationValueOrPriority): + """Sets the max_allowed_cost of this TapiConnectivityConnectivityService. + + + :param max_allowed_cost: The max_allowed_cost of this TapiConnectivityConnectivityService. + :type max_allowed_cost: TapiPathComputationValueOrPriority + """ + + self._max_allowed_cost = max_allowed_cost + + @property + def diversity_policy(self) -> TapiPathComputationDiversityPolicy: + """Gets the diversity_policy of this TapiConnectivityConnectivityService. + + + :return: The diversity_policy of this TapiConnectivityConnectivityService. + :rtype: TapiPathComputationDiversityPolicy + """ + return self._diversity_policy + + @diversity_policy.setter + def diversity_policy(self, diversity_policy: TapiPathComputationDiversityPolicy): + """Sets the diversity_policy of this TapiConnectivityConnectivityService. + + + :param diversity_policy: The diversity_policy of this TapiConnectivityConnectivityService. + :type diversity_policy: TapiPathComputationDiversityPolicy + """ + + self._diversity_policy = diversity_policy + + @property + def route_objective_function(self) -> TapiPathComputationRouteObjectiveFunction: + """Gets the route_objective_function of this TapiConnectivityConnectivityService. + + + :return: The route_objective_function of this TapiConnectivityConnectivityService. + :rtype: TapiPathComputationRouteObjectiveFunction + """ + return self._route_objective_function + + @route_objective_function.setter + def route_objective_function(self, route_objective_function: TapiPathComputationRouteObjectiveFunction): + """Sets the route_objective_function of this TapiConnectivityConnectivityService. + + + :param route_objective_function: The route_objective_function of this TapiConnectivityConnectivityService. + :type route_objective_function: TapiPathComputationRouteObjectiveFunction + """ + + self._route_objective_function = route_objective_function + + @property + def cost_characteristic(self) -> List[TapiTopologyCostCharacteristic]: + """Gets the cost_characteristic of this TapiConnectivityConnectivityService. + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :return: The cost_characteristic of this TapiConnectivityConnectivityService. + :rtype: List[TapiTopologyCostCharacteristic] + """ + return self._cost_characteristic + + @cost_characteristic.setter + def cost_characteristic(self, cost_characteristic: List[TapiTopologyCostCharacteristic]): + """Sets the cost_characteristic of this TapiConnectivityConnectivityService. + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :param cost_characteristic: The cost_characteristic of this TapiConnectivityConnectivityService. + :type cost_characteristic: List[TapiTopologyCostCharacteristic] + """ + + self._cost_characteristic = cost_characteristic + + @property + def max_allowed_hops(self) -> TapiPathComputationValueOrPriority: + """Gets the max_allowed_hops of this TapiConnectivityConnectivityService. + + + :return: The max_allowed_hops of this TapiConnectivityConnectivityService. + :rtype: TapiPathComputationValueOrPriority + """ + return self._max_allowed_hops + + @max_allowed_hops.setter + def max_allowed_hops(self, max_allowed_hops: TapiPathComputationValueOrPriority): + """Sets the max_allowed_hops of this TapiConnectivityConnectivityService. + + + :param max_allowed_hops: The max_allowed_hops of this TapiConnectivityConnectivityService. + :type max_allowed_hops: TapiPathComputationValueOrPriority + """ + + self._max_allowed_hops = max_allowed_hops + + @property + def max_allowed_delay(self) -> TapiPathComputationValueOrPriority: + """Gets the max_allowed_delay of this TapiConnectivityConnectivityService. + + + :return: The max_allowed_delay of this TapiConnectivityConnectivityService. + :rtype: TapiPathComputationValueOrPriority + """ + return self._max_allowed_delay + + @max_allowed_delay.setter + def max_allowed_delay(self, max_allowed_delay: TapiPathComputationValueOrPriority): + """Sets the max_allowed_delay of this TapiConnectivityConnectivityService. + + + :param max_allowed_delay: The max_allowed_delay of this TapiConnectivityConnectivityService. + :type max_allowed_delay: TapiPathComputationValueOrPriority + """ + + self._max_allowed_delay = max_allowed_delay + + @property + def latency_characteristic(self) -> List[TapiTopologyLatencyCharacteristic]: + """Gets the latency_characteristic of this TapiConnectivityConnectivityService. + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :return: The latency_characteristic of this TapiConnectivityConnectivityService. + :rtype: List[TapiTopologyLatencyCharacteristic] + """ + return self._latency_characteristic + + @latency_characteristic.setter + def latency_characteristic(self, latency_characteristic: List[TapiTopologyLatencyCharacteristic]): + """Sets the latency_characteristic of this TapiConnectivityConnectivityService. + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :param latency_characteristic: The latency_characteristic of this TapiConnectivityConnectivityService. + :type latency_characteristic: List[TapiTopologyLatencyCharacteristic] + """ + + self._latency_characteristic = latency_characteristic + + @property + def risk_diversity_characteristic(self) -> List[TapiTopologyRiskCharacteristic]: + """Gets the risk_diversity_characteristic of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :return: The risk_diversity_characteristic of this TapiConnectivityConnectivityService. + :rtype: List[TapiTopologyRiskCharacteristic] + """ + return self._risk_diversity_characteristic + + @risk_diversity_characteristic.setter + def risk_diversity_characteristic(self, risk_diversity_characteristic: List[TapiTopologyRiskCharacteristic]): + """Sets the risk_diversity_characteristic of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :param risk_diversity_characteristic: The risk_diversity_characteristic of this TapiConnectivityConnectivityService. + :type risk_diversity_characteristic: List[TapiTopologyRiskCharacteristic] + """ + + self._risk_diversity_characteristic = risk_diversity_characteristic + + @property + def route_direction(self) -> TapiCommonForwardingDirection: + """Gets the route_direction of this TapiConnectivityConnectivityService. + + + :return: The route_direction of this TapiConnectivityConnectivityService. + :rtype: TapiCommonForwardingDirection + """ + return self._route_direction + + @route_direction.setter + def route_direction(self, route_direction: TapiCommonForwardingDirection): + """Sets the route_direction of this TapiConnectivityConnectivityService. + + + :param route_direction: The route_direction of this TapiConnectivityConnectivityService. + :type route_direction: TapiCommonForwardingDirection + """ + + self._route_direction = route_direction + + @property + def include_node(self) -> List[str]: + """Gets the include_node of this TapiConnectivityConnectivityService. + + This is a loose constraint - that is it is unordered and could be a partial list # noqa: E501 + + :return: The include_node of this TapiConnectivityConnectivityService. + :rtype: List[str] + """ + return self._include_node + + @include_node.setter + def include_node(self, include_node: List[str]): + """Sets the include_node of this TapiConnectivityConnectivityService. + + This is a loose constraint - that is it is unordered and could be a partial list # noqa: E501 + + :param include_node: The include_node of this TapiConnectivityConnectivityService. + :type include_node: List[str] + """ + + self._include_node = include_node + + @property + def exclude_link(self) -> List[str]: + """Gets the exclude_link of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :return: The exclude_link of this TapiConnectivityConnectivityService. + :rtype: List[str] + """ + return self._exclude_link + + @exclude_link.setter + def exclude_link(self, exclude_link: List[str]): + """Sets the exclude_link of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :param exclude_link: The exclude_link of this TapiConnectivityConnectivityService. + :type exclude_link: List[str] + """ + + self._exclude_link = exclude_link + + @property + def avoid_topology(self) -> List[str]: + """Gets the avoid_topology of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :return: The avoid_topology of this TapiConnectivityConnectivityService. + :rtype: List[str] + """ + return self._avoid_topology + + @avoid_topology.setter + def avoid_topology(self, avoid_topology: List[str]): + """Sets the avoid_topology of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :param avoid_topology: The avoid_topology of this TapiConnectivityConnectivityService. + :type avoid_topology: List[str] + """ + + self._avoid_topology = avoid_topology + + @property + def exclude_path(self) -> List[str]: + """Gets the exclude_path of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :return: The exclude_path of this TapiConnectivityConnectivityService. + :rtype: List[str] + """ + return self._exclude_path + + @exclude_path.setter + def exclude_path(self, exclude_path: List[str]): + """Sets the exclude_path of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :param exclude_path: The exclude_path of this TapiConnectivityConnectivityService. + :type exclude_path: List[str] + """ + + self._exclude_path = exclude_path + + @property + def include_link(self) -> List[str]: + """Gets the include_link of this TapiConnectivityConnectivityService. + + This is a loose constraint - that is it is unordered and could be a partial list # noqa: E501 + + :return: The include_link of this TapiConnectivityConnectivityService. + :rtype: List[str] + """ + return self._include_link + + @include_link.setter + def include_link(self, include_link: List[str]): + """Sets the include_link of this TapiConnectivityConnectivityService. + + This is a loose constraint - that is it is unordered and could be a partial list # noqa: E501 + + :param include_link: The include_link of this TapiConnectivityConnectivityService. + :type include_link: List[str] + """ + + self._include_link = include_link + + @property + def preferred_transport_layer(self) -> List[TapiCommonLayerProtocolName]: + """Gets the preferred_transport_layer of this TapiConnectivityConnectivityService. + + soft constraint requested by client to indicate the layer(s) of transport connection that it prefers to carry the service. This could be same as the service layer or one of the supported server layers # noqa: E501 + + :return: The preferred_transport_layer of this TapiConnectivityConnectivityService. + :rtype: List[TapiCommonLayerProtocolName] + """ + return self._preferred_transport_layer + + @preferred_transport_layer.setter + def preferred_transport_layer(self, preferred_transport_layer: List[TapiCommonLayerProtocolName]): + """Sets the preferred_transport_layer of this TapiConnectivityConnectivityService. + + soft constraint requested by client to indicate the layer(s) of transport connection that it prefers to carry the service. This could be same as the service layer or one of the supported server layers # noqa: E501 + + :param preferred_transport_layer: The preferred_transport_layer of this TapiConnectivityConnectivityService. + :type preferred_transport_layer: List[TapiCommonLayerProtocolName] + """ + + self._preferred_transport_layer = preferred_transport_layer + + @property + def exclude_node(self) -> List[str]: + """Gets the exclude_node of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :return: The exclude_node of this TapiConnectivityConnectivityService. + :rtype: List[str] + """ + return self._exclude_node + + @exclude_node.setter + def exclude_node(self, exclude_node: List[str]): + """Sets the exclude_node of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :param exclude_node: The exclude_node of this TapiConnectivityConnectivityService. + :type exclude_node: List[str] + """ + + self._exclude_node = exclude_node + + @property + def include_topology(self) -> List[str]: + """Gets the include_topology of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :return: The include_topology of this TapiConnectivityConnectivityService. + :rtype: List[str] + """ + return self._include_topology + + @include_topology.setter + def include_topology(self, include_topology: List[str]): + """Sets the include_topology of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :param include_topology: The include_topology of this TapiConnectivityConnectivityService. + :type include_topology: List[str] + """ + + self._include_topology = include_topology + + @property + def include_path(self) -> List[str]: + """Gets the include_path of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :return: The include_path of this TapiConnectivityConnectivityService. + :rtype: List[str] + """ + return self._include_path + + @include_path.setter + def include_path(self, include_path: List[str]): + """Sets the include_path of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :param include_path: The include_path of this TapiConnectivityConnectivityService. + :type include_path: List[str] + """ + + self._include_path = include_path + + @property + def operational_state(self) -> TapiCommonOperationalState: + """Gets the operational_state of this TapiConnectivityConnectivityService. + + + :return: The operational_state of this TapiConnectivityConnectivityService. + :rtype: TapiCommonOperationalState + """ + return self._operational_state + + @operational_state.setter + def operational_state(self, operational_state: TapiCommonOperationalState): + """Sets the operational_state of this TapiConnectivityConnectivityService. + + + :param operational_state: The operational_state of this TapiConnectivityConnectivityService. + :type operational_state: TapiCommonOperationalState + """ + + self._operational_state = operational_state + + @property + def lifecycle_state(self) -> TapiCommonLifecycleState: + """Gets the lifecycle_state of this TapiConnectivityConnectivityService. + + + :return: The lifecycle_state of this TapiConnectivityConnectivityService. + :rtype: TapiCommonLifecycleState + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state: TapiCommonLifecycleState): + """Sets the lifecycle_state of this TapiConnectivityConnectivityService. + + + :param lifecycle_state: The lifecycle_state of this TapiConnectivityConnectivityService. + :type lifecycle_state: TapiCommonLifecycleState + """ + + self._lifecycle_state = lifecycle_state + + @property + def administrative_state(self) -> TapiCommonAdministrativeState: + """Gets the administrative_state of this TapiConnectivityConnectivityService. + + + :return: The administrative_state of this TapiConnectivityConnectivityService. + :rtype: TapiCommonAdministrativeState + """ + return self._administrative_state + + @administrative_state.setter + def administrative_state(self, administrative_state: TapiCommonAdministrativeState): + """Sets the administrative_state of this TapiConnectivityConnectivityService. + + + :param administrative_state: The administrative_state of this TapiConnectivityConnectivityService. + :type administrative_state: TapiCommonAdministrativeState + """ + + self._administrative_state = administrative_state + + @property + def end_point(self) -> List[TapiConnectivityConnectivityServiceEndPoint]: + """Gets the end_point of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :return: The end_point of this TapiConnectivityConnectivityService. + :rtype: List[TapiConnectivityConnectivityServiceEndPoint] + """ + return self._end_point + + @end_point.setter + def end_point(self, end_point: List[TapiConnectivityConnectivityServiceEndPoint]): + """Sets the end_point of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :param end_point: The end_point of this TapiConnectivityConnectivityService. + :type end_point: List[TapiConnectivityConnectivityServiceEndPoint] + """ + + self._end_point = end_point + + @property + def connection(self) -> List[TapiConnectivityConnectionRef]: + """Gets the connection of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :return: The connection of this TapiConnectivityConnectivityService. + :rtype: List[TapiConnectivityConnectionRef] + """ + return self._connection + + @connection.setter + def connection(self, connection: List[TapiConnectivityConnectionRef]): + """Sets the connection of this TapiConnectivityConnectivityService. + + none # noqa: E501 + + :param connection: The connection of this TapiConnectivityConnectivityService. + :type connection: List[TapiConnectivityConnectionRef] + """ + + self._connection = connection diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service_end_point.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service_end_point.py new file mode 100644 index 0000000000000000000000000000000000000000..84df8f687885c89db080047a8098929c2dcb8662 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service_end_point.py @@ -0,0 +1,474 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_admin_state_pac import TapiCommonAdminStatePac # noqa: F401,E501 +from tapi_server.models.tapi_common_administrative_state import TapiCommonAdministrativeState # noqa: F401,E501 +from tapi_server.models.tapi_common_capacity import TapiCommonCapacity # noqa: F401,E501 +from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501 +from tapi_server.models.tapi_common_lifecycle_state import TapiCommonLifecycleState # noqa: F401,E501 +from tapi_server.models.tapi_common_local_class import TapiCommonLocalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_common_operational_state import TapiCommonOperationalState # noqa: F401,E501 +from tapi_server.models.tapi_common_port_direction import TapiCommonPortDirection # noqa: F401,E501 +from tapi_server.models.tapi_common_port_role import TapiCommonPortRole # noqa: F401,E501 +from tapi_server.models.tapi_common_service_interface_point_ref import TapiCommonServiceInterfacePointRef # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_connection_end_point_ref import TapiConnectivityConnectionEndPointRef # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_connectivity_service_end_point_ref import TapiConnectivityConnectivityServiceEndPointRef # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_protection_role import TapiConnectivityProtectionRole # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityConnectivityServiceEndPoint(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: List[TapiCommonNameAndValue]=None, local_id: str=None, operational_state: TapiCommonOperationalState=None, lifecycle_state: TapiCommonLifecycleState=None, administrative_state: TapiCommonAdministrativeState=None, protection_role: TapiConnectivityProtectionRole=None, role: TapiCommonPortRole=None, service_interface_point: TapiCommonServiceInterfacePointRef=None, peer_fwd_connectivity_service_end_point: TapiConnectivityConnectivityServiceEndPointRef=None, layer_protocol_name: TapiCommonLayerProtocolName=None, layer_protocol_qualifier: str=None, connection_end_point: List[TapiConnectivityConnectionEndPointRef]=None, server_connectivity_service_end_point: TapiConnectivityConnectivityServiceEndPointRef=None, protecting_connectivity_service_end_point: TapiConnectivityConnectivityServiceEndPointRef=None, direction: TapiCommonPortDirection=None, capacity: TapiCommonCapacity=None): # noqa: E501 + """TapiConnectivityConnectivityServiceEndPoint - a model defined in Swagger + + :param name: The name of this TapiConnectivityConnectivityServiceEndPoint. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param local_id: The local_id of this TapiConnectivityConnectivityServiceEndPoint. # noqa: E501 + :type local_id: str + :param operational_state: The operational_state of this TapiConnectivityConnectivityServiceEndPoint. # noqa: E501 + :type operational_state: TapiCommonOperationalState + :param lifecycle_state: The lifecycle_state of this TapiConnectivityConnectivityServiceEndPoint. # noqa: E501 + :type lifecycle_state: TapiCommonLifecycleState + :param administrative_state: The administrative_state of this TapiConnectivityConnectivityServiceEndPoint. # noqa: E501 + :type administrative_state: TapiCommonAdministrativeState + :param protection_role: The protection_role of this TapiConnectivityConnectivityServiceEndPoint. # noqa: E501 + :type protection_role: TapiConnectivityProtectionRole + :param role: The role of this TapiConnectivityConnectivityServiceEndPoint. # noqa: E501 + :type role: TapiCommonPortRole + :param service_interface_point: The service_interface_point of this TapiConnectivityConnectivityServiceEndPoint. # noqa: E501 + :type service_interface_point: TapiCommonServiceInterfacePointRef + :param peer_fwd_connectivity_service_end_point: The peer_fwd_connectivity_service_end_point of this TapiConnectivityConnectivityServiceEndPoint. # noqa: E501 + :type peer_fwd_connectivity_service_end_point: TapiConnectivityConnectivityServiceEndPointRef + :param layer_protocol_name: The layer_protocol_name of this TapiConnectivityConnectivityServiceEndPoint. # noqa: E501 + :type layer_protocol_name: TapiCommonLayerProtocolName + :param layer_protocol_qualifier: The layer_protocol_qualifier of this TapiConnectivityConnectivityServiceEndPoint. # noqa: E501 + :type layer_protocol_qualifier: str + :param connection_end_point: The connection_end_point of this TapiConnectivityConnectivityServiceEndPoint. # noqa: E501 + :type connection_end_point: List[TapiConnectivityConnectionEndPointRef] + :param server_connectivity_service_end_point: The server_connectivity_service_end_point of this TapiConnectivityConnectivityServiceEndPoint. # noqa: E501 + :type server_connectivity_service_end_point: TapiConnectivityConnectivityServiceEndPointRef + :param protecting_connectivity_service_end_point: The protecting_connectivity_service_end_point of this TapiConnectivityConnectivityServiceEndPoint. # noqa: E501 + :type protecting_connectivity_service_end_point: TapiConnectivityConnectivityServiceEndPointRef + :param direction: The direction of this TapiConnectivityConnectivityServiceEndPoint. # noqa: E501 + :type direction: TapiCommonPortDirection + :param capacity: The capacity of this TapiConnectivityConnectivityServiceEndPoint. # noqa: E501 + :type capacity: TapiCommonCapacity + """ + self.swagger_types = { + 'name': List[TapiCommonNameAndValue], + 'local_id': str, + 'operational_state': TapiCommonOperationalState, + 'lifecycle_state': TapiCommonLifecycleState, + 'administrative_state': TapiCommonAdministrativeState, + 'protection_role': TapiConnectivityProtectionRole, + 'role': TapiCommonPortRole, + 'service_interface_point': TapiCommonServiceInterfacePointRef, + 'peer_fwd_connectivity_service_end_point': TapiConnectivityConnectivityServiceEndPointRef, + 'layer_protocol_name': TapiCommonLayerProtocolName, + 'layer_protocol_qualifier': str, + 'connection_end_point': List[TapiConnectivityConnectionEndPointRef], + 'server_connectivity_service_end_point': TapiConnectivityConnectivityServiceEndPointRef, + 'protecting_connectivity_service_end_point': TapiConnectivityConnectivityServiceEndPointRef, + 'direction': TapiCommonPortDirection, + 'capacity': TapiCommonCapacity + } + + self.attribute_map = { + 'name': 'name', + 'local_id': 'local-id', + 'operational_state': 'operational-state', + 'lifecycle_state': 'lifecycle-state', + 'administrative_state': 'administrative-state', + 'protection_role': 'protection-role', + 'role': 'role', + 'service_interface_point': 'service-interface-point', + 'peer_fwd_connectivity_service_end_point': 'peer-fwd-connectivity-service-end-point', + 'layer_protocol_name': 'layer-protocol-name', + 'layer_protocol_qualifier': 'layer-protocol-qualifier', + 'connection_end_point': 'connection-end-point', + 'server_connectivity_service_end_point': 'server-connectivity-service-end-point', + 'protecting_connectivity_service_end_point': 'protecting-connectivity-service-end-point', + 'direction': 'direction', + 'capacity': 'capacity' + } + self._name = name + self._local_id = local_id + self._operational_state = operational_state + self._lifecycle_state = lifecycle_state + self._administrative_state = administrative_state + self._protection_role = protection_role + self._role = role + self._service_interface_point = service_interface_point + self._peer_fwd_connectivity_service_end_point = peer_fwd_connectivity_service_end_point + self._layer_protocol_name = layer_protocol_name + self._layer_protocol_qualifier = layer_protocol_qualifier + self._connection_end_point = connection_end_point + self._server_connectivity_service_end_point = server_connectivity_service_end_point + self._protecting_connectivity_service_end_point = protecting_connectivity_service_end_point + self._direction = direction + self._capacity = capacity + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityConnectivityServiceEndPoint': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ConnectivityServiceEndPoint of this TapiConnectivityConnectivityServiceEndPoint. # noqa: E501 + :rtype: TapiConnectivityConnectivityServiceEndPoint + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiConnectivityConnectivityServiceEndPoint. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiConnectivityConnectivityServiceEndPoint. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiConnectivityConnectivityServiceEndPoint. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiConnectivityConnectivityServiceEndPoint. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def local_id(self) -> str: + """Gets the local_id of this TapiConnectivityConnectivityServiceEndPoint. + + none # noqa: E501 + + :return: The local_id of this TapiConnectivityConnectivityServiceEndPoint. + :rtype: str + """ + return self._local_id + + @local_id.setter + def local_id(self, local_id: str): + """Sets the local_id of this TapiConnectivityConnectivityServiceEndPoint. + + none # noqa: E501 + + :param local_id: The local_id of this TapiConnectivityConnectivityServiceEndPoint. + :type local_id: str + """ + + self._local_id = local_id + + @property + def operational_state(self) -> TapiCommonOperationalState: + """Gets the operational_state of this TapiConnectivityConnectivityServiceEndPoint. + + + :return: The operational_state of this TapiConnectivityConnectivityServiceEndPoint. + :rtype: TapiCommonOperationalState + """ + return self._operational_state + + @operational_state.setter + def operational_state(self, operational_state: TapiCommonOperationalState): + """Sets the operational_state of this TapiConnectivityConnectivityServiceEndPoint. + + + :param operational_state: The operational_state of this TapiConnectivityConnectivityServiceEndPoint. + :type operational_state: TapiCommonOperationalState + """ + + self._operational_state = operational_state + + @property + def lifecycle_state(self) -> TapiCommonLifecycleState: + """Gets the lifecycle_state of this TapiConnectivityConnectivityServiceEndPoint. + + + :return: The lifecycle_state of this TapiConnectivityConnectivityServiceEndPoint. + :rtype: TapiCommonLifecycleState + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state: TapiCommonLifecycleState): + """Sets the lifecycle_state of this TapiConnectivityConnectivityServiceEndPoint. + + + :param lifecycle_state: The lifecycle_state of this TapiConnectivityConnectivityServiceEndPoint. + :type lifecycle_state: TapiCommonLifecycleState + """ + + self._lifecycle_state = lifecycle_state + + @property + def administrative_state(self) -> TapiCommonAdministrativeState: + """Gets the administrative_state of this TapiConnectivityConnectivityServiceEndPoint. + + + :return: The administrative_state of this TapiConnectivityConnectivityServiceEndPoint. + :rtype: TapiCommonAdministrativeState + """ + return self._administrative_state + + @administrative_state.setter + def administrative_state(self, administrative_state: TapiCommonAdministrativeState): + """Sets the administrative_state of this TapiConnectivityConnectivityServiceEndPoint. + + + :param administrative_state: The administrative_state of this TapiConnectivityConnectivityServiceEndPoint. + :type administrative_state: TapiCommonAdministrativeState + """ + + self._administrative_state = administrative_state + + @property + def protection_role(self) -> TapiConnectivityProtectionRole: + """Gets the protection_role of this TapiConnectivityConnectivityServiceEndPoint. + + + :return: The protection_role of this TapiConnectivityConnectivityServiceEndPoint. + :rtype: TapiConnectivityProtectionRole + """ + return self._protection_role + + @protection_role.setter + def protection_role(self, protection_role: TapiConnectivityProtectionRole): + """Sets the protection_role of this TapiConnectivityConnectivityServiceEndPoint. + + + :param protection_role: The protection_role of this TapiConnectivityConnectivityServiceEndPoint. + :type protection_role: TapiConnectivityProtectionRole + """ + + self._protection_role = protection_role + + @property + def role(self) -> TapiCommonPortRole: + """Gets the role of this TapiConnectivityConnectivityServiceEndPoint. + + + :return: The role of this TapiConnectivityConnectivityServiceEndPoint. + :rtype: TapiCommonPortRole + """ + return self._role + + @role.setter + def role(self, role: TapiCommonPortRole): + """Sets the role of this TapiConnectivityConnectivityServiceEndPoint. + + + :param role: The role of this TapiConnectivityConnectivityServiceEndPoint. + :type role: TapiCommonPortRole + """ + + self._role = role + + @property + def service_interface_point(self) -> TapiCommonServiceInterfacePointRef: + """Gets the service_interface_point of this TapiConnectivityConnectivityServiceEndPoint. + + + :return: The service_interface_point of this TapiConnectivityConnectivityServiceEndPoint. + :rtype: TapiCommonServiceInterfacePointRef + """ + return self._service_interface_point + + @service_interface_point.setter + def service_interface_point(self, service_interface_point: TapiCommonServiceInterfacePointRef): + """Sets the service_interface_point of this TapiConnectivityConnectivityServiceEndPoint. + + + :param service_interface_point: The service_interface_point of this TapiConnectivityConnectivityServiceEndPoint. + :type service_interface_point: TapiCommonServiceInterfacePointRef + """ + + self._service_interface_point = service_interface_point + + @property + def peer_fwd_connectivity_service_end_point(self) -> TapiConnectivityConnectivityServiceEndPointRef: + """Gets the peer_fwd_connectivity_service_end_point of this TapiConnectivityConnectivityServiceEndPoint. + + + :return: The peer_fwd_connectivity_service_end_point of this TapiConnectivityConnectivityServiceEndPoint. + :rtype: TapiConnectivityConnectivityServiceEndPointRef + """ + return self._peer_fwd_connectivity_service_end_point + + @peer_fwd_connectivity_service_end_point.setter + def peer_fwd_connectivity_service_end_point(self, peer_fwd_connectivity_service_end_point: TapiConnectivityConnectivityServiceEndPointRef): + """Sets the peer_fwd_connectivity_service_end_point of this TapiConnectivityConnectivityServiceEndPoint. + + + :param peer_fwd_connectivity_service_end_point: The peer_fwd_connectivity_service_end_point of this TapiConnectivityConnectivityServiceEndPoint. + :type peer_fwd_connectivity_service_end_point: TapiConnectivityConnectivityServiceEndPointRef + """ + + self._peer_fwd_connectivity_service_end_point = peer_fwd_connectivity_service_end_point + + @property + def layer_protocol_name(self) -> TapiCommonLayerProtocolName: + """Gets the layer_protocol_name of this TapiConnectivityConnectivityServiceEndPoint. + + + :return: The layer_protocol_name of this TapiConnectivityConnectivityServiceEndPoint. + :rtype: TapiCommonLayerProtocolName + """ + return self._layer_protocol_name + + @layer_protocol_name.setter + def layer_protocol_name(self, layer_protocol_name: TapiCommonLayerProtocolName): + """Sets the layer_protocol_name of this TapiConnectivityConnectivityServiceEndPoint. + + + :param layer_protocol_name: The layer_protocol_name of this TapiConnectivityConnectivityServiceEndPoint. + :type layer_protocol_name: TapiCommonLayerProtocolName + """ + + self._layer_protocol_name = layer_protocol_name + + @property + def layer_protocol_qualifier(self) -> str: + """Gets the layer_protocol_qualifier of this TapiConnectivityConnectivityServiceEndPoint. + + none # noqa: E501 + + :return: The layer_protocol_qualifier of this TapiConnectivityConnectivityServiceEndPoint. + :rtype: str + """ + return self._layer_protocol_qualifier + + @layer_protocol_qualifier.setter + def layer_protocol_qualifier(self, layer_protocol_qualifier: str): + """Sets the layer_protocol_qualifier of this TapiConnectivityConnectivityServiceEndPoint. + + none # noqa: E501 + + :param layer_protocol_qualifier: The layer_protocol_qualifier of this TapiConnectivityConnectivityServiceEndPoint. + :type layer_protocol_qualifier: str + """ + + self._layer_protocol_qualifier = layer_protocol_qualifier + + @property + def connection_end_point(self) -> List[TapiConnectivityConnectionEndPointRef]: + """Gets the connection_end_point of this TapiConnectivityConnectivityServiceEndPoint. + + none # noqa: E501 + + :return: The connection_end_point of this TapiConnectivityConnectivityServiceEndPoint. + :rtype: List[TapiConnectivityConnectionEndPointRef] + """ + return self._connection_end_point + + @connection_end_point.setter + def connection_end_point(self, connection_end_point: List[TapiConnectivityConnectionEndPointRef]): + """Sets the connection_end_point of this TapiConnectivityConnectivityServiceEndPoint. + + none # noqa: E501 + + :param connection_end_point: The connection_end_point of this TapiConnectivityConnectivityServiceEndPoint. + :type connection_end_point: List[TapiConnectivityConnectionEndPointRef] + """ + + self._connection_end_point = connection_end_point + + @property + def server_connectivity_service_end_point(self) -> TapiConnectivityConnectivityServiceEndPointRef: + """Gets the server_connectivity_service_end_point of this TapiConnectivityConnectivityServiceEndPoint. + + + :return: The server_connectivity_service_end_point of this TapiConnectivityConnectivityServiceEndPoint. + :rtype: TapiConnectivityConnectivityServiceEndPointRef + """ + return self._server_connectivity_service_end_point + + @server_connectivity_service_end_point.setter + def server_connectivity_service_end_point(self, server_connectivity_service_end_point: TapiConnectivityConnectivityServiceEndPointRef): + """Sets the server_connectivity_service_end_point of this TapiConnectivityConnectivityServiceEndPoint. + + + :param server_connectivity_service_end_point: The server_connectivity_service_end_point of this TapiConnectivityConnectivityServiceEndPoint. + :type server_connectivity_service_end_point: TapiConnectivityConnectivityServiceEndPointRef + """ + + self._server_connectivity_service_end_point = server_connectivity_service_end_point + + @property + def protecting_connectivity_service_end_point(self) -> TapiConnectivityConnectivityServiceEndPointRef: + """Gets the protecting_connectivity_service_end_point of this TapiConnectivityConnectivityServiceEndPoint. + + + :return: The protecting_connectivity_service_end_point of this TapiConnectivityConnectivityServiceEndPoint. + :rtype: TapiConnectivityConnectivityServiceEndPointRef + """ + return self._protecting_connectivity_service_end_point + + @protecting_connectivity_service_end_point.setter + def protecting_connectivity_service_end_point(self, protecting_connectivity_service_end_point: TapiConnectivityConnectivityServiceEndPointRef): + """Sets the protecting_connectivity_service_end_point of this TapiConnectivityConnectivityServiceEndPoint. + + + :param protecting_connectivity_service_end_point: The protecting_connectivity_service_end_point of this TapiConnectivityConnectivityServiceEndPoint. + :type protecting_connectivity_service_end_point: TapiConnectivityConnectivityServiceEndPointRef + """ + + self._protecting_connectivity_service_end_point = protecting_connectivity_service_end_point + + @property + def direction(self) -> TapiCommonPortDirection: + """Gets the direction of this TapiConnectivityConnectivityServiceEndPoint. + + + :return: The direction of this TapiConnectivityConnectivityServiceEndPoint. + :rtype: TapiCommonPortDirection + """ + return self._direction + + @direction.setter + def direction(self, direction: TapiCommonPortDirection): + """Sets the direction of this TapiConnectivityConnectivityServiceEndPoint. + + + :param direction: The direction of this TapiConnectivityConnectivityServiceEndPoint. + :type direction: TapiCommonPortDirection + """ + + self._direction = direction + + @property + def capacity(self) -> TapiCommonCapacity: + """Gets the capacity of this TapiConnectivityConnectivityServiceEndPoint. + + + :return: The capacity of this TapiConnectivityConnectivityServiceEndPoint. + :rtype: TapiCommonCapacity + """ + return self._capacity + + @capacity.setter + def capacity(self, capacity: TapiCommonCapacity): + """Sets the capacity of this TapiConnectivityConnectivityServiceEndPoint. + + + :param capacity: The capacity of this TapiConnectivityConnectivityServiceEndPoint. + :type capacity: TapiCommonCapacity + """ + + self._capacity = capacity diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service_end_point_ref.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service_end_point_ref.py new file mode 100644 index 0000000000000000000000000000000000000000..afde504d00bb5494da1b23c6c4cded75d4eb630e --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service_end_point_ref.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connectivity_service_ref import TapiConnectivityConnectivityServiceRef # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityConnectivityServiceEndPointRef(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, connectivity_service_uuid: str=None, connectivity_service_end_point_local_id: str=None): # noqa: E501 + """TapiConnectivityConnectivityServiceEndPointRef - a model defined in Swagger + + :param connectivity_service_uuid: The connectivity_service_uuid of this TapiConnectivityConnectivityServiceEndPointRef. # noqa: E501 + :type connectivity_service_uuid: str + :param connectivity_service_end_point_local_id: The connectivity_service_end_point_local_id of this TapiConnectivityConnectivityServiceEndPointRef. # noqa: E501 + :type connectivity_service_end_point_local_id: str + """ + self.swagger_types = { + 'connectivity_service_uuid': str, + 'connectivity_service_end_point_local_id': str + } + + self.attribute_map = { + 'connectivity_service_uuid': 'connectivity-service-uuid', + 'connectivity_service_end_point_local_id': 'connectivity-service-end-point-local-id' + } + self._connectivity_service_uuid = connectivity_service_uuid + self._connectivity_service_end_point_local_id = connectivity_service_end_point_local_id + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityConnectivityServiceEndPointRef': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ConnectivityServiceEndPointRef of this TapiConnectivityConnectivityServiceEndPointRef. # noqa: E501 + :rtype: TapiConnectivityConnectivityServiceEndPointRef + """ + return util.deserialize_model(dikt, cls) + + @property + def connectivity_service_uuid(self) -> str: + """Gets the connectivity_service_uuid of this TapiConnectivityConnectivityServiceEndPointRef. + + none # noqa: E501 + + :return: The connectivity_service_uuid of this TapiConnectivityConnectivityServiceEndPointRef. + :rtype: str + """ + return self._connectivity_service_uuid + + @connectivity_service_uuid.setter + def connectivity_service_uuid(self, connectivity_service_uuid: str): + """Sets the connectivity_service_uuid of this TapiConnectivityConnectivityServiceEndPointRef. + + none # noqa: E501 + + :param connectivity_service_uuid: The connectivity_service_uuid of this TapiConnectivityConnectivityServiceEndPointRef. + :type connectivity_service_uuid: str + """ + + self._connectivity_service_uuid = connectivity_service_uuid + + @property + def connectivity_service_end_point_local_id(self) -> str: + """Gets the connectivity_service_end_point_local_id of this TapiConnectivityConnectivityServiceEndPointRef. + + none # noqa: E501 + + :return: The connectivity_service_end_point_local_id of this TapiConnectivityConnectivityServiceEndPointRef. + :rtype: str + """ + return self._connectivity_service_end_point_local_id + + @connectivity_service_end_point_local_id.setter + def connectivity_service_end_point_local_id(self, connectivity_service_end_point_local_id: str): + """Sets the connectivity_service_end_point_local_id of this TapiConnectivityConnectivityServiceEndPointRef. + + none # noqa: E501 + + :param connectivity_service_end_point_local_id: The connectivity_service_end_point_local_id of this TapiConnectivityConnectivityServiceEndPointRef. + :type connectivity_service_end_point_local_id: str + """ + + self._connectivity_service_end_point_local_id = connectivity_service_end_point_local_id diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service_end_point_ref_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service_end_point_ref_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..f0f156275ae8bac5c7382f94b14df13ccd9309f9 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service_end_point_ref_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connectivity_service_end_point_ref import TapiConnectivityConnectivityServiceEndPointRef # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityConnectivityServiceEndPointRefWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, peer_fwd_connectivity_service_end_point: TapiConnectivityConnectivityServiceEndPointRef=None): # noqa: E501 + """TapiConnectivityConnectivityServiceEndPointRefWrapper - a model defined in Swagger + + :param peer_fwd_connectivity_service_end_point: The peer_fwd_connectivity_service_end_point of this TapiConnectivityConnectivityServiceEndPointRefWrapper. # noqa: E501 + :type peer_fwd_connectivity_service_end_point: TapiConnectivityConnectivityServiceEndPointRef + """ + self.swagger_types = { + 'peer_fwd_connectivity_service_end_point': TapiConnectivityConnectivityServiceEndPointRef + } + + self.attribute_map = { + 'peer_fwd_connectivity_service_end_point': 'peer-fwd-connectivity-service-end-point' + } + self._peer_fwd_connectivity_service_end_point = peer_fwd_connectivity_service_end_point + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityConnectivityServiceEndPointRefWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ConnectivityServiceEndPointRefWrapper of this TapiConnectivityConnectivityServiceEndPointRefWrapper. # noqa: E501 + :rtype: TapiConnectivityConnectivityServiceEndPointRefWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def peer_fwd_connectivity_service_end_point(self) -> TapiConnectivityConnectivityServiceEndPointRef: + """Gets the peer_fwd_connectivity_service_end_point of this TapiConnectivityConnectivityServiceEndPointRefWrapper. + + + :return: The peer_fwd_connectivity_service_end_point of this TapiConnectivityConnectivityServiceEndPointRefWrapper. + :rtype: TapiConnectivityConnectivityServiceEndPointRef + """ + return self._peer_fwd_connectivity_service_end_point + + @peer_fwd_connectivity_service_end_point.setter + def peer_fwd_connectivity_service_end_point(self, peer_fwd_connectivity_service_end_point: TapiConnectivityConnectivityServiceEndPointRef): + """Sets the peer_fwd_connectivity_service_end_point of this TapiConnectivityConnectivityServiceEndPointRefWrapper. + + + :param peer_fwd_connectivity_service_end_point: The peer_fwd_connectivity_service_end_point of this TapiConnectivityConnectivityServiceEndPointRefWrapper. + :type peer_fwd_connectivity_service_end_point: TapiConnectivityConnectivityServiceEndPointRef + """ + + self._peer_fwd_connectivity_service_end_point = peer_fwd_connectivity_service_end_point diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service_end_point_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service_end_point_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..2f55968a292fe062f714f08eec6dd450af1abaa2 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service_end_point_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connectivity_service_end_point import TapiConnectivityConnectivityServiceEndPoint # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityConnectivityServiceEndPointWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, end_point: TapiConnectivityConnectivityServiceEndPoint=None): # noqa: E501 + """TapiConnectivityConnectivityServiceEndPointWrapper - a model defined in Swagger + + :param end_point: The end_point of this TapiConnectivityConnectivityServiceEndPointWrapper. # noqa: E501 + :type end_point: TapiConnectivityConnectivityServiceEndPoint + """ + self.swagger_types = { + 'end_point': TapiConnectivityConnectivityServiceEndPoint + } + + self.attribute_map = { + 'end_point': 'end-point' + } + self._end_point = end_point + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityConnectivityServiceEndPointWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ConnectivityServiceEndPointWrapper of this TapiConnectivityConnectivityServiceEndPointWrapper. # noqa: E501 + :rtype: TapiConnectivityConnectivityServiceEndPointWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def end_point(self) -> TapiConnectivityConnectivityServiceEndPoint: + """Gets the end_point of this TapiConnectivityConnectivityServiceEndPointWrapper. + + + :return: The end_point of this TapiConnectivityConnectivityServiceEndPointWrapper. + :rtype: TapiConnectivityConnectivityServiceEndPoint + """ + return self._end_point + + @end_point.setter + def end_point(self, end_point: TapiConnectivityConnectivityServiceEndPoint): + """Sets the end_point of this TapiConnectivityConnectivityServiceEndPointWrapper. + + + :param end_point: The end_point of this TapiConnectivityConnectivityServiceEndPointWrapper. + :type end_point: TapiConnectivityConnectivityServiceEndPoint + """ + + self._end_point = end_point diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service_ref.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service_ref.py new file mode 100644 index 0000000000000000000000000000000000000000..b854f2223db359cf03db8e6df27948fc62535ca1 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service_ref.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiConnectivityConnectivityServiceRef(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, connectivity_service_uuid: str=None): # noqa: E501 + """TapiConnectivityConnectivityServiceRef - a model defined in Swagger + + :param connectivity_service_uuid: The connectivity_service_uuid of this TapiConnectivityConnectivityServiceRef. # noqa: E501 + :type connectivity_service_uuid: str + """ + self.swagger_types = { + 'connectivity_service_uuid': str + } + + self.attribute_map = { + 'connectivity_service_uuid': 'connectivity-service-uuid' + } + self._connectivity_service_uuid = connectivity_service_uuid + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityConnectivityServiceRef': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ConnectivityServiceRef of this TapiConnectivityConnectivityServiceRef. # noqa: E501 + :rtype: TapiConnectivityConnectivityServiceRef + """ + return util.deserialize_model(dikt, cls) + + @property + def connectivity_service_uuid(self) -> str: + """Gets the connectivity_service_uuid of this TapiConnectivityConnectivityServiceRef. + + none # noqa: E501 + + :return: The connectivity_service_uuid of this TapiConnectivityConnectivityServiceRef. + :rtype: str + """ + return self._connectivity_service_uuid + + @connectivity_service_uuid.setter + def connectivity_service_uuid(self, connectivity_service_uuid: str): + """Sets the connectivity_service_uuid of this TapiConnectivityConnectivityServiceRef. + + none # noqa: E501 + + :param connectivity_service_uuid: The connectivity_service_uuid of this TapiConnectivityConnectivityServiceRef. + :type connectivity_service_uuid: str + """ + + self._connectivity_service_uuid = connectivity_service_uuid diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service_ref_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service_ref_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..289ab904cf5f966b8e4155bd7f253e0f2c367d70 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service_ref_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connectivity_service_ref import TapiConnectivityConnectivityServiceRef # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityConnectivityServiceRefWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, coroute_inclusion: TapiConnectivityConnectivityServiceRef=None): # noqa: E501 + """TapiConnectivityConnectivityServiceRefWrapper - a model defined in Swagger + + :param coroute_inclusion: The coroute_inclusion of this TapiConnectivityConnectivityServiceRefWrapper. # noqa: E501 + :type coroute_inclusion: TapiConnectivityConnectivityServiceRef + """ + self.swagger_types = { + 'coroute_inclusion': TapiConnectivityConnectivityServiceRef + } + + self.attribute_map = { + 'coroute_inclusion': 'coroute-inclusion' + } + self._coroute_inclusion = coroute_inclusion + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityConnectivityServiceRefWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ConnectivityServiceRefWrapper of this TapiConnectivityConnectivityServiceRefWrapper. # noqa: E501 + :rtype: TapiConnectivityConnectivityServiceRefWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def coroute_inclusion(self) -> TapiConnectivityConnectivityServiceRef: + """Gets the coroute_inclusion of this TapiConnectivityConnectivityServiceRefWrapper. + + + :return: The coroute_inclusion of this TapiConnectivityConnectivityServiceRefWrapper. + :rtype: TapiConnectivityConnectivityServiceRef + """ + return self._coroute_inclusion + + @coroute_inclusion.setter + def coroute_inclusion(self, coroute_inclusion: TapiConnectivityConnectivityServiceRef): + """Sets the coroute_inclusion of this TapiConnectivityConnectivityServiceRefWrapper. + + + :param coroute_inclusion: The coroute_inclusion of this TapiConnectivityConnectivityServiceRefWrapper. + :type coroute_inclusion: TapiConnectivityConnectivityServiceRef + """ + + self._coroute_inclusion = coroute_inclusion diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..9be218bbe7a102094531ad1a754a138a8155d408 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_connectivity_service_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connectivity_service import TapiConnectivityConnectivityService # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityConnectivityServiceWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, connectivity_service: TapiConnectivityConnectivityService=None): # noqa: E501 + """TapiConnectivityConnectivityServiceWrapper - a model defined in Swagger + + :param connectivity_service: The connectivity_service of this TapiConnectivityConnectivityServiceWrapper. # noqa: E501 + :type connectivity_service: TapiConnectivityConnectivityService + """ + self.swagger_types = { + 'connectivity_service': TapiConnectivityConnectivityService + } + + self.attribute_map = { + 'connectivity_service': 'connectivity-service' + } + self._connectivity_service = connectivity_service + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityConnectivityServiceWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ConnectivityServiceWrapper of this TapiConnectivityConnectivityServiceWrapper. # noqa: E501 + :rtype: TapiConnectivityConnectivityServiceWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def connectivity_service(self) -> TapiConnectivityConnectivityService: + """Gets the connectivity_service of this TapiConnectivityConnectivityServiceWrapper. + + + :return: The connectivity_service of this TapiConnectivityConnectivityServiceWrapper. + :rtype: TapiConnectivityConnectivityService + """ + return self._connectivity_service + + @connectivity_service.setter + def connectivity_service(self, connectivity_service: TapiConnectivityConnectivityService): + """Sets the connectivity_service of this TapiConnectivityConnectivityServiceWrapper. + + + :param connectivity_service: The connectivity_service of this TapiConnectivityConnectivityServiceWrapper. + :type connectivity_service: TapiConnectivityConnectivityService + """ + + self._connectivity_service = connectivity_service diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_context_augmentation3.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_context_augmentation3.py new file mode 100644 index 0000000000000000000000000000000000000000..1e4fe8d2064b1fc86c2f1a2de31584f052ff2ff1 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_context_augmentation3.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connectivity_context import TapiConnectivityConnectivityContext # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityContextAugmentation3(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, connectivity_context: TapiConnectivityConnectivityContext=None): # noqa: E501 + """TapiConnectivityContextAugmentation3 - a model defined in Swagger + + :param connectivity_context: The connectivity_context of this TapiConnectivityContextAugmentation3. # noqa: E501 + :type connectivity_context: TapiConnectivityConnectivityContext + """ + self.swagger_types = { + 'connectivity_context': TapiConnectivityConnectivityContext + } + + self.attribute_map = { + 'connectivity_context': 'connectivity-context' + } + self._connectivity_context = connectivity_context + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityContextAugmentation3': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ContextAugmentation3 of this TapiConnectivityContextAugmentation3. # noqa: E501 + :rtype: TapiConnectivityContextAugmentation3 + """ + return util.deserialize_model(dikt, cls) + + @property + def connectivity_context(self) -> TapiConnectivityConnectivityContext: + """Gets the connectivity_context of this TapiConnectivityContextAugmentation3. + + + :return: The connectivity_context of this TapiConnectivityContextAugmentation3. + :rtype: TapiConnectivityConnectivityContext + """ + return self._connectivity_context + + @connectivity_context.setter + def connectivity_context(self, connectivity_context: TapiConnectivityConnectivityContext): + """Sets the connectivity_context of this TapiConnectivityContextAugmentation3. + + + :param connectivity_context: The connectivity_context of this TapiConnectivityContextAugmentation3. + :type connectivity_context: TapiConnectivityConnectivityContext + """ + + self._connectivity_context = connectivity_context diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_coordinate_type.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_coordinate_type.py new file mode 100644 index 0000000000000000000000000000000000000000..f7924219f829bff23cd829cc5c1df365a30e610f --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_coordinate_type.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiConnectivityCoordinateType(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + NO_COORDINATE = "NO_COORDINATE" + HOLD_OFF_TIME = "HOLD_OFF_TIME" + WAIT_FOR_NOTIFICATION = "WAIT_FOR_NOTIFICATION" + def __init__(self): # noqa: E501 + """TapiConnectivityCoordinateType - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityCoordinateType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.CoordinateType of this TapiConnectivityCoordinateType. # noqa: E501 + :rtype: TapiConnectivityCoordinateType + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_create_connectivity_service.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_create_connectivity_service.py new file mode 100644 index 0000000000000000000000000000000000000000..1d22b1bfb6584a170b62717c63f780a27d662660 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_create_connectivity_service.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_createconnectivityservice_output import TapiConnectivityCreateconnectivityserviceOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityCreateConnectivityService(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiConnectivityCreateconnectivityserviceOutput=None): # noqa: E501 + """TapiConnectivityCreateConnectivityService - a model defined in Swagger + + :param output: The output of this TapiConnectivityCreateConnectivityService. # noqa: E501 + :type output: TapiConnectivityCreateconnectivityserviceOutput + """ + self.swagger_types = { + 'output': TapiConnectivityCreateconnectivityserviceOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityCreateConnectivityService': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.CreateConnectivityService of this TapiConnectivityCreateConnectivityService. # noqa: E501 + :rtype: TapiConnectivityCreateConnectivityService + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiConnectivityCreateconnectivityserviceOutput: + """Gets the output of this TapiConnectivityCreateConnectivityService. + + + :return: The output of this TapiConnectivityCreateConnectivityService. + :rtype: TapiConnectivityCreateconnectivityserviceOutput + """ + return self._output + + @output.setter + def output(self, output: TapiConnectivityCreateconnectivityserviceOutput): + """Sets the output of this TapiConnectivityCreateConnectivityService. + + + :param output: The output of this TapiConnectivityCreateConnectivityService. + :type output: TapiConnectivityCreateconnectivityserviceOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_createconnectivityservice_input.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_createconnectivityservice_input.py new file mode 100644 index 0000000000000000000000000000000000000000..dcb22ab3b2a1ccd9e75b4ae10dac4ae54694137e --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_createconnectivityservice_input.py @@ -0,0 +1,201 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connectivity_constraint import TapiConnectivityConnectivityConstraint # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_connectivity_service_end_point import TapiConnectivityConnectivityServiceEndPoint # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_resilience_constraint import TapiConnectivityResilienceConstraint # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_routing_constraint import TapiPathComputationRoutingConstraint # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_topology_constraint import TapiPathComputationTopologyConstraint # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityCreateconnectivityserviceInput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, topology_constraint: TapiPathComputationTopologyConstraint=None, end_point: List[TapiConnectivityConnectivityServiceEndPoint]=None, resilience_constraint: TapiConnectivityResilienceConstraint=None, routing_constraint: TapiPathComputationRoutingConstraint=None, state: str=None, connectivity_constraint: TapiConnectivityConnectivityConstraint=None): # noqa: E501 + """TapiConnectivityCreateconnectivityserviceInput - a model defined in Swagger + + :param topology_constraint: The topology_constraint of this TapiConnectivityCreateconnectivityserviceInput. # noqa: E501 + :type topology_constraint: TapiPathComputationTopologyConstraint + :param end_point: The end_point of this TapiConnectivityCreateconnectivityserviceInput. # noqa: E501 + :type end_point: List[TapiConnectivityConnectivityServiceEndPoint] + :param resilience_constraint: The resilience_constraint of this TapiConnectivityCreateconnectivityserviceInput. # noqa: E501 + :type resilience_constraint: TapiConnectivityResilienceConstraint + :param routing_constraint: The routing_constraint of this TapiConnectivityCreateconnectivityserviceInput. # noqa: E501 + :type routing_constraint: TapiPathComputationRoutingConstraint + :param state: The state of this TapiConnectivityCreateconnectivityserviceInput. # noqa: E501 + :type state: str + :param connectivity_constraint: The connectivity_constraint of this TapiConnectivityCreateconnectivityserviceInput. # noqa: E501 + :type connectivity_constraint: TapiConnectivityConnectivityConstraint + """ + self.swagger_types = { + 'topology_constraint': TapiPathComputationTopologyConstraint, + 'end_point': List[TapiConnectivityConnectivityServiceEndPoint], + 'resilience_constraint': TapiConnectivityResilienceConstraint, + 'routing_constraint': TapiPathComputationRoutingConstraint, + 'state': str, + 'connectivity_constraint': TapiConnectivityConnectivityConstraint + } + + self.attribute_map = { + 'topology_constraint': 'topology-constraint', + 'end_point': 'end-point', + 'resilience_constraint': 'resilience-constraint', + 'routing_constraint': 'routing-constraint', + 'state': 'state', + 'connectivity_constraint': 'connectivity-constraint' + } + self._topology_constraint = topology_constraint + self._end_point = end_point + self._resilience_constraint = resilience_constraint + self._routing_constraint = routing_constraint + self._state = state + self._connectivity_constraint = connectivity_constraint + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityCreateconnectivityserviceInput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.createconnectivityservice.Input of this TapiConnectivityCreateconnectivityserviceInput. # noqa: E501 + :rtype: TapiConnectivityCreateconnectivityserviceInput + """ + return util.deserialize_model(dikt, cls) + + @property + def topology_constraint(self) -> TapiPathComputationTopologyConstraint: + """Gets the topology_constraint of this TapiConnectivityCreateconnectivityserviceInput. + + + :return: The topology_constraint of this TapiConnectivityCreateconnectivityserviceInput. + :rtype: TapiPathComputationTopologyConstraint + """ + return self._topology_constraint + + @topology_constraint.setter + def topology_constraint(self, topology_constraint: TapiPathComputationTopologyConstraint): + """Sets the topology_constraint of this TapiConnectivityCreateconnectivityserviceInput. + + + :param topology_constraint: The topology_constraint of this TapiConnectivityCreateconnectivityserviceInput. + :type topology_constraint: TapiPathComputationTopologyConstraint + """ + + self._topology_constraint = topology_constraint + + @property + def end_point(self) -> List[TapiConnectivityConnectivityServiceEndPoint]: + """Gets the end_point of this TapiConnectivityCreateconnectivityserviceInput. + + none # noqa: E501 + + :return: The end_point of this TapiConnectivityCreateconnectivityserviceInput. + :rtype: List[TapiConnectivityConnectivityServiceEndPoint] + """ + return self._end_point + + @end_point.setter + def end_point(self, end_point: List[TapiConnectivityConnectivityServiceEndPoint]): + """Sets the end_point of this TapiConnectivityCreateconnectivityserviceInput. + + none # noqa: E501 + + :param end_point: The end_point of this TapiConnectivityCreateconnectivityserviceInput. + :type end_point: List[TapiConnectivityConnectivityServiceEndPoint] + """ + + self._end_point = end_point + + @property + def resilience_constraint(self) -> TapiConnectivityResilienceConstraint: + """Gets the resilience_constraint of this TapiConnectivityCreateconnectivityserviceInput. + + + :return: The resilience_constraint of this TapiConnectivityCreateconnectivityserviceInput. + :rtype: TapiConnectivityResilienceConstraint + """ + return self._resilience_constraint + + @resilience_constraint.setter + def resilience_constraint(self, resilience_constraint: TapiConnectivityResilienceConstraint): + """Sets the resilience_constraint of this TapiConnectivityCreateconnectivityserviceInput. + + + :param resilience_constraint: The resilience_constraint of this TapiConnectivityCreateconnectivityserviceInput. + :type resilience_constraint: TapiConnectivityResilienceConstraint + """ + + self._resilience_constraint = resilience_constraint + + @property + def routing_constraint(self) -> TapiPathComputationRoutingConstraint: + """Gets the routing_constraint of this TapiConnectivityCreateconnectivityserviceInput. + + + :return: The routing_constraint of this TapiConnectivityCreateconnectivityserviceInput. + :rtype: TapiPathComputationRoutingConstraint + """ + return self._routing_constraint + + @routing_constraint.setter + def routing_constraint(self, routing_constraint: TapiPathComputationRoutingConstraint): + """Sets the routing_constraint of this TapiConnectivityCreateconnectivityserviceInput. + + + :param routing_constraint: The routing_constraint of this TapiConnectivityCreateconnectivityserviceInput. + :type routing_constraint: TapiPathComputationRoutingConstraint + """ + + self._routing_constraint = routing_constraint + + @property + def state(self) -> str: + """Gets the state of this TapiConnectivityCreateconnectivityserviceInput. + + none # noqa: E501 + + :return: The state of this TapiConnectivityCreateconnectivityserviceInput. + :rtype: str + """ + return self._state + + @state.setter + def state(self, state: str): + """Sets the state of this TapiConnectivityCreateconnectivityserviceInput. + + none # noqa: E501 + + :param state: The state of this TapiConnectivityCreateconnectivityserviceInput. + :type state: str + """ + + self._state = state + + @property + def connectivity_constraint(self) -> TapiConnectivityConnectivityConstraint: + """Gets the connectivity_constraint of this TapiConnectivityCreateconnectivityserviceInput. + + + :return: The connectivity_constraint of this TapiConnectivityCreateconnectivityserviceInput. + :rtype: TapiConnectivityConnectivityConstraint + """ + return self._connectivity_constraint + + @connectivity_constraint.setter + def connectivity_constraint(self, connectivity_constraint: TapiConnectivityConnectivityConstraint): + """Sets the connectivity_constraint of this TapiConnectivityCreateconnectivityserviceInput. + + + :param connectivity_constraint: The connectivity_constraint of this TapiConnectivityCreateconnectivityserviceInput. + :type connectivity_constraint: TapiConnectivityConnectivityConstraint + """ + + self._connectivity_constraint = connectivity_constraint diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_createconnectivityservice_output.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_createconnectivityservice_output.py new file mode 100644 index 0000000000000000000000000000000000000000..a17efd6245eddeec5c4a3b2fe85b8e35de253dc6 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_createconnectivityservice_output.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connectivity_service import TapiConnectivityConnectivityService # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityCreateconnectivityserviceOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, service: TapiConnectivityConnectivityService=None): # noqa: E501 + """TapiConnectivityCreateconnectivityserviceOutput - a model defined in Swagger + + :param service: The service of this TapiConnectivityCreateconnectivityserviceOutput. # noqa: E501 + :type service: TapiConnectivityConnectivityService + """ + self.swagger_types = { + 'service': TapiConnectivityConnectivityService + } + + self.attribute_map = { + 'service': 'service' + } + self._service = service + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityCreateconnectivityserviceOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.createconnectivityservice.Output of this TapiConnectivityCreateconnectivityserviceOutput. # noqa: E501 + :rtype: TapiConnectivityCreateconnectivityserviceOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def service(self) -> TapiConnectivityConnectivityService: + """Gets the service of this TapiConnectivityCreateconnectivityserviceOutput. + + + :return: The service of this TapiConnectivityCreateconnectivityserviceOutput. + :rtype: TapiConnectivityConnectivityService + """ + return self._service + + @service.setter + def service(self, service: TapiConnectivityConnectivityService): + """Sets the service of this TapiConnectivityCreateconnectivityserviceOutput. + + + :param service: The service of this TapiConnectivityCreateconnectivityserviceOutput. + :type service: TapiConnectivityConnectivityService + """ + + self._service = service diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_deleteconnectivityservice_input.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_deleteconnectivityservice_input.py new file mode 100644 index 0000000000000000000000000000000000000000..b2bd8d52488b5f193a9c72ed968f7cc441c9bba2 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_deleteconnectivityservice_input.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiConnectivityDeleteconnectivityserviceInput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, service_id_or_name: str=None): # noqa: E501 + """TapiConnectivityDeleteconnectivityserviceInput - a model defined in Swagger + + :param service_id_or_name: The service_id_or_name of this TapiConnectivityDeleteconnectivityserviceInput. # noqa: E501 + :type service_id_or_name: str + """ + self.swagger_types = { + 'service_id_or_name': str + } + + self.attribute_map = { + 'service_id_or_name': 'service-id-or-name' + } + self._service_id_or_name = service_id_or_name + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityDeleteconnectivityserviceInput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.deleteconnectivityservice.Input of this TapiConnectivityDeleteconnectivityserviceInput. # noqa: E501 + :rtype: TapiConnectivityDeleteconnectivityserviceInput + """ + return util.deserialize_model(dikt, cls) + + @property + def service_id_or_name(self) -> str: + """Gets the service_id_or_name of this TapiConnectivityDeleteconnectivityserviceInput. + + none # noqa: E501 + + :return: The service_id_or_name of this TapiConnectivityDeleteconnectivityserviceInput. + :rtype: str + """ + return self._service_id_or_name + + @service_id_or_name.setter + def service_id_or_name(self, service_id_or_name: str): + """Sets the service_id_or_name of this TapiConnectivityDeleteconnectivityserviceInput. + + none # noqa: E501 + + :param service_id_or_name: The service_id_or_name of this TapiConnectivityDeleteconnectivityserviceInput. + :type service_id_or_name: str + """ + + self._service_id_or_name = service_id_or_name diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_get_connection_details.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_get_connection_details.py new file mode 100644 index 0000000000000000000000000000000000000000..dcef8c372f3cf195909391e153e2569d01991c4d --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_get_connection_details.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_getconnectiondetails_output import TapiConnectivityGetconnectiondetailsOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityGetConnectionDetails(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiConnectivityGetconnectiondetailsOutput=None): # noqa: E501 + """TapiConnectivityGetConnectionDetails - a model defined in Swagger + + :param output: The output of this TapiConnectivityGetConnectionDetails. # noqa: E501 + :type output: TapiConnectivityGetconnectiondetailsOutput + """ + self.swagger_types = { + 'output': TapiConnectivityGetconnectiondetailsOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityGetConnectionDetails': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.GetConnectionDetails of this TapiConnectivityGetConnectionDetails. # noqa: E501 + :rtype: TapiConnectivityGetConnectionDetails + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiConnectivityGetconnectiondetailsOutput: + """Gets the output of this TapiConnectivityGetConnectionDetails. + + + :return: The output of this TapiConnectivityGetConnectionDetails. + :rtype: TapiConnectivityGetconnectiondetailsOutput + """ + return self._output + + @output.setter + def output(self, output: TapiConnectivityGetconnectiondetailsOutput): + """Sets the output of this TapiConnectivityGetConnectionDetails. + + + :param output: The output of this TapiConnectivityGetConnectionDetails. + :type output: TapiConnectivityGetconnectiondetailsOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_get_connection_end_point_details.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_get_connection_end_point_details.py new file mode 100644 index 0000000000000000000000000000000000000000..8ef8320b6264708a9958aee5cd6b655f023cf639 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_get_connection_end_point_details.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_getconnectionendpointdetails_output import TapiConnectivityGetconnectionendpointdetailsOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityGetConnectionEndPointDetails(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiConnectivityGetconnectionendpointdetailsOutput=None): # noqa: E501 + """TapiConnectivityGetConnectionEndPointDetails - a model defined in Swagger + + :param output: The output of this TapiConnectivityGetConnectionEndPointDetails. # noqa: E501 + :type output: TapiConnectivityGetconnectionendpointdetailsOutput + """ + self.swagger_types = { + 'output': TapiConnectivityGetconnectionendpointdetailsOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityGetConnectionEndPointDetails': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.GetConnectionEndPointDetails of this TapiConnectivityGetConnectionEndPointDetails. # noqa: E501 + :rtype: TapiConnectivityGetConnectionEndPointDetails + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiConnectivityGetconnectionendpointdetailsOutput: + """Gets the output of this TapiConnectivityGetConnectionEndPointDetails. + + + :return: The output of this TapiConnectivityGetConnectionEndPointDetails. + :rtype: TapiConnectivityGetconnectionendpointdetailsOutput + """ + return self._output + + @output.setter + def output(self, output: TapiConnectivityGetconnectionendpointdetailsOutput): + """Sets the output of this TapiConnectivityGetConnectionEndPointDetails. + + + :param output: The output of this TapiConnectivityGetConnectionEndPointDetails. + :type output: TapiConnectivityGetconnectionendpointdetailsOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_get_connectivity_service_details.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_get_connectivity_service_details.py new file mode 100644 index 0000000000000000000000000000000000000000..94634c34435a9cf3e8c16f8a85b369b50c31021c --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_get_connectivity_service_details.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_getconnectivityservicedetails_output import TapiConnectivityGetconnectivityservicedetailsOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityGetConnectivityServiceDetails(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiConnectivityGetconnectivityservicedetailsOutput=None): # noqa: E501 + """TapiConnectivityGetConnectivityServiceDetails - a model defined in Swagger + + :param output: The output of this TapiConnectivityGetConnectivityServiceDetails. # noqa: E501 + :type output: TapiConnectivityGetconnectivityservicedetailsOutput + """ + self.swagger_types = { + 'output': TapiConnectivityGetconnectivityservicedetailsOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityGetConnectivityServiceDetails': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.GetConnectivityServiceDetails of this TapiConnectivityGetConnectivityServiceDetails. # noqa: E501 + :rtype: TapiConnectivityGetConnectivityServiceDetails + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiConnectivityGetconnectivityservicedetailsOutput: + """Gets the output of this TapiConnectivityGetConnectivityServiceDetails. + + + :return: The output of this TapiConnectivityGetConnectivityServiceDetails. + :rtype: TapiConnectivityGetconnectivityservicedetailsOutput + """ + return self._output + + @output.setter + def output(self, output: TapiConnectivityGetconnectivityservicedetailsOutput): + """Sets the output of this TapiConnectivityGetConnectivityServiceDetails. + + + :param output: The output of this TapiConnectivityGetConnectivityServiceDetails. + :type output: TapiConnectivityGetconnectivityservicedetailsOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_get_connectivity_service_list.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_get_connectivity_service_list.py new file mode 100644 index 0000000000000000000000000000000000000000..0690417e6db422b8db768fef5a6e9b33bdfb36d7 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_get_connectivity_service_list.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_getconnectivityservicelist_output import TapiConnectivityGetconnectivityservicelistOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityGetConnectivityServiceList(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiConnectivityGetconnectivityservicelistOutput=None): # noqa: E501 + """TapiConnectivityGetConnectivityServiceList - a model defined in Swagger + + :param output: The output of this TapiConnectivityGetConnectivityServiceList. # noqa: E501 + :type output: TapiConnectivityGetconnectivityservicelistOutput + """ + self.swagger_types = { + 'output': TapiConnectivityGetconnectivityservicelistOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityGetConnectivityServiceList': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.GetConnectivityServiceList of this TapiConnectivityGetConnectivityServiceList. # noqa: E501 + :rtype: TapiConnectivityGetConnectivityServiceList + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiConnectivityGetconnectivityservicelistOutput: + """Gets the output of this TapiConnectivityGetConnectivityServiceList. + + + :return: The output of this TapiConnectivityGetConnectivityServiceList. + :rtype: TapiConnectivityGetconnectivityservicelistOutput + """ + return self._output + + @output.setter + def output(self, output: TapiConnectivityGetconnectivityservicelistOutput): + """Sets the output of this TapiConnectivityGetConnectivityServiceList. + + + :param output: The output of this TapiConnectivityGetConnectivityServiceList. + :type output: TapiConnectivityGetconnectivityservicelistOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_getconnectiondetails_input.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_getconnectiondetails_input.py new file mode 100644 index 0000000000000000000000000000000000000000..e67339d980718a136b9176871eb6dc8a42aec0a3 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_getconnectiondetails_input.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiConnectivityGetconnectiondetailsInput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, connection_id_or_name: str=None): # noqa: E501 + """TapiConnectivityGetconnectiondetailsInput - a model defined in Swagger + + :param connection_id_or_name: The connection_id_or_name of this TapiConnectivityGetconnectiondetailsInput. # noqa: E501 + :type connection_id_or_name: str + """ + self.swagger_types = { + 'connection_id_or_name': str + } + + self.attribute_map = { + 'connection_id_or_name': 'connection-id-or-name' + } + self._connection_id_or_name = connection_id_or_name + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityGetconnectiondetailsInput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.getconnectiondetails.Input of this TapiConnectivityGetconnectiondetailsInput. # noqa: E501 + :rtype: TapiConnectivityGetconnectiondetailsInput + """ + return util.deserialize_model(dikt, cls) + + @property + def connection_id_or_name(self) -> str: + """Gets the connection_id_or_name of this TapiConnectivityGetconnectiondetailsInput. + + none # noqa: E501 + + :return: The connection_id_or_name of this TapiConnectivityGetconnectiondetailsInput. + :rtype: str + """ + return self._connection_id_or_name + + @connection_id_or_name.setter + def connection_id_or_name(self, connection_id_or_name: str): + """Sets the connection_id_or_name of this TapiConnectivityGetconnectiondetailsInput. + + none # noqa: E501 + + :param connection_id_or_name: The connection_id_or_name of this TapiConnectivityGetconnectiondetailsInput. + :type connection_id_or_name: str + """ + + self._connection_id_or_name = connection_id_or_name diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_getconnectiondetails_output.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_getconnectiondetails_output.py new file mode 100644 index 0000000000000000000000000000000000000000..cf93f482c72a65f18f757293e21eec75a1e3f2b6 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_getconnectiondetails_output.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connection import TapiConnectivityConnection # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityGetconnectiondetailsOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, connection: TapiConnectivityConnection=None): # noqa: E501 + """TapiConnectivityGetconnectiondetailsOutput - a model defined in Swagger + + :param connection: The connection of this TapiConnectivityGetconnectiondetailsOutput. # noqa: E501 + :type connection: TapiConnectivityConnection + """ + self.swagger_types = { + 'connection': TapiConnectivityConnection + } + + self.attribute_map = { + 'connection': 'connection' + } + self._connection = connection + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityGetconnectiondetailsOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.getconnectiondetails.Output of this TapiConnectivityGetconnectiondetailsOutput. # noqa: E501 + :rtype: TapiConnectivityGetconnectiondetailsOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def connection(self) -> TapiConnectivityConnection: + """Gets the connection of this TapiConnectivityGetconnectiondetailsOutput. + + + :return: The connection of this TapiConnectivityGetconnectiondetailsOutput. + :rtype: TapiConnectivityConnection + """ + return self._connection + + @connection.setter + def connection(self, connection: TapiConnectivityConnection): + """Sets the connection of this TapiConnectivityGetconnectiondetailsOutput. + + + :param connection: The connection of this TapiConnectivityGetconnectiondetailsOutput. + :type connection: TapiConnectivityConnection + """ + + self._connection = connection diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_getconnectionendpointdetails_input.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_getconnectionendpointdetails_input.py new file mode 100644 index 0000000000000000000000000000000000000000..86ca4a4c459555fbd662a42b67256513f3861930 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_getconnectionendpointdetails_input.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiConnectivityGetconnectionendpointdetailsInput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, cep_id_or_name: str=None, nep_id_or_name: str=None, node_id_or_name: str=None, topology_id_or_name: str=None): # noqa: E501 + """TapiConnectivityGetconnectionendpointdetailsInput - a model defined in Swagger + + :param cep_id_or_name: The cep_id_or_name of this TapiConnectivityGetconnectionendpointdetailsInput. # noqa: E501 + :type cep_id_or_name: str + :param nep_id_or_name: The nep_id_or_name of this TapiConnectivityGetconnectionendpointdetailsInput. # noqa: E501 + :type nep_id_or_name: str + :param node_id_or_name: The node_id_or_name of this TapiConnectivityGetconnectionendpointdetailsInput. # noqa: E501 + :type node_id_or_name: str + :param topology_id_or_name: The topology_id_or_name of this TapiConnectivityGetconnectionendpointdetailsInput. # noqa: E501 + :type topology_id_or_name: str + """ + self.swagger_types = { + 'cep_id_or_name': str, + 'nep_id_or_name': str, + 'node_id_or_name': str, + 'topology_id_or_name': str + } + + self.attribute_map = { + 'cep_id_or_name': 'cep-id-or-name', + 'nep_id_or_name': 'nep-id-or-name', + 'node_id_or_name': 'node-id-or-name', + 'topology_id_or_name': 'topology-id-or-name' + } + self._cep_id_or_name = cep_id_or_name + self._nep_id_or_name = nep_id_or_name + self._node_id_or_name = node_id_or_name + self._topology_id_or_name = topology_id_or_name + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityGetconnectionendpointdetailsInput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.getconnectionendpointdetails.Input of this TapiConnectivityGetconnectionendpointdetailsInput. # noqa: E501 + :rtype: TapiConnectivityGetconnectionendpointdetailsInput + """ + return util.deserialize_model(dikt, cls) + + @property + def cep_id_or_name(self) -> str: + """Gets the cep_id_or_name of this TapiConnectivityGetconnectionendpointdetailsInput. + + none # noqa: E501 + + :return: The cep_id_or_name of this TapiConnectivityGetconnectionendpointdetailsInput. + :rtype: str + """ + return self._cep_id_or_name + + @cep_id_or_name.setter + def cep_id_or_name(self, cep_id_or_name: str): + """Sets the cep_id_or_name of this TapiConnectivityGetconnectionendpointdetailsInput. + + none # noqa: E501 + + :param cep_id_or_name: The cep_id_or_name of this TapiConnectivityGetconnectionendpointdetailsInput. + :type cep_id_or_name: str + """ + + self._cep_id_or_name = cep_id_or_name + + @property + def nep_id_or_name(self) -> str: + """Gets the nep_id_or_name of this TapiConnectivityGetconnectionendpointdetailsInput. + + none # noqa: E501 + + :return: The nep_id_or_name of this TapiConnectivityGetconnectionendpointdetailsInput. + :rtype: str + """ + return self._nep_id_or_name + + @nep_id_or_name.setter + def nep_id_or_name(self, nep_id_or_name: str): + """Sets the nep_id_or_name of this TapiConnectivityGetconnectionendpointdetailsInput. + + none # noqa: E501 + + :param nep_id_or_name: The nep_id_or_name of this TapiConnectivityGetconnectionendpointdetailsInput. + :type nep_id_or_name: str + """ + + self._nep_id_or_name = nep_id_or_name + + @property + def node_id_or_name(self) -> str: + """Gets the node_id_or_name of this TapiConnectivityGetconnectionendpointdetailsInput. + + none # noqa: E501 + + :return: The node_id_or_name of this TapiConnectivityGetconnectionendpointdetailsInput. + :rtype: str + """ + return self._node_id_or_name + + @node_id_or_name.setter + def node_id_or_name(self, node_id_or_name: str): + """Sets the node_id_or_name of this TapiConnectivityGetconnectionendpointdetailsInput. + + none # noqa: E501 + + :param node_id_or_name: The node_id_or_name of this TapiConnectivityGetconnectionendpointdetailsInput. + :type node_id_or_name: str + """ + + self._node_id_or_name = node_id_or_name + + @property + def topology_id_or_name(self) -> str: + """Gets the topology_id_or_name of this TapiConnectivityGetconnectionendpointdetailsInput. + + none # noqa: E501 + + :return: The topology_id_or_name of this TapiConnectivityGetconnectionendpointdetailsInput. + :rtype: str + """ + return self._topology_id_or_name + + @topology_id_or_name.setter + def topology_id_or_name(self, topology_id_or_name: str): + """Sets the topology_id_or_name of this TapiConnectivityGetconnectionendpointdetailsInput. + + none # noqa: E501 + + :param topology_id_or_name: The topology_id_or_name of this TapiConnectivityGetconnectionendpointdetailsInput. + :type topology_id_or_name: str + """ + + self._topology_id_or_name = topology_id_or_name diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_getconnectionendpointdetails_output.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_getconnectionendpointdetails_output.py new file mode 100644 index 0000000000000000000000000000000000000000..d7a9e6e03bae5fdf4c7166c9bb229de138d95ead --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_getconnectionendpointdetails_output.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connection_end_point import TapiConnectivityConnectionEndPoint # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityGetconnectionendpointdetailsOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, connection_end_point: TapiConnectivityConnectionEndPoint=None): # noqa: E501 + """TapiConnectivityGetconnectionendpointdetailsOutput - a model defined in Swagger + + :param connection_end_point: The connection_end_point of this TapiConnectivityGetconnectionendpointdetailsOutput. # noqa: E501 + :type connection_end_point: TapiConnectivityConnectionEndPoint + """ + self.swagger_types = { + 'connection_end_point': TapiConnectivityConnectionEndPoint + } + + self.attribute_map = { + 'connection_end_point': 'connection-end-point' + } + self._connection_end_point = connection_end_point + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityGetconnectionendpointdetailsOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.getconnectionendpointdetails.Output of this TapiConnectivityGetconnectionendpointdetailsOutput. # noqa: E501 + :rtype: TapiConnectivityGetconnectionendpointdetailsOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def connection_end_point(self) -> TapiConnectivityConnectionEndPoint: + """Gets the connection_end_point of this TapiConnectivityGetconnectionendpointdetailsOutput. + + + :return: The connection_end_point of this TapiConnectivityGetconnectionendpointdetailsOutput. + :rtype: TapiConnectivityConnectionEndPoint + """ + return self._connection_end_point + + @connection_end_point.setter + def connection_end_point(self, connection_end_point: TapiConnectivityConnectionEndPoint): + """Sets the connection_end_point of this TapiConnectivityGetconnectionendpointdetailsOutput. + + + :param connection_end_point: The connection_end_point of this TapiConnectivityGetconnectionendpointdetailsOutput. + :type connection_end_point: TapiConnectivityConnectionEndPoint + """ + + self._connection_end_point = connection_end_point diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_getconnectivityservicedetails_input.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_getconnectivityservicedetails_input.py new file mode 100644 index 0000000000000000000000000000000000000000..820758a5544b01c776625a4f85d2222f40b15d21 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_getconnectivityservicedetails_input.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiConnectivityGetconnectivityservicedetailsInput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, service_id_or_name: str=None): # noqa: E501 + """TapiConnectivityGetconnectivityservicedetailsInput - a model defined in Swagger + + :param service_id_or_name: The service_id_or_name of this TapiConnectivityGetconnectivityservicedetailsInput. # noqa: E501 + :type service_id_or_name: str + """ + self.swagger_types = { + 'service_id_or_name': str + } + + self.attribute_map = { + 'service_id_or_name': 'service-id-or-name' + } + self._service_id_or_name = service_id_or_name + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityGetconnectivityservicedetailsInput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.getconnectivityservicedetails.Input of this TapiConnectivityGetconnectivityservicedetailsInput. # noqa: E501 + :rtype: TapiConnectivityGetconnectivityservicedetailsInput + """ + return util.deserialize_model(dikt, cls) + + @property + def service_id_or_name(self) -> str: + """Gets the service_id_or_name of this TapiConnectivityGetconnectivityservicedetailsInput. + + none # noqa: E501 + + :return: The service_id_or_name of this TapiConnectivityGetconnectivityservicedetailsInput. + :rtype: str + """ + return self._service_id_or_name + + @service_id_or_name.setter + def service_id_or_name(self, service_id_or_name: str): + """Sets the service_id_or_name of this TapiConnectivityGetconnectivityservicedetailsInput. + + none # noqa: E501 + + :param service_id_or_name: The service_id_or_name of this TapiConnectivityGetconnectivityservicedetailsInput. + :type service_id_or_name: str + """ + + self._service_id_or_name = service_id_or_name diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_getconnectivityservicedetails_output.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_getconnectivityservicedetails_output.py new file mode 100644 index 0000000000000000000000000000000000000000..3b08975ce29bba78f9184d96758dbe1041882525 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_getconnectivityservicedetails_output.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connectivity_service import TapiConnectivityConnectivityService # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityGetconnectivityservicedetailsOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, service: TapiConnectivityConnectivityService=None): # noqa: E501 + """TapiConnectivityGetconnectivityservicedetailsOutput - a model defined in Swagger + + :param service: The service of this TapiConnectivityGetconnectivityservicedetailsOutput. # noqa: E501 + :type service: TapiConnectivityConnectivityService + """ + self.swagger_types = { + 'service': TapiConnectivityConnectivityService + } + + self.attribute_map = { + 'service': 'service' + } + self._service = service + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityGetconnectivityservicedetailsOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.getconnectivityservicedetails.Output of this TapiConnectivityGetconnectivityservicedetailsOutput. # noqa: E501 + :rtype: TapiConnectivityGetconnectivityservicedetailsOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def service(self) -> TapiConnectivityConnectivityService: + """Gets the service of this TapiConnectivityGetconnectivityservicedetailsOutput. + + + :return: The service of this TapiConnectivityGetconnectivityservicedetailsOutput. + :rtype: TapiConnectivityConnectivityService + """ + return self._service + + @service.setter + def service(self, service: TapiConnectivityConnectivityService): + """Sets the service of this TapiConnectivityGetconnectivityservicedetailsOutput. + + + :param service: The service of this TapiConnectivityGetconnectivityservicedetailsOutput. + :type service: TapiConnectivityConnectivityService + """ + + self._service = service diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_getconnectivityservicelist_output.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_getconnectivityservicelist_output.py new file mode 100644 index 0000000000000000000000000000000000000000..6490999b3799cb16883db8898199bc4872b12f66 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_getconnectivityservicelist_output.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connectivity_service import TapiConnectivityConnectivityService # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityGetconnectivityservicelistOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, service: List[TapiConnectivityConnectivityService]=None): # noqa: E501 + """TapiConnectivityGetconnectivityservicelistOutput - a model defined in Swagger + + :param service: The service of this TapiConnectivityGetconnectivityservicelistOutput. # noqa: E501 + :type service: List[TapiConnectivityConnectivityService] + """ + self.swagger_types = { + 'service': List[TapiConnectivityConnectivityService] + } + + self.attribute_map = { + 'service': 'service' + } + self._service = service + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityGetconnectivityservicelistOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.getconnectivityservicelist.Output of this TapiConnectivityGetconnectivityservicelistOutput. # noqa: E501 + :rtype: TapiConnectivityGetconnectivityservicelistOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def service(self) -> List[TapiConnectivityConnectivityService]: + """Gets the service of this TapiConnectivityGetconnectivityservicelistOutput. + + none # noqa: E501 + + :return: The service of this TapiConnectivityGetconnectivityservicelistOutput. + :rtype: List[TapiConnectivityConnectivityService] + """ + return self._service + + @service.setter + def service(self, service: List[TapiConnectivityConnectivityService]): + """Sets the service of this TapiConnectivityGetconnectivityservicelistOutput. + + none # noqa: E501 + + :param service: The service of this TapiConnectivityGetconnectivityservicelistOutput. + :type service: List[TapiConnectivityConnectivityService] + """ + + self._service = service diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_owned_node_edge_point_augmentation1.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_owned_node_edge_point_augmentation1.py new file mode 100644 index 0000000000000000000000000000000000000000..b3ee274b1a4d9c5c9959a695166898411f82a88f --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_owned_node_edge_point_augmentation1.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_cep_list import TapiConnectivityCepList # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityOwnedNodeEdgePointAugmentation1(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, cep_list: TapiConnectivityCepList=None): # noqa: E501 + """TapiConnectivityOwnedNodeEdgePointAugmentation1 - a model defined in Swagger + + :param cep_list: The cep_list of this TapiConnectivityOwnedNodeEdgePointAugmentation1. # noqa: E501 + :type cep_list: TapiConnectivityCepList + """ + self.swagger_types = { + 'cep_list': TapiConnectivityCepList + } + + self.attribute_map = { + 'cep_list': 'cep-list' + } + self._cep_list = cep_list + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityOwnedNodeEdgePointAugmentation1': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.OwnedNodeEdgePointAugmentation1 of this TapiConnectivityOwnedNodeEdgePointAugmentation1. # noqa: E501 + :rtype: TapiConnectivityOwnedNodeEdgePointAugmentation1 + """ + return util.deserialize_model(dikt, cls) + + @property + def cep_list(self) -> TapiConnectivityCepList: + """Gets the cep_list of this TapiConnectivityOwnedNodeEdgePointAugmentation1. + + + :return: The cep_list of this TapiConnectivityOwnedNodeEdgePointAugmentation1. + :rtype: TapiConnectivityCepList + """ + return self._cep_list + + @cep_list.setter + def cep_list(self, cep_list: TapiConnectivityCepList): + """Sets the cep_list of this TapiConnectivityOwnedNodeEdgePointAugmentation1. + + + :param cep_list: The cep_list of this TapiConnectivityOwnedNodeEdgePointAugmentation1. + :type cep_list: TapiConnectivityCepList + """ + + self._cep_list = cep_list diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_protection_role.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_protection_role.py new file mode 100644 index 0000000000000000000000000000000000000000..045f9e0d1a83295ea6afe9c7e22fc2f7dcaf2be8 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_protection_role.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiConnectivityProtectionRole(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + WORK = "WORK" + PROTECT = "PROTECT" + PROTECTED = "PROTECTED" + NA = "NA" + WORK_RESTORE = "WORK_RESTORE" + PROTECT_RESTORE = "PROTECT_RESTORE" + def __init__(self): # noqa: E501 + """TapiConnectivityProtectionRole - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityProtectionRole': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ProtectionRole of this TapiConnectivityProtectionRole. # noqa: E501 + :rtype: TapiConnectivityProtectionRole + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_resilience_constraint.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_resilience_constraint.py new file mode 100644 index 0000000000000000000000000000000000000000..d122587aa99abe20cb93592fe253a7c5190b3a55 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_resilience_constraint.py @@ -0,0 +1,342 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_coordinate_type import TapiConnectivityCoordinateType # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_reversion_mode import TapiConnectivityReversionMode # noqa: F401,E501 +from tapi_server.models.tapi_topology_resilience_type import TapiTopologyResilienceType # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityResilienceConstraint(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, is_lock_out: bool=False, max_switch_times: int=None, restoration_coordinate_type: TapiConnectivityCoordinateType=None, is_coordinated_switching_both_ends: bool=False, hold_off_time: int=None, is_frozen: bool=False, wait_to_revert_time: int=15, resilience_type: TapiTopologyResilienceType=None, preferred_restoration_layer: List[TapiCommonLayerProtocolName]=None, restore_priority: int=None, reversion_mode: TapiConnectivityReversionMode=None): # noqa: E501 + """TapiConnectivityResilienceConstraint - a model defined in Swagger + + :param is_lock_out: The is_lock_out of this TapiConnectivityResilienceConstraint. # noqa: E501 + :type is_lock_out: bool + :param max_switch_times: The max_switch_times of this TapiConnectivityResilienceConstraint. # noqa: E501 + :type max_switch_times: int + :param restoration_coordinate_type: The restoration_coordinate_type of this TapiConnectivityResilienceConstraint. # noqa: E501 + :type restoration_coordinate_type: TapiConnectivityCoordinateType + :param is_coordinated_switching_both_ends: The is_coordinated_switching_both_ends of this TapiConnectivityResilienceConstraint. # noqa: E501 + :type is_coordinated_switching_both_ends: bool + :param hold_off_time: The hold_off_time of this TapiConnectivityResilienceConstraint. # noqa: E501 + :type hold_off_time: int + :param is_frozen: The is_frozen of this TapiConnectivityResilienceConstraint. # noqa: E501 + :type is_frozen: bool + :param wait_to_revert_time: The wait_to_revert_time of this TapiConnectivityResilienceConstraint. # noqa: E501 + :type wait_to_revert_time: int + :param resilience_type: The resilience_type of this TapiConnectivityResilienceConstraint. # noqa: E501 + :type resilience_type: TapiTopologyResilienceType + :param preferred_restoration_layer: The preferred_restoration_layer of this TapiConnectivityResilienceConstraint. # noqa: E501 + :type preferred_restoration_layer: List[TapiCommonLayerProtocolName] + :param restore_priority: The restore_priority of this TapiConnectivityResilienceConstraint. # noqa: E501 + :type restore_priority: int + :param reversion_mode: The reversion_mode of this TapiConnectivityResilienceConstraint. # noqa: E501 + :type reversion_mode: TapiConnectivityReversionMode + """ + self.swagger_types = { + 'is_lock_out': bool, + 'max_switch_times': int, + 'restoration_coordinate_type': TapiConnectivityCoordinateType, + 'is_coordinated_switching_both_ends': bool, + 'hold_off_time': int, + 'is_frozen': bool, + 'wait_to_revert_time': int, + 'resilience_type': TapiTopologyResilienceType, + 'preferred_restoration_layer': List[TapiCommonLayerProtocolName], + 'restore_priority': int, + 'reversion_mode': TapiConnectivityReversionMode + } + + self.attribute_map = { + 'is_lock_out': 'is-lock-out', + 'max_switch_times': 'max-switch-times', + 'restoration_coordinate_type': 'restoration-coordinate-type', + 'is_coordinated_switching_both_ends': 'is-coordinated-switching-both-ends', + 'hold_off_time': 'hold-off-time', + 'is_frozen': 'is-frozen', + 'wait_to_revert_time': 'wait-to-revert-time', + 'resilience_type': 'resilience-type', + 'preferred_restoration_layer': 'preferred-restoration-layer', + 'restore_priority': 'restore-priority', + 'reversion_mode': 'reversion-mode' + } + self._is_lock_out = is_lock_out + self._max_switch_times = max_switch_times + self._restoration_coordinate_type = restoration_coordinate_type + self._is_coordinated_switching_both_ends = is_coordinated_switching_both_ends + self._hold_off_time = hold_off_time + self._is_frozen = is_frozen + self._wait_to_revert_time = wait_to_revert_time + self._resilience_type = resilience_type + self._preferred_restoration_layer = preferred_restoration_layer + self._restore_priority = restore_priority + self._reversion_mode = reversion_mode + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityResilienceConstraint': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ResilienceConstraint of this TapiConnectivityResilienceConstraint. # noqa: E501 + :rtype: TapiConnectivityResilienceConstraint + """ + return util.deserialize_model(dikt, cls) + + @property + def is_lock_out(self) -> bool: + """Gets the is_lock_out of this TapiConnectivityResilienceConstraint. + + The resource is configured to temporarily not be available for use in the protection scheme(s) it is part of. This overrides all other protection control states including forced. If the item is locked out then it cannot be used under any circumstances. Note: Only relevant when part of a protection scheme. # noqa: E501 + + :return: The is_lock_out of this TapiConnectivityResilienceConstraint. + :rtype: bool + """ + return self._is_lock_out + + @is_lock_out.setter + def is_lock_out(self, is_lock_out: bool): + """Sets the is_lock_out of this TapiConnectivityResilienceConstraint. + + The resource is configured to temporarily not be available for use in the protection scheme(s) it is part of. This overrides all other protection control states including forced. If the item is locked out then it cannot be used under any circumstances. Note: Only relevant when part of a protection scheme. # noqa: E501 + + :param is_lock_out: The is_lock_out of this TapiConnectivityResilienceConstraint. + :type is_lock_out: bool + """ + + self._is_lock_out = is_lock_out + + @property + def max_switch_times(self) -> int: + """Gets the max_switch_times of this TapiConnectivityResilienceConstraint. + + Used to limit the maximum swtich times. When work fault disappears , and traffic return to the original work path, switch counter reset. # noqa: E501 + + :return: The max_switch_times of this TapiConnectivityResilienceConstraint. + :rtype: int + """ + return self._max_switch_times + + @max_switch_times.setter + def max_switch_times(self, max_switch_times: int): + """Sets the max_switch_times of this TapiConnectivityResilienceConstraint. + + Used to limit the maximum swtich times. When work fault disappears , and traffic return to the original work path, switch counter reset. # noqa: E501 + + :param max_switch_times: The max_switch_times of this TapiConnectivityResilienceConstraint. + :type max_switch_times: int + """ + + self._max_switch_times = max_switch_times + + @property + def restoration_coordinate_type(self) -> TapiConnectivityCoordinateType: + """Gets the restoration_coordinate_type of this TapiConnectivityResilienceConstraint. + + + :return: The restoration_coordinate_type of this TapiConnectivityResilienceConstraint. + :rtype: TapiConnectivityCoordinateType + """ + return self._restoration_coordinate_type + + @restoration_coordinate_type.setter + def restoration_coordinate_type(self, restoration_coordinate_type: TapiConnectivityCoordinateType): + """Sets the restoration_coordinate_type of this TapiConnectivityResilienceConstraint. + + + :param restoration_coordinate_type: The restoration_coordinate_type of this TapiConnectivityResilienceConstraint. + :type restoration_coordinate_type: TapiConnectivityCoordinateType + """ + + self._restoration_coordinate_type = restoration_coordinate_type + + @property + def is_coordinated_switching_both_ends(self) -> bool: + """Gets the is_coordinated_switching_both_ends of this TapiConnectivityResilienceConstraint. + + Is operating such that switching at both ends of each flow acorss the FC is coordinated at both ingress and egress ends. # noqa: E501 + + :return: The is_coordinated_switching_both_ends of this TapiConnectivityResilienceConstraint. + :rtype: bool + """ + return self._is_coordinated_switching_both_ends + + @is_coordinated_switching_both_ends.setter + def is_coordinated_switching_both_ends(self, is_coordinated_switching_both_ends: bool): + """Sets the is_coordinated_switching_both_ends of this TapiConnectivityResilienceConstraint. + + Is operating such that switching at both ends of each flow acorss the FC is coordinated at both ingress and egress ends. # noqa: E501 + + :param is_coordinated_switching_both_ends: The is_coordinated_switching_both_ends of this TapiConnectivityResilienceConstraint. + :type is_coordinated_switching_both_ends: bool + """ + + self._is_coordinated_switching_both_ends = is_coordinated_switching_both_ends + + @property + def hold_off_time(self) -> int: + """Gets the hold_off_time of this TapiConnectivityResilienceConstraint. + + This attribute indicates the time, in milliseconds, between declaration of signal degrade or signal fail, and the initialization of the protection switching algorithm. # noqa: E501 + + :return: The hold_off_time of this TapiConnectivityResilienceConstraint. + :rtype: int + """ + return self._hold_off_time + + @hold_off_time.setter + def hold_off_time(self, hold_off_time: int): + """Sets the hold_off_time of this TapiConnectivityResilienceConstraint. + + This attribute indicates the time, in milliseconds, between declaration of signal degrade or signal fail, and the initialization of the protection switching algorithm. # noqa: E501 + + :param hold_off_time: The hold_off_time of this TapiConnectivityResilienceConstraint. + :type hold_off_time: int + """ + + self._hold_off_time = hold_off_time + + @property + def is_frozen(self) -> bool: + """Gets the is_frozen of this TapiConnectivityResilienceConstraint. + + Temporarily prevents any switch action to be taken and, as such, freezes the current state. Until the freeze is cleared, additional near-end external commands are rejected and fault condition changes and received APS messages are ignored. All administrative controls of any aspect of protection are rejected. # noqa: E501 + + :return: The is_frozen of this TapiConnectivityResilienceConstraint. + :rtype: bool + """ + return self._is_frozen + + @is_frozen.setter + def is_frozen(self, is_frozen: bool): + """Sets the is_frozen of this TapiConnectivityResilienceConstraint. + + Temporarily prevents any switch action to be taken and, as such, freezes the current state. Until the freeze is cleared, additional near-end external commands are rejected and fault condition changes and received APS messages are ignored. All administrative controls of any aspect of protection are rejected. # noqa: E501 + + :param is_frozen: The is_frozen of this TapiConnectivityResilienceConstraint. + :type is_frozen: bool + """ + + self._is_frozen = is_frozen + + @property + def wait_to_revert_time(self) -> int: + """Gets the wait_to_revert_time of this TapiConnectivityResilienceConstraint. + + If the protection system is revertive, this attribute specifies the time, in minutes, to wait after a fault clears on a higher priority (preferred) resource before reverting to the preferred resource. # noqa: E501 + + :return: The wait_to_revert_time of this TapiConnectivityResilienceConstraint. + :rtype: int + """ + return self._wait_to_revert_time + + @wait_to_revert_time.setter + def wait_to_revert_time(self, wait_to_revert_time: int): + """Sets the wait_to_revert_time of this TapiConnectivityResilienceConstraint. + + If the protection system is revertive, this attribute specifies the time, in minutes, to wait after a fault clears on a higher priority (preferred) resource before reverting to the preferred resource. # noqa: E501 + + :param wait_to_revert_time: The wait_to_revert_time of this TapiConnectivityResilienceConstraint. + :type wait_to_revert_time: int + """ + + self._wait_to_revert_time = wait_to_revert_time + + @property + def resilience_type(self) -> TapiTopologyResilienceType: + """Gets the resilience_type of this TapiConnectivityResilienceConstraint. + + + :return: The resilience_type of this TapiConnectivityResilienceConstraint. + :rtype: TapiTopologyResilienceType + """ + return self._resilience_type + + @resilience_type.setter + def resilience_type(self, resilience_type: TapiTopologyResilienceType): + """Sets the resilience_type of this TapiConnectivityResilienceConstraint. + + + :param resilience_type: The resilience_type of this TapiConnectivityResilienceConstraint. + :type resilience_type: TapiTopologyResilienceType + """ + + self._resilience_type = resilience_type + + @property + def preferred_restoration_layer(self) -> List[TapiCommonLayerProtocolName]: + """Gets the preferred_restoration_layer of this TapiConnectivityResilienceConstraint. + + Indicate which layer this resilience parameters package configured for. # noqa: E501 + + :return: The preferred_restoration_layer of this TapiConnectivityResilienceConstraint. + :rtype: List[TapiCommonLayerProtocolName] + """ + return self._preferred_restoration_layer + + @preferred_restoration_layer.setter + def preferred_restoration_layer(self, preferred_restoration_layer: List[TapiCommonLayerProtocolName]): + """Sets the preferred_restoration_layer of this TapiConnectivityResilienceConstraint. + + Indicate which layer this resilience parameters package configured for. # noqa: E501 + + :param preferred_restoration_layer: The preferred_restoration_layer of this TapiConnectivityResilienceConstraint. + :type preferred_restoration_layer: List[TapiCommonLayerProtocolName] + """ + + self._preferred_restoration_layer = preferred_restoration_layer + + @property + def restore_priority(self) -> int: + """Gets the restore_priority of this TapiConnectivityResilienceConstraint. + + none # noqa: E501 + + :return: The restore_priority of this TapiConnectivityResilienceConstraint. + :rtype: int + """ + return self._restore_priority + + @restore_priority.setter + def restore_priority(self, restore_priority: int): + """Sets the restore_priority of this TapiConnectivityResilienceConstraint. + + none # noqa: E501 + + :param restore_priority: The restore_priority of this TapiConnectivityResilienceConstraint. + :type restore_priority: int + """ + + self._restore_priority = restore_priority + + @property + def reversion_mode(self) -> TapiConnectivityReversionMode: + """Gets the reversion_mode of this TapiConnectivityResilienceConstraint. + + + :return: The reversion_mode of this TapiConnectivityResilienceConstraint. + :rtype: TapiConnectivityReversionMode + """ + return self._reversion_mode + + @reversion_mode.setter + def reversion_mode(self, reversion_mode: TapiConnectivityReversionMode): + """Sets the reversion_mode of this TapiConnectivityResilienceConstraint. + + + :param reversion_mode: The reversion_mode of this TapiConnectivityResilienceConstraint. + :type reversion_mode: TapiConnectivityReversionMode + """ + + self._reversion_mode = reversion_mode diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_resilience_route.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_resilience_route.py new file mode 100644 index 0000000000000000000000000000000000000000..a005aa32b44d6f0ed694a0b6d7f95f047ded4b28 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_resilience_route.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_local_class import TapiCommonLocalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityResilienceRoute(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: List[TapiCommonNameAndValue]=None, local_id: str=None, priority: int=None, route_state: str=None): # noqa: E501 + """TapiConnectivityResilienceRoute - a model defined in Swagger + + :param name: The name of this TapiConnectivityResilienceRoute. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param local_id: The local_id of this TapiConnectivityResilienceRoute. # noqa: E501 + :type local_id: str + :param priority: The priority of this TapiConnectivityResilienceRoute. # noqa: E501 + :type priority: int + :param route_state: The route_state of this TapiConnectivityResilienceRoute. # noqa: E501 + :type route_state: str + """ + self.swagger_types = { + 'name': List[TapiCommonNameAndValue], + 'local_id': str, + 'priority': int, + 'route_state': str + } + + self.attribute_map = { + 'name': 'name', + 'local_id': 'local-id', + 'priority': 'priority', + 'route_state': 'route-state' + } + self._name = name + self._local_id = local_id + self._priority = priority + self._route_state = route_state + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityResilienceRoute': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ResilienceRoute of this TapiConnectivityResilienceRoute. # noqa: E501 + :rtype: TapiConnectivityResilienceRoute + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiConnectivityResilienceRoute. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiConnectivityResilienceRoute. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiConnectivityResilienceRoute. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiConnectivityResilienceRoute. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def local_id(self) -> str: + """Gets the local_id of this TapiConnectivityResilienceRoute. + + none # noqa: E501 + + :return: The local_id of this TapiConnectivityResilienceRoute. + :rtype: str + """ + return self._local_id + + @local_id.setter + def local_id(self, local_id: str): + """Sets the local_id of this TapiConnectivityResilienceRoute. + + none # noqa: E501 + + :param local_id: The local_id of this TapiConnectivityResilienceRoute. + :type local_id: str + """ + + self._local_id = local_id + + @property + def priority(self) -> int: + """Gets the priority of this TapiConnectivityResilienceRoute. + + Value of 0 (zero) means 'unspecified priority'. Highest priority is 1, sometimes referred as 'preferred' or 'main' or 'intended' route. 2 has lower priority than 1, 3 has lower priority than 2, etc. # noqa: E501 + + :return: The priority of this TapiConnectivityResilienceRoute. + :rtype: int + """ + return self._priority + + @priority.setter + def priority(self, priority: int): + """Sets the priority of this TapiConnectivityResilienceRoute. + + Value of 0 (zero) means 'unspecified priority'. Highest priority is 1, sometimes referred as 'preferred' or 'main' or 'intended' route. 2 has lower priority than 1, 3 has lower priority than 2, etc. # noqa: E501 + + :param priority: The priority of this TapiConnectivityResilienceRoute. + :type priority: int + """ + + self._priority = priority + + @property + def route_state(self) -> str: + """Gets the route_state of this TapiConnectivityResilienceRoute. + + Current information on the route selection. # noqa: E501 + + :return: The route_state of this TapiConnectivityResilienceRoute. + :rtype: str + """ + return self._route_state + + @route_state.setter + def route_state(self, route_state: str): + """Sets the route_state of this TapiConnectivityResilienceRoute. + + Current information on the route selection. # noqa: E501 + + :param route_state: The route_state of this TapiConnectivityResilienceRoute. + :type route_state: str + """ + + self._route_state = route_state diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_resilience_route_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_resilience_route_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..7c1e3af55f692d9a7585957ab2ecff68be4e3e24 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_resilience_route_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_resilience_route import TapiConnectivityResilienceRoute # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityResilienceRouteWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, resilience_route_pac: TapiConnectivityResilienceRoute=None): # noqa: E501 + """TapiConnectivityResilienceRouteWrapper - a model defined in Swagger + + :param resilience_route_pac: The resilience_route_pac of this TapiConnectivityResilienceRouteWrapper. # noqa: E501 + :type resilience_route_pac: TapiConnectivityResilienceRoute + """ + self.swagger_types = { + 'resilience_route_pac': TapiConnectivityResilienceRoute + } + + self.attribute_map = { + 'resilience_route_pac': 'resilience-route-pac' + } + self._resilience_route_pac = resilience_route_pac + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityResilienceRouteWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ResilienceRouteWrapper of this TapiConnectivityResilienceRouteWrapper. # noqa: E501 + :rtype: TapiConnectivityResilienceRouteWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def resilience_route_pac(self) -> TapiConnectivityResilienceRoute: + """Gets the resilience_route_pac of this TapiConnectivityResilienceRouteWrapper. + + + :return: The resilience_route_pac of this TapiConnectivityResilienceRouteWrapper. + :rtype: TapiConnectivityResilienceRoute + """ + return self._resilience_route_pac + + @resilience_route_pac.setter + def resilience_route_pac(self, resilience_route_pac: TapiConnectivityResilienceRoute): + """Sets the resilience_route_pac of this TapiConnectivityResilienceRouteWrapper. + + + :param resilience_route_pac: The resilience_route_pac of this TapiConnectivityResilienceRouteWrapper. + :type resilience_route_pac: TapiConnectivityResilienceRoute + """ + + self._resilience_route_pac = resilience_route_pac diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_reversion_mode.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_reversion_mode.py new file mode 100644 index 0000000000000000000000000000000000000000..8004b8293a895a9d32ecdd27b3642bf22fe5934b --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_reversion_mode.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiConnectivityReversionMode(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + REVERTIVE = "REVERTIVE" + NON_REVERTIVE = "NON-REVERTIVE" + def __init__(self): # noqa: E501 + """TapiConnectivityReversionMode - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityReversionMode': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ReversionMode of this TapiConnectivityReversionMode. # noqa: E501 + :rtype: TapiConnectivityReversionMode + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_route.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_route.py new file mode 100644 index 0000000000000000000000000000000000000000..85768ee1727161a3741e38656d9d49fe9ee2e0e3 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_route.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_local_class import TapiCommonLocalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_connection_end_point_ref import TapiConnectivityConnectionEndPointRef # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_resilience_route import TapiConnectivityResilienceRoute # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityRoute(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: List[TapiCommonNameAndValue]=None, local_id: str=None, connection_end_point: List[TapiConnectivityConnectionEndPointRef]=None, resilience_route_pac: TapiConnectivityResilienceRoute=None): # noqa: E501 + """TapiConnectivityRoute - a model defined in Swagger + + :param name: The name of this TapiConnectivityRoute. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param local_id: The local_id of this TapiConnectivityRoute. # noqa: E501 + :type local_id: str + :param connection_end_point: The connection_end_point of this TapiConnectivityRoute. # noqa: E501 + :type connection_end_point: List[TapiConnectivityConnectionEndPointRef] + :param resilience_route_pac: The resilience_route_pac of this TapiConnectivityRoute. # noqa: E501 + :type resilience_route_pac: TapiConnectivityResilienceRoute + """ + self.swagger_types = { + 'name': List[TapiCommonNameAndValue], + 'local_id': str, + 'connection_end_point': List[TapiConnectivityConnectionEndPointRef], + 'resilience_route_pac': TapiConnectivityResilienceRoute + } + + self.attribute_map = { + 'name': 'name', + 'local_id': 'local-id', + 'connection_end_point': 'connection-end-point', + 'resilience_route_pac': 'resilience-route-pac' + } + self._name = name + self._local_id = local_id + self._connection_end_point = connection_end_point + self._resilience_route_pac = resilience_route_pac + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityRoute': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.Route of this TapiConnectivityRoute. # noqa: E501 + :rtype: TapiConnectivityRoute + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiConnectivityRoute. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiConnectivityRoute. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiConnectivityRoute. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiConnectivityRoute. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def local_id(self) -> str: + """Gets the local_id of this TapiConnectivityRoute. + + none # noqa: E501 + + :return: The local_id of this TapiConnectivityRoute. + :rtype: str + """ + return self._local_id + + @local_id.setter + def local_id(self, local_id: str): + """Sets the local_id of this TapiConnectivityRoute. + + none # noqa: E501 + + :param local_id: The local_id of this TapiConnectivityRoute. + :type local_id: str + """ + + self._local_id = local_id + + @property + def connection_end_point(self) -> List[TapiConnectivityConnectionEndPointRef]: + """Gets the connection_end_point of this TapiConnectivityRoute. + + none # noqa: E501 + + :return: The connection_end_point of this TapiConnectivityRoute. + :rtype: List[TapiConnectivityConnectionEndPointRef] + """ + return self._connection_end_point + + @connection_end_point.setter + def connection_end_point(self, connection_end_point: List[TapiConnectivityConnectionEndPointRef]): + """Sets the connection_end_point of this TapiConnectivityRoute. + + none # noqa: E501 + + :param connection_end_point: The connection_end_point of this TapiConnectivityRoute. + :type connection_end_point: List[TapiConnectivityConnectionEndPointRef] + """ + + self._connection_end_point = connection_end_point + + @property + def resilience_route_pac(self) -> TapiConnectivityResilienceRoute: + """Gets the resilience_route_pac of this TapiConnectivityRoute. + + + :return: The resilience_route_pac of this TapiConnectivityRoute. + :rtype: TapiConnectivityResilienceRoute + """ + return self._resilience_route_pac + + @resilience_route_pac.setter + def resilience_route_pac(self, resilience_route_pac: TapiConnectivityResilienceRoute): + """Sets the resilience_route_pac of this TapiConnectivityRoute. + + + :param resilience_route_pac: The resilience_route_pac of this TapiConnectivityRoute. + :type resilience_route_pac: TapiConnectivityResilienceRoute + """ + + self._resilience_route_pac = resilience_route_pac diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_route_ref.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_route_ref.py new file mode 100644 index 0000000000000000000000000000000000000000..3c8e794f10d6ab135daf8c5bec387408285afdf3 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_route_ref.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connection_ref import TapiConnectivityConnectionRef # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityRouteRef(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, connection_uuid: str=None, route_local_id: str=None): # noqa: E501 + """TapiConnectivityRouteRef - a model defined in Swagger + + :param connection_uuid: The connection_uuid of this TapiConnectivityRouteRef. # noqa: E501 + :type connection_uuid: str + :param route_local_id: The route_local_id of this TapiConnectivityRouteRef. # noqa: E501 + :type route_local_id: str + """ + self.swagger_types = { + 'connection_uuid': str, + 'route_local_id': str + } + + self.attribute_map = { + 'connection_uuid': 'connection-uuid', + 'route_local_id': 'route-local-id' + } + self._connection_uuid = connection_uuid + self._route_local_id = route_local_id + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityRouteRef': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.RouteRef of this TapiConnectivityRouteRef. # noqa: E501 + :rtype: TapiConnectivityRouteRef + """ + return util.deserialize_model(dikt, cls) + + @property + def connection_uuid(self) -> str: + """Gets the connection_uuid of this TapiConnectivityRouteRef. + + none # noqa: E501 + + :return: The connection_uuid of this TapiConnectivityRouteRef. + :rtype: str + """ + return self._connection_uuid + + @connection_uuid.setter + def connection_uuid(self, connection_uuid: str): + """Sets the connection_uuid of this TapiConnectivityRouteRef. + + none # noqa: E501 + + :param connection_uuid: The connection_uuid of this TapiConnectivityRouteRef. + :type connection_uuid: str + """ + + self._connection_uuid = connection_uuid + + @property + def route_local_id(self) -> str: + """Gets the route_local_id of this TapiConnectivityRouteRef. + + none # noqa: E501 + + :return: The route_local_id of this TapiConnectivityRouteRef. + :rtype: str + """ + return self._route_local_id + + @route_local_id.setter + def route_local_id(self, route_local_id: str): + """Sets the route_local_id of this TapiConnectivityRouteRef. + + none # noqa: E501 + + :param route_local_id: The route_local_id of this TapiConnectivityRouteRef. + :type route_local_id: str + """ + + self._route_local_id = route_local_id diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_route_ref_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_route_ref_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..32de337b97f5437d9a447ae03aa2705f94e82166 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_route_ref_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_route_ref import TapiConnectivityRouteRef # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityRouteRefWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, selected_route: TapiConnectivityRouteRef=None): # noqa: E501 + """TapiConnectivityRouteRefWrapper - a model defined in Swagger + + :param selected_route: The selected_route of this TapiConnectivityRouteRefWrapper. # noqa: E501 + :type selected_route: TapiConnectivityRouteRef + """ + self.swagger_types = { + 'selected_route': TapiConnectivityRouteRef + } + + self.attribute_map = { + 'selected_route': 'selected-route' + } + self._selected_route = selected_route + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityRouteRefWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.RouteRefWrapper of this TapiConnectivityRouteRefWrapper. # noqa: E501 + :rtype: TapiConnectivityRouteRefWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def selected_route(self) -> TapiConnectivityRouteRef: + """Gets the selected_route of this TapiConnectivityRouteRefWrapper. + + + :return: The selected_route of this TapiConnectivityRouteRefWrapper. + :rtype: TapiConnectivityRouteRef + """ + return self._selected_route + + @selected_route.setter + def selected_route(self, selected_route: TapiConnectivityRouteRef): + """Sets the selected_route of this TapiConnectivityRouteRefWrapper. + + + :param selected_route: The selected_route of this TapiConnectivityRouteRefWrapper. + :type selected_route: TapiConnectivityRouteRef + """ + + self._selected_route = selected_route diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_route_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_route_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..846bb16c72cbaf0e4d13eb37849abff4cc0b8065 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_route_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_route import TapiConnectivityRoute # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityRouteWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, route: TapiConnectivityRoute=None): # noqa: E501 + """TapiConnectivityRouteWrapper - a model defined in Swagger + + :param route: The route of this TapiConnectivityRouteWrapper. # noqa: E501 + :type route: TapiConnectivityRoute + """ + self.swagger_types = { + 'route': TapiConnectivityRoute + } + + self.attribute_map = { + 'route': 'route' + } + self._route = route + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityRouteWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.RouteWrapper of this TapiConnectivityRouteWrapper. # noqa: E501 + :rtype: TapiConnectivityRouteWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def route(self) -> TapiConnectivityRoute: + """Gets the route of this TapiConnectivityRouteWrapper. + + + :return: The route of this TapiConnectivityRouteWrapper. + :rtype: TapiConnectivityRoute + """ + return self._route + + @route.setter + def route(self, route: TapiConnectivityRoute): + """Sets the route of this TapiConnectivityRouteWrapper. + + + :param route: The route of this TapiConnectivityRouteWrapper. + :type route: TapiConnectivityRoute + """ + + self._route = route diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_selection_control.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_selection_control.py new file mode 100644 index 0000000000000000000000000000000000000000..12a0cef5a396a0df41b9ae2fde20948fbb71353d --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_selection_control.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiConnectivitySelectionControl(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + LOCK_OUT = "LOCK_OUT" + NORMAL = "NORMAL" + MANUAL = "MANUAL" + FORCED = "FORCED" + def __init__(self): # noqa: E501 + """TapiConnectivitySelectionControl - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivitySelectionControl': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.SelectionControl of this TapiConnectivitySelectionControl. # noqa: E501 + :rtype: TapiConnectivitySelectionControl + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_selection_reason.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_selection_reason.py new file mode 100644 index 0000000000000000000000000000000000000000..2c20d3577365fcc314e587b6c0dab95185e01212 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_selection_reason.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiConnectivitySelectionReason(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + LOCKOUT = "LOCKOUT" + NORMAL = "NORMAL" + MANUAL = "MANUAL" + FORCED = "FORCED" + WAIT_TO_REVERT = "WAIT_TO_REVERT" + SIGNAL_DEGRADE = "SIGNAL_DEGRADE" + SIGNAL_FAIL = "SIGNAL_FAIL" + def __init__(self): # noqa: E501 + """TapiConnectivitySelectionReason - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivitySelectionReason': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.SelectionReason of this TapiConnectivitySelectionReason. # noqa: E501 + :rtype: TapiConnectivitySelectionReason + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_service_type.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_service_type.py new file mode 100644 index 0000000000000000000000000000000000000000..ef342f8db50904a03f62b0b5340662107a78dd8a --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_service_type.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiConnectivityServiceType(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + POINT_TO_POINT_CONNECTIVITY = "POINT_TO_POINT_CONNECTIVITY" + POINT_TO_MULTIPOINT_CONNECTIVITY = "POINT_TO_MULTIPOINT_CONNECTIVITY" + MULTIPOINT_CONNECTIVITY = "MULTIPOINT_CONNECTIVITY" + ROOTED_MULTIPOINT_CONNECTIVITY = "ROOTED_MULTIPOINT_CONNECTIVITY" + def __init__(self): # noqa: E501 + """TapiConnectivityServiceType - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityServiceType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.ServiceType of this TapiConnectivityServiceType. # noqa: E501 + :rtype: TapiConnectivityServiceType + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_switch.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_switch.py new file mode 100644 index 0000000000000000000000000000000000000000..564ef1b1931130cdc24b09f01a1c08d420800dee --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_switch.py @@ -0,0 +1,233 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_local_class import TapiCommonLocalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_common_port_direction import TapiCommonPortDirection # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_connection_end_point_ref import TapiConnectivityConnectionEndPointRef # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_route_ref import TapiConnectivityRouteRef # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_selection_control import TapiConnectivitySelectionControl # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_selection_reason import TapiConnectivitySelectionReason # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivitySwitch(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: List[TapiCommonNameAndValue]=None, local_id: str=None, selected_connection_end_point: List[TapiConnectivityConnectionEndPointRef]=None, selected_route: List[TapiConnectivityRouteRef]=None, selection_control: TapiConnectivitySelectionControl=None, selection_reason: TapiConnectivitySelectionReason=None, switch_direction: TapiCommonPortDirection=None): # noqa: E501 + """TapiConnectivitySwitch - a model defined in Swagger + + :param name: The name of this TapiConnectivitySwitch. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param local_id: The local_id of this TapiConnectivitySwitch. # noqa: E501 + :type local_id: str + :param selected_connection_end_point: The selected_connection_end_point of this TapiConnectivitySwitch. # noqa: E501 + :type selected_connection_end_point: List[TapiConnectivityConnectionEndPointRef] + :param selected_route: The selected_route of this TapiConnectivitySwitch. # noqa: E501 + :type selected_route: List[TapiConnectivityRouteRef] + :param selection_control: The selection_control of this TapiConnectivitySwitch. # noqa: E501 + :type selection_control: TapiConnectivitySelectionControl + :param selection_reason: The selection_reason of this TapiConnectivitySwitch. # noqa: E501 + :type selection_reason: TapiConnectivitySelectionReason + :param switch_direction: The switch_direction of this TapiConnectivitySwitch. # noqa: E501 + :type switch_direction: TapiCommonPortDirection + """ + self.swagger_types = { + 'name': List[TapiCommonNameAndValue], + 'local_id': str, + 'selected_connection_end_point': List[TapiConnectivityConnectionEndPointRef], + 'selected_route': List[TapiConnectivityRouteRef], + 'selection_control': TapiConnectivitySelectionControl, + 'selection_reason': TapiConnectivitySelectionReason, + 'switch_direction': TapiCommonPortDirection + } + + self.attribute_map = { + 'name': 'name', + 'local_id': 'local-id', + 'selected_connection_end_point': 'selected-connection-end-point', + 'selected_route': 'selected-route', + 'selection_control': 'selection-control', + 'selection_reason': 'selection-reason', + 'switch_direction': 'switch-direction' + } + self._name = name + self._local_id = local_id + self._selected_connection_end_point = selected_connection_end_point + self._selected_route = selected_route + self._selection_control = selection_control + self._selection_reason = selection_reason + self._switch_direction = switch_direction + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivitySwitch': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.Switch of this TapiConnectivitySwitch. # noqa: E501 + :rtype: TapiConnectivitySwitch + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiConnectivitySwitch. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiConnectivitySwitch. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiConnectivitySwitch. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiConnectivitySwitch. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def local_id(self) -> str: + """Gets the local_id of this TapiConnectivitySwitch. + + none # noqa: E501 + + :return: The local_id of this TapiConnectivitySwitch. + :rtype: str + """ + return self._local_id + + @local_id.setter + def local_id(self, local_id: str): + """Sets the local_id of this TapiConnectivitySwitch. + + none # noqa: E501 + + :param local_id: The local_id of this TapiConnectivitySwitch. + :type local_id: str + """ + + self._local_id = local_id + + @property + def selected_connection_end_point(self) -> List[TapiConnectivityConnectionEndPointRef]: + """Gets the selected_connection_end_point of this TapiConnectivitySwitch. + + none # noqa: E501 + + :return: The selected_connection_end_point of this TapiConnectivitySwitch. + :rtype: List[TapiConnectivityConnectionEndPointRef] + """ + return self._selected_connection_end_point + + @selected_connection_end_point.setter + def selected_connection_end_point(self, selected_connection_end_point: List[TapiConnectivityConnectionEndPointRef]): + """Sets the selected_connection_end_point of this TapiConnectivitySwitch. + + none # noqa: E501 + + :param selected_connection_end_point: The selected_connection_end_point of this TapiConnectivitySwitch. + :type selected_connection_end_point: List[TapiConnectivityConnectionEndPointRef] + """ + + self._selected_connection_end_point = selected_connection_end_point + + @property + def selected_route(self) -> List[TapiConnectivityRouteRef]: + """Gets the selected_route of this TapiConnectivitySwitch. + + none # noqa: E501 + + :return: The selected_route of this TapiConnectivitySwitch. + :rtype: List[TapiConnectivityRouteRef] + """ + return self._selected_route + + @selected_route.setter + def selected_route(self, selected_route: List[TapiConnectivityRouteRef]): + """Sets the selected_route of this TapiConnectivitySwitch. + + none # noqa: E501 + + :param selected_route: The selected_route of this TapiConnectivitySwitch. + :type selected_route: List[TapiConnectivityRouteRef] + """ + + self._selected_route = selected_route + + @property + def selection_control(self) -> TapiConnectivitySelectionControl: + """Gets the selection_control of this TapiConnectivitySwitch. + + + :return: The selection_control of this TapiConnectivitySwitch. + :rtype: TapiConnectivitySelectionControl + """ + return self._selection_control + + @selection_control.setter + def selection_control(self, selection_control: TapiConnectivitySelectionControl): + """Sets the selection_control of this TapiConnectivitySwitch. + + + :param selection_control: The selection_control of this TapiConnectivitySwitch. + :type selection_control: TapiConnectivitySelectionControl + """ + + self._selection_control = selection_control + + @property + def selection_reason(self) -> TapiConnectivitySelectionReason: + """Gets the selection_reason of this TapiConnectivitySwitch. + + + :return: The selection_reason of this TapiConnectivitySwitch. + :rtype: TapiConnectivitySelectionReason + """ + return self._selection_reason + + @selection_reason.setter + def selection_reason(self, selection_reason: TapiConnectivitySelectionReason): + """Sets the selection_reason of this TapiConnectivitySwitch. + + + :param selection_reason: The selection_reason of this TapiConnectivitySwitch. + :type selection_reason: TapiConnectivitySelectionReason + """ + + self._selection_reason = selection_reason + + @property + def switch_direction(self) -> TapiCommonPortDirection: + """Gets the switch_direction of this TapiConnectivitySwitch. + + + :return: The switch_direction of this TapiConnectivitySwitch. + :rtype: TapiCommonPortDirection + """ + return self._switch_direction + + @switch_direction.setter + def switch_direction(self, switch_direction: TapiCommonPortDirection): + """Sets the switch_direction of this TapiConnectivitySwitch. + + + :param switch_direction: The switch_direction of this TapiConnectivitySwitch. + :type switch_direction: TapiCommonPortDirection + """ + + self._switch_direction = switch_direction diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_switch_control.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_switch_control.py new file mode 100644 index 0000000000000000000000000000000000000000..72150962af704593bb19d8a865cea2c14d955fda --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_switch_control.py @@ -0,0 +1,459 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_global_class import TapiCommonGlobalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_coordinate_type import TapiConnectivityCoordinateType # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_resilience_constraint import TapiConnectivityResilienceConstraint # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_reversion_mode import TapiConnectivityReversionMode # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_switch import TapiConnectivitySwitch # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_switch_control_ref import TapiConnectivitySwitchControlRef # noqa: F401,E501 +from tapi_server.models.tapi_topology_resilience_type import TapiTopologyResilienceType # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivitySwitchControl(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, is_lock_out: bool=False, max_switch_times: int=None, restoration_coordinate_type: TapiConnectivityCoordinateType=None, is_coordinated_switching_both_ends: bool=False, hold_off_time: int=None, is_frozen: bool=False, wait_to_revert_time: int=15, resilience_type: TapiTopologyResilienceType=None, preferred_restoration_layer: List[TapiCommonLayerProtocolName]=None, restore_priority: int=None, reversion_mode: TapiConnectivityReversionMode=None, name: List[TapiCommonNameAndValue]=None, uuid: str=None, sub_switch_control: List[TapiConnectivitySwitchControlRef]=None, switch: List[TapiConnectivitySwitch]=None): # noqa: E501 + """TapiConnectivitySwitchControl - a model defined in Swagger + + :param is_lock_out: The is_lock_out of this TapiConnectivitySwitchControl. # noqa: E501 + :type is_lock_out: bool + :param max_switch_times: The max_switch_times of this TapiConnectivitySwitchControl. # noqa: E501 + :type max_switch_times: int + :param restoration_coordinate_type: The restoration_coordinate_type of this TapiConnectivitySwitchControl. # noqa: E501 + :type restoration_coordinate_type: TapiConnectivityCoordinateType + :param is_coordinated_switching_both_ends: The is_coordinated_switching_both_ends of this TapiConnectivitySwitchControl. # noqa: E501 + :type is_coordinated_switching_both_ends: bool + :param hold_off_time: The hold_off_time of this TapiConnectivitySwitchControl. # noqa: E501 + :type hold_off_time: int + :param is_frozen: The is_frozen of this TapiConnectivitySwitchControl. # noqa: E501 + :type is_frozen: bool + :param wait_to_revert_time: The wait_to_revert_time of this TapiConnectivitySwitchControl. # noqa: E501 + :type wait_to_revert_time: int + :param resilience_type: The resilience_type of this TapiConnectivitySwitchControl. # noqa: E501 + :type resilience_type: TapiTopologyResilienceType + :param preferred_restoration_layer: The preferred_restoration_layer of this TapiConnectivitySwitchControl. # noqa: E501 + :type preferred_restoration_layer: List[TapiCommonLayerProtocolName] + :param restore_priority: The restore_priority of this TapiConnectivitySwitchControl. # noqa: E501 + :type restore_priority: int + :param reversion_mode: The reversion_mode of this TapiConnectivitySwitchControl. # noqa: E501 + :type reversion_mode: TapiConnectivityReversionMode + :param name: The name of this TapiConnectivitySwitchControl. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param uuid: The uuid of this TapiConnectivitySwitchControl. # noqa: E501 + :type uuid: str + :param sub_switch_control: The sub_switch_control of this TapiConnectivitySwitchControl. # noqa: E501 + :type sub_switch_control: List[TapiConnectivitySwitchControlRef] + :param switch: The switch of this TapiConnectivitySwitchControl. # noqa: E501 + :type switch: List[TapiConnectivitySwitch] + """ + self.swagger_types = { + 'is_lock_out': bool, + 'max_switch_times': int, + 'restoration_coordinate_type': TapiConnectivityCoordinateType, + 'is_coordinated_switching_both_ends': bool, + 'hold_off_time': int, + 'is_frozen': bool, + 'wait_to_revert_time': int, + 'resilience_type': TapiTopologyResilienceType, + 'preferred_restoration_layer': List[TapiCommonLayerProtocolName], + 'restore_priority': int, + 'reversion_mode': TapiConnectivityReversionMode, + 'name': List[TapiCommonNameAndValue], + 'uuid': str, + 'sub_switch_control': List[TapiConnectivitySwitchControlRef], + 'switch': List[TapiConnectivitySwitch] + } + + self.attribute_map = { + 'is_lock_out': 'is-lock-out', + 'max_switch_times': 'max-switch-times', + 'restoration_coordinate_type': 'restoration-coordinate-type', + 'is_coordinated_switching_both_ends': 'is-coordinated-switching-both-ends', + 'hold_off_time': 'hold-off-time', + 'is_frozen': 'is-frozen', + 'wait_to_revert_time': 'wait-to-revert-time', + 'resilience_type': 'resilience-type', + 'preferred_restoration_layer': 'preferred-restoration-layer', + 'restore_priority': 'restore-priority', + 'reversion_mode': 'reversion-mode', + 'name': 'name', + 'uuid': 'uuid', + 'sub_switch_control': 'sub-switch-control', + 'switch': 'switch' + } + self._is_lock_out = is_lock_out + self._max_switch_times = max_switch_times + self._restoration_coordinate_type = restoration_coordinate_type + self._is_coordinated_switching_both_ends = is_coordinated_switching_both_ends + self._hold_off_time = hold_off_time + self._is_frozen = is_frozen + self._wait_to_revert_time = wait_to_revert_time + self._resilience_type = resilience_type + self._preferred_restoration_layer = preferred_restoration_layer + self._restore_priority = restore_priority + self._reversion_mode = reversion_mode + self._name = name + self._uuid = uuid + self._sub_switch_control = sub_switch_control + self._switch = switch + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivitySwitchControl': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.SwitchControl of this TapiConnectivitySwitchControl. # noqa: E501 + :rtype: TapiConnectivitySwitchControl + """ + return util.deserialize_model(dikt, cls) + + @property + def is_lock_out(self) -> bool: + """Gets the is_lock_out of this TapiConnectivitySwitchControl. + + The resource is configured to temporarily not be available for use in the protection scheme(s) it is part of. This overrides all other protection control states including forced. If the item is locked out then it cannot be used under any circumstances. Note: Only relevant when part of a protection scheme. # noqa: E501 + + :return: The is_lock_out of this TapiConnectivitySwitchControl. + :rtype: bool + """ + return self._is_lock_out + + @is_lock_out.setter + def is_lock_out(self, is_lock_out: bool): + """Sets the is_lock_out of this TapiConnectivitySwitchControl. + + The resource is configured to temporarily not be available for use in the protection scheme(s) it is part of. This overrides all other protection control states including forced. If the item is locked out then it cannot be used under any circumstances. Note: Only relevant when part of a protection scheme. # noqa: E501 + + :param is_lock_out: The is_lock_out of this TapiConnectivitySwitchControl. + :type is_lock_out: bool + """ + + self._is_lock_out = is_lock_out + + @property + def max_switch_times(self) -> int: + """Gets the max_switch_times of this TapiConnectivitySwitchControl. + + Used to limit the maximum swtich times. When work fault disappears , and traffic return to the original work path, switch counter reset. # noqa: E501 + + :return: The max_switch_times of this TapiConnectivitySwitchControl. + :rtype: int + """ + return self._max_switch_times + + @max_switch_times.setter + def max_switch_times(self, max_switch_times: int): + """Sets the max_switch_times of this TapiConnectivitySwitchControl. + + Used to limit the maximum swtich times. When work fault disappears , and traffic return to the original work path, switch counter reset. # noqa: E501 + + :param max_switch_times: The max_switch_times of this TapiConnectivitySwitchControl. + :type max_switch_times: int + """ + + self._max_switch_times = max_switch_times + + @property + def restoration_coordinate_type(self) -> TapiConnectivityCoordinateType: + """Gets the restoration_coordinate_type of this TapiConnectivitySwitchControl. + + + :return: The restoration_coordinate_type of this TapiConnectivitySwitchControl. + :rtype: TapiConnectivityCoordinateType + """ + return self._restoration_coordinate_type + + @restoration_coordinate_type.setter + def restoration_coordinate_type(self, restoration_coordinate_type: TapiConnectivityCoordinateType): + """Sets the restoration_coordinate_type of this TapiConnectivitySwitchControl. + + + :param restoration_coordinate_type: The restoration_coordinate_type of this TapiConnectivitySwitchControl. + :type restoration_coordinate_type: TapiConnectivityCoordinateType + """ + + self._restoration_coordinate_type = restoration_coordinate_type + + @property + def is_coordinated_switching_both_ends(self) -> bool: + """Gets the is_coordinated_switching_both_ends of this TapiConnectivitySwitchControl. + + Is operating such that switching at both ends of each flow acorss the FC is coordinated at both ingress and egress ends. # noqa: E501 + + :return: The is_coordinated_switching_both_ends of this TapiConnectivitySwitchControl. + :rtype: bool + """ + return self._is_coordinated_switching_both_ends + + @is_coordinated_switching_both_ends.setter + def is_coordinated_switching_both_ends(self, is_coordinated_switching_both_ends: bool): + """Sets the is_coordinated_switching_both_ends of this TapiConnectivitySwitchControl. + + Is operating such that switching at both ends of each flow acorss the FC is coordinated at both ingress and egress ends. # noqa: E501 + + :param is_coordinated_switching_both_ends: The is_coordinated_switching_both_ends of this TapiConnectivitySwitchControl. + :type is_coordinated_switching_both_ends: bool + """ + + self._is_coordinated_switching_both_ends = is_coordinated_switching_both_ends + + @property + def hold_off_time(self) -> int: + """Gets the hold_off_time of this TapiConnectivitySwitchControl. + + This attribute indicates the time, in milliseconds, between declaration of signal degrade or signal fail, and the initialization of the protection switching algorithm. # noqa: E501 + + :return: The hold_off_time of this TapiConnectivitySwitchControl. + :rtype: int + """ + return self._hold_off_time + + @hold_off_time.setter + def hold_off_time(self, hold_off_time: int): + """Sets the hold_off_time of this TapiConnectivitySwitchControl. + + This attribute indicates the time, in milliseconds, between declaration of signal degrade or signal fail, and the initialization of the protection switching algorithm. # noqa: E501 + + :param hold_off_time: The hold_off_time of this TapiConnectivitySwitchControl. + :type hold_off_time: int + """ + + self._hold_off_time = hold_off_time + + @property + def is_frozen(self) -> bool: + """Gets the is_frozen of this TapiConnectivitySwitchControl. + + Temporarily prevents any switch action to be taken and, as such, freezes the current state. Until the freeze is cleared, additional near-end external commands are rejected and fault condition changes and received APS messages are ignored. All administrative controls of any aspect of protection are rejected. # noqa: E501 + + :return: The is_frozen of this TapiConnectivitySwitchControl. + :rtype: bool + """ + return self._is_frozen + + @is_frozen.setter + def is_frozen(self, is_frozen: bool): + """Sets the is_frozen of this TapiConnectivitySwitchControl. + + Temporarily prevents any switch action to be taken and, as such, freezes the current state. Until the freeze is cleared, additional near-end external commands are rejected and fault condition changes and received APS messages are ignored. All administrative controls of any aspect of protection are rejected. # noqa: E501 + + :param is_frozen: The is_frozen of this TapiConnectivitySwitchControl. + :type is_frozen: bool + """ + + self._is_frozen = is_frozen + + @property + def wait_to_revert_time(self) -> int: + """Gets the wait_to_revert_time of this TapiConnectivitySwitchControl. + + If the protection system is revertive, this attribute specifies the time, in minutes, to wait after a fault clears on a higher priority (preferred) resource before reverting to the preferred resource. # noqa: E501 + + :return: The wait_to_revert_time of this TapiConnectivitySwitchControl. + :rtype: int + """ + return self._wait_to_revert_time + + @wait_to_revert_time.setter + def wait_to_revert_time(self, wait_to_revert_time: int): + """Sets the wait_to_revert_time of this TapiConnectivitySwitchControl. + + If the protection system is revertive, this attribute specifies the time, in minutes, to wait after a fault clears on a higher priority (preferred) resource before reverting to the preferred resource. # noqa: E501 + + :param wait_to_revert_time: The wait_to_revert_time of this TapiConnectivitySwitchControl. + :type wait_to_revert_time: int + """ + + self._wait_to_revert_time = wait_to_revert_time + + @property + def resilience_type(self) -> TapiTopologyResilienceType: + """Gets the resilience_type of this TapiConnectivitySwitchControl. + + + :return: The resilience_type of this TapiConnectivitySwitchControl. + :rtype: TapiTopologyResilienceType + """ + return self._resilience_type + + @resilience_type.setter + def resilience_type(self, resilience_type: TapiTopologyResilienceType): + """Sets the resilience_type of this TapiConnectivitySwitchControl. + + + :param resilience_type: The resilience_type of this TapiConnectivitySwitchControl. + :type resilience_type: TapiTopologyResilienceType + """ + + self._resilience_type = resilience_type + + @property + def preferred_restoration_layer(self) -> List[TapiCommonLayerProtocolName]: + """Gets the preferred_restoration_layer of this TapiConnectivitySwitchControl. + + Indicate which layer this resilience parameters package configured for. # noqa: E501 + + :return: The preferred_restoration_layer of this TapiConnectivitySwitchControl. + :rtype: List[TapiCommonLayerProtocolName] + """ + return self._preferred_restoration_layer + + @preferred_restoration_layer.setter + def preferred_restoration_layer(self, preferred_restoration_layer: List[TapiCommonLayerProtocolName]): + """Sets the preferred_restoration_layer of this TapiConnectivitySwitchControl. + + Indicate which layer this resilience parameters package configured for. # noqa: E501 + + :param preferred_restoration_layer: The preferred_restoration_layer of this TapiConnectivitySwitchControl. + :type preferred_restoration_layer: List[TapiCommonLayerProtocolName] + """ + + self._preferred_restoration_layer = preferred_restoration_layer + + @property + def restore_priority(self) -> int: + """Gets the restore_priority of this TapiConnectivitySwitchControl. + + none # noqa: E501 + + :return: The restore_priority of this TapiConnectivitySwitchControl. + :rtype: int + """ + return self._restore_priority + + @restore_priority.setter + def restore_priority(self, restore_priority: int): + """Sets the restore_priority of this TapiConnectivitySwitchControl. + + none # noqa: E501 + + :param restore_priority: The restore_priority of this TapiConnectivitySwitchControl. + :type restore_priority: int + """ + + self._restore_priority = restore_priority + + @property + def reversion_mode(self) -> TapiConnectivityReversionMode: + """Gets the reversion_mode of this TapiConnectivitySwitchControl. + + + :return: The reversion_mode of this TapiConnectivitySwitchControl. + :rtype: TapiConnectivityReversionMode + """ + return self._reversion_mode + + @reversion_mode.setter + def reversion_mode(self, reversion_mode: TapiConnectivityReversionMode): + """Sets the reversion_mode of this TapiConnectivitySwitchControl. + + + :param reversion_mode: The reversion_mode of this TapiConnectivitySwitchControl. + :type reversion_mode: TapiConnectivityReversionMode + """ + + self._reversion_mode = reversion_mode + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiConnectivitySwitchControl. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiConnectivitySwitchControl. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiConnectivitySwitchControl. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiConnectivitySwitchControl. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def uuid(self) -> str: + """Gets the uuid of this TapiConnectivitySwitchControl. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :return: The uuid of this TapiConnectivitySwitchControl. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid: str): + """Sets the uuid of this TapiConnectivitySwitchControl. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :param uuid: The uuid of this TapiConnectivitySwitchControl. + :type uuid: str + """ + + self._uuid = uuid + + @property + def sub_switch_control(self) -> List[TapiConnectivitySwitchControlRef]: + """Gets the sub_switch_control of this TapiConnectivitySwitchControl. + + none # noqa: E501 + + :return: The sub_switch_control of this TapiConnectivitySwitchControl. + :rtype: List[TapiConnectivitySwitchControlRef] + """ + return self._sub_switch_control + + @sub_switch_control.setter + def sub_switch_control(self, sub_switch_control: List[TapiConnectivitySwitchControlRef]): + """Sets the sub_switch_control of this TapiConnectivitySwitchControl. + + none # noqa: E501 + + :param sub_switch_control: The sub_switch_control of this TapiConnectivitySwitchControl. + :type sub_switch_control: List[TapiConnectivitySwitchControlRef] + """ + + self._sub_switch_control = sub_switch_control + + @property + def switch(self) -> List[TapiConnectivitySwitch]: + """Gets the switch of this TapiConnectivitySwitchControl. + + none # noqa: E501 + + :return: The switch of this TapiConnectivitySwitchControl. + :rtype: List[TapiConnectivitySwitch] + """ + return self._switch + + @switch.setter + def switch(self, switch: List[TapiConnectivitySwitch]): + """Sets the switch of this TapiConnectivitySwitchControl. + + none # noqa: E501 + + :param switch: The switch of this TapiConnectivitySwitchControl. + :type switch: List[TapiConnectivitySwitch] + """ + + self._switch = switch diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_switch_control_ref.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_switch_control_ref.py new file mode 100644 index 0000000000000000000000000000000000000000..6167745852ce3c81c4818103d42d2a6271abb83b --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_switch_control_ref.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connection_ref import TapiConnectivityConnectionRef # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivitySwitchControlRef(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, connection_uuid: str=None, switch_control_uuid: str=None): # noqa: E501 + """TapiConnectivitySwitchControlRef - a model defined in Swagger + + :param connection_uuid: The connection_uuid of this TapiConnectivitySwitchControlRef. # noqa: E501 + :type connection_uuid: str + :param switch_control_uuid: The switch_control_uuid of this TapiConnectivitySwitchControlRef. # noqa: E501 + :type switch_control_uuid: str + """ + self.swagger_types = { + 'connection_uuid': str, + 'switch_control_uuid': str + } + + self.attribute_map = { + 'connection_uuid': 'connection-uuid', + 'switch_control_uuid': 'switch-control-uuid' + } + self._connection_uuid = connection_uuid + self._switch_control_uuid = switch_control_uuid + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivitySwitchControlRef': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.SwitchControlRef of this TapiConnectivitySwitchControlRef. # noqa: E501 + :rtype: TapiConnectivitySwitchControlRef + """ + return util.deserialize_model(dikt, cls) + + @property + def connection_uuid(self) -> str: + """Gets the connection_uuid of this TapiConnectivitySwitchControlRef. + + none # noqa: E501 + + :return: The connection_uuid of this TapiConnectivitySwitchControlRef. + :rtype: str + """ + return self._connection_uuid + + @connection_uuid.setter + def connection_uuid(self, connection_uuid: str): + """Sets the connection_uuid of this TapiConnectivitySwitchControlRef. + + none # noqa: E501 + + :param connection_uuid: The connection_uuid of this TapiConnectivitySwitchControlRef. + :type connection_uuid: str + """ + + self._connection_uuid = connection_uuid + + @property + def switch_control_uuid(self) -> str: + """Gets the switch_control_uuid of this TapiConnectivitySwitchControlRef. + + none # noqa: E501 + + :return: The switch_control_uuid of this TapiConnectivitySwitchControlRef. + :rtype: str + """ + return self._switch_control_uuid + + @switch_control_uuid.setter + def switch_control_uuid(self, switch_control_uuid: str): + """Sets the switch_control_uuid of this TapiConnectivitySwitchControlRef. + + none # noqa: E501 + + :param switch_control_uuid: The switch_control_uuid of this TapiConnectivitySwitchControlRef. + :type switch_control_uuid: str + """ + + self._switch_control_uuid = switch_control_uuid diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_switch_control_ref_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_switch_control_ref_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..9e6f183b20f9bcedbd34bab0865d22d567d94536 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_switch_control_ref_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_switch_control_ref import TapiConnectivitySwitchControlRef # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivitySwitchControlRefWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, sub_switch_control: TapiConnectivitySwitchControlRef=None): # noqa: E501 + """TapiConnectivitySwitchControlRefWrapper - a model defined in Swagger + + :param sub_switch_control: The sub_switch_control of this TapiConnectivitySwitchControlRefWrapper. # noqa: E501 + :type sub_switch_control: TapiConnectivitySwitchControlRef + """ + self.swagger_types = { + 'sub_switch_control': TapiConnectivitySwitchControlRef + } + + self.attribute_map = { + 'sub_switch_control': 'sub-switch-control' + } + self._sub_switch_control = sub_switch_control + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivitySwitchControlRefWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.SwitchControlRefWrapper of this TapiConnectivitySwitchControlRefWrapper. # noqa: E501 + :rtype: TapiConnectivitySwitchControlRefWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def sub_switch_control(self) -> TapiConnectivitySwitchControlRef: + """Gets the sub_switch_control of this TapiConnectivitySwitchControlRefWrapper. + + + :return: The sub_switch_control of this TapiConnectivitySwitchControlRefWrapper. + :rtype: TapiConnectivitySwitchControlRef + """ + return self._sub_switch_control + + @sub_switch_control.setter + def sub_switch_control(self, sub_switch_control: TapiConnectivitySwitchControlRef): + """Sets the sub_switch_control of this TapiConnectivitySwitchControlRefWrapper. + + + :param sub_switch_control: The sub_switch_control of this TapiConnectivitySwitchControlRefWrapper. + :type sub_switch_control: TapiConnectivitySwitchControlRef + """ + + self._sub_switch_control = sub_switch_control diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_switch_control_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_switch_control_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..993504e2431dfe2c8bf4587767e842a85789acc8 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_switch_control_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_switch_control import TapiConnectivitySwitchControl # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivitySwitchControlWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, switch_control: TapiConnectivitySwitchControl=None): # noqa: E501 + """TapiConnectivitySwitchControlWrapper - a model defined in Swagger + + :param switch_control: The switch_control of this TapiConnectivitySwitchControlWrapper. # noqa: E501 + :type switch_control: TapiConnectivitySwitchControl + """ + self.swagger_types = { + 'switch_control': TapiConnectivitySwitchControl + } + + self.attribute_map = { + 'switch_control': 'switch-control' + } + self._switch_control = switch_control + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivitySwitchControlWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.SwitchControlWrapper of this TapiConnectivitySwitchControlWrapper. # noqa: E501 + :rtype: TapiConnectivitySwitchControlWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def switch_control(self) -> TapiConnectivitySwitchControl: + """Gets the switch_control of this TapiConnectivitySwitchControlWrapper. + + + :return: The switch_control of this TapiConnectivitySwitchControlWrapper. + :rtype: TapiConnectivitySwitchControl + """ + return self._switch_control + + @switch_control.setter + def switch_control(self, switch_control: TapiConnectivitySwitchControl): + """Sets the switch_control of this TapiConnectivitySwitchControlWrapper. + + + :param switch_control: The switch_control of this TapiConnectivitySwitchControlWrapper. + :type switch_control: TapiConnectivitySwitchControl + """ + + self._switch_control = switch_control diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_switch_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_switch_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..52a2166bc8e4ceb0fe372ec40953c48c370ebc8a --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_switch_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_switch import TapiConnectivitySwitch # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivitySwitchWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, switch: TapiConnectivitySwitch=None): # noqa: E501 + """TapiConnectivitySwitchWrapper - a model defined in Swagger + + :param switch: The switch of this TapiConnectivitySwitchWrapper. # noqa: E501 + :type switch: TapiConnectivitySwitch + """ + self.swagger_types = { + 'switch': TapiConnectivitySwitch + } + + self.attribute_map = { + 'switch': 'switch' + } + self._switch = switch + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivitySwitchWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.SwitchWrapper of this TapiConnectivitySwitchWrapper. # noqa: E501 + :rtype: TapiConnectivitySwitchWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def switch(self) -> TapiConnectivitySwitch: + """Gets the switch of this TapiConnectivitySwitchWrapper. + + + :return: The switch of this TapiConnectivitySwitchWrapper. + :rtype: TapiConnectivitySwitch + """ + return self._switch + + @switch.setter + def switch(self, switch: TapiConnectivitySwitch): + """Sets the switch of this TapiConnectivitySwitchWrapper. + + + :param switch: The switch of this TapiConnectivitySwitchWrapper. + :type switch: TapiConnectivitySwitch + """ + + self._switch = switch diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_update_connectivity_service.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_update_connectivity_service.py new file mode 100644 index 0000000000000000000000000000000000000000..3a80b938b4d68cf6d7de12c066f7e3ee50a862fe --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_update_connectivity_service.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_updateconnectivityservice_output import TapiConnectivityUpdateconnectivityserviceOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityUpdateConnectivityService(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiConnectivityUpdateconnectivityserviceOutput=None): # noqa: E501 + """TapiConnectivityUpdateConnectivityService - a model defined in Swagger + + :param output: The output of this TapiConnectivityUpdateConnectivityService. # noqa: E501 + :type output: TapiConnectivityUpdateconnectivityserviceOutput + """ + self.swagger_types = { + 'output': TapiConnectivityUpdateconnectivityserviceOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityUpdateConnectivityService': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.UpdateConnectivityService of this TapiConnectivityUpdateConnectivityService. # noqa: E501 + :rtype: TapiConnectivityUpdateConnectivityService + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiConnectivityUpdateconnectivityserviceOutput: + """Gets the output of this TapiConnectivityUpdateConnectivityService. + + + :return: The output of this TapiConnectivityUpdateConnectivityService. + :rtype: TapiConnectivityUpdateconnectivityserviceOutput + """ + return self._output + + @output.setter + def output(self, output: TapiConnectivityUpdateconnectivityserviceOutput): + """Sets the output of this TapiConnectivityUpdateConnectivityService. + + + :param output: The output of this TapiConnectivityUpdateConnectivityService. + :type output: TapiConnectivityUpdateconnectivityserviceOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_updateconnectivityservice_input.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_updateconnectivityservice_input.py new file mode 100644 index 0000000000000000000000000000000000000000..d871c9b8e20488b37de02be6d2ee0e441f26c5eb --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_updateconnectivityservice_input.py @@ -0,0 +1,229 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connectivity_constraint import TapiConnectivityConnectivityConstraint # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_connectivity_service_end_point import TapiConnectivityConnectivityServiceEndPoint # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_resilience_constraint import TapiConnectivityResilienceConstraint # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_routing_constraint import TapiPathComputationRoutingConstraint # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_topology_constraint import TapiPathComputationTopologyConstraint # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityUpdateconnectivityserviceInput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, service_id_or_name: str=None, topology_constraint: TapiPathComputationTopologyConstraint=None, end_point: List[TapiConnectivityConnectivityServiceEndPoint]=None, resilience_constraint: TapiConnectivityResilienceConstraint=None, routing_constraint: TapiPathComputationRoutingConstraint=None, state: str=None, connectivity_constraint: TapiConnectivityConnectivityConstraint=None): # noqa: E501 + """TapiConnectivityUpdateconnectivityserviceInput - a model defined in Swagger + + :param service_id_or_name: The service_id_or_name of this TapiConnectivityUpdateconnectivityserviceInput. # noqa: E501 + :type service_id_or_name: str + :param topology_constraint: The topology_constraint of this TapiConnectivityUpdateconnectivityserviceInput. # noqa: E501 + :type topology_constraint: TapiPathComputationTopologyConstraint + :param end_point: The end_point of this TapiConnectivityUpdateconnectivityserviceInput. # noqa: E501 + :type end_point: List[TapiConnectivityConnectivityServiceEndPoint] + :param resilience_constraint: The resilience_constraint of this TapiConnectivityUpdateconnectivityserviceInput. # noqa: E501 + :type resilience_constraint: TapiConnectivityResilienceConstraint + :param routing_constraint: The routing_constraint of this TapiConnectivityUpdateconnectivityserviceInput. # noqa: E501 + :type routing_constraint: TapiPathComputationRoutingConstraint + :param state: The state of this TapiConnectivityUpdateconnectivityserviceInput. # noqa: E501 + :type state: str + :param connectivity_constraint: The connectivity_constraint of this TapiConnectivityUpdateconnectivityserviceInput. # noqa: E501 + :type connectivity_constraint: TapiConnectivityConnectivityConstraint + """ + self.swagger_types = { + 'service_id_or_name': str, + 'topology_constraint': TapiPathComputationTopologyConstraint, + 'end_point': List[TapiConnectivityConnectivityServiceEndPoint], + 'resilience_constraint': TapiConnectivityResilienceConstraint, + 'routing_constraint': TapiPathComputationRoutingConstraint, + 'state': str, + 'connectivity_constraint': TapiConnectivityConnectivityConstraint + } + + self.attribute_map = { + 'service_id_or_name': 'service-id-or-name', + 'topology_constraint': 'topology-constraint', + 'end_point': 'end-point', + 'resilience_constraint': 'resilience-constraint', + 'routing_constraint': 'routing-constraint', + 'state': 'state', + 'connectivity_constraint': 'connectivity-constraint' + } + self._service_id_or_name = service_id_or_name + self._topology_constraint = topology_constraint + self._end_point = end_point + self._resilience_constraint = resilience_constraint + self._routing_constraint = routing_constraint + self._state = state + self._connectivity_constraint = connectivity_constraint + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityUpdateconnectivityserviceInput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.updateconnectivityservice.Input of this TapiConnectivityUpdateconnectivityserviceInput. # noqa: E501 + :rtype: TapiConnectivityUpdateconnectivityserviceInput + """ + return util.deserialize_model(dikt, cls) + + @property + def service_id_or_name(self) -> str: + """Gets the service_id_or_name of this TapiConnectivityUpdateconnectivityserviceInput. + + none # noqa: E501 + + :return: The service_id_or_name of this TapiConnectivityUpdateconnectivityserviceInput. + :rtype: str + """ + return self._service_id_or_name + + @service_id_or_name.setter + def service_id_or_name(self, service_id_or_name: str): + """Sets the service_id_or_name of this TapiConnectivityUpdateconnectivityserviceInput. + + none # noqa: E501 + + :param service_id_or_name: The service_id_or_name of this TapiConnectivityUpdateconnectivityserviceInput. + :type service_id_or_name: str + """ + + self._service_id_or_name = service_id_or_name + + @property + def topology_constraint(self) -> TapiPathComputationTopologyConstraint: + """Gets the topology_constraint of this TapiConnectivityUpdateconnectivityserviceInput. + + + :return: The topology_constraint of this TapiConnectivityUpdateconnectivityserviceInput. + :rtype: TapiPathComputationTopologyConstraint + """ + return self._topology_constraint + + @topology_constraint.setter + def topology_constraint(self, topology_constraint: TapiPathComputationTopologyConstraint): + """Sets the topology_constraint of this TapiConnectivityUpdateconnectivityserviceInput. + + + :param topology_constraint: The topology_constraint of this TapiConnectivityUpdateconnectivityserviceInput. + :type topology_constraint: TapiPathComputationTopologyConstraint + """ + + self._topology_constraint = topology_constraint + + @property + def end_point(self) -> List[TapiConnectivityConnectivityServiceEndPoint]: + """Gets the end_point of this TapiConnectivityUpdateconnectivityserviceInput. + + none # noqa: E501 + + :return: The end_point of this TapiConnectivityUpdateconnectivityserviceInput. + :rtype: List[TapiConnectivityConnectivityServiceEndPoint] + """ + return self._end_point + + @end_point.setter + def end_point(self, end_point: List[TapiConnectivityConnectivityServiceEndPoint]): + """Sets the end_point of this TapiConnectivityUpdateconnectivityserviceInput. + + none # noqa: E501 + + :param end_point: The end_point of this TapiConnectivityUpdateconnectivityserviceInput. + :type end_point: List[TapiConnectivityConnectivityServiceEndPoint] + """ + + self._end_point = end_point + + @property + def resilience_constraint(self) -> TapiConnectivityResilienceConstraint: + """Gets the resilience_constraint of this TapiConnectivityUpdateconnectivityserviceInput. + + + :return: The resilience_constraint of this TapiConnectivityUpdateconnectivityserviceInput. + :rtype: TapiConnectivityResilienceConstraint + """ + return self._resilience_constraint + + @resilience_constraint.setter + def resilience_constraint(self, resilience_constraint: TapiConnectivityResilienceConstraint): + """Sets the resilience_constraint of this TapiConnectivityUpdateconnectivityserviceInput. + + + :param resilience_constraint: The resilience_constraint of this TapiConnectivityUpdateconnectivityserviceInput. + :type resilience_constraint: TapiConnectivityResilienceConstraint + """ + + self._resilience_constraint = resilience_constraint + + @property + def routing_constraint(self) -> TapiPathComputationRoutingConstraint: + """Gets the routing_constraint of this TapiConnectivityUpdateconnectivityserviceInput. + + + :return: The routing_constraint of this TapiConnectivityUpdateconnectivityserviceInput. + :rtype: TapiPathComputationRoutingConstraint + """ + return self._routing_constraint + + @routing_constraint.setter + def routing_constraint(self, routing_constraint: TapiPathComputationRoutingConstraint): + """Sets the routing_constraint of this TapiConnectivityUpdateconnectivityserviceInput. + + + :param routing_constraint: The routing_constraint of this TapiConnectivityUpdateconnectivityserviceInput. + :type routing_constraint: TapiPathComputationRoutingConstraint + """ + + self._routing_constraint = routing_constraint + + @property + def state(self) -> str: + """Gets the state of this TapiConnectivityUpdateconnectivityserviceInput. + + none # noqa: E501 + + :return: The state of this TapiConnectivityUpdateconnectivityserviceInput. + :rtype: str + """ + return self._state + + @state.setter + def state(self, state: str): + """Sets the state of this TapiConnectivityUpdateconnectivityserviceInput. + + none # noqa: E501 + + :param state: The state of this TapiConnectivityUpdateconnectivityserviceInput. + :type state: str + """ + + self._state = state + + @property + def connectivity_constraint(self) -> TapiConnectivityConnectivityConstraint: + """Gets the connectivity_constraint of this TapiConnectivityUpdateconnectivityserviceInput. + + + :return: The connectivity_constraint of this TapiConnectivityUpdateconnectivityserviceInput. + :rtype: TapiConnectivityConnectivityConstraint + """ + return self._connectivity_constraint + + @connectivity_constraint.setter + def connectivity_constraint(self, connectivity_constraint: TapiConnectivityConnectivityConstraint): + """Sets the connectivity_constraint of this TapiConnectivityUpdateconnectivityserviceInput. + + + :param connectivity_constraint: The connectivity_constraint of this TapiConnectivityUpdateconnectivityserviceInput. + :type connectivity_constraint: TapiConnectivityConnectivityConstraint + """ + + self._connectivity_constraint = connectivity_constraint diff --git a/hackfest/tapi/server/tapi_server/models/tapi_connectivity_updateconnectivityservice_output.py b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_updateconnectivityservice_output.py new file mode 100644 index 0000000000000000000000000000000000000000..a9d2d85b4f5153176e3d91dd4074b1490a409d6e --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_connectivity_updateconnectivityservice_output.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_connectivity_connectivity_service import TapiConnectivityConnectivityService # noqa: F401,E501 +from tapi_server import util + + +class TapiConnectivityUpdateconnectivityserviceOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, service: TapiConnectivityConnectivityService=None): # noqa: E501 + """TapiConnectivityUpdateconnectivityserviceOutput - a model defined in Swagger + + :param service: The service of this TapiConnectivityUpdateconnectivityserviceOutput. # noqa: E501 + :type service: TapiConnectivityConnectivityService + """ + self.swagger_types = { + 'service': TapiConnectivityConnectivityService + } + + self.attribute_map = { + 'service': 'service' + } + self._service = service + + @classmethod + def from_dict(cls, dikt) -> 'TapiConnectivityUpdateconnectivityserviceOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.connectivity.updateconnectivityservice.Output of this TapiConnectivityUpdateconnectivityserviceOutput. # noqa: E501 + :rtype: TapiConnectivityUpdateconnectivityserviceOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def service(self) -> TapiConnectivityConnectivityService: + """Gets the service of this TapiConnectivityUpdateconnectivityserviceOutput. + + + :return: The service of this TapiConnectivityUpdateconnectivityserviceOutput. + :rtype: TapiConnectivityConnectivityService + """ + return self._service + + @service.setter + def service(self, service: TapiConnectivityConnectivityService): + """Sets the service of this TapiConnectivityUpdateconnectivityserviceOutput. + + + :param service: The service of this TapiConnectivityUpdateconnectivityserviceOutput. + :type service: TapiConnectivityConnectivityService + """ + + self._service = service diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_alarm_info.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_alarm_info.py new file mode 100644 index 0000000000000000000000000000000000000000..51a759100a9cb0e447d620b51db4f5fa42dbbb5c --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_alarm_info.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_perceived_severity_type import TapiNotificationPerceivedSeverityType # noqa: F401,E501 +from tapi_server.models.tapi_notification_service_affecting import TapiNotificationServiceAffecting # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationAlarmInfo(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, perceived_severity: TapiNotificationPerceivedSeverityType=None, probable_cause: str=None, service_affecting: TapiNotificationServiceAffecting=None, is_transient: bool=False): # noqa: E501 + """TapiNotificationAlarmInfo - a model defined in Swagger + + :param perceived_severity: The perceived_severity of this TapiNotificationAlarmInfo. # noqa: E501 + :type perceived_severity: TapiNotificationPerceivedSeverityType + :param probable_cause: The probable_cause of this TapiNotificationAlarmInfo. # noqa: E501 + :type probable_cause: str + :param service_affecting: The service_affecting of this TapiNotificationAlarmInfo. # noqa: E501 + :type service_affecting: TapiNotificationServiceAffecting + :param is_transient: The is_transient of this TapiNotificationAlarmInfo. # noqa: E501 + :type is_transient: bool + """ + self.swagger_types = { + 'perceived_severity': TapiNotificationPerceivedSeverityType, + 'probable_cause': str, + 'service_affecting': TapiNotificationServiceAffecting, + 'is_transient': bool + } + + self.attribute_map = { + 'perceived_severity': 'perceived-severity', + 'probable_cause': 'probable-cause', + 'service_affecting': 'service-affecting', + 'is_transient': 'is-transient' + } + self._perceived_severity = perceived_severity + self._probable_cause = probable_cause + self._service_affecting = service_affecting + self._is_transient = is_transient + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationAlarmInfo': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.AlarmInfo of this TapiNotificationAlarmInfo. # noqa: E501 + :rtype: TapiNotificationAlarmInfo + """ + return util.deserialize_model(dikt, cls) + + @property + def perceived_severity(self) -> TapiNotificationPerceivedSeverityType: + """Gets the perceived_severity of this TapiNotificationAlarmInfo. + + + :return: The perceived_severity of this TapiNotificationAlarmInfo. + :rtype: TapiNotificationPerceivedSeverityType + """ + return self._perceived_severity + + @perceived_severity.setter + def perceived_severity(self, perceived_severity: TapiNotificationPerceivedSeverityType): + """Sets the perceived_severity of this TapiNotificationAlarmInfo. + + + :param perceived_severity: The perceived_severity of this TapiNotificationAlarmInfo. + :type perceived_severity: TapiNotificationPerceivedSeverityType + """ + + self._perceived_severity = perceived_severity + + @property + def probable_cause(self) -> str: + """Gets the probable_cause of this TapiNotificationAlarmInfo. + + none # noqa: E501 + + :return: The probable_cause of this TapiNotificationAlarmInfo. + :rtype: str + """ + return self._probable_cause + + @probable_cause.setter + def probable_cause(self, probable_cause: str): + """Sets the probable_cause of this TapiNotificationAlarmInfo. + + none # noqa: E501 + + :param probable_cause: The probable_cause of this TapiNotificationAlarmInfo. + :type probable_cause: str + """ + + self._probable_cause = probable_cause + + @property + def service_affecting(self) -> TapiNotificationServiceAffecting: + """Gets the service_affecting of this TapiNotificationAlarmInfo. + + + :return: The service_affecting of this TapiNotificationAlarmInfo. + :rtype: TapiNotificationServiceAffecting + """ + return self._service_affecting + + @service_affecting.setter + def service_affecting(self, service_affecting: TapiNotificationServiceAffecting): + """Sets the service_affecting of this TapiNotificationAlarmInfo. + + + :param service_affecting: The service_affecting of this TapiNotificationAlarmInfo. + :type service_affecting: TapiNotificationServiceAffecting + """ + + self._service_affecting = service_affecting + + @property + def is_transient(self) -> bool: + """Gets the is_transient of this TapiNotificationAlarmInfo. + + none # noqa: E501 + + :return: The is_transient of this TapiNotificationAlarmInfo. + :rtype: bool + """ + return self._is_transient + + @is_transient.setter + def is_transient(self, is_transient: bool): + """Sets the is_transient of this TapiNotificationAlarmInfo. + + none # noqa: E501 + + :param is_transient: The is_transient of this TapiNotificationAlarmInfo. + :type is_transient: bool + """ + + self._is_transient = is_transient diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_alarm_info_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_alarm_info_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..d0ac0bcb010d16c1fb3429ad9864662fce4e8bda --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_alarm_info_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_alarm_info import TapiNotificationAlarmInfo # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationAlarmInfoWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, alarm_info: TapiNotificationAlarmInfo=None): # noqa: E501 + """TapiNotificationAlarmInfoWrapper - a model defined in Swagger + + :param alarm_info: The alarm_info of this TapiNotificationAlarmInfoWrapper. # noqa: E501 + :type alarm_info: TapiNotificationAlarmInfo + """ + self.swagger_types = { + 'alarm_info': TapiNotificationAlarmInfo + } + + self.attribute_map = { + 'alarm_info': 'alarm-info' + } + self._alarm_info = alarm_info + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationAlarmInfoWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.AlarmInfoWrapper of this TapiNotificationAlarmInfoWrapper. # noqa: E501 + :rtype: TapiNotificationAlarmInfoWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def alarm_info(self) -> TapiNotificationAlarmInfo: + """Gets the alarm_info of this TapiNotificationAlarmInfoWrapper. + + + :return: The alarm_info of this TapiNotificationAlarmInfoWrapper. + :rtype: TapiNotificationAlarmInfo + """ + return self._alarm_info + + @alarm_info.setter + def alarm_info(self, alarm_info: TapiNotificationAlarmInfo): + """Sets the alarm_info of this TapiNotificationAlarmInfoWrapper. + + + :param alarm_info: The alarm_info of this TapiNotificationAlarmInfoWrapper. + :type alarm_info: TapiNotificationAlarmInfo + """ + + self._alarm_info = alarm_info diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_context_augmentation1.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_context_augmentation1.py new file mode 100644 index 0000000000000000000000000000000000000000..8d363452e9ab3ba9c564a0e77791c119be44276e --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_context_augmentation1.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_notification_context import TapiNotificationNotificationContext # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationContextAugmentation1(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, notification_context: TapiNotificationNotificationContext=None): # noqa: E501 + """TapiNotificationContextAugmentation1 - a model defined in Swagger + + :param notification_context: The notification_context of this TapiNotificationContextAugmentation1. # noqa: E501 + :type notification_context: TapiNotificationNotificationContext + """ + self.swagger_types = { + 'notification_context': TapiNotificationNotificationContext + } + + self.attribute_map = { + 'notification_context': 'notification-context' + } + self._notification_context = notification_context + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationContextAugmentation1': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.ContextAugmentation1 of this TapiNotificationContextAugmentation1. # noqa: E501 + :rtype: TapiNotificationContextAugmentation1 + """ + return util.deserialize_model(dikt, cls) + + @property + def notification_context(self) -> TapiNotificationNotificationContext: + """Gets the notification_context of this TapiNotificationContextAugmentation1. + + + :return: The notification_context of this TapiNotificationContextAugmentation1. + :rtype: TapiNotificationNotificationContext + """ + return self._notification_context + + @notification_context.setter + def notification_context(self, notification_context: TapiNotificationNotificationContext): + """Sets the notification_context of this TapiNotificationContextAugmentation1. + + + :param notification_context: The notification_context of this TapiNotificationContextAugmentation1. + :type notification_context: TapiNotificationNotificationContext + """ + + self._notification_context = notification_context diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_create_notification_subscription_service.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_create_notification_subscription_service.py new file mode 100644 index 0000000000000000000000000000000000000000..93518225c0bb60ce41386242cf81c86725956260 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_create_notification_subscription_service.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_createnotificationsubscriptionservice_output import TapiNotificationCreatenotificationsubscriptionserviceOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationCreateNotificationSubscriptionService(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiNotificationCreatenotificationsubscriptionserviceOutput=None): # noqa: E501 + """TapiNotificationCreateNotificationSubscriptionService - a model defined in Swagger + + :param output: The output of this TapiNotificationCreateNotificationSubscriptionService. # noqa: E501 + :type output: TapiNotificationCreatenotificationsubscriptionserviceOutput + """ + self.swagger_types = { + 'output': TapiNotificationCreatenotificationsubscriptionserviceOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationCreateNotificationSubscriptionService': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.CreateNotificationSubscriptionService of this TapiNotificationCreateNotificationSubscriptionService. # noqa: E501 + :rtype: TapiNotificationCreateNotificationSubscriptionService + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiNotificationCreatenotificationsubscriptionserviceOutput: + """Gets the output of this TapiNotificationCreateNotificationSubscriptionService. + + + :return: The output of this TapiNotificationCreateNotificationSubscriptionService. + :rtype: TapiNotificationCreatenotificationsubscriptionserviceOutput + """ + return self._output + + @output.setter + def output(self, output: TapiNotificationCreatenotificationsubscriptionserviceOutput): + """Sets the output of this TapiNotificationCreateNotificationSubscriptionService. + + + :param output: The output of this TapiNotificationCreateNotificationSubscriptionService. + :type output: TapiNotificationCreatenotificationsubscriptionserviceOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_createnotificationsubscriptionservice_input.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_createnotificationsubscriptionservice_input.py new file mode 100644 index 0000000000000000000000000000000000000000..8b0572aa9da9d16e4a7dbe3816c5d2ac672146e4 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_createnotificationsubscriptionservice_input.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_subscription_filter import TapiNotificationSubscriptionFilter # noqa: F401,E501 +from tapi_server.models.tapi_notification_subscription_state import TapiNotificationSubscriptionState # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationCreatenotificationsubscriptionserviceInput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, subscription_state: TapiNotificationSubscriptionState=None, subscription_filter: TapiNotificationSubscriptionFilter=None): # noqa: E501 + """TapiNotificationCreatenotificationsubscriptionserviceInput - a model defined in Swagger + + :param subscription_state: The subscription_state of this TapiNotificationCreatenotificationsubscriptionserviceInput. # noqa: E501 + :type subscription_state: TapiNotificationSubscriptionState + :param subscription_filter: The subscription_filter of this TapiNotificationCreatenotificationsubscriptionserviceInput. # noqa: E501 + :type subscription_filter: TapiNotificationSubscriptionFilter + """ + self.swagger_types = { + 'subscription_state': TapiNotificationSubscriptionState, + 'subscription_filter': TapiNotificationSubscriptionFilter + } + + self.attribute_map = { + 'subscription_state': 'subscription-state', + 'subscription_filter': 'subscription-filter' + } + self._subscription_state = subscription_state + self._subscription_filter = subscription_filter + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationCreatenotificationsubscriptionserviceInput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.createnotificationsubscriptionservice.Input of this TapiNotificationCreatenotificationsubscriptionserviceInput. # noqa: E501 + :rtype: TapiNotificationCreatenotificationsubscriptionserviceInput + """ + return util.deserialize_model(dikt, cls) + + @property + def subscription_state(self) -> TapiNotificationSubscriptionState: + """Gets the subscription_state of this TapiNotificationCreatenotificationsubscriptionserviceInput. + + + :return: The subscription_state of this TapiNotificationCreatenotificationsubscriptionserviceInput. + :rtype: TapiNotificationSubscriptionState + """ + return self._subscription_state + + @subscription_state.setter + def subscription_state(self, subscription_state: TapiNotificationSubscriptionState): + """Sets the subscription_state of this TapiNotificationCreatenotificationsubscriptionserviceInput. + + + :param subscription_state: The subscription_state of this TapiNotificationCreatenotificationsubscriptionserviceInput. + :type subscription_state: TapiNotificationSubscriptionState + """ + + self._subscription_state = subscription_state + + @property + def subscription_filter(self) -> TapiNotificationSubscriptionFilter: + """Gets the subscription_filter of this TapiNotificationCreatenotificationsubscriptionserviceInput. + + + :return: The subscription_filter of this TapiNotificationCreatenotificationsubscriptionserviceInput. + :rtype: TapiNotificationSubscriptionFilter + """ + return self._subscription_filter + + @subscription_filter.setter + def subscription_filter(self, subscription_filter: TapiNotificationSubscriptionFilter): + """Sets the subscription_filter of this TapiNotificationCreatenotificationsubscriptionserviceInput. + + + :param subscription_filter: The subscription_filter of this TapiNotificationCreatenotificationsubscriptionserviceInput. + :type subscription_filter: TapiNotificationSubscriptionFilter + """ + + self._subscription_filter = subscription_filter diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_createnotificationsubscriptionservice_output.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_createnotificationsubscriptionservice_output.py new file mode 100644 index 0000000000000000000000000000000000000000..52426ffab3c436b1a436e9fde9f9634e75a6e0a6 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_createnotificationsubscriptionservice_output.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_notification_subscription_service import TapiNotificationNotificationSubscriptionService # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationCreatenotificationsubscriptionserviceOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, subscription_service: TapiNotificationNotificationSubscriptionService=None): # noqa: E501 + """TapiNotificationCreatenotificationsubscriptionserviceOutput - a model defined in Swagger + + :param subscription_service: The subscription_service of this TapiNotificationCreatenotificationsubscriptionserviceOutput. # noqa: E501 + :type subscription_service: TapiNotificationNotificationSubscriptionService + """ + self.swagger_types = { + 'subscription_service': TapiNotificationNotificationSubscriptionService + } + + self.attribute_map = { + 'subscription_service': 'subscription-service' + } + self._subscription_service = subscription_service + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationCreatenotificationsubscriptionserviceOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.createnotificationsubscriptionservice.Output of this TapiNotificationCreatenotificationsubscriptionserviceOutput. # noqa: E501 + :rtype: TapiNotificationCreatenotificationsubscriptionserviceOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def subscription_service(self) -> TapiNotificationNotificationSubscriptionService: + """Gets the subscription_service of this TapiNotificationCreatenotificationsubscriptionserviceOutput. + + + :return: The subscription_service of this TapiNotificationCreatenotificationsubscriptionserviceOutput. + :rtype: TapiNotificationNotificationSubscriptionService + """ + return self._subscription_service + + @subscription_service.setter + def subscription_service(self, subscription_service: TapiNotificationNotificationSubscriptionService): + """Sets the subscription_service of this TapiNotificationCreatenotificationsubscriptionserviceOutput. + + + :param subscription_service: The subscription_service of this TapiNotificationCreatenotificationsubscriptionserviceOutput. + :type subscription_service: TapiNotificationNotificationSubscriptionService + """ + + self._subscription_service = subscription_service diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_delete_notification_subscription_service.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_delete_notification_subscription_service.py new file mode 100644 index 0000000000000000000000000000000000000000..c38cfa685afa1c54befcc85c2e0a046070ce79b3 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_delete_notification_subscription_service.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_deletenotificationsubscriptionservice_output import TapiNotificationDeletenotificationsubscriptionserviceOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationDeleteNotificationSubscriptionService(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiNotificationDeletenotificationsubscriptionserviceOutput=None): # noqa: E501 + """TapiNotificationDeleteNotificationSubscriptionService - a model defined in Swagger + + :param output: The output of this TapiNotificationDeleteNotificationSubscriptionService. # noqa: E501 + :type output: TapiNotificationDeletenotificationsubscriptionserviceOutput + """ + self.swagger_types = { + 'output': TapiNotificationDeletenotificationsubscriptionserviceOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationDeleteNotificationSubscriptionService': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.DeleteNotificationSubscriptionService of this TapiNotificationDeleteNotificationSubscriptionService. # noqa: E501 + :rtype: TapiNotificationDeleteNotificationSubscriptionService + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiNotificationDeletenotificationsubscriptionserviceOutput: + """Gets the output of this TapiNotificationDeleteNotificationSubscriptionService. + + + :return: The output of this TapiNotificationDeleteNotificationSubscriptionService. + :rtype: TapiNotificationDeletenotificationsubscriptionserviceOutput + """ + return self._output + + @output.setter + def output(self, output: TapiNotificationDeletenotificationsubscriptionserviceOutput): + """Sets the output of this TapiNotificationDeleteNotificationSubscriptionService. + + + :param output: The output of this TapiNotificationDeleteNotificationSubscriptionService. + :type output: TapiNotificationDeletenotificationsubscriptionserviceOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_deletenotificationsubscriptionservice_input.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_deletenotificationsubscriptionservice_input.py new file mode 100644 index 0000000000000000000000000000000000000000..c1c2ca6aa21fa142024d9c385ce5ad133c969f97 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_deletenotificationsubscriptionservice_input.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiNotificationDeletenotificationsubscriptionserviceInput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, subscription_id_or_name: str=None): # noqa: E501 + """TapiNotificationDeletenotificationsubscriptionserviceInput - a model defined in Swagger + + :param subscription_id_or_name: The subscription_id_or_name of this TapiNotificationDeletenotificationsubscriptionserviceInput. # noqa: E501 + :type subscription_id_or_name: str + """ + self.swagger_types = { + 'subscription_id_or_name': str + } + + self.attribute_map = { + 'subscription_id_or_name': 'subscription-id-or-name' + } + self._subscription_id_or_name = subscription_id_or_name + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationDeletenotificationsubscriptionserviceInput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.deletenotificationsubscriptionservice.Input of this TapiNotificationDeletenotificationsubscriptionserviceInput. # noqa: E501 + :rtype: TapiNotificationDeletenotificationsubscriptionserviceInput + """ + return util.deserialize_model(dikt, cls) + + @property + def subscription_id_or_name(self) -> str: + """Gets the subscription_id_or_name of this TapiNotificationDeletenotificationsubscriptionserviceInput. + + none # noqa: E501 + + :return: The subscription_id_or_name of this TapiNotificationDeletenotificationsubscriptionserviceInput. + :rtype: str + """ + return self._subscription_id_or_name + + @subscription_id_or_name.setter + def subscription_id_or_name(self, subscription_id_or_name: str): + """Sets the subscription_id_or_name of this TapiNotificationDeletenotificationsubscriptionserviceInput. + + none # noqa: E501 + + :param subscription_id_or_name: The subscription_id_or_name of this TapiNotificationDeletenotificationsubscriptionserviceInput. + :type subscription_id_or_name: str + """ + + self._subscription_id_or_name = subscription_id_or_name diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_deletenotificationsubscriptionservice_output.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_deletenotificationsubscriptionservice_output.py new file mode 100644 index 0000000000000000000000000000000000000000..9746d00f257b5bf879c03b8e3c05a55f961e89a3 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_deletenotificationsubscriptionservice_output.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_notification_subscription_service import TapiNotificationNotificationSubscriptionService # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationDeletenotificationsubscriptionserviceOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, subscription_service: TapiNotificationNotificationSubscriptionService=None): # noqa: E501 + """TapiNotificationDeletenotificationsubscriptionserviceOutput - a model defined in Swagger + + :param subscription_service: The subscription_service of this TapiNotificationDeletenotificationsubscriptionserviceOutput. # noqa: E501 + :type subscription_service: TapiNotificationNotificationSubscriptionService + """ + self.swagger_types = { + 'subscription_service': TapiNotificationNotificationSubscriptionService + } + + self.attribute_map = { + 'subscription_service': 'subscription-service' + } + self._subscription_service = subscription_service + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationDeletenotificationsubscriptionserviceOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.deletenotificationsubscriptionservice.Output of this TapiNotificationDeletenotificationsubscriptionserviceOutput. # noqa: E501 + :rtype: TapiNotificationDeletenotificationsubscriptionserviceOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def subscription_service(self) -> TapiNotificationNotificationSubscriptionService: + """Gets the subscription_service of this TapiNotificationDeletenotificationsubscriptionserviceOutput. + + + :return: The subscription_service of this TapiNotificationDeletenotificationsubscriptionserviceOutput. + :rtype: TapiNotificationNotificationSubscriptionService + """ + return self._subscription_service + + @subscription_service.setter + def subscription_service(self, subscription_service: TapiNotificationNotificationSubscriptionService): + """Sets the subscription_service of this TapiNotificationDeletenotificationsubscriptionserviceOutput. + + + :param subscription_service: The subscription_service of this TapiNotificationDeletenotificationsubscriptionserviceOutput. + :type subscription_service: TapiNotificationNotificationSubscriptionService + """ + + self._subscription_service = subscription_service diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_get_notification_list.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_get_notification_list.py new file mode 100644 index 0000000000000000000000000000000000000000..3b6ca4fd656c470eb45525c725b0d215244af505 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_get_notification_list.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_getnotificationlist_output import TapiNotificationGetnotificationlistOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationGetNotificationList(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiNotificationGetnotificationlistOutput=None): # noqa: E501 + """TapiNotificationGetNotificationList - a model defined in Swagger + + :param output: The output of this TapiNotificationGetNotificationList. # noqa: E501 + :type output: TapiNotificationGetnotificationlistOutput + """ + self.swagger_types = { + 'output': TapiNotificationGetnotificationlistOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationGetNotificationList': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.GetNotificationList of this TapiNotificationGetNotificationList. # noqa: E501 + :rtype: TapiNotificationGetNotificationList + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiNotificationGetnotificationlistOutput: + """Gets the output of this TapiNotificationGetNotificationList. + + + :return: The output of this TapiNotificationGetNotificationList. + :rtype: TapiNotificationGetnotificationlistOutput + """ + return self._output + + @output.setter + def output(self, output: TapiNotificationGetnotificationlistOutput): + """Sets the output of this TapiNotificationGetNotificationList. + + + :param output: The output of this TapiNotificationGetNotificationList. + :type output: TapiNotificationGetnotificationlistOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_get_notification_subscription_service_details.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_get_notification_subscription_service_details.py new file mode 100644 index 0000000000000000000000000000000000000000..50bf3f6a896cef26e68a6ed4c79563214ac26530 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_get_notification_subscription_service_details.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_getnotificationsubscriptionservicedetails_output import TapiNotificationGetnotificationsubscriptionservicedetailsOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationGetNotificationSubscriptionServiceDetails(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiNotificationGetnotificationsubscriptionservicedetailsOutput=None): # noqa: E501 + """TapiNotificationGetNotificationSubscriptionServiceDetails - a model defined in Swagger + + :param output: The output of this TapiNotificationGetNotificationSubscriptionServiceDetails. # noqa: E501 + :type output: TapiNotificationGetnotificationsubscriptionservicedetailsOutput + """ + self.swagger_types = { + 'output': TapiNotificationGetnotificationsubscriptionservicedetailsOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationGetNotificationSubscriptionServiceDetails': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.GetNotificationSubscriptionServiceDetails of this TapiNotificationGetNotificationSubscriptionServiceDetails. # noqa: E501 + :rtype: TapiNotificationGetNotificationSubscriptionServiceDetails + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiNotificationGetnotificationsubscriptionservicedetailsOutput: + """Gets the output of this TapiNotificationGetNotificationSubscriptionServiceDetails. + + + :return: The output of this TapiNotificationGetNotificationSubscriptionServiceDetails. + :rtype: TapiNotificationGetnotificationsubscriptionservicedetailsOutput + """ + return self._output + + @output.setter + def output(self, output: TapiNotificationGetnotificationsubscriptionservicedetailsOutput): + """Sets the output of this TapiNotificationGetNotificationSubscriptionServiceDetails. + + + :param output: The output of this TapiNotificationGetNotificationSubscriptionServiceDetails. + :type output: TapiNotificationGetnotificationsubscriptionservicedetailsOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_get_notification_subscription_service_list.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_get_notification_subscription_service_list.py new file mode 100644 index 0000000000000000000000000000000000000000..580435c0cf76cc3fa6e4616d1969d6466e8f0931 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_get_notification_subscription_service_list.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_getnotificationsubscriptionservicelist_output import TapiNotificationGetnotificationsubscriptionservicelistOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationGetNotificationSubscriptionServiceList(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiNotificationGetnotificationsubscriptionservicelistOutput=None): # noqa: E501 + """TapiNotificationGetNotificationSubscriptionServiceList - a model defined in Swagger + + :param output: The output of this TapiNotificationGetNotificationSubscriptionServiceList. # noqa: E501 + :type output: TapiNotificationGetnotificationsubscriptionservicelistOutput + """ + self.swagger_types = { + 'output': TapiNotificationGetnotificationsubscriptionservicelistOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationGetNotificationSubscriptionServiceList': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.GetNotificationSubscriptionServiceList of this TapiNotificationGetNotificationSubscriptionServiceList. # noqa: E501 + :rtype: TapiNotificationGetNotificationSubscriptionServiceList + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiNotificationGetnotificationsubscriptionservicelistOutput: + """Gets the output of this TapiNotificationGetNotificationSubscriptionServiceList. + + + :return: The output of this TapiNotificationGetNotificationSubscriptionServiceList. + :rtype: TapiNotificationGetnotificationsubscriptionservicelistOutput + """ + return self._output + + @output.setter + def output(self, output: TapiNotificationGetnotificationsubscriptionservicelistOutput): + """Sets the output of this TapiNotificationGetNotificationSubscriptionServiceList. + + + :param output: The output of this TapiNotificationGetNotificationSubscriptionServiceList. + :type output: TapiNotificationGetnotificationsubscriptionservicelistOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_get_supported_notification_types.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_get_supported_notification_types.py new file mode 100644 index 0000000000000000000000000000000000000000..3b93d784817c938b93162f984cfa78b25ce3f566 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_get_supported_notification_types.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_getsupportednotificationtypes_output import TapiNotificationGetsupportednotificationtypesOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationGetSupportedNotificationTypes(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiNotificationGetsupportednotificationtypesOutput=None): # noqa: E501 + """TapiNotificationGetSupportedNotificationTypes - a model defined in Swagger + + :param output: The output of this TapiNotificationGetSupportedNotificationTypes. # noqa: E501 + :type output: TapiNotificationGetsupportednotificationtypesOutput + """ + self.swagger_types = { + 'output': TapiNotificationGetsupportednotificationtypesOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationGetSupportedNotificationTypes': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.GetSupportedNotificationTypes of this TapiNotificationGetSupportedNotificationTypes. # noqa: E501 + :rtype: TapiNotificationGetSupportedNotificationTypes + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiNotificationGetsupportednotificationtypesOutput: + """Gets the output of this TapiNotificationGetSupportedNotificationTypes. + + + :return: The output of this TapiNotificationGetSupportedNotificationTypes. + :rtype: TapiNotificationGetsupportednotificationtypesOutput + """ + return self._output + + @output.setter + def output(self, output: TapiNotificationGetsupportednotificationtypesOutput): + """Sets the output of this TapiNotificationGetSupportedNotificationTypes. + + + :param output: The output of this TapiNotificationGetSupportedNotificationTypes. + :type output: TapiNotificationGetsupportednotificationtypesOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_getnotificationlist_input.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_getnotificationlist_input.py new file mode 100644 index 0000000000000000000000000000000000000000..f2fe7c6f4e3ad837e97a9b0de1b4a5e998a6805b --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_getnotificationlist_input.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiNotificationGetnotificationlistInput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, time_period: str=None, subscription_id_or_name: str=None): # noqa: E501 + """TapiNotificationGetnotificationlistInput - a model defined in Swagger + + :param time_period: The time_period of this TapiNotificationGetnotificationlistInput. # noqa: E501 + :type time_period: str + :param subscription_id_or_name: The subscription_id_or_name of this TapiNotificationGetnotificationlistInput. # noqa: E501 + :type subscription_id_or_name: str + """ + self.swagger_types = { + 'time_period': str, + 'subscription_id_or_name': str + } + + self.attribute_map = { + 'time_period': 'time-period', + 'subscription_id_or_name': 'subscription-id-or-name' + } + self._time_period = time_period + self._subscription_id_or_name = subscription_id_or_name + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationGetnotificationlistInput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.getnotificationlist.Input of this TapiNotificationGetnotificationlistInput. # noqa: E501 + :rtype: TapiNotificationGetnotificationlistInput + """ + return util.deserialize_model(dikt, cls) + + @property + def time_period(self) -> str: + """Gets the time_period of this TapiNotificationGetnotificationlistInput. + + none # noqa: E501 + + :return: The time_period of this TapiNotificationGetnotificationlistInput. + :rtype: str + """ + return self._time_period + + @time_period.setter + def time_period(self, time_period: str): + """Sets the time_period of this TapiNotificationGetnotificationlistInput. + + none # noqa: E501 + + :param time_period: The time_period of this TapiNotificationGetnotificationlistInput. + :type time_period: str + """ + + self._time_period = time_period + + @property + def subscription_id_or_name(self) -> str: + """Gets the subscription_id_or_name of this TapiNotificationGetnotificationlistInput. + + none # noqa: E501 + + :return: The subscription_id_or_name of this TapiNotificationGetnotificationlistInput. + :rtype: str + """ + return self._subscription_id_or_name + + @subscription_id_or_name.setter + def subscription_id_or_name(self, subscription_id_or_name: str): + """Sets the subscription_id_or_name of this TapiNotificationGetnotificationlistInput. + + none # noqa: E501 + + :param subscription_id_or_name: The subscription_id_or_name of this TapiNotificationGetnotificationlistInput. + :type subscription_id_or_name: str + """ + + self._subscription_id_or_name = subscription_id_or_name diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_getnotificationlist_output.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_getnotificationlist_output.py new file mode 100644 index 0000000000000000000000000000000000000000..b2af0be12f49cc6f71795863b8cdc135192ba165 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_getnotificationlist_output.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_notification import TapiNotificationNotification # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationGetnotificationlistOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, notification: List[TapiNotificationNotification]=None): # noqa: E501 + """TapiNotificationGetnotificationlistOutput - a model defined in Swagger + + :param notification: The notification of this TapiNotificationGetnotificationlistOutput. # noqa: E501 + :type notification: List[TapiNotificationNotification] + """ + self.swagger_types = { + 'notification': List[TapiNotificationNotification] + } + + self.attribute_map = { + 'notification': 'notification' + } + self._notification = notification + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationGetnotificationlistOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.getnotificationlist.Output of this TapiNotificationGetnotificationlistOutput. # noqa: E501 + :rtype: TapiNotificationGetnotificationlistOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def notification(self) -> List[TapiNotificationNotification]: + """Gets the notification of this TapiNotificationGetnotificationlistOutput. + + none # noqa: E501 + + :return: The notification of this TapiNotificationGetnotificationlistOutput. + :rtype: List[TapiNotificationNotification] + """ + return self._notification + + @notification.setter + def notification(self, notification: List[TapiNotificationNotification]): + """Sets the notification of this TapiNotificationGetnotificationlistOutput. + + none # noqa: E501 + + :param notification: The notification of this TapiNotificationGetnotificationlistOutput. + :type notification: List[TapiNotificationNotification] + """ + + self._notification = notification diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_getnotificationsubscriptionservicedetails_input.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_getnotificationsubscriptionservicedetails_input.py new file mode 100644 index 0000000000000000000000000000000000000000..acf36fec45e6fe483464b5b243bed97c8ebc5036 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_getnotificationsubscriptionservicedetails_input.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiNotificationGetnotificationsubscriptionservicedetailsInput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, subscription_id_or_name: str=None): # noqa: E501 + """TapiNotificationGetnotificationsubscriptionservicedetailsInput - a model defined in Swagger + + :param subscription_id_or_name: The subscription_id_or_name of this TapiNotificationGetnotificationsubscriptionservicedetailsInput. # noqa: E501 + :type subscription_id_or_name: str + """ + self.swagger_types = { + 'subscription_id_or_name': str + } + + self.attribute_map = { + 'subscription_id_or_name': 'subscription-id-or-name' + } + self._subscription_id_or_name = subscription_id_or_name + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationGetnotificationsubscriptionservicedetailsInput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.getnotificationsubscriptionservicedetails.Input of this TapiNotificationGetnotificationsubscriptionservicedetailsInput. # noqa: E501 + :rtype: TapiNotificationGetnotificationsubscriptionservicedetailsInput + """ + return util.deserialize_model(dikt, cls) + + @property + def subscription_id_or_name(self) -> str: + """Gets the subscription_id_or_name of this TapiNotificationGetnotificationsubscriptionservicedetailsInput. + + none # noqa: E501 + + :return: The subscription_id_or_name of this TapiNotificationGetnotificationsubscriptionservicedetailsInput. + :rtype: str + """ + return self._subscription_id_or_name + + @subscription_id_or_name.setter + def subscription_id_or_name(self, subscription_id_or_name: str): + """Sets the subscription_id_or_name of this TapiNotificationGetnotificationsubscriptionservicedetailsInput. + + none # noqa: E501 + + :param subscription_id_or_name: The subscription_id_or_name of this TapiNotificationGetnotificationsubscriptionservicedetailsInput. + :type subscription_id_or_name: str + """ + + self._subscription_id_or_name = subscription_id_or_name diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_getnotificationsubscriptionservicedetails_output.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_getnotificationsubscriptionservicedetails_output.py new file mode 100644 index 0000000000000000000000000000000000000000..35148ee279d118f4d96ca578053950e10afefa15 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_getnotificationsubscriptionservicedetails_output.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_notification_subscription_service import TapiNotificationNotificationSubscriptionService # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationGetnotificationsubscriptionservicedetailsOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, subscription_service: TapiNotificationNotificationSubscriptionService=None): # noqa: E501 + """TapiNotificationGetnotificationsubscriptionservicedetailsOutput - a model defined in Swagger + + :param subscription_service: The subscription_service of this TapiNotificationGetnotificationsubscriptionservicedetailsOutput. # noqa: E501 + :type subscription_service: TapiNotificationNotificationSubscriptionService + """ + self.swagger_types = { + 'subscription_service': TapiNotificationNotificationSubscriptionService + } + + self.attribute_map = { + 'subscription_service': 'subscription-service' + } + self._subscription_service = subscription_service + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationGetnotificationsubscriptionservicedetailsOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.getnotificationsubscriptionservicedetails.Output of this TapiNotificationGetnotificationsubscriptionservicedetailsOutput. # noqa: E501 + :rtype: TapiNotificationGetnotificationsubscriptionservicedetailsOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def subscription_service(self) -> TapiNotificationNotificationSubscriptionService: + """Gets the subscription_service of this TapiNotificationGetnotificationsubscriptionservicedetailsOutput. + + + :return: The subscription_service of this TapiNotificationGetnotificationsubscriptionservicedetailsOutput. + :rtype: TapiNotificationNotificationSubscriptionService + """ + return self._subscription_service + + @subscription_service.setter + def subscription_service(self, subscription_service: TapiNotificationNotificationSubscriptionService): + """Sets the subscription_service of this TapiNotificationGetnotificationsubscriptionservicedetailsOutput. + + + :param subscription_service: The subscription_service of this TapiNotificationGetnotificationsubscriptionservicedetailsOutput. + :type subscription_service: TapiNotificationNotificationSubscriptionService + """ + + self._subscription_service = subscription_service diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_getnotificationsubscriptionservicelist_output.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_getnotificationsubscriptionservicelist_output.py new file mode 100644 index 0000000000000000000000000000000000000000..1a6511724fcd939df13231d7bb537e75f32c6a93 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_getnotificationsubscriptionservicelist_output.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_notification_subscription_service import TapiNotificationNotificationSubscriptionService # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationGetnotificationsubscriptionservicelistOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, subscription_service: List[TapiNotificationNotificationSubscriptionService]=None): # noqa: E501 + """TapiNotificationGetnotificationsubscriptionservicelistOutput - a model defined in Swagger + + :param subscription_service: The subscription_service of this TapiNotificationGetnotificationsubscriptionservicelistOutput. # noqa: E501 + :type subscription_service: List[TapiNotificationNotificationSubscriptionService] + """ + self.swagger_types = { + 'subscription_service': List[TapiNotificationNotificationSubscriptionService] + } + + self.attribute_map = { + 'subscription_service': 'subscription-service' + } + self._subscription_service = subscription_service + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationGetnotificationsubscriptionservicelistOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.getnotificationsubscriptionservicelist.Output of this TapiNotificationGetnotificationsubscriptionservicelistOutput. # noqa: E501 + :rtype: TapiNotificationGetnotificationsubscriptionservicelistOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def subscription_service(self) -> List[TapiNotificationNotificationSubscriptionService]: + """Gets the subscription_service of this TapiNotificationGetnotificationsubscriptionservicelistOutput. + + none # noqa: E501 + + :return: The subscription_service of this TapiNotificationGetnotificationsubscriptionservicelistOutput. + :rtype: List[TapiNotificationNotificationSubscriptionService] + """ + return self._subscription_service + + @subscription_service.setter + def subscription_service(self, subscription_service: List[TapiNotificationNotificationSubscriptionService]): + """Sets the subscription_service of this TapiNotificationGetnotificationsubscriptionservicelistOutput. + + none # noqa: E501 + + :param subscription_service: The subscription_service of this TapiNotificationGetnotificationsubscriptionservicelistOutput. + :type subscription_service: List[TapiNotificationNotificationSubscriptionService] + """ + + self._subscription_service = subscription_service diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_getsupportednotificationtypes_output.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_getsupportednotificationtypes_output.py new file mode 100644 index 0000000000000000000000000000000000000000..e1138dc8eb6704a7cf02d708ff9dfd9caa7c1bb7 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_getsupportednotificationtypes_output.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_notification_type import TapiNotificationNotificationType # noqa: F401,E501 +from tapi_server.models.tapi_notification_object_type import TapiNotificationObjectType # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationGetsupportednotificationtypesOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, supported_object_types: List[TapiNotificationObjectType]=None, supported_notification_types: List[TapiNotificationNotificationType]=None): # noqa: E501 + """TapiNotificationGetsupportednotificationtypesOutput - a model defined in Swagger + + :param supported_object_types: The supported_object_types of this TapiNotificationGetsupportednotificationtypesOutput. # noqa: E501 + :type supported_object_types: List[TapiNotificationObjectType] + :param supported_notification_types: The supported_notification_types of this TapiNotificationGetsupportednotificationtypesOutput. # noqa: E501 + :type supported_notification_types: List[TapiNotificationNotificationType] + """ + self.swagger_types = { + 'supported_object_types': List[TapiNotificationObjectType], + 'supported_notification_types': List[TapiNotificationNotificationType] + } + + self.attribute_map = { + 'supported_object_types': 'supported-object-types', + 'supported_notification_types': 'supported-notification-types' + } + self._supported_object_types = supported_object_types + self._supported_notification_types = supported_notification_types + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationGetsupportednotificationtypesOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.getsupportednotificationtypes.Output of this TapiNotificationGetsupportednotificationtypesOutput. # noqa: E501 + :rtype: TapiNotificationGetsupportednotificationtypesOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def supported_object_types(self) -> List[TapiNotificationObjectType]: + """Gets the supported_object_types of this TapiNotificationGetsupportednotificationtypesOutput. + + none # noqa: E501 + + :return: The supported_object_types of this TapiNotificationGetsupportednotificationtypesOutput. + :rtype: List[TapiNotificationObjectType] + """ + return self._supported_object_types + + @supported_object_types.setter + def supported_object_types(self, supported_object_types: List[TapiNotificationObjectType]): + """Sets the supported_object_types of this TapiNotificationGetsupportednotificationtypesOutput. + + none # noqa: E501 + + :param supported_object_types: The supported_object_types of this TapiNotificationGetsupportednotificationtypesOutput. + :type supported_object_types: List[TapiNotificationObjectType] + """ + + self._supported_object_types = supported_object_types + + @property + def supported_notification_types(self) -> List[TapiNotificationNotificationType]: + """Gets the supported_notification_types of this TapiNotificationGetsupportednotificationtypesOutput. + + none # noqa: E501 + + :return: The supported_notification_types of this TapiNotificationGetsupportednotificationtypesOutput. + :rtype: List[TapiNotificationNotificationType] + """ + return self._supported_notification_types + + @supported_notification_types.setter + def supported_notification_types(self, supported_notification_types: List[TapiNotificationNotificationType]): + """Sets the supported_notification_types of this TapiNotificationGetsupportednotificationtypesOutput. + + none # noqa: E501 + + :param supported_notification_types: The supported_notification_types of this TapiNotificationGetsupportednotificationtypesOutput. + :type supported_notification_types: List[TapiNotificationNotificationType] + """ + + self._supported_notification_types = supported_notification_types diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_name_and_value_change.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_name_and_value_change.py new file mode 100644 index 0000000000000000000000000000000000000000..b73a13f13cf5a1a2db45656a5badf63bac3edfb1 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_name_and_value_change.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiNotificationNameAndValueChange(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, value_name: str=None, old_value: str=None, new_value: str=None): # noqa: E501 + """TapiNotificationNameAndValueChange - a model defined in Swagger + + :param value_name: The value_name of this TapiNotificationNameAndValueChange. # noqa: E501 + :type value_name: str + :param old_value: The old_value of this TapiNotificationNameAndValueChange. # noqa: E501 + :type old_value: str + :param new_value: The new_value of this TapiNotificationNameAndValueChange. # noqa: E501 + :type new_value: str + """ + self.swagger_types = { + 'value_name': str, + 'old_value': str, + 'new_value': str + } + + self.attribute_map = { + 'value_name': 'value-name', + 'old_value': 'old-value', + 'new_value': 'new-value' + } + self._value_name = value_name + self._old_value = old_value + self._new_value = new_value + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationNameAndValueChange': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.NameAndValueChange of this TapiNotificationNameAndValueChange. # noqa: E501 + :rtype: TapiNotificationNameAndValueChange + """ + return util.deserialize_model(dikt, cls) + + @property + def value_name(self) -> str: + """Gets the value_name of this TapiNotificationNameAndValueChange. + + The name of the value. The value need not have a name. # noqa: E501 + + :return: The value_name of this TapiNotificationNameAndValueChange. + :rtype: str + """ + return self._value_name + + @value_name.setter + def value_name(self, value_name: str): + """Sets the value_name of this TapiNotificationNameAndValueChange. + + The name of the value. The value need not have a name. # noqa: E501 + + :param value_name: The value_name of this TapiNotificationNameAndValueChange. + :type value_name: str + """ + + self._value_name = value_name + + @property + def old_value(self) -> str: + """Gets the old_value of this TapiNotificationNameAndValueChange. + + The value # noqa: E501 + + :return: The old_value of this TapiNotificationNameAndValueChange. + :rtype: str + """ + return self._old_value + + @old_value.setter + def old_value(self, old_value: str): + """Sets the old_value of this TapiNotificationNameAndValueChange. + + The value # noqa: E501 + + :param old_value: The old_value of this TapiNotificationNameAndValueChange. + :type old_value: str + """ + + self._old_value = old_value + + @property + def new_value(self) -> str: + """Gets the new_value of this TapiNotificationNameAndValueChange. + + The value # noqa: E501 + + :return: The new_value of this TapiNotificationNameAndValueChange. + :rtype: str + """ + return self._new_value + + @new_value.setter + def new_value(self, new_value: str): + """Sets the new_value of this TapiNotificationNameAndValueChange. + + The value # noqa: E501 + + :param new_value: The new_value of this TapiNotificationNameAndValueChange. + :type new_value: str + """ + + self._new_value = new_value diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_name_and_value_change_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_name_and_value_change_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..3911ae8b9deb9df8b2116a8bf88657b8a30b0b73 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_name_and_value_change_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_name_and_value_change import TapiNotificationNameAndValueChange # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationNameAndValueChangeWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, changed_attributes: TapiNotificationNameAndValueChange=None): # noqa: E501 + """TapiNotificationNameAndValueChangeWrapper - a model defined in Swagger + + :param changed_attributes: The changed_attributes of this TapiNotificationNameAndValueChangeWrapper. # noqa: E501 + :type changed_attributes: TapiNotificationNameAndValueChange + """ + self.swagger_types = { + 'changed_attributes': TapiNotificationNameAndValueChange + } + + self.attribute_map = { + 'changed_attributes': 'changed-attributes' + } + self._changed_attributes = changed_attributes + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationNameAndValueChangeWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.NameAndValueChangeWrapper of this TapiNotificationNameAndValueChangeWrapper. # noqa: E501 + :rtype: TapiNotificationNameAndValueChangeWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def changed_attributes(self) -> TapiNotificationNameAndValueChange: + """Gets the changed_attributes of this TapiNotificationNameAndValueChangeWrapper. + + + :return: The changed_attributes of this TapiNotificationNameAndValueChangeWrapper. + :rtype: TapiNotificationNameAndValueChange + """ + return self._changed_attributes + + @changed_attributes.setter + def changed_attributes(self, changed_attributes: TapiNotificationNameAndValueChange): + """Sets the changed_attributes of this TapiNotificationNameAndValueChangeWrapper. + + + :param changed_attributes: The changed_attributes of this TapiNotificationNameAndValueChangeWrapper. + :type changed_attributes: TapiNotificationNameAndValueChange + """ + + self._changed_attributes = changed_attributes diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_notification.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_notification.py new file mode 100644 index 0000000000000000000000000000000000000000..df83fd5889de69dfe5774363d25caa0be0053784 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_notification.py @@ -0,0 +1,453 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_global_class import TapiCommonGlobalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_notification_alarm_info import TapiNotificationAlarmInfo # noqa: F401,E501 +from tapi_server.models.tapi_notification_name_and_value_change import TapiNotificationNameAndValueChange # noqa: F401,E501 +from tapi_server.models.tapi_notification_notification_type import TapiNotificationNotificationType # noqa: F401,E501 +from tapi_server.models.tapi_notification_object_type import TapiNotificationObjectType # noqa: F401,E501 +from tapi_server.models.tapi_notification_source_indicator import TapiNotificationSourceIndicator # noqa: F401,E501 +from tapi_server.models.tapi_notification_tca_info import TapiNotificationTcaInfo # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationNotification(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: List[TapiCommonNameAndValue]=None, uuid: str=None, target_object_type: TapiNotificationObjectType=None, additional_text: str=None, event_time_stamp: str=None, additional_info: List[TapiCommonNameAndValue]=None, sequence_number: int=None, tca_info: TapiNotificationTcaInfo=None, target_object_identifier: str=None, notification_type: TapiNotificationNotificationType=None, target_object_name: List[TapiCommonNameAndValue]=None, layer_protocol_name: TapiCommonLayerProtocolName=None, source_indicator: TapiNotificationSourceIndicator=None, alarm_info: TapiNotificationAlarmInfo=None, changed_attributes: List[TapiNotificationNameAndValueChange]=None): # noqa: E501 + """TapiNotificationNotification - a model defined in Swagger + + :param name: The name of this TapiNotificationNotification. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param uuid: The uuid of this TapiNotificationNotification. # noqa: E501 + :type uuid: str + :param target_object_type: The target_object_type of this TapiNotificationNotification. # noqa: E501 + :type target_object_type: TapiNotificationObjectType + :param additional_text: The additional_text of this TapiNotificationNotification. # noqa: E501 + :type additional_text: str + :param event_time_stamp: The event_time_stamp of this TapiNotificationNotification. # noqa: E501 + :type event_time_stamp: str + :param additional_info: The additional_info of this TapiNotificationNotification. # noqa: E501 + :type additional_info: List[TapiCommonNameAndValue] + :param sequence_number: The sequence_number of this TapiNotificationNotification. # noqa: E501 + :type sequence_number: int + :param tca_info: The tca_info of this TapiNotificationNotification. # noqa: E501 + :type tca_info: TapiNotificationTcaInfo + :param target_object_identifier: The target_object_identifier of this TapiNotificationNotification. # noqa: E501 + :type target_object_identifier: str + :param notification_type: The notification_type of this TapiNotificationNotification. # noqa: E501 + :type notification_type: TapiNotificationNotificationType + :param target_object_name: The target_object_name of this TapiNotificationNotification. # noqa: E501 + :type target_object_name: List[TapiCommonNameAndValue] + :param layer_protocol_name: The layer_protocol_name of this TapiNotificationNotification. # noqa: E501 + :type layer_protocol_name: TapiCommonLayerProtocolName + :param source_indicator: The source_indicator of this TapiNotificationNotification. # noqa: E501 + :type source_indicator: TapiNotificationSourceIndicator + :param alarm_info: The alarm_info of this TapiNotificationNotification. # noqa: E501 + :type alarm_info: TapiNotificationAlarmInfo + :param changed_attributes: The changed_attributes of this TapiNotificationNotification. # noqa: E501 + :type changed_attributes: List[TapiNotificationNameAndValueChange] + """ + self.swagger_types = { + 'name': List[TapiCommonNameAndValue], + 'uuid': str, + 'target_object_type': TapiNotificationObjectType, + 'additional_text': str, + 'event_time_stamp': str, + 'additional_info': List[TapiCommonNameAndValue], + 'sequence_number': int, + 'tca_info': TapiNotificationTcaInfo, + 'target_object_identifier': str, + 'notification_type': TapiNotificationNotificationType, + 'target_object_name': List[TapiCommonNameAndValue], + 'layer_protocol_name': TapiCommonLayerProtocolName, + 'source_indicator': TapiNotificationSourceIndicator, + 'alarm_info': TapiNotificationAlarmInfo, + 'changed_attributes': List[TapiNotificationNameAndValueChange] + } + + self.attribute_map = { + 'name': 'name', + 'uuid': 'uuid', + 'target_object_type': 'target-object-type', + 'additional_text': 'additional-text', + 'event_time_stamp': 'event-time-stamp', + 'additional_info': 'additional-info', + 'sequence_number': 'sequence-number', + 'tca_info': 'tca-info', + 'target_object_identifier': 'target-object-identifier', + 'notification_type': 'notification-type', + 'target_object_name': 'target-object-name', + 'layer_protocol_name': 'layer-protocol-name', + 'source_indicator': 'source-indicator', + 'alarm_info': 'alarm-info', + 'changed_attributes': 'changed-attributes' + } + self._name = name + self._uuid = uuid + self._target_object_type = target_object_type + self._additional_text = additional_text + self._event_time_stamp = event_time_stamp + self._additional_info = additional_info + self._sequence_number = sequence_number + self._tca_info = tca_info + self._target_object_identifier = target_object_identifier + self._notification_type = notification_type + self._target_object_name = target_object_name + self._layer_protocol_name = layer_protocol_name + self._source_indicator = source_indicator + self._alarm_info = alarm_info + self._changed_attributes = changed_attributes + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationNotification': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.Notification of this TapiNotificationNotification. # noqa: E501 + :rtype: TapiNotificationNotification + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiNotificationNotification. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiNotificationNotification. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiNotificationNotification. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiNotificationNotification. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def uuid(self) -> str: + """Gets the uuid of this TapiNotificationNotification. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :return: The uuid of this TapiNotificationNotification. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid: str): + """Sets the uuid of this TapiNotificationNotification. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :param uuid: The uuid of this TapiNotificationNotification. + :type uuid: str + """ + + self._uuid = uuid + + @property + def target_object_type(self) -> TapiNotificationObjectType: + """Gets the target_object_type of this TapiNotificationNotification. + + + :return: The target_object_type of this TapiNotificationNotification. + :rtype: TapiNotificationObjectType + """ + return self._target_object_type + + @target_object_type.setter + def target_object_type(self, target_object_type: TapiNotificationObjectType): + """Sets the target_object_type of this TapiNotificationNotification. + + + :param target_object_type: The target_object_type of this TapiNotificationNotification. + :type target_object_type: TapiNotificationObjectType + """ + + self._target_object_type = target_object_type + + @property + def additional_text(self) -> str: + """Gets the additional_text of this TapiNotificationNotification. + + none # noqa: E501 + + :return: The additional_text of this TapiNotificationNotification. + :rtype: str + """ + return self._additional_text + + @additional_text.setter + def additional_text(self, additional_text: str): + """Sets the additional_text of this TapiNotificationNotification. + + none # noqa: E501 + + :param additional_text: The additional_text of this TapiNotificationNotification. + :type additional_text: str + """ + + self._additional_text = additional_text + + @property + def event_time_stamp(self) -> str: + """Gets the event_time_stamp of this TapiNotificationNotification. + + none # noqa: E501 + + :return: The event_time_stamp of this TapiNotificationNotification. + :rtype: str + """ + return self._event_time_stamp + + @event_time_stamp.setter + def event_time_stamp(self, event_time_stamp: str): + """Sets the event_time_stamp of this TapiNotificationNotification. + + none # noqa: E501 + + :param event_time_stamp: The event_time_stamp of this TapiNotificationNotification. + :type event_time_stamp: str + """ + + self._event_time_stamp = event_time_stamp + + @property + def additional_info(self) -> List[TapiCommonNameAndValue]: + """Gets the additional_info of this TapiNotificationNotification. + + none # noqa: E501 + + :return: The additional_info of this TapiNotificationNotification. + :rtype: List[TapiCommonNameAndValue] + """ + return self._additional_info + + @additional_info.setter + def additional_info(self, additional_info: List[TapiCommonNameAndValue]): + """Sets the additional_info of this TapiNotificationNotification. + + none # noqa: E501 + + :param additional_info: The additional_info of this TapiNotificationNotification. + :type additional_info: List[TapiCommonNameAndValue] + """ + + self._additional_info = additional_info + + @property + def sequence_number(self) -> int: + """Gets the sequence_number of this TapiNotificationNotification. + + A monotonous increasing sequence number associated with the notification. The exact semantics of how this sequence number is assigned (per channel or subscription or source or system) is left undefined. # noqa: E501 + + :return: The sequence_number of this TapiNotificationNotification. + :rtype: int + """ + return self._sequence_number + + @sequence_number.setter + def sequence_number(self, sequence_number: int): + """Sets the sequence_number of this TapiNotificationNotification. + + A monotonous increasing sequence number associated with the notification. The exact semantics of how this sequence number is assigned (per channel or subscription or source or system) is left undefined. # noqa: E501 + + :param sequence_number: The sequence_number of this TapiNotificationNotification. + :type sequence_number: int + """ + + self._sequence_number = sequence_number + + @property + def tca_info(self) -> TapiNotificationTcaInfo: + """Gets the tca_info of this TapiNotificationNotification. + + + :return: The tca_info of this TapiNotificationNotification. + :rtype: TapiNotificationTcaInfo + """ + return self._tca_info + + @tca_info.setter + def tca_info(self, tca_info: TapiNotificationTcaInfo): + """Sets the tca_info of this TapiNotificationNotification. + + + :param tca_info: The tca_info of this TapiNotificationNotification. + :type tca_info: TapiNotificationTcaInfo + """ + + self._tca_info = tca_info + + @property + def target_object_identifier(self) -> str: + """Gets the target_object_identifier of this TapiNotificationNotification. + + none # noqa: E501 + + :return: The target_object_identifier of this TapiNotificationNotification. + :rtype: str + """ + return self._target_object_identifier + + @target_object_identifier.setter + def target_object_identifier(self, target_object_identifier: str): + """Sets the target_object_identifier of this TapiNotificationNotification. + + none # noqa: E501 + + :param target_object_identifier: The target_object_identifier of this TapiNotificationNotification. + :type target_object_identifier: str + """ + + self._target_object_identifier = target_object_identifier + + @property + def notification_type(self) -> TapiNotificationNotificationType: + """Gets the notification_type of this TapiNotificationNotification. + + + :return: The notification_type of this TapiNotificationNotification. + :rtype: TapiNotificationNotificationType + """ + return self._notification_type + + @notification_type.setter + def notification_type(self, notification_type: TapiNotificationNotificationType): + """Sets the notification_type of this TapiNotificationNotification. + + + :param notification_type: The notification_type of this TapiNotificationNotification. + :type notification_type: TapiNotificationNotificationType + """ + + self._notification_type = notification_type + + @property + def target_object_name(self) -> List[TapiCommonNameAndValue]: + """Gets the target_object_name of this TapiNotificationNotification. + + none # noqa: E501 + + :return: The target_object_name of this TapiNotificationNotification. + :rtype: List[TapiCommonNameAndValue] + """ + return self._target_object_name + + @target_object_name.setter + def target_object_name(self, target_object_name: List[TapiCommonNameAndValue]): + """Sets the target_object_name of this TapiNotificationNotification. + + none # noqa: E501 + + :param target_object_name: The target_object_name of this TapiNotificationNotification. + :type target_object_name: List[TapiCommonNameAndValue] + """ + + self._target_object_name = target_object_name + + @property + def layer_protocol_name(self) -> TapiCommonLayerProtocolName: + """Gets the layer_protocol_name of this TapiNotificationNotification. + + + :return: The layer_protocol_name of this TapiNotificationNotification. + :rtype: TapiCommonLayerProtocolName + """ + return self._layer_protocol_name + + @layer_protocol_name.setter + def layer_protocol_name(self, layer_protocol_name: TapiCommonLayerProtocolName): + """Sets the layer_protocol_name of this TapiNotificationNotification. + + + :param layer_protocol_name: The layer_protocol_name of this TapiNotificationNotification. + :type layer_protocol_name: TapiCommonLayerProtocolName + """ + + self._layer_protocol_name = layer_protocol_name + + @property + def source_indicator(self) -> TapiNotificationSourceIndicator: + """Gets the source_indicator of this TapiNotificationNotification. + + + :return: The source_indicator of this TapiNotificationNotification. + :rtype: TapiNotificationSourceIndicator + """ + return self._source_indicator + + @source_indicator.setter + def source_indicator(self, source_indicator: TapiNotificationSourceIndicator): + """Sets the source_indicator of this TapiNotificationNotification. + + + :param source_indicator: The source_indicator of this TapiNotificationNotification. + :type source_indicator: TapiNotificationSourceIndicator + """ + + self._source_indicator = source_indicator + + @property + def alarm_info(self) -> TapiNotificationAlarmInfo: + """Gets the alarm_info of this TapiNotificationNotification. + + + :return: The alarm_info of this TapiNotificationNotification. + :rtype: TapiNotificationAlarmInfo + """ + return self._alarm_info + + @alarm_info.setter + def alarm_info(self, alarm_info: TapiNotificationAlarmInfo): + """Sets the alarm_info of this TapiNotificationNotification. + + + :param alarm_info: The alarm_info of this TapiNotificationNotification. + :type alarm_info: TapiNotificationAlarmInfo + """ + + self._alarm_info = alarm_info + + @property + def changed_attributes(self) -> List[TapiNotificationNameAndValueChange]: + """Gets the changed_attributes of this TapiNotificationNotification. + + none # noqa: E501 + + :return: The changed_attributes of this TapiNotificationNotification. + :rtype: List[TapiNotificationNameAndValueChange] + """ + return self._changed_attributes + + @changed_attributes.setter + def changed_attributes(self, changed_attributes: List[TapiNotificationNameAndValueChange]): + """Sets the changed_attributes of this TapiNotificationNotification. + + none # noqa: E501 + + :param changed_attributes: The changed_attributes of this TapiNotificationNotification. + :type changed_attributes: List[TapiNotificationNameAndValueChange] + """ + + self._changed_attributes = changed_attributes diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_channel.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_channel.py new file mode 100644 index 0000000000000000000000000000000000000000..c5d7bb6a11f7015ca6cdc224d359a3c43ddb09d3 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_channel.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_local_class import TapiCommonLocalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationNotificationChannel(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: List[TapiCommonNameAndValue]=None, local_id: str=None, next_sequence_no: int=None, stream_address: str=None): # noqa: E501 + """TapiNotificationNotificationChannel - a model defined in Swagger + + :param name: The name of this TapiNotificationNotificationChannel. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param local_id: The local_id of this TapiNotificationNotificationChannel. # noqa: E501 + :type local_id: str + :param next_sequence_no: The next_sequence_no of this TapiNotificationNotificationChannel. # noqa: E501 + :type next_sequence_no: int + :param stream_address: The stream_address of this TapiNotificationNotificationChannel. # noqa: E501 + :type stream_address: str + """ + self.swagger_types = { + 'name': List[TapiCommonNameAndValue], + 'local_id': str, + 'next_sequence_no': int, + 'stream_address': str + } + + self.attribute_map = { + 'name': 'name', + 'local_id': 'local-id', + 'next_sequence_no': 'next-sequence-no', + 'stream_address': 'stream-address' + } + self._name = name + self._local_id = local_id + self._next_sequence_no = next_sequence_no + self._stream_address = stream_address + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationNotificationChannel': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.NotificationChannel of this TapiNotificationNotificationChannel. # noqa: E501 + :rtype: TapiNotificationNotificationChannel + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiNotificationNotificationChannel. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiNotificationNotificationChannel. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiNotificationNotificationChannel. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiNotificationNotificationChannel. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def local_id(self) -> str: + """Gets the local_id of this TapiNotificationNotificationChannel. + + none # noqa: E501 + + :return: The local_id of this TapiNotificationNotificationChannel. + :rtype: str + """ + return self._local_id + + @local_id.setter + def local_id(self, local_id: str): + """Sets the local_id of this TapiNotificationNotificationChannel. + + none # noqa: E501 + + :param local_id: The local_id of this TapiNotificationNotificationChannel. + :type local_id: str + """ + + self._local_id = local_id + + @property + def next_sequence_no(self) -> int: + """Gets the next_sequence_no of this TapiNotificationNotificationChannel. + + The sequence number of the next notification that will be published on the channel # noqa: E501 + + :return: The next_sequence_no of this TapiNotificationNotificationChannel. + :rtype: int + """ + return self._next_sequence_no + + @next_sequence_no.setter + def next_sequence_no(self, next_sequence_no: int): + """Sets the next_sequence_no of this TapiNotificationNotificationChannel. + + The sequence number of the next notification that will be published on the channel # noqa: E501 + + :param next_sequence_no: The next_sequence_no of this TapiNotificationNotificationChannel. + :type next_sequence_no: int + """ + + self._next_sequence_no = next_sequence_no + + @property + def stream_address(self) -> str: + """Gets the stream_address of this TapiNotificationNotificationChannel. + + The address/location/URI of the channel/stream to which the subscribed notifications are published. This specifics of this is typically dependent on the implementation protocol & mechanism and hence is typed as a string. # noqa: E501 + + :return: The stream_address of this TapiNotificationNotificationChannel. + :rtype: str + """ + return self._stream_address + + @stream_address.setter + def stream_address(self, stream_address: str): + """Sets the stream_address of this TapiNotificationNotificationChannel. + + The address/location/URI of the channel/stream to which the subscribed notifications are published. This specifics of this is typically dependent on the implementation protocol & mechanism and hence is typed as a string. # noqa: E501 + + :param stream_address: The stream_address of this TapiNotificationNotificationChannel. + :type stream_address: str + """ + + self._stream_address = stream_address diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_channel_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_channel_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..1176a018926ae06c53d76ceaa6b62e22822866b2 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_channel_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_notification_channel import TapiNotificationNotificationChannel # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationNotificationChannelWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, notification_channel: TapiNotificationNotificationChannel=None): # noqa: E501 + """TapiNotificationNotificationChannelWrapper - a model defined in Swagger + + :param notification_channel: The notification_channel of this TapiNotificationNotificationChannelWrapper. # noqa: E501 + :type notification_channel: TapiNotificationNotificationChannel + """ + self.swagger_types = { + 'notification_channel': TapiNotificationNotificationChannel + } + + self.attribute_map = { + 'notification_channel': 'notification-channel' + } + self._notification_channel = notification_channel + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationNotificationChannelWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.NotificationChannelWrapper of this TapiNotificationNotificationChannelWrapper. # noqa: E501 + :rtype: TapiNotificationNotificationChannelWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def notification_channel(self) -> TapiNotificationNotificationChannel: + """Gets the notification_channel of this TapiNotificationNotificationChannelWrapper. + + + :return: The notification_channel of this TapiNotificationNotificationChannelWrapper. + :rtype: TapiNotificationNotificationChannel + """ + return self._notification_channel + + @notification_channel.setter + def notification_channel(self, notification_channel: TapiNotificationNotificationChannel): + """Sets the notification_channel of this TapiNotificationNotificationChannelWrapper. + + + :param notification_channel: The notification_channel of this TapiNotificationNotificationChannelWrapper. + :type notification_channel: TapiNotificationNotificationChannel + """ + + self._notification_channel = notification_channel diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_context.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_context.py new file mode 100644 index 0000000000000000000000000000000000000000..595ddd8312eb2fe6cf28cfccf5853759d1419ada --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_context.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_notification import TapiNotificationNotification # noqa: F401,E501 +from tapi_server.models.tapi_notification_notification_subscription_service import TapiNotificationNotificationSubscriptionService # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationNotificationContext(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, notif_subscription: List[TapiNotificationNotificationSubscriptionService]=None, notification: List[TapiNotificationNotification]=None): # noqa: E501 + """TapiNotificationNotificationContext - a model defined in Swagger + + :param notif_subscription: The notif_subscription of this TapiNotificationNotificationContext. # noqa: E501 + :type notif_subscription: List[TapiNotificationNotificationSubscriptionService] + :param notification: The notification of this TapiNotificationNotificationContext. # noqa: E501 + :type notification: List[TapiNotificationNotification] + """ + self.swagger_types = { + 'notif_subscription': List[TapiNotificationNotificationSubscriptionService], + 'notification': List[TapiNotificationNotification] + } + + self.attribute_map = { + 'notif_subscription': 'notif-subscription', + 'notification': 'notification' + } + self._notif_subscription = notif_subscription + self._notification = notification + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationNotificationContext': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.NotificationContext of this TapiNotificationNotificationContext. # noqa: E501 + :rtype: TapiNotificationNotificationContext + """ + return util.deserialize_model(dikt, cls) + + @property + def notif_subscription(self) -> List[TapiNotificationNotificationSubscriptionService]: + """Gets the notif_subscription of this TapiNotificationNotificationContext. + + none # noqa: E501 + + :return: The notif_subscription of this TapiNotificationNotificationContext. + :rtype: List[TapiNotificationNotificationSubscriptionService] + """ + return self._notif_subscription + + @notif_subscription.setter + def notif_subscription(self, notif_subscription: List[TapiNotificationNotificationSubscriptionService]): + """Sets the notif_subscription of this TapiNotificationNotificationContext. + + none # noqa: E501 + + :param notif_subscription: The notif_subscription of this TapiNotificationNotificationContext. + :type notif_subscription: List[TapiNotificationNotificationSubscriptionService] + """ + + self._notif_subscription = notif_subscription + + @property + def notification(self) -> List[TapiNotificationNotification]: + """Gets the notification of this TapiNotificationNotificationContext. + + none # noqa: E501 + + :return: The notification of this TapiNotificationNotificationContext. + :rtype: List[TapiNotificationNotification] + """ + return self._notification + + @notification.setter + def notification(self, notification: List[TapiNotificationNotification]): + """Sets the notification of this TapiNotificationNotificationContext. + + none # noqa: E501 + + :param notification: The notification of this TapiNotificationNotificationContext. + :type notification: List[TapiNotificationNotification] + """ + + self._notification = notification diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_context_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_context_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..fb0bf9abb2397c121f005757e5da48701132bdfe --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_context_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_notification_context import TapiNotificationNotificationContext # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationNotificationContextWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, tapi_notificationnotification_context: TapiNotificationNotificationContext=None): # noqa: E501 + """TapiNotificationNotificationContextWrapper - a model defined in Swagger + + :param tapi_notificationnotification_context: The tapi_notificationnotification_context of this TapiNotificationNotificationContextWrapper. # noqa: E501 + :type tapi_notificationnotification_context: TapiNotificationNotificationContext + """ + self.swagger_types = { + 'tapi_notificationnotification_context': TapiNotificationNotificationContext + } + + self.attribute_map = { + 'tapi_notificationnotification_context': 'tapi-notification:notification-context' + } + self._tapi_notificationnotification_context = tapi_notificationnotification_context + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationNotificationContextWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.NotificationContextWrapper of this TapiNotificationNotificationContextWrapper. # noqa: E501 + :rtype: TapiNotificationNotificationContextWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def tapi_notificationnotification_context(self) -> TapiNotificationNotificationContext: + """Gets the tapi_notificationnotification_context of this TapiNotificationNotificationContextWrapper. + + + :return: The tapi_notificationnotification_context of this TapiNotificationNotificationContextWrapper. + :rtype: TapiNotificationNotificationContext + """ + return self._tapi_notificationnotification_context + + @tapi_notificationnotification_context.setter + def tapi_notificationnotification_context(self, tapi_notificationnotification_context: TapiNotificationNotificationContext): + """Sets the tapi_notificationnotification_context of this TapiNotificationNotificationContextWrapper. + + + :param tapi_notificationnotification_context: The tapi_notificationnotification_context of this TapiNotificationNotificationContextWrapper. + :type tapi_notificationnotification_context: TapiNotificationNotificationContext + """ + + self._tapi_notificationnotification_context = tapi_notificationnotification_context diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_subscription_service.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_subscription_service.py new file mode 100644 index 0000000000000000000000000000000000000000..10e6128e52392a42a3472c82a6ca2894c6820ad1 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_subscription_service.py @@ -0,0 +1,262 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_global_class import TapiCommonGlobalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_notification_notification import TapiNotificationNotification # noqa: F401,E501 +from tapi_server.models.tapi_notification_notification_channel import TapiNotificationNotificationChannel # noqa: F401,E501 +from tapi_server.models.tapi_notification_notification_type import TapiNotificationNotificationType # noqa: F401,E501 +from tapi_server.models.tapi_notification_object_type import TapiNotificationObjectType # noqa: F401,E501 +from tapi_server.models.tapi_notification_subscription_filter import TapiNotificationSubscriptionFilter # noqa: F401,E501 +from tapi_server.models.tapi_notification_subscription_state import TapiNotificationSubscriptionState # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationNotificationSubscriptionService(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: List[TapiCommonNameAndValue]=None, uuid: str=None, notification: List[TapiNotificationNotification]=None, notification_channel: TapiNotificationNotificationChannel=None, subscription_state: TapiNotificationSubscriptionState=None, supported_object_types: List[TapiNotificationObjectType]=None, supported_notification_types: List[TapiNotificationNotificationType]=None, subscription_filter: TapiNotificationSubscriptionFilter=None): # noqa: E501 + """TapiNotificationNotificationSubscriptionService - a model defined in Swagger + + :param name: The name of this TapiNotificationNotificationSubscriptionService. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param uuid: The uuid of this TapiNotificationNotificationSubscriptionService. # noqa: E501 + :type uuid: str + :param notification: The notification of this TapiNotificationNotificationSubscriptionService. # noqa: E501 + :type notification: List[TapiNotificationNotification] + :param notification_channel: The notification_channel of this TapiNotificationNotificationSubscriptionService. # noqa: E501 + :type notification_channel: TapiNotificationNotificationChannel + :param subscription_state: The subscription_state of this TapiNotificationNotificationSubscriptionService. # noqa: E501 + :type subscription_state: TapiNotificationSubscriptionState + :param supported_object_types: The supported_object_types of this TapiNotificationNotificationSubscriptionService. # noqa: E501 + :type supported_object_types: List[TapiNotificationObjectType] + :param supported_notification_types: The supported_notification_types of this TapiNotificationNotificationSubscriptionService. # noqa: E501 + :type supported_notification_types: List[TapiNotificationNotificationType] + :param subscription_filter: The subscription_filter of this TapiNotificationNotificationSubscriptionService. # noqa: E501 + :type subscription_filter: TapiNotificationSubscriptionFilter + """ + self.swagger_types = { + 'name': List[TapiCommonNameAndValue], + 'uuid': str, + 'notification': List[TapiNotificationNotification], + 'notification_channel': TapiNotificationNotificationChannel, + 'subscription_state': TapiNotificationSubscriptionState, + 'supported_object_types': List[TapiNotificationObjectType], + 'supported_notification_types': List[TapiNotificationNotificationType], + 'subscription_filter': TapiNotificationSubscriptionFilter + } + + self.attribute_map = { + 'name': 'name', + 'uuid': 'uuid', + 'notification': 'notification', + 'notification_channel': 'notification-channel', + 'subscription_state': 'subscription-state', + 'supported_object_types': 'supported-object-types', + 'supported_notification_types': 'supported-notification-types', + 'subscription_filter': 'subscription-filter' + } + self._name = name + self._uuid = uuid + self._notification = notification + self._notification_channel = notification_channel + self._subscription_state = subscription_state + self._supported_object_types = supported_object_types + self._supported_notification_types = supported_notification_types + self._subscription_filter = subscription_filter + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationNotificationSubscriptionService': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.NotificationSubscriptionService of this TapiNotificationNotificationSubscriptionService. # noqa: E501 + :rtype: TapiNotificationNotificationSubscriptionService + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiNotificationNotificationSubscriptionService. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiNotificationNotificationSubscriptionService. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiNotificationNotificationSubscriptionService. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiNotificationNotificationSubscriptionService. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def uuid(self) -> str: + """Gets the uuid of this TapiNotificationNotificationSubscriptionService. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :return: The uuid of this TapiNotificationNotificationSubscriptionService. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid: str): + """Sets the uuid of this TapiNotificationNotificationSubscriptionService. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :param uuid: The uuid of this TapiNotificationNotificationSubscriptionService. + :type uuid: str + """ + + self._uuid = uuid + + @property + def notification(self) -> List[TapiNotificationNotification]: + """Gets the notification of this TapiNotificationNotificationSubscriptionService. + + none # noqa: E501 + + :return: The notification of this TapiNotificationNotificationSubscriptionService. + :rtype: List[TapiNotificationNotification] + """ + return self._notification + + @notification.setter + def notification(self, notification: List[TapiNotificationNotification]): + """Sets the notification of this TapiNotificationNotificationSubscriptionService. + + none # noqa: E501 + + :param notification: The notification of this TapiNotificationNotificationSubscriptionService. + :type notification: List[TapiNotificationNotification] + """ + + self._notification = notification + + @property + def notification_channel(self) -> TapiNotificationNotificationChannel: + """Gets the notification_channel of this TapiNotificationNotificationSubscriptionService. + + + :return: The notification_channel of this TapiNotificationNotificationSubscriptionService. + :rtype: TapiNotificationNotificationChannel + """ + return self._notification_channel + + @notification_channel.setter + def notification_channel(self, notification_channel: TapiNotificationNotificationChannel): + """Sets the notification_channel of this TapiNotificationNotificationSubscriptionService. + + + :param notification_channel: The notification_channel of this TapiNotificationNotificationSubscriptionService. + :type notification_channel: TapiNotificationNotificationChannel + """ + + self._notification_channel = notification_channel + + @property + def subscription_state(self) -> TapiNotificationSubscriptionState: + """Gets the subscription_state of this TapiNotificationNotificationSubscriptionService. + + + :return: The subscription_state of this TapiNotificationNotificationSubscriptionService. + :rtype: TapiNotificationSubscriptionState + """ + return self._subscription_state + + @subscription_state.setter + def subscription_state(self, subscription_state: TapiNotificationSubscriptionState): + """Sets the subscription_state of this TapiNotificationNotificationSubscriptionService. + + + :param subscription_state: The subscription_state of this TapiNotificationNotificationSubscriptionService. + :type subscription_state: TapiNotificationSubscriptionState + """ + + self._subscription_state = subscription_state + + @property + def supported_object_types(self) -> List[TapiNotificationObjectType]: + """Gets the supported_object_types of this TapiNotificationNotificationSubscriptionService. + + none # noqa: E501 + + :return: The supported_object_types of this TapiNotificationNotificationSubscriptionService. + :rtype: List[TapiNotificationObjectType] + """ + return self._supported_object_types + + @supported_object_types.setter + def supported_object_types(self, supported_object_types: List[TapiNotificationObjectType]): + """Sets the supported_object_types of this TapiNotificationNotificationSubscriptionService. + + none # noqa: E501 + + :param supported_object_types: The supported_object_types of this TapiNotificationNotificationSubscriptionService. + :type supported_object_types: List[TapiNotificationObjectType] + """ + + self._supported_object_types = supported_object_types + + @property + def supported_notification_types(self) -> List[TapiNotificationNotificationType]: + """Gets the supported_notification_types of this TapiNotificationNotificationSubscriptionService. + + none # noqa: E501 + + :return: The supported_notification_types of this TapiNotificationNotificationSubscriptionService. + :rtype: List[TapiNotificationNotificationType] + """ + return self._supported_notification_types + + @supported_notification_types.setter + def supported_notification_types(self, supported_notification_types: List[TapiNotificationNotificationType]): + """Sets the supported_notification_types of this TapiNotificationNotificationSubscriptionService. + + none # noqa: E501 + + :param supported_notification_types: The supported_notification_types of this TapiNotificationNotificationSubscriptionService. + :type supported_notification_types: List[TapiNotificationNotificationType] + """ + + self._supported_notification_types = supported_notification_types + + @property + def subscription_filter(self) -> TapiNotificationSubscriptionFilter: + """Gets the subscription_filter of this TapiNotificationNotificationSubscriptionService. + + + :return: The subscription_filter of this TapiNotificationNotificationSubscriptionService. + :rtype: TapiNotificationSubscriptionFilter + """ + return self._subscription_filter + + @subscription_filter.setter + def subscription_filter(self, subscription_filter: TapiNotificationSubscriptionFilter): + """Sets the subscription_filter of this TapiNotificationNotificationSubscriptionService. + + + :param subscription_filter: The subscription_filter of this TapiNotificationNotificationSubscriptionService. + :type subscription_filter: TapiNotificationSubscriptionFilter + """ + + self._subscription_filter = subscription_filter diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_subscription_service_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_subscription_service_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..ec809bd51070beb022d5f089a5d1826af4f15ad9 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_subscription_service_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_notification_subscription_service import TapiNotificationNotificationSubscriptionService # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationNotificationSubscriptionServiceWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, notif_subscription: TapiNotificationNotificationSubscriptionService=None): # noqa: E501 + """TapiNotificationNotificationSubscriptionServiceWrapper - a model defined in Swagger + + :param notif_subscription: The notif_subscription of this TapiNotificationNotificationSubscriptionServiceWrapper. # noqa: E501 + :type notif_subscription: TapiNotificationNotificationSubscriptionService + """ + self.swagger_types = { + 'notif_subscription': TapiNotificationNotificationSubscriptionService + } + + self.attribute_map = { + 'notif_subscription': 'notif-subscription' + } + self._notif_subscription = notif_subscription + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationNotificationSubscriptionServiceWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.NotificationSubscriptionServiceWrapper of this TapiNotificationNotificationSubscriptionServiceWrapper. # noqa: E501 + :rtype: TapiNotificationNotificationSubscriptionServiceWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def notif_subscription(self) -> TapiNotificationNotificationSubscriptionService: + """Gets the notif_subscription of this TapiNotificationNotificationSubscriptionServiceWrapper. + + + :return: The notif_subscription of this TapiNotificationNotificationSubscriptionServiceWrapper. + :rtype: TapiNotificationNotificationSubscriptionService + """ + return self._notif_subscription + + @notif_subscription.setter + def notif_subscription(self, notif_subscription: TapiNotificationNotificationSubscriptionService): + """Sets the notif_subscription of this TapiNotificationNotificationSubscriptionServiceWrapper. + + + :param notif_subscription: The notif_subscription of this TapiNotificationNotificationSubscriptionServiceWrapper. + :type notif_subscription: TapiNotificationNotificationSubscriptionService + """ + + self._notif_subscription = notif_subscription diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_type.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_type.py new file mode 100644 index 0000000000000000000000000000000000000000..176f3661feded5e423c2fddb5346602eab9f5692 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_type.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiNotificationNotificationType(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + OBJECT_CREATION = "OBJECT_CREATION" + OBJECT_DELETION = "OBJECT_DELETION" + ATTRIBUTE_VALUE_CHANGE = "ATTRIBUTE_VALUE_CHANGE" + ALARM_EVENT = "ALARM_EVENT" + THRESHOLD_CROSSING_ALERT = "THRESHOLD_CROSSING_ALERT" + def __init__(self): # noqa: E501 + """TapiNotificationNotificationType - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationNotificationType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.NotificationType of this TapiNotificationNotificationType. # noqa: E501 + :rtype: TapiNotificationNotificationType + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..eb2d9a1ed6dad8fa90c0ef097e40d80d1c4e6e67 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_notification_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_notification import TapiNotificationNotification # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationNotificationWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, notification: TapiNotificationNotification=None): # noqa: E501 + """TapiNotificationNotificationWrapper - a model defined in Swagger + + :param notification: The notification of this TapiNotificationNotificationWrapper. # noqa: E501 + :type notification: TapiNotificationNotification + """ + self.swagger_types = { + 'notification': TapiNotificationNotification + } + + self.attribute_map = { + 'notification': 'notification' + } + self._notification = notification + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationNotificationWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.NotificationWrapper of this TapiNotificationNotificationWrapper. # noqa: E501 + :rtype: TapiNotificationNotificationWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def notification(self) -> TapiNotificationNotification: + """Gets the notification of this TapiNotificationNotificationWrapper. + + + :return: The notification of this TapiNotificationNotificationWrapper. + :rtype: TapiNotificationNotification + """ + return self._notification + + @notification.setter + def notification(self, notification: TapiNotificationNotification): + """Sets the notification of this TapiNotificationNotificationWrapper. + + + :param notification: The notification of this TapiNotificationNotificationWrapper. + :type notification: TapiNotificationNotification + """ + + self._notification = notification diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_object_type.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_object_type.py new file mode 100644 index 0000000000000000000000000000000000000000..973801635db2cfe8682a4d04cd38d928f33895f9 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_object_type.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiNotificationObjectType(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + TOPOLOGY = "TOPOLOGY" + NODE = "NODE" + LINK = "LINK" + CONNECTION = "CONNECTION" + PATH = "PATH" + CONNECTIVITY_SERVICE = "CONNECTIVITY_SERVICE" + VIRTUAL_NETWORK_SERVICE = "VIRTUAL_NETWORK_SERVICE" + PATH_COMPUTATION_SERVICE = "PATH_COMPUTATION_SERVICE" + NODE_EDGE_POINT = "NODE_EDGE_POINT" + SERVICE_INTERFACE_POINT = "SERVICE_INTERFACE_POINT" + CONNECTION_END_POINT = "CONNECTION_END_POINT" + MAINTENANCE_ENTITY_GROUP = "MAINTENANCE_ENTITY_GROUP" + MAINTENANCE_ENTITY = "MAINTENANCE_ENTITY" + MEG_END_POINT = "MEG_END_POINT" + MEG_INTERMEDIATE_POINT = "MEG_INTERMEDIATE_POINT" + SWITCH_CONTROL = "SWITCH_CONTROL" + SWITCH = "SWITCH" + ROUTE = "ROUTE" + NODE_RULE_GROUP = "NODE_RULE_GROUP" + INTER_RULE_GROUP = "INTER_RULE_GROUP" + RULE = "RULE" + OAM_JOB = "OAM_JOB" + ACCESS_PORT = "ACCESS_PORT" + EQUIPMENT = "EQUIPMENT" + HOLDER = "HOLDER" + PHYSICAL_SPAN = "PHYSICAL_SPAN" + ABSTRACT_STRAND = "ABSTRACT_STRAND" + DEVICE = "DEVICE" + def __init__(self): # noqa: E501 + """TapiNotificationObjectType - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationObjectType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.ObjectType of this TapiNotificationObjectType. # noqa: E501 + :rtype: TapiNotificationObjectType + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_perceived_severity_type.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_perceived_severity_type.py new file mode 100644 index 0000000000000000000000000000000000000000..fb852664e1016543af88543c85e1103ee9e64959 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_perceived_severity_type.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiNotificationPerceivedSeverityType(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + CRITICAL = "CRITICAL" + MAJOR = "MAJOR" + MINOR = "MINOR" + WARNING = "WARNING" + CLEARED = "CLEARED" + def __init__(self): # noqa: E501 + """TapiNotificationPerceivedSeverityType - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationPerceivedSeverityType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.PerceivedSeverityType of this TapiNotificationPerceivedSeverityType. # noqa: E501 + :rtype: TapiNotificationPerceivedSeverityType + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_perceived_tca_severity.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_perceived_tca_severity.py new file mode 100644 index 0000000000000000000000000000000000000000..0dc2e13a4765af8537b95728cb630396b2c8ba01 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_perceived_tca_severity.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiNotificationPerceivedTcaSeverity(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + WARNING = "WARNING" + CLEAR = "CLEAR" + def __init__(self): # noqa: E501 + """TapiNotificationPerceivedTcaSeverity - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationPerceivedTcaSeverity': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.PerceivedTcaSeverity of this TapiNotificationPerceivedTcaSeverity. # noqa: E501 + :rtype: TapiNotificationPerceivedTcaSeverity + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_service_affecting.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_service_affecting.py new file mode 100644 index 0000000000000000000000000000000000000000..fb2253894af156e17ede625ae8c703e9fb3e5521 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_service_affecting.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiNotificationServiceAffecting(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + SERVICE_AFFECTING = "SERVICE_AFFECTING" + NOT_SERVICE_AFFECTING = "NOT_SERVICE_AFFECTING" + UNKNOWN = "UNKNOWN" + def __init__(self): # noqa: E501 + """TapiNotificationServiceAffecting - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationServiceAffecting': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.ServiceAffecting of this TapiNotificationServiceAffecting. # noqa: E501 + :rtype: TapiNotificationServiceAffecting + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_source_indicator.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_source_indicator.py new file mode 100644 index 0000000000000000000000000000000000000000..5f0bcedbfd814966fe5dbdc9063f4c65e68da66e --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_source_indicator.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiNotificationSourceIndicator(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + RESOURCE_OPERATION = "RESOURCE_OPERATION" + MANAGEMENT_OPERATION = "MANAGEMENT_OPERATION" + UNKNOWN = "UNKNOWN" + def __init__(self): # noqa: E501 + """TapiNotificationSourceIndicator - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationSourceIndicator': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.SourceIndicator of this TapiNotificationSourceIndicator. # noqa: E501 + :rtype: TapiNotificationSourceIndicator + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_subscription_filter.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_subscription_filter.py new file mode 100644 index 0000000000000000000000000000000000000000..e26921ceffedf65344e70c477fcc5d998c14fcf5 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_subscription_filter.py @@ -0,0 +1,237 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501 +from tapi_server.models.tapi_common_local_class import TapiCommonLocalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_notification_notification_type import TapiNotificationNotificationType # noqa: F401,E501 +from tapi_server.models.tapi_notification_object_type import TapiNotificationObjectType # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationSubscriptionFilter(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: List[TapiCommonNameAndValue]=None, local_id: str=None, requested_notification_types: List[TapiNotificationNotificationType]=None, requested_object_identifier: List[str]=None, requested_layer_protocols: List[TapiCommonLayerProtocolName]=None, include_content: bool=False, requested_object_types: List[TapiNotificationObjectType]=None): # noqa: E501 + """TapiNotificationSubscriptionFilter - a model defined in Swagger + + :param name: The name of this TapiNotificationSubscriptionFilter. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param local_id: The local_id of this TapiNotificationSubscriptionFilter. # noqa: E501 + :type local_id: str + :param requested_notification_types: The requested_notification_types of this TapiNotificationSubscriptionFilter. # noqa: E501 + :type requested_notification_types: List[TapiNotificationNotificationType] + :param requested_object_identifier: The requested_object_identifier of this TapiNotificationSubscriptionFilter. # noqa: E501 + :type requested_object_identifier: List[str] + :param requested_layer_protocols: The requested_layer_protocols of this TapiNotificationSubscriptionFilter. # noqa: E501 + :type requested_layer_protocols: List[TapiCommonLayerProtocolName] + :param include_content: The include_content of this TapiNotificationSubscriptionFilter. # noqa: E501 + :type include_content: bool + :param requested_object_types: The requested_object_types of this TapiNotificationSubscriptionFilter. # noqa: E501 + :type requested_object_types: List[TapiNotificationObjectType] + """ + self.swagger_types = { + 'name': List[TapiCommonNameAndValue], + 'local_id': str, + 'requested_notification_types': List[TapiNotificationNotificationType], + 'requested_object_identifier': List[str], + 'requested_layer_protocols': List[TapiCommonLayerProtocolName], + 'include_content': bool, + 'requested_object_types': List[TapiNotificationObjectType] + } + + self.attribute_map = { + 'name': 'name', + 'local_id': 'local-id', + 'requested_notification_types': 'requested-notification-types', + 'requested_object_identifier': 'requested-object-identifier', + 'requested_layer_protocols': 'requested-layer-protocols', + 'include_content': 'include-content', + 'requested_object_types': 'requested-object-types' + } + self._name = name + self._local_id = local_id + self._requested_notification_types = requested_notification_types + self._requested_object_identifier = requested_object_identifier + self._requested_layer_protocols = requested_layer_protocols + self._include_content = include_content + self._requested_object_types = requested_object_types + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationSubscriptionFilter': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.SubscriptionFilter of this TapiNotificationSubscriptionFilter. # noqa: E501 + :rtype: TapiNotificationSubscriptionFilter + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiNotificationSubscriptionFilter. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiNotificationSubscriptionFilter. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiNotificationSubscriptionFilter. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiNotificationSubscriptionFilter. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def local_id(self) -> str: + """Gets the local_id of this TapiNotificationSubscriptionFilter. + + none # noqa: E501 + + :return: The local_id of this TapiNotificationSubscriptionFilter. + :rtype: str + """ + return self._local_id + + @local_id.setter + def local_id(self, local_id: str): + """Sets the local_id of this TapiNotificationSubscriptionFilter. + + none # noqa: E501 + + :param local_id: The local_id of this TapiNotificationSubscriptionFilter. + :type local_id: str + """ + + self._local_id = local_id + + @property + def requested_notification_types(self) -> List[TapiNotificationNotificationType]: + """Gets the requested_notification_types of this TapiNotificationSubscriptionFilter. + + none # noqa: E501 + + :return: The requested_notification_types of this TapiNotificationSubscriptionFilter. + :rtype: List[TapiNotificationNotificationType] + """ + return self._requested_notification_types + + @requested_notification_types.setter + def requested_notification_types(self, requested_notification_types: List[TapiNotificationNotificationType]): + """Sets the requested_notification_types of this TapiNotificationSubscriptionFilter. + + none # noqa: E501 + + :param requested_notification_types: The requested_notification_types of this TapiNotificationSubscriptionFilter. + :type requested_notification_types: List[TapiNotificationNotificationType] + """ + + self._requested_notification_types = requested_notification_types + + @property + def requested_object_identifier(self) -> List[str]: + """Gets the requested_object_identifier of this TapiNotificationSubscriptionFilter. + + none # noqa: E501 + + :return: The requested_object_identifier of this TapiNotificationSubscriptionFilter. + :rtype: List[str] + """ + return self._requested_object_identifier + + @requested_object_identifier.setter + def requested_object_identifier(self, requested_object_identifier: List[str]): + """Sets the requested_object_identifier of this TapiNotificationSubscriptionFilter. + + none # noqa: E501 + + :param requested_object_identifier: The requested_object_identifier of this TapiNotificationSubscriptionFilter. + :type requested_object_identifier: List[str] + """ + + self._requested_object_identifier = requested_object_identifier + + @property + def requested_layer_protocols(self) -> List[TapiCommonLayerProtocolName]: + """Gets the requested_layer_protocols of this TapiNotificationSubscriptionFilter. + + none # noqa: E501 + + :return: The requested_layer_protocols of this TapiNotificationSubscriptionFilter. + :rtype: List[TapiCommonLayerProtocolName] + """ + return self._requested_layer_protocols + + @requested_layer_protocols.setter + def requested_layer_protocols(self, requested_layer_protocols: List[TapiCommonLayerProtocolName]): + """Sets the requested_layer_protocols of this TapiNotificationSubscriptionFilter. + + none # noqa: E501 + + :param requested_layer_protocols: The requested_layer_protocols of this TapiNotificationSubscriptionFilter. + :type requested_layer_protocols: List[TapiCommonLayerProtocolName] + """ + + self._requested_layer_protocols = requested_layer_protocols + + @property + def include_content(self) -> bool: + """Gets the include_content of this TapiNotificationSubscriptionFilter. + + Indicates whether the published Notification includes content or just the Notification Id (which enables retrieval of the notification at the later stage) # noqa: E501 + + :return: The include_content of this TapiNotificationSubscriptionFilter. + :rtype: bool + """ + return self._include_content + + @include_content.setter + def include_content(self, include_content: bool): + """Sets the include_content of this TapiNotificationSubscriptionFilter. + + Indicates whether the published Notification includes content or just the Notification Id (which enables retrieval of the notification at the later stage) # noqa: E501 + + :param include_content: The include_content of this TapiNotificationSubscriptionFilter. + :type include_content: bool + """ + + self._include_content = include_content + + @property + def requested_object_types(self) -> List[TapiNotificationObjectType]: + """Gets the requested_object_types of this TapiNotificationSubscriptionFilter. + + none # noqa: E501 + + :return: The requested_object_types of this TapiNotificationSubscriptionFilter. + :rtype: List[TapiNotificationObjectType] + """ + return self._requested_object_types + + @requested_object_types.setter + def requested_object_types(self, requested_object_types: List[TapiNotificationObjectType]): + """Sets the requested_object_types of this TapiNotificationSubscriptionFilter. + + none # noqa: E501 + + :param requested_object_types: The requested_object_types of this TapiNotificationSubscriptionFilter. + :type requested_object_types: List[TapiNotificationObjectType] + """ + + self._requested_object_types = requested_object_types diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_subscription_filter_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_subscription_filter_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..4320001ca23ebb84f774f3c9e634523439f90423 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_subscription_filter_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_subscription_filter import TapiNotificationSubscriptionFilter # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationSubscriptionFilterWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, subscription_filter: TapiNotificationSubscriptionFilter=None): # noqa: E501 + """TapiNotificationSubscriptionFilterWrapper - a model defined in Swagger + + :param subscription_filter: The subscription_filter of this TapiNotificationSubscriptionFilterWrapper. # noqa: E501 + :type subscription_filter: TapiNotificationSubscriptionFilter + """ + self.swagger_types = { + 'subscription_filter': TapiNotificationSubscriptionFilter + } + + self.attribute_map = { + 'subscription_filter': 'subscription-filter' + } + self._subscription_filter = subscription_filter + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationSubscriptionFilterWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.SubscriptionFilterWrapper of this TapiNotificationSubscriptionFilterWrapper. # noqa: E501 + :rtype: TapiNotificationSubscriptionFilterWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def subscription_filter(self) -> TapiNotificationSubscriptionFilter: + """Gets the subscription_filter of this TapiNotificationSubscriptionFilterWrapper. + + + :return: The subscription_filter of this TapiNotificationSubscriptionFilterWrapper. + :rtype: TapiNotificationSubscriptionFilter + """ + return self._subscription_filter + + @subscription_filter.setter + def subscription_filter(self, subscription_filter: TapiNotificationSubscriptionFilter): + """Sets the subscription_filter of this TapiNotificationSubscriptionFilterWrapper. + + + :param subscription_filter: The subscription_filter of this TapiNotificationSubscriptionFilterWrapper. + :type subscription_filter: TapiNotificationSubscriptionFilter + """ + + self._subscription_filter = subscription_filter diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_subscription_state.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_subscription_state.py new file mode 100644 index 0000000000000000000000000000000000000000..80f69c5f51085ca4512a622ca253dd634ac2360f --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_subscription_state.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiNotificationSubscriptionState(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + SUSPENDED = "SUSPENDED" + ACTIVE = "ACTIVE" + def __init__(self): # noqa: E501 + """TapiNotificationSubscriptionState - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationSubscriptionState': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.SubscriptionState of this TapiNotificationSubscriptionState. # noqa: E501 + :rtype: TapiNotificationSubscriptionState + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_tca_info.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_tca_info.py new file mode 100644 index 0000000000000000000000000000000000000000..9043ceee54d8c6c18dc58ef10f77fa1e1efd5b4b --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_tca_info.py @@ -0,0 +1,230 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_perceived_tca_severity import TapiNotificationPerceivedTcaSeverity # noqa: F401,E501 +from tapi_server.models.tapi_notification_threshold_crossing_type import TapiNotificationThresholdCrossingType # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationTcaInfo(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, threshold_crossing: TapiNotificationThresholdCrossingType=None, threshold_parameter: str=None, is_transient: bool=False, threshold_value: int=None, perceived_severity: TapiNotificationPerceivedTcaSeverity=None, suspect_interval_flag: bool=False, measurement_interval: str=None): # noqa: E501 + """TapiNotificationTcaInfo - a model defined in Swagger + + :param threshold_crossing: The threshold_crossing of this TapiNotificationTcaInfo. # noqa: E501 + :type threshold_crossing: TapiNotificationThresholdCrossingType + :param threshold_parameter: The threshold_parameter of this TapiNotificationTcaInfo. # noqa: E501 + :type threshold_parameter: str + :param is_transient: The is_transient of this TapiNotificationTcaInfo. # noqa: E501 + :type is_transient: bool + :param threshold_value: The threshold_value of this TapiNotificationTcaInfo. # noqa: E501 + :type threshold_value: int + :param perceived_severity: The perceived_severity of this TapiNotificationTcaInfo. # noqa: E501 + :type perceived_severity: TapiNotificationPerceivedTcaSeverity + :param suspect_interval_flag: The suspect_interval_flag of this TapiNotificationTcaInfo. # noqa: E501 + :type suspect_interval_flag: bool + :param measurement_interval: The measurement_interval of this TapiNotificationTcaInfo. # noqa: E501 + :type measurement_interval: str + """ + self.swagger_types = { + 'threshold_crossing': TapiNotificationThresholdCrossingType, + 'threshold_parameter': str, + 'is_transient': bool, + 'threshold_value': int, + 'perceived_severity': TapiNotificationPerceivedTcaSeverity, + 'suspect_interval_flag': bool, + 'measurement_interval': str + } + + self.attribute_map = { + 'threshold_crossing': 'threshold-crossing', + 'threshold_parameter': 'threshold-parameter', + 'is_transient': 'is-transient', + 'threshold_value': 'threshold-value', + 'perceived_severity': 'perceived-severity', + 'suspect_interval_flag': 'suspect-interval-flag', + 'measurement_interval': 'measurement-interval' + } + self._threshold_crossing = threshold_crossing + self._threshold_parameter = threshold_parameter + self._is_transient = is_transient + self._threshold_value = threshold_value + self._perceived_severity = perceived_severity + self._suspect_interval_flag = suspect_interval_flag + self._measurement_interval = measurement_interval + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationTcaInfo': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.TcaInfo of this TapiNotificationTcaInfo. # noqa: E501 + :rtype: TapiNotificationTcaInfo + """ + return util.deserialize_model(dikt, cls) + + @property + def threshold_crossing(self) -> TapiNotificationThresholdCrossingType: + """Gets the threshold_crossing of this TapiNotificationTcaInfo. + + + :return: The threshold_crossing of this TapiNotificationTcaInfo. + :rtype: TapiNotificationThresholdCrossingType + """ + return self._threshold_crossing + + @threshold_crossing.setter + def threshold_crossing(self, threshold_crossing: TapiNotificationThresholdCrossingType): + """Sets the threshold_crossing of this TapiNotificationTcaInfo. + + + :param threshold_crossing: The threshold_crossing of this TapiNotificationTcaInfo. + :type threshold_crossing: TapiNotificationThresholdCrossingType + """ + + self._threshold_crossing = threshold_crossing + + @property + def threshold_parameter(self) -> str: + """Gets the threshold_parameter of this TapiNotificationTcaInfo. + + none # noqa: E501 + + :return: The threshold_parameter of this TapiNotificationTcaInfo. + :rtype: str + """ + return self._threshold_parameter + + @threshold_parameter.setter + def threshold_parameter(self, threshold_parameter: str): + """Sets the threshold_parameter of this TapiNotificationTcaInfo. + + none # noqa: E501 + + :param threshold_parameter: The threshold_parameter of this TapiNotificationTcaInfo. + :type threshold_parameter: str + """ + + self._threshold_parameter = threshold_parameter + + @property + def is_transient(self) -> bool: + """Gets the is_transient of this TapiNotificationTcaInfo. + + none # noqa: E501 + + :return: The is_transient of this TapiNotificationTcaInfo. + :rtype: bool + """ + return self._is_transient + + @is_transient.setter + def is_transient(self, is_transient: bool): + """Sets the is_transient of this TapiNotificationTcaInfo. + + none # noqa: E501 + + :param is_transient: The is_transient of this TapiNotificationTcaInfo. + :type is_transient: bool + """ + + self._is_transient = is_transient + + @property + def threshold_value(self) -> int: + """Gets the threshold_value of this TapiNotificationTcaInfo. + + none # noqa: E501 + + :return: The threshold_value of this TapiNotificationTcaInfo. + :rtype: int + """ + return self._threshold_value + + @threshold_value.setter + def threshold_value(self, threshold_value: int): + """Sets the threshold_value of this TapiNotificationTcaInfo. + + none # noqa: E501 + + :param threshold_value: The threshold_value of this TapiNotificationTcaInfo. + :type threshold_value: int + """ + + self._threshold_value = threshold_value + + @property + def perceived_severity(self) -> TapiNotificationPerceivedTcaSeverity: + """Gets the perceived_severity of this TapiNotificationTcaInfo. + + + :return: The perceived_severity of this TapiNotificationTcaInfo. + :rtype: TapiNotificationPerceivedTcaSeverity + """ + return self._perceived_severity + + @perceived_severity.setter + def perceived_severity(self, perceived_severity: TapiNotificationPerceivedTcaSeverity): + """Sets the perceived_severity of this TapiNotificationTcaInfo. + + + :param perceived_severity: The perceived_severity of this TapiNotificationTcaInfo. + :type perceived_severity: TapiNotificationPerceivedTcaSeverity + """ + + self._perceived_severity = perceived_severity + + @property + def suspect_interval_flag(self) -> bool: + """Gets the suspect_interval_flag of this TapiNotificationTcaInfo. + + none # noqa: E501 + + :return: The suspect_interval_flag of this TapiNotificationTcaInfo. + :rtype: bool + """ + return self._suspect_interval_flag + + @suspect_interval_flag.setter + def suspect_interval_flag(self, suspect_interval_flag: bool): + """Sets the suspect_interval_flag of this TapiNotificationTcaInfo. + + none # noqa: E501 + + :param suspect_interval_flag: The suspect_interval_flag of this TapiNotificationTcaInfo. + :type suspect_interval_flag: bool + """ + + self._suspect_interval_flag = suspect_interval_flag + + @property + def measurement_interval(self) -> str: + """Gets the measurement_interval of this TapiNotificationTcaInfo. + + none # noqa: E501 + + :return: The measurement_interval of this TapiNotificationTcaInfo. + :rtype: str + """ + return self._measurement_interval + + @measurement_interval.setter + def measurement_interval(self, measurement_interval: str): + """Sets the measurement_interval of this TapiNotificationTcaInfo. + + none # noqa: E501 + + :param measurement_interval: The measurement_interval of this TapiNotificationTcaInfo. + :type measurement_interval: str + """ + + self._measurement_interval = measurement_interval diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_tca_info_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_tca_info_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..b607e088d46fd14cbb5deb37df8f9f02a0bfc22b --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_tca_info_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_tca_info import TapiNotificationTcaInfo # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationTcaInfoWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, tca_info: TapiNotificationTcaInfo=None): # noqa: E501 + """TapiNotificationTcaInfoWrapper - a model defined in Swagger + + :param tca_info: The tca_info of this TapiNotificationTcaInfoWrapper. # noqa: E501 + :type tca_info: TapiNotificationTcaInfo + """ + self.swagger_types = { + 'tca_info': TapiNotificationTcaInfo + } + + self.attribute_map = { + 'tca_info': 'tca-info' + } + self._tca_info = tca_info + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationTcaInfoWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.TcaInfoWrapper of this TapiNotificationTcaInfoWrapper. # noqa: E501 + :rtype: TapiNotificationTcaInfoWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def tca_info(self) -> TapiNotificationTcaInfo: + """Gets the tca_info of this TapiNotificationTcaInfoWrapper. + + + :return: The tca_info of this TapiNotificationTcaInfoWrapper. + :rtype: TapiNotificationTcaInfo + """ + return self._tca_info + + @tca_info.setter + def tca_info(self, tca_info: TapiNotificationTcaInfo): + """Sets the tca_info of this TapiNotificationTcaInfoWrapper. + + + :param tca_info: The tca_info of this TapiNotificationTcaInfoWrapper. + :type tca_info: TapiNotificationTcaInfo + """ + + self._tca_info = tca_info diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_threshold_crossing_type.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_threshold_crossing_type.py new file mode 100644 index 0000000000000000000000000000000000000000..7082427638817227cbdb964d0c7d55459376938e --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_threshold_crossing_type.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiNotificationThresholdCrossingType(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + THRESHOLD_ABOVE = "THRESHOLD_ABOVE" + THRESHOLD_BELOW = "THRESHOLD_BELOW" + CLEARED = "CLEARED" + def __init__(self): # noqa: E501 + """TapiNotificationThresholdCrossingType - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationThresholdCrossingType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.ThresholdCrossingType of this TapiNotificationThresholdCrossingType. # noqa: E501 + :rtype: TapiNotificationThresholdCrossingType + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_update_notification_subscription_service.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_update_notification_subscription_service.py new file mode 100644 index 0000000000000000000000000000000000000000..a784b067a36151c912470b2c234b31cdc33e4762 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_update_notification_subscription_service.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_updatenotificationsubscriptionservice_output import TapiNotificationUpdatenotificationsubscriptionserviceOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationUpdateNotificationSubscriptionService(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiNotificationUpdatenotificationsubscriptionserviceOutput=None): # noqa: E501 + """TapiNotificationUpdateNotificationSubscriptionService - a model defined in Swagger + + :param output: The output of this TapiNotificationUpdateNotificationSubscriptionService. # noqa: E501 + :type output: TapiNotificationUpdatenotificationsubscriptionserviceOutput + """ + self.swagger_types = { + 'output': TapiNotificationUpdatenotificationsubscriptionserviceOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationUpdateNotificationSubscriptionService': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.UpdateNotificationSubscriptionService of this TapiNotificationUpdateNotificationSubscriptionService. # noqa: E501 + :rtype: TapiNotificationUpdateNotificationSubscriptionService + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiNotificationUpdatenotificationsubscriptionserviceOutput: + """Gets the output of this TapiNotificationUpdateNotificationSubscriptionService. + + + :return: The output of this TapiNotificationUpdateNotificationSubscriptionService. + :rtype: TapiNotificationUpdatenotificationsubscriptionserviceOutput + """ + return self._output + + @output.setter + def output(self, output: TapiNotificationUpdatenotificationsubscriptionserviceOutput): + """Sets the output of this TapiNotificationUpdateNotificationSubscriptionService. + + + :param output: The output of this TapiNotificationUpdateNotificationSubscriptionService. + :type output: TapiNotificationUpdatenotificationsubscriptionserviceOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_updatenotificationsubscriptionservice_input.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_updatenotificationsubscriptionservice_input.py new file mode 100644 index 0000000000000000000000000000000000000000..c6a1b1e4e980157be32a71692fe6a40b2e098bfd --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_updatenotificationsubscriptionservice_input.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_subscription_filter import TapiNotificationSubscriptionFilter # noqa: F401,E501 +from tapi_server.models.tapi_notification_subscription_state import TapiNotificationSubscriptionState # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationUpdatenotificationsubscriptionserviceInput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, subscription_state: TapiNotificationSubscriptionState=None, subscription_filter: TapiNotificationSubscriptionFilter=None, subscription_id_or_name: str=None): # noqa: E501 + """TapiNotificationUpdatenotificationsubscriptionserviceInput - a model defined in Swagger + + :param subscription_state: The subscription_state of this TapiNotificationUpdatenotificationsubscriptionserviceInput. # noqa: E501 + :type subscription_state: TapiNotificationSubscriptionState + :param subscription_filter: The subscription_filter of this TapiNotificationUpdatenotificationsubscriptionserviceInput. # noqa: E501 + :type subscription_filter: TapiNotificationSubscriptionFilter + :param subscription_id_or_name: The subscription_id_or_name of this TapiNotificationUpdatenotificationsubscriptionserviceInput. # noqa: E501 + :type subscription_id_or_name: str + """ + self.swagger_types = { + 'subscription_state': TapiNotificationSubscriptionState, + 'subscription_filter': TapiNotificationSubscriptionFilter, + 'subscription_id_or_name': str + } + + self.attribute_map = { + 'subscription_state': 'subscription-state', + 'subscription_filter': 'subscription-filter', + 'subscription_id_or_name': 'subscription-id-or-name' + } + self._subscription_state = subscription_state + self._subscription_filter = subscription_filter + self._subscription_id_or_name = subscription_id_or_name + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationUpdatenotificationsubscriptionserviceInput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.updatenotificationsubscriptionservice.Input of this TapiNotificationUpdatenotificationsubscriptionserviceInput. # noqa: E501 + :rtype: TapiNotificationUpdatenotificationsubscriptionserviceInput + """ + return util.deserialize_model(dikt, cls) + + @property + def subscription_state(self) -> TapiNotificationSubscriptionState: + """Gets the subscription_state of this TapiNotificationUpdatenotificationsubscriptionserviceInput. + + + :return: The subscription_state of this TapiNotificationUpdatenotificationsubscriptionserviceInput. + :rtype: TapiNotificationSubscriptionState + """ + return self._subscription_state + + @subscription_state.setter + def subscription_state(self, subscription_state: TapiNotificationSubscriptionState): + """Sets the subscription_state of this TapiNotificationUpdatenotificationsubscriptionserviceInput. + + + :param subscription_state: The subscription_state of this TapiNotificationUpdatenotificationsubscriptionserviceInput. + :type subscription_state: TapiNotificationSubscriptionState + """ + + self._subscription_state = subscription_state + + @property + def subscription_filter(self) -> TapiNotificationSubscriptionFilter: + """Gets the subscription_filter of this TapiNotificationUpdatenotificationsubscriptionserviceInput. + + + :return: The subscription_filter of this TapiNotificationUpdatenotificationsubscriptionserviceInput. + :rtype: TapiNotificationSubscriptionFilter + """ + return self._subscription_filter + + @subscription_filter.setter + def subscription_filter(self, subscription_filter: TapiNotificationSubscriptionFilter): + """Sets the subscription_filter of this TapiNotificationUpdatenotificationsubscriptionserviceInput. + + + :param subscription_filter: The subscription_filter of this TapiNotificationUpdatenotificationsubscriptionserviceInput. + :type subscription_filter: TapiNotificationSubscriptionFilter + """ + + self._subscription_filter = subscription_filter + + @property + def subscription_id_or_name(self) -> str: + """Gets the subscription_id_or_name of this TapiNotificationUpdatenotificationsubscriptionserviceInput. + + none # noqa: E501 + + :return: The subscription_id_or_name of this TapiNotificationUpdatenotificationsubscriptionserviceInput. + :rtype: str + """ + return self._subscription_id_or_name + + @subscription_id_or_name.setter + def subscription_id_or_name(self, subscription_id_or_name: str): + """Sets the subscription_id_or_name of this TapiNotificationUpdatenotificationsubscriptionserviceInput. + + none # noqa: E501 + + :param subscription_id_or_name: The subscription_id_or_name of this TapiNotificationUpdatenotificationsubscriptionserviceInput. + :type subscription_id_or_name: str + """ + + self._subscription_id_or_name = subscription_id_or_name diff --git a/hackfest/tapi/server/tapi_server/models/tapi_notification_updatenotificationsubscriptionservice_output.py b/hackfest/tapi/server/tapi_server/models/tapi_notification_updatenotificationsubscriptionservice_output.py new file mode 100644 index 0000000000000000000000000000000000000000..fc0ba68399d51b381faa2adcb6a2899fcc0a8554 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_notification_updatenotificationsubscriptionservice_output.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_notification_notification_subscription_service import TapiNotificationNotificationSubscriptionService # noqa: F401,E501 +from tapi_server import util + + +class TapiNotificationUpdatenotificationsubscriptionserviceOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, subscription_service: TapiNotificationNotificationSubscriptionService=None): # noqa: E501 + """TapiNotificationUpdatenotificationsubscriptionserviceOutput - a model defined in Swagger + + :param subscription_service: The subscription_service of this TapiNotificationUpdatenotificationsubscriptionserviceOutput. # noqa: E501 + :type subscription_service: TapiNotificationNotificationSubscriptionService + """ + self.swagger_types = { + 'subscription_service': TapiNotificationNotificationSubscriptionService + } + + self.attribute_map = { + 'subscription_service': 'subscription-service' + } + self._subscription_service = subscription_service + + @classmethod + def from_dict(cls, dikt) -> 'TapiNotificationUpdatenotificationsubscriptionserviceOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.notification.updatenotificationsubscriptionservice.Output of this TapiNotificationUpdatenotificationsubscriptionserviceOutput. # noqa: E501 + :rtype: TapiNotificationUpdatenotificationsubscriptionserviceOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def subscription_service(self) -> TapiNotificationNotificationSubscriptionService: + """Gets the subscription_service of this TapiNotificationUpdatenotificationsubscriptionserviceOutput. + + + :return: The subscription_service of this TapiNotificationUpdatenotificationsubscriptionserviceOutput. + :rtype: TapiNotificationNotificationSubscriptionService + """ + return self._subscription_service + + @subscription_service.setter + def subscription_service(self, subscription_service: TapiNotificationNotificationSubscriptionService): + """Sets the subscription_service of this TapiNotificationUpdatenotificationsubscriptionserviceOutput. + + + :param subscription_service: The subscription_service of this TapiNotificationUpdatenotificationsubscriptionserviceOutput. + :type subscription_service: TapiNotificationNotificationSubscriptionService + """ + + self._subscription_service = subscription_service diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_compute_p2_p_path.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_compute_p2_p_path.py new file mode 100644 index 0000000000000000000000000000000000000000..a3630b3b370eda154618831f0e399d9f2df8cde1 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_compute_p2_p_path.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_computep2ppath_output import TapiPathComputationComputep2ppathOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationComputeP2PPath(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiPathComputationComputep2ppathOutput=None): # noqa: E501 + """TapiPathComputationComputeP2PPath - a model defined in Swagger + + :param output: The output of this TapiPathComputationComputeP2PPath. # noqa: E501 + :type output: TapiPathComputationComputep2ppathOutput + """ + self.swagger_types = { + 'output': TapiPathComputationComputep2ppathOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationComputeP2PPath': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.ComputeP2PPath of this TapiPathComputationComputeP2PPath. # noqa: E501 + :rtype: TapiPathComputationComputeP2PPath + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiPathComputationComputep2ppathOutput: + """Gets the output of this TapiPathComputationComputeP2PPath. + + + :return: The output of this TapiPathComputationComputeP2PPath. + :rtype: TapiPathComputationComputep2ppathOutput + """ + return self._output + + @output.setter + def output(self, output: TapiPathComputationComputep2ppathOutput): + """Sets the output of this TapiPathComputationComputeP2PPath. + + + :param output: The output of this TapiPathComputationComputeP2PPath. + :type output: TapiPathComputationComputep2ppathOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_computep2ppath_input.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_computep2ppath_input.py new file mode 100644 index 0000000000000000000000000000000000000000..1e934cbdca0d23f23ef282da4e0863f14badc972 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_computep2ppath_input.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_path_objective_function import TapiPathComputationPathObjectiveFunction # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_path_service_end_point import TapiPathComputationPathServiceEndPoint # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_routing_constraint import TapiPathComputationRoutingConstraint # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_topology_constraint import TapiPathComputationTopologyConstraint # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationComputep2ppathInput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, topology_constraint: TapiPathComputationTopologyConstraint=None, routing_constraint: TapiPathComputationRoutingConstraint=None, objective_function: TapiPathComputationPathObjectiveFunction=None, sep: List[TapiPathComputationPathServiceEndPoint]=None): # noqa: E501 + """TapiPathComputationComputep2ppathInput - a model defined in Swagger + + :param topology_constraint: The topology_constraint of this TapiPathComputationComputep2ppathInput. # noqa: E501 + :type topology_constraint: TapiPathComputationTopologyConstraint + :param routing_constraint: The routing_constraint of this TapiPathComputationComputep2ppathInput. # noqa: E501 + :type routing_constraint: TapiPathComputationRoutingConstraint + :param objective_function: The objective_function of this TapiPathComputationComputep2ppathInput. # noqa: E501 + :type objective_function: TapiPathComputationPathObjectiveFunction + :param sep: The sep of this TapiPathComputationComputep2ppathInput. # noqa: E501 + :type sep: List[TapiPathComputationPathServiceEndPoint] + """ + self.swagger_types = { + 'topology_constraint': TapiPathComputationTopologyConstraint, + 'routing_constraint': TapiPathComputationRoutingConstraint, + 'objective_function': TapiPathComputationPathObjectiveFunction, + 'sep': List[TapiPathComputationPathServiceEndPoint] + } + + self.attribute_map = { + 'topology_constraint': 'topology-constraint', + 'routing_constraint': 'routing-constraint', + 'objective_function': 'objective-function', + 'sep': 'sep' + } + self._topology_constraint = topology_constraint + self._routing_constraint = routing_constraint + self._objective_function = objective_function + self._sep = sep + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationComputep2ppathInput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.computep2ppath.Input of this TapiPathComputationComputep2ppathInput. # noqa: E501 + :rtype: TapiPathComputationComputep2ppathInput + """ + return util.deserialize_model(dikt, cls) + + @property + def topology_constraint(self) -> TapiPathComputationTopologyConstraint: + """Gets the topology_constraint of this TapiPathComputationComputep2ppathInput. + + + :return: The topology_constraint of this TapiPathComputationComputep2ppathInput. + :rtype: TapiPathComputationTopologyConstraint + """ + return self._topology_constraint + + @topology_constraint.setter + def topology_constraint(self, topology_constraint: TapiPathComputationTopologyConstraint): + """Sets the topology_constraint of this TapiPathComputationComputep2ppathInput. + + + :param topology_constraint: The topology_constraint of this TapiPathComputationComputep2ppathInput. + :type topology_constraint: TapiPathComputationTopologyConstraint + """ + + self._topology_constraint = topology_constraint + + @property + def routing_constraint(self) -> TapiPathComputationRoutingConstraint: + """Gets the routing_constraint of this TapiPathComputationComputep2ppathInput. + + + :return: The routing_constraint of this TapiPathComputationComputep2ppathInput. + :rtype: TapiPathComputationRoutingConstraint + """ + return self._routing_constraint + + @routing_constraint.setter + def routing_constraint(self, routing_constraint: TapiPathComputationRoutingConstraint): + """Sets the routing_constraint of this TapiPathComputationComputep2ppathInput. + + + :param routing_constraint: The routing_constraint of this TapiPathComputationComputep2ppathInput. + :type routing_constraint: TapiPathComputationRoutingConstraint + """ + + self._routing_constraint = routing_constraint + + @property + def objective_function(self) -> TapiPathComputationPathObjectiveFunction: + """Gets the objective_function of this TapiPathComputationComputep2ppathInput. + + + :return: The objective_function of this TapiPathComputationComputep2ppathInput. + :rtype: TapiPathComputationPathObjectiveFunction + """ + return self._objective_function + + @objective_function.setter + def objective_function(self, objective_function: TapiPathComputationPathObjectiveFunction): + """Sets the objective_function of this TapiPathComputationComputep2ppathInput. + + + :param objective_function: The objective_function of this TapiPathComputationComputep2ppathInput. + :type objective_function: TapiPathComputationPathObjectiveFunction + """ + + self._objective_function = objective_function + + @property + def sep(self) -> List[TapiPathComputationPathServiceEndPoint]: + """Gets the sep of this TapiPathComputationComputep2ppathInput. + + none # noqa: E501 + + :return: The sep of this TapiPathComputationComputep2ppathInput. + :rtype: List[TapiPathComputationPathServiceEndPoint] + """ + return self._sep + + @sep.setter + def sep(self, sep: List[TapiPathComputationPathServiceEndPoint]): + """Sets the sep of this TapiPathComputationComputep2ppathInput. + + none # noqa: E501 + + :param sep: The sep of this TapiPathComputationComputep2ppathInput. + :type sep: List[TapiPathComputationPathServiceEndPoint] + """ + + self._sep = sep diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_computep2ppath_output.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_computep2ppath_output.py new file mode 100644 index 0000000000000000000000000000000000000000..a89dc2657d6b17d654cead1a40e5d7d46a2b420d --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_computep2ppath_output.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_path_computation_service import TapiPathComputationPathComputationService # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationComputep2ppathOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, service: TapiPathComputationPathComputationService=None): # noqa: E501 + """TapiPathComputationComputep2ppathOutput - a model defined in Swagger + + :param service: The service of this TapiPathComputationComputep2ppathOutput. # noqa: E501 + :type service: TapiPathComputationPathComputationService + """ + self.swagger_types = { + 'service': TapiPathComputationPathComputationService + } + + self.attribute_map = { + 'service': 'service' + } + self._service = service + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationComputep2ppathOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.computep2ppath.Output of this TapiPathComputationComputep2ppathOutput. # noqa: E501 + :rtype: TapiPathComputationComputep2ppathOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def service(self) -> TapiPathComputationPathComputationService: + """Gets the service of this TapiPathComputationComputep2ppathOutput. + + + :return: The service of this TapiPathComputationComputep2ppathOutput. + :rtype: TapiPathComputationPathComputationService + """ + return self._service + + @service.setter + def service(self, service: TapiPathComputationPathComputationService): + """Sets the service of this TapiPathComputationComputep2ppathOutput. + + + :param service: The service of this TapiPathComputationComputep2ppathOutput. + :type service: TapiPathComputationPathComputationService + """ + + self._service = service diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_context_augmentation2.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_context_augmentation2.py new file mode 100644 index 0000000000000000000000000000000000000000..846fd8190406e4e88a9a7151f50200a8caf3059f --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_context_augmentation2.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_path_computation_context import TapiPathComputationPathComputationContext # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationContextAugmentation2(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, path_computation_context: TapiPathComputationPathComputationContext=None): # noqa: E501 + """TapiPathComputationContextAugmentation2 - a model defined in Swagger + + :param path_computation_context: The path_computation_context of this TapiPathComputationContextAugmentation2. # noqa: E501 + :type path_computation_context: TapiPathComputationPathComputationContext + """ + self.swagger_types = { + 'path_computation_context': TapiPathComputationPathComputationContext + } + + self.attribute_map = { + 'path_computation_context': 'path-computation-context' + } + self._path_computation_context = path_computation_context + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationContextAugmentation2': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.ContextAugmentation2 of this TapiPathComputationContextAugmentation2. # noqa: E501 + :rtype: TapiPathComputationContextAugmentation2 + """ + return util.deserialize_model(dikt, cls) + + @property + def path_computation_context(self) -> TapiPathComputationPathComputationContext: + """Gets the path_computation_context of this TapiPathComputationContextAugmentation2. + + + :return: The path_computation_context of this TapiPathComputationContextAugmentation2. + :rtype: TapiPathComputationPathComputationContext + """ + return self._path_computation_context + + @path_computation_context.setter + def path_computation_context(self, path_computation_context: TapiPathComputationPathComputationContext): + """Sets the path_computation_context of this TapiPathComputationContextAugmentation2. + + + :param path_computation_context: The path_computation_context of this TapiPathComputationContextAugmentation2. + :type path_computation_context: TapiPathComputationPathComputationContext + """ + + self._path_computation_context = path_computation_context diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_delete_p2_p_path.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_delete_p2_p_path.py new file mode 100644 index 0000000000000000000000000000000000000000..5af4467a2927cde5085f14bb97270b1b962fa105 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_delete_p2_p_path.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_deletep2ppath_output import TapiPathComputationDeletep2ppathOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationDeleteP2PPath(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiPathComputationDeletep2ppathOutput=None): # noqa: E501 + """TapiPathComputationDeleteP2PPath - a model defined in Swagger + + :param output: The output of this TapiPathComputationDeleteP2PPath. # noqa: E501 + :type output: TapiPathComputationDeletep2ppathOutput + """ + self.swagger_types = { + 'output': TapiPathComputationDeletep2ppathOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationDeleteP2PPath': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.DeleteP2PPath of this TapiPathComputationDeleteP2PPath. # noqa: E501 + :rtype: TapiPathComputationDeleteP2PPath + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiPathComputationDeletep2ppathOutput: + """Gets the output of this TapiPathComputationDeleteP2PPath. + + + :return: The output of this TapiPathComputationDeleteP2PPath. + :rtype: TapiPathComputationDeletep2ppathOutput + """ + return self._output + + @output.setter + def output(self, output: TapiPathComputationDeletep2ppathOutput): + """Sets the output of this TapiPathComputationDeleteP2PPath. + + + :param output: The output of this TapiPathComputationDeleteP2PPath. + :type output: TapiPathComputationDeletep2ppathOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_deletep2ppath_input.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_deletep2ppath_input.py new file mode 100644 index 0000000000000000000000000000000000000000..e09c60312cd29b8005ad7dcc1cc2c2b526ab478e --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_deletep2ppath_input.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiPathComputationDeletep2ppathInput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, path_id_or_name: str=None): # noqa: E501 + """TapiPathComputationDeletep2ppathInput - a model defined in Swagger + + :param path_id_or_name: The path_id_or_name of this TapiPathComputationDeletep2ppathInput. # noqa: E501 + :type path_id_or_name: str + """ + self.swagger_types = { + 'path_id_or_name': str + } + + self.attribute_map = { + 'path_id_or_name': 'path-id-or-name' + } + self._path_id_or_name = path_id_or_name + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationDeletep2ppathInput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.deletep2ppath.Input of this TapiPathComputationDeletep2ppathInput. # noqa: E501 + :rtype: TapiPathComputationDeletep2ppathInput + """ + return util.deserialize_model(dikt, cls) + + @property + def path_id_or_name(self) -> str: + """Gets the path_id_or_name of this TapiPathComputationDeletep2ppathInput. + + none # noqa: E501 + + :return: The path_id_or_name of this TapiPathComputationDeletep2ppathInput. + :rtype: str + """ + return self._path_id_or_name + + @path_id_or_name.setter + def path_id_or_name(self, path_id_or_name: str): + """Sets the path_id_or_name of this TapiPathComputationDeletep2ppathInput. + + none # noqa: E501 + + :param path_id_or_name: The path_id_or_name of this TapiPathComputationDeletep2ppathInput. + :type path_id_or_name: str + """ + + self._path_id_or_name = path_id_or_name diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_deletep2ppath_output.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_deletep2ppath_output.py new file mode 100644 index 0000000000000000000000000000000000000000..fab025bea92a859f23fe917e3bead9101b7b45a1 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_deletep2ppath_output.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_path_computation_service import TapiPathComputationPathComputationService # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationDeletep2ppathOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, service: TapiPathComputationPathComputationService=None): # noqa: E501 + """TapiPathComputationDeletep2ppathOutput - a model defined in Swagger + + :param service: The service of this TapiPathComputationDeletep2ppathOutput. # noqa: E501 + :type service: TapiPathComputationPathComputationService + """ + self.swagger_types = { + 'service': TapiPathComputationPathComputationService + } + + self.attribute_map = { + 'service': 'service' + } + self._service = service + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationDeletep2ppathOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.deletep2ppath.Output of this TapiPathComputationDeletep2ppathOutput. # noqa: E501 + :rtype: TapiPathComputationDeletep2ppathOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def service(self) -> TapiPathComputationPathComputationService: + """Gets the service of this TapiPathComputationDeletep2ppathOutput. + + + :return: The service of this TapiPathComputationDeletep2ppathOutput. + :rtype: TapiPathComputationPathComputationService + """ + return self._service + + @service.setter + def service(self, service: TapiPathComputationPathComputationService): + """Sets the service of this TapiPathComputationDeletep2ppathOutput. + + + :param service: The service of this TapiPathComputationDeletep2ppathOutput. + :type service: TapiPathComputationPathComputationService + """ + + self._service = service diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_diversity_policy.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_diversity_policy.py new file mode 100644 index 0000000000000000000000000000000000000000..fb26c95763424c8168c33752246365696d331175 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_diversity_policy.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiPathComputationDiversityPolicy(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + SRLG = "SRLG" + SRNG = "SRNG" + SNG = "SNG" + NODE = "NODE" + LINK = "LINK" + def __init__(self): # noqa: E501 + """TapiPathComputationDiversityPolicy - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationDiversityPolicy': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.DiversityPolicy of this TapiPathComputationDiversityPolicy. # noqa: E501 + :rtype: TapiPathComputationDiversityPolicy + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_optimize_p2_ppath.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_optimize_p2_ppath.py new file mode 100644 index 0000000000000000000000000000000000000000..33673e284aa5574a1fd4285a2ac3e947c58e3027 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_optimize_p2_ppath.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_optimizep2ppath_output import TapiPathComputationOptimizep2ppathOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationOptimizeP2Ppath(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiPathComputationOptimizep2ppathOutput=None): # noqa: E501 + """TapiPathComputationOptimizeP2Ppath - a model defined in Swagger + + :param output: The output of this TapiPathComputationOptimizeP2Ppath. # noqa: E501 + :type output: TapiPathComputationOptimizep2ppathOutput + """ + self.swagger_types = { + 'output': TapiPathComputationOptimizep2ppathOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationOptimizeP2Ppath': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.OptimizeP2Ppath of this TapiPathComputationOptimizeP2Ppath. # noqa: E501 + :rtype: TapiPathComputationOptimizeP2Ppath + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiPathComputationOptimizep2ppathOutput: + """Gets the output of this TapiPathComputationOptimizeP2Ppath. + + + :return: The output of this TapiPathComputationOptimizeP2Ppath. + :rtype: TapiPathComputationOptimizep2ppathOutput + """ + return self._output + + @output.setter + def output(self, output: TapiPathComputationOptimizep2ppathOutput): + """Sets the output of this TapiPathComputationOptimizeP2Ppath. + + + :param output: The output of this TapiPathComputationOptimizeP2Ppath. + :type output: TapiPathComputationOptimizep2ppathOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_optimizep2ppath_input.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_optimizep2ppath_input.py new file mode 100644 index 0000000000000000000000000000000000000000..8d156745236d27b6d9a96514f6c463f009096d11 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_optimizep2ppath_input.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_path_objective_function import TapiPathComputationPathObjectiveFunction # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_path_optimization_constraint import TapiPathComputationPathOptimizationConstraint # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_routing_constraint import TapiPathComputationRoutingConstraint # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationOptimizep2ppathInput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, routing_constraint: TapiPathComputationRoutingConstraint=None, path_id_or_name: str=None, optimization_constraint: TapiPathComputationPathOptimizationConstraint=None, objective_function: TapiPathComputationPathObjectiveFunction=None): # noqa: E501 + """TapiPathComputationOptimizep2ppathInput - a model defined in Swagger + + :param routing_constraint: The routing_constraint of this TapiPathComputationOptimizep2ppathInput. # noqa: E501 + :type routing_constraint: TapiPathComputationRoutingConstraint + :param path_id_or_name: The path_id_or_name of this TapiPathComputationOptimizep2ppathInput. # noqa: E501 + :type path_id_or_name: str + :param optimization_constraint: The optimization_constraint of this TapiPathComputationOptimizep2ppathInput. # noqa: E501 + :type optimization_constraint: TapiPathComputationPathOptimizationConstraint + :param objective_function: The objective_function of this TapiPathComputationOptimizep2ppathInput. # noqa: E501 + :type objective_function: TapiPathComputationPathObjectiveFunction + """ + self.swagger_types = { + 'routing_constraint': TapiPathComputationRoutingConstraint, + 'path_id_or_name': str, + 'optimization_constraint': TapiPathComputationPathOptimizationConstraint, + 'objective_function': TapiPathComputationPathObjectiveFunction + } + + self.attribute_map = { + 'routing_constraint': 'routing-constraint', + 'path_id_or_name': 'path-id-or-name', + 'optimization_constraint': 'optimization-constraint', + 'objective_function': 'objective-function' + } + self._routing_constraint = routing_constraint + self._path_id_or_name = path_id_or_name + self._optimization_constraint = optimization_constraint + self._objective_function = objective_function + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationOptimizep2ppathInput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.optimizep2ppath.Input of this TapiPathComputationOptimizep2ppathInput. # noqa: E501 + :rtype: TapiPathComputationOptimizep2ppathInput + """ + return util.deserialize_model(dikt, cls) + + @property + def routing_constraint(self) -> TapiPathComputationRoutingConstraint: + """Gets the routing_constraint of this TapiPathComputationOptimizep2ppathInput. + + + :return: The routing_constraint of this TapiPathComputationOptimizep2ppathInput. + :rtype: TapiPathComputationRoutingConstraint + """ + return self._routing_constraint + + @routing_constraint.setter + def routing_constraint(self, routing_constraint: TapiPathComputationRoutingConstraint): + """Sets the routing_constraint of this TapiPathComputationOptimizep2ppathInput. + + + :param routing_constraint: The routing_constraint of this TapiPathComputationOptimizep2ppathInput. + :type routing_constraint: TapiPathComputationRoutingConstraint + """ + + self._routing_constraint = routing_constraint + + @property + def path_id_or_name(self) -> str: + """Gets the path_id_or_name of this TapiPathComputationOptimizep2ppathInput. + + none # noqa: E501 + + :return: The path_id_or_name of this TapiPathComputationOptimizep2ppathInput. + :rtype: str + """ + return self._path_id_or_name + + @path_id_or_name.setter + def path_id_or_name(self, path_id_or_name: str): + """Sets the path_id_or_name of this TapiPathComputationOptimizep2ppathInput. + + none # noqa: E501 + + :param path_id_or_name: The path_id_or_name of this TapiPathComputationOptimizep2ppathInput. + :type path_id_or_name: str + """ + + self._path_id_or_name = path_id_or_name + + @property + def optimization_constraint(self) -> TapiPathComputationPathOptimizationConstraint: + """Gets the optimization_constraint of this TapiPathComputationOptimizep2ppathInput. + + + :return: The optimization_constraint of this TapiPathComputationOptimizep2ppathInput. + :rtype: TapiPathComputationPathOptimizationConstraint + """ + return self._optimization_constraint + + @optimization_constraint.setter + def optimization_constraint(self, optimization_constraint: TapiPathComputationPathOptimizationConstraint): + """Sets the optimization_constraint of this TapiPathComputationOptimizep2ppathInput. + + + :param optimization_constraint: The optimization_constraint of this TapiPathComputationOptimizep2ppathInput. + :type optimization_constraint: TapiPathComputationPathOptimizationConstraint + """ + + self._optimization_constraint = optimization_constraint + + @property + def objective_function(self) -> TapiPathComputationPathObjectiveFunction: + """Gets the objective_function of this TapiPathComputationOptimizep2ppathInput. + + + :return: The objective_function of this TapiPathComputationOptimizep2ppathInput. + :rtype: TapiPathComputationPathObjectiveFunction + """ + return self._objective_function + + @objective_function.setter + def objective_function(self, objective_function: TapiPathComputationPathObjectiveFunction): + """Sets the objective_function of this TapiPathComputationOptimizep2ppathInput. + + + :param objective_function: The objective_function of this TapiPathComputationOptimizep2ppathInput. + :type objective_function: TapiPathComputationPathObjectiveFunction + """ + + self._objective_function = objective_function diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_optimizep2ppath_output.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_optimizep2ppath_output.py new file mode 100644 index 0000000000000000000000000000000000000000..70447a61f7d388f7c9c755bdd09ba922a64aa4f3 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_optimizep2ppath_output.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_path_computation_service import TapiPathComputationPathComputationService # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationOptimizep2ppathOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, service: TapiPathComputationPathComputationService=None): # noqa: E501 + """TapiPathComputationOptimizep2ppathOutput - a model defined in Swagger + + :param service: The service of this TapiPathComputationOptimizep2ppathOutput. # noqa: E501 + :type service: TapiPathComputationPathComputationService + """ + self.swagger_types = { + 'service': TapiPathComputationPathComputationService + } + + self.attribute_map = { + 'service': 'service' + } + self._service = service + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationOptimizep2ppathOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.optimizep2ppath.Output of this TapiPathComputationOptimizep2ppathOutput. # noqa: E501 + :rtype: TapiPathComputationOptimizep2ppathOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def service(self) -> TapiPathComputationPathComputationService: + """Gets the service of this TapiPathComputationOptimizep2ppathOutput. + + + :return: The service of this TapiPathComputationOptimizep2ppathOutput. + :rtype: TapiPathComputationPathComputationService + """ + return self._service + + @service.setter + def service(self, service: TapiPathComputationPathComputationService): + """Sets the service of this TapiPathComputationOptimizep2ppathOutput. + + + :param service: The service of this TapiPathComputationOptimizep2ppathOutput. + :type service: TapiPathComputationPathComputationService + """ + + self._service = service diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path.py new file mode 100644 index 0000000000000000000000000000000000000000..a522aed2a66c61eea616d528ea089d0fab9ccf34 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path.py @@ -0,0 +1,204 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_forwarding_direction import TapiCommonForwardingDirection # noqa: F401,E501 +from tapi_server.models.tapi_common_global_class import TapiCommonGlobalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_routing_constraint import TapiPathComputationRoutingConstraint # noqa: F401,E501 +from tapi_server.models.tapi_topology_link_ref import TapiTopologyLinkRef # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationPath(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: List[TapiCommonNameAndValue]=None, uuid: str=None, layer_protocol_name: TapiCommonLayerProtocolName=None, link: List[TapiTopologyLinkRef]=None, routing_constraint: TapiPathComputationRoutingConstraint=None, direction: TapiCommonForwardingDirection=None): # noqa: E501 + """TapiPathComputationPath - a model defined in Swagger + + :param name: The name of this TapiPathComputationPath. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param uuid: The uuid of this TapiPathComputationPath. # noqa: E501 + :type uuid: str + :param layer_protocol_name: The layer_protocol_name of this TapiPathComputationPath. # noqa: E501 + :type layer_protocol_name: TapiCommonLayerProtocolName + :param link: The link of this TapiPathComputationPath. # noqa: E501 + :type link: List[TapiTopologyLinkRef] + :param routing_constraint: The routing_constraint of this TapiPathComputationPath. # noqa: E501 + :type routing_constraint: TapiPathComputationRoutingConstraint + :param direction: The direction of this TapiPathComputationPath. # noqa: E501 + :type direction: TapiCommonForwardingDirection + """ + self.swagger_types = { + 'name': List[TapiCommonNameAndValue], + 'uuid': str, + 'layer_protocol_name': TapiCommonLayerProtocolName, + 'link': List[TapiTopologyLinkRef], + 'routing_constraint': TapiPathComputationRoutingConstraint, + 'direction': TapiCommonForwardingDirection + } + + self.attribute_map = { + 'name': 'name', + 'uuid': 'uuid', + 'layer_protocol_name': 'layer-protocol-name', + 'link': 'link', + 'routing_constraint': 'routing-constraint', + 'direction': 'direction' + } + self._name = name + self._uuid = uuid + self._layer_protocol_name = layer_protocol_name + self._link = link + self._routing_constraint = routing_constraint + self._direction = direction + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationPath': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.Path of this TapiPathComputationPath. # noqa: E501 + :rtype: TapiPathComputationPath + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiPathComputationPath. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiPathComputationPath. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiPathComputationPath. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiPathComputationPath. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def uuid(self) -> str: + """Gets the uuid of this TapiPathComputationPath. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :return: The uuid of this TapiPathComputationPath. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid: str): + """Sets the uuid of this TapiPathComputationPath. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :param uuid: The uuid of this TapiPathComputationPath. + :type uuid: str + """ + + self._uuid = uuid + + @property + def layer_protocol_name(self) -> TapiCommonLayerProtocolName: + """Gets the layer_protocol_name of this TapiPathComputationPath. + + + :return: The layer_protocol_name of this TapiPathComputationPath. + :rtype: TapiCommonLayerProtocolName + """ + return self._layer_protocol_name + + @layer_protocol_name.setter + def layer_protocol_name(self, layer_protocol_name: TapiCommonLayerProtocolName): + """Sets the layer_protocol_name of this TapiPathComputationPath. + + + :param layer_protocol_name: The layer_protocol_name of this TapiPathComputationPath. + :type layer_protocol_name: TapiCommonLayerProtocolName + """ + + self._layer_protocol_name = layer_protocol_name + + @property + def link(self) -> List[TapiTopologyLinkRef]: + """Gets the link of this TapiPathComputationPath. + + none # noqa: E501 + + :return: The link of this TapiPathComputationPath. + :rtype: List[TapiTopologyLinkRef] + """ + return self._link + + @link.setter + def link(self, link: List[TapiTopologyLinkRef]): + """Sets the link of this TapiPathComputationPath. + + none # noqa: E501 + + :param link: The link of this TapiPathComputationPath. + :type link: List[TapiTopologyLinkRef] + """ + + self._link = link + + @property + def routing_constraint(self) -> TapiPathComputationRoutingConstraint: + """Gets the routing_constraint of this TapiPathComputationPath. + + + :return: The routing_constraint of this TapiPathComputationPath. + :rtype: TapiPathComputationRoutingConstraint + """ + return self._routing_constraint + + @routing_constraint.setter + def routing_constraint(self, routing_constraint: TapiPathComputationRoutingConstraint): + """Sets the routing_constraint of this TapiPathComputationPath. + + + :param routing_constraint: The routing_constraint of this TapiPathComputationPath. + :type routing_constraint: TapiPathComputationRoutingConstraint + """ + + self._routing_constraint = routing_constraint + + @property + def direction(self) -> TapiCommonForwardingDirection: + """Gets the direction of this TapiPathComputationPath. + + + :return: The direction of this TapiPathComputationPath. + :rtype: TapiCommonForwardingDirection + """ + return self._direction + + @direction.setter + def direction(self, direction: TapiCommonForwardingDirection): + """Sets the direction of this TapiPathComputationPath. + + + :param direction: The direction of this TapiPathComputationPath. + :type direction: TapiCommonForwardingDirection + """ + + self._direction = direction diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_computation_context.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_computation_context.py new file mode 100644 index 0000000000000000000000000000000000000000..7a1b72f7947633a822a77c41a6cb2b271f4ae536 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_computation_context.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_path import TapiPathComputationPath # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_path_computation_service import TapiPathComputationPathComputationService # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationPathComputationContext(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, path_comp_service: List[TapiPathComputationPathComputationService]=None, path: List[TapiPathComputationPath]=None): # noqa: E501 + """TapiPathComputationPathComputationContext - a model defined in Swagger + + :param path_comp_service: The path_comp_service of this TapiPathComputationPathComputationContext. # noqa: E501 + :type path_comp_service: List[TapiPathComputationPathComputationService] + :param path: The path of this TapiPathComputationPathComputationContext. # noqa: E501 + :type path: List[TapiPathComputationPath] + """ + self.swagger_types = { + 'path_comp_service': List[TapiPathComputationPathComputationService], + 'path': List[TapiPathComputationPath] + } + + self.attribute_map = { + 'path_comp_service': 'path-comp-service', + 'path': 'path' + } + self._path_comp_service = path_comp_service + self._path = path + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationPathComputationContext': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.PathComputationContext of this TapiPathComputationPathComputationContext. # noqa: E501 + :rtype: TapiPathComputationPathComputationContext + """ + return util.deserialize_model(dikt, cls) + + @property + def path_comp_service(self) -> List[TapiPathComputationPathComputationService]: + """Gets the path_comp_service of this TapiPathComputationPathComputationContext. + + none # noqa: E501 + + :return: The path_comp_service of this TapiPathComputationPathComputationContext. + :rtype: List[TapiPathComputationPathComputationService] + """ + return self._path_comp_service + + @path_comp_service.setter + def path_comp_service(self, path_comp_service: List[TapiPathComputationPathComputationService]): + """Sets the path_comp_service of this TapiPathComputationPathComputationContext. + + none # noqa: E501 + + :param path_comp_service: The path_comp_service of this TapiPathComputationPathComputationContext. + :type path_comp_service: List[TapiPathComputationPathComputationService] + """ + + self._path_comp_service = path_comp_service + + @property + def path(self) -> List[TapiPathComputationPath]: + """Gets the path of this TapiPathComputationPathComputationContext. + + none # noqa: E501 + + :return: The path of this TapiPathComputationPathComputationContext. + :rtype: List[TapiPathComputationPath] + """ + return self._path + + @path.setter + def path(self, path: List[TapiPathComputationPath]): + """Sets the path of this TapiPathComputationPathComputationContext. + + none # noqa: E501 + + :param path: The path of this TapiPathComputationPathComputationContext. + :type path: List[TapiPathComputationPath] + """ + + self._path = path diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_computation_context_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_computation_context_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..1363e893605826a02fc4139cfebc905fde456b5d --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_computation_context_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_path_computation_context import TapiPathComputationPathComputationContext # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationPathComputationContextWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, tapi_path_computationpath_computation_context: TapiPathComputationPathComputationContext=None): # noqa: E501 + """TapiPathComputationPathComputationContextWrapper - a model defined in Swagger + + :param tapi_path_computationpath_computation_context: The tapi_path_computationpath_computation_context of this TapiPathComputationPathComputationContextWrapper. # noqa: E501 + :type tapi_path_computationpath_computation_context: TapiPathComputationPathComputationContext + """ + self.swagger_types = { + 'tapi_path_computationpath_computation_context': TapiPathComputationPathComputationContext + } + + self.attribute_map = { + 'tapi_path_computationpath_computation_context': 'tapi-path-computation:path-computation-context' + } + self._tapi_path_computationpath_computation_context = tapi_path_computationpath_computation_context + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationPathComputationContextWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.PathComputationContextWrapper of this TapiPathComputationPathComputationContextWrapper. # noqa: E501 + :rtype: TapiPathComputationPathComputationContextWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def tapi_path_computationpath_computation_context(self) -> TapiPathComputationPathComputationContext: + """Gets the tapi_path_computationpath_computation_context of this TapiPathComputationPathComputationContextWrapper. + + + :return: The tapi_path_computationpath_computation_context of this TapiPathComputationPathComputationContextWrapper. + :rtype: TapiPathComputationPathComputationContext + """ + return self._tapi_path_computationpath_computation_context + + @tapi_path_computationpath_computation_context.setter + def tapi_path_computationpath_computation_context(self, tapi_path_computationpath_computation_context: TapiPathComputationPathComputationContext): + """Sets the tapi_path_computationpath_computation_context of this TapiPathComputationPathComputationContextWrapper. + + + :param tapi_path_computationpath_computation_context: The tapi_path_computationpath_computation_context of this TapiPathComputationPathComputationContextWrapper. + :type tapi_path_computationpath_computation_context: TapiPathComputationPathComputationContext + """ + + self._tapi_path_computationpath_computation_context = tapi_path_computationpath_computation_context diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_computation_service.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_computation_service.py new file mode 100644 index 0000000000000000000000000000000000000000..f940cab7e89979fbb631a66e164f9ca1525cc179 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_computation_service.py @@ -0,0 +1,260 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_global_class import TapiCommonGlobalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_path_objective_function import TapiPathComputationPathObjectiveFunction # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_path_optimization_constraint import TapiPathComputationPathOptimizationConstraint # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_path_ref import TapiPathComputationPathRef # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_path_service_end_point import TapiPathComputationPathServiceEndPoint # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_routing_constraint import TapiPathComputationRoutingConstraint # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_topology_constraint import TapiPathComputationTopologyConstraint # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationPathComputationService(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: List[TapiCommonNameAndValue]=None, uuid: str=None, topology_constraint: TapiPathComputationTopologyConstraint=None, path: List[TapiPathComputationPathRef]=None, objective_function: TapiPathComputationPathObjectiveFunction=None, end_point: List[TapiPathComputationPathServiceEndPoint]=None, routing_constraint: TapiPathComputationRoutingConstraint=None, optimization_constraint: TapiPathComputationPathOptimizationConstraint=None): # noqa: E501 + """TapiPathComputationPathComputationService - a model defined in Swagger + + :param name: The name of this TapiPathComputationPathComputationService. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param uuid: The uuid of this TapiPathComputationPathComputationService. # noqa: E501 + :type uuid: str + :param topology_constraint: The topology_constraint of this TapiPathComputationPathComputationService. # noqa: E501 + :type topology_constraint: TapiPathComputationTopologyConstraint + :param path: The path of this TapiPathComputationPathComputationService. # noqa: E501 + :type path: List[TapiPathComputationPathRef] + :param objective_function: The objective_function of this TapiPathComputationPathComputationService. # noqa: E501 + :type objective_function: TapiPathComputationPathObjectiveFunction + :param end_point: The end_point of this TapiPathComputationPathComputationService. # noqa: E501 + :type end_point: List[TapiPathComputationPathServiceEndPoint] + :param routing_constraint: The routing_constraint of this TapiPathComputationPathComputationService. # noqa: E501 + :type routing_constraint: TapiPathComputationRoutingConstraint + :param optimization_constraint: The optimization_constraint of this TapiPathComputationPathComputationService. # noqa: E501 + :type optimization_constraint: TapiPathComputationPathOptimizationConstraint + """ + self.swagger_types = { + 'name': List[TapiCommonNameAndValue], + 'uuid': str, + 'topology_constraint': TapiPathComputationTopologyConstraint, + 'path': List[TapiPathComputationPathRef], + 'objective_function': TapiPathComputationPathObjectiveFunction, + 'end_point': List[TapiPathComputationPathServiceEndPoint], + 'routing_constraint': TapiPathComputationRoutingConstraint, + 'optimization_constraint': TapiPathComputationPathOptimizationConstraint + } + + self.attribute_map = { + 'name': 'name', + 'uuid': 'uuid', + 'topology_constraint': 'topology-constraint', + 'path': 'path', + 'objective_function': 'objective-function', + 'end_point': 'end-point', + 'routing_constraint': 'routing-constraint', + 'optimization_constraint': 'optimization-constraint' + } + self._name = name + self._uuid = uuid + self._topology_constraint = topology_constraint + self._path = path + self._objective_function = objective_function + self._end_point = end_point + self._routing_constraint = routing_constraint + self._optimization_constraint = optimization_constraint + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationPathComputationService': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.PathComputationService of this TapiPathComputationPathComputationService. # noqa: E501 + :rtype: TapiPathComputationPathComputationService + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiPathComputationPathComputationService. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiPathComputationPathComputationService. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiPathComputationPathComputationService. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiPathComputationPathComputationService. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def uuid(self) -> str: + """Gets the uuid of this TapiPathComputationPathComputationService. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :return: The uuid of this TapiPathComputationPathComputationService. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid: str): + """Sets the uuid of this TapiPathComputationPathComputationService. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :param uuid: The uuid of this TapiPathComputationPathComputationService. + :type uuid: str + """ + + self._uuid = uuid + + @property + def topology_constraint(self) -> TapiPathComputationTopologyConstraint: + """Gets the topology_constraint of this TapiPathComputationPathComputationService. + + + :return: The topology_constraint of this TapiPathComputationPathComputationService. + :rtype: TapiPathComputationTopologyConstraint + """ + return self._topology_constraint + + @topology_constraint.setter + def topology_constraint(self, topology_constraint: TapiPathComputationTopologyConstraint): + """Sets the topology_constraint of this TapiPathComputationPathComputationService. + + + :param topology_constraint: The topology_constraint of this TapiPathComputationPathComputationService. + :type topology_constraint: TapiPathComputationTopologyConstraint + """ + + self._topology_constraint = topology_constraint + + @property + def path(self) -> List[TapiPathComputationPathRef]: + """Gets the path of this TapiPathComputationPathComputationService. + + none # noqa: E501 + + :return: The path of this TapiPathComputationPathComputationService. + :rtype: List[TapiPathComputationPathRef] + """ + return self._path + + @path.setter + def path(self, path: List[TapiPathComputationPathRef]): + """Sets the path of this TapiPathComputationPathComputationService. + + none # noqa: E501 + + :param path: The path of this TapiPathComputationPathComputationService. + :type path: List[TapiPathComputationPathRef] + """ + + self._path = path + + @property + def objective_function(self) -> TapiPathComputationPathObjectiveFunction: + """Gets the objective_function of this TapiPathComputationPathComputationService. + + + :return: The objective_function of this TapiPathComputationPathComputationService. + :rtype: TapiPathComputationPathObjectiveFunction + """ + return self._objective_function + + @objective_function.setter + def objective_function(self, objective_function: TapiPathComputationPathObjectiveFunction): + """Sets the objective_function of this TapiPathComputationPathComputationService. + + + :param objective_function: The objective_function of this TapiPathComputationPathComputationService. + :type objective_function: TapiPathComputationPathObjectiveFunction + """ + + self._objective_function = objective_function + + @property + def end_point(self) -> List[TapiPathComputationPathServiceEndPoint]: + """Gets the end_point of this TapiPathComputationPathComputationService. + + none # noqa: E501 + + :return: The end_point of this TapiPathComputationPathComputationService. + :rtype: List[TapiPathComputationPathServiceEndPoint] + """ + return self._end_point + + @end_point.setter + def end_point(self, end_point: List[TapiPathComputationPathServiceEndPoint]): + """Sets the end_point of this TapiPathComputationPathComputationService. + + none # noqa: E501 + + :param end_point: The end_point of this TapiPathComputationPathComputationService. + :type end_point: List[TapiPathComputationPathServiceEndPoint] + """ + + self._end_point = end_point + + @property + def routing_constraint(self) -> TapiPathComputationRoutingConstraint: + """Gets the routing_constraint of this TapiPathComputationPathComputationService. + + + :return: The routing_constraint of this TapiPathComputationPathComputationService. + :rtype: TapiPathComputationRoutingConstraint + """ + return self._routing_constraint + + @routing_constraint.setter + def routing_constraint(self, routing_constraint: TapiPathComputationRoutingConstraint): + """Sets the routing_constraint of this TapiPathComputationPathComputationService. + + + :param routing_constraint: The routing_constraint of this TapiPathComputationPathComputationService. + :type routing_constraint: TapiPathComputationRoutingConstraint + """ + + self._routing_constraint = routing_constraint + + @property + def optimization_constraint(self) -> TapiPathComputationPathOptimizationConstraint: + """Gets the optimization_constraint of this TapiPathComputationPathComputationService. + + + :return: The optimization_constraint of this TapiPathComputationPathComputationService. + :rtype: TapiPathComputationPathOptimizationConstraint + """ + return self._optimization_constraint + + @optimization_constraint.setter + def optimization_constraint(self, optimization_constraint: TapiPathComputationPathOptimizationConstraint): + """Sets the optimization_constraint of this TapiPathComputationPathComputationService. + + + :param optimization_constraint: The optimization_constraint of this TapiPathComputationPathComputationService. + :type optimization_constraint: TapiPathComputationPathOptimizationConstraint + """ + + self._optimization_constraint = optimization_constraint diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_computation_service_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_computation_service_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..0f6457979d7c102c2c5e0e5003469eb4d06d407a --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_computation_service_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_path_computation_service import TapiPathComputationPathComputationService # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationPathComputationServiceWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, path_comp_service: TapiPathComputationPathComputationService=None): # noqa: E501 + """TapiPathComputationPathComputationServiceWrapper - a model defined in Swagger + + :param path_comp_service: The path_comp_service of this TapiPathComputationPathComputationServiceWrapper. # noqa: E501 + :type path_comp_service: TapiPathComputationPathComputationService + """ + self.swagger_types = { + 'path_comp_service': TapiPathComputationPathComputationService + } + + self.attribute_map = { + 'path_comp_service': 'path-comp-service' + } + self._path_comp_service = path_comp_service + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationPathComputationServiceWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.PathComputationServiceWrapper of this TapiPathComputationPathComputationServiceWrapper. # noqa: E501 + :rtype: TapiPathComputationPathComputationServiceWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def path_comp_service(self) -> TapiPathComputationPathComputationService: + """Gets the path_comp_service of this TapiPathComputationPathComputationServiceWrapper. + + + :return: The path_comp_service of this TapiPathComputationPathComputationServiceWrapper. + :rtype: TapiPathComputationPathComputationService + """ + return self._path_comp_service + + @path_comp_service.setter + def path_comp_service(self, path_comp_service: TapiPathComputationPathComputationService): + """Sets the path_comp_service of this TapiPathComputationPathComputationServiceWrapper. + + + :param path_comp_service: The path_comp_service of this TapiPathComputationPathComputationServiceWrapper. + :type path_comp_service: TapiPathComputationPathComputationService + """ + + self._path_comp_service = path_comp_service diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_objective_function.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_objective_function.py new file mode 100644 index 0000000000000000000000000000000000000000..4b6262b176ff0063a10996d08c332b325a7bf64d --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_objective_function.py @@ -0,0 +1,225 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_directive_value import TapiCommonDirectiveValue # noqa: F401,E501 +from tapi_server.models.tapi_common_local_class import TapiCommonLocalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationPathObjectiveFunction(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: List[TapiCommonNameAndValue]=None, local_id: str=None, link_utilization: TapiCommonDirectiveValue=None, bandwidth_optimization: TapiCommonDirectiveValue=None, cost_optimization: TapiCommonDirectiveValue=None, resource_sharing: TapiCommonDirectiveValue=None, concurrent_paths: TapiCommonDirectiveValue=None): # noqa: E501 + """TapiPathComputationPathObjectiveFunction - a model defined in Swagger + + :param name: The name of this TapiPathComputationPathObjectiveFunction. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param local_id: The local_id of this TapiPathComputationPathObjectiveFunction. # noqa: E501 + :type local_id: str + :param link_utilization: The link_utilization of this TapiPathComputationPathObjectiveFunction. # noqa: E501 + :type link_utilization: TapiCommonDirectiveValue + :param bandwidth_optimization: The bandwidth_optimization of this TapiPathComputationPathObjectiveFunction. # noqa: E501 + :type bandwidth_optimization: TapiCommonDirectiveValue + :param cost_optimization: The cost_optimization of this TapiPathComputationPathObjectiveFunction. # noqa: E501 + :type cost_optimization: TapiCommonDirectiveValue + :param resource_sharing: The resource_sharing of this TapiPathComputationPathObjectiveFunction. # noqa: E501 + :type resource_sharing: TapiCommonDirectiveValue + :param concurrent_paths: The concurrent_paths of this TapiPathComputationPathObjectiveFunction. # noqa: E501 + :type concurrent_paths: TapiCommonDirectiveValue + """ + self.swagger_types = { + 'name': List[TapiCommonNameAndValue], + 'local_id': str, + 'link_utilization': TapiCommonDirectiveValue, + 'bandwidth_optimization': TapiCommonDirectiveValue, + 'cost_optimization': TapiCommonDirectiveValue, + 'resource_sharing': TapiCommonDirectiveValue, + 'concurrent_paths': TapiCommonDirectiveValue + } + + self.attribute_map = { + 'name': 'name', + 'local_id': 'local-id', + 'link_utilization': 'link-utilization', + 'bandwidth_optimization': 'bandwidth-optimization', + 'cost_optimization': 'cost-optimization', + 'resource_sharing': 'resource-sharing', + 'concurrent_paths': 'concurrent-paths' + } + self._name = name + self._local_id = local_id + self._link_utilization = link_utilization + self._bandwidth_optimization = bandwidth_optimization + self._cost_optimization = cost_optimization + self._resource_sharing = resource_sharing + self._concurrent_paths = concurrent_paths + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationPathObjectiveFunction': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.PathObjectiveFunction of this TapiPathComputationPathObjectiveFunction. # noqa: E501 + :rtype: TapiPathComputationPathObjectiveFunction + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiPathComputationPathObjectiveFunction. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiPathComputationPathObjectiveFunction. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiPathComputationPathObjectiveFunction. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiPathComputationPathObjectiveFunction. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def local_id(self) -> str: + """Gets the local_id of this TapiPathComputationPathObjectiveFunction. + + none # noqa: E501 + + :return: The local_id of this TapiPathComputationPathObjectiveFunction. + :rtype: str + """ + return self._local_id + + @local_id.setter + def local_id(self, local_id: str): + """Sets the local_id of this TapiPathComputationPathObjectiveFunction. + + none # noqa: E501 + + :param local_id: The local_id of this TapiPathComputationPathObjectiveFunction. + :type local_id: str + """ + + self._local_id = local_id + + @property + def link_utilization(self) -> TapiCommonDirectiveValue: + """Gets the link_utilization of this TapiPathComputationPathObjectiveFunction. + + + :return: The link_utilization of this TapiPathComputationPathObjectiveFunction. + :rtype: TapiCommonDirectiveValue + """ + return self._link_utilization + + @link_utilization.setter + def link_utilization(self, link_utilization: TapiCommonDirectiveValue): + """Sets the link_utilization of this TapiPathComputationPathObjectiveFunction. + + + :param link_utilization: The link_utilization of this TapiPathComputationPathObjectiveFunction. + :type link_utilization: TapiCommonDirectiveValue + """ + + self._link_utilization = link_utilization + + @property + def bandwidth_optimization(self) -> TapiCommonDirectiveValue: + """Gets the bandwidth_optimization of this TapiPathComputationPathObjectiveFunction. + + + :return: The bandwidth_optimization of this TapiPathComputationPathObjectiveFunction. + :rtype: TapiCommonDirectiveValue + """ + return self._bandwidth_optimization + + @bandwidth_optimization.setter + def bandwidth_optimization(self, bandwidth_optimization: TapiCommonDirectiveValue): + """Sets the bandwidth_optimization of this TapiPathComputationPathObjectiveFunction. + + + :param bandwidth_optimization: The bandwidth_optimization of this TapiPathComputationPathObjectiveFunction. + :type bandwidth_optimization: TapiCommonDirectiveValue + """ + + self._bandwidth_optimization = bandwidth_optimization + + @property + def cost_optimization(self) -> TapiCommonDirectiveValue: + """Gets the cost_optimization of this TapiPathComputationPathObjectiveFunction. + + + :return: The cost_optimization of this TapiPathComputationPathObjectiveFunction. + :rtype: TapiCommonDirectiveValue + """ + return self._cost_optimization + + @cost_optimization.setter + def cost_optimization(self, cost_optimization: TapiCommonDirectiveValue): + """Sets the cost_optimization of this TapiPathComputationPathObjectiveFunction. + + + :param cost_optimization: The cost_optimization of this TapiPathComputationPathObjectiveFunction. + :type cost_optimization: TapiCommonDirectiveValue + """ + + self._cost_optimization = cost_optimization + + @property + def resource_sharing(self) -> TapiCommonDirectiveValue: + """Gets the resource_sharing of this TapiPathComputationPathObjectiveFunction. + + + :return: The resource_sharing of this TapiPathComputationPathObjectiveFunction. + :rtype: TapiCommonDirectiveValue + """ + return self._resource_sharing + + @resource_sharing.setter + def resource_sharing(self, resource_sharing: TapiCommonDirectiveValue): + """Sets the resource_sharing of this TapiPathComputationPathObjectiveFunction. + + + :param resource_sharing: The resource_sharing of this TapiPathComputationPathObjectiveFunction. + :type resource_sharing: TapiCommonDirectiveValue + """ + + self._resource_sharing = resource_sharing + + @property + def concurrent_paths(self) -> TapiCommonDirectiveValue: + """Gets the concurrent_paths of this TapiPathComputationPathObjectiveFunction. + + + :return: The concurrent_paths of this TapiPathComputationPathObjectiveFunction. + :rtype: TapiCommonDirectiveValue + """ + return self._concurrent_paths + + @concurrent_paths.setter + def concurrent_paths(self, concurrent_paths: TapiCommonDirectiveValue): + """Sets the concurrent_paths of this TapiPathComputationPathObjectiveFunction. + + + :param concurrent_paths: The concurrent_paths of this TapiPathComputationPathObjectiveFunction. + :type concurrent_paths: TapiCommonDirectiveValue + """ + + self._concurrent_paths = concurrent_paths diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_objective_function_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_objective_function_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..789ba09af03b210a9ddd3486f25fcdb62bd12c08 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_objective_function_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_path_objective_function import TapiPathComputationPathObjectiveFunction # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationPathObjectiveFunctionWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, objective_function: TapiPathComputationPathObjectiveFunction=None): # noqa: E501 + """TapiPathComputationPathObjectiveFunctionWrapper - a model defined in Swagger + + :param objective_function: The objective_function of this TapiPathComputationPathObjectiveFunctionWrapper. # noqa: E501 + :type objective_function: TapiPathComputationPathObjectiveFunction + """ + self.swagger_types = { + 'objective_function': TapiPathComputationPathObjectiveFunction + } + + self.attribute_map = { + 'objective_function': 'objective-function' + } + self._objective_function = objective_function + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationPathObjectiveFunctionWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.PathObjectiveFunctionWrapper of this TapiPathComputationPathObjectiveFunctionWrapper. # noqa: E501 + :rtype: TapiPathComputationPathObjectiveFunctionWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def objective_function(self) -> TapiPathComputationPathObjectiveFunction: + """Gets the objective_function of this TapiPathComputationPathObjectiveFunctionWrapper. + + + :return: The objective_function of this TapiPathComputationPathObjectiveFunctionWrapper. + :rtype: TapiPathComputationPathObjectiveFunction + """ + return self._objective_function + + @objective_function.setter + def objective_function(self, objective_function: TapiPathComputationPathObjectiveFunction): + """Sets the objective_function of this TapiPathComputationPathObjectiveFunctionWrapper. + + + :param objective_function: The objective_function of this TapiPathComputationPathObjectiveFunctionWrapper. + :type objective_function: TapiPathComputationPathObjectiveFunction + """ + + self._objective_function = objective_function diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_optimization_constraint.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_optimization_constraint.py new file mode 100644 index 0000000000000000000000000000000000000000..4de4ec31cc47493696f8abaf7dd86359336c6b4a --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_optimization_constraint.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_directive_value import TapiCommonDirectiveValue # noqa: F401,E501 +from tapi_server.models.tapi_common_local_class import TapiCommonLocalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationPathOptimizationConstraint(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: List[TapiCommonNameAndValue]=None, local_id: str=None, traffic_interruption: TapiCommonDirectiveValue=None): # noqa: E501 + """TapiPathComputationPathOptimizationConstraint - a model defined in Swagger + + :param name: The name of this TapiPathComputationPathOptimizationConstraint. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param local_id: The local_id of this TapiPathComputationPathOptimizationConstraint. # noqa: E501 + :type local_id: str + :param traffic_interruption: The traffic_interruption of this TapiPathComputationPathOptimizationConstraint. # noqa: E501 + :type traffic_interruption: TapiCommonDirectiveValue + """ + self.swagger_types = { + 'name': List[TapiCommonNameAndValue], + 'local_id': str, + 'traffic_interruption': TapiCommonDirectiveValue + } + + self.attribute_map = { + 'name': 'name', + 'local_id': 'local-id', + 'traffic_interruption': 'traffic-interruption' + } + self._name = name + self._local_id = local_id + self._traffic_interruption = traffic_interruption + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationPathOptimizationConstraint': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.PathOptimizationConstraint of this TapiPathComputationPathOptimizationConstraint. # noqa: E501 + :rtype: TapiPathComputationPathOptimizationConstraint + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiPathComputationPathOptimizationConstraint. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiPathComputationPathOptimizationConstraint. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiPathComputationPathOptimizationConstraint. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiPathComputationPathOptimizationConstraint. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def local_id(self) -> str: + """Gets the local_id of this TapiPathComputationPathOptimizationConstraint. + + none # noqa: E501 + + :return: The local_id of this TapiPathComputationPathOptimizationConstraint. + :rtype: str + """ + return self._local_id + + @local_id.setter + def local_id(self, local_id: str): + """Sets the local_id of this TapiPathComputationPathOptimizationConstraint. + + none # noqa: E501 + + :param local_id: The local_id of this TapiPathComputationPathOptimizationConstraint. + :type local_id: str + """ + + self._local_id = local_id + + @property + def traffic_interruption(self) -> TapiCommonDirectiveValue: + """Gets the traffic_interruption of this TapiPathComputationPathOptimizationConstraint. + + + :return: The traffic_interruption of this TapiPathComputationPathOptimizationConstraint. + :rtype: TapiCommonDirectiveValue + """ + return self._traffic_interruption + + @traffic_interruption.setter + def traffic_interruption(self, traffic_interruption: TapiCommonDirectiveValue): + """Sets the traffic_interruption of this TapiPathComputationPathOptimizationConstraint. + + + :param traffic_interruption: The traffic_interruption of this TapiPathComputationPathOptimizationConstraint. + :type traffic_interruption: TapiCommonDirectiveValue + """ + + self._traffic_interruption = traffic_interruption diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_optimization_constraint_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_optimization_constraint_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..006f1b27bdd42ef3f82f0a96dd2a5d6fd522dd5d --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_optimization_constraint_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_path_optimization_constraint import TapiPathComputationPathOptimizationConstraint # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationPathOptimizationConstraintWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, optimization_constraint: TapiPathComputationPathOptimizationConstraint=None): # noqa: E501 + """TapiPathComputationPathOptimizationConstraintWrapper - a model defined in Swagger + + :param optimization_constraint: The optimization_constraint of this TapiPathComputationPathOptimizationConstraintWrapper. # noqa: E501 + :type optimization_constraint: TapiPathComputationPathOptimizationConstraint + """ + self.swagger_types = { + 'optimization_constraint': TapiPathComputationPathOptimizationConstraint + } + + self.attribute_map = { + 'optimization_constraint': 'optimization-constraint' + } + self._optimization_constraint = optimization_constraint + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationPathOptimizationConstraintWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.PathOptimizationConstraintWrapper of this TapiPathComputationPathOptimizationConstraintWrapper. # noqa: E501 + :rtype: TapiPathComputationPathOptimizationConstraintWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def optimization_constraint(self) -> TapiPathComputationPathOptimizationConstraint: + """Gets the optimization_constraint of this TapiPathComputationPathOptimizationConstraintWrapper. + + + :return: The optimization_constraint of this TapiPathComputationPathOptimizationConstraintWrapper. + :rtype: TapiPathComputationPathOptimizationConstraint + """ + return self._optimization_constraint + + @optimization_constraint.setter + def optimization_constraint(self, optimization_constraint: TapiPathComputationPathOptimizationConstraint): + """Sets the optimization_constraint of this TapiPathComputationPathOptimizationConstraintWrapper. + + + :param optimization_constraint: The optimization_constraint of this TapiPathComputationPathOptimizationConstraintWrapper. + :type optimization_constraint: TapiPathComputationPathOptimizationConstraint + """ + + self._optimization_constraint = optimization_constraint diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_ref.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_ref.py new file mode 100644 index 0000000000000000000000000000000000000000..4ce08ac953777c972d033cad916ee3f61eed8001 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_ref.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiPathComputationPathRef(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, path_uuid: str=None): # noqa: E501 + """TapiPathComputationPathRef - a model defined in Swagger + + :param path_uuid: The path_uuid of this TapiPathComputationPathRef. # noqa: E501 + :type path_uuid: str + """ + self.swagger_types = { + 'path_uuid': str + } + + self.attribute_map = { + 'path_uuid': 'path-uuid' + } + self._path_uuid = path_uuid + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationPathRef': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.PathRef of this TapiPathComputationPathRef. # noqa: E501 + :rtype: TapiPathComputationPathRef + """ + return util.deserialize_model(dikt, cls) + + @property + def path_uuid(self) -> str: + """Gets the path_uuid of this TapiPathComputationPathRef. + + none # noqa: E501 + + :return: The path_uuid of this TapiPathComputationPathRef. + :rtype: str + """ + return self._path_uuid + + @path_uuid.setter + def path_uuid(self, path_uuid: str): + """Sets the path_uuid of this TapiPathComputationPathRef. + + none # noqa: E501 + + :param path_uuid: The path_uuid of this TapiPathComputationPathRef. + :type path_uuid: str + """ + + self._path_uuid = path_uuid diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_ref_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_ref_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..95abec7140eef27ede5e523a6d9db298a6f5952d --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_ref_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_path_ref import TapiPathComputationPathRef # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationPathRefWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, path: TapiPathComputationPathRef=None): # noqa: E501 + """TapiPathComputationPathRefWrapper - a model defined in Swagger + + :param path: The path of this TapiPathComputationPathRefWrapper. # noqa: E501 + :type path: TapiPathComputationPathRef + """ + self.swagger_types = { + 'path': TapiPathComputationPathRef + } + + self.attribute_map = { + 'path': 'path' + } + self._path = path + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationPathRefWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.PathRefWrapper of this TapiPathComputationPathRefWrapper. # noqa: E501 + :rtype: TapiPathComputationPathRefWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def path(self) -> TapiPathComputationPathRef: + """Gets the path of this TapiPathComputationPathRefWrapper. + + + :return: The path of this TapiPathComputationPathRefWrapper. + :rtype: TapiPathComputationPathRef + """ + return self._path + + @path.setter + def path(self, path: TapiPathComputationPathRef): + """Sets the path of this TapiPathComputationPathRefWrapper. + + + :param path: The path of this TapiPathComputationPathRefWrapper. + :type path: TapiPathComputationPathRef + """ + + self._path = path diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_service_end_point.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_service_end_point.py new file mode 100644 index 0000000000000000000000000000000000000000..7db4a9374c1b8f1b9648613e43cc47edbb0c0c41 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_service_end_point.py @@ -0,0 +1,257 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_capacity import TapiCommonCapacity # noqa: F401,E501 +from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501 +from tapi_server.models.tapi_common_local_class import TapiCommonLocalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_common_port_direction import TapiCommonPortDirection # noqa: F401,E501 +from tapi_server.models.tapi_common_port_role import TapiCommonPortRole # noqa: F401,E501 +from tapi_server.models.tapi_common_service_interface_point_ref import TapiCommonServiceInterfacePointRef # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationPathServiceEndPoint(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: List[TapiCommonNameAndValue]=None, local_id: str=None, role: TapiCommonPortRole=None, service_interface_point: TapiCommonServiceInterfacePointRef=None, layer_protocol_name: TapiCommonLayerProtocolName=None, layer_protocol_qualifier: str=None, direction: TapiCommonPortDirection=None, capacity: TapiCommonCapacity=None): # noqa: E501 + """TapiPathComputationPathServiceEndPoint - a model defined in Swagger + + :param name: The name of this TapiPathComputationPathServiceEndPoint. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param local_id: The local_id of this TapiPathComputationPathServiceEndPoint. # noqa: E501 + :type local_id: str + :param role: The role of this TapiPathComputationPathServiceEndPoint. # noqa: E501 + :type role: TapiCommonPortRole + :param service_interface_point: The service_interface_point of this TapiPathComputationPathServiceEndPoint. # noqa: E501 + :type service_interface_point: TapiCommonServiceInterfacePointRef + :param layer_protocol_name: The layer_protocol_name of this TapiPathComputationPathServiceEndPoint. # noqa: E501 + :type layer_protocol_name: TapiCommonLayerProtocolName + :param layer_protocol_qualifier: The layer_protocol_qualifier of this TapiPathComputationPathServiceEndPoint. # noqa: E501 + :type layer_protocol_qualifier: str + :param direction: The direction of this TapiPathComputationPathServiceEndPoint. # noqa: E501 + :type direction: TapiCommonPortDirection + :param capacity: The capacity of this TapiPathComputationPathServiceEndPoint. # noqa: E501 + :type capacity: TapiCommonCapacity + """ + self.swagger_types = { + 'name': List[TapiCommonNameAndValue], + 'local_id': str, + 'role': TapiCommonPortRole, + 'service_interface_point': TapiCommonServiceInterfacePointRef, + 'layer_protocol_name': TapiCommonLayerProtocolName, + 'layer_protocol_qualifier': str, + 'direction': TapiCommonPortDirection, + 'capacity': TapiCommonCapacity + } + + self.attribute_map = { + 'name': 'name', + 'local_id': 'local-id', + 'role': 'role', + 'service_interface_point': 'service-interface-point', + 'layer_protocol_name': 'layer-protocol-name', + 'layer_protocol_qualifier': 'layer-protocol-qualifier', + 'direction': 'direction', + 'capacity': 'capacity' + } + self._name = name + self._local_id = local_id + self._role = role + self._service_interface_point = service_interface_point + self._layer_protocol_name = layer_protocol_name + self._layer_protocol_qualifier = layer_protocol_qualifier + self._direction = direction + self._capacity = capacity + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationPathServiceEndPoint': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.PathServiceEndPoint of this TapiPathComputationPathServiceEndPoint. # noqa: E501 + :rtype: TapiPathComputationPathServiceEndPoint + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiPathComputationPathServiceEndPoint. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiPathComputationPathServiceEndPoint. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiPathComputationPathServiceEndPoint. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiPathComputationPathServiceEndPoint. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def local_id(self) -> str: + """Gets the local_id of this TapiPathComputationPathServiceEndPoint. + + none # noqa: E501 + + :return: The local_id of this TapiPathComputationPathServiceEndPoint. + :rtype: str + """ + return self._local_id + + @local_id.setter + def local_id(self, local_id: str): + """Sets the local_id of this TapiPathComputationPathServiceEndPoint. + + none # noqa: E501 + + :param local_id: The local_id of this TapiPathComputationPathServiceEndPoint. + :type local_id: str + """ + + self._local_id = local_id + + @property + def role(self) -> TapiCommonPortRole: + """Gets the role of this TapiPathComputationPathServiceEndPoint. + + + :return: The role of this TapiPathComputationPathServiceEndPoint. + :rtype: TapiCommonPortRole + """ + return self._role + + @role.setter + def role(self, role: TapiCommonPortRole): + """Sets the role of this TapiPathComputationPathServiceEndPoint. + + + :param role: The role of this TapiPathComputationPathServiceEndPoint. + :type role: TapiCommonPortRole + """ + + self._role = role + + @property + def service_interface_point(self) -> TapiCommonServiceInterfacePointRef: + """Gets the service_interface_point of this TapiPathComputationPathServiceEndPoint. + + + :return: The service_interface_point of this TapiPathComputationPathServiceEndPoint. + :rtype: TapiCommonServiceInterfacePointRef + """ + return self._service_interface_point + + @service_interface_point.setter + def service_interface_point(self, service_interface_point: TapiCommonServiceInterfacePointRef): + """Sets the service_interface_point of this TapiPathComputationPathServiceEndPoint. + + + :param service_interface_point: The service_interface_point of this TapiPathComputationPathServiceEndPoint. + :type service_interface_point: TapiCommonServiceInterfacePointRef + """ + + self._service_interface_point = service_interface_point + + @property + def layer_protocol_name(self) -> TapiCommonLayerProtocolName: + """Gets the layer_protocol_name of this TapiPathComputationPathServiceEndPoint. + + + :return: The layer_protocol_name of this TapiPathComputationPathServiceEndPoint. + :rtype: TapiCommonLayerProtocolName + """ + return self._layer_protocol_name + + @layer_protocol_name.setter + def layer_protocol_name(self, layer_protocol_name: TapiCommonLayerProtocolName): + """Sets the layer_protocol_name of this TapiPathComputationPathServiceEndPoint. + + + :param layer_protocol_name: The layer_protocol_name of this TapiPathComputationPathServiceEndPoint. + :type layer_protocol_name: TapiCommonLayerProtocolName + """ + + self._layer_protocol_name = layer_protocol_name + + @property + def layer_protocol_qualifier(self) -> str: + """Gets the layer_protocol_qualifier of this TapiPathComputationPathServiceEndPoint. + + none # noqa: E501 + + :return: The layer_protocol_qualifier of this TapiPathComputationPathServiceEndPoint. + :rtype: str + """ + return self._layer_protocol_qualifier + + @layer_protocol_qualifier.setter + def layer_protocol_qualifier(self, layer_protocol_qualifier: str): + """Sets the layer_protocol_qualifier of this TapiPathComputationPathServiceEndPoint. + + none # noqa: E501 + + :param layer_protocol_qualifier: The layer_protocol_qualifier of this TapiPathComputationPathServiceEndPoint. + :type layer_protocol_qualifier: str + """ + + self._layer_protocol_qualifier = layer_protocol_qualifier + + @property + def direction(self) -> TapiCommonPortDirection: + """Gets the direction of this TapiPathComputationPathServiceEndPoint. + + + :return: The direction of this TapiPathComputationPathServiceEndPoint. + :rtype: TapiCommonPortDirection + """ + return self._direction + + @direction.setter + def direction(self, direction: TapiCommonPortDirection): + """Sets the direction of this TapiPathComputationPathServiceEndPoint. + + + :param direction: The direction of this TapiPathComputationPathServiceEndPoint. + :type direction: TapiCommonPortDirection + """ + + self._direction = direction + + @property + def capacity(self) -> TapiCommonCapacity: + """Gets the capacity of this TapiPathComputationPathServiceEndPoint. + + + :return: The capacity of this TapiPathComputationPathServiceEndPoint. + :rtype: TapiCommonCapacity + """ + return self._capacity + + @capacity.setter + def capacity(self, capacity: TapiCommonCapacity): + """Sets the capacity of this TapiPathComputationPathServiceEndPoint. + + + :param capacity: The capacity of this TapiPathComputationPathServiceEndPoint. + :type capacity: TapiCommonCapacity + """ + + self._capacity = capacity diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_service_end_point_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_service_end_point_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..5a342c91362908b00bef8bd32cd07fa18cc14612 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_service_end_point_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_path_service_end_point import TapiPathComputationPathServiceEndPoint # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationPathServiceEndPointWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, end_point: TapiPathComputationPathServiceEndPoint=None): # noqa: E501 + """TapiPathComputationPathServiceEndPointWrapper - a model defined in Swagger + + :param end_point: The end_point of this TapiPathComputationPathServiceEndPointWrapper. # noqa: E501 + :type end_point: TapiPathComputationPathServiceEndPoint + """ + self.swagger_types = { + 'end_point': TapiPathComputationPathServiceEndPoint + } + + self.attribute_map = { + 'end_point': 'end-point' + } + self._end_point = end_point + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationPathServiceEndPointWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.PathServiceEndPointWrapper of this TapiPathComputationPathServiceEndPointWrapper. # noqa: E501 + :rtype: TapiPathComputationPathServiceEndPointWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def end_point(self) -> TapiPathComputationPathServiceEndPoint: + """Gets the end_point of this TapiPathComputationPathServiceEndPointWrapper. + + + :return: The end_point of this TapiPathComputationPathServiceEndPointWrapper. + :rtype: TapiPathComputationPathServiceEndPoint + """ + return self._end_point + + @end_point.setter + def end_point(self, end_point: TapiPathComputationPathServiceEndPoint): + """Sets the end_point of this TapiPathComputationPathServiceEndPointWrapper. + + + :param end_point: The end_point of this TapiPathComputationPathServiceEndPointWrapper. + :type end_point: TapiPathComputationPathServiceEndPoint + """ + + self._end_point = end_point diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..8efa8661aaabb60a857c63e480138bed5b61a50f --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_path_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_path import TapiPathComputationPath # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationPathWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, path: TapiPathComputationPath=None): # noqa: E501 + """TapiPathComputationPathWrapper - a model defined in Swagger + + :param path: The path of this TapiPathComputationPathWrapper. # noqa: E501 + :type path: TapiPathComputationPath + """ + self.swagger_types = { + 'path': TapiPathComputationPath + } + + self.attribute_map = { + 'path': 'path' + } + self._path = path + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationPathWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.PathWrapper of this TapiPathComputationPathWrapper. # noqa: E501 + :rtype: TapiPathComputationPathWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def path(self) -> TapiPathComputationPath: + """Gets the path of this TapiPathComputationPathWrapper. + + + :return: The path of this TapiPathComputationPathWrapper. + :rtype: TapiPathComputationPath + """ + return self._path + + @path.setter + def path(self, path: TapiPathComputationPath): + """Sets the path of this TapiPathComputationPathWrapper. + + + :param path: The path of this TapiPathComputationPathWrapper. + :type path: TapiPathComputationPath + """ + + self._path = path diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_route_objective_function.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_route_objective_function.py new file mode 100644 index 0000000000000000000000000000000000000000..8822be5acd8cbcbfdacb7bd0cef7c8aea23dabdd --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_route_objective_function.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiPathComputationRouteObjectiveFunction(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + MIN_WORK_ROUTE_HOP = "MIN_WORK_ROUTE_HOP" + MIN_WORK_ROUTE_COST = "MIN_WORK_ROUTE_COST" + MIN_WORK_ROUTE_LATENCY = "MIN_WORK_ROUTE_LATENCY" + MIN_SUM_OF_WORK_AND_PROTECTION_ROUTE_HOP = "MIN_SUM_OF_WORK_AND_PROTECTION_ROUTE_HOP" + MIN_SUM_OF_WORK_AND_PROTECTION_ROUTE_COST = "MIN_SUM_OF_WORK_AND_PROTECTION_ROUTE_COST" + MIN_SUM_OF_WORK_AND_PROTECTION_ROUTE_LATENCY = "MIN_SUM_OF_WORK_AND_PROTECTION_ROUTE_LATENCY" + LOAD_BALANCE_MAX_UNUSED_CAPACITY = "LOAD_BALANCE_MAX_UNUSED_CAPACITY" + def __init__(self): # noqa: E501 + """TapiPathComputationRouteObjectiveFunction - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationRouteObjectiveFunction': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.RouteObjectiveFunction of this TapiPathComputationRouteObjectiveFunction. # noqa: E501 + :rtype: TapiPathComputationRouteObjectiveFunction + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_routing_constraint.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_routing_constraint.py new file mode 100644 index 0000000000000000000000000000000000000000..ac423f8899419eb94b09c5d92183ea52b8e125ea --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_routing_constraint.py @@ -0,0 +1,311 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_forwarding_direction import TapiCommonForwardingDirection # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_diversity_policy import TapiPathComputationDiversityPolicy # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_route_objective_function import TapiPathComputationRouteObjectiveFunction # noqa: F401,E501 +from tapi_server.models.tapi_path_computation_value_or_priority import TapiPathComputationValueOrPriority # noqa: F401,E501 +from tapi_server.models.tapi_topology_cost_characteristic import TapiTopologyCostCharacteristic # noqa: F401,E501 +from tapi_server.models.tapi_topology_latency_characteristic import TapiTopologyLatencyCharacteristic # noqa: F401,E501 +from tapi_server.models.tapi_topology_risk_characteristic import TapiTopologyRiskCharacteristic # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationRoutingConstraint(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, is_exclusive: bool=True, max_allowed_cost: TapiPathComputationValueOrPriority=None, diversity_policy: TapiPathComputationDiversityPolicy=None, route_objective_function: TapiPathComputationRouteObjectiveFunction=None, cost_characteristic: List[TapiTopologyCostCharacteristic]=None, max_allowed_hops: TapiPathComputationValueOrPriority=None, max_allowed_delay: TapiPathComputationValueOrPriority=None, latency_characteristic: List[TapiTopologyLatencyCharacteristic]=None, risk_diversity_characteristic: List[TapiTopologyRiskCharacteristic]=None, route_direction: TapiCommonForwardingDirection=None): # noqa: E501 + """TapiPathComputationRoutingConstraint - a model defined in Swagger + + :param is_exclusive: The is_exclusive of this TapiPathComputationRoutingConstraint. # noqa: E501 + :type is_exclusive: bool + :param max_allowed_cost: The max_allowed_cost of this TapiPathComputationRoutingConstraint. # noqa: E501 + :type max_allowed_cost: TapiPathComputationValueOrPriority + :param diversity_policy: The diversity_policy of this TapiPathComputationRoutingConstraint. # noqa: E501 + :type diversity_policy: TapiPathComputationDiversityPolicy + :param route_objective_function: The route_objective_function of this TapiPathComputationRoutingConstraint. # noqa: E501 + :type route_objective_function: TapiPathComputationRouteObjectiveFunction + :param cost_characteristic: The cost_characteristic of this TapiPathComputationRoutingConstraint. # noqa: E501 + :type cost_characteristic: List[TapiTopologyCostCharacteristic] + :param max_allowed_hops: The max_allowed_hops of this TapiPathComputationRoutingConstraint. # noqa: E501 + :type max_allowed_hops: TapiPathComputationValueOrPriority + :param max_allowed_delay: The max_allowed_delay of this TapiPathComputationRoutingConstraint. # noqa: E501 + :type max_allowed_delay: TapiPathComputationValueOrPriority + :param latency_characteristic: The latency_characteristic of this TapiPathComputationRoutingConstraint. # noqa: E501 + :type latency_characteristic: List[TapiTopologyLatencyCharacteristic] + :param risk_diversity_characteristic: The risk_diversity_characteristic of this TapiPathComputationRoutingConstraint. # noqa: E501 + :type risk_diversity_characteristic: List[TapiTopologyRiskCharacteristic] + :param route_direction: The route_direction of this TapiPathComputationRoutingConstraint. # noqa: E501 + :type route_direction: TapiCommonForwardingDirection + """ + self.swagger_types = { + 'is_exclusive': bool, + 'max_allowed_cost': TapiPathComputationValueOrPriority, + 'diversity_policy': TapiPathComputationDiversityPolicy, + 'route_objective_function': TapiPathComputationRouteObjectiveFunction, + 'cost_characteristic': List[TapiTopologyCostCharacteristic], + 'max_allowed_hops': TapiPathComputationValueOrPriority, + 'max_allowed_delay': TapiPathComputationValueOrPriority, + 'latency_characteristic': List[TapiTopologyLatencyCharacteristic], + 'risk_diversity_characteristic': List[TapiTopologyRiskCharacteristic], + 'route_direction': TapiCommonForwardingDirection + } + + self.attribute_map = { + 'is_exclusive': 'is-exclusive', + 'max_allowed_cost': 'max-allowed-cost', + 'diversity_policy': 'diversity-policy', + 'route_objective_function': 'route-objective-function', + 'cost_characteristic': 'cost-characteristic', + 'max_allowed_hops': 'max-allowed-hops', + 'max_allowed_delay': 'max-allowed-delay', + 'latency_characteristic': 'latency-characteristic', + 'risk_diversity_characteristic': 'risk-diversity-characteristic', + 'route_direction': 'route-direction' + } + self._is_exclusive = is_exclusive + self._max_allowed_cost = max_allowed_cost + self._diversity_policy = diversity_policy + self._route_objective_function = route_objective_function + self._cost_characteristic = cost_characteristic + self._max_allowed_hops = max_allowed_hops + self._max_allowed_delay = max_allowed_delay + self._latency_characteristic = latency_characteristic + self._risk_diversity_characteristic = risk_diversity_characteristic + self._route_direction = route_direction + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationRoutingConstraint': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.RoutingConstraint of this TapiPathComputationRoutingConstraint. # noqa: E501 + :rtype: TapiPathComputationRoutingConstraint + """ + return util.deserialize_model(dikt, cls) + + @property + def is_exclusive(self) -> bool: + """Gets the is_exclusive of this TapiPathComputationRoutingConstraint. + + To distinguish if the resources are to be exclusive to the service # noqa: E501 + + :return: The is_exclusive of this TapiPathComputationRoutingConstraint. + :rtype: bool + """ + return self._is_exclusive + + @is_exclusive.setter + def is_exclusive(self, is_exclusive: bool): + """Sets the is_exclusive of this TapiPathComputationRoutingConstraint. + + To distinguish if the resources are to be exclusive to the service # noqa: E501 + + :param is_exclusive: The is_exclusive of this TapiPathComputationRoutingConstraint. + :type is_exclusive: bool + """ + + self._is_exclusive = is_exclusive + + @property + def max_allowed_cost(self) -> TapiPathComputationValueOrPriority: + """Gets the max_allowed_cost of this TapiPathComputationRoutingConstraint. + + + :return: The max_allowed_cost of this TapiPathComputationRoutingConstraint. + :rtype: TapiPathComputationValueOrPriority + """ + return self._max_allowed_cost + + @max_allowed_cost.setter + def max_allowed_cost(self, max_allowed_cost: TapiPathComputationValueOrPriority): + """Sets the max_allowed_cost of this TapiPathComputationRoutingConstraint. + + + :param max_allowed_cost: The max_allowed_cost of this TapiPathComputationRoutingConstraint. + :type max_allowed_cost: TapiPathComputationValueOrPriority + """ + + self._max_allowed_cost = max_allowed_cost + + @property + def diversity_policy(self) -> TapiPathComputationDiversityPolicy: + """Gets the diversity_policy of this TapiPathComputationRoutingConstraint. + + + :return: The diversity_policy of this TapiPathComputationRoutingConstraint. + :rtype: TapiPathComputationDiversityPolicy + """ + return self._diversity_policy + + @diversity_policy.setter + def diversity_policy(self, diversity_policy: TapiPathComputationDiversityPolicy): + """Sets the diversity_policy of this TapiPathComputationRoutingConstraint. + + + :param diversity_policy: The diversity_policy of this TapiPathComputationRoutingConstraint. + :type diversity_policy: TapiPathComputationDiversityPolicy + """ + + self._diversity_policy = diversity_policy + + @property + def route_objective_function(self) -> TapiPathComputationRouteObjectiveFunction: + """Gets the route_objective_function of this TapiPathComputationRoutingConstraint. + + + :return: The route_objective_function of this TapiPathComputationRoutingConstraint. + :rtype: TapiPathComputationRouteObjectiveFunction + """ + return self._route_objective_function + + @route_objective_function.setter + def route_objective_function(self, route_objective_function: TapiPathComputationRouteObjectiveFunction): + """Sets the route_objective_function of this TapiPathComputationRoutingConstraint. + + + :param route_objective_function: The route_objective_function of this TapiPathComputationRoutingConstraint. + :type route_objective_function: TapiPathComputationRouteObjectiveFunction + """ + + self._route_objective_function = route_objective_function + + @property + def cost_characteristic(self) -> List[TapiTopologyCostCharacteristic]: + """Gets the cost_characteristic of this TapiPathComputationRoutingConstraint. + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :return: The cost_characteristic of this TapiPathComputationRoutingConstraint. + :rtype: List[TapiTopologyCostCharacteristic] + """ + return self._cost_characteristic + + @cost_characteristic.setter + def cost_characteristic(self, cost_characteristic: List[TapiTopologyCostCharacteristic]): + """Sets the cost_characteristic of this TapiPathComputationRoutingConstraint. + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :param cost_characteristic: The cost_characteristic of this TapiPathComputationRoutingConstraint. + :type cost_characteristic: List[TapiTopologyCostCharacteristic] + """ + + self._cost_characteristic = cost_characteristic + + @property + def max_allowed_hops(self) -> TapiPathComputationValueOrPriority: + """Gets the max_allowed_hops of this TapiPathComputationRoutingConstraint. + + + :return: The max_allowed_hops of this TapiPathComputationRoutingConstraint. + :rtype: TapiPathComputationValueOrPriority + """ + return self._max_allowed_hops + + @max_allowed_hops.setter + def max_allowed_hops(self, max_allowed_hops: TapiPathComputationValueOrPriority): + """Sets the max_allowed_hops of this TapiPathComputationRoutingConstraint. + + + :param max_allowed_hops: The max_allowed_hops of this TapiPathComputationRoutingConstraint. + :type max_allowed_hops: TapiPathComputationValueOrPriority + """ + + self._max_allowed_hops = max_allowed_hops + + @property + def max_allowed_delay(self) -> TapiPathComputationValueOrPriority: + """Gets the max_allowed_delay of this TapiPathComputationRoutingConstraint. + + + :return: The max_allowed_delay of this TapiPathComputationRoutingConstraint. + :rtype: TapiPathComputationValueOrPriority + """ + return self._max_allowed_delay + + @max_allowed_delay.setter + def max_allowed_delay(self, max_allowed_delay: TapiPathComputationValueOrPriority): + """Sets the max_allowed_delay of this TapiPathComputationRoutingConstraint. + + + :param max_allowed_delay: The max_allowed_delay of this TapiPathComputationRoutingConstraint. + :type max_allowed_delay: TapiPathComputationValueOrPriority + """ + + self._max_allowed_delay = max_allowed_delay + + @property + def latency_characteristic(self) -> List[TapiTopologyLatencyCharacteristic]: + """Gets the latency_characteristic of this TapiPathComputationRoutingConstraint. + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :return: The latency_characteristic of this TapiPathComputationRoutingConstraint. + :rtype: List[TapiTopologyLatencyCharacteristic] + """ + return self._latency_characteristic + + @latency_characteristic.setter + def latency_characteristic(self, latency_characteristic: List[TapiTopologyLatencyCharacteristic]): + """Sets the latency_characteristic of this TapiPathComputationRoutingConstraint. + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :param latency_characteristic: The latency_characteristic of this TapiPathComputationRoutingConstraint. + :type latency_characteristic: List[TapiTopologyLatencyCharacteristic] + """ + + self._latency_characteristic = latency_characteristic + + @property + def risk_diversity_characteristic(self) -> List[TapiTopologyRiskCharacteristic]: + """Gets the risk_diversity_characteristic of this TapiPathComputationRoutingConstraint. + + none # noqa: E501 + + :return: The risk_diversity_characteristic of this TapiPathComputationRoutingConstraint. + :rtype: List[TapiTopologyRiskCharacteristic] + """ + return self._risk_diversity_characteristic + + @risk_diversity_characteristic.setter + def risk_diversity_characteristic(self, risk_diversity_characteristic: List[TapiTopologyRiskCharacteristic]): + """Sets the risk_diversity_characteristic of this TapiPathComputationRoutingConstraint. + + none # noqa: E501 + + :param risk_diversity_characteristic: The risk_diversity_characteristic of this TapiPathComputationRoutingConstraint. + :type risk_diversity_characteristic: List[TapiTopologyRiskCharacteristic] + """ + + self._risk_diversity_characteristic = risk_diversity_characteristic + + @property + def route_direction(self) -> TapiCommonForwardingDirection: + """Gets the route_direction of this TapiPathComputationRoutingConstraint. + + + :return: The route_direction of this TapiPathComputationRoutingConstraint. + :rtype: TapiCommonForwardingDirection + """ + return self._route_direction + + @route_direction.setter + def route_direction(self, route_direction: TapiCommonForwardingDirection): + """Sets the route_direction of this TapiPathComputationRoutingConstraint. + + + :param route_direction: The route_direction of this TapiPathComputationRoutingConstraint. + :type route_direction: TapiCommonForwardingDirection + """ + + self._route_direction = route_direction diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_routing_constraint_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_routing_constraint_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..83d0b2ea73efe78e6490787bd3644149363338cc --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_routing_constraint_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_routing_constraint import TapiPathComputationRoutingConstraint # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationRoutingConstraintWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, routing_constraint: TapiPathComputationRoutingConstraint=None): # noqa: E501 + """TapiPathComputationRoutingConstraintWrapper - a model defined in Swagger + + :param routing_constraint: The routing_constraint of this TapiPathComputationRoutingConstraintWrapper. # noqa: E501 + :type routing_constraint: TapiPathComputationRoutingConstraint + """ + self.swagger_types = { + 'routing_constraint': TapiPathComputationRoutingConstraint + } + + self.attribute_map = { + 'routing_constraint': 'routing-constraint' + } + self._routing_constraint = routing_constraint + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationRoutingConstraintWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.RoutingConstraintWrapper of this TapiPathComputationRoutingConstraintWrapper. # noqa: E501 + :rtype: TapiPathComputationRoutingConstraintWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def routing_constraint(self) -> TapiPathComputationRoutingConstraint: + """Gets the routing_constraint of this TapiPathComputationRoutingConstraintWrapper. + + + :return: The routing_constraint of this TapiPathComputationRoutingConstraintWrapper. + :rtype: TapiPathComputationRoutingConstraint + """ + return self._routing_constraint + + @routing_constraint.setter + def routing_constraint(self, routing_constraint: TapiPathComputationRoutingConstraint): + """Sets the routing_constraint of this TapiPathComputationRoutingConstraintWrapper. + + + :param routing_constraint: The routing_constraint of this TapiPathComputationRoutingConstraintWrapper. + :type routing_constraint: TapiPathComputationRoutingConstraint + """ + + self._routing_constraint = routing_constraint diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_topology_constraint.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_topology_constraint.py new file mode 100644 index 0000000000000000000000000000000000000000..b55c2a0d51fb74f7023aa8d03223d45804d9e2de --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_topology_constraint.py @@ -0,0 +1,289 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationTopologyConstraint(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, include_node: List[str]=None, exclude_link: List[str]=None, avoid_topology: List[str]=None, exclude_path: List[str]=None, include_link: List[str]=None, preferred_transport_layer: List[TapiCommonLayerProtocolName]=None, exclude_node: List[str]=None, include_topology: List[str]=None, include_path: List[str]=None): # noqa: E501 + """TapiPathComputationTopologyConstraint - a model defined in Swagger + + :param include_node: The include_node of this TapiPathComputationTopologyConstraint. # noqa: E501 + :type include_node: List[str] + :param exclude_link: The exclude_link of this TapiPathComputationTopologyConstraint. # noqa: E501 + :type exclude_link: List[str] + :param avoid_topology: The avoid_topology of this TapiPathComputationTopologyConstraint. # noqa: E501 + :type avoid_topology: List[str] + :param exclude_path: The exclude_path of this TapiPathComputationTopologyConstraint. # noqa: E501 + :type exclude_path: List[str] + :param include_link: The include_link of this TapiPathComputationTopologyConstraint. # noqa: E501 + :type include_link: List[str] + :param preferred_transport_layer: The preferred_transport_layer of this TapiPathComputationTopologyConstraint. # noqa: E501 + :type preferred_transport_layer: List[TapiCommonLayerProtocolName] + :param exclude_node: The exclude_node of this TapiPathComputationTopologyConstraint. # noqa: E501 + :type exclude_node: List[str] + :param include_topology: The include_topology of this TapiPathComputationTopologyConstraint. # noqa: E501 + :type include_topology: List[str] + :param include_path: The include_path of this TapiPathComputationTopologyConstraint. # noqa: E501 + :type include_path: List[str] + """ + self.swagger_types = { + 'include_node': List[str], + 'exclude_link': List[str], + 'avoid_topology': List[str], + 'exclude_path': List[str], + 'include_link': List[str], + 'preferred_transport_layer': List[TapiCommonLayerProtocolName], + 'exclude_node': List[str], + 'include_topology': List[str], + 'include_path': List[str] + } + + self.attribute_map = { + 'include_node': 'include-node', + 'exclude_link': 'exclude-link', + 'avoid_topology': 'avoid-topology', + 'exclude_path': 'exclude-path', + 'include_link': 'include-link', + 'preferred_transport_layer': 'preferred-transport-layer', + 'exclude_node': 'exclude-node', + 'include_topology': 'include-topology', + 'include_path': 'include-path' + } + self._include_node = include_node + self._exclude_link = exclude_link + self._avoid_topology = avoid_topology + self._exclude_path = exclude_path + self._include_link = include_link + self._preferred_transport_layer = preferred_transport_layer + self._exclude_node = exclude_node + self._include_topology = include_topology + self._include_path = include_path + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationTopologyConstraint': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.TopologyConstraint of this TapiPathComputationTopologyConstraint. # noqa: E501 + :rtype: TapiPathComputationTopologyConstraint + """ + return util.deserialize_model(dikt, cls) + + @property + def include_node(self) -> List[str]: + """Gets the include_node of this TapiPathComputationTopologyConstraint. + + This is a loose constraint - that is it is unordered and could be a partial list # noqa: E501 + + :return: The include_node of this TapiPathComputationTopologyConstraint. + :rtype: List[str] + """ + return self._include_node + + @include_node.setter + def include_node(self, include_node: List[str]): + """Sets the include_node of this TapiPathComputationTopologyConstraint. + + This is a loose constraint - that is it is unordered and could be a partial list # noqa: E501 + + :param include_node: The include_node of this TapiPathComputationTopologyConstraint. + :type include_node: List[str] + """ + + self._include_node = include_node + + @property + def exclude_link(self) -> List[str]: + """Gets the exclude_link of this TapiPathComputationTopologyConstraint. + + none # noqa: E501 + + :return: The exclude_link of this TapiPathComputationTopologyConstraint. + :rtype: List[str] + """ + return self._exclude_link + + @exclude_link.setter + def exclude_link(self, exclude_link: List[str]): + """Sets the exclude_link of this TapiPathComputationTopologyConstraint. + + none # noqa: E501 + + :param exclude_link: The exclude_link of this TapiPathComputationTopologyConstraint. + :type exclude_link: List[str] + """ + + self._exclude_link = exclude_link + + @property + def avoid_topology(self) -> List[str]: + """Gets the avoid_topology of this TapiPathComputationTopologyConstraint. + + none # noqa: E501 + + :return: The avoid_topology of this TapiPathComputationTopologyConstraint. + :rtype: List[str] + """ + return self._avoid_topology + + @avoid_topology.setter + def avoid_topology(self, avoid_topology: List[str]): + """Sets the avoid_topology of this TapiPathComputationTopologyConstraint. + + none # noqa: E501 + + :param avoid_topology: The avoid_topology of this TapiPathComputationTopologyConstraint. + :type avoid_topology: List[str] + """ + + self._avoid_topology = avoid_topology + + @property + def exclude_path(self) -> List[str]: + """Gets the exclude_path of this TapiPathComputationTopologyConstraint. + + none # noqa: E501 + + :return: The exclude_path of this TapiPathComputationTopologyConstraint. + :rtype: List[str] + """ + return self._exclude_path + + @exclude_path.setter + def exclude_path(self, exclude_path: List[str]): + """Sets the exclude_path of this TapiPathComputationTopologyConstraint. + + none # noqa: E501 + + :param exclude_path: The exclude_path of this TapiPathComputationTopologyConstraint. + :type exclude_path: List[str] + """ + + self._exclude_path = exclude_path + + @property + def include_link(self) -> List[str]: + """Gets the include_link of this TapiPathComputationTopologyConstraint. + + This is a loose constraint - that is it is unordered and could be a partial list # noqa: E501 + + :return: The include_link of this TapiPathComputationTopologyConstraint. + :rtype: List[str] + """ + return self._include_link + + @include_link.setter + def include_link(self, include_link: List[str]): + """Sets the include_link of this TapiPathComputationTopologyConstraint. + + This is a loose constraint - that is it is unordered and could be a partial list # noqa: E501 + + :param include_link: The include_link of this TapiPathComputationTopologyConstraint. + :type include_link: List[str] + """ + + self._include_link = include_link + + @property + def preferred_transport_layer(self) -> List[TapiCommonLayerProtocolName]: + """Gets the preferred_transport_layer of this TapiPathComputationTopologyConstraint. + + soft constraint requested by client to indicate the layer(s) of transport connection that it prefers to carry the service. This could be same as the service layer or one of the supported server layers # noqa: E501 + + :return: The preferred_transport_layer of this TapiPathComputationTopologyConstraint. + :rtype: List[TapiCommonLayerProtocolName] + """ + return self._preferred_transport_layer + + @preferred_transport_layer.setter + def preferred_transport_layer(self, preferred_transport_layer: List[TapiCommonLayerProtocolName]): + """Sets the preferred_transport_layer of this TapiPathComputationTopologyConstraint. + + soft constraint requested by client to indicate the layer(s) of transport connection that it prefers to carry the service. This could be same as the service layer or one of the supported server layers # noqa: E501 + + :param preferred_transport_layer: The preferred_transport_layer of this TapiPathComputationTopologyConstraint. + :type preferred_transport_layer: List[TapiCommonLayerProtocolName] + """ + + self._preferred_transport_layer = preferred_transport_layer + + @property + def exclude_node(self) -> List[str]: + """Gets the exclude_node of this TapiPathComputationTopologyConstraint. + + none # noqa: E501 + + :return: The exclude_node of this TapiPathComputationTopologyConstraint. + :rtype: List[str] + """ + return self._exclude_node + + @exclude_node.setter + def exclude_node(self, exclude_node: List[str]): + """Sets the exclude_node of this TapiPathComputationTopologyConstraint. + + none # noqa: E501 + + :param exclude_node: The exclude_node of this TapiPathComputationTopologyConstraint. + :type exclude_node: List[str] + """ + + self._exclude_node = exclude_node + + @property + def include_topology(self) -> List[str]: + """Gets the include_topology of this TapiPathComputationTopologyConstraint. + + none # noqa: E501 + + :return: The include_topology of this TapiPathComputationTopologyConstraint. + :rtype: List[str] + """ + return self._include_topology + + @include_topology.setter + def include_topology(self, include_topology: List[str]): + """Sets the include_topology of this TapiPathComputationTopologyConstraint. + + none # noqa: E501 + + :param include_topology: The include_topology of this TapiPathComputationTopologyConstraint. + :type include_topology: List[str] + """ + + self._include_topology = include_topology + + @property + def include_path(self) -> List[str]: + """Gets the include_path of this TapiPathComputationTopologyConstraint. + + none # noqa: E501 + + :return: The include_path of this TapiPathComputationTopologyConstraint. + :rtype: List[str] + """ + return self._include_path + + @include_path.setter + def include_path(self, include_path: List[str]): + """Sets the include_path of this TapiPathComputationTopologyConstraint. + + none # noqa: E501 + + :param include_path: The include_path of this TapiPathComputationTopologyConstraint. + :type include_path: List[str] + """ + + self._include_path = include_path diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_topology_constraint_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_topology_constraint_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..441c005304f7e2d56174271c3680074d5fbee9bc --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_topology_constraint_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_topology_constraint import TapiPathComputationTopologyConstraint # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationTopologyConstraintWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, topology_constraint: TapiPathComputationTopologyConstraint=None): # noqa: E501 + """TapiPathComputationTopologyConstraintWrapper - a model defined in Swagger + + :param topology_constraint: The topology_constraint of this TapiPathComputationTopologyConstraintWrapper. # noqa: E501 + :type topology_constraint: TapiPathComputationTopologyConstraint + """ + self.swagger_types = { + 'topology_constraint': TapiPathComputationTopologyConstraint + } + + self.attribute_map = { + 'topology_constraint': 'topology-constraint' + } + self._topology_constraint = topology_constraint + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationTopologyConstraintWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.TopologyConstraintWrapper of this TapiPathComputationTopologyConstraintWrapper. # noqa: E501 + :rtype: TapiPathComputationTopologyConstraintWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def topology_constraint(self) -> TapiPathComputationTopologyConstraint: + """Gets the topology_constraint of this TapiPathComputationTopologyConstraintWrapper. + + + :return: The topology_constraint of this TapiPathComputationTopologyConstraintWrapper. + :rtype: TapiPathComputationTopologyConstraint + """ + return self._topology_constraint + + @topology_constraint.setter + def topology_constraint(self, topology_constraint: TapiPathComputationTopologyConstraint): + """Sets the topology_constraint of this TapiPathComputationTopologyConstraintWrapper. + + + :param topology_constraint: The topology_constraint of this TapiPathComputationTopologyConstraintWrapper. + :type topology_constraint: TapiPathComputationTopologyConstraint + """ + + self._topology_constraint = topology_constraint diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_value_or_priority.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_value_or_priority.py new file mode 100644 index 0000000000000000000000000000000000000000..b53d84e70763f38213e41c7c71448e58bdfd3929 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_value_or_priority.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiPathComputationValueOrPriority(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, priority: int=None, value: int=None): # noqa: E501 + """TapiPathComputationValueOrPriority - a model defined in Swagger + + :param priority: The priority of this TapiPathComputationValueOrPriority. # noqa: E501 + :type priority: int + :param value: The value of this TapiPathComputationValueOrPriority. # noqa: E501 + :type value: int + """ + self.swagger_types = { + 'priority': int, + 'value': int + } + + self.attribute_map = { + 'priority': 'priority', + 'value': 'value' + } + self._priority = priority + self._value = value + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationValueOrPriority': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.ValueOrPriority of this TapiPathComputationValueOrPriority. # noqa: E501 + :rtype: TapiPathComputationValueOrPriority + """ + return util.deserialize_model(dikt, cls) + + @property + def priority(self) -> int: + """Gets the priority of this TapiPathComputationValueOrPriority. + + none # noqa: E501 + + :return: The priority of this TapiPathComputationValueOrPriority. + :rtype: int + """ + return self._priority + + @priority.setter + def priority(self, priority: int): + """Sets the priority of this TapiPathComputationValueOrPriority. + + none # noqa: E501 + + :param priority: The priority of this TapiPathComputationValueOrPriority. + :type priority: int + """ + + self._priority = priority + + @property + def value(self) -> int: + """Gets the value of this TapiPathComputationValueOrPriority. + + none # noqa: E501 + + :return: The value of this TapiPathComputationValueOrPriority. + :rtype: int + """ + return self._value + + @value.setter + def value(self, value: int): + """Sets the value of this TapiPathComputationValueOrPriority. + + none # noqa: E501 + + :param value: The value of this TapiPathComputationValueOrPriority. + :type value: int + """ + + self._value = value diff --git a/hackfest/tapi/server/tapi_server/models/tapi_path_computation_value_or_priority_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_value_or_priority_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..d2ea24076e98c830ac0a29acd6bf1d2880d9394b --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_path_computation_value_or_priority_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_path_computation_value_or_priority import TapiPathComputationValueOrPriority # noqa: F401,E501 +from tapi_server import util + + +class TapiPathComputationValueOrPriorityWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, max_allowed_cost: TapiPathComputationValueOrPriority=None): # noqa: E501 + """TapiPathComputationValueOrPriorityWrapper - a model defined in Swagger + + :param max_allowed_cost: The max_allowed_cost of this TapiPathComputationValueOrPriorityWrapper. # noqa: E501 + :type max_allowed_cost: TapiPathComputationValueOrPriority + """ + self.swagger_types = { + 'max_allowed_cost': TapiPathComputationValueOrPriority + } + + self.attribute_map = { + 'max_allowed_cost': 'max-allowed-cost' + } + self._max_allowed_cost = max_allowed_cost + + @classmethod + def from_dict(cls, dikt) -> 'TapiPathComputationValueOrPriorityWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.path.computation.ValueOrPriorityWrapper of this TapiPathComputationValueOrPriorityWrapper. # noqa: E501 + :rtype: TapiPathComputationValueOrPriorityWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def max_allowed_cost(self) -> TapiPathComputationValueOrPriority: + """Gets the max_allowed_cost of this TapiPathComputationValueOrPriorityWrapper. + + + :return: The max_allowed_cost of this TapiPathComputationValueOrPriorityWrapper. + :rtype: TapiPathComputationValueOrPriority + """ + return self._max_allowed_cost + + @max_allowed_cost.setter + def max_allowed_cost(self, max_allowed_cost: TapiPathComputationValueOrPriority): + """Sets the max_allowed_cost of this TapiPathComputationValueOrPriorityWrapper. + + + :param max_allowed_cost: The max_allowed_cost of this TapiPathComputationValueOrPriorityWrapper. + :type max_allowed_cost: TapiPathComputationValueOrPriority + """ + + self._max_allowed_cost = max_allowed_cost diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_connection_spec_reference.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_connection_spec_reference.py new file mode 100644 index 0000000000000000000000000000000000000000..e759188d47a927436ed70a256e2063935a03013d --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_connection_spec_reference.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiTopologyConnectionSpecReference(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, connection_spec_name: str=None, connection_spec_id: str=None): # noqa: E501 + """TapiTopologyConnectionSpecReference - a model defined in Swagger + + :param connection_spec_name: The connection_spec_name of this TapiTopologyConnectionSpecReference. # noqa: E501 + :type connection_spec_name: str + :param connection_spec_id: The connection_spec_id of this TapiTopologyConnectionSpecReference. # noqa: E501 + :type connection_spec_id: str + """ + self.swagger_types = { + 'connection_spec_name': str, + 'connection_spec_id': str + } + + self.attribute_map = { + 'connection_spec_name': 'connection-spec-name', + 'connection_spec_id': 'connection-spec-id' + } + self._connection_spec_name = connection_spec_name + self._connection_spec_id = connection_spec_id + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyConnectionSpecReference': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.ConnectionSpecReference of this TapiTopologyConnectionSpecReference. # noqa: E501 + :rtype: TapiTopologyConnectionSpecReference + """ + return util.deserialize_model(dikt, cls) + + @property + def connection_spec_name(self) -> str: + """Gets the connection_spec_name of this TapiTopologyConnectionSpecReference. + + The name of the connection type spec. This can be used as a reference to a paper document where full formal machine interpretable specs are not supported. # noqa: E501 + + :return: The connection_spec_name of this TapiTopologyConnectionSpecReference. + :rtype: str + """ + return self._connection_spec_name + + @connection_spec_name.setter + def connection_spec_name(self, connection_spec_name: str): + """Sets the connection_spec_name of this TapiTopologyConnectionSpecReference. + + The name of the connection type spec. This can be used as a reference to a paper document where full formal machine interpretable specs are not supported. # noqa: E501 + + :param connection_spec_name: The connection_spec_name of this TapiTopologyConnectionSpecReference. + :type connection_spec_name: str + """ + + self._connection_spec_name = connection_spec_name + + @property + def connection_spec_id(self) -> str: + """Gets the connection_spec_id of this TapiTopologyConnectionSpecReference. + + The reference to a formal spec. This reference need not be provided (e.g., where there is no formal machine interpretable spec for the type of connection). # noqa: E501 + + :return: The connection_spec_id of this TapiTopologyConnectionSpecReference. + :rtype: str + """ + return self._connection_spec_id + + @connection_spec_id.setter + def connection_spec_id(self, connection_spec_id: str): + """Sets the connection_spec_id of this TapiTopologyConnectionSpecReference. + + The reference to a formal spec. This reference need not be provided (e.g., where there is no formal machine interpretable spec for the type of connection). # noqa: E501 + + :param connection_spec_id: The connection_spec_id of this TapiTopologyConnectionSpecReference. + :type connection_spec_id: str + """ + + self._connection_spec_id = connection_spec_id diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_connection_spec_reference_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_connection_spec_reference_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..67365cb2bf8416211ed7cb2e6e115ff3c6136dfb --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_connection_spec_reference_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_connection_spec_reference import TapiTopologyConnectionSpecReference # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyConnectionSpecReferenceWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, connection_spec_reference: TapiTopologyConnectionSpecReference=None): # noqa: E501 + """TapiTopologyConnectionSpecReferenceWrapper - a model defined in Swagger + + :param connection_spec_reference: The connection_spec_reference of this TapiTopologyConnectionSpecReferenceWrapper. # noqa: E501 + :type connection_spec_reference: TapiTopologyConnectionSpecReference + """ + self.swagger_types = { + 'connection_spec_reference': TapiTopologyConnectionSpecReference + } + + self.attribute_map = { + 'connection_spec_reference': 'connection-spec-reference' + } + self._connection_spec_reference = connection_spec_reference + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyConnectionSpecReferenceWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.ConnectionSpecReferenceWrapper of this TapiTopologyConnectionSpecReferenceWrapper. # noqa: E501 + :rtype: TapiTopologyConnectionSpecReferenceWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def connection_spec_reference(self) -> TapiTopologyConnectionSpecReference: + """Gets the connection_spec_reference of this TapiTopologyConnectionSpecReferenceWrapper. + + + :return: The connection_spec_reference of this TapiTopologyConnectionSpecReferenceWrapper. + :rtype: TapiTopologyConnectionSpecReference + """ + return self._connection_spec_reference + + @connection_spec_reference.setter + def connection_spec_reference(self, connection_spec_reference: TapiTopologyConnectionSpecReference): + """Sets the connection_spec_reference of this TapiTopologyConnectionSpecReferenceWrapper. + + + :param connection_spec_reference: The connection_spec_reference of this TapiTopologyConnectionSpecReferenceWrapper. + :type connection_spec_reference: TapiTopologyConnectionSpecReference + """ + + self._connection_spec_reference = connection_spec_reference diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_context_augmentation4.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_context_augmentation4.py new file mode 100644 index 0000000000000000000000000000000000000000..873d348406861edcad45039aec1bdf9a4acc939e --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_context_augmentation4.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_topology_context import TapiTopologyTopologyContext # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyContextAugmentation4(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, topology_context: TapiTopologyTopologyContext=None): # noqa: E501 + """TapiTopologyContextAugmentation4 - a model defined in Swagger + + :param topology_context: The topology_context of this TapiTopologyContextAugmentation4. # noqa: E501 + :type topology_context: TapiTopologyTopologyContext + """ + self.swagger_types = { + 'topology_context': TapiTopologyTopologyContext + } + + self.attribute_map = { + 'topology_context': 'topology-context' + } + self._topology_context = topology_context + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyContextAugmentation4': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.ContextAugmentation4 of this TapiTopologyContextAugmentation4. # noqa: E501 + :rtype: TapiTopologyContextAugmentation4 + """ + return util.deserialize_model(dikt, cls) + + @property + def topology_context(self) -> TapiTopologyTopologyContext: + """Gets the topology_context of this TapiTopologyContextAugmentation4. + + + :return: The topology_context of this TapiTopologyContextAugmentation4. + :rtype: TapiTopologyTopologyContext + """ + return self._topology_context + + @topology_context.setter + def topology_context(self, topology_context: TapiTopologyTopologyContext): + """Sets the topology_context of this TapiTopologyContextAugmentation4. + + + :param topology_context: The topology_context of this TapiTopologyContextAugmentation4. + :type topology_context: TapiTopologyTopologyContext + """ + + self._topology_context = topology_context diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_cost_characteristic.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_cost_characteristic.py new file mode 100644 index 0000000000000000000000000000000000000000..86b11fe77c24191f115a83a449a40f303b341a2e --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_cost_characteristic.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiTopologyCostCharacteristic(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, cost_value: str=None, cost_algorithm: str=None, cost_name: str=None): # noqa: E501 + """TapiTopologyCostCharacteristic - a model defined in Swagger + + :param cost_value: The cost_value of this TapiTopologyCostCharacteristic. # noqa: E501 + :type cost_value: str + :param cost_algorithm: The cost_algorithm of this TapiTopologyCostCharacteristic. # noqa: E501 + :type cost_algorithm: str + :param cost_name: The cost_name of this TapiTopologyCostCharacteristic. # noqa: E501 + :type cost_name: str + """ + self.swagger_types = { + 'cost_value': str, + 'cost_algorithm': str, + 'cost_name': str + } + + self.attribute_map = { + 'cost_value': 'cost-value', + 'cost_algorithm': 'cost-algorithm', + 'cost_name': 'cost-name' + } + self._cost_value = cost_value + self._cost_algorithm = cost_algorithm + self._cost_name = cost_name + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyCostCharacteristic': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.CostCharacteristic of this TapiTopologyCostCharacteristic. # noqa: E501 + :rtype: TapiTopologyCostCharacteristic + """ + return util.deserialize_model(dikt, cls) + + @property + def cost_value(self) -> str: + """Gets the cost_value of this TapiTopologyCostCharacteristic. + + The specific cost. # noqa: E501 + + :return: The cost_value of this TapiTopologyCostCharacteristic. + :rtype: str + """ + return self._cost_value + + @cost_value.setter + def cost_value(self, cost_value: str): + """Sets the cost_value of this TapiTopologyCostCharacteristic. + + The specific cost. # noqa: E501 + + :param cost_value: The cost_value of this TapiTopologyCostCharacteristic. + :type cost_value: str + """ + + self._cost_value = cost_value + + @property + def cost_algorithm(self) -> str: + """Gets the cost_algorithm of this TapiTopologyCostCharacteristic. + + The cost may vary based upon some properties of the TopologicalEntity. The rules for the variation are conveyed by the costAlgorithm. # noqa: E501 + + :return: The cost_algorithm of this TapiTopologyCostCharacteristic. + :rtype: str + """ + return self._cost_algorithm + + @cost_algorithm.setter + def cost_algorithm(self, cost_algorithm: str): + """Sets the cost_algorithm of this TapiTopologyCostCharacteristic. + + The cost may vary based upon some properties of the TopologicalEntity. The rules for the variation are conveyed by the costAlgorithm. # noqa: E501 + + :param cost_algorithm: The cost_algorithm of this TapiTopologyCostCharacteristic. + :type cost_algorithm: str + """ + + self._cost_algorithm = cost_algorithm + + @property + def cost_name(self) -> str: + """Gets the cost_name of this TapiTopologyCostCharacteristic. + + The cost characteristic will related to some aspect of the TopologicalEntity (e.g. $ cost, routing weight). This aspect will be conveyed by the costName. # noqa: E501 + + :return: The cost_name of this TapiTopologyCostCharacteristic. + :rtype: str + """ + return self._cost_name + + @cost_name.setter + def cost_name(self, cost_name: str): + """Sets the cost_name of this TapiTopologyCostCharacteristic. + + The cost characteristic will related to some aspect of the TopologicalEntity (e.g. $ cost, routing weight). This aspect will be conveyed by the costName. # noqa: E501 + + :param cost_name: The cost_name of this TapiTopologyCostCharacteristic. + :type cost_name: str + """ + + self._cost_name = cost_name diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_cost_characteristic_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_cost_characteristic_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..360442c00da909c10f61f24482013195560d5c35 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_cost_characteristic_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_cost_characteristic import TapiTopologyCostCharacteristic # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyCostCharacteristicWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, cost_characteristic: TapiTopologyCostCharacteristic=None): # noqa: E501 + """TapiTopologyCostCharacteristicWrapper - a model defined in Swagger + + :param cost_characteristic: The cost_characteristic of this TapiTopologyCostCharacteristicWrapper. # noqa: E501 + :type cost_characteristic: TapiTopologyCostCharacteristic + """ + self.swagger_types = { + 'cost_characteristic': TapiTopologyCostCharacteristic + } + + self.attribute_map = { + 'cost_characteristic': 'cost-characteristic' + } + self._cost_characteristic = cost_characteristic + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyCostCharacteristicWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.CostCharacteristicWrapper of this TapiTopologyCostCharacteristicWrapper. # noqa: E501 + :rtype: TapiTopologyCostCharacteristicWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def cost_characteristic(self) -> TapiTopologyCostCharacteristic: + """Gets the cost_characteristic of this TapiTopologyCostCharacteristicWrapper. + + + :return: The cost_characteristic of this TapiTopologyCostCharacteristicWrapper. + :rtype: TapiTopologyCostCharacteristic + """ + return self._cost_characteristic + + @cost_characteristic.setter + def cost_characteristic(self, cost_characteristic: TapiTopologyCostCharacteristic): + """Sets the cost_characteristic of this TapiTopologyCostCharacteristicWrapper. + + + :param cost_characteristic: The cost_characteristic of this TapiTopologyCostCharacteristicWrapper. + :type cost_characteristic: TapiTopologyCostCharacteristic + """ + + self._cost_characteristic = cost_characteristic diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_forwarding_rule.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_forwarding_rule.py new file mode 100644 index 0000000000000000000000000000000000000000..d976ccfb79aade750bf5798dd8bef4d827956327 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_forwarding_rule.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiTopologyForwardingRule(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + MAY_FORWARD_ACROSS_GROUP = "MAY_FORWARD_ACROSS_GROUP" + MUST_FORWARD_ACROSS_GROUP = "MUST_FORWARD_ACROSS_GROUP" + CANNOT_FORWARD_ACROSS_GROUP = "CANNOT_FORWARD_ACROSS_GROUP" + NO_STATEMENT_ON_FORWARDING = "NO_STATEMENT_ON_FORWARDING" + INTER_CONNECTION_CONTENTION = "INTER_CONNECTION_CONTENTION" + def __init__(self): # noqa: E501 + """TapiTopologyForwardingRule - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyForwardingRule': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.ForwardingRule of this TapiTopologyForwardingRule. # noqa: E501 + :rtype: TapiTopologyForwardingRule + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_get_link_details.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_get_link_details.py new file mode 100644 index 0000000000000000000000000000000000000000..3b480a1fb2da271966e241548bd3db08646fe9f3 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_get_link_details.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_getlinkdetails_output import TapiTopologyGetlinkdetailsOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyGetLinkDetails(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiTopologyGetlinkdetailsOutput=None): # noqa: E501 + """TapiTopologyGetLinkDetails - a model defined in Swagger + + :param output: The output of this TapiTopologyGetLinkDetails. # noqa: E501 + :type output: TapiTopologyGetlinkdetailsOutput + """ + self.swagger_types = { + 'output': TapiTopologyGetlinkdetailsOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyGetLinkDetails': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.GetLinkDetails of this TapiTopologyGetLinkDetails. # noqa: E501 + :rtype: TapiTopologyGetLinkDetails + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiTopologyGetlinkdetailsOutput: + """Gets the output of this TapiTopologyGetLinkDetails. + + + :return: The output of this TapiTopologyGetLinkDetails. + :rtype: TapiTopologyGetlinkdetailsOutput + """ + return self._output + + @output.setter + def output(self, output: TapiTopologyGetlinkdetailsOutput): + """Sets the output of this TapiTopologyGetLinkDetails. + + + :param output: The output of this TapiTopologyGetLinkDetails. + :type output: TapiTopologyGetlinkdetailsOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_get_node_details.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_get_node_details.py new file mode 100644 index 0000000000000000000000000000000000000000..b60d9cc9a2e9b7c15bdeebd3ac1b1fffbd335c90 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_get_node_details.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_getnodedetails_output import TapiTopologyGetnodedetailsOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyGetNodeDetails(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiTopologyGetnodedetailsOutput=None): # noqa: E501 + """TapiTopologyGetNodeDetails - a model defined in Swagger + + :param output: The output of this TapiTopologyGetNodeDetails. # noqa: E501 + :type output: TapiTopologyGetnodedetailsOutput + """ + self.swagger_types = { + 'output': TapiTopologyGetnodedetailsOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyGetNodeDetails': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.GetNodeDetails of this TapiTopologyGetNodeDetails. # noqa: E501 + :rtype: TapiTopologyGetNodeDetails + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiTopologyGetnodedetailsOutput: + """Gets the output of this TapiTopologyGetNodeDetails. + + + :return: The output of this TapiTopologyGetNodeDetails. + :rtype: TapiTopologyGetnodedetailsOutput + """ + return self._output + + @output.setter + def output(self, output: TapiTopologyGetnodedetailsOutput): + """Sets the output of this TapiTopologyGetNodeDetails. + + + :param output: The output of this TapiTopologyGetNodeDetails. + :type output: TapiTopologyGetnodedetailsOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_get_node_edge_point_details.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_get_node_edge_point_details.py new file mode 100644 index 0000000000000000000000000000000000000000..bf0fc4167dd95fc7f8b5ba5eb65f5508b0fe05c9 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_get_node_edge_point_details.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_getnodeedgepointdetails_output import TapiTopologyGetnodeedgepointdetailsOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyGetNodeEdgePointDetails(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiTopologyGetnodeedgepointdetailsOutput=None): # noqa: E501 + """TapiTopologyGetNodeEdgePointDetails - a model defined in Swagger + + :param output: The output of this TapiTopologyGetNodeEdgePointDetails. # noqa: E501 + :type output: TapiTopologyGetnodeedgepointdetailsOutput + """ + self.swagger_types = { + 'output': TapiTopologyGetnodeedgepointdetailsOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyGetNodeEdgePointDetails': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.GetNodeEdgePointDetails of this TapiTopologyGetNodeEdgePointDetails. # noqa: E501 + :rtype: TapiTopologyGetNodeEdgePointDetails + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiTopologyGetnodeedgepointdetailsOutput: + """Gets the output of this TapiTopologyGetNodeEdgePointDetails. + + + :return: The output of this TapiTopologyGetNodeEdgePointDetails. + :rtype: TapiTopologyGetnodeedgepointdetailsOutput + """ + return self._output + + @output.setter + def output(self, output: TapiTopologyGetnodeedgepointdetailsOutput): + """Sets the output of this TapiTopologyGetNodeEdgePointDetails. + + + :param output: The output of this TapiTopologyGetNodeEdgePointDetails. + :type output: TapiTopologyGetnodeedgepointdetailsOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_get_topology_details.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_get_topology_details.py new file mode 100644 index 0000000000000000000000000000000000000000..0a68c6e4dbd2f0376fed41e4efc3baf18bc4880e --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_get_topology_details.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_gettopologydetails_output import TapiTopologyGettopologydetailsOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyGetTopologyDetails(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiTopologyGettopologydetailsOutput=None): # noqa: E501 + """TapiTopologyGetTopologyDetails - a model defined in Swagger + + :param output: The output of this TapiTopologyGetTopologyDetails. # noqa: E501 + :type output: TapiTopologyGettopologydetailsOutput + """ + self.swagger_types = { + 'output': TapiTopologyGettopologydetailsOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyGetTopologyDetails': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.GetTopologyDetails of this TapiTopologyGetTopologyDetails. # noqa: E501 + :rtype: TapiTopologyGetTopologyDetails + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiTopologyGettopologydetailsOutput: + """Gets the output of this TapiTopologyGetTopologyDetails. + + + :return: The output of this TapiTopologyGetTopologyDetails. + :rtype: TapiTopologyGettopologydetailsOutput + """ + return self._output + + @output.setter + def output(self, output: TapiTopologyGettopologydetailsOutput): + """Sets the output of this TapiTopologyGetTopologyDetails. + + + :param output: The output of this TapiTopologyGetTopologyDetails. + :type output: TapiTopologyGettopologydetailsOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_get_topology_list.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_get_topology_list.py new file mode 100644 index 0000000000000000000000000000000000000000..88a3eceddd0d54b21db6102e7cf83c85c47edbdf --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_get_topology_list.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_gettopologylist_output import TapiTopologyGettopologylistOutput # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyGetTopologyList(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, output: TapiTopologyGettopologylistOutput=None): # noqa: E501 + """TapiTopologyGetTopologyList - a model defined in Swagger + + :param output: The output of this TapiTopologyGetTopologyList. # noqa: E501 + :type output: TapiTopologyGettopologylistOutput + """ + self.swagger_types = { + 'output': TapiTopologyGettopologylistOutput + } + + self.attribute_map = { + 'output': 'output' + } + self._output = output + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyGetTopologyList': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.GetTopologyList of this TapiTopologyGetTopologyList. # noqa: E501 + :rtype: TapiTopologyGetTopologyList + """ + return util.deserialize_model(dikt, cls) + + @property + def output(self) -> TapiTopologyGettopologylistOutput: + """Gets the output of this TapiTopologyGetTopologyList. + + + :return: The output of this TapiTopologyGetTopologyList. + :rtype: TapiTopologyGettopologylistOutput + """ + return self._output + + @output.setter + def output(self, output: TapiTopologyGettopologylistOutput): + """Sets the output of this TapiTopologyGetTopologyList. + + + :param output: The output of this TapiTopologyGetTopologyList. + :type output: TapiTopologyGettopologylistOutput + """ + + self._output = output diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_getlinkdetails_input.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_getlinkdetails_input.py new file mode 100644 index 0000000000000000000000000000000000000000..f838f3d4707f34153b17ac45c5063907171ee38f --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_getlinkdetails_input.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiTopologyGetlinkdetailsInput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, link_id_or_name: str=None, topology_id_or_name: str=None): # noqa: E501 + """TapiTopologyGetlinkdetailsInput - a model defined in Swagger + + :param link_id_or_name: The link_id_or_name of this TapiTopologyGetlinkdetailsInput. # noqa: E501 + :type link_id_or_name: str + :param topology_id_or_name: The topology_id_or_name of this TapiTopologyGetlinkdetailsInput. # noqa: E501 + :type topology_id_or_name: str + """ + self.swagger_types = { + 'link_id_or_name': str, + 'topology_id_or_name': str + } + + self.attribute_map = { + 'link_id_or_name': 'link-id-or-name', + 'topology_id_or_name': 'topology-id-or-name' + } + self._link_id_or_name = link_id_or_name + self._topology_id_or_name = topology_id_or_name + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyGetlinkdetailsInput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.getlinkdetails.Input of this TapiTopologyGetlinkdetailsInput. # noqa: E501 + :rtype: TapiTopologyGetlinkdetailsInput + """ + return util.deserialize_model(dikt, cls) + + @property + def link_id_or_name(self) -> str: + """Gets the link_id_or_name of this TapiTopologyGetlinkdetailsInput. + + none # noqa: E501 + + :return: The link_id_or_name of this TapiTopologyGetlinkdetailsInput. + :rtype: str + """ + return self._link_id_or_name + + @link_id_or_name.setter + def link_id_or_name(self, link_id_or_name: str): + """Sets the link_id_or_name of this TapiTopologyGetlinkdetailsInput. + + none # noqa: E501 + + :param link_id_or_name: The link_id_or_name of this TapiTopologyGetlinkdetailsInput. + :type link_id_or_name: str + """ + + self._link_id_or_name = link_id_or_name + + @property + def topology_id_or_name(self) -> str: + """Gets the topology_id_or_name of this TapiTopologyGetlinkdetailsInput. + + none # noqa: E501 + + :return: The topology_id_or_name of this TapiTopologyGetlinkdetailsInput. + :rtype: str + """ + return self._topology_id_or_name + + @topology_id_or_name.setter + def topology_id_or_name(self, topology_id_or_name: str): + """Sets the topology_id_or_name of this TapiTopologyGetlinkdetailsInput. + + none # noqa: E501 + + :param topology_id_or_name: The topology_id_or_name of this TapiTopologyGetlinkdetailsInput. + :type topology_id_or_name: str + """ + + self._topology_id_or_name = topology_id_or_name diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_getlinkdetails_output.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_getlinkdetails_output.py new file mode 100644 index 0000000000000000000000000000000000000000..95b662e2fecc9f78ee17c15b8ee9bc84943ce119 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_getlinkdetails_output.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_link import TapiTopologyLink # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyGetlinkdetailsOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, link: TapiTopologyLink=None): # noqa: E501 + """TapiTopologyGetlinkdetailsOutput - a model defined in Swagger + + :param link: The link of this TapiTopologyGetlinkdetailsOutput. # noqa: E501 + :type link: TapiTopologyLink + """ + self.swagger_types = { + 'link': TapiTopologyLink + } + + self.attribute_map = { + 'link': 'link' + } + self._link = link + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyGetlinkdetailsOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.getlinkdetails.Output of this TapiTopologyGetlinkdetailsOutput. # noqa: E501 + :rtype: TapiTopologyGetlinkdetailsOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def link(self) -> TapiTopologyLink: + """Gets the link of this TapiTopologyGetlinkdetailsOutput. + + + :return: The link of this TapiTopologyGetlinkdetailsOutput. + :rtype: TapiTopologyLink + """ + return self._link + + @link.setter + def link(self, link: TapiTopologyLink): + """Sets the link of this TapiTopologyGetlinkdetailsOutput. + + + :param link: The link of this TapiTopologyGetlinkdetailsOutput. + :type link: TapiTopologyLink + """ + + self._link = link diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_getnodedetails_input.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_getnodedetails_input.py new file mode 100644 index 0000000000000000000000000000000000000000..d125b2539b228e1160ddf6c5a1bcf68d97ca6797 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_getnodedetails_input.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiTopologyGetnodedetailsInput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, node_id_or_name: str=None, topology_id_or_name: str=None): # noqa: E501 + """TapiTopologyGetnodedetailsInput - a model defined in Swagger + + :param node_id_or_name: The node_id_or_name of this TapiTopologyGetnodedetailsInput. # noqa: E501 + :type node_id_or_name: str + :param topology_id_or_name: The topology_id_or_name of this TapiTopologyGetnodedetailsInput. # noqa: E501 + :type topology_id_or_name: str + """ + self.swagger_types = { + 'node_id_or_name': str, + 'topology_id_or_name': str + } + + self.attribute_map = { + 'node_id_or_name': 'node-id-or-name', + 'topology_id_or_name': 'topology-id-or-name' + } + self._node_id_or_name = node_id_or_name + self._topology_id_or_name = topology_id_or_name + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyGetnodedetailsInput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.getnodedetails.Input of this TapiTopologyGetnodedetailsInput. # noqa: E501 + :rtype: TapiTopologyGetnodedetailsInput + """ + return util.deserialize_model(dikt, cls) + + @property + def node_id_or_name(self) -> str: + """Gets the node_id_or_name of this TapiTopologyGetnodedetailsInput. + + none # noqa: E501 + + :return: The node_id_or_name of this TapiTopologyGetnodedetailsInput. + :rtype: str + """ + return self._node_id_or_name + + @node_id_or_name.setter + def node_id_or_name(self, node_id_or_name: str): + """Sets the node_id_or_name of this TapiTopologyGetnodedetailsInput. + + none # noqa: E501 + + :param node_id_or_name: The node_id_or_name of this TapiTopologyGetnodedetailsInput. + :type node_id_or_name: str + """ + + self._node_id_or_name = node_id_or_name + + @property + def topology_id_or_name(self) -> str: + """Gets the topology_id_or_name of this TapiTopologyGetnodedetailsInput. + + none # noqa: E501 + + :return: The topology_id_or_name of this TapiTopologyGetnodedetailsInput. + :rtype: str + """ + return self._topology_id_or_name + + @topology_id_or_name.setter + def topology_id_or_name(self, topology_id_or_name: str): + """Sets the topology_id_or_name of this TapiTopologyGetnodedetailsInput. + + none # noqa: E501 + + :param topology_id_or_name: The topology_id_or_name of this TapiTopologyGetnodedetailsInput. + :type topology_id_or_name: str + """ + + self._topology_id_or_name = topology_id_or_name diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_getnodedetails_output.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_getnodedetails_output.py new file mode 100644 index 0000000000000000000000000000000000000000..49e0042763a40a064620d869f9e60c1f3e68a92e --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_getnodedetails_output.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_node import TapiTopologyNode # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyGetnodedetailsOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, node: TapiTopologyNode=None): # noqa: E501 + """TapiTopologyGetnodedetailsOutput - a model defined in Swagger + + :param node: The node of this TapiTopologyGetnodedetailsOutput. # noqa: E501 + :type node: TapiTopologyNode + """ + self.swagger_types = { + 'node': TapiTopologyNode + } + + self.attribute_map = { + 'node': 'node' + } + self._node = node + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyGetnodedetailsOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.getnodedetails.Output of this TapiTopologyGetnodedetailsOutput. # noqa: E501 + :rtype: TapiTopologyGetnodedetailsOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def node(self) -> TapiTopologyNode: + """Gets the node of this TapiTopologyGetnodedetailsOutput. + + + :return: The node of this TapiTopologyGetnodedetailsOutput. + :rtype: TapiTopologyNode + """ + return self._node + + @node.setter + def node(self, node: TapiTopologyNode): + """Sets the node of this TapiTopologyGetnodedetailsOutput. + + + :param node: The node of this TapiTopologyGetnodedetailsOutput. + :type node: TapiTopologyNode + """ + + self._node = node diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_getnodeedgepointdetails_input.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_getnodeedgepointdetails_input.py new file mode 100644 index 0000000000000000000000000000000000000000..dc7f65ad32056fad5c8f6c1e7f6d9be5c2c7f0fc --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_getnodeedgepointdetails_input.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiTopologyGetnodeedgepointdetailsInput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, ep_id_or_name: str=None, node_id_or_name: str=None, topology_id_or_name: str=None): # noqa: E501 + """TapiTopologyGetnodeedgepointdetailsInput - a model defined in Swagger + + :param ep_id_or_name: The ep_id_or_name of this TapiTopologyGetnodeedgepointdetailsInput. # noqa: E501 + :type ep_id_or_name: str + :param node_id_or_name: The node_id_or_name of this TapiTopologyGetnodeedgepointdetailsInput. # noqa: E501 + :type node_id_or_name: str + :param topology_id_or_name: The topology_id_or_name of this TapiTopologyGetnodeedgepointdetailsInput. # noqa: E501 + :type topology_id_or_name: str + """ + self.swagger_types = { + 'ep_id_or_name': str, + 'node_id_or_name': str, + 'topology_id_or_name': str + } + + self.attribute_map = { + 'ep_id_or_name': 'ep-id-or-name', + 'node_id_or_name': 'node-id-or-name', + 'topology_id_or_name': 'topology-id-or-name' + } + self._ep_id_or_name = ep_id_or_name + self._node_id_or_name = node_id_or_name + self._topology_id_or_name = topology_id_or_name + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyGetnodeedgepointdetailsInput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.getnodeedgepointdetails.Input of this TapiTopologyGetnodeedgepointdetailsInput. # noqa: E501 + :rtype: TapiTopologyGetnodeedgepointdetailsInput + """ + return util.deserialize_model(dikt, cls) + + @property + def ep_id_or_name(self) -> str: + """Gets the ep_id_or_name of this TapiTopologyGetnodeedgepointdetailsInput. + + none # noqa: E501 + + :return: The ep_id_or_name of this TapiTopologyGetnodeedgepointdetailsInput. + :rtype: str + """ + return self._ep_id_or_name + + @ep_id_or_name.setter + def ep_id_or_name(self, ep_id_or_name: str): + """Sets the ep_id_or_name of this TapiTopologyGetnodeedgepointdetailsInput. + + none # noqa: E501 + + :param ep_id_or_name: The ep_id_or_name of this TapiTopologyGetnodeedgepointdetailsInput. + :type ep_id_or_name: str + """ + + self._ep_id_or_name = ep_id_or_name + + @property + def node_id_or_name(self) -> str: + """Gets the node_id_or_name of this TapiTopologyGetnodeedgepointdetailsInput. + + none # noqa: E501 + + :return: The node_id_or_name of this TapiTopologyGetnodeedgepointdetailsInput. + :rtype: str + """ + return self._node_id_or_name + + @node_id_or_name.setter + def node_id_or_name(self, node_id_or_name: str): + """Sets the node_id_or_name of this TapiTopologyGetnodeedgepointdetailsInput. + + none # noqa: E501 + + :param node_id_or_name: The node_id_or_name of this TapiTopologyGetnodeedgepointdetailsInput. + :type node_id_or_name: str + """ + + self._node_id_or_name = node_id_or_name + + @property + def topology_id_or_name(self) -> str: + """Gets the topology_id_or_name of this TapiTopologyGetnodeedgepointdetailsInput. + + none # noqa: E501 + + :return: The topology_id_or_name of this TapiTopologyGetnodeedgepointdetailsInput. + :rtype: str + """ + return self._topology_id_or_name + + @topology_id_or_name.setter + def topology_id_or_name(self, topology_id_or_name: str): + """Sets the topology_id_or_name of this TapiTopologyGetnodeedgepointdetailsInput. + + none # noqa: E501 + + :param topology_id_or_name: The topology_id_or_name of this TapiTopologyGetnodeedgepointdetailsInput. + :type topology_id_or_name: str + """ + + self._topology_id_or_name = topology_id_or_name diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_getnodeedgepointdetails_output.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_getnodeedgepointdetails_output.py new file mode 100644 index 0000000000000000000000000000000000000000..8506c3a6abe447726a8affbb0edd319bb1f80e0d --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_getnodeedgepointdetails_output.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_node_edge_point import TapiTopologyNodeEdgePoint # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyGetnodeedgepointdetailsOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, node_edge_point: TapiTopologyNodeEdgePoint=None): # noqa: E501 + """TapiTopologyGetnodeedgepointdetailsOutput - a model defined in Swagger + + :param node_edge_point: The node_edge_point of this TapiTopologyGetnodeedgepointdetailsOutput. # noqa: E501 + :type node_edge_point: TapiTopologyNodeEdgePoint + """ + self.swagger_types = { + 'node_edge_point': TapiTopologyNodeEdgePoint + } + + self.attribute_map = { + 'node_edge_point': 'node-edge-point' + } + self._node_edge_point = node_edge_point + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyGetnodeedgepointdetailsOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.getnodeedgepointdetails.Output of this TapiTopologyGetnodeedgepointdetailsOutput. # noqa: E501 + :rtype: TapiTopologyGetnodeedgepointdetailsOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def node_edge_point(self) -> TapiTopologyNodeEdgePoint: + """Gets the node_edge_point of this TapiTopologyGetnodeedgepointdetailsOutput. + + + :return: The node_edge_point of this TapiTopologyGetnodeedgepointdetailsOutput. + :rtype: TapiTopologyNodeEdgePoint + """ + return self._node_edge_point + + @node_edge_point.setter + def node_edge_point(self, node_edge_point: TapiTopologyNodeEdgePoint): + """Sets the node_edge_point of this TapiTopologyGetnodeedgepointdetailsOutput. + + + :param node_edge_point: The node_edge_point of this TapiTopologyGetnodeedgepointdetailsOutput. + :type node_edge_point: TapiTopologyNodeEdgePoint + """ + + self._node_edge_point = node_edge_point diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_gettopologydetails_input.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_gettopologydetails_input.py new file mode 100644 index 0000000000000000000000000000000000000000..766155919ed803e8097d01ce1052d85e7c4900c6 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_gettopologydetails_input.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiTopologyGettopologydetailsInput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, topology_id_or_name: str=None): # noqa: E501 + """TapiTopologyGettopologydetailsInput - a model defined in Swagger + + :param topology_id_or_name: The topology_id_or_name of this TapiTopologyGettopologydetailsInput. # noqa: E501 + :type topology_id_or_name: str + """ + self.swagger_types = { + 'topology_id_or_name': str + } + + self.attribute_map = { + 'topology_id_or_name': 'topology-id-or-name' + } + self._topology_id_or_name = topology_id_or_name + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyGettopologydetailsInput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.gettopologydetails.Input of this TapiTopologyGettopologydetailsInput. # noqa: E501 + :rtype: TapiTopologyGettopologydetailsInput + """ + return util.deserialize_model(dikt, cls) + + @property + def topology_id_or_name(self) -> str: + """Gets the topology_id_or_name of this TapiTopologyGettopologydetailsInput. + + none # noqa: E501 + + :return: The topology_id_or_name of this TapiTopologyGettopologydetailsInput. + :rtype: str + """ + return self._topology_id_or_name + + @topology_id_or_name.setter + def topology_id_or_name(self, topology_id_or_name: str): + """Sets the topology_id_or_name of this TapiTopologyGettopologydetailsInput. + + none # noqa: E501 + + :param topology_id_or_name: The topology_id_or_name of this TapiTopologyGettopologydetailsInput. + :type topology_id_or_name: str + """ + + self._topology_id_or_name = topology_id_or_name diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_gettopologydetails_output.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_gettopologydetails_output.py new file mode 100644 index 0000000000000000000000000000000000000000..5e2186dbedaae0d3c48d22f377d84cc82d7fc614 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_gettopologydetails_output.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_topology import TapiTopologyTopology # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyGettopologydetailsOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, topology: TapiTopologyTopology=None): # noqa: E501 + """TapiTopologyGettopologydetailsOutput - a model defined in Swagger + + :param topology: The topology of this TapiTopologyGettopologydetailsOutput. # noqa: E501 + :type topology: TapiTopologyTopology + """ + self.swagger_types = { + 'topology': TapiTopologyTopology + } + + self.attribute_map = { + 'topology': 'topology' + } + self._topology = topology + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyGettopologydetailsOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.gettopologydetails.Output of this TapiTopologyGettopologydetailsOutput. # noqa: E501 + :rtype: TapiTopologyGettopologydetailsOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def topology(self) -> TapiTopologyTopology: + """Gets the topology of this TapiTopologyGettopologydetailsOutput. + + + :return: The topology of this TapiTopologyGettopologydetailsOutput. + :rtype: TapiTopologyTopology + """ + return self._topology + + @topology.setter + def topology(self, topology: TapiTopologyTopology): + """Sets the topology of this TapiTopologyGettopologydetailsOutput. + + + :param topology: The topology of this TapiTopologyGettopologydetailsOutput. + :type topology: TapiTopologyTopology + """ + + self._topology = topology diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_gettopologylist_output.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_gettopologylist_output.py new file mode 100644 index 0000000000000000000000000000000000000000..45a88d2770a8ccdd0c9e345795cd0dfb401d6691 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_gettopologylist_output.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_topology import TapiTopologyTopology # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyGettopologylistOutput(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, topology: List[TapiTopologyTopology]=None): # noqa: E501 + """TapiTopologyGettopologylistOutput - a model defined in Swagger + + :param topology: The topology of this TapiTopologyGettopologylistOutput. # noqa: E501 + :type topology: List[TapiTopologyTopology] + """ + self.swagger_types = { + 'topology': List[TapiTopologyTopology] + } + + self.attribute_map = { + 'topology': 'topology' + } + self._topology = topology + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyGettopologylistOutput': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.gettopologylist.Output of this TapiTopologyGettopologylistOutput. # noqa: E501 + :rtype: TapiTopologyGettopologylistOutput + """ + return util.deserialize_model(dikt, cls) + + @property + def topology(self) -> List[TapiTopologyTopology]: + """Gets the topology of this TapiTopologyGettopologylistOutput. + + none # noqa: E501 + + :return: The topology of this TapiTopologyGettopologylistOutput. + :rtype: List[TapiTopologyTopology] + """ + return self._topology + + @topology.setter + def topology(self, topology: List[TapiTopologyTopology]): + """Sets the topology of this TapiTopologyGettopologylistOutput. + + none # noqa: E501 + + :param topology: The topology of this TapiTopologyGettopologylistOutput. + :type topology: List[TapiTopologyTopology] + """ + + self._topology = topology diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_inter_rule_group.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_inter_rule_group.py new file mode 100644 index 0000000000000000000000000000000000000000..aaf71e657c13304e4bd5a7cc2eb1ce3597030b7d --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_inter_rule_group.py @@ -0,0 +1,296 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_capacity import TapiCommonCapacity # noqa: F401,E501 +from tapi_server.models.tapi_common_capacity_pac import TapiCommonCapacityPac # noqa: F401,E501 +from tapi_server.models.tapi_common_global_class import TapiCommonGlobalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_topology_cost_characteristic import TapiTopologyCostCharacteristic # noqa: F401,E501 +from tapi_server.models.tapi_topology_latency_characteristic import TapiTopologyLatencyCharacteristic # noqa: F401,E501 +from tapi_server.models.tapi_topology_node_rule_group_ref import TapiTopologyNodeRuleGroupRef # noqa: F401,E501 +from tapi_server.models.tapi_topology_risk_characteristic import TapiTopologyRiskCharacteristic # noqa: F401,E501 +from tapi_server.models.tapi_topology_risk_parameter_pac import TapiTopologyRiskParameterPac # noqa: F401,E501 +from tapi_server.models.tapi_topology_rule import TapiTopologyRule # noqa: F401,E501 +from tapi_server.models.tapi_topology_transfer_cost_pac import TapiTopologyTransferCostPac # noqa: F401,E501 +from tapi_server.models.tapi_topology_transfer_timing_pac import TapiTopologyTransferTimingPac # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyInterRuleGroup(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: List[TapiCommonNameAndValue]=None, uuid: str=None, risk_characteristic: List[TapiTopologyRiskCharacteristic]=None, cost_characteristic: List[TapiTopologyCostCharacteristic]=None, latency_characteristic: List[TapiTopologyLatencyCharacteristic]=None, available_capacity: TapiCommonCapacity=None, total_potential_capacity: TapiCommonCapacity=None, associated_node_rule_group: List[TapiTopologyNodeRuleGroupRef]=None, rule: List[TapiTopologyRule]=None): # noqa: E501 + """TapiTopologyInterRuleGroup - a model defined in Swagger + + :param name: The name of this TapiTopologyInterRuleGroup. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param uuid: The uuid of this TapiTopologyInterRuleGroup. # noqa: E501 + :type uuid: str + :param risk_characteristic: The risk_characteristic of this TapiTopologyInterRuleGroup. # noqa: E501 + :type risk_characteristic: List[TapiTopologyRiskCharacteristic] + :param cost_characteristic: The cost_characteristic of this TapiTopologyInterRuleGroup. # noqa: E501 + :type cost_characteristic: List[TapiTopologyCostCharacteristic] + :param latency_characteristic: The latency_characteristic of this TapiTopologyInterRuleGroup. # noqa: E501 + :type latency_characteristic: List[TapiTopologyLatencyCharacteristic] + :param available_capacity: The available_capacity of this TapiTopologyInterRuleGroup. # noqa: E501 + :type available_capacity: TapiCommonCapacity + :param total_potential_capacity: The total_potential_capacity of this TapiTopologyInterRuleGroup. # noqa: E501 + :type total_potential_capacity: TapiCommonCapacity + :param associated_node_rule_group: The associated_node_rule_group of this TapiTopologyInterRuleGroup. # noqa: E501 + :type associated_node_rule_group: List[TapiTopologyNodeRuleGroupRef] + :param rule: The rule of this TapiTopologyInterRuleGroup. # noqa: E501 + :type rule: List[TapiTopologyRule] + """ + self.swagger_types = { + 'name': List[TapiCommonNameAndValue], + 'uuid': str, + 'risk_characteristic': List[TapiTopologyRiskCharacteristic], + 'cost_characteristic': List[TapiTopologyCostCharacteristic], + 'latency_characteristic': List[TapiTopologyLatencyCharacteristic], + 'available_capacity': TapiCommonCapacity, + 'total_potential_capacity': TapiCommonCapacity, + 'associated_node_rule_group': List[TapiTopologyNodeRuleGroupRef], + 'rule': List[TapiTopologyRule] + } + + self.attribute_map = { + 'name': 'name', + 'uuid': 'uuid', + 'risk_characteristic': 'risk-characteristic', + 'cost_characteristic': 'cost-characteristic', + 'latency_characteristic': 'latency-characteristic', + 'available_capacity': 'available-capacity', + 'total_potential_capacity': 'total-potential-capacity', + 'associated_node_rule_group': 'associated-node-rule-group', + 'rule': 'rule' + } + self._name = name + self._uuid = uuid + self._risk_characteristic = risk_characteristic + self._cost_characteristic = cost_characteristic + self._latency_characteristic = latency_characteristic + self._available_capacity = available_capacity + self._total_potential_capacity = total_potential_capacity + self._associated_node_rule_group = associated_node_rule_group + self._rule = rule + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyInterRuleGroup': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.InterRuleGroup of this TapiTopologyInterRuleGroup. # noqa: E501 + :rtype: TapiTopologyInterRuleGroup + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiTopologyInterRuleGroup. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiTopologyInterRuleGroup. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiTopologyInterRuleGroup. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiTopologyInterRuleGroup. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def uuid(self) -> str: + """Gets the uuid of this TapiTopologyInterRuleGroup. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :return: The uuid of this TapiTopologyInterRuleGroup. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid: str): + """Sets the uuid of this TapiTopologyInterRuleGroup. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :param uuid: The uuid of this TapiTopologyInterRuleGroup. + :type uuid: str + """ + + self._uuid = uuid + + @property + def risk_characteristic(self) -> List[TapiTopologyRiskCharacteristic]: + """Gets the risk_characteristic of this TapiTopologyInterRuleGroup. + + A list of risk characteristics for consideration in an analysis of shared risk. Each element of the list represents a specific risk consideration. # noqa: E501 + + :return: The risk_characteristic of this TapiTopologyInterRuleGroup. + :rtype: List[TapiTopologyRiskCharacteristic] + """ + return self._risk_characteristic + + @risk_characteristic.setter + def risk_characteristic(self, risk_characteristic: List[TapiTopologyRiskCharacteristic]): + """Sets the risk_characteristic of this TapiTopologyInterRuleGroup. + + A list of risk characteristics for consideration in an analysis of shared risk. Each element of the list represents a specific risk consideration. # noqa: E501 + + :param risk_characteristic: The risk_characteristic of this TapiTopologyInterRuleGroup. + :type risk_characteristic: List[TapiTopologyRiskCharacteristic] + """ + + self._risk_characteristic = risk_characteristic + + @property + def cost_characteristic(self) -> List[TapiTopologyCostCharacteristic]: + """Gets the cost_characteristic of this TapiTopologyInterRuleGroup. + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :return: The cost_characteristic of this TapiTopologyInterRuleGroup. + :rtype: List[TapiTopologyCostCharacteristic] + """ + return self._cost_characteristic + + @cost_characteristic.setter + def cost_characteristic(self, cost_characteristic: List[TapiTopologyCostCharacteristic]): + """Sets the cost_characteristic of this TapiTopologyInterRuleGroup. + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :param cost_characteristic: The cost_characteristic of this TapiTopologyInterRuleGroup. + :type cost_characteristic: List[TapiTopologyCostCharacteristic] + """ + + self._cost_characteristic = cost_characteristic + + @property + def latency_characteristic(self) -> List[TapiTopologyLatencyCharacteristic]: + """Gets the latency_characteristic of this TapiTopologyInterRuleGroup. + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :return: The latency_characteristic of this TapiTopologyInterRuleGroup. + :rtype: List[TapiTopologyLatencyCharacteristic] + """ + return self._latency_characteristic + + @latency_characteristic.setter + def latency_characteristic(self, latency_characteristic: List[TapiTopologyLatencyCharacteristic]): + """Sets the latency_characteristic of this TapiTopologyInterRuleGroup. + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :param latency_characteristic: The latency_characteristic of this TapiTopologyInterRuleGroup. + :type latency_characteristic: List[TapiTopologyLatencyCharacteristic] + """ + + self._latency_characteristic = latency_characteristic + + @property + def available_capacity(self) -> TapiCommonCapacity: + """Gets the available_capacity of this TapiTopologyInterRuleGroup. + + + :return: The available_capacity of this TapiTopologyInterRuleGroup. + :rtype: TapiCommonCapacity + """ + return self._available_capacity + + @available_capacity.setter + def available_capacity(self, available_capacity: TapiCommonCapacity): + """Sets the available_capacity of this TapiTopologyInterRuleGroup. + + + :param available_capacity: The available_capacity of this TapiTopologyInterRuleGroup. + :type available_capacity: TapiCommonCapacity + """ + + self._available_capacity = available_capacity + + @property + def total_potential_capacity(self) -> TapiCommonCapacity: + """Gets the total_potential_capacity of this TapiTopologyInterRuleGroup. + + + :return: The total_potential_capacity of this TapiTopologyInterRuleGroup. + :rtype: TapiCommonCapacity + """ + return self._total_potential_capacity + + @total_potential_capacity.setter + def total_potential_capacity(self, total_potential_capacity: TapiCommonCapacity): + """Sets the total_potential_capacity of this TapiTopologyInterRuleGroup. + + + :param total_potential_capacity: The total_potential_capacity of this TapiTopologyInterRuleGroup. + :type total_potential_capacity: TapiCommonCapacity + """ + + self._total_potential_capacity = total_potential_capacity + + @property + def associated_node_rule_group(self) -> List[TapiTopologyNodeRuleGroupRef]: + """Gets the associated_node_rule_group of this TapiTopologyInterRuleGroup. + + The NodeRuleGroups that the InterRuleGroup constrains interconnection between. The CEPs of the NEPs of a referenced NodeRuleGroup can interconnect to the CEPs of the NEPs of another referenced NodeRuleGroup constrained by the rules of the InterRuleGroup. # noqa: E501 + + :return: The associated_node_rule_group of this TapiTopologyInterRuleGroup. + :rtype: List[TapiTopologyNodeRuleGroupRef] + """ + return self._associated_node_rule_group + + @associated_node_rule_group.setter + def associated_node_rule_group(self, associated_node_rule_group: List[TapiTopologyNodeRuleGroupRef]): + """Sets the associated_node_rule_group of this TapiTopologyInterRuleGroup. + + The NodeRuleGroups that the InterRuleGroup constrains interconnection between. The CEPs of the NEPs of a referenced NodeRuleGroup can interconnect to the CEPs of the NEPs of another referenced NodeRuleGroup constrained by the rules of the InterRuleGroup. # noqa: E501 + + :param associated_node_rule_group: The associated_node_rule_group of this TapiTopologyInterRuleGroup. + :type associated_node_rule_group: List[TapiTopologyNodeRuleGroupRef] + """ + + self._associated_node_rule_group = associated_node_rule_group + + @property + def rule(self) -> List[TapiTopologyRule]: + """Gets the rule of this TapiTopologyInterRuleGroup. + + The list of rules of the InterRuleGroup. # noqa: E501 + + :return: The rule of this TapiTopologyInterRuleGroup. + :rtype: List[TapiTopologyRule] + """ + return self._rule + + @rule.setter + def rule(self, rule: List[TapiTopologyRule]): + """Sets the rule of this TapiTopologyInterRuleGroup. + + The list of rules of the InterRuleGroup. # noqa: E501 + + :param rule: The rule of this TapiTopologyInterRuleGroup. + :type rule: List[TapiTopologyRule] + """ + + self._rule = rule diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_inter_rule_group_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_inter_rule_group_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..b28c05707efed2d485d496cd9b4c646c4b00c607 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_inter_rule_group_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_inter_rule_group import TapiTopologyInterRuleGroup # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyInterRuleGroupWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, inter_rule_group: TapiTopologyInterRuleGroup=None): # noqa: E501 + """TapiTopologyInterRuleGroupWrapper - a model defined in Swagger + + :param inter_rule_group: The inter_rule_group of this TapiTopologyInterRuleGroupWrapper. # noqa: E501 + :type inter_rule_group: TapiTopologyInterRuleGroup + """ + self.swagger_types = { + 'inter_rule_group': TapiTopologyInterRuleGroup + } + + self.attribute_map = { + 'inter_rule_group': 'inter-rule-group' + } + self._inter_rule_group = inter_rule_group + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyInterRuleGroupWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.InterRuleGroupWrapper of this TapiTopologyInterRuleGroupWrapper. # noqa: E501 + :rtype: TapiTopologyInterRuleGroupWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def inter_rule_group(self) -> TapiTopologyInterRuleGroup: + """Gets the inter_rule_group of this TapiTopologyInterRuleGroupWrapper. + + + :return: The inter_rule_group of this TapiTopologyInterRuleGroupWrapper. + :rtype: TapiTopologyInterRuleGroup + """ + return self._inter_rule_group + + @inter_rule_group.setter + def inter_rule_group(self, inter_rule_group: TapiTopologyInterRuleGroup): + """Sets the inter_rule_group of this TapiTopologyInterRuleGroupWrapper. + + + :param inter_rule_group: The inter_rule_group of this TapiTopologyInterRuleGroupWrapper. + :type inter_rule_group: TapiTopologyInterRuleGroup + """ + + self._inter_rule_group = inter_rule_group diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_latency_characteristic.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_latency_characteristic.py new file mode 100644 index 0000000000000000000000000000000000000000..014790461ff1fed768ba6518426bdbad8e175f11 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_latency_characteristic.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiTopologyLatencyCharacteristic(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, traffic_property_name: str=None, jitter_characteristic: str=None, fixed_latency_characteristic: str=None, wander_characteristic: str=None, queing_latency_characteristic: str=None): # noqa: E501 + """TapiTopologyLatencyCharacteristic - a model defined in Swagger + + :param traffic_property_name: The traffic_property_name of this TapiTopologyLatencyCharacteristic. # noqa: E501 + :type traffic_property_name: str + :param jitter_characteristic: The jitter_characteristic of this TapiTopologyLatencyCharacteristic. # noqa: E501 + :type jitter_characteristic: str + :param fixed_latency_characteristic: The fixed_latency_characteristic of this TapiTopologyLatencyCharacteristic. # noqa: E501 + :type fixed_latency_characteristic: str + :param wander_characteristic: The wander_characteristic of this TapiTopologyLatencyCharacteristic. # noqa: E501 + :type wander_characteristic: str + :param queing_latency_characteristic: The queing_latency_characteristic of this TapiTopologyLatencyCharacteristic. # noqa: E501 + :type queing_latency_characteristic: str + """ + self.swagger_types = { + 'traffic_property_name': str, + 'jitter_characteristic': str, + 'fixed_latency_characteristic': str, + 'wander_characteristic': str, + 'queing_latency_characteristic': str + } + + self.attribute_map = { + 'traffic_property_name': 'traffic-property-name', + 'jitter_characteristic': 'jitter-characteristic', + 'fixed_latency_characteristic': 'fixed-latency-characteristic', + 'wander_characteristic': 'wander-characteristic', + 'queing_latency_characteristic': 'queing-latency-characteristic' + } + self._traffic_property_name = traffic_property_name + self._jitter_characteristic = jitter_characteristic + self._fixed_latency_characteristic = fixed_latency_characteristic + self._wander_characteristic = wander_characteristic + self._queing_latency_characteristic = queing_latency_characteristic + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyLatencyCharacteristic': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.LatencyCharacteristic of this TapiTopologyLatencyCharacteristic. # noqa: E501 + :rtype: TapiTopologyLatencyCharacteristic + """ + return util.deserialize_model(dikt, cls) + + @property + def traffic_property_name(self) -> str: + """Gets the traffic_property_name of this TapiTopologyLatencyCharacteristic. + + The identifier of the specific traffic property to which the queuing latency applies. # noqa: E501 + + :return: The traffic_property_name of this TapiTopologyLatencyCharacteristic. + :rtype: str + """ + return self._traffic_property_name + + @traffic_property_name.setter + def traffic_property_name(self, traffic_property_name: str): + """Sets the traffic_property_name of this TapiTopologyLatencyCharacteristic. + + The identifier of the specific traffic property to which the queuing latency applies. # noqa: E501 + + :param traffic_property_name: The traffic_property_name of this TapiTopologyLatencyCharacteristic. + :type traffic_property_name: str + """ + + self._traffic_property_name = traffic_property_name + + @property + def jitter_characteristic(self) -> str: + """Gets the jitter_characteristic of this TapiTopologyLatencyCharacteristic. + + High frequency deviation from true periodicity of a signal and therefore a small high rate of change of transfer latency. Applies to TDM systems (and not packet). # noqa: E501 + + :return: The jitter_characteristic of this TapiTopologyLatencyCharacteristic. + :rtype: str + """ + return self._jitter_characteristic + + @jitter_characteristic.setter + def jitter_characteristic(self, jitter_characteristic: str): + """Sets the jitter_characteristic of this TapiTopologyLatencyCharacteristic. + + High frequency deviation from true periodicity of a signal and therefore a small high rate of change of transfer latency. Applies to TDM systems (and not packet). # noqa: E501 + + :param jitter_characteristic: The jitter_characteristic of this TapiTopologyLatencyCharacteristic. + :type jitter_characteristic: str + """ + + self._jitter_characteristic = jitter_characteristic + + @property + def fixed_latency_characteristic(self) -> str: + """Gets the fixed_latency_characteristic of this TapiTopologyLatencyCharacteristic. + + A TopologicalEntity suffers delay caused by the realization of the servers (e.g. distance related; FEC encoding etc.) along with some client specific processing. This is the total average latency effect of the TopologicalEntity # noqa: E501 + + :return: The fixed_latency_characteristic of this TapiTopologyLatencyCharacteristic. + :rtype: str + """ + return self._fixed_latency_characteristic + + @fixed_latency_characteristic.setter + def fixed_latency_characteristic(self, fixed_latency_characteristic: str): + """Sets the fixed_latency_characteristic of this TapiTopologyLatencyCharacteristic. + + A TopologicalEntity suffers delay caused by the realization of the servers (e.g. distance related; FEC encoding etc.) along with some client specific processing. This is the total average latency effect of the TopologicalEntity # noqa: E501 + + :param fixed_latency_characteristic: The fixed_latency_characteristic of this TapiTopologyLatencyCharacteristic. + :type fixed_latency_characteristic: str + """ + + self._fixed_latency_characteristic = fixed_latency_characteristic + + @property + def wander_characteristic(self) -> str: + """Gets the wander_characteristic of this TapiTopologyLatencyCharacteristic. + + Low frequency deviation from true periodicity of a signal and therefore a small low rate of change of transfer latency. Applies to TDM systems (and not packet). # noqa: E501 + + :return: The wander_characteristic of this TapiTopologyLatencyCharacteristic. + :rtype: str + """ + return self._wander_characteristic + + @wander_characteristic.setter + def wander_characteristic(self, wander_characteristic: str): + """Sets the wander_characteristic of this TapiTopologyLatencyCharacteristic. + + Low frequency deviation from true periodicity of a signal and therefore a small low rate of change of transfer latency. Applies to TDM systems (and not packet). # noqa: E501 + + :param wander_characteristic: The wander_characteristic of this TapiTopologyLatencyCharacteristic. + :type wander_characteristic: str + """ + + self._wander_characteristic = wander_characteristic + + @property + def queing_latency_characteristic(self) -> str: + """Gets the queing_latency_characteristic of this TapiTopologyLatencyCharacteristic. + + The specific queuing latency for the traffic property. # noqa: E501 + + :return: The queing_latency_characteristic of this TapiTopologyLatencyCharacteristic. + :rtype: str + """ + return self._queing_latency_characteristic + + @queing_latency_characteristic.setter + def queing_latency_characteristic(self, queing_latency_characteristic: str): + """Sets the queing_latency_characteristic of this TapiTopologyLatencyCharacteristic. + + The specific queuing latency for the traffic property. # noqa: E501 + + :param queing_latency_characteristic: The queing_latency_characteristic of this TapiTopologyLatencyCharacteristic. + :type queing_latency_characteristic: str + """ + + self._queing_latency_characteristic = queing_latency_characteristic diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_latency_characteristic_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_latency_characteristic_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..faf48fcb4f91fe044c27bde449eb5c78ae3b36ec --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_latency_characteristic_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_latency_characteristic import TapiTopologyLatencyCharacteristic # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyLatencyCharacteristicWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, latency_characteristic: TapiTopologyLatencyCharacteristic=None): # noqa: E501 + """TapiTopologyLatencyCharacteristicWrapper - a model defined in Swagger + + :param latency_characteristic: The latency_characteristic of this TapiTopologyLatencyCharacteristicWrapper. # noqa: E501 + :type latency_characteristic: TapiTopologyLatencyCharacteristic + """ + self.swagger_types = { + 'latency_characteristic': TapiTopologyLatencyCharacteristic + } + + self.attribute_map = { + 'latency_characteristic': 'latency-characteristic' + } + self._latency_characteristic = latency_characteristic + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyLatencyCharacteristicWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.LatencyCharacteristicWrapper of this TapiTopologyLatencyCharacteristicWrapper. # noqa: E501 + :rtype: TapiTopologyLatencyCharacteristicWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def latency_characteristic(self) -> TapiTopologyLatencyCharacteristic: + """Gets the latency_characteristic of this TapiTopologyLatencyCharacteristicWrapper. + + + :return: The latency_characteristic of this TapiTopologyLatencyCharacteristicWrapper. + :rtype: TapiTopologyLatencyCharacteristic + """ + return self._latency_characteristic + + @latency_characteristic.setter + def latency_characteristic(self, latency_characteristic: TapiTopologyLatencyCharacteristic): + """Sets the latency_characteristic of this TapiTopologyLatencyCharacteristicWrapper. + + + :param latency_characteristic: The latency_characteristic of this TapiTopologyLatencyCharacteristicWrapper. + :type latency_characteristic: TapiTopologyLatencyCharacteristic + """ + + self._latency_characteristic = latency_characteristic diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_layer_protocol_transition_pac.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_layer_protocol_transition_pac.py new file mode 100644 index 0000000000000000000000000000000000000000..3b3cda712be5b822740c7deb404ee17c32b6e264 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_layer_protocol_transition_pac.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiTopologyLayerProtocolTransitionPac(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, transitioned_layer_protocol_name: List[str]=None): # noqa: E501 + """TapiTopologyLayerProtocolTransitionPac - a model defined in Swagger + + :param transitioned_layer_protocol_name: The transitioned_layer_protocol_name of this TapiTopologyLayerProtocolTransitionPac. # noqa: E501 + :type transitioned_layer_protocol_name: List[str] + """ + self.swagger_types = { + 'transitioned_layer_protocol_name': List[str] + } + + self.attribute_map = { + 'transitioned_layer_protocol_name': 'transitioned-layer-protocol-name' + } + self._transitioned_layer_protocol_name = transitioned_layer_protocol_name + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyLayerProtocolTransitionPac': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.LayerProtocolTransitionPac of this TapiTopologyLayerProtocolTransitionPac. # noqa: E501 + :rtype: TapiTopologyLayerProtocolTransitionPac + """ + return util.deserialize_model(dikt, cls) + + @property + def transitioned_layer_protocol_name(self) -> List[str]: + """Gets the transitioned_layer_protocol_name of this TapiTopologyLayerProtocolTransitionPac. + + Provides the ordered structure of layer protocol transitions encapsulated in the TopologicalEntity. The ordering relates to the LinkPort role. # noqa: E501 + + :return: The transitioned_layer_protocol_name of this TapiTopologyLayerProtocolTransitionPac. + :rtype: List[str] + """ + return self._transitioned_layer_protocol_name + + @transitioned_layer_protocol_name.setter + def transitioned_layer_protocol_name(self, transitioned_layer_protocol_name: List[str]): + """Sets the transitioned_layer_protocol_name of this TapiTopologyLayerProtocolTransitionPac. + + Provides the ordered structure of layer protocol transitions encapsulated in the TopologicalEntity. The ordering relates to the LinkPort role. # noqa: E501 + + :param transitioned_layer_protocol_name: The transitioned_layer_protocol_name of this TapiTopologyLayerProtocolTransitionPac. + :type transitioned_layer_protocol_name: List[str] + """ + + self._transitioned_layer_protocol_name = transitioned_layer_protocol_name diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_link.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_link.py new file mode 100644 index 0000000000000000000000000000000000000000..0bf0baf8e189132d6b6a0e76e9f0852acdd02746 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_link.py @@ -0,0 +1,660 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_admin_state_pac import TapiCommonAdminStatePac # noqa: F401,E501 +from tapi_server.models.tapi_common_administrative_state import TapiCommonAdministrativeState # noqa: F401,E501 +from tapi_server.models.tapi_common_capacity import TapiCommonCapacity # noqa: F401,E501 +from tapi_server.models.tapi_common_capacity_pac import TapiCommonCapacityPac # noqa: F401,E501 +from tapi_server.models.tapi_common_forwarding_direction import TapiCommonForwardingDirection # noqa: F401,E501 +from tapi_server.models.tapi_common_global_class import TapiCommonGlobalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501 +from tapi_server.models.tapi_common_lifecycle_state import TapiCommonLifecycleState # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_common_operational_state import TapiCommonOperationalState # noqa: F401,E501 +from tapi_server.models.tapi_topology_cost_characteristic import TapiTopologyCostCharacteristic # noqa: F401,E501 +from tapi_server.models.tapi_topology_latency_characteristic import TapiTopologyLatencyCharacteristic # noqa: F401,E501 +from tapi_server.models.tapi_topology_layer_protocol_transition_pac import TapiTopologyLayerProtocolTransitionPac # noqa: F401,E501 +from tapi_server.models.tapi_topology_node_edge_point_ref import TapiTopologyNodeEdgePointRef # noqa: F401,E501 +from tapi_server.models.tapi_topology_resilience_type import TapiTopologyResilienceType # noqa: F401,E501 +from tapi_server.models.tapi_topology_risk_characteristic import TapiTopologyRiskCharacteristic # noqa: F401,E501 +from tapi_server.models.tapi_topology_risk_parameter_pac import TapiTopologyRiskParameterPac # noqa: F401,E501 +from tapi_server.models.tapi_topology_transfer_cost_pac import TapiTopologyTransferCostPac # noqa: F401,E501 +from tapi_server.models.tapi_topology_transfer_integrity_pac import TapiTopologyTransferIntegrityPac # noqa: F401,E501 +from tapi_server.models.tapi_topology_transfer_timing_pac import TapiTopologyTransferTimingPac # noqa: F401,E501 +from tapi_server.models.tapi_topology_validation_mechanism import TapiTopologyValidationMechanism # noqa: F401,E501 +from tapi_server.models.tapi_topology_validation_pac import TapiTopologyValidationPac # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyLink(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, available_capacity: TapiCommonCapacity=None, total_potential_capacity: TapiCommonCapacity=None, name: List[TapiCommonNameAndValue]=None, uuid: str=None, transitioned_layer_protocol_name: List[str]=None, risk_characteristic: List[TapiTopologyRiskCharacteristic]=None, cost_characteristic: List[TapiTopologyCostCharacteristic]=None, error_characteristic: str=None, unavailable_time_characteristic: str=None, server_integrity_process_characteristic: str=None, delivery_order_characteristic: str=None, repeat_delivery_characteristic: str=None, loss_characteristic: str=None, latency_characteristic: List[TapiTopologyLatencyCharacteristic]=None, validation_mechanism: List[TapiTopologyValidationMechanism]=None, operational_state: TapiCommonOperationalState=None, lifecycle_state: TapiCommonLifecycleState=None, administrative_state: TapiCommonAdministrativeState=None, layer_protocol_name: List[TapiCommonLayerProtocolName]=None, resilience_type: TapiTopologyResilienceType=None, node_edge_point: List[TapiTopologyNodeEdgePointRef]=None, direction: TapiCommonForwardingDirection=None): # noqa: E501 + """TapiTopologyLink - a model defined in Swagger + + :param available_capacity: The available_capacity of this TapiTopologyLink. # noqa: E501 + :type available_capacity: TapiCommonCapacity + :param total_potential_capacity: The total_potential_capacity of this TapiTopologyLink. # noqa: E501 + :type total_potential_capacity: TapiCommonCapacity + :param name: The name of this TapiTopologyLink. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param uuid: The uuid of this TapiTopologyLink. # noqa: E501 + :type uuid: str + :param transitioned_layer_protocol_name: The transitioned_layer_protocol_name of this TapiTopologyLink. # noqa: E501 + :type transitioned_layer_protocol_name: List[str] + :param risk_characteristic: The risk_characteristic of this TapiTopologyLink. # noqa: E501 + :type risk_characteristic: List[TapiTopologyRiskCharacteristic] + :param cost_characteristic: The cost_characteristic of this TapiTopologyLink. # noqa: E501 + :type cost_characteristic: List[TapiTopologyCostCharacteristic] + :param error_characteristic: The error_characteristic of this TapiTopologyLink. # noqa: E501 + :type error_characteristic: str + :param unavailable_time_characteristic: The unavailable_time_characteristic of this TapiTopologyLink. # noqa: E501 + :type unavailable_time_characteristic: str + :param server_integrity_process_characteristic: The server_integrity_process_characteristic of this TapiTopologyLink. # noqa: E501 + :type server_integrity_process_characteristic: str + :param delivery_order_characteristic: The delivery_order_characteristic of this TapiTopologyLink. # noqa: E501 + :type delivery_order_characteristic: str + :param repeat_delivery_characteristic: The repeat_delivery_characteristic of this TapiTopologyLink. # noqa: E501 + :type repeat_delivery_characteristic: str + :param loss_characteristic: The loss_characteristic of this TapiTopologyLink. # noqa: E501 + :type loss_characteristic: str + :param latency_characteristic: The latency_characteristic of this TapiTopologyLink. # noqa: E501 + :type latency_characteristic: List[TapiTopologyLatencyCharacteristic] + :param validation_mechanism: The validation_mechanism of this TapiTopologyLink. # noqa: E501 + :type validation_mechanism: List[TapiTopologyValidationMechanism] + :param operational_state: The operational_state of this TapiTopologyLink. # noqa: E501 + :type operational_state: TapiCommonOperationalState + :param lifecycle_state: The lifecycle_state of this TapiTopologyLink. # noqa: E501 + :type lifecycle_state: TapiCommonLifecycleState + :param administrative_state: The administrative_state of this TapiTopologyLink. # noqa: E501 + :type administrative_state: TapiCommonAdministrativeState + :param layer_protocol_name: The layer_protocol_name of this TapiTopologyLink. # noqa: E501 + :type layer_protocol_name: List[TapiCommonLayerProtocolName] + :param resilience_type: The resilience_type of this TapiTopologyLink. # noqa: E501 + :type resilience_type: TapiTopologyResilienceType + :param node_edge_point: The node_edge_point of this TapiTopologyLink. # noqa: E501 + :type node_edge_point: List[TapiTopologyNodeEdgePointRef] + :param direction: The direction of this TapiTopologyLink. # noqa: E501 + :type direction: TapiCommonForwardingDirection + """ + self.swagger_types = { + 'available_capacity': TapiCommonCapacity, + 'total_potential_capacity': TapiCommonCapacity, + 'name': List[TapiCommonNameAndValue], + 'uuid': str, + 'transitioned_layer_protocol_name': List[str], + 'risk_characteristic': List[TapiTopologyRiskCharacteristic], + 'cost_characteristic': List[TapiTopologyCostCharacteristic], + 'error_characteristic': str, + 'unavailable_time_characteristic': str, + 'server_integrity_process_characteristic': str, + 'delivery_order_characteristic': str, + 'repeat_delivery_characteristic': str, + 'loss_characteristic': str, + 'latency_characteristic': List[TapiTopologyLatencyCharacteristic], + 'validation_mechanism': List[TapiTopologyValidationMechanism], + 'operational_state': TapiCommonOperationalState, + 'lifecycle_state': TapiCommonLifecycleState, + 'administrative_state': TapiCommonAdministrativeState, + 'layer_protocol_name': List[TapiCommonLayerProtocolName], + 'resilience_type': TapiTopologyResilienceType, + 'node_edge_point': List[TapiTopologyNodeEdgePointRef], + 'direction': TapiCommonForwardingDirection + } + + self.attribute_map = { + 'available_capacity': 'available-capacity', + 'total_potential_capacity': 'total-potential-capacity', + 'name': 'name', + 'uuid': 'uuid', + 'transitioned_layer_protocol_name': 'transitioned-layer-protocol-name', + 'risk_characteristic': 'risk-characteristic', + 'cost_characteristic': 'cost-characteristic', + 'error_characteristic': 'error-characteristic', + 'unavailable_time_characteristic': 'unavailable-time-characteristic', + 'server_integrity_process_characteristic': 'server-integrity-process-characteristic', + 'delivery_order_characteristic': 'delivery-order-characteristic', + 'repeat_delivery_characteristic': 'repeat-delivery-characteristic', + 'loss_characteristic': 'loss-characteristic', + 'latency_characteristic': 'latency-characteristic', + 'validation_mechanism': 'validation-mechanism', + 'operational_state': 'operational-state', + 'lifecycle_state': 'lifecycle-state', + 'administrative_state': 'administrative-state', + 'layer_protocol_name': 'layer-protocol-name', + 'resilience_type': 'resilience-type', + 'node_edge_point': 'node-edge-point', + 'direction': 'direction' + } + self._available_capacity = available_capacity + self._total_potential_capacity = total_potential_capacity + self._name = name + self._uuid = uuid + self._transitioned_layer_protocol_name = transitioned_layer_protocol_name + self._risk_characteristic = risk_characteristic + self._cost_characteristic = cost_characteristic + self._error_characteristic = error_characteristic + self._unavailable_time_characteristic = unavailable_time_characteristic + self._server_integrity_process_characteristic = server_integrity_process_characteristic + self._delivery_order_characteristic = delivery_order_characteristic + self._repeat_delivery_characteristic = repeat_delivery_characteristic + self._loss_characteristic = loss_characteristic + self._latency_characteristic = latency_characteristic + self._validation_mechanism = validation_mechanism + self._operational_state = operational_state + self._lifecycle_state = lifecycle_state + self._administrative_state = administrative_state + self._layer_protocol_name = layer_protocol_name + self._resilience_type = resilience_type + self._node_edge_point = node_edge_point + self._direction = direction + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyLink': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.Link of this TapiTopologyLink. # noqa: E501 + :rtype: TapiTopologyLink + """ + return util.deserialize_model(dikt, cls) + + @property + def available_capacity(self) -> TapiCommonCapacity: + """Gets the available_capacity of this TapiTopologyLink. + + + :return: The available_capacity of this TapiTopologyLink. + :rtype: TapiCommonCapacity + """ + return self._available_capacity + + @available_capacity.setter + def available_capacity(self, available_capacity: TapiCommonCapacity): + """Sets the available_capacity of this TapiTopologyLink. + + + :param available_capacity: The available_capacity of this TapiTopologyLink. + :type available_capacity: TapiCommonCapacity + """ + + self._available_capacity = available_capacity + + @property + def total_potential_capacity(self) -> TapiCommonCapacity: + """Gets the total_potential_capacity of this TapiTopologyLink. + + + :return: The total_potential_capacity of this TapiTopologyLink. + :rtype: TapiCommonCapacity + """ + return self._total_potential_capacity + + @total_potential_capacity.setter + def total_potential_capacity(self, total_potential_capacity: TapiCommonCapacity): + """Sets the total_potential_capacity of this TapiTopologyLink. + + + :param total_potential_capacity: The total_potential_capacity of this TapiTopologyLink. + :type total_potential_capacity: TapiCommonCapacity + """ + + self._total_potential_capacity = total_potential_capacity + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiTopologyLink. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiTopologyLink. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiTopologyLink. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiTopologyLink. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def uuid(self) -> str: + """Gets the uuid of this TapiTopologyLink. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :return: The uuid of this TapiTopologyLink. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid: str): + """Sets the uuid of this TapiTopologyLink. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :param uuid: The uuid of this TapiTopologyLink. + :type uuid: str + """ + + self._uuid = uuid + + @property + def transitioned_layer_protocol_name(self) -> List[str]: + """Gets the transitioned_layer_protocol_name of this TapiTopologyLink. + + Provides the ordered structure of layer protocol transitions encapsulated in the TopologicalEntity. The ordering relates to the LinkPort role. # noqa: E501 + + :return: The transitioned_layer_protocol_name of this TapiTopologyLink. + :rtype: List[str] + """ + return self._transitioned_layer_protocol_name + + @transitioned_layer_protocol_name.setter + def transitioned_layer_protocol_name(self, transitioned_layer_protocol_name: List[str]): + """Sets the transitioned_layer_protocol_name of this TapiTopologyLink. + + Provides the ordered structure of layer protocol transitions encapsulated in the TopologicalEntity. The ordering relates to the LinkPort role. # noqa: E501 + + :param transitioned_layer_protocol_name: The transitioned_layer_protocol_name of this TapiTopologyLink. + :type transitioned_layer_protocol_name: List[str] + """ + + self._transitioned_layer_protocol_name = transitioned_layer_protocol_name + + @property + def risk_characteristic(self) -> List[TapiTopologyRiskCharacteristic]: + """Gets the risk_characteristic of this TapiTopologyLink. + + A list of risk characteristics for consideration in an analysis of shared risk. Each element of the list represents a specific risk consideration. # noqa: E501 + + :return: The risk_characteristic of this TapiTopologyLink. + :rtype: List[TapiTopologyRiskCharacteristic] + """ + return self._risk_characteristic + + @risk_characteristic.setter + def risk_characteristic(self, risk_characteristic: List[TapiTopologyRiskCharacteristic]): + """Sets the risk_characteristic of this TapiTopologyLink. + + A list of risk characteristics for consideration in an analysis of shared risk. Each element of the list represents a specific risk consideration. # noqa: E501 + + :param risk_characteristic: The risk_characteristic of this TapiTopologyLink. + :type risk_characteristic: List[TapiTopologyRiskCharacteristic] + """ + + self._risk_characteristic = risk_characteristic + + @property + def cost_characteristic(self) -> List[TapiTopologyCostCharacteristic]: + """Gets the cost_characteristic of this TapiTopologyLink. + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :return: The cost_characteristic of this TapiTopologyLink. + :rtype: List[TapiTopologyCostCharacteristic] + """ + return self._cost_characteristic + + @cost_characteristic.setter + def cost_characteristic(self, cost_characteristic: List[TapiTopologyCostCharacteristic]): + """Sets the cost_characteristic of this TapiTopologyLink. + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :param cost_characteristic: The cost_characteristic of this TapiTopologyLink. + :type cost_characteristic: List[TapiTopologyCostCharacteristic] + """ + + self._cost_characteristic = cost_characteristic + + @property + def error_characteristic(self) -> str: + """Gets the error_characteristic of this TapiTopologyLink. + + Describes the degree to which the signal propagated can be errored. Applies to TDM systems as the errored signal will be propagated and not packet as errored packets will be discarded. # noqa: E501 + + :return: The error_characteristic of this TapiTopologyLink. + :rtype: str + """ + return self._error_characteristic + + @error_characteristic.setter + def error_characteristic(self, error_characteristic: str): + """Sets the error_characteristic of this TapiTopologyLink. + + Describes the degree to which the signal propagated can be errored. Applies to TDM systems as the errored signal will be propagated and not packet as errored packets will be discarded. # noqa: E501 + + :param error_characteristic: The error_characteristic of this TapiTopologyLink. + :type error_characteristic: str + """ + + self._error_characteristic = error_characteristic + + @property + def unavailable_time_characteristic(self) -> str: + """Gets the unavailable_time_characteristic of this TapiTopologyLink. + + Describes the duration for which there may be no valid signal propagated. # noqa: E501 + + :return: The unavailable_time_characteristic of this TapiTopologyLink. + :rtype: str + """ + return self._unavailable_time_characteristic + + @unavailable_time_characteristic.setter + def unavailable_time_characteristic(self, unavailable_time_characteristic: str): + """Sets the unavailable_time_characteristic of this TapiTopologyLink. + + Describes the duration for which there may be no valid signal propagated. # noqa: E501 + + :param unavailable_time_characteristic: The unavailable_time_characteristic of this TapiTopologyLink. + :type unavailable_time_characteristic: str + """ + + self._unavailable_time_characteristic = unavailable_time_characteristic + + @property + def server_integrity_process_characteristic(self) -> str: + """Gets the server_integrity_process_characteristic of this TapiTopologyLink. + + Describes the effect of any server integrity enhancement process on the characteristics of the TopologicalEntity. # noqa: E501 + + :return: The server_integrity_process_characteristic of this TapiTopologyLink. + :rtype: str + """ + return self._server_integrity_process_characteristic + + @server_integrity_process_characteristic.setter + def server_integrity_process_characteristic(self, server_integrity_process_characteristic: str): + """Sets the server_integrity_process_characteristic of this TapiTopologyLink. + + Describes the effect of any server integrity enhancement process on the characteristics of the TopologicalEntity. # noqa: E501 + + :param server_integrity_process_characteristic: The server_integrity_process_characteristic of this TapiTopologyLink. + :type server_integrity_process_characteristic: str + """ + + self._server_integrity_process_characteristic = server_integrity_process_characteristic + + @property + def delivery_order_characteristic(self) -> str: + """Gets the delivery_order_characteristic of this TapiTopologyLink. + + Describes the degree to which packets will be delivered out of sequence. Does not apply to TDM as the TDM protocols maintain strict order. # noqa: E501 + + :return: The delivery_order_characteristic of this TapiTopologyLink. + :rtype: str + """ + return self._delivery_order_characteristic + + @delivery_order_characteristic.setter + def delivery_order_characteristic(self, delivery_order_characteristic: str): + """Sets the delivery_order_characteristic of this TapiTopologyLink. + + Describes the degree to which packets will be delivered out of sequence. Does not apply to TDM as the TDM protocols maintain strict order. # noqa: E501 + + :param delivery_order_characteristic: The delivery_order_characteristic of this TapiTopologyLink. + :type delivery_order_characteristic: str + """ + + self._delivery_order_characteristic = delivery_order_characteristic + + @property + def repeat_delivery_characteristic(self) -> str: + """Gets the repeat_delivery_characteristic of this TapiTopologyLink. + + Primarily applies to packet systems where a packet may be delivered more than once (in fault recovery for example). It can also apply to TDM where several frames may be received twice due to switching in a system with a large differential propagation delay. # noqa: E501 + + :return: The repeat_delivery_characteristic of this TapiTopologyLink. + :rtype: str + """ + return self._repeat_delivery_characteristic + + @repeat_delivery_characteristic.setter + def repeat_delivery_characteristic(self, repeat_delivery_characteristic: str): + """Sets the repeat_delivery_characteristic of this TapiTopologyLink. + + Primarily applies to packet systems where a packet may be delivered more than once (in fault recovery for example). It can also apply to TDM where several frames may be received twice due to switching in a system with a large differential propagation delay. # noqa: E501 + + :param repeat_delivery_characteristic: The repeat_delivery_characteristic of this TapiTopologyLink. + :type repeat_delivery_characteristic: str + """ + + self._repeat_delivery_characteristic = repeat_delivery_characteristic + + @property + def loss_characteristic(self) -> str: + """Gets the loss_characteristic of this TapiTopologyLink. + + Describes the acceptable characteristic of lost packets where loss may result from discard due to errors or overflow. Applies to packet systems and not TDM (as for TDM errored signals are propagated unless grossly errored and overflow/underflow turns into timing slips). # noqa: E501 + + :return: The loss_characteristic of this TapiTopologyLink. + :rtype: str + """ + return self._loss_characteristic + + @loss_characteristic.setter + def loss_characteristic(self, loss_characteristic: str): + """Sets the loss_characteristic of this TapiTopologyLink. + + Describes the acceptable characteristic of lost packets where loss may result from discard due to errors or overflow. Applies to packet systems and not TDM (as for TDM errored signals are propagated unless grossly errored and overflow/underflow turns into timing slips). # noqa: E501 + + :param loss_characteristic: The loss_characteristic of this TapiTopologyLink. + :type loss_characteristic: str + """ + + self._loss_characteristic = loss_characteristic + + @property + def latency_characteristic(self) -> List[TapiTopologyLatencyCharacteristic]: + """Gets the latency_characteristic of this TapiTopologyLink. + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :return: The latency_characteristic of this TapiTopologyLink. + :rtype: List[TapiTopologyLatencyCharacteristic] + """ + return self._latency_characteristic + + @latency_characteristic.setter + def latency_characteristic(self, latency_characteristic: List[TapiTopologyLatencyCharacteristic]): + """Sets the latency_characteristic of this TapiTopologyLink. + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :param latency_characteristic: The latency_characteristic of this TapiTopologyLink. + :type latency_characteristic: List[TapiTopologyLatencyCharacteristic] + """ + + self._latency_characteristic = latency_characteristic + + @property + def validation_mechanism(self) -> List[TapiTopologyValidationMechanism]: + """Gets the validation_mechanism of this TapiTopologyLink. + + Provides details of the specific validation mechanism(s) used to confirm the presence of an intended topologicalEntity. # noqa: E501 + + :return: The validation_mechanism of this TapiTopologyLink. + :rtype: List[TapiTopologyValidationMechanism] + """ + return self._validation_mechanism + + @validation_mechanism.setter + def validation_mechanism(self, validation_mechanism: List[TapiTopologyValidationMechanism]): + """Sets the validation_mechanism of this TapiTopologyLink. + + Provides details of the specific validation mechanism(s) used to confirm the presence of an intended topologicalEntity. # noqa: E501 + + :param validation_mechanism: The validation_mechanism of this TapiTopologyLink. + :type validation_mechanism: List[TapiTopologyValidationMechanism] + """ + + self._validation_mechanism = validation_mechanism + + @property + def operational_state(self) -> TapiCommonOperationalState: + """Gets the operational_state of this TapiTopologyLink. + + + :return: The operational_state of this TapiTopologyLink. + :rtype: TapiCommonOperationalState + """ + return self._operational_state + + @operational_state.setter + def operational_state(self, operational_state: TapiCommonOperationalState): + """Sets the operational_state of this TapiTopologyLink. + + + :param operational_state: The operational_state of this TapiTopologyLink. + :type operational_state: TapiCommonOperationalState + """ + + self._operational_state = operational_state + + @property + def lifecycle_state(self) -> TapiCommonLifecycleState: + """Gets the lifecycle_state of this TapiTopologyLink. + + + :return: The lifecycle_state of this TapiTopologyLink. + :rtype: TapiCommonLifecycleState + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state: TapiCommonLifecycleState): + """Sets the lifecycle_state of this TapiTopologyLink. + + + :param lifecycle_state: The lifecycle_state of this TapiTopologyLink. + :type lifecycle_state: TapiCommonLifecycleState + """ + + self._lifecycle_state = lifecycle_state + + @property + def administrative_state(self) -> TapiCommonAdministrativeState: + """Gets the administrative_state of this TapiTopologyLink. + + + :return: The administrative_state of this TapiTopologyLink. + :rtype: TapiCommonAdministrativeState + """ + return self._administrative_state + + @administrative_state.setter + def administrative_state(self, administrative_state: TapiCommonAdministrativeState): + """Sets the administrative_state of this TapiTopologyLink. + + + :param administrative_state: The administrative_state of this TapiTopologyLink. + :type administrative_state: TapiCommonAdministrativeState + """ + + self._administrative_state = administrative_state + + @property + def layer_protocol_name(self) -> List[TapiCommonLayerProtocolName]: + """Gets the layer_protocol_name of this TapiTopologyLink. + + none # noqa: E501 + + :return: The layer_protocol_name of this TapiTopologyLink. + :rtype: List[TapiCommonLayerProtocolName] + """ + return self._layer_protocol_name + + @layer_protocol_name.setter + def layer_protocol_name(self, layer_protocol_name: List[TapiCommonLayerProtocolName]): + """Sets the layer_protocol_name of this TapiTopologyLink. + + none # noqa: E501 + + :param layer_protocol_name: The layer_protocol_name of this TapiTopologyLink. + :type layer_protocol_name: List[TapiCommonLayerProtocolName] + """ + + self._layer_protocol_name = layer_protocol_name + + @property + def resilience_type(self) -> TapiTopologyResilienceType: + """Gets the resilience_type of this TapiTopologyLink. + + + :return: The resilience_type of this TapiTopologyLink. + :rtype: TapiTopologyResilienceType + """ + return self._resilience_type + + @resilience_type.setter + def resilience_type(self, resilience_type: TapiTopologyResilienceType): + """Sets the resilience_type of this TapiTopologyLink. + + + :param resilience_type: The resilience_type of this TapiTopologyLink. + :type resilience_type: TapiTopologyResilienceType + """ + + self._resilience_type = resilience_type + + @property + def node_edge_point(self) -> List[TapiTopologyNodeEdgePointRef]: + """Gets the node_edge_point of this TapiTopologyLink. + + none # noqa: E501 + + :return: The node_edge_point of this TapiTopologyLink. + :rtype: List[TapiTopologyNodeEdgePointRef] + """ + return self._node_edge_point + + @node_edge_point.setter + def node_edge_point(self, node_edge_point: List[TapiTopologyNodeEdgePointRef]): + """Sets the node_edge_point of this TapiTopologyLink. + + none # noqa: E501 + + :param node_edge_point: The node_edge_point of this TapiTopologyLink. + :type node_edge_point: List[TapiTopologyNodeEdgePointRef] + """ + + self._node_edge_point = node_edge_point + + @property + def direction(self) -> TapiCommonForwardingDirection: + """Gets the direction of this TapiTopologyLink. + + + :return: The direction of this TapiTopologyLink. + :rtype: TapiCommonForwardingDirection + """ + return self._direction + + @direction.setter + def direction(self, direction: TapiCommonForwardingDirection): + """Sets the direction of this TapiTopologyLink. + + + :param direction: The direction of this TapiTopologyLink. + :type direction: TapiCommonForwardingDirection + """ + + self._direction = direction diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_link_ref.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_link_ref.py new file mode 100644 index 0000000000000000000000000000000000000000..ed81e9066a240509083b220e1984ff2b85d97b81 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_link_ref.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_topology_ref import TapiTopologyTopologyRef # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyLinkRef(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, topology_uuid: str=None, link_uuid: str=None): # noqa: E501 + """TapiTopologyLinkRef - a model defined in Swagger + + :param topology_uuid: The topology_uuid of this TapiTopologyLinkRef. # noqa: E501 + :type topology_uuid: str + :param link_uuid: The link_uuid of this TapiTopologyLinkRef. # noqa: E501 + :type link_uuid: str + """ + self.swagger_types = { + 'topology_uuid': str, + 'link_uuid': str + } + + self.attribute_map = { + 'topology_uuid': 'topology-uuid', + 'link_uuid': 'link-uuid' + } + self._topology_uuid = topology_uuid + self._link_uuid = link_uuid + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyLinkRef': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.LinkRef of this TapiTopologyLinkRef. # noqa: E501 + :rtype: TapiTopologyLinkRef + """ + return util.deserialize_model(dikt, cls) + + @property + def topology_uuid(self) -> str: + """Gets the topology_uuid of this TapiTopologyLinkRef. + + none # noqa: E501 + + :return: The topology_uuid of this TapiTopologyLinkRef. + :rtype: str + """ + return self._topology_uuid + + @topology_uuid.setter + def topology_uuid(self, topology_uuid: str): + """Sets the topology_uuid of this TapiTopologyLinkRef. + + none # noqa: E501 + + :param topology_uuid: The topology_uuid of this TapiTopologyLinkRef. + :type topology_uuid: str + """ + + self._topology_uuid = topology_uuid + + @property + def link_uuid(self) -> str: + """Gets the link_uuid of this TapiTopologyLinkRef. + + none # noqa: E501 + + :return: The link_uuid of this TapiTopologyLinkRef. + :rtype: str + """ + return self._link_uuid + + @link_uuid.setter + def link_uuid(self, link_uuid: str): + """Sets the link_uuid of this TapiTopologyLinkRef. + + none # noqa: E501 + + :param link_uuid: The link_uuid of this TapiTopologyLinkRef. + :type link_uuid: str + """ + + self._link_uuid = link_uuid diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_link_ref_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_link_ref_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..0b73647c83674ef1cd7b349eb3805583600c77d6 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_link_ref_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_link_ref import TapiTopologyLinkRef # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyLinkRefWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, supported_client_link: TapiTopologyLinkRef=None): # noqa: E501 + """TapiTopologyLinkRefWrapper - a model defined in Swagger + + :param supported_client_link: The supported_client_link of this TapiTopologyLinkRefWrapper. # noqa: E501 + :type supported_client_link: TapiTopologyLinkRef + """ + self.swagger_types = { + 'supported_client_link': TapiTopologyLinkRef + } + + self.attribute_map = { + 'supported_client_link': 'supported-client-link' + } + self._supported_client_link = supported_client_link + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyLinkRefWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.LinkRefWrapper of this TapiTopologyLinkRefWrapper. # noqa: E501 + :rtype: TapiTopologyLinkRefWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def supported_client_link(self) -> TapiTopologyLinkRef: + """Gets the supported_client_link of this TapiTopologyLinkRefWrapper. + + + :return: The supported_client_link of this TapiTopologyLinkRefWrapper. + :rtype: TapiTopologyLinkRef + """ + return self._supported_client_link + + @supported_client_link.setter + def supported_client_link(self, supported_client_link: TapiTopologyLinkRef): + """Sets the supported_client_link of this TapiTopologyLinkRefWrapper. + + + :param supported_client_link: The supported_client_link of this TapiTopologyLinkRefWrapper. + :type supported_client_link: TapiTopologyLinkRef + """ + + self._supported_client_link = supported_client_link diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_link_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_link_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..5d58250c466930153cb01f9ef08fea18a5948ac7 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_link_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_link import TapiTopologyLink # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyLinkWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, link: TapiTopologyLink=None): # noqa: E501 + """TapiTopologyLinkWrapper - a model defined in Swagger + + :param link: The link of this TapiTopologyLinkWrapper. # noqa: E501 + :type link: TapiTopologyLink + """ + self.swagger_types = { + 'link': TapiTopologyLink + } + + self.attribute_map = { + 'link': 'link' + } + self._link = link + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyLinkWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.LinkWrapper of this TapiTopologyLinkWrapper. # noqa: E501 + :rtype: TapiTopologyLinkWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def link(self) -> TapiTopologyLink: + """Gets the link of this TapiTopologyLinkWrapper. + + + :return: The link of this TapiTopologyLinkWrapper. + :rtype: TapiTopologyLink + """ + return self._link + + @link.setter + def link(self, link: TapiTopologyLink): + """Sets the link of this TapiTopologyLinkWrapper. + + + :param link: The link of this TapiTopologyLinkWrapper. + :type link: TapiTopologyLink + """ + + self._link = link diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_network_topology_service.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_network_topology_service.py new file mode 100644 index 0000000000000000000000000000000000000000..10efcf4cff885aa9f3b55a9fe8aad87ab2c9579e --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_network_topology_service.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_global_class import TapiCommonGlobalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_topology_topology_ref import TapiTopologyTopologyRef # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyNetworkTopologyService(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: List[TapiCommonNameAndValue]=None, uuid: str=None, topology: List[TapiTopologyTopologyRef]=None): # noqa: E501 + """TapiTopologyNetworkTopologyService - a model defined in Swagger + + :param name: The name of this TapiTopologyNetworkTopologyService. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param uuid: The uuid of this TapiTopologyNetworkTopologyService. # noqa: E501 + :type uuid: str + :param topology: The topology of this TapiTopologyNetworkTopologyService. # noqa: E501 + :type topology: List[TapiTopologyTopologyRef] + """ + self.swagger_types = { + 'name': List[TapiCommonNameAndValue], + 'uuid': str, + 'topology': List[TapiTopologyTopologyRef] + } + + self.attribute_map = { + 'name': 'name', + 'uuid': 'uuid', + 'topology': 'topology' + } + self._name = name + self._uuid = uuid + self._topology = topology + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyNetworkTopologyService': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.NetworkTopologyService of this TapiTopologyNetworkTopologyService. # noqa: E501 + :rtype: TapiTopologyNetworkTopologyService + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiTopologyNetworkTopologyService. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiTopologyNetworkTopologyService. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiTopologyNetworkTopologyService. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiTopologyNetworkTopologyService. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def uuid(self) -> str: + """Gets the uuid of this TapiTopologyNetworkTopologyService. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :return: The uuid of this TapiTopologyNetworkTopologyService. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid: str): + """Sets the uuid of this TapiTopologyNetworkTopologyService. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :param uuid: The uuid of this TapiTopologyNetworkTopologyService. + :type uuid: str + """ + + self._uuid = uuid + + @property + def topology(self) -> List[TapiTopologyTopologyRef]: + """Gets the topology of this TapiTopologyNetworkTopologyService. + + none # noqa: E501 + + :return: The topology of this TapiTopologyNetworkTopologyService. + :rtype: List[TapiTopologyTopologyRef] + """ + return self._topology + + @topology.setter + def topology(self, topology: List[TapiTopologyTopologyRef]): + """Sets the topology of this TapiTopologyNetworkTopologyService. + + none # noqa: E501 + + :param topology: The topology of this TapiTopologyNetworkTopologyService. + :type topology: List[TapiTopologyTopologyRef] + """ + + self._topology = topology diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_network_topology_service_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_network_topology_service_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..94f5e23596501a016982cf55464d33b1bf2ccb90 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_network_topology_service_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_network_topology_service import TapiTopologyNetworkTopologyService # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyNetworkTopologyServiceWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, nw_topology_service: TapiTopologyNetworkTopologyService=None): # noqa: E501 + """TapiTopologyNetworkTopologyServiceWrapper - a model defined in Swagger + + :param nw_topology_service: The nw_topology_service of this TapiTopologyNetworkTopologyServiceWrapper. # noqa: E501 + :type nw_topology_service: TapiTopologyNetworkTopologyService + """ + self.swagger_types = { + 'nw_topology_service': TapiTopologyNetworkTopologyService + } + + self.attribute_map = { + 'nw_topology_service': 'nw-topology-service' + } + self._nw_topology_service = nw_topology_service + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyNetworkTopologyServiceWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.NetworkTopologyServiceWrapper of this TapiTopologyNetworkTopologyServiceWrapper. # noqa: E501 + :rtype: TapiTopologyNetworkTopologyServiceWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def nw_topology_service(self) -> TapiTopologyNetworkTopologyService: + """Gets the nw_topology_service of this TapiTopologyNetworkTopologyServiceWrapper. + + + :return: The nw_topology_service of this TapiTopologyNetworkTopologyServiceWrapper. + :rtype: TapiTopologyNetworkTopologyService + """ + return self._nw_topology_service + + @nw_topology_service.setter + def nw_topology_service(self, nw_topology_service: TapiTopologyNetworkTopologyService): + """Sets the nw_topology_service of this TapiTopologyNetworkTopologyServiceWrapper. + + + :param nw_topology_service: The nw_topology_service of this TapiTopologyNetworkTopologyServiceWrapper. + :type nw_topology_service: TapiTopologyNetworkTopologyService + """ + + self._nw_topology_service = nw_topology_service diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_node.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_node.py new file mode 100644 index 0000000000000000000000000000000000000000..2a71716d759bcf98749188ccb630be0ad29472d4 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_node.py @@ -0,0 +1,602 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_admin_state_pac import TapiCommonAdminStatePac # noqa: F401,E501 +from tapi_server.models.tapi_common_administrative_state import TapiCommonAdministrativeState # noqa: F401,E501 +from tapi_server.models.tapi_common_capacity import TapiCommonCapacity # noqa: F401,E501 +from tapi_server.models.tapi_common_capacity_pac import TapiCommonCapacityPac # noqa: F401,E501 +from tapi_server.models.tapi_common_global_class import TapiCommonGlobalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501 +from tapi_server.models.tapi_common_lifecycle_state import TapiCommonLifecycleState # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_common_operational_state import TapiCommonOperationalState # noqa: F401,E501 +from tapi_server.models.tapi_topology_cost_characteristic import TapiTopologyCostCharacteristic # noqa: F401,E501 +from tapi_server.models.tapi_topology_latency_characteristic import TapiTopologyLatencyCharacteristic # noqa: F401,E501 +from tapi_server.models.tapi_topology_node_edge_point import TapiTopologyNodeEdgePoint # noqa: F401,E501 +from tapi_server.models.tapi_topology_node_edge_point_ref import TapiTopologyNodeEdgePointRef # noqa: F401,E501 +from tapi_server.models.tapi_topology_node_rule_group import TapiTopologyNodeRuleGroup # noqa: F401,E501 +from tapi_server.models.tapi_topology_topology_ref import TapiTopologyTopologyRef # noqa: F401,E501 +from tapi_server.models.tapi_topology_transfer_cost_pac import TapiTopologyTransferCostPac # noqa: F401,E501 +from tapi_server.models.tapi_topology_transfer_integrity_pac import TapiTopologyTransferIntegrityPac # noqa: F401,E501 +from tapi_server.models.tapi_topology_transfer_timing_pac import TapiTopologyTransferTimingPac # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyNode(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, available_capacity: TapiCommonCapacity=None, total_potential_capacity: TapiCommonCapacity=None, name: List[TapiCommonNameAndValue]=None, uuid: str=None, cost_characteristic: List[TapiTopologyCostCharacteristic]=None, error_characteristic: str=None, unavailable_time_characteristic: str=None, server_integrity_process_characteristic: str=None, delivery_order_characteristic: str=None, repeat_delivery_characteristic: str=None, loss_characteristic: str=None, latency_characteristic: List[TapiTopologyLatencyCharacteristic]=None, operational_state: TapiCommonOperationalState=None, lifecycle_state: TapiCommonLifecycleState=None, administrative_state: TapiCommonAdministrativeState=None, layer_protocol_name: List[TapiCommonLayerProtocolName]=None, encap_topology: TapiTopologyTopologyRef=None, owned_node_edge_point: List[TapiTopologyNodeEdgePoint]=None, node_rule_group: List[TapiTopologyNodeRuleGroup]=None, aggregated_node_edge_point: List[TapiTopologyNodeEdgePointRef]=None): # noqa: E501 + """TapiTopologyNode - a model defined in Swagger + + :param available_capacity: The available_capacity of this TapiTopologyNode. # noqa: E501 + :type available_capacity: TapiCommonCapacity + :param total_potential_capacity: The total_potential_capacity of this TapiTopologyNode. # noqa: E501 + :type total_potential_capacity: TapiCommonCapacity + :param name: The name of this TapiTopologyNode. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param uuid: The uuid of this TapiTopologyNode. # noqa: E501 + :type uuid: str + :param cost_characteristic: The cost_characteristic of this TapiTopologyNode. # noqa: E501 + :type cost_characteristic: List[TapiTopologyCostCharacteristic] + :param error_characteristic: The error_characteristic of this TapiTopologyNode. # noqa: E501 + :type error_characteristic: str + :param unavailable_time_characteristic: The unavailable_time_characteristic of this TapiTopologyNode. # noqa: E501 + :type unavailable_time_characteristic: str + :param server_integrity_process_characteristic: The server_integrity_process_characteristic of this TapiTopologyNode. # noqa: E501 + :type server_integrity_process_characteristic: str + :param delivery_order_characteristic: The delivery_order_characteristic of this TapiTopologyNode. # noqa: E501 + :type delivery_order_characteristic: str + :param repeat_delivery_characteristic: The repeat_delivery_characteristic of this TapiTopologyNode. # noqa: E501 + :type repeat_delivery_characteristic: str + :param loss_characteristic: The loss_characteristic of this TapiTopologyNode. # noqa: E501 + :type loss_characteristic: str + :param latency_characteristic: The latency_characteristic of this TapiTopologyNode. # noqa: E501 + :type latency_characteristic: List[TapiTopologyLatencyCharacteristic] + :param operational_state: The operational_state of this TapiTopologyNode. # noqa: E501 + :type operational_state: TapiCommonOperationalState + :param lifecycle_state: The lifecycle_state of this TapiTopologyNode. # noqa: E501 + :type lifecycle_state: TapiCommonLifecycleState + :param administrative_state: The administrative_state of this TapiTopologyNode. # noqa: E501 + :type administrative_state: TapiCommonAdministrativeState + :param layer_protocol_name: The layer_protocol_name of this TapiTopologyNode. # noqa: E501 + :type layer_protocol_name: List[TapiCommonLayerProtocolName] + :param encap_topology: The encap_topology of this TapiTopologyNode. # noqa: E501 + :type encap_topology: TapiTopologyTopologyRef + :param owned_node_edge_point: The owned_node_edge_point of this TapiTopologyNode. # noqa: E501 + :type owned_node_edge_point: List[TapiTopologyNodeEdgePoint] + :param node_rule_group: The node_rule_group of this TapiTopologyNode. # noqa: E501 + :type node_rule_group: List[TapiTopologyNodeRuleGroup] + :param aggregated_node_edge_point: The aggregated_node_edge_point of this TapiTopologyNode. # noqa: E501 + :type aggregated_node_edge_point: List[TapiTopologyNodeEdgePointRef] + """ + self.swagger_types = { + 'available_capacity': TapiCommonCapacity, + 'total_potential_capacity': TapiCommonCapacity, + 'name': List[TapiCommonNameAndValue], + 'uuid': str, + 'cost_characteristic': List[TapiTopologyCostCharacteristic], + 'error_characteristic': str, + 'unavailable_time_characteristic': str, + 'server_integrity_process_characteristic': str, + 'delivery_order_characteristic': str, + 'repeat_delivery_characteristic': str, + 'loss_characteristic': str, + 'latency_characteristic': List[TapiTopologyLatencyCharacteristic], + 'operational_state': TapiCommonOperationalState, + 'lifecycle_state': TapiCommonLifecycleState, + 'administrative_state': TapiCommonAdministrativeState, + 'layer_protocol_name': List[TapiCommonLayerProtocolName], + 'encap_topology': TapiTopologyTopologyRef, + 'owned_node_edge_point': List[TapiTopologyNodeEdgePoint], + 'node_rule_group': List[TapiTopologyNodeRuleGroup], + 'aggregated_node_edge_point': List[TapiTopologyNodeEdgePointRef] + } + + self.attribute_map = { + 'available_capacity': 'available-capacity', + 'total_potential_capacity': 'total-potential-capacity', + 'name': 'name', + 'uuid': 'uuid', + 'cost_characteristic': 'cost-characteristic', + 'error_characteristic': 'error-characteristic', + 'unavailable_time_characteristic': 'unavailable-time-characteristic', + 'server_integrity_process_characteristic': 'server-integrity-process-characteristic', + 'delivery_order_characteristic': 'delivery-order-characteristic', + 'repeat_delivery_characteristic': 'repeat-delivery-characteristic', + 'loss_characteristic': 'loss-characteristic', + 'latency_characteristic': 'latency-characteristic', + 'operational_state': 'operational-state', + 'lifecycle_state': 'lifecycle-state', + 'administrative_state': 'administrative-state', + 'layer_protocol_name': 'layer-protocol-name', + 'encap_topology': 'encap-topology', + 'owned_node_edge_point': 'owned-node-edge-point', + 'node_rule_group': 'node-rule-group', + 'aggregated_node_edge_point': 'aggregated-node-edge-point' + } + self._available_capacity = available_capacity + self._total_potential_capacity = total_potential_capacity + self._name = name + self._uuid = uuid + self._cost_characteristic = cost_characteristic + self._error_characteristic = error_characteristic + self._unavailable_time_characteristic = unavailable_time_characteristic + self._server_integrity_process_characteristic = server_integrity_process_characteristic + self._delivery_order_characteristic = delivery_order_characteristic + self._repeat_delivery_characteristic = repeat_delivery_characteristic + self._loss_characteristic = loss_characteristic + self._latency_characteristic = latency_characteristic + self._operational_state = operational_state + self._lifecycle_state = lifecycle_state + self._administrative_state = administrative_state + self._layer_protocol_name = layer_protocol_name + self._encap_topology = encap_topology + self._owned_node_edge_point = owned_node_edge_point + self._node_rule_group = node_rule_group + self._aggregated_node_edge_point = aggregated_node_edge_point + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyNode': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.Node of this TapiTopologyNode. # noqa: E501 + :rtype: TapiTopologyNode + """ + return util.deserialize_model(dikt, cls) + + @property + def available_capacity(self) -> TapiCommonCapacity: + """Gets the available_capacity of this TapiTopologyNode. + + + :return: The available_capacity of this TapiTopologyNode. + :rtype: TapiCommonCapacity + """ + return self._available_capacity + + @available_capacity.setter + def available_capacity(self, available_capacity: TapiCommonCapacity): + """Sets the available_capacity of this TapiTopologyNode. + + + :param available_capacity: The available_capacity of this TapiTopologyNode. + :type available_capacity: TapiCommonCapacity + """ + + self._available_capacity = available_capacity + + @property + def total_potential_capacity(self) -> TapiCommonCapacity: + """Gets the total_potential_capacity of this TapiTopologyNode. + + + :return: The total_potential_capacity of this TapiTopologyNode. + :rtype: TapiCommonCapacity + """ + return self._total_potential_capacity + + @total_potential_capacity.setter + def total_potential_capacity(self, total_potential_capacity: TapiCommonCapacity): + """Sets the total_potential_capacity of this TapiTopologyNode. + + + :param total_potential_capacity: The total_potential_capacity of this TapiTopologyNode. + :type total_potential_capacity: TapiCommonCapacity + """ + + self._total_potential_capacity = total_potential_capacity + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiTopologyNode. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiTopologyNode. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiTopologyNode. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiTopologyNode. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def uuid(self) -> str: + """Gets the uuid of this TapiTopologyNode. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :return: The uuid of this TapiTopologyNode. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid: str): + """Sets the uuid of this TapiTopologyNode. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :param uuid: The uuid of this TapiTopologyNode. + :type uuid: str + """ + + self._uuid = uuid + + @property + def cost_characteristic(self) -> List[TapiTopologyCostCharacteristic]: + """Gets the cost_characteristic of this TapiTopologyNode. + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :return: The cost_characteristic of this TapiTopologyNode. + :rtype: List[TapiTopologyCostCharacteristic] + """ + return self._cost_characteristic + + @cost_characteristic.setter + def cost_characteristic(self, cost_characteristic: List[TapiTopologyCostCharacteristic]): + """Sets the cost_characteristic of this TapiTopologyNode. + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :param cost_characteristic: The cost_characteristic of this TapiTopologyNode. + :type cost_characteristic: List[TapiTopologyCostCharacteristic] + """ + + self._cost_characteristic = cost_characteristic + + @property + def error_characteristic(self) -> str: + """Gets the error_characteristic of this TapiTopologyNode. + + Describes the degree to which the signal propagated can be errored. Applies to TDM systems as the errored signal will be propagated and not packet as errored packets will be discarded. # noqa: E501 + + :return: The error_characteristic of this TapiTopologyNode. + :rtype: str + """ + return self._error_characteristic + + @error_characteristic.setter + def error_characteristic(self, error_characteristic: str): + """Sets the error_characteristic of this TapiTopologyNode. + + Describes the degree to which the signal propagated can be errored. Applies to TDM systems as the errored signal will be propagated and not packet as errored packets will be discarded. # noqa: E501 + + :param error_characteristic: The error_characteristic of this TapiTopologyNode. + :type error_characteristic: str + """ + + self._error_characteristic = error_characteristic + + @property + def unavailable_time_characteristic(self) -> str: + """Gets the unavailable_time_characteristic of this TapiTopologyNode. + + Describes the duration for which there may be no valid signal propagated. # noqa: E501 + + :return: The unavailable_time_characteristic of this TapiTopologyNode. + :rtype: str + """ + return self._unavailable_time_characteristic + + @unavailable_time_characteristic.setter + def unavailable_time_characteristic(self, unavailable_time_characteristic: str): + """Sets the unavailable_time_characteristic of this TapiTopologyNode. + + Describes the duration for which there may be no valid signal propagated. # noqa: E501 + + :param unavailable_time_characteristic: The unavailable_time_characteristic of this TapiTopologyNode. + :type unavailable_time_characteristic: str + """ + + self._unavailable_time_characteristic = unavailable_time_characteristic + + @property + def server_integrity_process_characteristic(self) -> str: + """Gets the server_integrity_process_characteristic of this TapiTopologyNode. + + Describes the effect of any server integrity enhancement process on the characteristics of the TopologicalEntity. # noqa: E501 + + :return: The server_integrity_process_characteristic of this TapiTopologyNode. + :rtype: str + """ + return self._server_integrity_process_characteristic + + @server_integrity_process_characteristic.setter + def server_integrity_process_characteristic(self, server_integrity_process_characteristic: str): + """Sets the server_integrity_process_characteristic of this TapiTopologyNode. + + Describes the effect of any server integrity enhancement process on the characteristics of the TopologicalEntity. # noqa: E501 + + :param server_integrity_process_characteristic: The server_integrity_process_characteristic of this TapiTopologyNode. + :type server_integrity_process_characteristic: str + """ + + self._server_integrity_process_characteristic = server_integrity_process_characteristic + + @property + def delivery_order_characteristic(self) -> str: + """Gets the delivery_order_characteristic of this TapiTopologyNode. + + Describes the degree to which packets will be delivered out of sequence. Does not apply to TDM as the TDM protocols maintain strict order. # noqa: E501 + + :return: The delivery_order_characteristic of this TapiTopologyNode. + :rtype: str + """ + return self._delivery_order_characteristic + + @delivery_order_characteristic.setter + def delivery_order_characteristic(self, delivery_order_characteristic: str): + """Sets the delivery_order_characteristic of this TapiTopologyNode. + + Describes the degree to which packets will be delivered out of sequence. Does not apply to TDM as the TDM protocols maintain strict order. # noqa: E501 + + :param delivery_order_characteristic: The delivery_order_characteristic of this TapiTopologyNode. + :type delivery_order_characteristic: str + """ + + self._delivery_order_characteristic = delivery_order_characteristic + + @property + def repeat_delivery_characteristic(self) -> str: + """Gets the repeat_delivery_characteristic of this TapiTopologyNode. + + Primarily applies to packet systems where a packet may be delivered more than once (in fault recovery for example). It can also apply to TDM where several frames may be received twice due to switching in a system with a large differential propagation delay. # noqa: E501 + + :return: The repeat_delivery_characteristic of this TapiTopologyNode. + :rtype: str + """ + return self._repeat_delivery_characteristic + + @repeat_delivery_characteristic.setter + def repeat_delivery_characteristic(self, repeat_delivery_characteristic: str): + """Sets the repeat_delivery_characteristic of this TapiTopologyNode. + + Primarily applies to packet systems where a packet may be delivered more than once (in fault recovery for example). It can also apply to TDM where several frames may be received twice due to switching in a system with a large differential propagation delay. # noqa: E501 + + :param repeat_delivery_characteristic: The repeat_delivery_characteristic of this TapiTopologyNode. + :type repeat_delivery_characteristic: str + """ + + self._repeat_delivery_characteristic = repeat_delivery_characteristic + + @property + def loss_characteristic(self) -> str: + """Gets the loss_characteristic of this TapiTopologyNode. + + Describes the acceptable characteristic of lost packets where loss may result from discard due to errors or overflow. Applies to packet systems and not TDM (as for TDM errored signals are propagated unless grossly errored and overflow/underflow turns into timing slips). # noqa: E501 + + :return: The loss_characteristic of this TapiTopologyNode. + :rtype: str + """ + return self._loss_characteristic + + @loss_characteristic.setter + def loss_characteristic(self, loss_characteristic: str): + """Sets the loss_characteristic of this TapiTopologyNode. + + Describes the acceptable characteristic of lost packets where loss may result from discard due to errors or overflow. Applies to packet systems and not TDM (as for TDM errored signals are propagated unless grossly errored and overflow/underflow turns into timing slips). # noqa: E501 + + :param loss_characteristic: The loss_characteristic of this TapiTopologyNode. + :type loss_characteristic: str + """ + + self._loss_characteristic = loss_characteristic + + @property + def latency_characteristic(self) -> List[TapiTopologyLatencyCharacteristic]: + """Gets the latency_characteristic of this TapiTopologyNode. + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :return: The latency_characteristic of this TapiTopologyNode. + :rtype: List[TapiTopologyLatencyCharacteristic] + """ + return self._latency_characteristic + + @latency_characteristic.setter + def latency_characteristic(self, latency_characteristic: List[TapiTopologyLatencyCharacteristic]): + """Sets the latency_characteristic of this TapiTopologyNode. + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :param latency_characteristic: The latency_characteristic of this TapiTopologyNode. + :type latency_characteristic: List[TapiTopologyLatencyCharacteristic] + """ + + self._latency_characteristic = latency_characteristic + + @property + def operational_state(self) -> TapiCommonOperationalState: + """Gets the operational_state of this TapiTopologyNode. + + + :return: The operational_state of this TapiTopologyNode. + :rtype: TapiCommonOperationalState + """ + return self._operational_state + + @operational_state.setter + def operational_state(self, operational_state: TapiCommonOperationalState): + """Sets the operational_state of this TapiTopologyNode. + + + :param operational_state: The operational_state of this TapiTopologyNode. + :type operational_state: TapiCommonOperationalState + """ + + self._operational_state = operational_state + + @property + def lifecycle_state(self) -> TapiCommonLifecycleState: + """Gets the lifecycle_state of this TapiTopologyNode. + + + :return: The lifecycle_state of this TapiTopologyNode. + :rtype: TapiCommonLifecycleState + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state: TapiCommonLifecycleState): + """Sets the lifecycle_state of this TapiTopologyNode. + + + :param lifecycle_state: The lifecycle_state of this TapiTopologyNode. + :type lifecycle_state: TapiCommonLifecycleState + """ + + self._lifecycle_state = lifecycle_state + + @property + def administrative_state(self) -> TapiCommonAdministrativeState: + """Gets the administrative_state of this TapiTopologyNode. + + + :return: The administrative_state of this TapiTopologyNode. + :rtype: TapiCommonAdministrativeState + """ + return self._administrative_state + + @administrative_state.setter + def administrative_state(self, administrative_state: TapiCommonAdministrativeState): + """Sets the administrative_state of this TapiTopologyNode. + + + :param administrative_state: The administrative_state of this TapiTopologyNode. + :type administrative_state: TapiCommonAdministrativeState + """ + + self._administrative_state = administrative_state + + @property + def layer_protocol_name(self) -> List[TapiCommonLayerProtocolName]: + """Gets the layer_protocol_name of this TapiTopologyNode. + + none # noqa: E501 + + :return: The layer_protocol_name of this TapiTopologyNode. + :rtype: List[TapiCommonLayerProtocolName] + """ + return self._layer_protocol_name + + @layer_protocol_name.setter + def layer_protocol_name(self, layer_protocol_name: List[TapiCommonLayerProtocolName]): + """Sets the layer_protocol_name of this TapiTopologyNode. + + none # noqa: E501 + + :param layer_protocol_name: The layer_protocol_name of this TapiTopologyNode. + :type layer_protocol_name: List[TapiCommonLayerProtocolName] + """ + + self._layer_protocol_name = layer_protocol_name + + @property + def encap_topology(self) -> TapiTopologyTopologyRef: + """Gets the encap_topology of this TapiTopologyNode. + + + :return: The encap_topology of this TapiTopologyNode. + :rtype: TapiTopologyTopologyRef + """ + return self._encap_topology + + @encap_topology.setter + def encap_topology(self, encap_topology: TapiTopologyTopologyRef): + """Sets the encap_topology of this TapiTopologyNode. + + + :param encap_topology: The encap_topology of this TapiTopologyNode. + :type encap_topology: TapiTopologyTopologyRef + """ + + self._encap_topology = encap_topology + + @property + def owned_node_edge_point(self) -> List[TapiTopologyNodeEdgePoint]: + """Gets the owned_node_edge_point of this TapiTopologyNode. + + none # noqa: E501 + + :return: The owned_node_edge_point of this TapiTopologyNode. + :rtype: List[TapiTopologyNodeEdgePoint] + """ + return self._owned_node_edge_point + + @owned_node_edge_point.setter + def owned_node_edge_point(self, owned_node_edge_point: List[TapiTopologyNodeEdgePoint]): + """Sets the owned_node_edge_point of this TapiTopologyNode. + + none # noqa: E501 + + :param owned_node_edge_point: The owned_node_edge_point of this TapiTopologyNode. + :type owned_node_edge_point: List[TapiTopologyNodeEdgePoint] + """ + + self._owned_node_edge_point = owned_node_edge_point + + @property + def node_rule_group(self) -> List[TapiTopologyNodeRuleGroup]: + """Gets the node_rule_group of this TapiTopologyNode. + + none # noqa: E501 + + :return: The node_rule_group of this TapiTopologyNode. + :rtype: List[TapiTopologyNodeRuleGroup] + """ + return self._node_rule_group + + @node_rule_group.setter + def node_rule_group(self, node_rule_group: List[TapiTopologyNodeRuleGroup]): + """Sets the node_rule_group of this TapiTopologyNode. + + none # noqa: E501 + + :param node_rule_group: The node_rule_group of this TapiTopologyNode. + :type node_rule_group: List[TapiTopologyNodeRuleGroup] + """ + + self._node_rule_group = node_rule_group + + @property + def aggregated_node_edge_point(self) -> List[TapiTopologyNodeEdgePointRef]: + """Gets the aggregated_node_edge_point of this TapiTopologyNode. + + none # noqa: E501 + + :return: The aggregated_node_edge_point of this TapiTopologyNode. + :rtype: List[TapiTopologyNodeEdgePointRef] + """ + return self._aggregated_node_edge_point + + @aggregated_node_edge_point.setter + def aggregated_node_edge_point(self, aggregated_node_edge_point: List[TapiTopologyNodeEdgePointRef]): + """Sets the aggregated_node_edge_point of this TapiTopologyNode. + + none # noqa: E501 + + :param aggregated_node_edge_point: The aggregated_node_edge_point of this TapiTopologyNode. + :type aggregated_node_edge_point: List[TapiTopologyNodeEdgePointRef] + """ + + self._aggregated_node_edge_point = aggregated_node_edge_point diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_node_edge_point.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_node_edge_point.py new file mode 100644 index 0000000000000000000000000000000000000000..7e87f23fb2e57a164b4c597d6892cf98fcb91819 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_node_edge_point.py @@ -0,0 +1,452 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_admin_state_pac import TapiCommonAdminStatePac # noqa: F401,E501 +from tapi_server.models.tapi_common_administrative_state import TapiCommonAdministrativeState # noqa: F401,E501 +from tapi_server.models.tapi_common_capacity import TapiCommonCapacity # noqa: F401,E501 +from tapi_server.models.tapi_common_capacity_pac import TapiCommonCapacityPac # noqa: F401,E501 +from tapi_server.models.tapi_common_global_class import TapiCommonGlobalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501 +from tapi_server.models.tapi_common_lifecycle_state import TapiCommonLifecycleState # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_common_operational_state import TapiCommonOperationalState # noqa: F401,E501 +from tapi_server.models.tapi_common_port_direction import TapiCommonPortDirection # noqa: F401,E501 +from tapi_server.models.tapi_common_port_role import TapiCommonPortRole # noqa: F401,E501 +from tapi_server.models.tapi_common_service_interface_point_ref import TapiCommonServiceInterfacePointRef # noqa: F401,E501 +from tapi_server.models.tapi_common_termination_direction import TapiCommonTerminationDirection # noqa: F401,E501 +from tapi_server.models.tapi_common_termination_pac import TapiCommonTerminationPac # noqa: F401,E501 +from tapi_server.models.tapi_common_termination_state import TapiCommonTerminationState # noqa: F401,E501 +from tapi_server.models.tapi_topology_node_edge_point_ref import TapiTopologyNodeEdgePointRef # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyNodeEdgePoint(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, available_capacity: TapiCommonCapacity=None, total_potential_capacity: TapiCommonCapacity=None, name: List[TapiCommonNameAndValue]=None, uuid: str=None, termination_direction: TapiCommonTerminationDirection=None, termination_state: TapiCommonTerminationState=None, operational_state: TapiCommonOperationalState=None, lifecycle_state: TapiCommonLifecycleState=None, administrative_state: TapiCommonAdministrativeState=None, link_port_role: TapiCommonPortRole=None, mapped_service_interface_point: List[TapiCommonServiceInterfacePointRef]=None, aggregated_node_edge_point: List[TapiTopologyNodeEdgePointRef]=None, layer_protocol_name: TapiCommonLayerProtocolName=None, link_port_direction: TapiCommonPortDirection=None, supported_cep_layer_protocol_qualifier: List[str]=None): # noqa: E501 + """TapiTopologyNodeEdgePoint - a model defined in Swagger + + :param available_capacity: The available_capacity of this TapiTopologyNodeEdgePoint. # noqa: E501 + :type available_capacity: TapiCommonCapacity + :param total_potential_capacity: The total_potential_capacity of this TapiTopologyNodeEdgePoint. # noqa: E501 + :type total_potential_capacity: TapiCommonCapacity + :param name: The name of this TapiTopologyNodeEdgePoint. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param uuid: The uuid of this TapiTopologyNodeEdgePoint. # noqa: E501 + :type uuid: str + :param termination_direction: The termination_direction of this TapiTopologyNodeEdgePoint. # noqa: E501 + :type termination_direction: TapiCommonTerminationDirection + :param termination_state: The termination_state of this TapiTopologyNodeEdgePoint. # noqa: E501 + :type termination_state: TapiCommonTerminationState + :param operational_state: The operational_state of this TapiTopologyNodeEdgePoint. # noqa: E501 + :type operational_state: TapiCommonOperationalState + :param lifecycle_state: The lifecycle_state of this TapiTopologyNodeEdgePoint. # noqa: E501 + :type lifecycle_state: TapiCommonLifecycleState + :param administrative_state: The administrative_state of this TapiTopologyNodeEdgePoint. # noqa: E501 + :type administrative_state: TapiCommonAdministrativeState + :param link_port_role: The link_port_role of this TapiTopologyNodeEdgePoint. # noqa: E501 + :type link_port_role: TapiCommonPortRole + :param mapped_service_interface_point: The mapped_service_interface_point of this TapiTopologyNodeEdgePoint. # noqa: E501 + :type mapped_service_interface_point: List[TapiCommonServiceInterfacePointRef] + :param aggregated_node_edge_point: The aggregated_node_edge_point of this TapiTopologyNodeEdgePoint. # noqa: E501 + :type aggregated_node_edge_point: List[TapiTopologyNodeEdgePointRef] + :param layer_protocol_name: The layer_protocol_name of this TapiTopologyNodeEdgePoint. # noqa: E501 + :type layer_protocol_name: TapiCommonLayerProtocolName + :param link_port_direction: The link_port_direction of this TapiTopologyNodeEdgePoint. # noqa: E501 + :type link_port_direction: TapiCommonPortDirection + :param supported_cep_layer_protocol_qualifier: The supported_cep_layer_protocol_qualifier of this TapiTopologyNodeEdgePoint. # noqa: E501 + :type supported_cep_layer_protocol_qualifier: List[str] + """ + self.swagger_types = { + 'available_capacity': TapiCommonCapacity, + 'total_potential_capacity': TapiCommonCapacity, + 'name': List[TapiCommonNameAndValue], + 'uuid': str, + 'termination_direction': TapiCommonTerminationDirection, + 'termination_state': TapiCommonTerminationState, + 'operational_state': TapiCommonOperationalState, + 'lifecycle_state': TapiCommonLifecycleState, + 'administrative_state': TapiCommonAdministrativeState, + 'link_port_role': TapiCommonPortRole, + 'mapped_service_interface_point': List[TapiCommonServiceInterfacePointRef], + 'aggregated_node_edge_point': List[TapiTopologyNodeEdgePointRef], + 'layer_protocol_name': TapiCommonLayerProtocolName, + 'link_port_direction': TapiCommonPortDirection, + 'supported_cep_layer_protocol_qualifier': List[str] + } + + self.attribute_map = { + 'available_capacity': 'available-capacity', + 'total_potential_capacity': 'total-potential-capacity', + 'name': 'name', + 'uuid': 'uuid', + 'termination_direction': 'termination-direction', + 'termination_state': 'termination-state', + 'operational_state': 'operational-state', + 'lifecycle_state': 'lifecycle-state', + 'administrative_state': 'administrative-state', + 'link_port_role': 'link-port-role', + 'mapped_service_interface_point': 'mapped-service-interface-point', + 'aggregated_node_edge_point': 'aggregated-node-edge-point', + 'layer_protocol_name': 'layer-protocol-name', + 'link_port_direction': 'link-port-direction', + 'supported_cep_layer_protocol_qualifier': 'supported-cep-layer-protocol-qualifier' + } + self._available_capacity = available_capacity + self._total_potential_capacity = total_potential_capacity + self._name = name + self._uuid = uuid + self._termination_direction = termination_direction + self._termination_state = termination_state + self._operational_state = operational_state + self._lifecycle_state = lifecycle_state + self._administrative_state = administrative_state + self._link_port_role = link_port_role + self._mapped_service_interface_point = mapped_service_interface_point + self._aggregated_node_edge_point = aggregated_node_edge_point + self._layer_protocol_name = layer_protocol_name + self._link_port_direction = link_port_direction + self._supported_cep_layer_protocol_qualifier = supported_cep_layer_protocol_qualifier + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyNodeEdgePoint': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.NodeEdgePoint of this TapiTopologyNodeEdgePoint. # noqa: E501 + :rtype: TapiTopologyNodeEdgePoint + """ + return util.deserialize_model(dikt, cls) + + @property + def available_capacity(self) -> TapiCommonCapacity: + """Gets the available_capacity of this TapiTopologyNodeEdgePoint. + + + :return: The available_capacity of this TapiTopologyNodeEdgePoint. + :rtype: TapiCommonCapacity + """ + return self._available_capacity + + @available_capacity.setter + def available_capacity(self, available_capacity: TapiCommonCapacity): + """Sets the available_capacity of this TapiTopologyNodeEdgePoint. + + + :param available_capacity: The available_capacity of this TapiTopologyNodeEdgePoint. + :type available_capacity: TapiCommonCapacity + """ + + self._available_capacity = available_capacity + + @property + def total_potential_capacity(self) -> TapiCommonCapacity: + """Gets the total_potential_capacity of this TapiTopologyNodeEdgePoint. + + + :return: The total_potential_capacity of this TapiTopologyNodeEdgePoint. + :rtype: TapiCommonCapacity + """ + return self._total_potential_capacity + + @total_potential_capacity.setter + def total_potential_capacity(self, total_potential_capacity: TapiCommonCapacity): + """Sets the total_potential_capacity of this TapiTopologyNodeEdgePoint. + + + :param total_potential_capacity: The total_potential_capacity of this TapiTopologyNodeEdgePoint. + :type total_potential_capacity: TapiCommonCapacity + """ + + self._total_potential_capacity = total_potential_capacity + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiTopologyNodeEdgePoint. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiTopologyNodeEdgePoint. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiTopologyNodeEdgePoint. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiTopologyNodeEdgePoint. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def uuid(self) -> str: + """Gets the uuid of this TapiTopologyNodeEdgePoint. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :return: The uuid of this TapiTopologyNodeEdgePoint. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid: str): + """Sets the uuid of this TapiTopologyNodeEdgePoint. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :param uuid: The uuid of this TapiTopologyNodeEdgePoint. + :type uuid: str + """ + + self._uuid = uuid + + @property + def termination_direction(self) -> TapiCommonTerminationDirection: + """Gets the termination_direction of this TapiTopologyNodeEdgePoint. + + + :return: The termination_direction of this TapiTopologyNodeEdgePoint. + :rtype: TapiCommonTerminationDirection + """ + return self._termination_direction + + @termination_direction.setter + def termination_direction(self, termination_direction: TapiCommonTerminationDirection): + """Sets the termination_direction of this TapiTopologyNodeEdgePoint. + + + :param termination_direction: The termination_direction of this TapiTopologyNodeEdgePoint. + :type termination_direction: TapiCommonTerminationDirection + """ + + self._termination_direction = termination_direction + + @property + def termination_state(self) -> TapiCommonTerminationState: + """Gets the termination_state of this TapiTopologyNodeEdgePoint. + + + :return: The termination_state of this TapiTopologyNodeEdgePoint. + :rtype: TapiCommonTerminationState + """ + return self._termination_state + + @termination_state.setter + def termination_state(self, termination_state: TapiCommonTerminationState): + """Sets the termination_state of this TapiTopologyNodeEdgePoint. + + + :param termination_state: The termination_state of this TapiTopologyNodeEdgePoint. + :type termination_state: TapiCommonTerminationState + """ + + self._termination_state = termination_state + + @property + def operational_state(self) -> TapiCommonOperationalState: + """Gets the operational_state of this TapiTopologyNodeEdgePoint. + + + :return: The operational_state of this TapiTopologyNodeEdgePoint. + :rtype: TapiCommonOperationalState + """ + return self._operational_state + + @operational_state.setter + def operational_state(self, operational_state: TapiCommonOperationalState): + """Sets the operational_state of this TapiTopologyNodeEdgePoint. + + + :param operational_state: The operational_state of this TapiTopologyNodeEdgePoint. + :type operational_state: TapiCommonOperationalState + """ + + self._operational_state = operational_state + + @property + def lifecycle_state(self) -> TapiCommonLifecycleState: + """Gets the lifecycle_state of this TapiTopologyNodeEdgePoint. + + + :return: The lifecycle_state of this TapiTopologyNodeEdgePoint. + :rtype: TapiCommonLifecycleState + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state: TapiCommonLifecycleState): + """Sets the lifecycle_state of this TapiTopologyNodeEdgePoint. + + + :param lifecycle_state: The lifecycle_state of this TapiTopologyNodeEdgePoint. + :type lifecycle_state: TapiCommonLifecycleState + """ + + self._lifecycle_state = lifecycle_state + + @property + def administrative_state(self) -> TapiCommonAdministrativeState: + """Gets the administrative_state of this TapiTopologyNodeEdgePoint. + + + :return: The administrative_state of this TapiTopologyNodeEdgePoint. + :rtype: TapiCommonAdministrativeState + """ + return self._administrative_state + + @administrative_state.setter + def administrative_state(self, administrative_state: TapiCommonAdministrativeState): + """Sets the administrative_state of this TapiTopologyNodeEdgePoint. + + + :param administrative_state: The administrative_state of this TapiTopologyNodeEdgePoint. + :type administrative_state: TapiCommonAdministrativeState + """ + + self._administrative_state = administrative_state + + @property + def link_port_role(self) -> TapiCommonPortRole: + """Gets the link_port_role of this TapiTopologyNodeEdgePoint. + + + :return: The link_port_role of this TapiTopologyNodeEdgePoint. + :rtype: TapiCommonPortRole + """ + return self._link_port_role + + @link_port_role.setter + def link_port_role(self, link_port_role: TapiCommonPortRole): + """Sets the link_port_role of this TapiTopologyNodeEdgePoint. + + + :param link_port_role: The link_port_role of this TapiTopologyNodeEdgePoint. + :type link_port_role: TapiCommonPortRole + """ + + self._link_port_role = link_port_role + + @property + def mapped_service_interface_point(self) -> List[TapiCommonServiceInterfacePointRef]: + """Gets the mapped_service_interface_point of this TapiTopologyNodeEdgePoint. + + NodeEdgePoint mapped to more than ServiceInterfacePoint (slicing/virtualizing) or a ServiceInterfacePoint mapped to more than one NodeEdgePoint (load balancing/Resilience) should be considered experimental # noqa: E501 + + :return: The mapped_service_interface_point of this TapiTopologyNodeEdgePoint. + :rtype: List[TapiCommonServiceInterfacePointRef] + """ + return self._mapped_service_interface_point + + @mapped_service_interface_point.setter + def mapped_service_interface_point(self, mapped_service_interface_point: List[TapiCommonServiceInterfacePointRef]): + """Sets the mapped_service_interface_point of this TapiTopologyNodeEdgePoint. + + NodeEdgePoint mapped to more than ServiceInterfacePoint (slicing/virtualizing) or a ServiceInterfacePoint mapped to more than one NodeEdgePoint (load balancing/Resilience) should be considered experimental # noqa: E501 + + :param mapped_service_interface_point: The mapped_service_interface_point of this TapiTopologyNodeEdgePoint. + :type mapped_service_interface_point: List[TapiCommonServiceInterfacePointRef] + """ + + self._mapped_service_interface_point = mapped_service_interface_point + + @property + def aggregated_node_edge_point(self) -> List[TapiTopologyNodeEdgePointRef]: + """Gets the aggregated_node_edge_point of this TapiTopologyNodeEdgePoint. + + none # noqa: E501 + + :return: The aggregated_node_edge_point of this TapiTopologyNodeEdgePoint. + :rtype: List[TapiTopologyNodeEdgePointRef] + """ + return self._aggregated_node_edge_point + + @aggregated_node_edge_point.setter + def aggregated_node_edge_point(self, aggregated_node_edge_point: List[TapiTopologyNodeEdgePointRef]): + """Sets the aggregated_node_edge_point of this TapiTopologyNodeEdgePoint. + + none # noqa: E501 + + :param aggregated_node_edge_point: The aggregated_node_edge_point of this TapiTopologyNodeEdgePoint. + :type aggregated_node_edge_point: List[TapiTopologyNodeEdgePointRef] + """ + + self._aggregated_node_edge_point = aggregated_node_edge_point + + @property + def layer_protocol_name(self) -> TapiCommonLayerProtocolName: + """Gets the layer_protocol_name of this TapiTopologyNodeEdgePoint. + + + :return: The layer_protocol_name of this TapiTopologyNodeEdgePoint. + :rtype: TapiCommonLayerProtocolName + """ + return self._layer_protocol_name + + @layer_protocol_name.setter + def layer_protocol_name(self, layer_protocol_name: TapiCommonLayerProtocolName): + """Sets the layer_protocol_name of this TapiTopologyNodeEdgePoint. + + + :param layer_protocol_name: The layer_protocol_name of this TapiTopologyNodeEdgePoint. + :type layer_protocol_name: TapiCommonLayerProtocolName + """ + + self._layer_protocol_name = layer_protocol_name + + @property + def link_port_direction(self) -> TapiCommonPortDirection: + """Gets the link_port_direction of this TapiTopologyNodeEdgePoint. + + + :return: The link_port_direction of this TapiTopologyNodeEdgePoint. + :rtype: TapiCommonPortDirection + """ + return self._link_port_direction + + @link_port_direction.setter + def link_port_direction(self, link_port_direction: TapiCommonPortDirection): + """Sets the link_port_direction of this TapiTopologyNodeEdgePoint. + + + :param link_port_direction: The link_port_direction of this TapiTopologyNodeEdgePoint. + :type link_port_direction: TapiCommonPortDirection + """ + + self._link_port_direction = link_port_direction + + @property + def supported_cep_layer_protocol_qualifier(self) -> List[str]: + """Gets the supported_cep_layer_protocol_qualifier of this TapiTopologyNodeEdgePoint. + + none # noqa: E501 + + :return: The supported_cep_layer_protocol_qualifier of this TapiTopologyNodeEdgePoint. + :rtype: List[str] + """ + return self._supported_cep_layer_protocol_qualifier + + @supported_cep_layer_protocol_qualifier.setter + def supported_cep_layer_protocol_qualifier(self, supported_cep_layer_protocol_qualifier: List[str]): + """Sets the supported_cep_layer_protocol_qualifier of this TapiTopologyNodeEdgePoint. + + none # noqa: E501 + + :param supported_cep_layer_protocol_qualifier: The supported_cep_layer_protocol_qualifier of this TapiTopologyNodeEdgePoint. + :type supported_cep_layer_protocol_qualifier: List[str] + """ + + self._supported_cep_layer_protocol_qualifier = supported_cep_layer_protocol_qualifier diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_node_edge_point_ref.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_node_edge_point_ref.py new file mode 100644 index 0000000000000000000000000000000000000000..5780fe383116f0b8c377e2a92b7e54013dd07273 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_node_edge_point_ref.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_node_ref import TapiTopologyNodeRef # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyNodeEdgePointRef(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, node_uuid: str=None, node_edge_point_uuid: str=None): # noqa: E501 + """TapiTopologyNodeEdgePointRef - a model defined in Swagger + + :param node_uuid: The node_uuid of this TapiTopologyNodeEdgePointRef. # noqa: E501 + :type node_uuid: str + :param node_edge_point_uuid: The node_edge_point_uuid of this TapiTopologyNodeEdgePointRef. # noqa: E501 + :type node_edge_point_uuid: str + """ + self.swagger_types = { + 'node_uuid': str, + 'node_edge_point_uuid': str + } + + self.attribute_map = { + 'node_uuid': 'node-uuid', + 'node_edge_point_uuid': 'node-edge-point-uuid' + } + self._node_uuid = node_uuid + self._node_edge_point_uuid = node_edge_point_uuid + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyNodeEdgePointRef': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.NodeEdgePointRef of this TapiTopologyNodeEdgePointRef. # noqa: E501 + :rtype: TapiTopologyNodeEdgePointRef + """ + return util.deserialize_model(dikt, cls) + + @property + def node_uuid(self) -> str: + """Gets the node_uuid of this TapiTopologyNodeEdgePointRef. + + none # noqa: E501 + + :return: The node_uuid of this TapiTopologyNodeEdgePointRef. + :rtype: str + """ + return self._node_uuid + + @node_uuid.setter + def node_uuid(self, node_uuid: str): + """Sets the node_uuid of this TapiTopologyNodeEdgePointRef. + + none # noqa: E501 + + :param node_uuid: The node_uuid of this TapiTopologyNodeEdgePointRef. + :type node_uuid: str + """ + + self._node_uuid = node_uuid + + @property + def node_edge_point_uuid(self) -> str: + """Gets the node_edge_point_uuid of this TapiTopologyNodeEdgePointRef. + + none # noqa: E501 + + :return: The node_edge_point_uuid of this TapiTopologyNodeEdgePointRef. + :rtype: str + """ + return self._node_edge_point_uuid + + @node_edge_point_uuid.setter + def node_edge_point_uuid(self, node_edge_point_uuid: str): + """Sets the node_edge_point_uuid of this TapiTopologyNodeEdgePointRef. + + none # noqa: E501 + + :param node_edge_point_uuid: The node_edge_point_uuid of this TapiTopologyNodeEdgePointRef. + :type node_edge_point_uuid: str + """ + + self._node_edge_point_uuid = node_edge_point_uuid diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_node_edge_point_ref_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_node_edge_point_ref_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..750dd69251bf55f4b1f839b141293d37fcb84ba8 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_node_edge_point_ref_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_node_edge_point_ref import TapiTopologyNodeEdgePointRef # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyNodeEdgePointRefWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, node_edge_point: TapiTopologyNodeEdgePointRef=None): # noqa: E501 + """TapiTopologyNodeEdgePointRefWrapper - a model defined in Swagger + + :param node_edge_point: The node_edge_point of this TapiTopologyNodeEdgePointRefWrapper. # noqa: E501 + :type node_edge_point: TapiTopologyNodeEdgePointRef + """ + self.swagger_types = { + 'node_edge_point': TapiTopologyNodeEdgePointRef + } + + self.attribute_map = { + 'node_edge_point': 'node-edge-point' + } + self._node_edge_point = node_edge_point + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyNodeEdgePointRefWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.NodeEdgePointRefWrapper of this TapiTopologyNodeEdgePointRefWrapper. # noqa: E501 + :rtype: TapiTopologyNodeEdgePointRefWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def node_edge_point(self) -> TapiTopologyNodeEdgePointRef: + """Gets the node_edge_point of this TapiTopologyNodeEdgePointRefWrapper. + + + :return: The node_edge_point of this TapiTopologyNodeEdgePointRefWrapper. + :rtype: TapiTopologyNodeEdgePointRef + """ + return self._node_edge_point + + @node_edge_point.setter + def node_edge_point(self, node_edge_point: TapiTopologyNodeEdgePointRef): + """Sets the node_edge_point of this TapiTopologyNodeEdgePointRefWrapper. + + + :param node_edge_point: The node_edge_point of this TapiTopologyNodeEdgePointRefWrapper. + :type node_edge_point: TapiTopologyNodeEdgePointRef + """ + + self._node_edge_point = node_edge_point diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_node_owned_node_edge_point.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_node_owned_node_edge_point.py new file mode 100644 index 0000000000000000000000000000000000000000..ca6356844176a105e7b6d970680a78a21d307772 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_node_owned_node_edge_point.py @@ -0,0 +1,396 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_capacity import TapiCommonCapacity # noqa: F401,E501 +from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_common_port_direction import TapiCommonPortDirection # noqa: F401,E501 +from tapi_server.models.tapi_common_port_role import TapiCommonPortRole # noqa: F401,E501 +from tapi_server.models.tapi_common_service_interface_point_ref import TapiCommonServiceInterfacePointRef # noqa: F401,E501 +from tapi_server.models.tapi_common_termination_direction import TapiCommonTerminationDirection # noqa: F401,E501 +from tapi_server.models.tapi_common_termination_state import TapiCommonTerminationState # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_cep_list import TapiConnectivityCepList # noqa: F401,E501 +from tapi_server.models.tapi_connectivity_owned_node_edge_point_augmentation1 import TapiConnectivityOwnedNodeEdgePointAugmentation1 # noqa: F401,E501 +from tapi_server.models.tapi_topology_node_edge_point import TapiTopologyNodeEdgePoint # noqa: F401,E501 +from tapi_server.models.tapi_topology_node_edge_point_ref import TapiTopologyNodeEdgePointRef # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyNodeOwnedNodeEdgePoint(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, available_capacity: TapiCommonCapacity=None, total_potential_capacity: TapiCommonCapacity=None, name: List[TapiCommonNameAndValue]=None, uuid: str=None, termination_direction: TapiCommonTerminationDirection=None, termination_state: TapiCommonTerminationState=None, link_port_role: TapiCommonPortRole=None, mapped_service_interface_point: List[TapiCommonServiceInterfacePointRef]=None, aggregated_node_edge_point: List[TapiTopologyNodeEdgePointRef]=None, layer_protocol_name: TapiCommonLayerProtocolName=None, link_port_direction: TapiCommonPortDirection=None, supported_cep_layer_protocol_qualifier: List[str]=None, cep_list: TapiConnectivityCepList=None): # noqa: E501 + """TapiTopologyNodeOwnedNodeEdgePoint - a model defined in Swagger + + :param available_capacity: The available_capacity of this TapiTopologyNodeOwnedNodeEdgePoint. # noqa: E501 + :type available_capacity: TapiCommonCapacity + :param total_potential_capacity: The total_potential_capacity of this TapiTopologyNodeOwnedNodeEdgePoint. # noqa: E501 + :type total_potential_capacity: TapiCommonCapacity + :param name: The name of this TapiTopologyNodeOwnedNodeEdgePoint. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param uuid: The uuid of this TapiTopologyNodeOwnedNodeEdgePoint. # noqa: E501 + :type uuid: str + :param termination_direction: The termination_direction of this TapiTopologyNodeOwnedNodeEdgePoint. # noqa: E501 + :type termination_direction: TapiCommonTerminationDirection + :param termination_state: The termination_state of this TapiTopologyNodeOwnedNodeEdgePoint. # noqa: E501 + :type termination_state: TapiCommonTerminationState + :param link_port_role: The link_port_role of this TapiTopologyNodeOwnedNodeEdgePoint. # noqa: E501 + :type link_port_role: TapiCommonPortRole + :param mapped_service_interface_point: The mapped_service_interface_point of this TapiTopologyNodeOwnedNodeEdgePoint. # noqa: E501 + :type mapped_service_interface_point: List[TapiCommonServiceInterfacePointRef] + :param aggregated_node_edge_point: The aggregated_node_edge_point of this TapiTopologyNodeOwnedNodeEdgePoint. # noqa: E501 + :type aggregated_node_edge_point: List[TapiTopologyNodeEdgePointRef] + :param layer_protocol_name: The layer_protocol_name of this TapiTopologyNodeOwnedNodeEdgePoint. # noqa: E501 + :type layer_protocol_name: TapiCommonLayerProtocolName + :param link_port_direction: The link_port_direction of this TapiTopologyNodeOwnedNodeEdgePoint. # noqa: E501 + :type link_port_direction: TapiCommonPortDirection + :param supported_cep_layer_protocol_qualifier: The supported_cep_layer_protocol_qualifier of this TapiTopologyNodeOwnedNodeEdgePoint. # noqa: E501 + :type supported_cep_layer_protocol_qualifier: List[str] + :param cep_list: The cep_list of this TapiTopologyNodeOwnedNodeEdgePoint. # noqa: E501 + :type cep_list: TapiConnectivityCepList + """ + self.swagger_types = { + 'available_capacity': TapiCommonCapacity, + 'total_potential_capacity': TapiCommonCapacity, + 'name': List[TapiCommonNameAndValue], + 'uuid': str, + 'termination_direction': TapiCommonTerminationDirection, + 'termination_state': TapiCommonTerminationState, + 'link_port_role': TapiCommonPortRole, + 'mapped_service_interface_point': List[TapiCommonServiceInterfacePointRef], + 'aggregated_node_edge_point': List[TapiTopologyNodeEdgePointRef], + 'layer_protocol_name': TapiCommonLayerProtocolName, + 'link_port_direction': TapiCommonPortDirection, + 'supported_cep_layer_protocol_qualifier': List[str], + 'cep_list': TapiConnectivityCepList + } + + self.attribute_map = { + 'available_capacity': 'available-capacity', + 'total_potential_capacity': 'total-potential-capacity', + 'name': 'name', + 'uuid': 'uuid', + 'termination_direction': 'termination-direction', + 'termination_state': 'termination-state', + 'link_port_role': 'link-port-role', + 'mapped_service_interface_point': 'mapped-service-interface-point', + 'aggregated_node_edge_point': 'aggregated-node-edge-point', + 'layer_protocol_name': 'layer-protocol-name', + 'link_port_direction': 'link-port-direction', + 'supported_cep_layer_protocol_qualifier': 'supported-cep-layer-protocol-qualifier', + 'cep_list': 'cep-list' + } + self._available_capacity = available_capacity + self._total_potential_capacity = total_potential_capacity + self._name = name + self._uuid = uuid + self._termination_direction = termination_direction + self._termination_state = termination_state + self._link_port_role = link_port_role + self._mapped_service_interface_point = mapped_service_interface_point + self._aggregated_node_edge_point = aggregated_node_edge_point + self._layer_protocol_name = layer_protocol_name + self._link_port_direction = link_port_direction + self._supported_cep_layer_protocol_qualifier = supported_cep_layer_protocol_qualifier + self._cep_list = cep_list + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyNodeOwnedNodeEdgePoint': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.node.OwnedNodeEdgePoint of this TapiTopologyNodeOwnedNodeEdgePoint. # noqa: E501 + :rtype: TapiTopologyNodeOwnedNodeEdgePoint + """ + return util.deserialize_model(dikt, cls) + + @property + def available_capacity(self) -> TapiCommonCapacity: + """Gets the available_capacity of this TapiTopologyNodeOwnedNodeEdgePoint. + + + :return: The available_capacity of this TapiTopologyNodeOwnedNodeEdgePoint. + :rtype: TapiCommonCapacity + """ + return self._available_capacity + + @available_capacity.setter + def available_capacity(self, available_capacity: TapiCommonCapacity): + """Sets the available_capacity of this TapiTopologyNodeOwnedNodeEdgePoint. + + + :param available_capacity: The available_capacity of this TapiTopologyNodeOwnedNodeEdgePoint. + :type available_capacity: TapiCommonCapacity + """ + + self._available_capacity = available_capacity + + @property + def total_potential_capacity(self) -> TapiCommonCapacity: + """Gets the total_potential_capacity of this TapiTopologyNodeOwnedNodeEdgePoint. + + + :return: The total_potential_capacity of this TapiTopologyNodeOwnedNodeEdgePoint. + :rtype: TapiCommonCapacity + """ + return self._total_potential_capacity + + @total_potential_capacity.setter + def total_potential_capacity(self, total_potential_capacity: TapiCommonCapacity): + """Sets the total_potential_capacity of this TapiTopologyNodeOwnedNodeEdgePoint. + + + :param total_potential_capacity: The total_potential_capacity of this TapiTopologyNodeOwnedNodeEdgePoint. + :type total_potential_capacity: TapiCommonCapacity + """ + + self._total_potential_capacity = total_potential_capacity + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiTopologyNodeOwnedNodeEdgePoint. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiTopologyNodeOwnedNodeEdgePoint. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiTopologyNodeOwnedNodeEdgePoint. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiTopologyNodeOwnedNodeEdgePoint. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def uuid(self) -> str: + """Gets the uuid of this TapiTopologyNodeOwnedNodeEdgePoint. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :return: The uuid of this TapiTopologyNodeOwnedNodeEdgePoint. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid: str): + """Sets the uuid of this TapiTopologyNodeOwnedNodeEdgePoint. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :param uuid: The uuid of this TapiTopologyNodeOwnedNodeEdgePoint. + :type uuid: str + """ + + self._uuid = uuid + + @property + def termination_direction(self) -> TapiCommonTerminationDirection: + """Gets the termination_direction of this TapiTopologyNodeOwnedNodeEdgePoint. + + + :return: The termination_direction of this TapiTopologyNodeOwnedNodeEdgePoint. + :rtype: TapiCommonTerminationDirection + """ + return self._termination_direction + + @termination_direction.setter + def termination_direction(self, termination_direction: TapiCommonTerminationDirection): + """Sets the termination_direction of this TapiTopologyNodeOwnedNodeEdgePoint. + + + :param termination_direction: The termination_direction of this TapiTopologyNodeOwnedNodeEdgePoint. + :type termination_direction: TapiCommonTerminationDirection + """ + + self._termination_direction = termination_direction + + @property + def termination_state(self) -> TapiCommonTerminationState: + """Gets the termination_state of this TapiTopologyNodeOwnedNodeEdgePoint. + + + :return: The termination_state of this TapiTopologyNodeOwnedNodeEdgePoint. + :rtype: TapiCommonTerminationState + """ + return self._termination_state + + @termination_state.setter + def termination_state(self, termination_state: TapiCommonTerminationState): + """Sets the termination_state of this TapiTopologyNodeOwnedNodeEdgePoint. + + + :param termination_state: The termination_state of this TapiTopologyNodeOwnedNodeEdgePoint. + :type termination_state: TapiCommonTerminationState + """ + + self._termination_state = termination_state + + @property + def link_port_role(self) -> TapiCommonPortRole: + """Gets the link_port_role of this TapiTopologyNodeOwnedNodeEdgePoint. + + + :return: The link_port_role of this TapiTopologyNodeOwnedNodeEdgePoint. + :rtype: TapiCommonPortRole + """ + return self._link_port_role + + @link_port_role.setter + def link_port_role(self, link_port_role: TapiCommonPortRole): + """Sets the link_port_role of this TapiTopologyNodeOwnedNodeEdgePoint. + + + :param link_port_role: The link_port_role of this TapiTopologyNodeOwnedNodeEdgePoint. + :type link_port_role: TapiCommonPortRole + """ + + self._link_port_role = link_port_role + + @property + def mapped_service_interface_point(self) -> List[TapiCommonServiceInterfacePointRef]: + """Gets the mapped_service_interface_point of this TapiTopologyNodeOwnedNodeEdgePoint. + + NodeEdgePoint mapped to more than ServiceInterfacePoint (slicing/virtualizing) or a ServiceInterfacePoint mapped to more than one NodeEdgePoint (load balancing/Resilience) should be considered experimental # noqa: E501 + + :return: The mapped_service_interface_point of this TapiTopologyNodeOwnedNodeEdgePoint. + :rtype: List[TapiCommonServiceInterfacePointRef] + """ + return self._mapped_service_interface_point + + @mapped_service_interface_point.setter + def mapped_service_interface_point(self, mapped_service_interface_point: List[TapiCommonServiceInterfacePointRef]): + """Sets the mapped_service_interface_point of this TapiTopologyNodeOwnedNodeEdgePoint. + + NodeEdgePoint mapped to more than ServiceInterfacePoint (slicing/virtualizing) or a ServiceInterfacePoint mapped to more than one NodeEdgePoint (load balancing/Resilience) should be considered experimental # noqa: E501 + + :param mapped_service_interface_point: The mapped_service_interface_point of this TapiTopologyNodeOwnedNodeEdgePoint. + :type mapped_service_interface_point: List[TapiCommonServiceInterfacePointRef] + """ + + self._mapped_service_interface_point = mapped_service_interface_point + + @property + def aggregated_node_edge_point(self) -> List[TapiTopologyNodeEdgePointRef]: + """Gets the aggregated_node_edge_point of this TapiTopologyNodeOwnedNodeEdgePoint. + + none # noqa: E501 + + :return: The aggregated_node_edge_point of this TapiTopologyNodeOwnedNodeEdgePoint. + :rtype: List[TapiTopologyNodeEdgePointRef] + """ + return self._aggregated_node_edge_point + + @aggregated_node_edge_point.setter + def aggregated_node_edge_point(self, aggregated_node_edge_point: List[TapiTopologyNodeEdgePointRef]): + """Sets the aggregated_node_edge_point of this TapiTopologyNodeOwnedNodeEdgePoint. + + none # noqa: E501 + + :param aggregated_node_edge_point: The aggregated_node_edge_point of this TapiTopologyNodeOwnedNodeEdgePoint. + :type aggregated_node_edge_point: List[TapiTopologyNodeEdgePointRef] + """ + + self._aggregated_node_edge_point = aggregated_node_edge_point + + @property + def layer_protocol_name(self) -> TapiCommonLayerProtocolName: + """Gets the layer_protocol_name of this TapiTopologyNodeOwnedNodeEdgePoint. + + + :return: The layer_protocol_name of this TapiTopologyNodeOwnedNodeEdgePoint. + :rtype: TapiCommonLayerProtocolName + """ + return self._layer_protocol_name + + @layer_protocol_name.setter + def layer_protocol_name(self, layer_protocol_name: TapiCommonLayerProtocolName): + """Sets the layer_protocol_name of this TapiTopologyNodeOwnedNodeEdgePoint. + + + :param layer_protocol_name: The layer_protocol_name of this TapiTopologyNodeOwnedNodeEdgePoint. + :type layer_protocol_name: TapiCommonLayerProtocolName + """ + + self._layer_protocol_name = layer_protocol_name + + @property + def link_port_direction(self) -> TapiCommonPortDirection: + """Gets the link_port_direction of this TapiTopologyNodeOwnedNodeEdgePoint. + + + :return: The link_port_direction of this TapiTopologyNodeOwnedNodeEdgePoint. + :rtype: TapiCommonPortDirection + """ + return self._link_port_direction + + @link_port_direction.setter + def link_port_direction(self, link_port_direction: TapiCommonPortDirection): + """Sets the link_port_direction of this TapiTopologyNodeOwnedNodeEdgePoint. + + + :param link_port_direction: The link_port_direction of this TapiTopologyNodeOwnedNodeEdgePoint. + :type link_port_direction: TapiCommonPortDirection + """ + + self._link_port_direction = link_port_direction + + @property + def supported_cep_layer_protocol_qualifier(self) -> List[str]: + """Gets the supported_cep_layer_protocol_qualifier of this TapiTopologyNodeOwnedNodeEdgePoint. + + none # noqa: E501 + + :return: The supported_cep_layer_protocol_qualifier of this TapiTopologyNodeOwnedNodeEdgePoint. + :rtype: List[str] + """ + return self._supported_cep_layer_protocol_qualifier + + @supported_cep_layer_protocol_qualifier.setter + def supported_cep_layer_protocol_qualifier(self, supported_cep_layer_protocol_qualifier: List[str]): + """Sets the supported_cep_layer_protocol_qualifier of this TapiTopologyNodeOwnedNodeEdgePoint. + + none # noqa: E501 + + :param supported_cep_layer_protocol_qualifier: The supported_cep_layer_protocol_qualifier of this TapiTopologyNodeOwnedNodeEdgePoint. + :type supported_cep_layer_protocol_qualifier: List[str] + """ + + self._supported_cep_layer_protocol_qualifier = supported_cep_layer_protocol_qualifier + + @property + def cep_list(self) -> TapiConnectivityCepList: + """Gets the cep_list of this TapiTopologyNodeOwnedNodeEdgePoint. + + + :return: The cep_list of this TapiTopologyNodeOwnedNodeEdgePoint. + :rtype: TapiConnectivityCepList + """ + return self._cep_list + + @cep_list.setter + def cep_list(self, cep_list: TapiConnectivityCepList): + """Sets the cep_list of this TapiTopologyNodeOwnedNodeEdgePoint. + + + :param cep_list: The cep_list of this TapiTopologyNodeOwnedNodeEdgePoint. + :type cep_list: TapiConnectivityCepList + """ + + self._cep_list = cep_list diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_node_owned_node_edge_point_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_node_owned_node_edge_point_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..625b248341e9a782de2da647ba2cc5c870346971 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_node_owned_node_edge_point_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_node_owned_node_edge_point import TapiTopologyNodeOwnedNodeEdgePoint # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyNodeOwnedNodeEdgePointWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, owned_node_edge_point: TapiTopologyNodeOwnedNodeEdgePoint=None): # noqa: E501 + """TapiTopologyNodeOwnedNodeEdgePointWrapper - a model defined in Swagger + + :param owned_node_edge_point: The owned_node_edge_point of this TapiTopologyNodeOwnedNodeEdgePointWrapper. # noqa: E501 + :type owned_node_edge_point: TapiTopologyNodeOwnedNodeEdgePoint + """ + self.swagger_types = { + 'owned_node_edge_point': TapiTopologyNodeOwnedNodeEdgePoint + } + + self.attribute_map = { + 'owned_node_edge_point': 'owned-node-edge-point' + } + self._owned_node_edge_point = owned_node_edge_point + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyNodeOwnedNodeEdgePointWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.node.OwnedNodeEdgePointWrapper of this TapiTopologyNodeOwnedNodeEdgePointWrapper. # noqa: E501 + :rtype: TapiTopologyNodeOwnedNodeEdgePointWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def owned_node_edge_point(self) -> TapiTopologyNodeOwnedNodeEdgePoint: + """Gets the owned_node_edge_point of this TapiTopologyNodeOwnedNodeEdgePointWrapper. + + + :return: The owned_node_edge_point of this TapiTopologyNodeOwnedNodeEdgePointWrapper. + :rtype: TapiTopologyNodeOwnedNodeEdgePoint + """ + return self._owned_node_edge_point + + @owned_node_edge_point.setter + def owned_node_edge_point(self, owned_node_edge_point: TapiTopologyNodeOwnedNodeEdgePoint): + """Sets the owned_node_edge_point of this TapiTopologyNodeOwnedNodeEdgePointWrapper. + + + :param owned_node_edge_point: The owned_node_edge_point of this TapiTopologyNodeOwnedNodeEdgePointWrapper. + :type owned_node_edge_point: TapiTopologyNodeOwnedNodeEdgePoint + """ + + self._owned_node_edge_point = owned_node_edge_point diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_node_ref.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_node_ref.py new file mode 100644 index 0000000000000000000000000000000000000000..28ada09fba172a38d556cdc208e73e55d3df2c3c --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_node_ref.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_topology_ref import TapiTopologyTopologyRef # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyNodeRef(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, topology_uuid: str=None, node_uuid: str=None): # noqa: E501 + """TapiTopologyNodeRef - a model defined in Swagger + + :param topology_uuid: The topology_uuid of this TapiTopologyNodeRef. # noqa: E501 + :type topology_uuid: str + :param node_uuid: The node_uuid of this TapiTopologyNodeRef. # noqa: E501 + :type node_uuid: str + """ + self.swagger_types = { + 'topology_uuid': str, + 'node_uuid': str + } + + self.attribute_map = { + 'topology_uuid': 'topology-uuid', + 'node_uuid': 'node-uuid' + } + self._topology_uuid = topology_uuid + self._node_uuid = node_uuid + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyNodeRef': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.NodeRef of this TapiTopologyNodeRef. # noqa: E501 + :rtype: TapiTopologyNodeRef + """ + return util.deserialize_model(dikt, cls) + + @property + def topology_uuid(self) -> str: + """Gets the topology_uuid of this TapiTopologyNodeRef. + + none # noqa: E501 + + :return: The topology_uuid of this TapiTopologyNodeRef. + :rtype: str + """ + return self._topology_uuid + + @topology_uuid.setter + def topology_uuid(self, topology_uuid: str): + """Sets the topology_uuid of this TapiTopologyNodeRef. + + none # noqa: E501 + + :param topology_uuid: The topology_uuid of this TapiTopologyNodeRef. + :type topology_uuid: str + """ + + self._topology_uuid = topology_uuid + + @property + def node_uuid(self) -> str: + """Gets the node_uuid of this TapiTopologyNodeRef. + + none # noqa: E501 + + :return: The node_uuid of this TapiTopologyNodeRef. + :rtype: str + """ + return self._node_uuid + + @node_uuid.setter + def node_uuid(self, node_uuid: str): + """Sets the node_uuid of this TapiTopologyNodeRef. + + none # noqa: E501 + + :param node_uuid: The node_uuid of this TapiTopologyNodeRef. + :type node_uuid: str + """ + + self._node_uuid = node_uuid diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_node_rule_group.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_node_rule_group.py new file mode 100644 index 0000000000000000000000000000000000000000..af337f38d2a13f58990907fc25061e9007445726 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_node_rule_group.py @@ -0,0 +1,354 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_capacity import TapiCommonCapacity # noqa: F401,E501 +from tapi_server.models.tapi_common_capacity_pac import TapiCommonCapacityPac # noqa: F401,E501 +from tapi_server.models.tapi_common_global_class import TapiCommonGlobalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_topology_cost_characteristic import TapiTopologyCostCharacteristic # noqa: F401,E501 +from tapi_server.models.tapi_topology_inter_rule_group import TapiTopologyInterRuleGroup # noqa: F401,E501 +from tapi_server.models.tapi_topology_latency_characteristic import TapiTopologyLatencyCharacteristic # noqa: F401,E501 +from tapi_server.models.tapi_topology_node_edge_point_ref import TapiTopologyNodeEdgePointRef # noqa: F401,E501 +from tapi_server.models.tapi_topology_node_rule_group_ref import TapiTopologyNodeRuleGroupRef # noqa: F401,E501 +from tapi_server.models.tapi_topology_risk_characteristic import TapiTopologyRiskCharacteristic # noqa: F401,E501 +from tapi_server.models.tapi_topology_risk_parameter_pac import TapiTopologyRiskParameterPac # noqa: F401,E501 +from tapi_server.models.tapi_topology_rule import TapiTopologyRule # noqa: F401,E501 +from tapi_server.models.tapi_topology_transfer_cost_pac import TapiTopologyTransferCostPac # noqa: F401,E501 +from tapi_server.models.tapi_topology_transfer_timing_pac import TapiTopologyTransferTimingPac # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyNodeRuleGroup(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: List[TapiCommonNameAndValue]=None, uuid: str=None, risk_characteristic: List[TapiTopologyRiskCharacteristic]=None, cost_characteristic: List[TapiTopologyCostCharacteristic]=None, latency_characteristic: List[TapiTopologyLatencyCharacteristic]=None, available_capacity: TapiCommonCapacity=None, total_potential_capacity: TapiCommonCapacity=None, inter_rule_group: List[TapiTopologyInterRuleGroup]=None, rule: List[TapiTopologyRule]=None, node_rule_group: List[TapiTopologyNodeRuleGroupRef]=None, node_edge_point: List[TapiTopologyNodeEdgePointRef]=None): # noqa: E501 + """TapiTopologyNodeRuleGroup - a model defined in Swagger + + :param name: The name of this TapiTopologyNodeRuleGroup. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param uuid: The uuid of this TapiTopologyNodeRuleGroup. # noqa: E501 + :type uuid: str + :param risk_characteristic: The risk_characteristic of this TapiTopologyNodeRuleGroup. # noqa: E501 + :type risk_characteristic: List[TapiTopologyRiskCharacteristic] + :param cost_characteristic: The cost_characteristic of this TapiTopologyNodeRuleGroup. # noqa: E501 + :type cost_characteristic: List[TapiTopologyCostCharacteristic] + :param latency_characteristic: The latency_characteristic of this TapiTopologyNodeRuleGroup. # noqa: E501 + :type latency_characteristic: List[TapiTopologyLatencyCharacteristic] + :param available_capacity: The available_capacity of this TapiTopologyNodeRuleGroup. # noqa: E501 + :type available_capacity: TapiCommonCapacity + :param total_potential_capacity: The total_potential_capacity of this TapiTopologyNodeRuleGroup. # noqa: E501 + :type total_potential_capacity: TapiCommonCapacity + :param inter_rule_group: The inter_rule_group of this TapiTopologyNodeRuleGroup. # noqa: E501 + :type inter_rule_group: List[TapiTopologyInterRuleGroup] + :param rule: The rule of this TapiTopologyNodeRuleGroup. # noqa: E501 + :type rule: List[TapiTopologyRule] + :param node_rule_group: The node_rule_group of this TapiTopologyNodeRuleGroup. # noqa: E501 + :type node_rule_group: List[TapiTopologyNodeRuleGroupRef] + :param node_edge_point: The node_edge_point of this TapiTopologyNodeRuleGroup. # noqa: E501 + :type node_edge_point: List[TapiTopologyNodeEdgePointRef] + """ + self.swagger_types = { + 'name': List[TapiCommonNameAndValue], + 'uuid': str, + 'risk_characteristic': List[TapiTopologyRiskCharacteristic], + 'cost_characteristic': List[TapiTopologyCostCharacteristic], + 'latency_characteristic': List[TapiTopologyLatencyCharacteristic], + 'available_capacity': TapiCommonCapacity, + 'total_potential_capacity': TapiCommonCapacity, + 'inter_rule_group': List[TapiTopologyInterRuleGroup], + 'rule': List[TapiTopologyRule], + 'node_rule_group': List[TapiTopologyNodeRuleGroupRef], + 'node_edge_point': List[TapiTopologyNodeEdgePointRef] + } + + self.attribute_map = { + 'name': 'name', + 'uuid': 'uuid', + 'risk_characteristic': 'risk-characteristic', + 'cost_characteristic': 'cost-characteristic', + 'latency_characteristic': 'latency-characteristic', + 'available_capacity': 'available-capacity', + 'total_potential_capacity': 'total-potential-capacity', + 'inter_rule_group': 'inter-rule-group', + 'rule': 'rule', + 'node_rule_group': 'node-rule-group', + 'node_edge_point': 'node-edge-point' + } + self._name = name + self._uuid = uuid + self._risk_characteristic = risk_characteristic + self._cost_characteristic = cost_characteristic + self._latency_characteristic = latency_characteristic + self._available_capacity = available_capacity + self._total_potential_capacity = total_potential_capacity + self._inter_rule_group = inter_rule_group + self._rule = rule + self._node_rule_group = node_rule_group + self._node_edge_point = node_edge_point + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyNodeRuleGroup': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.NodeRuleGroup of this TapiTopologyNodeRuleGroup. # noqa: E501 + :rtype: TapiTopologyNodeRuleGroup + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiTopologyNodeRuleGroup. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiTopologyNodeRuleGroup. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiTopologyNodeRuleGroup. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiTopologyNodeRuleGroup. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def uuid(self) -> str: + """Gets the uuid of this TapiTopologyNodeRuleGroup. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :return: The uuid of this TapiTopologyNodeRuleGroup. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid: str): + """Sets the uuid of this TapiTopologyNodeRuleGroup. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :param uuid: The uuid of this TapiTopologyNodeRuleGroup. + :type uuid: str + """ + + self._uuid = uuid + + @property + def risk_characteristic(self) -> List[TapiTopologyRiskCharacteristic]: + """Gets the risk_characteristic of this TapiTopologyNodeRuleGroup. + + A list of risk characteristics for consideration in an analysis of shared risk. Each element of the list represents a specific risk consideration. # noqa: E501 + + :return: The risk_characteristic of this TapiTopologyNodeRuleGroup. + :rtype: List[TapiTopologyRiskCharacteristic] + """ + return self._risk_characteristic + + @risk_characteristic.setter + def risk_characteristic(self, risk_characteristic: List[TapiTopologyRiskCharacteristic]): + """Sets the risk_characteristic of this TapiTopologyNodeRuleGroup. + + A list of risk characteristics for consideration in an analysis of shared risk. Each element of the list represents a specific risk consideration. # noqa: E501 + + :param risk_characteristic: The risk_characteristic of this TapiTopologyNodeRuleGroup. + :type risk_characteristic: List[TapiTopologyRiskCharacteristic] + """ + + self._risk_characteristic = risk_characteristic + + @property + def cost_characteristic(self) -> List[TapiTopologyCostCharacteristic]: + """Gets the cost_characteristic of this TapiTopologyNodeRuleGroup. + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :return: The cost_characteristic of this TapiTopologyNodeRuleGroup. + :rtype: List[TapiTopologyCostCharacteristic] + """ + return self._cost_characteristic + + @cost_characteristic.setter + def cost_characteristic(self, cost_characteristic: List[TapiTopologyCostCharacteristic]): + """Sets the cost_characteristic of this TapiTopologyNodeRuleGroup. + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :param cost_characteristic: The cost_characteristic of this TapiTopologyNodeRuleGroup. + :type cost_characteristic: List[TapiTopologyCostCharacteristic] + """ + + self._cost_characteristic = cost_characteristic + + @property + def latency_characteristic(self) -> List[TapiTopologyLatencyCharacteristic]: + """Gets the latency_characteristic of this TapiTopologyNodeRuleGroup. + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :return: The latency_characteristic of this TapiTopologyNodeRuleGroup. + :rtype: List[TapiTopologyLatencyCharacteristic] + """ + return self._latency_characteristic + + @latency_characteristic.setter + def latency_characteristic(self, latency_characteristic: List[TapiTopologyLatencyCharacteristic]): + """Sets the latency_characteristic of this TapiTopologyNodeRuleGroup. + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :param latency_characteristic: The latency_characteristic of this TapiTopologyNodeRuleGroup. + :type latency_characteristic: List[TapiTopologyLatencyCharacteristic] + """ + + self._latency_characteristic = latency_characteristic + + @property + def available_capacity(self) -> TapiCommonCapacity: + """Gets the available_capacity of this TapiTopologyNodeRuleGroup. + + + :return: The available_capacity of this TapiTopologyNodeRuleGroup. + :rtype: TapiCommonCapacity + """ + return self._available_capacity + + @available_capacity.setter + def available_capacity(self, available_capacity: TapiCommonCapacity): + """Sets the available_capacity of this TapiTopologyNodeRuleGroup. + + + :param available_capacity: The available_capacity of this TapiTopologyNodeRuleGroup. + :type available_capacity: TapiCommonCapacity + """ + + self._available_capacity = available_capacity + + @property + def total_potential_capacity(self) -> TapiCommonCapacity: + """Gets the total_potential_capacity of this TapiTopologyNodeRuleGroup. + + + :return: The total_potential_capacity of this TapiTopologyNodeRuleGroup. + :rtype: TapiCommonCapacity + """ + return self._total_potential_capacity + + @total_potential_capacity.setter + def total_potential_capacity(self, total_potential_capacity: TapiCommonCapacity): + """Sets the total_potential_capacity of this TapiTopologyNodeRuleGroup. + + + :param total_potential_capacity: The total_potential_capacity of this TapiTopologyNodeRuleGroup. + :type total_potential_capacity: TapiCommonCapacity + """ + + self._total_potential_capacity = total_potential_capacity + + @property + def inter_rule_group(self) -> List[TapiTopologyInterRuleGroup]: + """Gets the inter_rule_group of this TapiTopologyNodeRuleGroup. + + Nested NodeRuleGroups may have InterRuleGroups. The Superior NodeRuleGroup contains the nested NodeRuleGroups and their associated InterRuleGroups. This is equivalent to the Node-Topology hierarchy. # noqa: E501 + + :return: The inter_rule_group of this TapiTopologyNodeRuleGroup. + :rtype: List[TapiTopologyInterRuleGroup] + """ + return self._inter_rule_group + + @inter_rule_group.setter + def inter_rule_group(self, inter_rule_group: List[TapiTopologyInterRuleGroup]): + """Sets the inter_rule_group of this TapiTopologyNodeRuleGroup. + + Nested NodeRuleGroups may have InterRuleGroups. The Superior NodeRuleGroup contains the nested NodeRuleGroups and their associated InterRuleGroups. This is equivalent to the Node-Topology hierarchy. # noqa: E501 + + :param inter_rule_group: The inter_rule_group of this TapiTopologyNodeRuleGroup. + :type inter_rule_group: List[TapiTopologyInterRuleGroup] + """ + + self._inter_rule_group = inter_rule_group + + @property + def rule(self) -> List[TapiTopologyRule]: + """Gets the rule of this TapiTopologyNodeRuleGroup. + + The list of rules of the NodeRuleGroup. # noqa: E501 + + :return: The rule of this TapiTopologyNodeRuleGroup. + :rtype: List[TapiTopologyRule] + """ + return self._rule + + @rule.setter + def rule(self, rule: List[TapiTopologyRule]): + """Sets the rule of this TapiTopologyNodeRuleGroup. + + The list of rules of the NodeRuleGroup. # noqa: E501 + + :param rule: The rule of this TapiTopologyNodeRuleGroup. + :type rule: List[TapiTopologyRule] + """ + + self._rule = rule + + @property + def node_rule_group(self) -> List[TapiTopologyNodeRuleGroupRef]: + """Gets the node_rule_group of this TapiTopologyNodeRuleGroup. + + NodeRuleGroups may be nested such that finer grained rules may be applied. A nested rule group should have a subset of the NEPs of the superior rule group. # noqa: E501 + + :return: The node_rule_group of this TapiTopologyNodeRuleGroup. + :rtype: List[TapiTopologyNodeRuleGroupRef] + """ + return self._node_rule_group + + @node_rule_group.setter + def node_rule_group(self, node_rule_group: List[TapiTopologyNodeRuleGroupRef]): + """Sets the node_rule_group of this TapiTopologyNodeRuleGroup. + + NodeRuleGroups may be nested such that finer grained rules may be applied. A nested rule group should have a subset of the NEPs of the superior rule group. # noqa: E501 + + :param node_rule_group: The node_rule_group of this TapiTopologyNodeRuleGroup. + :type node_rule_group: List[TapiTopologyNodeRuleGroupRef] + """ + + self._node_rule_group = node_rule_group + + @property + def node_edge_point(self) -> List[TapiTopologyNodeEdgePointRef]: + """Gets the node_edge_point of this TapiTopologyNodeRuleGroup. + + NEPs and their client CEPs that the rules apply to. # noqa: E501 + + :return: The node_edge_point of this TapiTopologyNodeRuleGroup. + :rtype: List[TapiTopologyNodeEdgePointRef] + """ + return self._node_edge_point + + @node_edge_point.setter + def node_edge_point(self, node_edge_point: List[TapiTopologyNodeEdgePointRef]): + """Sets the node_edge_point of this TapiTopologyNodeRuleGroup. + + NEPs and their client CEPs that the rules apply to. # noqa: E501 + + :param node_edge_point: The node_edge_point of this TapiTopologyNodeRuleGroup. + :type node_edge_point: List[TapiTopologyNodeEdgePointRef] + """ + + self._node_edge_point = node_edge_point diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_node_rule_group_ref.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_node_rule_group_ref.py new file mode 100644 index 0000000000000000000000000000000000000000..0f093a2582774e1476092243e60694de5f0229d1 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_node_rule_group_ref.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_node_ref import TapiTopologyNodeRef # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyNodeRuleGroupRef(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, node_uuid: str=None, node_rule_group_uuid: str=None): # noqa: E501 + """TapiTopologyNodeRuleGroupRef - a model defined in Swagger + + :param node_uuid: The node_uuid of this TapiTopologyNodeRuleGroupRef. # noqa: E501 + :type node_uuid: str + :param node_rule_group_uuid: The node_rule_group_uuid of this TapiTopologyNodeRuleGroupRef. # noqa: E501 + :type node_rule_group_uuid: str + """ + self.swagger_types = { + 'node_uuid': str, + 'node_rule_group_uuid': str + } + + self.attribute_map = { + 'node_uuid': 'node-uuid', + 'node_rule_group_uuid': 'node-rule-group-uuid' + } + self._node_uuid = node_uuid + self._node_rule_group_uuid = node_rule_group_uuid + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyNodeRuleGroupRef': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.NodeRuleGroupRef of this TapiTopologyNodeRuleGroupRef. # noqa: E501 + :rtype: TapiTopologyNodeRuleGroupRef + """ + return util.deserialize_model(dikt, cls) + + @property + def node_uuid(self) -> str: + """Gets the node_uuid of this TapiTopologyNodeRuleGroupRef. + + none # noqa: E501 + + :return: The node_uuid of this TapiTopologyNodeRuleGroupRef. + :rtype: str + """ + return self._node_uuid + + @node_uuid.setter + def node_uuid(self, node_uuid: str): + """Sets the node_uuid of this TapiTopologyNodeRuleGroupRef. + + none # noqa: E501 + + :param node_uuid: The node_uuid of this TapiTopologyNodeRuleGroupRef. + :type node_uuid: str + """ + + self._node_uuid = node_uuid + + @property + def node_rule_group_uuid(self) -> str: + """Gets the node_rule_group_uuid of this TapiTopologyNodeRuleGroupRef. + + none # noqa: E501 + + :return: The node_rule_group_uuid of this TapiTopologyNodeRuleGroupRef. + :rtype: str + """ + return self._node_rule_group_uuid + + @node_rule_group_uuid.setter + def node_rule_group_uuid(self, node_rule_group_uuid: str): + """Sets the node_rule_group_uuid of this TapiTopologyNodeRuleGroupRef. + + none # noqa: E501 + + :param node_rule_group_uuid: The node_rule_group_uuid of this TapiTopologyNodeRuleGroupRef. + :type node_rule_group_uuid: str + """ + + self._node_rule_group_uuid = node_rule_group_uuid diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_node_rule_group_ref_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_node_rule_group_ref_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..ffc2990318100152ad49a3f5c5abd531d4f47f34 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_node_rule_group_ref_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_node_rule_group_ref import TapiTopologyNodeRuleGroupRef # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyNodeRuleGroupRefWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, associated_node_rule_group: TapiTopologyNodeRuleGroupRef=None): # noqa: E501 + """TapiTopologyNodeRuleGroupRefWrapper - a model defined in Swagger + + :param associated_node_rule_group: The associated_node_rule_group of this TapiTopologyNodeRuleGroupRefWrapper. # noqa: E501 + :type associated_node_rule_group: TapiTopologyNodeRuleGroupRef + """ + self.swagger_types = { + 'associated_node_rule_group': TapiTopologyNodeRuleGroupRef + } + + self.attribute_map = { + 'associated_node_rule_group': 'associated-node-rule-group' + } + self._associated_node_rule_group = associated_node_rule_group + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyNodeRuleGroupRefWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.NodeRuleGroupRefWrapper of this TapiTopologyNodeRuleGroupRefWrapper. # noqa: E501 + :rtype: TapiTopologyNodeRuleGroupRefWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def associated_node_rule_group(self) -> TapiTopologyNodeRuleGroupRef: + """Gets the associated_node_rule_group of this TapiTopologyNodeRuleGroupRefWrapper. + + + :return: The associated_node_rule_group of this TapiTopologyNodeRuleGroupRefWrapper. + :rtype: TapiTopologyNodeRuleGroupRef + """ + return self._associated_node_rule_group + + @associated_node_rule_group.setter + def associated_node_rule_group(self, associated_node_rule_group: TapiTopologyNodeRuleGroupRef): + """Sets the associated_node_rule_group of this TapiTopologyNodeRuleGroupRefWrapper. + + + :param associated_node_rule_group: The associated_node_rule_group of this TapiTopologyNodeRuleGroupRefWrapper. + :type associated_node_rule_group: TapiTopologyNodeRuleGroupRef + """ + + self._associated_node_rule_group = associated_node_rule_group diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_node_rule_group_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_node_rule_group_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..1ce586e129a21b56da19b1a78cdec528d8fde549 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_node_rule_group_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_node_rule_group import TapiTopologyNodeRuleGroup # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyNodeRuleGroupWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, node_rule_group: TapiTopologyNodeRuleGroup=None): # noqa: E501 + """TapiTopologyNodeRuleGroupWrapper - a model defined in Swagger + + :param node_rule_group: The node_rule_group of this TapiTopologyNodeRuleGroupWrapper. # noqa: E501 + :type node_rule_group: TapiTopologyNodeRuleGroup + """ + self.swagger_types = { + 'node_rule_group': TapiTopologyNodeRuleGroup + } + + self.attribute_map = { + 'node_rule_group': 'node-rule-group' + } + self._node_rule_group = node_rule_group + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyNodeRuleGroupWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.NodeRuleGroupWrapper of this TapiTopologyNodeRuleGroupWrapper. # noqa: E501 + :rtype: TapiTopologyNodeRuleGroupWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def node_rule_group(self) -> TapiTopologyNodeRuleGroup: + """Gets the node_rule_group of this TapiTopologyNodeRuleGroupWrapper. + + + :return: The node_rule_group of this TapiTopologyNodeRuleGroupWrapper. + :rtype: TapiTopologyNodeRuleGroup + """ + return self._node_rule_group + + @node_rule_group.setter + def node_rule_group(self, node_rule_group: TapiTopologyNodeRuleGroup): + """Sets the node_rule_group of this TapiTopologyNodeRuleGroupWrapper. + + + :param node_rule_group: The node_rule_group of this TapiTopologyNodeRuleGroupWrapper. + :type node_rule_group: TapiTopologyNodeRuleGroup + """ + + self._node_rule_group = node_rule_group diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_port_role_rule.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_port_role_rule.py new file mode 100644 index 0000000000000000000000000000000000000000..d5bfbe10ef4b23ebc54db30535e78d06786b3fd2 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_port_role_rule.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiTopologyPortRoleRule(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, port_role_rule: List[str]=None, port_role: List[str]=None): # noqa: E501 + """TapiTopologyPortRoleRule - a model defined in Swagger + + :param port_role_rule: The port_role_rule of this TapiTopologyPortRoleRule. # noqa: E501 + :type port_role_rule: List[str] + :param port_role: The port_role of this TapiTopologyPortRoleRule. # noqa: E501 + :type port_role: List[str] + """ + self.swagger_types = { + 'port_role_rule': List[str], + 'port_role': List[str] + } + + self.attribute_map = { + 'port_role_rule': 'port-role-rule', + 'port_role': 'port-role' + } + self._port_role_rule = port_role_rule + self._port_role = port_role + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyPortRoleRule': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.PortRoleRule of this TapiTopologyPortRoleRule. # noqa: E501 + :rtype: TapiTopologyPortRoleRule + """ + return util.deserialize_model(dikt, cls) + + @property + def port_role_rule(self) -> List[str]: + """Gets the port_role_rule of this TapiTopologyPortRoleRule. + + Where the rule references more than one port role or where there are rule intersections either as a result of overlay of rules or inter rule group usage indicates role matching criteria for a connection following the rules. For example if two port roles, 'a' and 'b', are listed and the port role rule is 'different', this means that a connection connecting points in that group must have port roles that are different for each CEP in that group. In the example if a connection can have n ports of role 'a' and m ports of role 'b' then a maximum of two ports can be drawn from the NEPs of the group and where there are two, one must be role 'a' and one must be role 'b'. # noqa: E501 + + :return: The port_role_rule of this TapiTopologyPortRoleRule. + :rtype: List[str] + """ + return self._port_role_rule + + @port_role_rule.setter + def port_role_rule(self, port_role_rule: List[str]): + """Sets the port_role_rule of this TapiTopologyPortRoleRule. + + Where the rule references more than one port role or where there are rule intersections either as a result of overlay of rules or inter rule group usage indicates role matching criteria for a connection following the rules. For example if two port roles, 'a' and 'b', are listed and the port role rule is 'different', this means that a connection connecting points in that group must have port roles that are different for each CEP in that group. In the example if a connection can have n ports of role 'a' and m ports of role 'b' then a maximum of two ports can be drawn from the NEPs of the group and where there are two, one must be role 'a' and one must be role 'b'. # noqa: E501 + + :param port_role_rule: The port_role_rule of this TapiTopologyPortRoleRule. + :type port_role_rule: List[str] + """ + + self._port_role_rule = port_role_rule + + @property + def port_role(self) -> List[str]: + """Gets the port_role of this TapiTopologyPortRoleRule. + + The role(s) of the port(s) considered in the rule. # noqa: E501 + + :return: The port_role of this TapiTopologyPortRoleRule. + :rtype: List[str] + """ + return self._port_role + + @port_role.setter + def port_role(self, port_role: List[str]): + """Sets the port_role of this TapiTopologyPortRoleRule. + + The role(s) of the port(s) considered in the rule. # noqa: E501 + + :param port_role: The port_role of this TapiTopologyPortRoleRule. + :type port_role: List[str] + """ + + self._port_role = port_role diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_port_role_rule_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_port_role_rule_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..a711600a972f892a0b9dfa0bf950f2fbbb019cfa --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_port_role_rule_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_port_role_rule import TapiTopologyPortRoleRule # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyPortRoleRuleWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, cep_port_role: TapiTopologyPortRoleRule=None): # noqa: E501 + """TapiTopologyPortRoleRuleWrapper - a model defined in Swagger + + :param cep_port_role: The cep_port_role of this TapiTopologyPortRoleRuleWrapper. # noqa: E501 + :type cep_port_role: TapiTopologyPortRoleRule + """ + self.swagger_types = { + 'cep_port_role': TapiTopologyPortRoleRule + } + + self.attribute_map = { + 'cep_port_role': 'cep-port-role' + } + self._cep_port_role = cep_port_role + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyPortRoleRuleWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.PortRoleRuleWrapper of this TapiTopologyPortRoleRuleWrapper. # noqa: E501 + :rtype: TapiTopologyPortRoleRuleWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def cep_port_role(self) -> TapiTopologyPortRoleRule: + """Gets the cep_port_role of this TapiTopologyPortRoleRuleWrapper. + + + :return: The cep_port_role of this TapiTopologyPortRoleRuleWrapper. + :rtype: TapiTopologyPortRoleRule + """ + return self._cep_port_role + + @cep_port_role.setter + def cep_port_role(self, cep_port_role: TapiTopologyPortRoleRule): + """Sets the cep_port_role of this TapiTopologyPortRoleRuleWrapper. + + + :param cep_port_role: The cep_port_role of this TapiTopologyPortRoleRuleWrapper. + :type cep_port_role: TapiTopologyPortRoleRule + """ + + self._cep_port_role = cep_port_role diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_protection_type.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_protection_type.py new file mode 100644 index 0000000000000000000000000000000000000000..ae81d84505a51f0c6ecec89d87644427a2ecddb2 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_protection_type.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiTopologyProtectionType(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + NO_PROTECTON = "NO_PROTECTON" + ONE_PLUS_ONE_PROTECTION = "ONE_PLUS_ONE_PROTECTION" + ONE_PLUS_ONE_PROTECTION_WITH_DYNAMIC_RESTORATION = "ONE_PLUS_ONE_PROTECTION_WITH_DYNAMIC_RESTORATION" + PERMANENT_ONE_PLUS_ONE_PROTECTION = "PERMANENT_ONE_PLUS_ONE_PROTECTION" + ONE_FOR_ONE_PROTECTION = "ONE_FOR_ONE_PROTECTION" + DYNAMIC_RESTORATION = "DYNAMIC_RESTORATION" + PRE_COMPUTED_RESTORATION = "PRE_COMPUTED_RESTORATION" + ONE_PLUS_ONE_PROTECTION_WITH_PRE_COMPUTED_RESTORATION = "ONE_PLUS_ONE_PROTECTION_WITH_PRE_COMPUTED_RESTORATION" + def __init__(self): # noqa: E501 + """TapiTopologyProtectionType - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyProtectionType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.ProtectionType of this TapiTopologyProtectionType. # noqa: E501 + :rtype: TapiTopologyProtectionType + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_resilience_type.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_resilience_type.py new file mode 100644 index 0000000000000000000000000000000000000000..21634e71cd123631577bd2bc8b8dde2632d87d9e --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_resilience_type.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_protection_type import TapiTopologyProtectionType # noqa: F401,E501 +from tapi_server.models.tapi_topology_restoration_policy import TapiTopologyRestorationPolicy # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyResilienceType(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, restoration_policy: TapiTopologyRestorationPolicy=None, protection_type: TapiTopologyProtectionType=None): # noqa: E501 + """TapiTopologyResilienceType - a model defined in Swagger + + :param restoration_policy: The restoration_policy of this TapiTopologyResilienceType. # noqa: E501 + :type restoration_policy: TapiTopologyRestorationPolicy + :param protection_type: The protection_type of this TapiTopologyResilienceType. # noqa: E501 + :type protection_type: TapiTopologyProtectionType + """ + self.swagger_types = { + 'restoration_policy': TapiTopologyRestorationPolicy, + 'protection_type': TapiTopologyProtectionType + } + + self.attribute_map = { + 'restoration_policy': 'restoration-policy', + 'protection_type': 'protection-type' + } + self._restoration_policy = restoration_policy + self._protection_type = protection_type + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyResilienceType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.ResilienceType of this TapiTopologyResilienceType. # noqa: E501 + :rtype: TapiTopologyResilienceType + """ + return util.deserialize_model(dikt, cls) + + @property + def restoration_policy(self) -> TapiTopologyRestorationPolicy: + """Gets the restoration_policy of this TapiTopologyResilienceType. + + + :return: The restoration_policy of this TapiTopologyResilienceType. + :rtype: TapiTopologyRestorationPolicy + """ + return self._restoration_policy + + @restoration_policy.setter + def restoration_policy(self, restoration_policy: TapiTopologyRestorationPolicy): + """Sets the restoration_policy of this TapiTopologyResilienceType. + + + :param restoration_policy: The restoration_policy of this TapiTopologyResilienceType. + :type restoration_policy: TapiTopologyRestorationPolicy + """ + + self._restoration_policy = restoration_policy + + @property + def protection_type(self) -> TapiTopologyProtectionType: + """Gets the protection_type of this TapiTopologyResilienceType. + + + :return: The protection_type of this TapiTopologyResilienceType. + :rtype: TapiTopologyProtectionType + """ + return self._protection_type + + @protection_type.setter + def protection_type(self, protection_type: TapiTopologyProtectionType): + """Sets the protection_type of this TapiTopologyResilienceType. + + + :param protection_type: The protection_type of this TapiTopologyResilienceType. + :type protection_type: TapiTopologyProtectionType + """ + + self._protection_type = protection_type diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_resilience_type_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_resilience_type_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..0aee9c035b3611c5f03716101aa0a0b0c7683ef7 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_resilience_type_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_resilience_type import TapiTopologyResilienceType # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyResilienceTypeWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, resilience_type: TapiTopologyResilienceType=None): # noqa: E501 + """TapiTopologyResilienceTypeWrapper - a model defined in Swagger + + :param resilience_type: The resilience_type of this TapiTopologyResilienceTypeWrapper. # noqa: E501 + :type resilience_type: TapiTopologyResilienceType + """ + self.swagger_types = { + 'resilience_type': TapiTopologyResilienceType + } + + self.attribute_map = { + 'resilience_type': 'resilience-type' + } + self._resilience_type = resilience_type + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyResilienceTypeWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.ResilienceTypeWrapper of this TapiTopologyResilienceTypeWrapper. # noqa: E501 + :rtype: TapiTopologyResilienceTypeWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def resilience_type(self) -> TapiTopologyResilienceType: + """Gets the resilience_type of this TapiTopologyResilienceTypeWrapper. + + + :return: The resilience_type of this TapiTopologyResilienceTypeWrapper. + :rtype: TapiTopologyResilienceType + """ + return self._resilience_type + + @resilience_type.setter + def resilience_type(self, resilience_type: TapiTopologyResilienceType): + """Sets the resilience_type of this TapiTopologyResilienceTypeWrapper. + + + :param resilience_type: The resilience_type of this TapiTopologyResilienceTypeWrapper. + :type resilience_type: TapiTopologyResilienceType + """ + + self._resilience_type = resilience_type diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_restoration_policy.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_restoration_policy.py new file mode 100644 index 0000000000000000000000000000000000000000..0986e10693a23a54f1a6fb26fca981ecc376d473 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_restoration_policy.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiTopologyRestorationPolicy(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + PER_DOMAIN_RESTORATION = "PER_DOMAIN_RESTORATION" + END_TO_END_RESTORATION = "END_TO_END_RESTORATION" + NA = "NA" + def __init__(self): # noqa: E501 + """TapiTopologyRestorationPolicy - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyRestorationPolicy': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.RestorationPolicy of this TapiTopologyRestorationPolicy. # noqa: E501 + :rtype: TapiTopologyRestorationPolicy + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_risk_characteristic.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_risk_characteristic.py new file mode 100644 index 0000000000000000000000000000000000000000..8e65e521e5cb653b379fd648e15aff18876c5375 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_risk_characteristic.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiTopologyRiskCharacteristic(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, risk_characteristic_name: str=None, risk_identifier_list: List[str]=None): # noqa: E501 + """TapiTopologyRiskCharacteristic - a model defined in Swagger + + :param risk_characteristic_name: The risk_characteristic_name of this TapiTopologyRiskCharacteristic. # noqa: E501 + :type risk_characteristic_name: str + :param risk_identifier_list: The risk_identifier_list of this TapiTopologyRiskCharacteristic. # noqa: E501 + :type risk_identifier_list: List[str] + """ + self.swagger_types = { + 'risk_characteristic_name': str, + 'risk_identifier_list': List[str] + } + + self.attribute_map = { + 'risk_characteristic_name': 'risk-characteristic-name', + 'risk_identifier_list': 'risk-identifier-list' + } + self._risk_characteristic_name = risk_characteristic_name + self._risk_identifier_list = risk_identifier_list + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyRiskCharacteristic': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.RiskCharacteristic of this TapiTopologyRiskCharacteristic. # noqa: E501 + :rtype: TapiTopologyRiskCharacteristic + """ + return util.deserialize_model(dikt, cls) + + @property + def risk_characteristic_name(self) -> str: + """Gets the risk_characteristic_name of this TapiTopologyRiskCharacteristic. + + The name of the risk characteristic. The characteristic may be related to a specific degree of closeness. For example a particular characteristic may apply to failures that are localized (e.g. to one side of a road) where as another characteristic may relate to failures that have a broader impact (e.g. both sides of a road that crosses a bridge). Depending upon the importance of the traffic being routed different risk characteristics will be evaluated. # noqa: E501 + + :return: The risk_characteristic_name of this TapiTopologyRiskCharacteristic. + :rtype: str + """ + return self._risk_characteristic_name + + @risk_characteristic_name.setter + def risk_characteristic_name(self, risk_characteristic_name: str): + """Sets the risk_characteristic_name of this TapiTopologyRiskCharacteristic. + + The name of the risk characteristic. The characteristic may be related to a specific degree of closeness. For example a particular characteristic may apply to failures that are localized (e.g. to one side of a road) where as another characteristic may relate to failures that have a broader impact (e.g. both sides of a road that crosses a bridge). Depending upon the importance of the traffic being routed different risk characteristics will be evaluated. # noqa: E501 + + :param risk_characteristic_name: The risk_characteristic_name of this TapiTopologyRiskCharacteristic. + :type risk_characteristic_name: str + """ + + self._risk_characteristic_name = risk_characteristic_name + + @property + def risk_identifier_list(self) -> List[str]: + """Gets the risk_identifier_list of this TapiTopologyRiskCharacteristic. + + A list of the identifiers of each physical/geographic unit (with the specific risk characteristic) that is related to a segment of the TopologicalEntity. # noqa: E501 + + :return: The risk_identifier_list of this TapiTopologyRiskCharacteristic. + :rtype: List[str] + """ + return self._risk_identifier_list + + @risk_identifier_list.setter + def risk_identifier_list(self, risk_identifier_list: List[str]): + """Sets the risk_identifier_list of this TapiTopologyRiskCharacteristic. + + A list of the identifiers of each physical/geographic unit (with the specific risk characteristic) that is related to a segment of the TopologicalEntity. # noqa: E501 + + :param risk_identifier_list: The risk_identifier_list of this TapiTopologyRiskCharacteristic. + :type risk_identifier_list: List[str] + """ + + self._risk_identifier_list = risk_identifier_list diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_risk_characteristic_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_risk_characteristic_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..030e148e23f6dde64eed41f2986a50088359c3f6 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_risk_characteristic_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_risk_characteristic import TapiTopologyRiskCharacteristic # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyRiskCharacteristicWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, risk_diversity_characteristic: TapiTopologyRiskCharacteristic=None): # noqa: E501 + """TapiTopologyRiskCharacteristicWrapper - a model defined in Swagger + + :param risk_diversity_characteristic: The risk_diversity_characteristic of this TapiTopologyRiskCharacteristicWrapper. # noqa: E501 + :type risk_diversity_characteristic: TapiTopologyRiskCharacteristic + """ + self.swagger_types = { + 'risk_diversity_characteristic': TapiTopologyRiskCharacteristic + } + + self.attribute_map = { + 'risk_diversity_characteristic': 'risk-diversity-characteristic' + } + self._risk_diversity_characteristic = risk_diversity_characteristic + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyRiskCharacteristicWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.RiskCharacteristicWrapper of this TapiTopologyRiskCharacteristicWrapper. # noqa: E501 + :rtype: TapiTopologyRiskCharacteristicWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def risk_diversity_characteristic(self) -> TapiTopologyRiskCharacteristic: + """Gets the risk_diversity_characteristic of this TapiTopologyRiskCharacteristicWrapper. + + + :return: The risk_diversity_characteristic of this TapiTopologyRiskCharacteristicWrapper. + :rtype: TapiTopologyRiskCharacteristic + """ + return self._risk_diversity_characteristic + + @risk_diversity_characteristic.setter + def risk_diversity_characteristic(self, risk_diversity_characteristic: TapiTopologyRiskCharacteristic): + """Sets the risk_diversity_characteristic of this TapiTopologyRiskCharacteristicWrapper. + + + :param risk_diversity_characteristic: The risk_diversity_characteristic of this TapiTopologyRiskCharacteristicWrapper. + :type risk_diversity_characteristic: TapiTopologyRiskCharacteristic + """ + + self._risk_diversity_characteristic = risk_diversity_characteristic diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_risk_parameter_pac.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_risk_parameter_pac.py new file mode 100644 index 0000000000000000000000000000000000000000..0aa546ad8ff49aa299c9a90174c9cb912269c725 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_risk_parameter_pac.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_risk_characteristic import TapiTopologyRiskCharacteristic # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyRiskParameterPac(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, risk_characteristic: List[TapiTopologyRiskCharacteristic]=None): # noqa: E501 + """TapiTopologyRiskParameterPac - a model defined in Swagger + + :param risk_characteristic: The risk_characteristic of this TapiTopologyRiskParameterPac. # noqa: E501 + :type risk_characteristic: List[TapiTopologyRiskCharacteristic] + """ + self.swagger_types = { + 'risk_characteristic': List[TapiTopologyRiskCharacteristic] + } + + self.attribute_map = { + 'risk_characteristic': 'risk-characteristic' + } + self._risk_characteristic = risk_characteristic + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyRiskParameterPac': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.RiskParameterPac of this TapiTopologyRiskParameterPac. # noqa: E501 + :rtype: TapiTopologyRiskParameterPac + """ + return util.deserialize_model(dikt, cls) + + @property + def risk_characteristic(self) -> List[TapiTopologyRiskCharacteristic]: + """Gets the risk_characteristic of this TapiTopologyRiskParameterPac. + + A list of risk characteristics for consideration in an analysis of shared risk. Each element of the list represents a specific risk consideration. # noqa: E501 + + :return: The risk_characteristic of this TapiTopologyRiskParameterPac. + :rtype: List[TapiTopologyRiskCharacteristic] + """ + return self._risk_characteristic + + @risk_characteristic.setter + def risk_characteristic(self, risk_characteristic: List[TapiTopologyRiskCharacteristic]): + """Sets the risk_characteristic of this TapiTopologyRiskParameterPac. + + A list of risk characteristics for consideration in an analysis of shared risk. Each element of the list represents a specific risk consideration. # noqa: E501 + + :param risk_characteristic: The risk_characteristic of this TapiTopologyRiskParameterPac. + :type risk_characteristic: List[TapiTopologyRiskCharacteristic] + """ + + self._risk_characteristic = risk_characteristic diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_rule.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_rule.py new file mode 100644 index 0000000000000000000000000000000000000000..8d087fefb918b7fb167522f3964a96fb8519cd3f --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_rule.py @@ -0,0 +1,346 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_local_class import TapiCommonLocalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_common_port_direction import TapiCommonPortDirection # noqa: F401,E501 +from tapi_server.models.tapi_topology_connection_spec_reference import TapiTopologyConnectionSpecReference # noqa: F401,E501 +from tapi_server.models.tapi_topology_forwarding_rule import TapiTopologyForwardingRule # noqa: F401,E501 +from tapi_server.models.tapi_topology_port_role_rule import TapiTopologyPortRoleRule # noqa: F401,E501 +from tapi_server.models.tapi_topology_rule_type import TapiTopologyRuleType # noqa: F401,E501 +from tapi_server.models.tapi_topology_signal_property_rule import TapiTopologySignalPropertyRule # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyRule(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: List[TapiCommonNameAndValue]=None, local_id: str=None, complex_rule: List[str]=None, rule_type: TapiTopologyRuleType=None, signal_property: TapiTopologySignalPropertyRule=None, connection_spec_reference: List[TapiTopologyConnectionSpecReference]=None, cep_port_role: List[TapiTopologyPortRoleRule]=None, cep_direction: List[TapiCommonPortDirection]=None, override_priority: int=None, layer_protocol_qualifier: List[str]=None, forwarding_rule: TapiTopologyForwardingRule=None): # noqa: E501 + """TapiTopologyRule - a model defined in Swagger + + :param name: The name of this TapiTopologyRule. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param local_id: The local_id of this TapiTopologyRule. # noqa: E501 + :type local_id: str + :param complex_rule: The complex_rule of this TapiTopologyRule. # noqa: E501 + :type complex_rule: List[str] + :param rule_type: The rule_type of this TapiTopologyRule. # noqa: E501 + :type rule_type: TapiTopologyRuleType + :param signal_property: The signal_property of this TapiTopologyRule. # noqa: E501 + :type signal_property: TapiTopologySignalPropertyRule + :param connection_spec_reference: The connection_spec_reference of this TapiTopologyRule. # noqa: E501 + :type connection_spec_reference: List[TapiTopologyConnectionSpecReference] + :param cep_port_role: The cep_port_role of this TapiTopologyRule. # noqa: E501 + :type cep_port_role: List[TapiTopologyPortRoleRule] + :param cep_direction: The cep_direction of this TapiTopologyRule. # noqa: E501 + :type cep_direction: List[TapiCommonPortDirection] + :param override_priority: The override_priority of this TapiTopologyRule. # noqa: E501 + :type override_priority: int + :param layer_protocol_qualifier: The layer_protocol_qualifier of this TapiTopologyRule. # noqa: E501 + :type layer_protocol_qualifier: List[str] + :param forwarding_rule: The forwarding_rule of this TapiTopologyRule. # noqa: E501 + :type forwarding_rule: TapiTopologyForwardingRule + """ + self.swagger_types = { + 'name': List[TapiCommonNameAndValue], + 'local_id': str, + 'complex_rule': List[str], + 'rule_type': TapiTopologyRuleType, + 'signal_property': TapiTopologySignalPropertyRule, + 'connection_spec_reference': List[TapiTopologyConnectionSpecReference], + 'cep_port_role': List[TapiTopologyPortRoleRule], + 'cep_direction': List[TapiCommonPortDirection], + 'override_priority': int, + 'layer_protocol_qualifier': List[str], + 'forwarding_rule': TapiTopologyForwardingRule + } + + self.attribute_map = { + 'name': 'name', + 'local_id': 'local-id', + 'complex_rule': 'complex-rule', + 'rule_type': 'rule-type', + 'signal_property': 'signal-property', + 'connection_spec_reference': 'connection-spec-reference', + 'cep_port_role': 'cep-port-role', + 'cep_direction': 'cep-direction', + 'override_priority': 'override-priority', + 'layer_protocol_qualifier': 'layer-protocol-qualifier', + 'forwarding_rule': 'forwarding-rule' + } + self._name = name + self._local_id = local_id + self._complex_rule = complex_rule + self._rule_type = rule_type + self._signal_property = signal_property + self._connection_spec_reference = connection_spec_reference + self._cep_port_role = cep_port_role + self._cep_direction = cep_direction + self._override_priority = override_priority + self._layer_protocol_qualifier = layer_protocol_qualifier + self._forwarding_rule = forwarding_rule + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyRule': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.Rule of this TapiTopologyRule. # noqa: E501 + :rtype: TapiTopologyRule + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiTopologyRule. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiTopologyRule. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiTopologyRule. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiTopologyRule. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def local_id(self) -> str: + """Gets the local_id of this TapiTopologyRule. + + none # noqa: E501 + + :return: The local_id of this TapiTopologyRule. + :rtype: str + """ + return self._local_id + + @local_id.setter + def local_id(self, local_id: str): + """Sets the local_id of this TapiTopologyRule. + + none # noqa: E501 + + :param local_id: The local_id of this TapiTopologyRule. + :type local_id: str + """ + + self._local_id = local_id + + @property + def complex_rule(self) -> List[str]: + """Gets the complex_rule of this TapiTopologyRule. + + Allows for more complex rules where the basic rule system is not sufficient. # noqa: E501 + + :return: The complex_rule of this TapiTopologyRule. + :rtype: List[str] + """ + return self._complex_rule + + @complex_rule.setter + def complex_rule(self, complex_rule: List[str]): + """Sets the complex_rule of this TapiTopologyRule. + + Allows for more complex rules where the basic rule system is not sufficient. # noqa: E501 + + :param complex_rule: The complex_rule of this TapiTopologyRule. + :type complex_rule: List[str] + """ + + self._complex_rule = complex_rule + + @property + def rule_type(self) -> TapiTopologyRuleType: + """Gets the rule_type of this TapiTopologyRule. + + + :return: The rule_type of this TapiTopologyRule. + :rtype: TapiTopologyRuleType + """ + return self._rule_type + + @rule_type.setter + def rule_type(self, rule_type: TapiTopologyRuleType): + """Sets the rule_type of this TapiTopologyRule. + + + :param rule_type: The rule_type of this TapiTopologyRule. + :type rule_type: TapiTopologyRuleType + """ + + self._rule_type = rule_type + + @property + def signal_property(self) -> TapiTopologySignalPropertyRule: + """Gets the signal_property of this TapiTopologyRule. + + + :return: The signal_property of this TapiTopologyRule. + :rtype: TapiTopologySignalPropertyRule + """ + return self._signal_property + + @signal_property.setter + def signal_property(self, signal_property: TapiTopologySignalPropertyRule): + """Sets the signal_property of this TapiTopologyRule. + + + :param signal_property: The signal_property of this TapiTopologyRule. + :type signal_property: TapiTopologySignalPropertyRule + """ + + self._signal_property = signal_property + + @property + def connection_spec_reference(self) -> List[TapiTopologyConnectionSpecReference]: + """Gets the connection_spec_reference of this TapiTopologyRule. + + Identifies the type of connection that the rule applies to. If the attribute is not present then the rule applies to all types of connection supported by the device. # noqa: E501 + + :return: The connection_spec_reference of this TapiTopologyRule. + :rtype: List[TapiTopologyConnectionSpecReference] + """ + return self._connection_spec_reference + + @connection_spec_reference.setter + def connection_spec_reference(self, connection_spec_reference: List[TapiTopologyConnectionSpecReference]): + """Sets the connection_spec_reference of this TapiTopologyRule. + + Identifies the type of connection that the rule applies to. If the attribute is not present then the rule applies to all types of connection supported by the device. # noqa: E501 + + :param connection_spec_reference: The connection_spec_reference of this TapiTopologyRule. + :type connection_spec_reference: List[TapiTopologyConnectionSpecReference] + """ + + self._connection_spec_reference = connection_spec_reference + + @property + def cep_port_role(self) -> List[TapiTopologyPortRoleRule]: + """Gets the cep_port_role of this TapiTopologyRule. + + Indicates the port role to which the rule applies. The port role is interpreted in the context of the connection type which is identified by the connection spec. The port role is not meaningful in the absence of a connection spec reference. If a node rule group carries a port role, that role applies also to the associated inter rule where the combination of the roles in the node rule groups at the ends of the inter group rule define the connection orientation. For example a root-and-leaf connection may be used in a node where a node rule group collects one set of NEPs has the port role 'root' and another node rule group collects another set of NEPs has the port role 'leaf' where these are joined by an inter rule group. This combination specifies an allowed orientation of the root-and-leaf connection. No port role statement means all port roles are allowed. # noqa: E501 + + :return: The cep_port_role of this TapiTopologyRule. + :rtype: List[TapiTopologyPortRoleRule] + """ + return self._cep_port_role + + @cep_port_role.setter + def cep_port_role(self, cep_port_role: List[TapiTopologyPortRoleRule]): + """Sets the cep_port_role of this TapiTopologyRule. + + Indicates the port role to which the rule applies. The port role is interpreted in the context of the connection type which is identified by the connection spec. The port role is not meaningful in the absence of a connection spec reference. If a node rule group carries a port role, that role applies also to the associated inter rule where the combination of the roles in the node rule groups at the ends of the inter group rule define the connection orientation. For example a root-and-leaf connection may be used in a node where a node rule group collects one set of NEPs has the port role 'root' and another node rule group collects another set of NEPs has the port role 'leaf' where these are joined by an inter rule group. This combination specifies an allowed orientation of the root-and-leaf connection. No port role statement means all port roles are allowed. # noqa: E501 + + :param cep_port_role: The cep_port_role of this TapiTopologyRule. + :type cep_port_role: List[TapiTopologyPortRoleRule] + """ + + self._cep_port_role = cep_port_role + + @property + def cep_direction(self) -> List[TapiCommonPortDirection]: + """Gets the cep_direction of this TapiTopologyRule. + + cep direction is a list of port directions that the rule applies to. No entry means all cep directions. # noqa: E501 + + :return: The cep_direction of this TapiTopologyRule. + :rtype: List[TapiCommonPortDirection] + """ + return self._cep_direction + + @cep_direction.setter + def cep_direction(self, cep_direction: List[TapiCommonPortDirection]): + """Sets the cep_direction of this TapiTopologyRule. + + cep direction is a list of port directions that the rule applies to. No entry means all cep directions. # noqa: E501 + + :param cep_direction: The cep_direction of this TapiTopologyRule. + :type cep_direction: List[TapiCommonPortDirection] + """ + + self._cep_direction = cep_direction + + @property + def override_priority(self) -> int: + """Gets the override_priority of this TapiTopologyRule. + + The overridePriority allows for one rule in a rule group to override another. Priority n rules override priority n+1 rules. Rules of the same priority override as follows (n overrides n+1): 1 - MustNot 2 - Must 3 - May 4 - Null Within a rule the flexibility rules (signal, port role...) override as follows (n overriedes n+1): 1 - Any 2 - Same 3 - Different Where there are two or more 'Same' rules, they will form an intersection where all must be met. # noqa: E501 + + :return: The override_priority of this TapiTopologyRule. + :rtype: int + """ + return self._override_priority + + @override_priority.setter + def override_priority(self, override_priority: int): + """Sets the override_priority of this TapiTopologyRule. + + The overridePriority allows for one rule in a rule group to override another. Priority n rules override priority n+1 rules. Rules of the same priority override as follows (n overrides n+1): 1 - MustNot 2 - Must 3 - May 4 - Null Within a rule the flexibility rules (signal, port role...) override as follows (n overriedes n+1): 1 - Any 2 - Same 3 - Different Where there are two or more 'Same' rules, they will form an intersection where all must be met. # noqa: E501 + + :param override_priority: The override_priority of this TapiTopologyRule. + :type override_priority: int + """ + + self._override_priority = override_priority + + @property + def layer_protocol_qualifier(self) -> List[str]: + """Gets the layer_protocol_qualifier of this TapiTopologyRule. + + Qualifies a rule for a particular layerProtocol identifying the qualifiers that the rule apples to. If the attribute is not present then the rule applies to all relevant qualifiers of the layer protocol of the parent entity. # noqa: E501 + + :return: The layer_protocol_qualifier of this TapiTopologyRule. + :rtype: List[str] + """ + return self._layer_protocol_qualifier + + @layer_protocol_qualifier.setter + def layer_protocol_qualifier(self, layer_protocol_qualifier: List[str]): + """Sets the layer_protocol_qualifier of this TapiTopologyRule. + + Qualifies a rule for a particular layerProtocol identifying the qualifiers that the rule apples to. If the attribute is not present then the rule applies to all relevant qualifiers of the layer protocol of the parent entity. # noqa: E501 + + :param layer_protocol_qualifier: The layer_protocol_qualifier of this TapiTopologyRule. + :type layer_protocol_qualifier: List[str] + """ + + self._layer_protocol_qualifier = layer_protocol_qualifier + + @property + def forwarding_rule(self) -> TapiTopologyForwardingRule: + """Gets the forwarding_rule of this TapiTopologyRule. + + + :return: The forwarding_rule of this TapiTopologyRule. + :rtype: TapiTopologyForwardingRule + """ + return self._forwarding_rule + + @forwarding_rule.setter + def forwarding_rule(self, forwarding_rule: TapiTopologyForwardingRule): + """Sets the forwarding_rule of this TapiTopologyRule. + + + :param forwarding_rule: The forwarding_rule of this TapiTopologyRule. + :type forwarding_rule: TapiTopologyForwardingRule + """ + + self._forwarding_rule = forwarding_rule diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_rule_type.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_rule_type.py new file mode 100644 index 0000000000000000000000000000000000000000..3cdfeafe5ebe9d8af5deb7efeaf0ae5c8d33af87 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_rule_type.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiTopologyRuleType(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + FORWARDING = "FORWARDING" + CAPACITY = "CAPACITY" + COST = "COST" + TIMING = "TIMING" + RISK = "RISK" + GROUPING = "GROUPING" + def __init__(self): # noqa: E501 + """TapiTopologyRuleType - a model defined in Swagger + + """ + self.swagger_types = { + } + + self.attribute_map = { + } + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyRuleType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.RuleType of this TapiTopologyRuleType. # noqa: E501 + :rtype: TapiTopologyRuleType + """ + return util.deserialize_model(dikt, cls) diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_rule_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_rule_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..1ce9e5fa2ada44897b31ff611934196d26a1179e --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_rule_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_rule import TapiTopologyRule # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyRuleWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, rule: TapiTopologyRule=None): # noqa: E501 + """TapiTopologyRuleWrapper - a model defined in Swagger + + :param rule: The rule of this TapiTopologyRuleWrapper. # noqa: E501 + :type rule: TapiTopologyRule + """ + self.swagger_types = { + 'rule': TapiTopologyRule + } + + self.attribute_map = { + 'rule': 'rule' + } + self._rule = rule + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyRuleWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.RuleWrapper of this TapiTopologyRuleWrapper. # noqa: E501 + :rtype: TapiTopologyRuleWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def rule(self) -> TapiTopologyRule: + """Gets the rule of this TapiTopologyRuleWrapper. + + + :return: The rule of this TapiTopologyRuleWrapper. + :rtype: TapiTopologyRule + """ + return self._rule + + @rule.setter + def rule(self, rule: TapiTopologyRule): + """Sets the rule of this TapiTopologyRuleWrapper. + + + :param rule: The rule of this TapiTopologyRuleWrapper. + :type rule: TapiTopologyRule + """ + + self._rule = rule diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_signal_property_rule.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_signal_property_rule.py new file mode 100644 index 0000000000000000000000000000000000000000..a7faecd16ebe8be8ed974a565d1c4efd79615a05 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_signal_property_rule.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiTopologySignalPropertyRule(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, number_of_signal_values: int=None, applicable_signal_value: List[str]=None, signal_property_value_rule: str=None, signal_property_name: str=None): # noqa: E501 + """TapiTopologySignalPropertyRule - a model defined in Swagger + + :param number_of_signal_values: The number_of_signal_values of this TapiTopologySignalPropertyRule. # noqa: E501 + :type number_of_signal_values: int + :param applicable_signal_value: The applicable_signal_value of this TapiTopologySignalPropertyRule. # noqa: E501 + :type applicable_signal_value: List[str] + :param signal_property_value_rule: The signal_property_value_rule of this TapiTopologySignalPropertyRule. # noqa: E501 + :type signal_property_value_rule: str + :param signal_property_name: The signal_property_name of this TapiTopologySignalPropertyRule. # noqa: E501 + :type signal_property_name: str + """ + self.swagger_types = { + 'number_of_signal_values': int, + 'applicable_signal_value': List[str], + 'signal_property_value_rule': str, + 'signal_property_name': str + } + + self.attribute_map = { + 'number_of_signal_values': 'number-of-signal-values', + 'applicable_signal_value': 'applicable-signal-value', + 'signal_property_value_rule': 'signal-property-value-rule', + 'signal_property_name': 'signal-property-name' + } + self._number_of_signal_values = number_of_signal_values + self._applicable_signal_value = applicable_signal_value + self._signal_property_value_rule = signal_property_value_rule + self._signal_property_name = signal_property_name + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologySignalPropertyRule': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.SignalPropertyRule of this TapiTopologySignalPropertyRule. # noqa: E501 + :rtype: TapiTopologySignalPropertyRule + """ + return util.deserialize_model(dikt, cls) + + @property + def number_of_signal_values(self) -> int: + """Gets the number_of_signal_values of this TapiTopologySignalPropertyRule. + + The number of instances of this specific property that can be supported by the group. # noqa: E501 + + :return: The number_of_signal_values of this TapiTopologySignalPropertyRule. + :rtype: int + """ + return self._number_of_signal_values + + @number_of_signal_values.setter + def number_of_signal_values(self, number_of_signal_values: int): + """Sets the number_of_signal_values of this TapiTopologySignalPropertyRule. + + The number of instances of this specific property that can be supported by the group. # noqa: E501 + + :param number_of_signal_values: The number_of_signal_values of this TapiTopologySignalPropertyRule. + :type number_of_signal_values: int + """ + + self._number_of_signal_values = number_of_signal_values + + @property + def applicable_signal_value(self) -> List[str]: + """Gets the applicable_signal_value of this TapiTopologySignalPropertyRule. + + Specific values of the signal property to which the rule applies. # noqa: E501 + + :return: The applicable_signal_value of this TapiTopologySignalPropertyRule. + :rtype: List[str] + """ + return self._applicable_signal_value + + @applicable_signal_value.setter + def applicable_signal_value(self, applicable_signal_value: List[str]): + """Sets the applicable_signal_value of this TapiTopologySignalPropertyRule. + + Specific values of the signal property to which the rule applies. # noqa: E501 + + :param applicable_signal_value: The applicable_signal_value of this TapiTopologySignalPropertyRule. + :type applicable_signal_value: List[str] + """ + + self._applicable_signal_value = applicable_signal_value + + @property + def signal_property_value_rule(self) -> str: + """Gets the signal_property_value_rule of this TapiTopologySignalPropertyRule. + + Indicates how the signal properties should be accounted for. # noqa: E501 + + :return: The signal_property_value_rule of this TapiTopologySignalPropertyRule. + :rtype: str + """ + return self._signal_property_value_rule + + @signal_property_value_rule.setter + def signal_property_value_rule(self, signal_property_value_rule: str): + """Sets the signal_property_value_rule of this TapiTopologySignalPropertyRule. + + Indicates how the signal properties should be accounted for. # noqa: E501 + + :param signal_property_value_rule: The signal_property_value_rule of this TapiTopologySignalPropertyRule. + :type signal_property_value_rule: str + """ + + self._signal_property_value_rule = signal_property_value_rule + + @property + def signal_property_name(self) -> str: + """Gets the signal_property_name of this TapiTopologySignalPropertyRule. + + The name of the signal property to which the rule applies. # noqa: E501 + + :return: The signal_property_name of this TapiTopologySignalPropertyRule. + :rtype: str + """ + return self._signal_property_name + + @signal_property_name.setter + def signal_property_name(self, signal_property_name: str): + """Sets the signal_property_name of this TapiTopologySignalPropertyRule. + + The name of the signal property to which the rule applies. # noqa: E501 + + :param signal_property_name: The signal_property_name of this TapiTopologySignalPropertyRule. + :type signal_property_name: str + """ + + self._signal_property_name = signal_property_name diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_signal_property_rule_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_signal_property_rule_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..a6553cbd1a1ecfbefa77f9ef95e870709656ca5d --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_signal_property_rule_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_signal_property_rule import TapiTopologySignalPropertyRule # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologySignalPropertyRuleWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, signal_property: TapiTopologySignalPropertyRule=None): # noqa: E501 + """TapiTopologySignalPropertyRuleWrapper - a model defined in Swagger + + :param signal_property: The signal_property of this TapiTopologySignalPropertyRuleWrapper. # noqa: E501 + :type signal_property: TapiTopologySignalPropertyRule + """ + self.swagger_types = { + 'signal_property': TapiTopologySignalPropertyRule + } + + self.attribute_map = { + 'signal_property': 'signal-property' + } + self._signal_property = signal_property + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologySignalPropertyRuleWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.SignalPropertyRuleWrapper of this TapiTopologySignalPropertyRuleWrapper. # noqa: E501 + :rtype: TapiTopologySignalPropertyRuleWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def signal_property(self) -> TapiTopologySignalPropertyRule: + """Gets the signal_property of this TapiTopologySignalPropertyRuleWrapper. + + + :return: The signal_property of this TapiTopologySignalPropertyRuleWrapper. + :rtype: TapiTopologySignalPropertyRule + """ + return self._signal_property + + @signal_property.setter + def signal_property(self, signal_property: TapiTopologySignalPropertyRule): + """Sets the signal_property of this TapiTopologySignalPropertyRuleWrapper. + + + :param signal_property: The signal_property of this TapiTopologySignalPropertyRuleWrapper. + :type signal_property: TapiTopologySignalPropertyRule + """ + + self._signal_property = signal_property diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_topology.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_topology.py new file mode 100644 index 0000000000000000000000000000000000000000..4cbfa914c30ce5d536c239f99b26f76e63f7679a --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_topology.py @@ -0,0 +1,181 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_global_class import TapiCommonGlobalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_topology_link import TapiTopologyLink # noqa: F401,E501 +from tapi_server.models.tapi_topology_node import TapiTopologyNode # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyTopology(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, name: List[TapiCommonNameAndValue]=None, uuid: str=None, layer_protocol_name: List[TapiCommonLayerProtocolName]=None, link: List[TapiTopologyLink]=None, node: List[TapiTopologyNode]=None): # noqa: E501 + """TapiTopologyTopology - a model defined in Swagger + + :param name: The name of this TapiTopologyTopology. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param uuid: The uuid of this TapiTopologyTopology. # noqa: E501 + :type uuid: str + :param layer_protocol_name: The layer_protocol_name of this TapiTopologyTopology. # noqa: E501 + :type layer_protocol_name: List[TapiCommonLayerProtocolName] + :param link: The link of this TapiTopologyTopology. # noqa: E501 + :type link: List[TapiTopologyLink] + :param node: The node of this TapiTopologyTopology. # noqa: E501 + :type node: List[TapiTopologyNode] + """ + self.swagger_types = { + 'name': List[TapiCommonNameAndValue], + 'uuid': str, + 'layer_protocol_name': List[TapiCommonLayerProtocolName], + 'link': List[TapiTopologyLink], + 'node': List[TapiTopologyNode] + } + + self.attribute_map = { + 'name': 'name', + 'uuid': 'uuid', + 'layer_protocol_name': 'layer-protocol-name', + 'link': 'link', + 'node': 'node' + } + self._name = name + self._uuid = uuid + self._layer_protocol_name = layer_protocol_name + self._link = link + self._node = node + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyTopology': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.Topology of this TapiTopologyTopology. # noqa: E501 + :rtype: TapiTopologyTopology + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiTopologyTopology. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiTopologyTopology. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiTopologyTopology. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiTopologyTopology. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def uuid(self) -> str: + """Gets the uuid of this TapiTopologyTopology. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :return: The uuid of this TapiTopologyTopology. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid: str): + """Sets the uuid of this TapiTopologyTopology. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :param uuid: The uuid of this TapiTopologyTopology. + :type uuid: str + """ + + self._uuid = uuid + + @property + def layer_protocol_name(self) -> List[TapiCommonLayerProtocolName]: + """Gets the layer_protocol_name of this TapiTopologyTopology. + + none # noqa: E501 + + :return: The layer_protocol_name of this TapiTopologyTopology. + :rtype: List[TapiCommonLayerProtocolName] + """ + return self._layer_protocol_name + + @layer_protocol_name.setter + def layer_protocol_name(self, layer_protocol_name: List[TapiCommonLayerProtocolName]): + """Sets the layer_protocol_name of this TapiTopologyTopology. + + none # noqa: E501 + + :param layer_protocol_name: The layer_protocol_name of this TapiTopologyTopology. + :type layer_protocol_name: List[TapiCommonLayerProtocolName] + """ + + self._layer_protocol_name = layer_protocol_name + + @property + def link(self) -> List[TapiTopologyLink]: + """Gets the link of this TapiTopologyTopology. + + none # noqa: E501 + + :return: The link of this TapiTopologyTopology. + :rtype: List[TapiTopologyLink] + """ + return self._link + + @link.setter + def link(self, link: List[TapiTopologyLink]): + """Sets the link of this TapiTopologyTopology. + + none # noqa: E501 + + :param link: The link of this TapiTopologyTopology. + :type link: List[TapiTopologyLink] + """ + + self._link = link + + @property + def node(self) -> List[TapiTopologyNode]: + """Gets the node of this TapiTopologyTopology. + + none # noqa: E501 + + :return: The node of this TapiTopologyTopology. + :rtype: List[TapiTopologyNode] + """ + return self._node + + @node.setter + def node(self, node: List[TapiTopologyNode]): + """Sets the node of this TapiTopologyTopology. + + none # noqa: E501 + + :param node: The node of this TapiTopologyTopology. + :type node: List[TapiTopologyNode] + """ + + self._node = node diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_topology_context.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_topology_context.py new file mode 100644 index 0000000000000000000000000000000000000000..d4912545297faa3503d7cef12e456c7ed744e7ab --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_topology_context.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_network_topology_service import TapiTopologyNetworkTopologyService # noqa: F401,E501 +from tapi_server.models.tapi_topology_topology import TapiTopologyTopology # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyTopologyContext(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, nw_topology_service: TapiTopologyNetworkTopologyService=None, topology: List[TapiTopologyTopology]=None): # noqa: E501 + """TapiTopologyTopologyContext - a model defined in Swagger + + :param nw_topology_service: The nw_topology_service of this TapiTopologyTopologyContext. # noqa: E501 + :type nw_topology_service: TapiTopologyNetworkTopologyService + :param topology: The topology of this TapiTopologyTopologyContext. # noqa: E501 + :type topology: List[TapiTopologyTopology] + """ + self.swagger_types = { + 'nw_topology_service': TapiTopologyNetworkTopologyService, + 'topology': List[TapiTopologyTopology] + } + + self.attribute_map = { + 'nw_topology_service': 'nw-topology-service', + 'topology': 'topology' + } + self._nw_topology_service = nw_topology_service + self._topology = topology + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyTopologyContext': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.TopologyContext of this TapiTopologyTopologyContext. # noqa: E501 + :rtype: TapiTopologyTopologyContext + """ + return util.deserialize_model(dikt, cls) + + @property + def nw_topology_service(self) -> TapiTopologyNetworkTopologyService: + """Gets the nw_topology_service of this TapiTopologyTopologyContext. + + + :return: The nw_topology_service of this TapiTopologyTopologyContext. + :rtype: TapiTopologyNetworkTopologyService + """ + return self._nw_topology_service + + @nw_topology_service.setter + def nw_topology_service(self, nw_topology_service: TapiTopologyNetworkTopologyService): + """Sets the nw_topology_service of this TapiTopologyTopologyContext. + + + :param nw_topology_service: The nw_topology_service of this TapiTopologyTopologyContext. + :type nw_topology_service: TapiTopologyNetworkTopologyService + """ + + self._nw_topology_service = nw_topology_service + + @property + def topology(self) -> List[TapiTopologyTopology]: + """Gets the topology of this TapiTopologyTopologyContext. + + none # noqa: E501 + + :return: The topology of this TapiTopologyTopologyContext. + :rtype: List[TapiTopologyTopology] + """ + return self._topology + + @topology.setter + def topology(self, topology: List[TapiTopologyTopology]): + """Sets the topology of this TapiTopologyTopologyContext. + + none # noqa: E501 + + :param topology: The topology of this TapiTopologyTopologyContext. + :type topology: List[TapiTopologyTopology] + """ + + self._topology = topology diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_topology_context_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_topology_context_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..08c38f43433d025171c10c7fc7fb9e902e643119 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_topology_context_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_topology_context import TapiTopologyTopologyContext # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyTopologyContextWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, tapi_topologytopology_context: TapiTopologyTopologyContext=None): # noqa: E501 + """TapiTopologyTopologyContextWrapper - a model defined in Swagger + + :param tapi_topologytopology_context: The tapi_topologytopology_context of this TapiTopologyTopologyContextWrapper. # noqa: E501 + :type tapi_topologytopology_context: TapiTopologyTopologyContext + """ + self.swagger_types = { + 'tapi_topologytopology_context': TapiTopologyTopologyContext + } + + self.attribute_map = { + 'tapi_topologytopology_context': 'tapi-topology:topology-context' + } + self._tapi_topologytopology_context = tapi_topologytopology_context + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyTopologyContextWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.TopologyContextWrapper of this TapiTopologyTopologyContextWrapper. # noqa: E501 + :rtype: TapiTopologyTopologyContextWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def tapi_topologytopology_context(self) -> TapiTopologyTopologyContext: + """Gets the tapi_topologytopology_context of this TapiTopologyTopologyContextWrapper. + + + :return: The tapi_topologytopology_context of this TapiTopologyTopologyContextWrapper. + :rtype: TapiTopologyTopologyContext + """ + return self._tapi_topologytopology_context + + @tapi_topologytopology_context.setter + def tapi_topologytopology_context(self, tapi_topologytopology_context: TapiTopologyTopologyContext): + """Sets the tapi_topologytopology_context of this TapiTopologyTopologyContextWrapper. + + + :param tapi_topologytopology_context: The tapi_topologytopology_context of this TapiTopologyTopologyContextWrapper. + :type tapi_topologytopology_context: TapiTopologyTopologyContext + """ + + self._tapi_topologytopology_context = tapi_topologytopology_context diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_topology_node.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_topology_node.py new file mode 100644 index 0000000000000000000000000000000000000000..e804dab5ec586fade93a476114474305339914dc --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_topology_node.py @@ -0,0 +1,602 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_common_admin_state_pac import TapiCommonAdminStatePac # noqa: F401,E501 +from tapi_server.models.tapi_common_administrative_state import TapiCommonAdministrativeState # noqa: F401,E501 +from tapi_server.models.tapi_common_capacity import TapiCommonCapacity # noqa: F401,E501 +from tapi_server.models.tapi_common_capacity_pac import TapiCommonCapacityPac # noqa: F401,E501 +from tapi_server.models.tapi_common_global_class import TapiCommonGlobalClass # noqa: F401,E501 +from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501 +from tapi_server.models.tapi_common_lifecycle_state import TapiCommonLifecycleState # noqa: F401,E501 +from tapi_server.models.tapi_common_name_and_value import TapiCommonNameAndValue # noqa: F401,E501 +from tapi_server.models.tapi_common_operational_state import TapiCommonOperationalState # noqa: F401,E501 +from tapi_server.models.tapi_topology_cost_characteristic import TapiTopologyCostCharacteristic # noqa: F401,E501 +from tapi_server.models.tapi_topology_latency_characteristic import TapiTopologyLatencyCharacteristic # noqa: F401,E501 +from tapi_server.models.tapi_topology_node_edge_point_ref import TapiTopologyNodeEdgePointRef # noqa: F401,E501 +from tapi_server.models.tapi_topology_node_owned_node_edge_point import TapiTopologyNodeOwnedNodeEdgePoint # noqa: F401,E501 +from tapi_server.models.tapi_topology_node_rule_group import TapiTopologyNodeRuleGroup # noqa: F401,E501 +from tapi_server.models.tapi_topology_topology_ref import TapiTopologyTopologyRef # noqa: F401,E501 +from tapi_server.models.tapi_topology_transfer_cost_pac import TapiTopologyTransferCostPac # noqa: F401,E501 +from tapi_server.models.tapi_topology_transfer_integrity_pac import TapiTopologyTransferIntegrityPac # noqa: F401,E501 +from tapi_server.models.tapi_topology_transfer_timing_pac import TapiTopologyTransferTimingPac # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyTopologyNode(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, available_capacity: TapiCommonCapacity=None, total_potential_capacity: TapiCommonCapacity=None, name: List[TapiCommonNameAndValue]=None, uuid: str=None, cost_characteristic: List[TapiTopologyCostCharacteristic]=None, error_characteristic: str=None, unavailable_time_characteristic: str=None, server_integrity_process_characteristic: str=None, delivery_order_characteristic: str=None, repeat_delivery_characteristic: str=None, loss_characteristic: str=None, latency_characteristic: List[TapiTopologyLatencyCharacteristic]=None, operational_state: TapiCommonOperationalState=None, lifecycle_state: TapiCommonLifecycleState=None, administrative_state: TapiCommonAdministrativeState=None, layer_protocol_name: List[TapiCommonLayerProtocolName]=None, encap_topology: TapiTopologyTopologyRef=None, owned_node_edge_point: List[TapiTopologyNodeOwnedNodeEdgePoint]=None, node_rule_group: List[TapiTopologyNodeRuleGroup]=None, aggregated_node_edge_point: List[TapiTopologyNodeEdgePointRef]=None): # noqa: E501 + """TapiTopologyTopologyNode - a model defined in Swagger + + :param available_capacity: The available_capacity of this TapiTopologyTopologyNode. # noqa: E501 + :type available_capacity: TapiCommonCapacity + :param total_potential_capacity: The total_potential_capacity of this TapiTopologyTopologyNode. # noqa: E501 + :type total_potential_capacity: TapiCommonCapacity + :param name: The name of this TapiTopologyTopologyNode. # noqa: E501 + :type name: List[TapiCommonNameAndValue] + :param uuid: The uuid of this TapiTopologyTopologyNode. # noqa: E501 + :type uuid: str + :param cost_characteristic: The cost_characteristic of this TapiTopologyTopologyNode. # noqa: E501 + :type cost_characteristic: List[TapiTopologyCostCharacteristic] + :param error_characteristic: The error_characteristic of this TapiTopologyTopologyNode. # noqa: E501 + :type error_characteristic: str + :param unavailable_time_characteristic: The unavailable_time_characteristic of this TapiTopologyTopologyNode. # noqa: E501 + :type unavailable_time_characteristic: str + :param server_integrity_process_characteristic: The server_integrity_process_characteristic of this TapiTopologyTopologyNode. # noqa: E501 + :type server_integrity_process_characteristic: str + :param delivery_order_characteristic: The delivery_order_characteristic of this TapiTopologyTopologyNode. # noqa: E501 + :type delivery_order_characteristic: str + :param repeat_delivery_characteristic: The repeat_delivery_characteristic of this TapiTopologyTopologyNode. # noqa: E501 + :type repeat_delivery_characteristic: str + :param loss_characteristic: The loss_characteristic of this TapiTopologyTopologyNode. # noqa: E501 + :type loss_characteristic: str + :param latency_characteristic: The latency_characteristic of this TapiTopologyTopologyNode. # noqa: E501 + :type latency_characteristic: List[TapiTopologyLatencyCharacteristic] + :param operational_state: The operational_state of this TapiTopologyTopologyNode. # noqa: E501 + :type operational_state: TapiCommonOperationalState + :param lifecycle_state: The lifecycle_state of this TapiTopologyTopologyNode. # noqa: E501 + :type lifecycle_state: TapiCommonLifecycleState + :param administrative_state: The administrative_state of this TapiTopologyTopologyNode. # noqa: E501 + :type administrative_state: TapiCommonAdministrativeState + :param layer_protocol_name: The layer_protocol_name of this TapiTopologyTopologyNode. # noqa: E501 + :type layer_protocol_name: List[TapiCommonLayerProtocolName] + :param encap_topology: The encap_topology of this TapiTopologyTopologyNode. # noqa: E501 + :type encap_topology: TapiTopologyTopologyRef + :param owned_node_edge_point: The owned_node_edge_point of this TapiTopologyTopologyNode. # noqa: E501 + :type owned_node_edge_point: List[TapiTopologyNodeOwnedNodeEdgePoint] + :param node_rule_group: The node_rule_group of this TapiTopologyTopologyNode. # noqa: E501 + :type node_rule_group: List[TapiTopologyNodeRuleGroup] + :param aggregated_node_edge_point: The aggregated_node_edge_point of this TapiTopologyTopologyNode. # noqa: E501 + :type aggregated_node_edge_point: List[TapiTopologyNodeEdgePointRef] + """ + self.swagger_types = { + 'available_capacity': TapiCommonCapacity, + 'total_potential_capacity': TapiCommonCapacity, + 'name': List[TapiCommonNameAndValue], + 'uuid': str, + 'cost_characteristic': List[TapiTopologyCostCharacteristic], + 'error_characteristic': str, + 'unavailable_time_characteristic': str, + 'server_integrity_process_characteristic': str, + 'delivery_order_characteristic': str, + 'repeat_delivery_characteristic': str, + 'loss_characteristic': str, + 'latency_characteristic': List[TapiTopologyLatencyCharacteristic], + 'operational_state': TapiCommonOperationalState, + 'lifecycle_state': TapiCommonLifecycleState, + 'administrative_state': TapiCommonAdministrativeState, + 'layer_protocol_name': List[TapiCommonLayerProtocolName], + 'encap_topology': TapiTopologyTopologyRef, + 'owned_node_edge_point': List[TapiTopologyNodeOwnedNodeEdgePoint], + 'node_rule_group': List[TapiTopologyNodeRuleGroup], + 'aggregated_node_edge_point': List[TapiTopologyNodeEdgePointRef] + } + + self.attribute_map = { + 'available_capacity': 'available-capacity', + 'total_potential_capacity': 'total-potential-capacity', + 'name': 'name', + 'uuid': 'uuid', + 'cost_characteristic': 'cost-characteristic', + 'error_characteristic': 'error-characteristic', + 'unavailable_time_characteristic': 'unavailable-time-characteristic', + 'server_integrity_process_characteristic': 'server-integrity-process-characteristic', + 'delivery_order_characteristic': 'delivery-order-characteristic', + 'repeat_delivery_characteristic': 'repeat-delivery-characteristic', + 'loss_characteristic': 'loss-characteristic', + 'latency_characteristic': 'latency-characteristic', + 'operational_state': 'operational-state', + 'lifecycle_state': 'lifecycle-state', + 'administrative_state': 'administrative-state', + 'layer_protocol_name': 'layer-protocol-name', + 'encap_topology': 'encap-topology', + 'owned_node_edge_point': 'owned-node-edge-point', + 'node_rule_group': 'node-rule-group', + 'aggregated_node_edge_point': 'aggregated-node-edge-point' + } + self._available_capacity = available_capacity + self._total_potential_capacity = total_potential_capacity + self._name = name + self._uuid = uuid + self._cost_characteristic = cost_characteristic + self._error_characteristic = error_characteristic + self._unavailable_time_characteristic = unavailable_time_characteristic + self._server_integrity_process_characteristic = server_integrity_process_characteristic + self._delivery_order_characteristic = delivery_order_characteristic + self._repeat_delivery_characteristic = repeat_delivery_characteristic + self._loss_characteristic = loss_characteristic + self._latency_characteristic = latency_characteristic + self._operational_state = operational_state + self._lifecycle_state = lifecycle_state + self._administrative_state = administrative_state + self._layer_protocol_name = layer_protocol_name + self._encap_topology = encap_topology + self._owned_node_edge_point = owned_node_edge_point + self._node_rule_group = node_rule_group + self._aggregated_node_edge_point = aggregated_node_edge_point + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyTopologyNode': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.topology.Node of this TapiTopologyTopologyNode. # noqa: E501 + :rtype: TapiTopologyTopologyNode + """ + return util.deserialize_model(dikt, cls) + + @property + def available_capacity(self) -> TapiCommonCapacity: + """Gets the available_capacity of this TapiTopologyTopologyNode. + + + :return: The available_capacity of this TapiTopologyTopologyNode. + :rtype: TapiCommonCapacity + """ + return self._available_capacity + + @available_capacity.setter + def available_capacity(self, available_capacity: TapiCommonCapacity): + """Sets the available_capacity of this TapiTopologyTopologyNode. + + + :param available_capacity: The available_capacity of this TapiTopologyTopologyNode. + :type available_capacity: TapiCommonCapacity + """ + + self._available_capacity = available_capacity + + @property + def total_potential_capacity(self) -> TapiCommonCapacity: + """Gets the total_potential_capacity of this TapiTopologyTopologyNode. + + + :return: The total_potential_capacity of this TapiTopologyTopologyNode. + :rtype: TapiCommonCapacity + """ + return self._total_potential_capacity + + @total_potential_capacity.setter + def total_potential_capacity(self, total_potential_capacity: TapiCommonCapacity): + """Sets the total_potential_capacity of this TapiTopologyTopologyNode. + + + :param total_potential_capacity: The total_potential_capacity of this TapiTopologyTopologyNode. + :type total_potential_capacity: TapiCommonCapacity + """ + + self._total_potential_capacity = total_potential_capacity + + @property + def name(self) -> List[TapiCommonNameAndValue]: + """Gets the name of this TapiTopologyTopologyNode. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :return: The name of this TapiTopologyTopologyNode. + :rtype: List[TapiCommonNameAndValue] + """ + return self._name + + @name.setter + def name(self, name: List[TapiCommonNameAndValue]): + """Sets the name of this TapiTopologyTopologyNode. + + List of names. A property of an entity with a value that is unique in some namespace but may change during the life of the entity. A name carries no semantics with respect to the purpose of the entity. # noqa: E501 + + :param name: The name of this TapiTopologyTopologyNode. + :type name: List[TapiCommonNameAndValue] + """ + + self._name = name + + @property + def uuid(self) -> str: + """Gets the uuid of this TapiTopologyTopologyNode. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :return: The uuid of this TapiTopologyTopologyNode. + :rtype: str + """ + return self._uuid + + @uuid.setter + def uuid(self, uuid: str): + """Sets the uuid of this TapiTopologyTopologyNode. + + UUID: An identifier that is universally unique within an identifier space, where the identifier space is itself globally unique, and immutable. An UUID carries no semantics with respect to the purpose or state of the entity. UUID here uses string representation as defined in RFC 4122. The canonical representation uses lowercase characters. Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-' + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} Example of a UUID in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6 # noqa: E501 + + :param uuid: The uuid of this TapiTopologyTopologyNode. + :type uuid: str + """ + + self._uuid = uuid + + @property + def cost_characteristic(self) -> List[TapiTopologyCostCharacteristic]: + """Gets the cost_characteristic of this TapiTopologyTopologyNode. + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :return: The cost_characteristic of this TapiTopologyTopologyNode. + :rtype: List[TapiTopologyCostCharacteristic] + """ + return self._cost_characteristic + + @cost_characteristic.setter + def cost_characteristic(self, cost_characteristic: List[TapiTopologyCostCharacteristic]): + """Sets the cost_characteristic of this TapiTopologyTopologyNode. + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :param cost_characteristic: The cost_characteristic of this TapiTopologyTopologyNode. + :type cost_characteristic: List[TapiTopologyCostCharacteristic] + """ + + self._cost_characteristic = cost_characteristic + + @property + def error_characteristic(self) -> str: + """Gets the error_characteristic of this TapiTopologyTopologyNode. + + Describes the degree to which the signal propagated can be errored. Applies to TDM systems as the errored signal will be propagated and not packet as errored packets will be discarded. # noqa: E501 + + :return: The error_characteristic of this TapiTopologyTopologyNode. + :rtype: str + """ + return self._error_characteristic + + @error_characteristic.setter + def error_characteristic(self, error_characteristic: str): + """Sets the error_characteristic of this TapiTopologyTopologyNode. + + Describes the degree to which the signal propagated can be errored. Applies to TDM systems as the errored signal will be propagated and not packet as errored packets will be discarded. # noqa: E501 + + :param error_characteristic: The error_characteristic of this TapiTopologyTopologyNode. + :type error_characteristic: str + """ + + self._error_characteristic = error_characteristic + + @property + def unavailable_time_characteristic(self) -> str: + """Gets the unavailable_time_characteristic of this TapiTopologyTopologyNode. + + Describes the duration for which there may be no valid signal propagated. # noqa: E501 + + :return: The unavailable_time_characteristic of this TapiTopologyTopologyNode. + :rtype: str + """ + return self._unavailable_time_characteristic + + @unavailable_time_characteristic.setter + def unavailable_time_characteristic(self, unavailable_time_characteristic: str): + """Sets the unavailable_time_characteristic of this TapiTopologyTopologyNode. + + Describes the duration for which there may be no valid signal propagated. # noqa: E501 + + :param unavailable_time_characteristic: The unavailable_time_characteristic of this TapiTopologyTopologyNode. + :type unavailable_time_characteristic: str + """ + + self._unavailable_time_characteristic = unavailable_time_characteristic + + @property + def server_integrity_process_characteristic(self) -> str: + """Gets the server_integrity_process_characteristic of this TapiTopologyTopologyNode. + + Describes the effect of any server integrity enhancement process on the characteristics of the TopologicalEntity. # noqa: E501 + + :return: The server_integrity_process_characteristic of this TapiTopologyTopologyNode. + :rtype: str + """ + return self._server_integrity_process_characteristic + + @server_integrity_process_characteristic.setter + def server_integrity_process_characteristic(self, server_integrity_process_characteristic: str): + """Sets the server_integrity_process_characteristic of this TapiTopologyTopologyNode. + + Describes the effect of any server integrity enhancement process on the characteristics of the TopologicalEntity. # noqa: E501 + + :param server_integrity_process_characteristic: The server_integrity_process_characteristic of this TapiTopologyTopologyNode. + :type server_integrity_process_characteristic: str + """ + + self._server_integrity_process_characteristic = server_integrity_process_characteristic + + @property + def delivery_order_characteristic(self) -> str: + """Gets the delivery_order_characteristic of this TapiTopologyTopologyNode. + + Describes the degree to which packets will be delivered out of sequence. Does not apply to TDM as the TDM protocols maintain strict order. # noqa: E501 + + :return: The delivery_order_characteristic of this TapiTopologyTopologyNode. + :rtype: str + """ + return self._delivery_order_characteristic + + @delivery_order_characteristic.setter + def delivery_order_characteristic(self, delivery_order_characteristic: str): + """Sets the delivery_order_characteristic of this TapiTopologyTopologyNode. + + Describes the degree to which packets will be delivered out of sequence. Does not apply to TDM as the TDM protocols maintain strict order. # noqa: E501 + + :param delivery_order_characteristic: The delivery_order_characteristic of this TapiTopologyTopologyNode. + :type delivery_order_characteristic: str + """ + + self._delivery_order_characteristic = delivery_order_characteristic + + @property + def repeat_delivery_characteristic(self) -> str: + """Gets the repeat_delivery_characteristic of this TapiTopologyTopologyNode. + + Primarily applies to packet systems where a packet may be delivered more than once (in fault recovery for example). It can also apply to TDM where several frames may be received twice due to switching in a system with a large differential propagation delay. # noqa: E501 + + :return: The repeat_delivery_characteristic of this TapiTopologyTopologyNode. + :rtype: str + """ + return self._repeat_delivery_characteristic + + @repeat_delivery_characteristic.setter + def repeat_delivery_characteristic(self, repeat_delivery_characteristic: str): + """Sets the repeat_delivery_characteristic of this TapiTopologyTopologyNode. + + Primarily applies to packet systems where a packet may be delivered more than once (in fault recovery for example). It can also apply to TDM where several frames may be received twice due to switching in a system with a large differential propagation delay. # noqa: E501 + + :param repeat_delivery_characteristic: The repeat_delivery_characteristic of this TapiTopologyTopologyNode. + :type repeat_delivery_characteristic: str + """ + + self._repeat_delivery_characteristic = repeat_delivery_characteristic + + @property + def loss_characteristic(self) -> str: + """Gets the loss_characteristic of this TapiTopologyTopologyNode. + + Describes the acceptable characteristic of lost packets where loss may result from discard due to errors or overflow. Applies to packet systems and not TDM (as for TDM errored signals are propagated unless grossly errored and overflow/underflow turns into timing slips). # noqa: E501 + + :return: The loss_characteristic of this TapiTopologyTopologyNode. + :rtype: str + """ + return self._loss_characteristic + + @loss_characteristic.setter + def loss_characteristic(self, loss_characteristic: str): + """Sets the loss_characteristic of this TapiTopologyTopologyNode. + + Describes the acceptable characteristic of lost packets where loss may result from discard due to errors or overflow. Applies to packet systems and not TDM (as for TDM errored signals are propagated unless grossly errored and overflow/underflow turns into timing slips). # noqa: E501 + + :param loss_characteristic: The loss_characteristic of this TapiTopologyTopologyNode. + :type loss_characteristic: str + """ + + self._loss_characteristic = loss_characteristic + + @property + def latency_characteristic(self) -> List[TapiTopologyLatencyCharacteristic]: + """Gets the latency_characteristic of this TapiTopologyTopologyNode. + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :return: The latency_characteristic of this TapiTopologyTopologyNode. + :rtype: List[TapiTopologyLatencyCharacteristic] + """ + return self._latency_characteristic + + @latency_characteristic.setter + def latency_characteristic(self, latency_characteristic: List[TapiTopologyLatencyCharacteristic]): + """Sets the latency_characteristic of this TapiTopologyTopologyNode. + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :param latency_characteristic: The latency_characteristic of this TapiTopologyTopologyNode. + :type latency_characteristic: List[TapiTopologyLatencyCharacteristic] + """ + + self._latency_characteristic = latency_characteristic + + @property + def operational_state(self) -> TapiCommonOperationalState: + """Gets the operational_state of this TapiTopologyTopologyNode. + + + :return: The operational_state of this TapiTopologyTopologyNode. + :rtype: TapiCommonOperationalState + """ + return self._operational_state + + @operational_state.setter + def operational_state(self, operational_state: TapiCommonOperationalState): + """Sets the operational_state of this TapiTopologyTopologyNode. + + + :param operational_state: The operational_state of this TapiTopologyTopologyNode. + :type operational_state: TapiCommonOperationalState + """ + + self._operational_state = operational_state + + @property + def lifecycle_state(self) -> TapiCommonLifecycleState: + """Gets the lifecycle_state of this TapiTopologyTopologyNode. + + + :return: The lifecycle_state of this TapiTopologyTopologyNode. + :rtype: TapiCommonLifecycleState + """ + return self._lifecycle_state + + @lifecycle_state.setter + def lifecycle_state(self, lifecycle_state: TapiCommonLifecycleState): + """Sets the lifecycle_state of this TapiTopologyTopologyNode. + + + :param lifecycle_state: The lifecycle_state of this TapiTopologyTopologyNode. + :type lifecycle_state: TapiCommonLifecycleState + """ + + self._lifecycle_state = lifecycle_state + + @property + def administrative_state(self) -> TapiCommonAdministrativeState: + """Gets the administrative_state of this TapiTopologyTopologyNode. + + + :return: The administrative_state of this TapiTopologyTopologyNode. + :rtype: TapiCommonAdministrativeState + """ + return self._administrative_state + + @administrative_state.setter + def administrative_state(self, administrative_state: TapiCommonAdministrativeState): + """Sets the administrative_state of this TapiTopologyTopologyNode. + + + :param administrative_state: The administrative_state of this TapiTopologyTopologyNode. + :type administrative_state: TapiCommonAdministrativeState + """ + + self._administrative_state = administrative_state + + @property + def layer_protocol_name(self) -> List[TapiCommonLayerProtocolName]: + """Gets the layer_protocol_name of this TapiTopologyTopologyNode. + + none # noqa: E501 + + :return: The layer_protocol_name of this TapiTopologyTopologyNode. + :rtype: List[TapiCommonLayerProtocolName] + """ + return self._layer_protocol_name + + @layer_protocol_name.setter + def layer_protocol_name(self, layer_protocol_name: List[TapiCommonLayerProtocolName]): + """Sets the layer_protocol_name of this TapiTopologyTopologyNode. + + none # noqa: E501 + + :param layer_protocol_name: The layer_protocol_name of this TapiTopologyTopologyNode. + :type layer_protocol_name: List[TapiCommonLayerProtocolName] + """ + + self._layer_protocol_name = layer_protocol_name + + @property + def encap_topology(self) -> TapiTopologyTopologyRef: + """Gets the encap_topology of this TapiTopologyTopologyNode. + + + :return: The encap_topology of this TapiTopologyTopologyNode. + :rtype: TapiTopologyTopologyRef + """ + return self._encap_topology + + @encap_topology.setter + def encap_topology(self, encap_topology: TapiTopologyTopologyRef): + """Sets the encap_topology of this TapiTopologyTopologyNode. + + + :param encap_topology: The encap_topology of this TapiTopologyTopologyNode. + :type encap_topology: TapiTopologyTopologyRef + """ + + self._encap_topology = encap_topology + + @property + def owned_node_edge_point(self) -> List[TapiTopologyNodeOwnedNodeEdgePoint]: + """Gets the owned_node_edge_point of this TapiTopologyTopologyNode. + + none # noqa: E501 + + :return: The owned_node_edge_point of this TapiTopologyTopologyNode. + :rtype: List[TapiTopologyNodeOwnedNodeEdgePoint] + """ + return self._owned_node_edge_point + + @owned_node_edge_point.setter + def owned_node_edge_point(self, owned_node_edge_point: List[TapiTopologyNodeOwnedNodeEdgePoint]): + """Sets the owned_node_edge_point of this TapiTopologyTopologyNode. + + none # noqa: E501 + + :param owned_node_edge_point: The owned_node_edge_point of this TapiTopologyTopologyNode. + :type owned_node_edge_point: List[TapiTopologyNodeOwnedNodeEdgePoint] + """ + + self._owned_node_edge_point = owned_node_edge_point + + @property + def node_rule_group(self) -> List[TapiTopologyNodeRuleGroup]: + """Gets the node_rule_group of this TapiTopologyTopologyNode. + + none # noqa: E501 + + :return: The node_rule_group of this TapiTopologyTopologyNode. + :rtype: List[TapiTopologyNodeRuleGroup] + """ + return self._node_rule_group + + @node_rule_group.setter + def node_rule_group(self, node_rule_group: List[TapiTopologyNodeRuleGroup]): + """Sets the node_rule_group of this TapiTopologyTopologyNode. + + none # noqa: E501 + + :param node_rule_group: The node_rule_group of this TapiTopologyTopologyNode. + :type node_rule_group: List[TapiTopologyNodeRuleGroup] + """ + + self._node_rule_group = node_rule_group + + @property + def aggregated_node_edge_point(self) -> List[TapiTopologyNodeEdgePointRef]: + """Gets the aggregated_node_edge_point of this TapiTopologyTopologyNode. + + none # noqa: E501 + + :return: The aggregated_node_edge_point of this TapiTopologyTopologyNode. + :rtype: List[TapiTopologyNodeEdgePointRef] + """ + return self._aggregated_node_edge_point + + @aggregated_node_edge_point.setter + def aggregated_node_edge_point(self, aggregated_node_edge_point: List[TapiTopologyNodeEdgePointRef]): + """Sets the aggregated_node_edge_point of this TapiTopologyTopologyNode. + + none # noqa: E501 + + :param aggregated_node_edge_point: The aggregated_node_edge_point of this TapiTopologyTopologyNode. + :type aggregated_node_edge_point: List[TapiTopologyNodeEdgePointRef] + """ + + self._aggregated_node_edge_point = aggregated_node_edge_point diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_topology_node_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_topology_node_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..0c868058b3b29a86d04842df89ac0ccf44ff8ad1 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_topology_node_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_topology_node import TapiTopologyTopologyNode # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyTopologyNodeWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, node: TapiTopologyTopologyNode=None): # noqa: E501 + """TapiTopologyTopologyNodeWrapper - a model defined in Swagger + + :param node: The node of this TapiTopologyTopologyNodeWrapper. # noqa: E501 + :type node: TapiTopologyTopologyNode + """ + self.swagger_types = { + 'node': TapiTopologyTopologyNode + } + + self.attribute_map = { + 'node': 'node' + } + self._node = node + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyTopologyNodeWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.topology.NodeWrapper of this TapiTopologyTopologyNodeWrapper. # noqa: E501 + :rtype: TapiTopologyTopologyNodeWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def node(self) -> TapiTopologyTopologyNode: + """Gets the node of this TapiTopologyTopologyNodeWrapper. + + + :return: The node of this TapiTopologyTopologyNodeWrapper. + :rtype: TapiTopologyTopologyNode + """ + return self._node + + @node.setter + def node(self, node: TapiTopologyTopologyNode): + """Sets the node of this TapiTopologyTopologyNodeWrapper. + + + :param node: The node of this TapiTopologyTopologyNodeWrapper. + :type node: TapiTopologyTopologyNode + """ + + self._node = node diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_topology_ref.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_topology_ref.py new file mode 100644 index 0000000000000000000000000000000000000000..21a7b2d61775862dac7767ca6378f291f7494053 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_topology_ref.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiTopologyTopologyRef(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, topology_uuid: str=None): # noqa: E501 + """TapiTopologyTopologyRef - a model defined in Swagger + + :param topology_uuid: The topology_uuid of this TapiTopologyTopologyRef. # noqa: E501 + :type topology_uuid: str + """ + self.swagger_types = { + 'topology_uuid': str + } + + self.attribute_map = { + 'topology_uuid': 'topology-uuid' + } + self._topology_uuid = topology_uuid + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyTopologyRef': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.TopologyRef of this TapiTopologyTopologyRef. # noqa: E501 + :rtype: TapiTopologyTopologyRef + """ + return util.deserialize_model(dikt, cls) + + @property + def topology_uuid(self) -> str: + """Gets the topology_uuid of this TapiTopologyTopologyRef. + + none # noqa: E501 + + :return: The topology_uuid of this TapiTopologyTopologyRef. + :rtype: str + """ + return self._topology_uuid + + @topology_uuid.setter + def topology_uuid(self, topology_uuid: str): + """Sets the topology_uuid of this TapiTopologyTopologyRef. + + none # noqa: E501 + + :param topology_uuid: The topology_uuid of this TapiTopologyTopologyRef. + :type topology_uuid: str + """ + + self._topology_uuid = topology_uuid diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_topology_ref_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_topology_ref_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..7e4c3259c120c96f8064a612a2f09a0003346f29 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_topology_ref_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_topology_ref import TapiTopologyTopologyRef # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyTopologyRefWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, topology: TapiTopologyTopologyRef=None): # noqa: E501 + """TapiTopologyTopologyRefWrapper - a model defined in Swagger + + :param topology: The topology of this TapiTopologyTopologyRefWrapper. # noqa: E501 + :type topology: TapiTopologyTopologyRef + """ + self.swagger_types = { + 'topology': TapiTopologyTopologyRef + } + + self.attribute_map = { + 'topology': 'topology' + } + self._topology = topology + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyTopologyRefWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.TopologyRefWrapper of this TapiTopologyTopologyRefWrapper. # noqa: E501 + :rtype: TapiTopologyTopologyRefWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def topology(self) -> TapiTopologyTopologyRef: + """Gets the topology of this TapiTopologyTopologyRefWrapper. + + + :return: The topology of this TapiTopologyTopologyRefWrapper. + :rtype: TapiTopologyTopologyRef + """ + return self._topology + + @topology.setter + def topology(self, topology: TapiTopologyTopologyRef): + """Sets the topology of this TapiTopologyTopologyRefWrapper. + + + :param topology: The topology of this TapiTopologyTopologyRefWrapper. + :type topology: TapiTopologyTopologyRef + """ + + self._topology = topology diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_topology_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_topology_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..47908b0cc4ab2a0114d52a0c2d4b3df8ec66a5ee --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_topology_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_topology import TapiTopologyTopology # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyTopologyWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, topology: TapiTopologyTopology=None): # noqa: E501 + """TapiTopologyTopologyWrapper - a model defined in Swagger + + :param topology: The topology of this TapiTopologyTopologyWrapper. # noqa: E501 + :type topology: TapiTopologyTopology + """ + self.swagger_types = { + 'topology': TapiTopologyTopology + } + + self.attribute_map = { + 'topology': 'topology' + } + self._topology = topology + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyTopologyWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.TopologyWrapper of this TapiTopologyTopologyWrapper. # noqa: E501 + :rtype: TapiTopologyTopologyWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def topology(self) -> TapiTopologyTopology: + """Gets the topology of this TapiTopologyTopologyWrapper. + + + :return: The topology of this TapiTopologyTopologyWrapper. + :rtype: TapiTopologyTopology + """ + return self._topology + + @topology.setter + def topology(self, topology: TapiTopologyTopology): + """Sets the topology of this TapiTopologyTopologyWrapper. + + + :param topology: The topology of this TapiTopologyTopologyWrapper. + :type topology: TapiTopologyTopology + """ + + self._topology = topology diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_transfer_cost_pac.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_transfer_cost_pac.py new file mode 100644 index 0000000000000000000000000000000000000000..f868fd807b8c3dcc8674fdbd837b630312835400 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_transfer_cost_pac.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_cost_characteristic import TapiTopologyCostCharacteristic # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyTransferCostPac(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, cost_characteristic: List[TapiTopologyCostCharacteristic]=None): # noqa: E501 + """TapiTopologyTransferCostPac - a model defined in Swagger + + :param cost_characteristic: The cost_characteristic of this TapiTopologyTransferCostPac. # noqa: E501 + :type cost_characteristic: List[TapiTopologyCostCharacteristic] + """ + self.swagger_types = { + 'cost_characteristic': List[TapiTopologyCostCharacteristic] + } + + self.attribute_map = { + 'cost_characteristic': 'cost-characteristic' + } + self._cost_characteristic = cost_characteristic + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyTransferCostPac': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.TransferCostPac of this TapiTopologyTransferCostPac. # noqa: E501 + :rtype: TapiTopologyTransferCostPac + """ + return util.deserialize_model(dikt, cls) + + @property + def cost_characteristic(self) -> List[TapiTopologyCostCharacteristic]: + """Gets the cost_characteristic of this TapiTopologyTransferCostPac. + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :return: The cost_characteristic of this TapiTopologyTransferCostPac. + :rtype: List[TapiTopologyCostCharacteristic] + """ + return self._cost_characteristic + + @cost_characteristic.setter + def cost_characteristic(self, cost_characteristic: List[TapiTopologyCostCharacteristic]): + """Sets the cost_characteristic of this TapiTopologyTransferCostPac. + + The list of costs where each cost relates to some aspect of the TopologicalEntity. # noqa: E501 + + :param cost_characteristic: The cost_characteristic of this TapiTopologyTransferCostPac. + :type cost_characteristic: List[TapiTopologyCostCharacteristic] + """ + + self._cost_characteristic = cost_characteristic diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_transfer_integrity_pac.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_transfer_integrity_pac.py new file mode 100644 index 0000000000000000000000000000000000000000..47570f8728f8fa61b03effb3c5df688df7f7bdd9 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_transfer_integrity_pac.py @@ -0,0 +1,204 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiTopologyTransferIntegrityPac(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, error_characteristic: str=None, unavailable_time_characteristic: str=None, server_integrity_process_characteristic: str=None, delivery_order_characteristic: str=None, repeat_delivery_characteristic: str=None, loss_characteristic: str=None): # noqa: E501 + """TapiTopologyTransferIntegrityPac - a model defined in Swagger + + :param error_characteristic: The error_characteristic of this TapiTopologyTransferIntegrityPac. # noqa: E501 + :type error_characteristic: str + :param unavailable_time_characteristic: The unavailable_time_characteristic of this TapiTopologyTransferIntegrityPac. # noqa: E501 + :type unavailable_time_characteristic: str + :param server_integrity_process_characteristic: The server_integrity_process_characteristic of this TapiTopologyTransferIntegrityPac. # noqa: E501 + :type server_integrity_process_characteristic: str + :param delivery_order_characteristic: The delivery_order_characteristic of this TapiTopologyTransferIntegrityPac. # noqa: E501 + :type delivery_order_characteristic: str + :param repeat_delivery_characteristic: The repeat_delivery_characteristic of this TapiTopologyTransferIntegrityPac. # noqa: E501 + :type repeat_delivery_characteristic: str + :param loss_characteristic: The loss_characteristic of this TapiTopologyTransferIntegrityPac. # noqa: E501 + :type loss_characteristic: str + """ + self.swagger_types = { + 'error_characteristic': str, + 'unavailable_time_characteristic': str, + 'server_integrity_process_characteristic': str, + 'delivery_order_characteristic': str, + 'repeat_delivery_characteristic': str, + 'loss_characteristic': str + } + + self.attribute_map = { + 'error_characteristic': 'error-characteristic', + 'unavailable_time_characteristic': 'unavailable-time-characteristic', + 'server_integrity_process_characteristic': 'server-integrity-process-characteristic', + 'delivery_order_characteristic': 'delivery-order-characteristic', + 'repeat_delivery_characteristic': 'repeat-delivery-characteristic', + 'loss_characteristic': 'loss-characteristic' + } + self._error_characteristic = error_characteristic + self._unavailable_time_characteristic = unavailable_time_characteristic + self._server_integrity_process_characteristic = server_integrity_process_characteristic + self._delivery_order_characteristic = delivery_order_characteristic + self._repeat_delivery_characteristic = repeat_delivery_characteristic + self._loss_characteristic = loss_characteristic + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyTransferIntegrityPac': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.TransferIntegrityPac of this TapiTopologyTransferIntegrityPac. # noqa: E501 + :rtype: TapiTopologyTransferIntegrityPac + """ + return util.deserialize_model(dikt, cls) + + @property + def error_characteristic(self) -> str: + """Gets the error_characteristic of this TapiTopologyTransferIntegrityPac. + + Describes the degree to which the signal propagated can be errored. Applies to TDM systems as the errored signal will be propagated and not packet as errored packets will be discarded. # noqa: E501 + + :return: The error_characteristic of this TapiTopologyTransferIntegrityPac. + :rtype: str + """ + return self._error_characteristic + + @error_characteristic.setter + def error_characteristic(self, error_characteristic: str): + """Sets the error_characteristic of this TapiTopologyTransferIntegrityPac. + + Describes the degree to which the signal propagated can be errored. Applies to TDM systems as the errored signal will be propagated and not packet as errored packets will be discarded. # noqa: E501 + + :param error_characteristic: The error_characteristic of this TapiTopologyTransferIntegrityPac. + :type error_characteristic: str + """ + + self._error_characteristic = error_characteristic + + @property + def unavailable_time_characteristic(self) -> str: + """Gets the unavailable_time_characteristic of this TapiTopologyTransferIntegrityPac. + + Describes the duration for which there may be no valid signal propagated. # noqa: E501 + + :return: The unavailable_time_characteristic of this TapiTopologyTransferIntegrityPac. + :rtype: str + """ + return self._unavailable_time_characteristic + + @unavailable_time_characteristic.setter + def unavailable_time_characteristic(self, unavailable_time_characteristic: str): + """Sets the unavailable_time_characteristic of this TapiTopologyTransferIntegrityPac. + + Describes the duration for which there may be no valid signal propagated. # noqa: E501 + + :param unavailable_time_characteristic: The unavailable_time_characteristic of this TapiTopologyTransferIntegrityPac. + :type unavailable_time_characteristic: str + """ + + self._unavailable_time_characteristic = unavailable_time_characteristic + + @property + def server_integrity_process_characteristic(self) -> str: + """Gets the server_integrity_process_characteristic of this TapiTopologyTransferIntegrityPac. + + Describes the effect of any server integrity enhancement process on the characteristics of the TopologicalEntity. # noqa: E501 + + :return: The server_integrity_process_characteristic of this TapiTopologyTransferIntegrityPac. + :rtype: str + """ + return self._server_integrity_process_characteristic + + @server_integrity_process_characteristic.setter + def server_integrity_process_characteristic(self, server_integrity_process_characteristic: str): + """Sets the server_integrity_process_characteristic of this TapiTopologyTransferIntegrityPac. + + Describes the effect of any server integrity enhancement process on the characteristics of the TopologicalEntity. # noqa: E501 + + :param server_integrity_process_characteristic: The server_integrity_process_characteristic of this TapiTopologyTransferIntegrityPac. + :type server_integrity_process_characteristic: str + """ + + self._server_integrity_process_characteristic = server_integrity_process_characteristic + + @property + def delivery_order_characteristic(self) -> str: + """Gets the delivery_order_characteristic of this TapiTopologyTransferIntegrityPac. + + Describes the degree to which packets will be delivered out of sequence. Does not apply to TDM as the TDM protocols maintain strict order. # noqa: E501 + + :return: The delivery_order_characteristic of this TapiTopologyTransferIntegrityPac. + :rtype: str + """ + return self._delivery_order_characteristic + + @delivery_order_characteristic.setter + def delivery_order_characteristic(self, delivery_order_characteristic: str): + """Sets the delivery_order_characteristic of this TapiTopologyTransferIntegrityPac. + + Describes the degree to which packets will be delivered out of sequence. Does not apply to TDM as the TDM protocols maintain strict order. # noqa: E501 + + :param delivery_order_characteristic: The delivery_order_characteristic of this TapiTopologyTransferIntegrityPac. + :type delivery_order_characteristic: str + """ + + self._delivery_order_characteristic = delivery_order_characteristic + + @property + def repeat_delivery_characteristic(self) -> str: + """Gets the repeat_delivery_characteristic of this TapiTopologyTransferIntegrityPac. + + Primarily applies to packet systems where a packet may be delivered more than once (in fault recovery for example). It can also apply to TDM where several frames may be received twice due to switching in a system with a large differential propagation delay. # noqa: E501 + + :return: The repeat_delivery_characteristic of this TapiTopologyTransferIntegrityPac. + :rtype: str + """ + return self._repeat_delivery_characteristic + + @repeat_delivery_characteristic.setter + def repeat_delivery_characteristic(self, repeat_delivery_characteristic: str): + """Sets the repeat_delivery_characteristic of this TapiTopologyTransferIntegrityPac. + + Primarily applies to packet systems where a packet may be delivered more than once (in fault recovery for example). It can also apply to TDM where several frames may be received twice due to switching in a system with a large differential propagation delay. # noqa: E501 + + :param repeat_delivery_characteristic: The repeat_delivery_characteristic of this TapiTopologyTransferIntegrityPac. + :type repeat_delivery_characteristic: str + """ + + self._repeat_delivery_characteristic = repeat_delivery_characteristic + + @property + def loss_characteristic(self) -> str: + """Gets the loss_characteristic of this TapiTopologyTransferIntegrityPac. + + Describes the acceptable characteristic of lost packets where loss may result from discard due to errors or overflow. Applies to packet systems and not TDM (as for TDM errored signals are propagated unless grossly errored and overflow/underflow turns into timing slips). # noqa: E501 + + :return: The loss_characteristic of this TapiTopologyTransferIntegrityPac. + :rtype: str + """ + return self._loss_characteristic + + @loss_characteristic.setter + def loss_characteristic(self, loss_characteristic: str): + """Sets the loss_characteristic of this TapiTopologyTransferIntegrityPac. + + Describes the acceptable characteristic of lost packets where loss may result from discard due to errors or overflow. Applies to packet systems and not TDM (as for TDM errored signals are propagated unless grossly errored and overflow/underflow turns into timing slips). # noqa: E501 + + :param loss_characteristic: The loss_characteristic of this TapiTopologyTransferIntegrityPac. + :type loss_characteristic: str + """ + + self._loss_characteristic = loss_characteristic diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_transfer_timing_pac.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_transfer_timing_pac.py new file mode 100644 index 0000000000000000000000000000000000000000..f980040c4f07ef66bc155bd4d2e87224b93c979f --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_transfer_timing_pac.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_latency_characteristic import TapiTopologyLatencyCharacteristic # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyTransferTimingPac(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, latency_characteristic: List[TapiTopologyLatencyCharacteristic]=None): # noqa: E501 + """TapiTopologyTransferTimingPac - a model defined in Swagger + + :param latency_characteristic: The latency_characteristic of this TapiTopologyTransferTimingPac. # noqa: E501 + :type latency_characteristic: List[TapiTopologyLatencyCharacteristic] + """ + self.swagger_types = { + 'latency_characteristic': List[TapiTopologyLatencyCharacteristic] + } + + self.attribute_map = { + 'latency_characteristic': 'latency-characteristic' + } + self._latency_characteristic = latency_characteristic + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyTransferTimingPac': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.TransferTimingPac of this TapiTopologyTransferTimingPac. # noqa: E501 + :rtype: TapiTopologyTransferTimingPac + """ + return util.deserialize_model(dikt, cls) + + @property + def latency_characteristic(self) -> List[TapiTopologyLatencyCharacteristic]: + """Gets the latency_characteristic of this TapiTopologyTransferTimingPac. + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :return: The latency_characteristic of this TapiTopologyTransferTimingPac. + :rtype: List[TapiTopologyLatencyCharacteristic] + """ + return self._latency_characteristic + + @latency_characteristic.setter + def latency_characteristic(self, latency_characteristic: List[TapiTopologyLatencyCharacteristic]): + """Sets the latency_characteristic of this TapiTopologyTransferTimingPac. + + The effect on the latency of a queuing process. This only has significant effect for packet based systems and has a complex characteristic. # noqa: E501 + + :param latency_characteristic: The latency_characteristic of this TapiTopologyTransferTimingPac. + :type latency_characteristic: List[TapiTopologyLatencyCharacteristic] + """ + + self._latency_characteristic = latency_characteristic diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_validation_mechanism.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_validation_mechanism.py new file mode 100644 index 0000000000000000000000000000000000000000..4404a512f34a2341977ccd2223d28a386e6c42d9 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_validation_mechanism.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server import util + + +class TapiTopologyValidationMechanism(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, layer_protocol_adjacency_validated: str=None, validation_mechanism: str=None, validation_robustness: str=None): # noqa: E501 + """TapiTopologyValidationMechanism - a model defined in Swagger + + :param layer_protocol_adjacency_validated: The layer_protocol_adjacency_validated of this TapiTopologyValidationMechanism. # noqa: E501 + :type layer_protocol_adjacency_validated: str + :param validation_mechanism: The validation_mechanism of this TapiTopologyValidationMechanism. # noqa: E501 + :type validation_mechanism: str + :param validation_robustness: The validation_robustness of this TapiTopologyValidationMechanism. # noqa: E501 + :type validation_robustness: str + """ + self.swagger_types = { + 'layer_protocol_adjacency_validated': str, + 'validation_mechanism': str, + 'validation_robustness': str + } + + self.attribute_map = { + 'layer_protocol_adjacency_validated': 'layer-protocol-adjacency-validated', + 'validation_mechanism': 'validation-mechanism', + 'validation_robustness': 'validation-robustness' + } + self._layer_protocol_adjacency_validated = layer_protocol_adjacency_validated + self._validation_mechanism = validation_mechanism + self._validation_robustness = validation_robustness + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyValidationMechanism': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.ValidationMechanism of this TapiTopologyValidationMechanism. # noqa: E501 + :rtype: TapiTopologyValidationMechanism + """ + return util.deserialize_model(dikt, cls) + + @property + def layer_protocol_adjacency_validated(self) -> str: + """Gets the layer_protocol_adjacency_validated of this TapiTopologyValidationMechanism. + + State of validatiion # noqa: E501 + + :return: The layer_protocol_adjacency_validated of this TapiTopologyValidationMechanism. + :rtype: str + """ + return self._layer_protocol_adjacency_validated + + @layer_protocol_adjacency_validated.setter + def layer_protocol_adjacency_validated(self, layer_protocol_adjacency_validated: str): + """Sets the layer_protocol_adjacency_validated of this TapiTopologyValidationMechanism. + + State of validatiion # noqa: E501 + + :param layer_protocol_adjacency_validated: The layer_protocol_adjacency_validated of this TapiTopologyValidationMechanism. + :type layer_protocol_adjacency_validated: str + """ + + self._layer_protocol_adjacency_validated = layer_protocol_adjacency_validated + + @property + def validation_mechanism(self) -> str: + """Gets the validation_mechanism of this TapiTopologyValidationMechanism. + + Name of mechanism used to validate adjacency # noqa: E501 + + :return: The validation_mechanism of this TapiTopologyValidationMechanism. + :rtype: str + """ + return self._validation_mechanism + + @validation_mechanism.setter + def validation_mechanism(self, validation_mechanism: str): + """Sets the validation_mechanism of this TapiTopologyValidationMechanism. + + Name of mechanism used to validate adjacency # noqa: E501 + + :param validation_mechanism: The validation_mechanism of this TapiTopologyValidationMechanism. + :type validation_mechanism: str + """ + + self._validation_mechanism = validation_mechanism + + @property + def validation_robustness(self) -> str: + """Gets the validation_robustness of this TapiTopologyValidationMechanism. + + Quality of validation (i.e. how likely is the stated validation to be invalid) # noqa: E501 + + :return: The validation_robustness of this TapiTopologyValidationMechanism. + :rtype: str + """ + return self._validation_robustness + + @validation_robustness.setter + def validation_robustness(self, validation_robustness: str): + """Sets the validation_robustness of this TapiTopologyValidationMechanism. + + Quality of validation (i.e. how likely is the stated validation to be invalid) # noqa: E501 + + :param validation_robustness: The validation_robustness of this TapiTopologyValidationMechanism. + :type validation_robustness: str + """ + + self._validation_robustness = validation_robustness diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_validation_mechanism_wrapper.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_validation_mechanism_wrapper.py new file mode 100644 index 0000000000000000000000000000000000000000..3038e8381ecfb71d98e2059fa79ac7d335c3221b --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_validation_mechanism_wrapper.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_validation_mechanism import TapiTopologyValidationMechanism # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyValidationMechanismWrapper(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, validation_mechanism: TapiTopologyValidationMechanism=None): # noqa: E501 + """TapiTopologyValidationMechanismWrapper - a model defined in Swagger + + :param validation_mechanism: The validation_mechanism of this TapiTopologyValidationMechanismWrapper. # noqa: E501 + :type validation_mechanism: TapiTopologyValidationMechanism + """ + self.swagger_types = { + 'validation_mechanism': TapiTopologyValidationMechanism + } + + self.attribute_map = { + 'validation_mechanism': 'validation-mechanism' + } + self._validation_mechanism = validation_mechanism + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyValidationMechanismWrapper': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.ValidationMechanismWrapper of this TapiTopologyValidationMechanismWrapper. # noqa: E501 + :rtype: TapiTopologyValidationMechanismWrapper + """ + return util.deserialize_model(dikt, cls) + + @property + def validation_mechanism(self) -> TapiTopologyValidationMechanism: + """Gets the validation_mechanism of this TapiTopologyValidationMechanismWrapper. + + + :return: The validation_mechanism of this TapiTopologyValidationMechanismWrapper. + :rtype: TapiTopologyValidationMechanism + """ + return self._validation_mechanism + + @validation_mechanism.setter + def validation_mechanism(self, validation_mechanism: TapiTopologyValidationMechanism): + """Sets the validation_mechanism of this TapiTopologyValidationMechanismWrapper. + + + :param validation_mechanism: The validation_mechanism of this TapiTopologyValidationMechanismWrapper. + :type validation_mechanism: TapiTopologyValidationMechanism + """ + + self._validation_mechanism = validation_mechanism diff --git a/hackfest/tapi/server/tapi_server/models/tapi_topology_validation_pac.py b/hackfest/tapi/server/tapi_server/models/tapi_topology_validation_pac.py new file mode 100644 index 0000000000000000000000000000000000000000..f90dbb029321110d664c72655b17f0523f474e23 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/models/tapi_topology_validation_pac.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from tapi_server.models.base_model_ import Model +from tapi_server.models.tapi_topology_validation_mechanism import TapiTopologyValidationMechanism # noqa: F401,E501 +from tapi_server import util + + +class TapiTopologyValidationPac(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, validation_mechanism: List[TapiTopologyValidationMechanism]=None): # noqa: E501 + """TapiTopologyValidationPac - a model defined in Swagger + + :param validation_mechanism: The validation_mechanism of this TapiTopologyValidationPac. # noqa: E501 + :type validation_mechanism: List[TapiTopologyValidationMechanism] + """ + self.swagger_types = { + 'validation_mechanism': List[TapiTopologyValidationMechanism] + } + + self.attribute_map = { + 'validation_mechanism': 'validation-mechanism' + } + self._validation_mechanism = validation_mechanism + + @classmethod + def from_dict(cls, dikt) -> 'TapiTopologyValidationPac': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The tapi.topology.ValidationPac of this TapiTopologyValidationPac. # noqa: E501 + :rtype: TapiTopologyValidationPac + """ + return util.deserialize_model(dikt, cls) + + @property + def validation_mechanism(self) -> List[TapiTopologyValidationMechanism]: + """Gets the validation_mechanism of this TapiTopologyValidationPac. + + Provides details of the specific validation mechanism(s) used to confirm the presence of an intended topologicalEntity. # noqa: E501 + + :return: The validation_mechanism of this TapiTopologyValidationPac. + :rtype: List[TapiTopologyValidationMechanism] + """ + return self._validation_mechanism + + @validation_mechanism.setter + def validation_mechanism(self, validation_mechanism: List[TapiTopologyValidationMechanism]): + """Sets the validation_mechanism of this TapiTopologyValidationPac. + + Provides details of the specific validation mechanism(s) used to confirm the presence of an intended topologicalEntity. # noqa: E501 + + :param validation_mechanism: The validation_mechanism of this TapiTopologyValidationPac. + :type validation_mechanism: List[TapiTopologyValidationMechanism] + """ + + self._validation_mechanism = validation_mechanism diff --git a/hackfest/tapi/server/tapi_server/swagger/swagger.yaml b/hackfest/tapi/server/tapi_server/swagger/swagger.yaml new file mode 100644 index 0000000000000000000000000000000000000000..99928b9dcc5a48def3df98c02cf1cf936fdc8543 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/swagger/swagger.yaml @@ -0,0 +1,20579 @@ +# 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. + +openapi: 3.0.1 +info: + title: "tapi-notification,tapi-connectivity,tapi-topology,tapi-common,tapi-path-computation\ + \ API" + description: "\r\n This module contains TAPI Notification Model definitions.\r\ + \n Source: TapiNotification.uml\r\n - The TAPI YANG models included\ + \ in this TAPI release are a *normative* part of the TAPI SDK.\r\n - The\ + \ YANG specifications have been generated from the corresponding UML model using\ + \ the [ONF EAGLE UML2YANG mapping tool]\r\n \r\n and further edited manually to comply with the [ONF IISOMI UML2YANG\ + \ mapping guidelines]\r\n \r\n - Status of YANG model artifacts can be determined by referring\ + \ to the corresponding UML artifacts.\r\n As described in the UML models,\ + \ some artifacts are considered *experimental*, and thus the corresponding YANG\ + \ artifacts.\r\n - The ONF TAPI release process does not guarantee backward\ + \ compatibility of YANG models across major versions of TAPI releases.\r\n \ + \ The YANG model backward compatibility criteria are outlined in section\ + \ 11 of .\r\n YANG models included in this release may not be backward compatible\ + \ with previous TAPI releases.\r\n Copyright (c) 2018 Open Networking Foundation\ + \ (ONF). All rights reserved.\r\n License: This module is distributed under\ + \ the Apache License 2.0,\r\n This module contains TAPI Connectivity Model\ + \ definitions.\r\n Source: TapiConnectivity.uml\r\n - The TAPI YANG\ + \ models included in this TAPI release are a *normative* part of the TAPI SDK.\r\ + \n - The YANG specifications have been generated from the corresponding\ + \ UML model using the [ONF EAGLE UML2YANG mapping tool]\r\n \r\n and further edited manually to comply with the [ONF IISOMI UML2YANG\ + \ mapping guidelines]\r\n \r\n - Status of YANG model artifacts can be determined by referring\ + \ to the corresponding UML artifacts.\r\n As described in the UML models,\ + \ some artifacts are considered *experimental*, and thus the corresponding YANG\ + \ artifacts.\r\n - The ONF TAPI release process does not guarantee backward\ + \ compatibility of YANG models across major versions of TAPI releases.\r\n \ + \ The YANG model backward compatibility criteria are outlined in section 11\ + \ of .\r\n YANG models included in this release may not be backward compatible\ + \ with previous TAPI releases.\r\n Copyright (c) 2018 Open Networking Foundation\ + \ (ONF). All rights reserved.\r\n License: This module is distributed under\ + \ the Apache License 2.0.,\r\n This module contains TAPI Topology Model\ + \ definitions.\r\n Source: TapiTopology.uml\r\n - The TAPI YANG\ + \ models included in this TAPI release are a *normative* part of the TAPI SDK.\r\ + \n - The YANG specifications have been generated from the corresponding\ + \ UML model using the [ONF EAGLE UML2YANG mapping tool]\r\n \r\n and further edited manually to comply with the [ONF IISOMI UML2YANG\ + \ mapping guidelines]\r\n \r\n - Status of YANG model artifacts can be determined by referring\ + \ to the corresponding UML artifacts.\r\n As described in the UML models,\ + \ some artifacts are considered *experimental*, and thus the corresponding YANG\ + \ artifacts.\r\n - The ONF TAPI release process does not guarantee backward\ + \ compatibility of YANG models across major versions of TAPI releases.\r\n \ + \ The YANG model backward compatibility criteria are outlined in section\ + \ 11 of .\r\n YANG models included in this release may not be backward compatible\ + \ with previous TAPI releases.\r\n Copyright (c) 2018 Open Networking Foundation\ + \ (ONF). All rights reserved.\r\n License: This module is distributed under\ + \ the Apache License 2.0.,\r\n This module contains TAPI Common Model definitions.\r\ + \n Source: TapiCommon.uml\r\n - The TAPI YANG models included in\ + \ this TAPI release are a *normative* part of the TAPI SDK.\r\n - The YANG\ + \ specifications have been generated from the corresponding UML model using the\ + \ [ONF EAGLE UML2YANG mapping tool]\r\n \r\ + \n and further edited manually to comply with the [ONF IISOMI UML2YANG\ + \ mapping guidelines]\r\n \r\ + \n - Status of YANG model artifacts can be determined by referring to the\ + \ corresponding UML artifacts.\r\n As described in the UML models, some\ + \ artifacts are considered *experimental*, and thus the corresponding YANG artifacts.\r\ + \n - The ONF TAPI release process does not guarantee backward compatibility\ + \ of YANG models across major versions of TAPI releases.\r\n The YANG model\ + \ backward compatibility criteria are outlined in section 11 of .\r\ + \n YANG models included in this release may not be backward compatible\ + \ with previous TAPI releases.\r\n Copyright (c) 2018 Open Networking Foundation\ + \ (ONF). All rights reserved.\r\n License: This module is distributed under\ + \ the Apache License 2.0.,\r\n This module contains TAPI Path Computation\ + \ Model definitions.\r\n Source: TapiPathComputation.uml\r\n - The\ + \ TAPI YANG models included in this TAPI release are a *normative* part of the\ + \ TAPI SDK.\r\n - The YANG specifications have been generated from the\ + \ corresponding UML model using the [ONF EAGLE UML2YANG mapping tool]\r\n \ + \ \r\n and\ + \ further edited manually to comply with the [ONF IISOMI UML2YANG mapping guidelines]\r\ + \n \r\ + \n - Status of YANG model artifacts can be determined by referring to the\ + \ corresponding UML artifacts.\r\n As described in the UML models, some\ + \ artifacts are considered *experimental*, and thus the corresponding YANG artifacts.\r\ + \n - The ONF TAPI release process does not guarantee backward compatibility\ + \ of YANG models across major versions of TAPI releases.\r\n The YANG model\ + \ backward compatibility criteria are outlined in section 11 of .\r\ + \n YANG models included in this release may not be backward compatible\ + \ with previous TAPI releases.\r\n Copyright (c) 2018 Open Networking Foundation\ + \ (ONF). All rights reserved.\r\n License: This module is distributed under\ + \ the Apache License 2.0." + version: 2.1.3 +servers: +- url: //localhost:1234/ +paths: + /data/tapi-common:context/: + get: + tags: + - tapi-common + summary: returns tapi.common.Context + description: none + operationId: data_tapi_commoncontext_get + responses: + "200": + description: tapi.common.Context + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.ContextWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + put: + tags: + - tapi-common + summary: creates or updates tapi.common.Context + description: none + operationId: data_tapi_commoncontext_put + requestBody: + description: tapi.common.Context to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.ContextWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.Context.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + post: + tags: + - tapi-common + summary: creates tapi.common.Context + description: none + operationId: data_tapi_commoncontext_post + requestBody: + description: tapi.common.Context to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.ContextWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.Context.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + delete: + tags: + - tapi-common + summary: removes tapi.common.Context + description: none + operationId: data_tapi_commoncontext_delete + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /data/tapi-common:context/name/: + post: + tags: + - tapi-common + summary: creates tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_name_post + requestBody: + description: tapi.common.NameAndValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.NameAndValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /data/tapi-common:context/name={value-name}/: + get: + tags: + - tapi-common + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_namevalue_name_get + parameters: + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + put: + tags: + - tapi-common + summary: creates or updates tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_namevalue_name_put + parameters: + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.NameAndValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.NameAndValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + delete: + tags: + - tapi-common + summary: removes tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_namevalue_name_delete + parameters: + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /data/tapi-common:context/service-interface-point/: + post: + tags: + - tapi-common + summary: creates tapi.common.ServiceInterfacePoint + description: none + operationId: data_tapi_commoncontext_service_interface_point_post + requestBody: + description: tapi.common.ServiceInterfacePoint to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.ServiceInterfacePointWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.ServiceInterfacePoint.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /data/tapi-common:context/service-interface-point={uuid}/: + get: + tags: + - tapi-common + summary: returns tapi.common.ServiceInterfacePoint + description: none + operationId: data_tapi_commoncontext_service_interface_pointuuid_get + parameters: + - name: uuid + in: path + description: Id of service-interface-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.ServiceInterfacePoint + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.ServiceInterfacePointWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + put: + tags: + - tapi-common + summary: creates or updates tapi.common.ServiceInterfacePoint + description: none + operationId: data_tapi_commoncontext_service_interface_pointuuid_put + parameters: + - name: uuid + in: path + description: Id of service-interface-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.ServiceInterfacePoint to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.ServiceInterfacePointWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.ServiceInterfacePoint.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + delete: + tags: + - tapi-common + summary: removes tapi.common.ServiceInterfacePoint + description: none + operationId: data_tapi_commoncontext_service_interface_pointuuid_delete + parameters: + - name: uuid + in: path + description: Id of service-interface-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /data/tapi-common:context/service-interface-point={uuid}/available-capacity/: + get: + tags: + - tapi-common + summary: returns tapi.common.Capacity + description: Capacity available to be assigned. + operationId: data_tapi_commoncontext_service_interface_pointuuid_available_capacity_get + parameters: + - name: uuid + in: path + description: Id of service-interface-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.Capacity + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /data/tapi-common:context/service-interface-point={uuid}/available-capacity/bandwidth-profile/: + get: + tags: + - tapi-common + summary: returns tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_service_interface_pointuuid_available_capacity_bandwidth_profile_get + parameters: + - name: uuid + in: path + description: Id of service-interface-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.BandwidthProfile + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.BandwidthProfileWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /data/tapi-common:context/service-interface-point={uuid}/available-capacity/bandwidth-profile/committed-burst-size/: + get: + tags: + - tapi-common + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_service_interface_pointuuid_available_capacity_bandwidth_profile_committed_burst_size_get + parameters: + - name: uuid + in: path + description: Id of service-interface-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /data/tapi-common:context/service-interface-point={uuid}/available-capacity/bandwidth-profile/committed-information-rate/: + get: + tags: + - tapi-common + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_service_interface_pointuuid_available_capacity_bandwidth_profile_committed_information_rate_get + parameters: + - name: uuid + in: path + description: Id of service-interface-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /data/tapi-common:context/service-interface-point={uuid}/available-capacity/bandwidth-profile/peak-burst-size/: + get: + tags: + - tapi-common + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_service_interface_pointuuid_available_capacity_bandwidth_profile_peak_burst_size_get + parameters: + - name: uuid + in: path + description: Id of service-interface-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /data/tapi-common:context/service-interface-point={uuid}/available-capacity/bandwidth-profile/peak-information-rate/: + get: + tags: + - tapi-common + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_service_interface_pointuuid_available_capacity_bandwidth_profile_peak_information_rate_get + parameters: + - name: uuid + in: path + description: Id of service-interface-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /data/tapi-common:context/service-interface-point={uuid}/available-capacity/total-size/: + get: + tags: + - tapi-common + summary: returns tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_service_interface_pointuuid_available_capacity_total_size_get + parameters: + - name: uuid + in: path + description: Id of service-interface-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /data/tapi-common:context/service-interface-point={uuid}/name/: + post: + tags: + - tapi-common + summary: creates tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_service_interface_pointuuid_name_post + parameters: + - name: uuid + in: path + description: Id of service-interface-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.NameAndValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.NameAndValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /data/tapi-common:context/service-interface-point={uuid}/name={value-name}/: + get: + tags: + - tapi-common + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_service_interface_pointuuid_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of service-interface-point + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + put: + tags: + - tapi-common + summary: creates or updates tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_service_interface_pointuuid_namevalue_name_put + parameters: + - name: uuid + in: path + description: Id of service-interface-point + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.NameAndValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.NameAndValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + delete: + tags: + - tapi-common + summary: removes tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_service_interface_pointuuid_namevalue_name_delete + parameters: + - name: uuid + in: path + description: Id of service-interface-point + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /data/tapi-common:context/service-interface-point={uuid}/total-potential-capacity/: + get: + tags: + - tapi-common + summary: returns tapi.common.Capacity + description: An optimistic view of the capacity of the TopologicalEntity assuming + that any shared capacity is available to be taken. + operationId: data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_get + parameters: + - name: uuid + in: path + description: Id of service-interface-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.Capacity + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /data/tapi-common:context/service-interface-point={uuid}/total-potential-capacity/bandwidth-profile/: + get: + tags: + - tapi-common + summary: returns tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_bandwidth_profile_get + parameters: + - name: uuid + in: path + description: Id of service-interface-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.BandwidthProfile + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.BandwidthProfileWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /data/tapi-common:context/service-interface-point={uuid}/total-potential-capacity/bandwidth-profile/committed-burst-size/: + get: + tags: + - tapi-common + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get + parameters: + - name: uuid + in: path + description: Id of service-interface-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /data/tapi-common:context/service-interface-point={uuid}/total-potential-capacity/bandwidth-profile/committed-information-rate/: + get: + tags: + - tapi-common + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get + parameters: + - name: uuid + in: path + description: Id of service-interface-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /data/tapi-common:context/service-interface-point={uuid}/total-potential-capacity/bandwidth-profile/peak-burst-size/: + get: + tags: + - tapi-common + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get + parameters: + - name: uuid + in: path + description: Id of service-interface-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /data/tapi-common:context/service-interface-point={uuid}/total-potential-capacity/bandwidth-profile/peak-information-rate/: + get: + tags: + - tapi-common + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get + parameters: + - name: uuid + in: path + description: Id of service-interface-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /data/tapi-common:context/service-interface-point={uuid}/total-potential-capacity/total-size/: + get: + tags: + - tapi-common + summary: returns tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_total_size_get + parameters: + - name: uuid + in: path + description: Id of service-interface-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/: + get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.ConnectivityContext + description: Augments the base TAPI Context with ConnectivityService information + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_get + responses: + "200": + description: tapi.connectivity.ConnectivityContext + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityContextWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.connectivity.ConnectivityContext + description: Augments the base TAPI Context with ConnectivityService information + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_put + requestBody: + description: tapi.connectivity.ConnectivityContext to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityContextWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.connectivity.ConnectivityContext.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.connectivity.ConnectivityContext + description: Augments the base TAPI Context with ConnectivityService information + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_post + requestBody: + description: tapi.connectivity.ConnectivityContext to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityContextWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.connectivity.ConnectivityContext.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.connectivity.ConnectivityContext + description: Augments the base TAPI Context with ConnectivityService information + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_delete + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/: + get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.Connection + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_get + parameters: + - name: uuid + in: path + description: Id of connection + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.Connection + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectionWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/connection-end-point={topology-uuid},{node-uuid},{node-edge-point-uuid},{connection-end-point-uuid}/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.ConnectionEndPointRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_connection_end_pointtopology_uuidnode_uuidnode_edge_point_uuidconnection_end_point_uuid_get + parameters: + - name: uuid + in: path + description: Id of connection + required: true + style: simple + explode: false + schema: + type: string + - name: topology_uuid + in: path + description: Id of connection-end-point + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of connection-end-point + required: true + style: simple + explode: false + schema: + type: string + - name: node_edge_point_uuid + in: path + description: Id of connection-end-point + required: true + style: simple + explode: false + schema: + type: string + - name: connection_end_point_uuid + in: path + description: Id of connection-end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.ConnectionEndPointRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectionEndPointRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/connection-spec-reference/: + get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.ConnectionSpecReference + description: Provides the reference to the spec that defines the connection + type and cepRoles. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_connection_spec_reference_get + parameters: + - name: uuid + in: path + description: Id of connection + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.ConnectionSpecReference + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectionSpecReferenceWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/lower-connection={connection-uuid}/: + get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.ConnectionRef + description: "An Connection object supports a recursive aggregation relationship\ + \ such that the internal construction of an Connection can be exposed as multiple\ + \ lower level Connection objects (partitioning).\r\n Aggregation\ + \ is used as for the Node/Topology to allow changes in hierarchy. \r\n \ + \ Connection aggregation reflects Node/Topology aggregation.\ + \ \r\n The FC represents a Cross-Connection in an NE. The Cross-Connection\ + \ in an NE is not necessarily the lowest level of FC partitioning." + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_lower_connectionconnection_uuid_get + parameters: + - name: uuid + in: path + description: Id of connection + required: true + style: simple + explode: false + schema: + type: string + - name: connection_uuid + in: path + description: Id of lower-connection + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.ConnectionRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectionRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/name={value-name}/: + get: + tags: + - tapi-connectivity + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of connection + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/route={local-id}/: + get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.Route + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_routelocal_id_get + parameters: + - name: uuid + in: path + description: Id of connection + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of route + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.Route + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.RouteWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/route={local-id}/connection-end-point={topology-uuid},{node-uuid},{node-edge-point-uuid},{connection-end-point-uuid}/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.ConnectionEndPointRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_routelocal_id_connection_end_pointtopology_uuidnode_uuidnode_edge_point_uuidconnection_end_point_uuid_get + parameters: + - name: uuid + in: path + description: Id of connection + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of route + required: true + style: simple + explode: false + schema: + type: string + - name: topology_uuid + in: path + description: Id of connection-end-point + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of connection-end-point + required: true + style: simple + explode: false + schema: + type: string + - name: node_edge_point_uuid + in: path + description: Id of connection-end-point + required: true + style: simple + explode: false + schema: + type: string + - name: connection_end_point_uuid + in: path + description: Id of connection-end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.ConnectionEndPointRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectionEndPointRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/route={local-id}/name={value-name}/: + get: + tags: + - tapi-connectivity + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_routelocal_id_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of connection + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of route + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/route={local-id}/resilience-route-pac/: + get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.ResilienceRoute + description: Provides optional resilience and state attributes to the Route. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_routelocal_id_resilience_route_pac_get + parameters: + - name: uuid + in: path + description: Id of connection + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of route + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.ResilienceRoute + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ResilienceRouteWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/route={local-id}/resilience-route-pac/name={value-name}/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_routelocal_id_resilience_route_pac_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of connection + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of route + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/supported-client-link={topology-uuid},{link-uuid}/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.topology.LinkRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_supported_client_linktopology_uuidlink_uuid_get + parameters: + - name: uuid + in: path + description: Id of connection + required: true + style: simple + explode: false + schema: + type: string + - name: topology_uuid + in: path + description: Id of supported-client-link + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of supported-client-link + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.LinkRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.LinkRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/: + get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.SwitchControl + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_get + parameters: + - name: uuid + in: path + description: Id of connection + required: true + style: simple + explode: false + schema: + type: string + - name: switch_control_uuid + in: path + description: Id of switch-control + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.SwitchControl + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.SwitchControlWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/name={value-name}/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of connection + required: true + style: simple + explode: false + schema: + type: string + - name: switch_control_uuid + in: path + description: Id of switch-control + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/resilience-type/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.topology.ResilienceType + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_resilience_type_get + parameters: + - name: uuid + in: path + description: Id of connection + required: true + style: simple + explode: false + schema: + type: string + - name: switch_control_uuid + in: path + description: Id of switch-control + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.ResilienceType + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.ResilienceTypeWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/sub-switch-control={connection-uuid},{sub-switch-control-switch-control-uuid}/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.SwitchControlRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_sub_switch_controlconnection_uuidsub_switch_control_switch_control_uuid_get + parameters: + - name: uuid + in: path + description: Id of connection + required: true + style: simple + explode: false + schema: + type: string + - name: switch_control_uuid + in: path + description: Id of switch-control + required: true + style: simple + explode: false + schema: + type: string + - name: connection_uuid + in: path + description: Id of sub-switch-control + required: true + style: simple + explode: false + schema: + type: string + - name: sub_switch_control_switch_control_uuid + in: path + description: Id of sub-switch-control + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.SwitchControlRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.SwitchControlRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/switch={local-id}/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.Switch + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_switchlocal_id_get + parameters: + - name: uuid + in: path + description: Id of connection + required: true + style: simple + explode: false + schema: + type: string + - name: switch_control_uuid + in: path + description: Id of switch-control + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of switch + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.Switch + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.SwitchWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/switch={local-id}/name={value-name}/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_switchlocal_id_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of connection + required: true + style: simple + explode: false + schema: + type: string + - name: switch_control_uuid + in: path + description: Id of switch-control + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of switch + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/switch={local-id}/selected-connection-end-point={topology-uuid},{node-uuid},{node-edge-point-uuid},{connection-end-point-uuid}/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.ConnectionEndPointRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_switchlocal_id_selected_connection_end_pointtopology_uuidnode_uuidnode_edge_point_uuidconnection_end_point_uuid_get + parameters: + - name: uuid + in: path + description: Id of connection + required: true + style: simple + explode: false + schema: + type: string + - name: switch_control_uuid + in: path + description: Id of switch-control + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of switch + required: true + style: simple + explode: false + schema: + type: string + - name: topology_uuid + in: path + description: Id of selected-connection-end-point + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of selected-connection-end-point + required: true + style: simple + explode: false + schema: + type: string + - name: node_edge_point_uuid + in: path + description: Id of selected-connection-end-point + required: true + style: simple + explode: false + schema: + type: string + - name: connection_end_point_uuid + in: path + description: Id of selected-connection-end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.ConnectionEndPointRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectionEndPointRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/switch={local-id}/selected-route={connection-uuid},{route-local-id}/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.RouteRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_switchlocal_id_selected_routeconnection_uuidroute_local_id_get + parameters: + - name: uuid + in: path + description: Id of connection + required: true + style: simple + explode: false + schema: + type: string + - name: switch_control_uuid + in: path + description: Id of switch-control + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of switch + required: true + style: simple + explode: false + schema: + type: string + - name: connection_uuid + in: path + description: Id of selected-route + required: true + style: simple + explode: false + schema: + type: string + - name: route_local_id + in: path + description: Id of selected-route + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.RouteRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.RouteRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service/: + post: + tags: + - tapi-connectivity + summary: creates tapi.connectivity.ConnectivityService + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_service_post + requestBody: + description: tapi.connectivity.ConnectivityService to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.connectivity.ConnectivityService.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/: + get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.ConnectivityService + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.ConnectivityService + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.connectivity.ConnectivityService + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.connectivity.ConnectivityService to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.connectivity.ConnectivityService.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.connectivity.ConnectivityService + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/connection={connection-uuid}/: + get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.ConnectionRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_connectionconnection_uuid_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: connection_uuid + in: path + description: Id of connection + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.ConnectionRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectionRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/coroute-inclusion/: + get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.ConnectivityServiceRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_coroute_inclusion_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.ConnectivityServiceRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.connectivity.ConnectivityServiceRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_coroute_inclusion_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.connectivity.ConnectivityServiceRef to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceRefWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.connectivity.ConnectivityServiceRef.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.connectivity.ConnectivityServiceRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_coroute_inclusion_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.connectivity.ConnectivityServiceRef to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceRefWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.connectivity.ConnectivityServiceRef.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.connectivity.ConnectivityServiceRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_coroute_inclusion_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/cost-characteristic/: + post: + tags: + - tapi-connectivity + summary: creates tapi.topology.CostCharacteristic + description: The list of costs where each cost relates to some aspect of the + TopologicalEntity. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_cost_characteristic_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.topology.CostCharacteristic to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.CostCharacteristicWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.topology.CostCharacteristic.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/cost-characteristic={cost-name}/: + get: + tags: + - tapi-connectivity + summary: returns tapi.topology.CostCharacteristic + description: The list of costs where each cost relates to some aspect of the + TopologicalEntity. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_cost_characteristiccost_name_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: cost_name + in: path + description: Id of cost-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.CostCharacteristic + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.CostCharacteristicWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.topology.CostCharacteristic + description: The list of costs where each cost relates to some aspect of the + TopologicalEntity. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_cost_characteristiccost_name_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: cost_name + in: path + description: Id of cost-characteristic + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.topology.CostCharacteristic to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.CostCharacteristicWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.topology.CostCharacteristic.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.topology.CostCharacteristic + description: The list of costs where each cost relates to some aspect of the + TopologicalEntity. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_cost_characteristiccost_name_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: cost_name + in: path + description: Id of cost-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/diversity-exclusion/: + post: + tags: + - tapi-connectivity + summary: creates tapi.connectivity.ConnectivityServiceRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_diversity_exclusion_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.connectivity.ConnectivityServiceRef to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceRefWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.connectivity.ConnectivityServiceRef.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/diversity-exclusion={connectivity-service-uuid}/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.ConnectivityServiceRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_diversity_exclusionconnectivity_service_uuid_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: connectivity_service_uuid + in: path + description: Id of diversity-exclusion + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.ConnectivityServiceRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.connectivity.ConnectivityServiceRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_diversity_exclusionconnectivity_service_uuid_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: connectivity_service_uuid + in: path + description: Id of diversity-exclusion + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.connectivity.ConnectivityServiceRef to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceRefWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.connectivity.ConnectivityServiceRef.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.connectivity.ConnectivityServiceRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_diversity_exclusionconnectivity_service_uuid_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: connectivity_service_uuid + in: path + description: Id of diversity-exclusion + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point/: + post: + tags: + - tapi-connectivity + summary: creates tapi.connectivity.ConnectivityServiceEndPoint + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_point_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.connectivity.ConnectivityServiceEndPoint to be added to + list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceEndPointWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.connectivity.ConnectivityServiceEndPoint.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/: + get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.ConnectivityServiceEndPoint + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.ConnectivityServiceEndPoint + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceEndPointWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.connectivity.ConnectivityServiceEndPoint + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.connectivity.ConnectivityServiceEndPoint to be added or + updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceEndPointWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.connectivity.ConnectivityServiceEndPoint.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.connectivity.ConnectivityServiceEndPoint + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/: + get: + tags: + - tapi-connectivity + summary: returns tapi.common.Capacity + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.Capacity + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.common.Capacity + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.Capacity to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.Capacity.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.common.Capacity + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.Capacity to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.Capacity.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.common.Capacity + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.BandwidthProfile + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.BandwidthProfileWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.BandwidthProfile to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.BandwidthProfileWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.BandwidthProfile.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.BandwidthProfile to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.BandwidthProfileWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.BandwidthProfile.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/total-size/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_total_size_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_total_size_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_total_size_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_total_size_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/connection-end-point={topology-uuid},{node-uuid},{node-edge-point-uuid},{connection-end-point-uuid}/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.ConnectionEndPointRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_connection_end_pointtopology_uuidnode_uuidnode_edge_point_uuidconnection_end_point_uuid_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + - name: topology_uuid + in: path + description: Id of connection-end-point + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of connection-end-point + required: true + style: simple + explode: false + schema: + type: string + - name: node_edge_point_uuid + in: path + description: Id of connection-end-point + required: true + style: simple + explode: false + schema: + type: string + - name: connection_end_point_uuid + in: path + description: Id of connection-end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.ConnectionEndPointRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectionEndPointRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/name/: + post: + tags: + - tapi-connectivity + summary: creates tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_name_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.NameAndValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.NameAndValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/name={value-name}/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_namevalue_name_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.NameAndValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.NameAndValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_namevalue_name_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/peer-fwd-connectivity-service-end-point/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.ConnectivityServiceEndPointRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_peer_fwd_connectivity_service_end_point_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.ConnectivityServiceEndPointRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceEndPointRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.connectivity.ConnectivityServiceEndPointRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_peer_fwd_connectivity_service_end_point_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.connectivity.ConnectivityServiceEndPointRef to be added + or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceEndPointRefWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.connectivity.ConnectivityServiceEndPointRef.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.connectivity.ConnectivityServiceEndPointRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_peer_fwd_connectivity_service_end_point_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.connectivity.ConnectivityServiceEndPointRef to be added + to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceEndPointRefWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.connectivity.ConnectivityServiceEndPointRef.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.connectivity.ConnectivityServiceEndPointRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_peer_fwd_connectivity_service_end_point_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/protecting-connectivity-service-end-point/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.ConnectivityServiceEndPointRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_protecting_connectivity_service_end_point_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.ConnectivityServiceEndPointRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceEndPointRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.connectivity.ConnectivityServiceEndPointRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_protecting_connectivity_service_end_point_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.connectivity.ConnectivityServiceEndPointRef to be added + or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceEndPointRefWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.connectivity.ConnectivityServiceEndPointRef.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.connectivity.ConnectivityServiceEndPointRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_protecting_connectivity_service_end_point_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.connectivity.ConnectivityServiceEndPointRef to be added + to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceEndPointRefWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.connectivity.ConnectivityServiceEndPointRef.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.connectivity.ConnectivityServiceEndPointRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_protecting_connectivity_service_end_point_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/server-connectivity-service-end-point/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.ConnectivityServiceEndPointRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_server_connectivity_service_end_point_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.ConnectivityServiceEndPointRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceEndPointRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.connectivity.ConnectivityServiceEndPointRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_server_connectivity_service_end_point_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.connectivity.ConnectivityServiceEndPointRef to be added + or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceEndPointRefWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.connectivity.ConnectivityServiceEndPointRef.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.connectivity.ConnectivityServiceEndPointRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_server_connectivity_service_end_point_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.connectivity.ConnectivityServiceEndPointRef to be added + to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceEndPointRefWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.connectivity.ConnectivityServiceEndPointRef.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.connectivity.ConnectivityServiceEndPointRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_server_connectivity_service_end_point_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/service-interface-point/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.common.ServiceInterfacePointRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_service_interface_point_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.ServiceInterfacePointRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.ServiceInterfacePointRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.common.ServiceInterfacePointRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_service_interface_point_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.ServiceInterfacePointRef to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.ServiceInterfacePointRefWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.ServiceInterfacePointRef.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.common.ServiceInterfacePointRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_service_interface_point_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.ServiceInterfacePointRef to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.ServiceInterfacePointRefWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.ServiceInterfacePointRef.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.common.ServiceInterfacePointRef + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_service_interface_point_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/latency-characteristic/: + post: + tags: + - tapi-connectivity + summary: creates tapi.topology.LatencyCharacteristic + description: The effect on the latency of a queuing process. This only has significant + effect for packet based systems and has a complex characteristic. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_latency_characteristic_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.topology.LatencyCharacteristic to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.LatencyCharacteristicWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.topology.LatencyCharacteristic.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/latency-characteristic={traffic-property-name}/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.topology.LatencyCharacteristic + description: The effect on the latency of a queuing process. This only has significant + effect for packet based systems and has a complex characteristic. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_latency_characteristictraffic_property_name_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: traffic_property_name + in: path + description: Id of latency-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.LatencyCharacteristic + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.LatencyCharacteristicWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.topology.LatencyCharacteristic + description: The effect on the latency of a queuing process. This only has significant + effect for packet based systems and has a complex characteristic. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_latency_characteristictraffic_property_name_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: traffic_property_name + in: path + description: Id of latency-characteristic + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.topology.LatencyCharacteristic to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.LatencyCharacteristicWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.topology.LatencyCharacteristic.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.topology.LatencyCharacteristic + description: The effect on the latency of a queuing process. This only has significant + effect for packet based systems and has a complex characteristic. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_latency_characteristictraffic_property_name_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: traffic_property_name + in: path + description: Id of latency-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/max-allowed-cost/: + get: + tags: + - tapi-connectivity + summary: returns tapi.path.computation.ValueOrPriority + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_cost_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.path.computation.ValueOrPriority + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriorityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.path.computation.ValueOrPriority + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_cost_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.ValueOrPriority to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriorityWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.path.computation.ValueOrPriority.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.path.computation.ValueOrPriority + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_cost_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.ValueOrPriority to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriorityWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.path.computation.ValueOrPriority.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.path.computation.ValueOrPriority + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_cost_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/max-allowed-delay/: + get: + tags: + - tapi-connectivity + summary: returns tapi.path.computation.ValueOrPriority + description: Delay unit is microseconds. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_delay_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.path.computation.ValueOrPriority + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriorityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.path.computation.ValueOrPriority + description: Delay unit is microseconds. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_delay_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.ValueOrPriority to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriorityWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.path.computation.ValueOrPriority.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.path.computation.ValueOrPriority + description: Delay unit is microseconds. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_delay_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.ValueOrPriority to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriorityWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.path.computation.ValueOrPriority.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.path.computation.ValueOrPriority + description: Delay unit is microseconds. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_delay_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/max-allowed-hops/: + get: + tags: + - tapi-connectivity + summary: returns tapi.path.computation.ValueOrPriority + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_hops_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.path.computation.ValueOrPriority + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriorityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.path.computation.ValueOrPriority + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_hops_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.ValueOrPriority to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriorityWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.path.computation.ValueOrPriority.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.path.computation.ValueOrPriority + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_hops_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.ValueOrPriority to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriorityWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.path.computation.ValueOrPriority.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.path.computation.ValueOrPriority + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_hops_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/name/: + post: + tags: + - tapi-connectivity + summary: creates tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_name_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.NameAndValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.NameAndValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/name={value-name}/: + get: + tags: + - tapi-connectivity + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_namevalue_name_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.NameAndValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.NameAndValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_namevalue_name_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/: + get: + tags: + - tapi-connectivity + summary: returns tapi.common.Capacity + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.Capacity + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.common.Capacity + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.Capacity to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.Capacity.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.common.Capacity + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.Capacity to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.Capacity.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.common.Capacity + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.BandwidthProfile + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.BandwidthProfileWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.BandwidthProfile to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.BandwidthProfileWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.BandwidthProfile.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.BandwidthProfile to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.BandwidthProfileWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.BandwidthProfile.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_burst_size_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_burst_size_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_burst_size_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_burst_size_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_information_rate_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_information_rate_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_information_rate_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_information_rate_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_burst_size_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_burst_size_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_burst_size_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_burst_size_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_information_rate_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_information_rate_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_information_rate_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_information_rate_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/total-size/: + get: + tags: + - tapi-connectivity + summary: returns tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_total_size_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_total_size_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_total_size_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_total_size_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/resilience-type/: + get: + tags: + - tapi-connectivity + summary: returns tapi.topology.ResilienceType + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_resilience_type_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.ResilienceType + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.ResilienceTypeWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.topology.ResilienceType + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_resilience_type_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.topology.ResilienceType to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.ResilienceTypeWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.topology.ResilienceType.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.topology.ResilienceType + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_resilience_type_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.topology.ResilienceType to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.ResilienceTypeWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.topology.ResilienceType.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.topology.ResilienceType + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_resilience_type_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/risk-diversity-characteristic/: + post: + tags: + - tapi-connectivity + summary: creates tapi.topology.RiskCharacteristic + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_risk_diversity_characteristic_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.topology.RiskCharacteristic to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.RiskCharacteristicWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.topology.RiskCharacteristic.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/risk-diversity-characteristic={risk-characteristic-name}/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.topology.RiskCharacteristic + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_risk_diversity_characteristicrisk_characteristic_name_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: risk_characteristic_name + in: path + description: Id of risk-diversity-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.RiskCharacteristic + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.RiskCharacteristicWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.topology.RiskCharacteristic + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_risk_diversity_characteristicrisk_characteristic_name_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: risk_characteristic_name + in: path + description: Id of risk-diversity-characteristic + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.topology.RiskCharacteristic to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.RiskCharacteristicWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.topology.RiskCharacteristic.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.topology.RiskCharacteristic + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_risk_diversity_characteristicrisk_characteristic_name_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + - name: risk_characteristic_name + in: path + description: Id of risk-diversity-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/schedule/: + get: + tags: + - tapi-connectivity + summary: returns tapi.common.TimeRange + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_schedule_get + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.TimeRange + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.TimeRangeWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + put: + tags: + - tapi-connectivity + summary: creates or updates tapi.common.TimeRange + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_schedule_put + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.TimeRange to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.TimeRangeWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.TimeRange.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + post: + tags: + - tapi-connectivity + summary: creates tapi.common.TimeRange + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_schedule_post + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.TimeRange to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.TimeRangeWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.TimeRange.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + delete: + tags: + - tapi-connectivity + summary: removes tapi.common.TimeRange + description: none + operationId: data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_schedule_delete + parameters: + - name: uuid + in: path + description: Id of connectivity-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /data/tapi-common:context/tapi-notification:notification-context/: + get: + tags: + - tapi-notification + summary: returns tapi.notification.NotificationContext + description: Augments the base TAPI Context with NotificationService information + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_get + responses: + "200": + description: tapi.notification.NotificationContext + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.NotificationContextWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + put: + tags: + - tapi-notification + summary: creates or updates tapi.notification.NotificationContext + description: Augments the base TAPI Context with NotificationService information + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_put + requestBody: + description: tapi.notification.NotificationContext to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.NotificationContextWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.notification.NotificationContext.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + post: + tags: + - tapi-notification + summary: creates tapi.notification.NotificationContext + description: Augments the base TAPI Context with NotificationService information + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_post + requestBody: + description: tapi.notification.NotificationContext to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.NotificationContextWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.notification.NotificationContext.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + delete: + tags: + - tapi-notification + summary: removes tapi.notification.NotificationContext + description: Augments the base TAPI Context with NotificationService information + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_delete + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /data/tapi-common:context/tapi-notification:notification-context/notif-subscription/: + post: + tags: + - tapi-notification + summary: creates tapi.notification.NotificationSubscriptionService + description: none + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscription_post + requestBody: + description: tapi.notification.NotificationSubscriptionService to be added + to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.NotificationSubscriptionServiceWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.notification.NotificationSubscriptionService.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/: + get: + tags: + - tapi-notification + summary: returns tapi.notification.NotificationSubscriptionService + description: none + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_get + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.notification.NotificationSubscriptionService + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.NotificationSubscriptionServiceWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + put: + tags: + - tapi-notification + summary: creates or updates tapi.notification.NotificationSubscriptionService + description: none + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_put + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.notification.NotificationSubscriptionService to be added + or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.NotificationSubscriptionServiceWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.notification.NotificationSubscriptionService.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + delete: + tags: + - tapi-notification + summary: removes tapi.notification.NotificationSubscriptionService + description: none + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_delete + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/name/: + post: + tags: + - tapi-notification + summary: creates tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_name_post + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.NameAndValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.NameAndValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/name={value-name}/: + get: + tags: + - tapi-notification + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + put: + tags: + - tapi-notification + summary: creates or updates tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_namevalue_name_put + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.NameAndValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.NameAndValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + delete: + tags: + - tapi-notification + summary: removes tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_namevalue_name_delete + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification-channel/: + get: + tags: + - tapi-notification + summary: returns tapi.notification.NotificationChannel + description: none + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notification_channel_get + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.notification.NotificationChannel + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.NotificationChannelWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + ? /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification-channel/name={value-name}/ + : get: + tags: + - tapi-notification + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notification_channel_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification={notification-uuid}/: + get: + tags: + - tapi-notification + summary: returns tapi.notification.Notification + description: none + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_get + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + - name: notification_uuid + in: path + description: Id of notification + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.notification.Notification + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.NotificationWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + ? /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification={notification-uuid}/additional-info={value-name}/ + : get: + tags: + - tapi-notification + summary: returns tapi.common.NameAndValue + description: none + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_additional_infovalue_name_get + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + - name: notification_uuid + in: path + description: Id of notification + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of additional-info + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + ? /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification={notification-uuid}/alarm-info/ + : get: + tags: + - tapi-notification + summary: returns tapi.notification.AlarmInfo + description: none + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_alarm_info_get + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + - name: notification_uuid + in: path + description: Id of notification + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.notification.AlarmInfo + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.AlarmInfoWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + ? /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification={notification-uuid}/changed-attributes={value-name}/ + : get: + tags: + - tapi-notification + summary: returns tapi.notification.NameAndValueChange + description: none + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_changed_attributesvalue_name_get + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + - name: notification_uuid + in: path + description: Id of notification + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of changed-attributes + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.notification.NameAndValueChange + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.NameAndValueChangeWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + ? /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification={notification-uuid}/name={value-name}/ + : get: + tags: + - tapi-notification + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + - name: notification_uuid + in: path + description: Id of notification + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + ? /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification={notification-uuid}/target-object-name={value-name}/ + : get: + tags: + - tapi-notification + summary: returns tapi.common.NameAndValue + description: none + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_target_object_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + - name: notification_uuid + in: path + description: Id of notification + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of target-object-name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + ? /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification={notification-uuid}/tca-info/ + : get: + tags: + - tapi-notification + summary: returns tapi.notification.TcaInfo + description: none + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_tca_info_get + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + - name: notification_uuid + in: path + description: Id of notification + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.notification.TcaInfo + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.TcaInfoWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/subscription-filter/: + get: + tags: + - tapi-notification + summary: returns tapi.notification.SubscriptionFilter + description: none + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_get + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.notification.SubscriptionFilter + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.SubscriptionFilterWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + put: + tags: + - tapi-notification + summary: creates or updates tapi.notification.SubscriptionFilter + description: none + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_put + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.notification.SubscriptionFilter to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.SubscriptionFilterWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.notification.SubscriptionFilter.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + post: + tags: + - tapi-notification + summary: creates tapi.notification.SubscriptionFilter + description: none + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_post + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.notification.SubscriptionFilter to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.SubscriptionFilterWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.notification.SubscriptionFilter.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + delete: + tags: + - tapi-notification + summary: removes tapi.notification.SubscriptionFilter + description: none + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_delete + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/subscription-filter/name/: + post: + tags: + - tapi-notification + summary: creates tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_name_post + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.NameAndValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.NameAndValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + ? /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/subscription-filter/name={value-name}/ + : get: + tags: + - tapi-notification + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + put: + tags: + - tapi-notification + summary: creates or updates tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_namevalue_name_put + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.NameAndValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.NameAndValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + delete: + tags: + - tapi-notification + summary: removes tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_namevalue_name_delete + parameters: + - name: uuid + in: path + description: Id of notif-subscription + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /data/tapi-common:context/tapi-notification:notification-context/notification={uuid}/: + get: + tags: + - tapi-notification + summary: returns tapi.notification.Notification + description: none + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_get + parameters: + - name: uuid + in: path + description: Id of notification + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.notification.Notification + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.NotificationWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /data/tapi-common:context/tapi-notification:notification-context/notification={uuid}/additional-info={value-name}/: + get: + tags: + - tapi-notification + summary: returns tapi.common.NameAndValue + description: none + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_additional_infovalue_name_get + parameters: + - name: uuid + in: path + description: Id of notification + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of additional-info + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /data/tapi-common:context/tapi-notification:notification-context/notification={uuid}/alarm-info/: + get: + tags: + - tapi-notification + summary: returns tapi.notification.AlarmInfo + description: none + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_alarm_info_get + parameters: + - name: uuid + in: path + description: Id of notification + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.notification.AlarmInfo + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.AlarmInfoWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /data/tapi-common:context/tapi-notification:notification-context/notification={uuid}/changed-attributes={value-name}/: + get: + tags: + - tapi-notification + summary: returns tapi.notification.NameAndValueChange + description: none + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_changed_attributesvalue_name_get + parameters: + - name: uuid + in: path + description: Id of notification + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of changed-attributes + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.notification.NameAndValueChange + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.NameAndValueChangeWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /data/tapi-common:context/tapi-notification:notification-context/notification={uuid}/name={value-name}/: + get: + tags: + - tapi-notification + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of notification + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /data/tapi-common:context/tapi-notification:notification-context/notification={uuid}/target-object-name={value-name}/: + get: + tags: + - tapi-notification + summary: returns tapi.common.NameAndValue + description: none + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_target_object_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of notification + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of target-object-name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /data/tapi-common:context/tapi-notification:notification-context/notification={uuid}/tca-info/: + get: + tags: + - tapi-notification + summary: returns tapi.notification.TcaInfo + description: none + operationId: data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_tca_info_get + parameters: + - name: uuid + in: path + description: Id of notification + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.notification.TcaInfo + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.TcaInfoWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /data/tapi-common:context/tapi-path-computation:path-computation-context/: + get: + tags: + - tapi-path-computation + summary: returns tapi.path.computation.PathComputationContext + description: Augments the base TAPI Context with PathComputationService information + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_get + responses: + "200": + description: tapi.path.computation.PathComputationContext + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.PathComputationContextWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.path.computation.PathComputationContext + description: Augments the base TAPI Context with PathComputationService information + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_put + requestBody: + description: tapi.path.computation.PathComputationContext to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.PathComputationContextWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.path.computation.PathComputationContext.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + post: + tags: + - tapi-path-computation + summary: creates tapi.path.computation.PathComputationContext + description: Augments the base TAPI Context with PathComputationService information + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_post + requestBody: + description: tapi.path.computation.PathComputationContext to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.PathComputationContextWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.path.computation.PathComputationContext.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.path.computation.PathComputationContext + description: Augments the base TAPI Context with PathComputationService information + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_delete + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service/: + post: + tags: + - tapi-path-computation + summary: creates tapi.path.computation.PathComputationService + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_service_post + requestBody: + description: tapi.path.computation.PathComputationService to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.PathComputationServiceWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.path.computation.PathComputationService.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/: + get: + tags: + - tapi-path-computation + summary: returns tapi.path.computation.PathComputationService + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.path.computation.PathComputationService + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.PathComputationServiceWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.path.computation.PathComputationService + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.PathComputationService to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.PathComputationServiceWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.path.computation.PathComputationService.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.path.computation.PathComputationService + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point/: + post: + tags: + - tapi-path-computation + summary: creates tapi.path.computation.PathServiceEndPoint + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_point_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.PathServiceEndPoint to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.PathServiceEndPointWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.path.computation.PathServiceEndPoint.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/: + get: + tags: + - tapi-path-computation + summary: returns tapi.path.computation.PathServiceEndPoint + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.path.computation.PathServiceEndPoint + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.PathServiceEndPointWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.path.computation.PathServiceEndPoint + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.PathServiceEndPoint to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.PathServiceEndPointWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.path.computation.PathServiceEndPoint.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.path.computation.PathServiceEndPoint + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/ + : get: + tags: + - tapi-path-computation + summary: returns tapi.common.Capacity + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.Capacity + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.common.Capacity + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.Capacity to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.Capacity.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + post: + tags: + - tapi-path-computation + summary: creates tapi.common.Capacity + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.Capacity to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.Capacity.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.common.Capacity + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/ + : get: + tags: + - tapi-path-computation + summary: returns tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.BandwidthProfile + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.BandwidthProfileWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.BandwidthProfile to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.BandwidthProfileWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.BandwidthProfile.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + post: + tags: + - tapi-path-computation + summary: creates tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.BandwidthProfile to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.BandwidthProfileWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.BandwidthProfile.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - tapi-path-computation + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + post: + tags: + - tapi-path-computation + summary: creates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - tapi-path-computation + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + post: + tags: + - tapi-path-computation + summary: creates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - tapi-path-computation + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + post: + tags: + - tapi-path-computation + summary: creates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - tapi-path-computation + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + post: + tags: + - tapi-path-computation + summary: creates tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/total-size/ + : get: + tags: + - tapi-path-computation + summary: returns tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_total_size_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_total_size_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + post: + tags: + - tapi-path-computation + summary: creates tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_total_size_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.CapacityValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.CapacityValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_total_size_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/name/: + post: + tags: + - tapi-path-computation + summary: creates tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_name_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.NameAndValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.NameAndValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/name={value-name}/ + : get: + tags: + - tapi-path-computation + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_namevalue_name_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.NameAndValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.NameAndValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_namevalue_name_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/service-interface-point/ + : get: + tags: + - tapi-path-computation + summary: returns tapi.common.ServiceInterfacePointRef + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_service_interface_point_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.ServiceInterfacePointRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.ServiceInterfacePointRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.common.ServiceInterfacePointRef + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_service_interface_point_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.ServiceInterfacePointRef to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.ServiceInterfacePointRefWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.ServiceInterfacePointRef.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + post: + tags: + - tapi-path-computation + summary: creates tapi.common.ServiceInterfacePointRef + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_service_interface_point_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.ServiceInterfacePointRef to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.ServiceInterfacePointRefWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.ServiceInterfacePointRef.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.common.ServiceInterfacePointRef + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_service_interface_point_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/name/: + post: + tags: + - tapi-path-computation + summary: creates tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_name_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.NameAndValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.NameAndValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/name={value-name}/: + get: + tags: + - tapi-path-computation + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_namevalue_name_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.NameAndValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.NameAndValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_namevalue_name_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/objective-function/: + get: + tags: + - tapi-path-computation + summary: returns tapi.path.computation.PathObjectiveFunction + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.path.computation.PathObjectiveFunction + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.PathObjectiveFunctionWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.path.computation.PathObjectiveFunction + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.PathObjectiveFunction to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.PathObjectiveFunctionWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.path.computation.PathObjectiveFunction.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + post: + tags: + - tapi-path-computation + summary: creates tapi.path.computation.PathObjectiveFunction + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.PathObjectiveFunction to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.PathObjectiveFunctionWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.path.computation.PathObjectiveFunction.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.path.computation.PathObjectiveFunction + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/objective-function/name/: + post: + tags: + - tapi-path-computation + summary: creates tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_name_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.NameAndValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.NameAndValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/objective-function/name={value-name}/ + : get: + tags: + - tapi-path-computation + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_namevalue_name_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.NameAndValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.NameAndValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_namevalue_name_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/optimization-constraint/: + get: + tags: + - tapi-path-computation + summary: returns tapi.path.computation.PathOptimizationConstraint + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.path.computation.PathOptimizationConstraint + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.PathOptimizationConstraintWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.path.computation.PathOptimizationConstraint + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.PathOptimizationConstraint to be added + or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.PathOptimizationConstraintWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.path.computation.PathOptimizationConstraint.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + post: + tags: + - tapi-path-computation + summary: creates tapi.path.computation.PathOptimizationConstraint + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.PathOptimizationConstraint to be added + to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.PathOptimizationConstraintWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.path.computation.PathOptimizationConstraint.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.path.computation.PathOptimizationConstraint + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/optimization-constraint/name/: + post: + tags: + - tapi-path-computation + summary: creates tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_name_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.NameAndValue to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.common.NameAndValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/optimization-constraint/name={value-name}/ + : get: + tags: + - tapi-path-computation + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_namevalue_name_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.common.NameAndValue to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.common.NameAndValue.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_namevalue_name_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/path={path-uuid}/: + get: + tags: + - tapi-path-computation + summary: returns tapi.path.computation.PathRef + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_pathpath_uuid_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: path_uuid + in: path + description: Id of path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.path.computation.PathRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.PathRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/: + get: + tags: + - tapi-path-computation + summary: returns tapi.path.computation.RoutingConstraint + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.path.computation.RoutingConstraint + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.RoutingConstraintWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.path.computation.RoutingConstraint + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.RoutingConstraint to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.RoutingConstraintWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.path.computation.RoutingConstraint.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + post: + tags: + - tapi-path-computation + summary: creates tapi.path.computation.RoutingConstraint + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.RoutingConstraint to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.RoutingConstraintWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.path.computation.RoutingConstraint.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.path.computation.RoutingConstraint + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/cost-characteristic/ + : post: + tags: + - tapi-path-computation + summary: creates tapi.topology.CostCharacteristic + description: The list of costs where each cost relates to some aspect of the + TopologicalEntity. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_cost_characteristic_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.topology.CostCharacteristic to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.CostCharacteristicWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.topology.CostCharacteristic.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/cost-characteristic={cost-name}/ + : get: + tags: + - tapi-path-computation + summary: returns tapi.topology.CostCharacteristic + description: The list of costs where each cost relates to some aspect of the + TopologicalEntity. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_cost_characteristiccost_name_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: cost_name + in: path + description: Id of cost-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.CostCharacteristic + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.CostCharacteristicWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.topology.CostCharacteristic + description: The list of costs where each cost relates to some aspect of the + TopologicalEntity. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_cost_characteristiccost_name_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: cost_name + in: path + description: Id of cost-characteristic + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.topology.CostCharacteristic to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.CostCharacteristicWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.topology.CostCharacteristic.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.topology.CostCharacteristic + description: The list of costs where each cost relates to some aspect of the + TopologicalEntity. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_cost_characteristiccost_name_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: cost_name + in: path + description: Id of cost-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/latency-characteristic/ + : post: + tags: + - tapi-path-computation + summary: creates tapi.topology.LatencyCharacteristic + description: The effect on the latency of a queuing process. This only has significant + effect for packet based systems and has a complex characteristic. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_latency_characteristic_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.topology.LatencyCharacteristic to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.LatencyCharacteristicWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.topology.LatencyCharacteristic.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/latency-characteristic={traffic-property-name}/ + : get: + tags: + - tapi-path-computation + summary: returns tapi.topology.LatencyCharacteristic + description: The effect on the latency of a queuing process. This only has significant + effect for packet based systems and has a complex characteristic. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_latency_characteristictraffic_property_name_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: traffic_property_name + in: path + description: Id of latency-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.LatencyCharacteristic + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.LatencyCharacteristicWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.topology.LatencyCharacteristic + description: The effect on the latency of a queuing process. This only has significant + effect for packet based systems and has a complex characteristic. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_latency_characteristictraffic_property_name_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: traffic_property_name + in: path + description: Id of latency-characteristic + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.topology.LatencyCharacteristic to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.LatencyCharacteristicWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.topology.LatencyCharacteristic.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.topology.LatencyCharacteristic + description: The effect on the latency of a queuing process. This only has significant + effect for packet based systems and has a complex characteristic. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_latency_characteristictraffic_property_name_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: traffic_property_name + in: path + description: Id of latency-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/max-allowed-cost/ + : get: + tags: + - tapi-path-computation + summary: returns tapi.path.computation.ValueOrPriority + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_cost_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.path.computation.ValueOrPriority + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriorityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.path.computation.ValueOrPriority + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_cost_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.ValueOrPriority to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriorityWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.path.computation.ValueOrPriority.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + post: + tags: + - tapi-path-computation + summary: creates tapi.path.computation.ValueOrPriority + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_cost_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.ValueOrPriority to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriorityWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.path.computation.ValueOrPriority.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.path.computation.ValueOrPriority + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_cost_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/max-allowed-delay/ + : get: + tags: + - tapi-path-computation + summary: returns tapi.path.computation.ValueOrPriority + description: Delay unit is microseconds. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_delay_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.path.computation.ValueOrPriority + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriorityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.path.computation.ValueOrPriority + description: Delay unit is microseconds. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_delay_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.ValueOrPriority to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriorityWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.path.computation.ValueOrPriority.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + post: + tags: + - tapi-path-computation + summary: creates tapi.path.computation.ValueOrPriority + description: Delay unit is microseconds. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_delay_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.ValueOrPriority to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriorityWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.path.computation.ValueOrPriority.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.path.computation.ValueOrPriority + description: Delay unit is microseconds. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_delay_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/max-allowed-hops/ + : get: + tags: + - tapi-path-computation + summary: returns tapi.path.computation.ValueOrPriority + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_hops_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.path.computation.ValueOrPriority + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriorityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.path.computation.ValueOrPriority + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_hops_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.ValueOrPriority to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriorityWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.path.computation.ValueOrPriority.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + post: + tags: + - tapi-path-computation + summary: creates tapi.path.computation.ValueOrPriority + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_hops_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.ValueOrPriority to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriorityWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.path.computation.ValueOrPriority.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.path.computation.ValueOrPriority + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_hops_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/risk-diversity-characteristic/ + : post: + tags: + - tapi-path-computation + summary: creates tapi.topology.RiskCharacteristic + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_risk_diversity_characteristic_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.topology.RiskCharacteristic to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.RiskCharacteristicWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.topology.RiskCharacteristic.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/risk-diversity-characteristic={risk-characteristic-name}/ + : get: + tags: + - tapi-path-computation + summary: returns tapi.topology.RiskCharacteristic + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_risk_diversity_characteristicrisk_characteristic_name_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: risk_characteristic_name + in: path + description: Id of risk-diversity-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.RiskCharacteristic + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.RiskCharacteristicWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.topology.RiskCharacteristic + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_risk_diversity_characteristicrisk_characteristic_name_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: risk_characteristic_name + in: path + description: Id of risk-diversity-characteristic + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.topology.RiskCharacteristic to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.RiskCharacteristicWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.topology.RiskCharacteristic.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.topology.RiskCharacteristic + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_risk_diversity_characteristicrisk_characteristic_name_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + - name: risk_characteristic_name + in: path + description: Id of risk-diversity-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/topology-constraint/: + get: + tags: + - tapi-path-computation + summary: returns tapi.path.computation.TopologyConstraint + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_topology_constraint_get + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.path.computation.TopologyConstraint + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.TopologyConstraintWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + put: + tags: + - tapi-path-computation + summary: creates or updates tapi.path.computation.TopologyConstraint + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_topology_constraint_put + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.TopologyConstraint to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.TopologyConstraintWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.path.computation.TopologyConstraint.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + post: + tags: + - tapi-path-computation + summary: creates tapi.path.computation.TopologyConstraint + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_topology_constraint_post + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + requestBody: + description: tapi.path.computation.TopologyConstraint to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.TopologyConstraintWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.path.computation.TopologyConstraint.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + delete: + tags: + - tapi-path-computation + summary: removes tapi.path.computation.TopologyConstraint + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_topology_constraint_delete + parameters: + - name: uuid + in: path + description: Id of path-comp-service + required: true + style: simple + explode: false + schema: + type: string + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/: + get: + tags: + - tapi-path-computation + summary: returns tapi.path.computation.Path + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_get + parameters: + - name: uuid + in: path + description: Id of path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.path.computation.Path + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.PathWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/link={topology-uuid},{link-uuid}/: + get: + tags: + - tapi-path-computation + summary: returns tapi.topology.LinkRef + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_linktopology_uuidlink_uuid_get + parameters: + - name: uuid + in: path + description: Id of path + required: true + style: simple + explode: false + schema: + type: string + - name: topology_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.LinkRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.LinkRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/name={value-name}/: + get: + tags: + - tapi-path-computation + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of path + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/routing-constraint/: + get: + tags: + - tapi-path-computation + summary: returns tapi.path.computation.RoutingConstraint + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_get + parameters: + - name: uuid + in: path + description: Id of path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.path.computation.RoutingConstraint + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.RoutingConstraintWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/routing-constraint/cost-characteristic={cost-name}/ + : get: + tags: + - tapi-path-computation + summary: returns tapi.topology.CostCharacteristic + description: The list of costs where each cost relates to some aspect of the + TopologicalEntity. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_cost_characteristiccost_name_get + parameters: + - name: uuid + in: path + description: Id of path + required: true + style: simple + explode: false + schema: + type: string + - name: cost_name + in: path + description: Id of cost-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.CostCharacteristic + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.CostCharacteristicWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/routing-constraint/latency-characteristic={traffic-property-name}/ + : get: + tags: + - tapi-path-computation + summary: returns tapi.topology.LatencyCharacteristic + description: The effect on the latency of a queuing process. This only has significant + effect for packet based systems and has a complex characteristic. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_latency_characteristictraffic_property_name_get + parameters: + - name: uuid + in: path + description: Id of path + required: true + style: simple + explode: false + schema: + type: string + - name: traffic_property_name + in: path + description: Id of latency-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.LatencyCharacteristic + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.LatencyCharacteristicWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/routing-constraint/max-allowed-cost/: + get: + tags: + - tapi-path-computation + summary: returns tapi.path.computation.ValueOrPriority + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_max_allowed_cost_get + parameters: + - name: uuid + in: path + description: Id of path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.path.computation.ValueOrPriority + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriorityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/routing-constraint/max-allowed-delay/: + get: + tags: + - tapi-path-computation + summary: returns tapi.path.computation.ValueOrPriority + description: Delay unit is microseconds. + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_max_allowed_delay_get + parameters: + - name: uuid + in: path + description: Id of path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.path.computation.ValueOrPriority + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriorityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/routing-constraint/max-allowed-hops/: + get: + tags: + - tapi-path-computation + summary: returns tapi.path.computation.ValueOrPriority + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_max_allowed_hops_get + parameters: + - name: uuid + in: path + description: Id of path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.path.computation.ValueOrPriority + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriorityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/routing-constraint/risk-diversity-characteristic={risk-characteristic-name}/ + : get: + tags: + - tapi-path-computation + summary: returns tapi.topology.RiskCharacteristic + description: none + operationId: data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_risk_diversity_characteristicrisk_characteristic_name_get + parameters: + - name: uuid + in: path + description: Id of path + required: true + style: simple + explode: false + schema: + type: string + - name: risk_characteristic_name + in: path + description: Id of risk-diversity-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.RiskCharacteristic + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.RiskCharacteristicWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /data/tapi-common:context/tapi-topology:topology-context/: + get: + tags: + - tapi-topology + summary: returns tapi.topology.context.TopologyContext + description: Augments the base TAPI Context with TopologyService information + operationId: data_tapi_commoncontext_tapi_topologytopology_context_get + responses: + "200": + description: tapi.topology.TopologyContext + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.TopologyContextWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + put: + tags: + - tapi-topology + summary: creates or updates tapi.topology.context.TopologyContext + description: Augments the base TAPI Context with TopologyService information + operationId: data_tapi_commoncontext_tapi_topologytopology_context_put + requestBody: + description: tapi.topology.TopologyContext to be added or updated + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.TopologyContextWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "204": + description: Object modified + content: {} + x-codegen-request-body-name: tapi.topology.context.TopologyContext.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + post: + tags: + - tapi-topology + summary: creates tapi.topology.context.TopologyContext + description: Augments the base TAPI Context with TopologyService information + operationId: data_tapi_commoncontext_tapi_topologytopology_context_post + requestBody: + description: tapi.topology.TopologyContext to be added to list + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.TopologyContextWrapper' + required: false + responses: + "201": + description: Object created + content: {} + "400": + description: Internal error + content: {} + "409": + description: Object already exists + content: {} + x-codegen-request-body-name: tapi.topology.context.TopologyContext.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + delete: + tags: + - tapi-topology + summary: removes tapi.topology.context.TopologyContext + description: Augments the base TAPI Context with TopologyService information + operationId: data_tapi_commoncontext_tapi_topologytopology_context_delete + responses: + "400": + description: Internal error + content: {} + "204": + description: Object deleted + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/nw-topology-service/: + get: + tags: + - tapi-topology + summary: returns tapi.topology.NetworkTopologyService + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_nw_topology_service_get + responses: + "200": + description: tapi.topology.NetworkTopologyService + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.NetworkTopologyServiceWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/nw-topology-service/name={value-name}/: + get: + tags: + - tapi-topology + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_nw_topology_service_namevalue_name_get + parameters: + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/nw-topology-service/topology={topology-uuid}/: + get: + tags: + - tapi-topology + summary: returns tapi.topology.TopologyRef + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_nw_topology_service_topologytopology_uuid_get + parameters: + - name: topology_uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.TopologyRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.TopologyRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/: + get: + tags: + - tapi-topology + summary: returns tapi.topology.topologycontext.Topology + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.Topology + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.TopologyWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/: + get: + tags: + - tapi-topology + summary: returns tapi.topology.Link + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.Link + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.LinkWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/available-capacity/: + get: + tags: + - tapi-topology + summary: returns tapi.common.Capacity + description: Capacity available to be assigned. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.Capacity + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/available-capacity/bandwidth-profile/: + get: + tags: + - tapi-topology + summary: returns tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_bandwidth_profile_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.BandwidthProfile + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.BandwidthProfileWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/available-capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_bandwidth_profile_committed_burst_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/available-capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_bandwidth_profile_committed_information_rate_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/available-capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_bandwidth_profile_peak_burst_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/available-capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_bandwidth_profile_peak_information_rate_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/available-capacity/total-size/: + get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_total_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/cost-characteristic={cost-name}/: + get: + tags: + - tapi-topology + summary: returns tapi.topology.CostCharacteristic + description: The list of costs where each cost relates to some aspect of the + TopologicalEntity. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_cost_characteristiccost_name_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + - name: cost_name + in: path + description: Id of cost-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.CostCharacteristic + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.CostCharacteristicWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/latency-characteristic={traffic-property-name}/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.LatencyCharacteristic + description: The effect on the latency of a queuing process. This only has significant + effect for packet based systems and has a complex characteristic. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_latency_characteristictraffic_property_name_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + - name: traffic_property_name + in: path + description: Id of latency-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.LatencyCharacteristic + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.LatencyCharacteristicWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/name={value-name}/: + get: + tags: + - tapi-topology + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/node-edge-point={topology-uuid},{node-uuid},{node-edge-point-uuid}/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.NodeEdgePointRef + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_node_edge_pointtopology_uuidnode_uuidnode_edge_point_uuid_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + - name: topology_uuid + in: path + description: Id of node-edge-point + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node-edge-point + required: true + style: simple + explode: false + schema: + type: string + - name: node_edge_point_uuid + in: path + description: Id of node-edge-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.NodeEdgePointRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.NodeEdgePointRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/resilience-type/: + get: + tags: + - tapi-topology + summary: returns tapi.topology.ResilienceType + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_resilience_type_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.ResilienceType + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.ResilienceTypeWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/risk-characteristic={risk-characteristic-name}/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.RiskCharacteristic + description: A list of risk characteristics for consideration in an analysis + of shared risk. Each element of the list represents a specific risk consideration. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_risk_characteristicrisk_characteristic_name_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + - name: risk_characteristic_name + in: path + description: Id of risk-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.RiskCharacteristic + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.RiskCharacteristicWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/total-potential-capacity/: + get: + tags: + - tapi-topology + summary: returns tapi.common.Capacity + description: An optimistic view of the capacity of the TopologicalEntity assuming + that any shared capacity is available to be taken. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.Capacity + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/total-potential-capacity/bandwidth-profile/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_bandwidth_profile_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.BandwidthProfile + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.BandwidthProfileWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/total-potential-capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/total-potential-capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/total-potential-capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/total-potential-capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/total-potential-capacity/total-size/: + get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_total_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/validation-mechanism={validation-mechanism}/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.ValidationMechanism + description: Provides details of the specific validation mechanism(s) used to + confirm the presence of an intended topologicalEntity. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_validation_mechanismvalidation_mechanism_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: link_uuid + in: path + description: Id of link + required: true + style: simple + explode: false + schema: + type: string + - name: validation_mechanism + in: path + description: Id of validation-mechanism + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.ValidationMechanism + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.ValidationMechanismWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/name={value-name}/: + get: + tags: + - tapi-topology + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/: + get: + tags: + - tapi-topology + summary: returns tapi.topology.topology.Node + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.topology.Node + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.topology.NodeWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/aggregated-node-edge-point={topology-uuid},{aggregated-node-edge-point-node-uuid},{node-edge-point-uuid}/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.NodeEdgePointRef + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_aggregated_node_edge_pointtopology_uuidaggregated_node_edge_point_node_uuidnode_edge_point_uuid_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: topology_uuid + in: path + description: Id of aggregated-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + - name: aggregated_node_edge_point_node_uuid + in: path + description: Id of aggregated-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + - name: node_edge_point_uuid + in: path + description: Id of aggregated-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.NodeEdgePointRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.NodeEdgePointRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/available-capacity/: + get: + tags: + - tapi-topology + summary: returns tapi.common.Capacity + description: Capacity available to be assigned. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.Capacity + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/available-capacity/bandwidth-profile/: + get: + tags: + - tapi-topology + summary: returns tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_bandwidth_profile_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.BandwidthProfile + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.BandwidthProfileWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/available-capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_bandwidth_profile_committed_burst_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/available-capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_bandwidth_profile_committed_information_rate_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/available-capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_bandwidth_profile_peak_burst_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/available-capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_bandwidth_profile_peak_information_rate_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/available-capacity/total-size/: + get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_total_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/cost-characteristic={cost-name}/: + get: + tags: + - tapi-topology + summary: returns tapi.topology.CostCharacteristic + description: The list of costs where each cost relates to some aspect of the + TopologicalEntity. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_cost_characteristiccost_name_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: cost_name + in: path + description: Id of cost-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.CostCharacteristic + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.CostCharacteristicWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/encap-topology/: + get: + tags: + - tapi-topology + summary: returns tapi.topology.TopologyRef + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_encap_topology_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.TopologyRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.TopologyRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/latency-characteristic={traffic-property-name}/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.LatencyCharacteristic + description: The effect on the latency of a queuing process. This only has significant + effect for packet based systems and has a complex characteristic. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_latency_characteristictraffic_property_name_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: traffic_property_name + in: path + description: Id of latency-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.LatencyCharacteristic + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.LatencyCharacteristicWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/name={value-name}/: + get: + tags: + - tapi-topology + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.NodeRuleGroup + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.NodeRuleGroup + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.NodeRuleGroupWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/available-capacity/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.Capacity + description: Capacity available to be assigned. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.Capacity + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/available-capacity/bandwidth-profile/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_bandwidth_profile_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.BandwidthProfile + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.BandwidthProfileWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/available-capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_bandwidth_profile_committed_burst_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/available-capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_bandwidth_profile_committed_information_rate_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/available-capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_bandwidth_profile_peak_burst_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/available-capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_bandwidth_profile_peak_information_rate_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/available-capacity/total-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_total_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/cost-characteristic={cost-name}/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.CostCharacteristic + description: The list of costs where each cost relates to some aspect of the + TopologicalEntity. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_cost_characteristiccost_name_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: cost_name + in: path + description: Id of cost-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.CostCharacteristic + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.CostCharacteristicWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.InterRuleGroup + description: "Nested NodeRuleGroups may have InterRuleGroups. The Superior NodeRuleGroup\ + \ contains the nested NodeRuleGroups and their associated InterRuleGroups.\r\ + \n This is equivalent to the Node-Topology hierarchy." + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.InterRuleGroup + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.InterRuleGroupWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/associated-node-rule-group={topology-uuid},{associated-node-rule-group-node-uuid},{associated-node-rule-group-node-rule-group-uuid}/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.NodeRuleGroupRef + description: "The NodeRuleGroups that the InterRuleGroup constrains interconnection\ + \ between.\r\n The CEPs of the NEPs of a referenced NodeRuleGroup\ + \ can interconnect to the CEPs of the NEPs of another referenced NodeRuleGroup\ + \ constrained by the rules of the InterRuleGroup." + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_associated_node_rule_grouptopology_uuidassociated_node_rule_group_node_uuidassociated_node_rule_group_node_rule_group_uuid_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: topology_uuid + in: path + description: Id of associated-node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: associated_node_rule_group_node_uuid + in: path + description: Id of associated-node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: associated_node_rule_group_node_rule_group_uuid + in: path + description: Id of associated-node-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.NodeRuleGroupRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.NodeRuleGroupRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/available-capacity/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.Capacity + description: Capacity available to be assigned. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.Capacity + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/available-capacity/bandwidth-profile/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_bandwidth_profile_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.BandwidthProfile + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.BandwidthProfileWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/available-capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_bandwidth_profile_committed_burst_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/available-capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_bandwidth_profile_committed_information_rate_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/available-capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_bandwidth_profile_peak_burst_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/available-capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_bandwidth_profile_peak_information_rate_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/available-capacity/total-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_total_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/cost-characteristic={cost-name}/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.CostCharacteristic + description: The list of costs where each cost relates to some aspect of the + TopologicalEntity. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_cost_characteristiccost_name_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: cost_name + in: path + description: Id of cost-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.CostCharacteristic + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.CostCharacteristicWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/latency-characteristic={traffic-property-name}/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.LatencyCharacteristic + description: The effect on the latency of a queuing process. This only has significant + effect for packet based systems and has a complex characteristic. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_latency_characteristictraffic_property_name_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: traffic_property_name + in: path + description: Id of latency-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.LatencyCharacteristic + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.LatencyCharacteristicWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/name={value-name}/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/risk-characteristic={risk-characteristic-name}/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.RiskCharacteristic + description: A list of risk characteristics for consideration in an analysis + of shared risk. Each element of the list represents a specific risk consideration. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_risk_characteristicrisk_characteristic_name_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: risk_characteristic_name + in: path + description: Id of risk-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.RiskCharacteristic + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.RiskCharacteristicWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/rule={local-id}/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.Rule + description: The list of rules of the InterRuleGroup. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_rulelocal_id_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of rule + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.Rule + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.RuleWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/rule={local-id}/cep-port-role/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.PortRoleRule + description: "Indicates the port role to which the rule applies. \r\n \ + \ The port role is interpreted in the context of the connection type\ + \ which is identified by the connection spec. \r\n The port\ + \ role is not meaningful in the absence of a connection spec reference.\r\n\ + \ If a node rule group carries a port role, that role applies\ + \ also to the associated inter rule where the combination of the roles in\ + \ the node rule groups at the ends of the inter group rule define the connection\ + \ orientation.\r\n For example a root-and-leaf connection may\ + \ be used in a node where a node rule group collects one set of NEPs has the\ + \ port role 'root' and another node rule group collects another set of NEPs\ + \ has the port role 'leaf' where these are joined by an inter rule group.\ + \ This combination specifies an allowed orientation of the root-and-leaf connection.\r\ + \n No port role statement means all port roles are allowed." + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_rulelocal_id_cep_port_role_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of rule + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.PortRoleRule + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.PortRoleRuleWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/rule={local-id}/connection-spec-reference/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.ConnectionSpecReference + description: "Identifies the type of connection that the rule applies to. \r\ + \n If the attribute is not present then the rule applies to\ + \ all types of connection supported by the device." + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_rulelocal_id_connection_spec_reference_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of rule + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.ConnectionSpecReference + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.ConnectionSpecReferenceWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/rule={local-id}/name={value-name}/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_rulelocal_id_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of rule + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/rule={local-id}/signal-property/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.SignalPropertyRule + description: "The rule only applies to signals with the properties listed. \r\ + \n If the attribute is not present then the rule applies to\ + \ all signals." + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_rulelocal_id_signal_property_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of rule + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.SignalPropertyRule + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.SignalPropertyRuleWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/total-potential-capacity/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.Capacity + description: An optimistic view of the capacity of the TopologicalEntity assuming + that any shared capacity is available to be taken. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.Capacity + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/total-potential-capacity/bandwidth-profile/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_bandwidth_profile_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.BandwidthProfile + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.BandwidthProfileWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/total-potential-capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/total-potential-capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/total-potential-capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/total-potential-capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/total-potential-capacity/total-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_total_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: inter_rule_group_uuid + in: path + description: Id of inter-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/latency-characteristic={traffic-property-name}/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.LatencyCharacteristic + description: The effect on the latency of a queuing process. This only has significant + effect for packet based systems and has a complex characteristic. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_latency_characteristictraffic_property_name_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: traffic_property_name + in: path + description: Id of latency-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.LatencyCharacteristic + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.LatencyCharacteristicWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/name={value-name}/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/node-edge-point={topology-uuid},{node-edge-point-node-uuid},{node-edge-point-uuid}/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.NodeEdgePointRef + description: NEPs and their client CEPs that the rules apply to. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_node_edge_pointtopology_uuidnode_edge_point_node_uuidnode_edge_point_uuid_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: topology_uuid + in: path + description: Id of node-edge-point + required: true + style: simple + explode: false + schema: + type: string + - name: node_edge_point_node_uuid + in: path + description: Id of node-edge-point + required: true + style: simple + explode: false + schema: + type: string + - name: node_edge_point_uuid + in: path + description: Id of node-edge-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.NodeEdgePointRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.NodeEdgePointRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/node-rule-group={topology-uuid},{node-rule-group-node-uuid},{node-rule-group-node-rule-group-uuid}/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.NodeRuleGroupRef + description: "NodeRuleGroups may be nested such that finer grained rules may\ + \ be applied.\r\n A nested rule group should have a subset\ + \ of the NEPs of the superior rule group." + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_node_rule_grouptopology_uuidnode_rule_group_node_uuidnode_rule_group_node_rule_group_uuid_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: topology_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_node_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.NodeRuleGroupRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.NodeRuleGroupRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/risk-characteristic={risk-characteristic-name}/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.RiskCharacteristic + description: A list of risk characteristics for consideration in an analysis + of shared risk. Each element of the list represents a specific risk consideration. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_risk_characteristicrisk_characteristic_name_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: risk_characteristic_name + in: path + description: Id of risk-characteristic + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.RiskCharacteristic + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.RiskCharacteristicWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/rule={local-id}/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.Rule + description: The list of rules of the NodeRuleGroup. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_rulelocal_id_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of rule + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.Rule + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.RuleWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/rule={local-id}/cep-port-role/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.PortRoleRule + description: "Indicates the port role to which the rule applies. \r\n \ + \ The port role is interpreted in the context of the connection type\ + \ which is identified by the connection spec. \r\n The port\ + \ role is not meaningful in the absence of a connection spec reference.\r\n\ + \ If a node rule group carries a port role, that role applies\ + \ also to the associated inter rule where the combination of the roles in\ + \ the node rule groups at the ends of the inter group rule define the connection\ + \ orientation.\r\n For example a root-and-leaf connection may\ + \ be used in a node where a node rule group collects one set of NEPs has the\ + \ port role 'root' and another node rule group collects another set of NEPs\ + \ has the port role 'leaf' where these are joined by an inter rule group.\ + \ This combination specifies an allowed orientation of the root-and-leaf connection.\r\ + \n No port role statement means all port roles are allowed." + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_rulelocal_id_cep_port_role_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of rule + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.PortRoleRule + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.PortRoleRuleWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/rule={local-id}/connection-spec-reference/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.ConnectionSpecReference + description: "Identifies the type of connection that the rule applies to. \r\ + \n If the attribute is not present then the rule applies to\ + \ all types of connection supported by the device." + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_rulelocal_id_connection_spec_reference_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of rule + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.ConnectionSpecReference + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.ConnectionSpecReferenceWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/rule={local-id}/name={value-name}/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_rulelocal_id_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of rule + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/rule={local-id}/signal-property/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.SignalPropertyRule + description: "The rule only applies to signals with the properties listed. \r\ + \n If the attribute is not present then the rule applies to\ + \ all signals." + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_rulelocal_id_signal_property_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + - name: local_id + in: path + description: Id of rule + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.SignalPropertyRule + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.SignalPropertyRuleWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/total-potential-capacity/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.Capacity + description: An optimistic view of the capacity of the TopologicalEntity assuming + that any shared capacity is available to be taken. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.Capacity + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/total-potential-capacity/bandwidth-profile/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_bandwidth_profile_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.BandwidthProfile + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.BandwidthProfileWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/total-potential-capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/total-potential-capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/total-potential-capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/total-potential-capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/total-potential-capacity/total-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_total_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: node_rule_group_uuid + in: path + description: Id of node-rule-group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.node.OwnedNodeEdgePoint + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.node.OwnedNodeEdgePoint + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.node.OwnedNodeEdgePointWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/aggregated-node-edge-point={topology-uuid},{aggregated-node-edge-point-node-uuid},{node-edge-point-uuid}/ + : get: + tags: + - tapi-topology + summary: returns tapi.topology.NodeEdgePointRef + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_aggregated_node_edge_pointtopology_uuidaggregated_node_edge_point_node_uuidnode_edge_point_uuid_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + - name: topology_uuid + in: path + description: Id of aggregated-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + - name: aggregated_node_edge_point_node_uuid + in: path + description: Id of aggregated-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + - name: node_edge_point_uuid + in: path + description: Id of aggregated-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.NodeEdgePointRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.NodeEdgePointRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/available-capacity/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.Capacity + description: Capacity available to be assigned. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.Capacity + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/available-capacity/bandwidth-profile/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_bandwidth_profile_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.BandwidthProfile + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.BandwidthProfileWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/available-capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_bandwidth_profile_committed_burst_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/available-capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_bandwidth_profile_committed_information_rate_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/available-capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_bandwidth_profile_peak_burst_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/available-capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_bandwidth_profile_peak_information_rate_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/available-capacity/total-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_total_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/mapped-service-interface-point={service-interface-point-uuid}/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.ServiceInterfacePointRef + description: NodeEdgePoint mapped to more than ServiceInterfacePoint (slicing/virtualizing) + or a ServiceInterfacePoint mapped to more than one NodeEdgePoint (load balancing/Resilience) + should be considered experimental + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_mapped_service_interface_pointservice_interface_point_uuid_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + - name: service_interface_point_uuid + in: path + description: Id of mapped-service-interface-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.ServiceInterfacePointRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.ServiceInterfacePointRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/name={value-name}/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.CepList + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.CepList + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.CepListWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/connection-end-point={connection-end-point-uuid}/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.ConnectionEndPoint + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + - name: connection_end_point_uuid + in: path + description: Id of connection-end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.ConnectionEndPoint + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectionEndPointWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/connection-end-point={connection-end-point-uuid}/aggregated-connection-end-point={topology-uuid},{aggregated-connection-end-point-node-uuid},{node-edge-point-uuid},{aggregated-connection-end-point-connection-end-point-uuid}/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.ConnectionEndPointRef + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_aggregated_connection_end_pointtopology_uuidaggregated_connection_end_point_node_uuidnode_edge_point_uuidaggregated_connection_end_point_connection_end_point_uuid_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + - name: connection_end_point_uuid + in: path + description: Id of connection-end-point + required: true + style: simple + explode: false + schema: + type: string + - name: topology_uuid + in: path + description: Id of aggregated-connection-end-point + required: true + style: simple + explode: false + schema: + type: string + - name: aggregated_connection_end_point_node_uuid + in: path + description: Id of aggregated-connection-end-point + required: true + style: simple + explode: false + schema: + type: string + - name: node_edge_point_uuid + in: path + description: Id of aggregated-connection-end-point + required: true + style: simple + explode: false + schema: + type: string + - name: aggregated_connection_end_point_connection_end_point_uuid + in: path + description: Id of aggregated-connection-end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.ConnectionEndPointRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectionEndPointRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/connection-end-point={connection-end-point-uuid}/cep-role/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.CepRole + description: "Defines the role of the CEP in the context of the connection spec.\r\ + \n There may be many cep role - connection spec combinations\ + \ for a particular CEP where each corresponds to a specific connection associated\ + \ with the CEP." + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_cep_role_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + - name: connection_end_point_uuid + in: path + description: Id of connection-end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.CepRole + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.CepRoleWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/connection-end-point={connection-end-point-uuid}/cep-role/connection-spec-reference/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.connectivity.ConnectionSpecReference + description: The reference to the spec that defines the cep role. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_cep_role_connection_spec_reference_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + - name: connection_end_point_uuid + in: path + description: Id of connection-end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.connectivity.ConnectionSpecReference + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.ConnectionSpecReferenceWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/connection-end-point={connection-end-point-uuid}/client-node-edge-point={topology-uuid},{client-node-edge-point-node-uuid},{node-edge-point-uuid}/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.topology.NodeEdgePointRef + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_client_node_edge_pointtopology_uuidclient_node_edge_point_node_uuidnode_edge_point_uuid_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + - name: connection_end_point_uuid + in: path + description: Id of connection-end-point + required: true + style: simple + explode: false + schema: + type: string + - name: topology_uuid + in: path + description: Id of client-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + - name: client_node_edge_point_node_uuid + in: path + description: Id of client-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + - name: node_edge_point_uuid + in: path + description: Id of client-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.NodeEdgePointRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.NodeEdgePointRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/connection-end-point={connection-end-point-uuid}/name={value-name}/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.common.NameAndValue + description: List of names. A property of an entity with a value that is unique + in some namespace but may change during the life of the entity. A name carries + no semantics with respect to the purpose of the entity. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_namevalue_name_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + - name: connection_end_point_uuid + in: path + description: Id of connection-end-point + required: true + style: simple + explode: false + schema: + type: string + - name: value_name + in: path + description: Id of name + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.NameAndValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.NameAndValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/connection-end-point={connection-end-point-uuid}/parent-node-edge-point/ + : get: + tags: + - tapi-connectivity + summary: returns tapi.topology.NodeEdgePointRef + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_parent_node_edge_point_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + - name: connection_end_point_uuid + in: path + description: Id of connection-end-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.topology.NodeEdgePointRef + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.NodeEdgePointRefWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/total-potential-capacity/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.Capacity + description: An optimistic view of the capacity of the TopologicalEntity assuming + that any shared capacity is available to be taken. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.Capacity + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/total-potential-capacity/bandwidth-profile/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_bandwidth_profile_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.BandwidthProfile + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.BandwidthProfileWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/total-potential-capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/total-potential-capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/total-potential-capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/total-potential-capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/total-potential-capacity/total-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_total_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + - name: owned_node_edge_point_uuid + in: path + description: Id of owned-node-edge-point + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/total-potential-capacity/: + get: + tags: + - tapi-topology + summary: returns tapi.common.Capacity + description: An optimistic view of the capacity of the TopologicalEntity assuming + that any shared capacity is available to be taken. + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.Capacity + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/total-potential-capacity/bandwidth-profile/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.BandwidthProfile + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_bandwidth_profile_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.BandwidthProfile + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.BandwidthProfileWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/total-potential-capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/total-potential-capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/total-potential-capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/total-potential-capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: none + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/total-potential-capacity/total-size/: + get: + tags: + - tapi-topology + summary: returns tapi.common.CapacityValue + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + operationId: data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_total_size_get + parameters: + - name: uuid + in: path + description: Id of topology + required: true + style: simple + explode: false + schema: + type: string + - name: node_uuid + in: path + description: Id of node + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: tapi.common.CapacityValue + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.CapacityValueWrapper' + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /operations/tapi-common:get-service-interface-point-details/: + post: + tags: + - tapi-common + summary: operates on tapi.common.GetServiceInterfacePointDetails + description: operates on tapi.common.GetServiceInterfacePointDetails + operationId: operations_tapi_commonget_service_interface_point_details_post + requestBody: + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/operations_tapicommongetserviceinterfacepointdetails_body' + required: false + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.GetServiceInterfacePointDetails' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-codegen-request-body-name: tapi.common.getserviceinterfacepointdetails.Input.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /operations/tapi-common:get-service-interface-point-list/: + post: + tags: + - tapi-common + operationId: operations_tapi_commonget_service_interface_point_list_post + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.common.GetServiceInterfacePointList' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /operations/tapi-common:update-service-interface-point/: + post: + tags: + - tapi-common + summary: operates on tapi.common.UpdateServiceInterfacePoint + description: operates on tapi.common.UpdateServiceInterfacePoint + operationId: operations_tapi_commonupdate_service_interface_point_post + requestBody: + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/operations_tapicommonupdateserviceinterfacepoint_body' + required: false + responses: + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-codegen-request-body-name: tapi.common.updateserviceinterfacepoint.Input.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_common_controller + /operations/tapi-connectivity:create-connectivity-service/: + post: + tags: + - tapi-connectivity + summary: operates on tapi.connectivity.CreateConnectivityService + description: operates on tapi.connectivity.CreateConnectivityService + operationId: operations_tapi_connectivitycreate_connectivity_service_post + requestBody: + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/operations_tapiconnectivitycreateconnectivityservice_body' + required: false + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.CreateConnectivityService' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-codegen-request-body-name: tapi.connectivity.createconnectivityservice.Input.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /operations/tapi-connectivity:delete-connectivity-service/: + post: + tags: + - tapi-connectivity + summary: operates on tapi.connectivity.DeleteConnectivityService + description: operates on tapi.connectivity.DeleteConnectivityService + operationId: operations_tapi_connectivitydelete_connectivity_service_post + requestBody: + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/operations_tapiconnectivitydeleteconnectivityservice_body' + required: false + responses: + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-codegen-request-body-name: tapi.connectivity.deleteconnectivityservice.Input.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /operations/tapi-connectivity:get-connection-details/: + post: + tags: + - tapi-connectivity + summary: operates on tapi.connectivity.GetConnectionDetails + description: operates on tapi.connectivity.GetConnectionDetails + operationId: operations_tapi_connectivityget_connection_details_post + requestBody: + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/operations_tapiconnectivitygetconnectiondetails_body' + required: false + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.GetConnectionDetails' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-codegen-request-body-name: tapi.connectivity.getconnectiondetails.Input.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /operations/tapi-connectivity:get-connection-end-point-details/: + post: + tags: + - tapi-connectivity + summary: operates on tapi.connectivity.GetConnectionEndPointDetails + description: operates on tapi.connectivity.GetConnectionEndPointDetails + operationId: operations_tapi_connectivityget_connection_end_point_details_post + requestBody: + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/operations_tapiconnectivitygetconnectionendpointdetails_body' + required: false + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.GetConnectionEndPointDetails' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-codegen-request-body-name: tapi.connectivity.getconnectionendpointdetails.Input.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /operations/tapi-connectivity:get-connectivity-service-details/: + post: + tags: + - tapi-connectivity + summary: operates on tapi.connectivity.GetConnectivityServiceDetails + description: operates on tapi.connectivity.GetConnectivityServiceDetails + operationId: operations_tapi_connectivityget_connectivity_service_details_post + requestBody: + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/operations_tapiconnectivitygetconnectivityservicedetails_body' + required: false + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.GetConnectivityServiceDetails' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-codegen-request-body-name: tapi.connectivity.getconnectivityservicedetails.Input.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /operations/tapi-connectivity:get-connectivity-service-list/: + post: + tags: + - tapi-connectivity + operationId: operations_tapi_connectivityget_connectivity_service_list_post + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.GetConnectivityServiceList' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /operations/tapi-connectivity:update-connectivity-service/: + post: + tags: + - tapi-connectivity + summary: operates on tapi.connectivity.UpdateConnectivityService + description: operates on tapi.connectivity.UpdateConnectivityService + operationId: operations_tapi_connectivityupdate_connectivity_service_post + requestBody: + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/operations_tapiconnectivityupdateconnectivityservice_body' + required: false + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.connectivity.UpdateConnectivityService' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-codegen-request-body-name: tapi.connectivity.updateconnectivityservice.Input.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_connectivity_controller + /operations/tapi-notification:create-notification-subscription-service/: + post: + tags: + - tapi-notification + summary: operates on tapi.notification.CreateNotificationSubscriptionService + description: operates on tapi.notification.CreateNotificationSubscriptionService + operationId: operations_tapi_notificationcreate_notification_subscription_service_post + requestBody: + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/operations_tapinotificationcreatenotificationsubscriptionservice_body' + required: false + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.CreateNotificationSubscriptionService' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-codegen-request-body-name: tapi.notification.createnotificationsubscriptionservice.Input.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /operations/tapi-notification:delete-notification-subscription-service/: + post: + tags: + - tapi-notification + summary: operates on tapi.notification.DeleteNotificationSubscriptionService + description: operates on tapi.notification.DeleteNotificationSubscriptionService + operationId: operations_tapi_notificationdelete_notification_subscription_service_post + requestBody: + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/operations_tapinotificationdeletenotificationsubscriptionservice_body' + required: false + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.DeleteNotificationSubscriptionService' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-codegen-request-body-name: tapi.notification.deletenotificationsubscriptionservice.Input.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /operations/tapi-notification:get-notification-list/: + post: + tags: + - tapi-notification + summary: operates on tapi.notification.GetNotificationList + description: operates on tapi.notification.GetNotificationList + operationId: operations_tapi_notificationget_notification_list_post + requestBody: + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/operations_tapinotificationgetnotificationlist_body' + required: false + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.GetNotificationList' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-codegen-request-body-name: tapi.notification.getnotificationlist.Input.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /operations/tapi-notification:get-notification-subscription-service-details/: + post: + tags: + - tapi-notification + summary: operates on tapi.notification.GetNotificationSubscriptionServiceDetails + description: operates on tapi.notification.GetNotificationSubscriptionServiceDetails + operationId: operations_tapi_notificationget_notification_subscription_service_details_post + requestBody: + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/operations_tapinotificationgetnotificationsubscriptionservicedetails_body' + required: false + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.GetNotificationSubscriptionServiceDetails' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-codegen-request-body-name: tapi.notification.getnotificationsubscriptionservicedetails.Input.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /operations/tapi-notification:get-notification-subscription-service-list/: + post: + tags: + - tapi-notification + operationId: operations_tapi_notificationget_notification_subscription_service_list_post + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.GetNotificationSubscriptionServiceList' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /operations/tapi-notification:get-supported-notification-types/: + post: + tags: + - tapi-notification + operationId: operations_tapi_notificationget_supported_notification_types_post + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.GetSupportedNotificationTypes' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /operations/tapi-notification:update-notification-subscription-service/: + post: + tags: + - tapi-notification + summary: operates on tapi.notification.UpdateNotificationSubscriptionService + description: operates on tapi.notification.UpdateNotificationSubscriptionService + operationId: operations_tapi_notificationupdate_notification_subscription_service_post + requestBody: + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/operations_tapinotificationupdatenotificationsubscriptionservice_body' + required: false + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.notification.UpdateNotificationSubscriptionService' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-codegen-request-body-name: tapi.notification.updatenotificationsubscriptionservice.Input.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_notification_controller + /operations/tapi-path-computation:compute-p-2-p-path/: + post: + tags: + - tapi-path-computation + summary: operates on tapi.path.computation.ComputeP2PPath + description: operates on tapi.path.computation.ComputeP2PPath + operationId: operations_tapi_path_computationcompute_p_2_p_path_post + requestBody: + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/operations_tapipathcomputationcomputep2ppath_body' + required: false + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.ComputeP2PPath' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-codegen-request-body-name: tapi.path.computation.computep2ppath.Input.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /operations/tapi-path-computation:delete-p-2-p-path/: + post: + tags: + - tapi-path-computation + summary: operates on tapi.path.computation.DeleteP2PPath + description: operates on tapi.path.computation.DeleteP2PPath + operationId: operations_tapi_path_computationdelete_p_2_p_path_post + requestBody: + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/operations_tapipathcomputationdeletep2ppath_body' + required: false + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.DeleteP2PPath' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-codegen-request-body-name: tapi.path.computation.deletep2ppath.Input.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /operations/tapi-path-computation:optimize-p-2-ppath/: + post: + tags: + - tapi-path-computation + summary: operates on tapi.path.computation.OptimizeP2Ppath + description: operates on tapi.path.computation.OptimizeP2Ppath + operationId: operations_tapi_path_computationoptimize_p_2_ppath_post + requestBody: + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/operations_tapipathcomputationoptimizep2ppath_body' + required: false + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.path.computation.OptimizeP2Ppath' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-codegen-request-body-name: tapi.path.computation.optimizep2ppath.Input.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_path_computation_controller + /operations/tapi-topology:get-link-details/: + post: + tags: + - tapi-topology + summary: operates on tapi.topology.GetLinkDetails + description: operates on tapi.topology.GetLinkDetails + operationId: operations_tapi_topologyget_link_details_post + requestBody: + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/operations_tapitopologygetlinkdetails_body' + required: false + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.GetLinkDetails' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-codegen-request-body-name: tapi.topology.getlinkdetails.Input.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /operations/tapi-topology:get-node-details/: + post: + tags: + - tapi-topology + summary: operates on tapi.topology.GetNodeDetails + description: operates on tapi.topology.GetNodeDetails + operationId: operations_tapi_topologyget_node_details_post + requestBody: + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/operations_tapitopologygetnodedetails_body' + required: false + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.GetNodeDetails' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-codegen-request-body-name: tapi.topology.getnodedetails.Input.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /operations/tapi-topology:get-node-edge-point-details/: + post: + tags: + - tapi-topology + summary: operates on tapi.topology.GetNodeEdgePointDetails + description: operates on tapi.topology.GetNodeEdgePointDetails + operationId: operations_tapi_topologyget_node_edge_point_details_post + requestBody: + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/operations_tapitopologygetnodeedgepointdetails_body' + required: false + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.GetNodeEdgePointDetails' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-codegen-request-body-name: tapi.topology.getnodeedgepointdetails.Input.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /operations/tapi-topology:get-topology-details/: + post: + tags: + - tapi-topology + summary: operates on tapi.topology.GetTopologyDetails + description: operates on tapi.topology.GetTopologyDetails + operationId: operations_tapi_topologyget_topology_details_post + requestBody: + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/operations_tapitopologygettopologydetails_body' + required: false + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.GetTopologyDetails' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-codegen-request-body-name: tapi.topology.gettopologydetails.Input.body-param + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller + /operations/tapi-topology:get-topology-list/: + post: + tags: + - tapi-topology + operationId: operations_tapi_topologyget_topology_list_post + responses: + "200": + description: Correct response + content: + application/yang-data+json: + schema: + $ref: '#/components/schemas/tapi.topology.GetTopologyList' + "201": + description: No response + content: {} + "400": + description: Internal error + content: {} + x-openapi-router-controller: tapi_server.controllers.tapi_topology_controller +components: + schemas: + tapi.common.AdminStatePac: + type: object + properties: + operational-state: + $ref: '#/components/schemas/tapi.common.OperationalState' + lifecycle-state: + $ref: '#/components/schemas/tapi.common.LifecycleState' + administrative-state: + $ref: '#/components/schemas/tapi.common.AdministrativeState' + tapi.common.AdministrativeState: + type: string + enum: + - LOCKED + - UNLOCKED + tapi.common.BandwidthProfile: + type: object + properties: + committed-information-rate: + $ref: '#/components/schemas/tapi.common.CapacityValue' + coupling-flag: + type: boolean + description: none + default: false + bw-profile-type: + $ref: '#/components/schemas/tapi.common.BandwidthProfileType' + peak-information-rate: + $ref: '#/components/schemas/tapi.common.CapacityValue' + committed-burst-size: + $ref: '#/components/schemas/tapi.common.CapacityValue' + peak-burst-size: + $ref: '#/components/schemas/tapi.common.CapacityValue' + color-aware: + type: boolean + description: none + default: false + tapi.common.BandwidthProfileType: + type: string + enum: + - MEF_10.x + - RFC_2697 + - RFC_2698 + - RFC_4115 + tapi.common.BandwidthProfileWrapper: + type: object + properties: + bandwidth-profile: + $ref: '#/components/schemas/tapi.common.BandwidthProfile' + tapi.common.Capacity: + type: object + properties: + bandwidth-profile: + $ref: '#/components/schemas/tapi.common.BandwidthProfile' + total-size: + $ref: '#/components/schemas/tapi.common.CapacityValue' + tapi.common.CapacityPac: + type: object + properties: + available-capacity: + $ref: '#/components/schemas/tapi.common.Capacity' + total-potential-capacity: + $ref: '#/components/schemas/tapi.common.Capacity' + tapi.common.CapacityUnit: + type: string + enum: + - TB + - TBPS + - GB + - GBPS + - MB + - MBPS + - KB + - KBPS + - GHz + - MHz + tapi.common.CapacityValue: + type: object + properties: + value: + type: integer + description: none + format: int32 + unit: + $ref: '#/components/schemas/tapi.common.CapacityUnit' + tapi.common.CapacityValueWrapper: + type: object + properties: + committed-burst-size: + $ref: '#/components/schemas/tapi.common.CapacityValue' + tapi.common.CapacityWrapper: + type: object + properties: + available-capacity: + $ref: '#/components/schemas/tapi.common.Capacity' + tapi.common.Context: + allOf: + - $ref: '#/components/schemas/tapi.common.TapiContext' + - $ref: '#/components/schemas/tapi.connectivity.ContextAugmentation3' + - $ref: '#/components/schemas/tapi.notification.ContextAugmentation1' + - $ref: '#/components/schemas/tapi.path.computation.ContextAugmentation2' + - $ref: '#/components/schemas/tapi.topology.ContextAugmentation4' + tapi.common.ContextWrapper: + type: object + properties: + tapi-common:context: + $ref: '#/components/schemas/tapi.common.Context' + tapi.common.DirectiveValue: + type: string + enum: + - MINIMIZE + - MAXIMIZE + - ALLOW + - DISALLOW + - DONT_CARE + tapi.common.ForwardingDirection: + type: string + enum: + - BIDIRECTIONAL + - UNIDIRECTIONAL + - UNDEFINED_OR_UNKNOWN + tapi.common.GetServiceInterfacePointDetails: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.common.getserviceinterfacepointdetails.Output' + tapi.common.GetServiceInterfacePointList: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.common.getserviceinterfacepointlist.Output' + tapi.common.GlobalClass: + type: object + properties: + name: + type: array + description: List of names. A property of an entity with a value that is + unique in some namespace but may change during the life of the entity. + A name carries no semantics with respect to the purpose of the entity. + items: + $ref: '#/components/schemas/tapi.common.NameAndValue' + uuid: + type: string + description: "UUID: An identifier that is universally unique within an identifier\ + \ space, where the identifier space is itself globally unique, and immutable.\ + \ An UUID carries no semantics with respect to the purpose or state of\ + \ the entity.\r\n UUID here uses string representation\ + \ as defined in RFC 4122. The canonical representation uses lowercase\ + \ characters.\r\n Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-'\ + \ + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} \r\n Example of a UUID\ + \ in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6" + tapi.common.LayerProtocolName: + type: string + enum: + - ODU + - ETH + - DSR + - PHOTONIC_MEDIA + tapi.common.LifecycleState: + type: string + enum: + - PLANNED + - POTENTIAL_AVAILABLE + - POTENTIAL_BUSY + - INSTALLED + - PENDING_REMOVAL + tapi.common.LocalClass: + type: object + properties: + name: + type: array + description: List of names. A property of an entity with a value that is + unique in some namespace but may change during the life of the entity. + A name carries no semantics with respect to the purpose of the entity. + items: + $ref: '#/components/schemas/tapi.common.NameAndValue' + local-id: + type: string + description: none + tapi.common.NameAndValue: + type: object + properties: + value-name: + type: string + description: The name of the value. The value need not have a name. + value: + type: string + description: The value + tapi.common.NameAndValueWrapper: + type: object + properties: + name: + $ref: '#/components/schemas/tapi.common.NameAndValue' + tapi.common.OperationalState: + type: string + enum: + - DISABLED + - ENABLED + tapi.common.OperationalStatePac: + type: object + properties: + operational-state: + $ref: '#/components/schemas/tapi.common.OperationalState' + lifecycle-state: + $ref: '#/components/schemas/tapi.common.LifecycleState' + tapi.common.PortDirection: + type: string + enum: + - BIDIRECTIONAL + - INPUT + - OUTPUT + - UNIDENTIFIED_OR_UNKNOWN + tapi.common.PortRole: + type: string + enum: + - SYMMETRIC + - ROOT + - LEAF + - TRUNK + - UNKNOWN + tapi.common.ServiceInterfacePoint: + allOf: + - $ref: '#/components/schemas/tapi.common.AdminStatePac' + - $ref: '#/components/schemas/tapi.common.CapacityPac' + - $ref: '#/components/schemas/tapi.common.GlobalClass' + - type: object + properties: + supported-layer-protocol-qualifier: + type: array + description: none + items: + type: string + layer-protocol-name: + $ref: '#/components/schemas/tapi.common.LayerProtocolName' + direction: + $ref: '#/components/schemas/tapi.common.PortDirection' + description: "The LogicalTerminationPoint (LTP) object class encapsulates\ + \ the termination and adaptation functions of one or more transport layers.\ + \ \r\n The structure of LTP supports all transport protocols\ + \ including circuit and packet forms." + tapi.common.ServiceInterfacePointRef: + type: object + properties: + service-interface-point-uuid: + type: string + description: none + x-path: /tapi-common:context/tapi-common:service-interface-point/tapi-common:uuid + tapi.common.ServiceInterfacePointRefWrapper: + type: object + properties: + service-interface-point: + $ref: '#/components/schemas/tapi.common.ServiceInterfacePointRef' + tapi.common.ServiceInterfacePointWrapper: + type: object + properties: + service-interface-point: + $ref: '#/components/schemas/tapi.common.ServiceInterfacePoint' + tapi.common.TapiContext: + allOf: + - $ref: '#/components/schemas/tapi.common.GlobalClass' + - type: object + properties: + service-interface-point: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.common.ServiceInterfacePoint' + description: "The Network Control Domain (NCD) object class represents the\ + \ scope of control that a particular SDN controller has with respect to\ + \ a particular network, (i.e., encompassing a designated set of interconnected\ + \ (virtual) network elements)." + tapi.common.TerminationDirection: + type: string + enum: + - BIDIRECTIONAL + - SINK + - SOURCE + - UNDEFINED_OR_UNKNOWN + tapi.common.TerminationPac: + type: object + properties: + termination-direction: + $ref: '#/components/schemas/tapi.common.TerminationDirection' + termination-state: + $ref: '#/components/schemas/tapi.common.TerminationState' + tapi.common.TerminationState: + type: string + enum: + - LP_CAN_NEVER_TERMINATE + - LT_NOT_TERMINATED + - TERMINATED_SERVER_TO_CLIENT_FLOW + - TERMINATED_CLIENT_TO_SERVER_FLOW + - TERMINATED_BIDIRECTIONAL + - LT_PERMENANTLY_TERMINATED + - TERMINATION_STATE_UNKNOWN + tapi.common.TimeRange: + type: object + properties: + end-time: + type: string + description: none + start-time: + type: string + description: none + tapi.common.TimeRangeWrapper: + type: object + properties: + schedule: + $ref: '#/components/schemas/tapi.common.TimeRange' + tapi.common.getserviceinterfacepointdetails.Input: + type: object + properties: + sip-id-or-name: + type: string + description: none + tapi.common.getserviceinterfacepointdetails.Output: + type: object + properties: + sip: + $ref: '#/components/schemas/tapi.common.ServiceInterfacePoint' + tapi.common.getserviceinterfacepointlist.Output: + type: object + properties: + sip: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.common.ServiceInterfacePoint' + tapi.common.updateserviceinterfacepoint.Input: + type: object + properties: + sip-id-or-name: + type: string + description: none + state: + $ref: '#/components/schemas/tapi.common.AdministrativeState' + tapi.connectivity.CepList: + type: object + properties: + connection-end-point: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.connectivity.ConnectionEndPoint' + tapi.connectivity.CepListWrapper: + type: object + properties: + tapi-connectivity:cep-list: + $ref: '#/components/schemas/tapi.connectivity.CepList' + tapi.connectivity.CepRole: + type: object + properties: + role-name: + type: string + description: The name of the cep role in the context of the referenced spec. + connection-spec-reference: + $ref: '#/components/schemas/tapi.connectivity.ConnectionSpecReference' + tapi.connectivity.CepRoleWrapper: + type: object + properties: + cep-role: + $ref: '#/components/schemas/tapi.connectivity.CepRole' + tapi.connectivity.Connection: + allOf: + - $ref: '#/components/schemas/tapi.common.GlobalClass' + - $ref: '#/components/schemas/tapi.common.OperationalStatePac' + - type: object + properties: + supported-client-link: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.topology.LinkRef' + lower-connection: + type: array + description: "An Connection object supports a recursive aggregation relationship\ + \ such that the internal construction of an Connection can be exposed\ + \ as multiple lower level Connection objects (partitioning).\r\n \ + \ Aggregation is used as for the Node/Topology to allow\ + \ changes in hierarchy. \r\n Connection aggregation reflects\ + \ Node/Topology aggregation. \r\n The FC represents a\ + \ Cross-Connection in an NE. The Cross-Connection in an NE is not necessarily\ + \ the lowest level of FC partitioning." + items: + $ref: '#/components/schemas/tapi.connectivity.ConnectionRef' + switch-control: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.connectivity.SwitchControl' + route: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.connectivity.Route' + connection-spec-reference: + $ref: '#/components/schemas/tapi.connectivity.ConnectionSpecReference' + layer-protocol-name: + $ref: '#/components/schemas/tapi.common.LayerProtocolName' + connection-end-point: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.connectivity.ConnectionEndPointRef' + direction: + $ref: '#/components/schemas/tapi.common.ForwardingDirection' + description: "The ForwardingConstruct (FC) object class models enabled potential\ + \ for forwarding between two or more LTPs and like the LTP supports any\ + \ transport protocol including all circuit and packet forms.\r\n \ + \ At the lowest level of recursion, a FC represents a cross-connection\ + \ within an NE." + tapi.connectivity.ConnectionEndPoint: + allOf: + - $ref: '#/components/schemas/tapi.common.GlobalClass' + - $ref: '#/components/schemas/tapi.common.OperationalStatePac' + - $ref: '#/components/schemas/tapi.common.TerminationPac' + - type: object + properties: + client-node-edge-point: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.topology.NodeEdgePointRef' + connection-port-role: + $ref: '#/components/schemas/tapi.common.PortRole' + layer-protocol-name: + $ref: '#/components/schemas/tapi.common.LayerProtocolName' + layer-protocol-qualifier: + type: string + description: none + parent-node-edge-point: + $ref: '#/components/schemas/tapi.topology.NodeEdgePointRef' + cep-role: + type: array + description: "Defines the role of the CEP in the context of the connection\ + \ spec.\r\n There may be many cep role - connection spec\ + \ combinations for a particular CEP where each corresponds to a specific\ + \ connection associated with the CEP." + items: + $ref: '#/components/schemas/tapi.connectivity.CepRole' + aggregated-connection-end-point: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.connectivity.ConnectionEndPointRef' + connection-port-direction: + $ref: '#/components/schemas/tapi.common.PortDirection' + description: "The LogicalTerminationPoint (LTP) object class encapsulates\ + \ the termination and adaptation functions of one or more transport layers.\ + \ \r\n The structure of LTP supports all transport protocols\ + \ including circuit and packet forms." + tapi.connectivity.ConnectionEndPointRef: + allOf: + - $ref: '#/components/schemas/tapi.topology.NodeEdgePointRef' + - type: object + properties: + connection-end-point-uuid: + type: string + description: none + x-path: /tapi-common:context/tapi-topology:topology-context/tapi-topology:topology/tapi-topology:node/tapi-topology:owned-node-edge-point/tapi-connectivity:cep-list/tapi-connectivity:connection-end-point/tapi-connectivity:uuid + description: none + tapi.connectivity.ConnectionEndPointRefWrapper: + type: object + properties: + connection-end-point: + $ref: '#/components/schemas/tapi.connectivity.ConnectionEndPointRef' + tapi.connectivity.ConnectionEndPointWrapper: + type: object + properties: + connection-end-point: + $ref: '#/components/schemas/tapi.connectivity.ConnectionEndPoint' + tapi.connectivity.ConnectionRef: + type: object + properties: + connection-uuid: + type: string + description: none + x-path: /tapi-common:context/tapi-connectivity:connectivity-context/tapi-connectivity:connection/tapi-connectivity:uuid + tapi.connectivity.ConnectionRefWrapper: + type: object + properties: + lower-connection: + $ref: '#/components/schemas/tapi.connectivity.ConnectionRef' + tapi.connectivity.ConnectionSpecReference: + type: object + properties: + connection-spec-name: + type: string + description: "The name of the connection spec.\r\n This can\ + \ be used alone (with no spec reference) where there is only a paper spec." + connection-spec-id: + type: string + description: "The reference to a formal spec. \r\n This reference\ + \ need not be provided (e.g., where there is no formal machine interpretable\ + \ spec for the type of connection)." + tapi.connectivity.ConnectionSpecReferenceWrapper: + type: object + properties: + connection-spec-reference: + $ref: '#/components/schemas/tapi.connectivity.ConnectionSpecReference' + tapi.connectivity.ConnectionWrapper: + type: object + properties: + connection: + $ref: '#/components/schemas/tapi.connectivity.Connection' + tapi.connectivity.ConnectivityConstraint: + type: object + properties: + service-layer: + $ref: '#/components/schemas/tapi.common.LayerProtocolName' + schedule: + $ref: '#/components/schemas/tapi.common.TimeRange' + connectivity-direction: + $ref: '#/components/schemas/tapi.common.ForwardingDirection' + requested-capacity: + $ref: '#/components/schemas/tapi.common.Capacity' + diversity-exclusion: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceRef' + connection-inclusion: + type: array + description: "A ConnectivityService may use one or more existing Connections.\r\ + \n A common traditional strategy is to set up “stranded”\ + \ connectivity in the core of the network as “express channels” (this\ + \ is essentially a serial compound link, but can be treated as simple\ + \ connections)\r\n A connection inclusion capability allows\ + \ for adoption of a discovered Connections.\r\n A ConnectivityService\ + \ is requested with a connection inclusion constraint that identifies\ + \ a connection (or chain of connections) that is bounded by CEPs that\ + \ each belong to a NEP that references a SIP that is referenced by a CSEP\ + \ of the ConnectivityService such that all CSEPs are satisfied by CEPs\ + \ of the existing Connection. will allow discovered Connections with no\ + \ stated intent to be associated with an intent via the ConnectivityService." + items: + type: string + service-level: + type: string + description: "An abstract value the meaning of which is mutually agreed\ + \ – typically represents metrics such as - Class of service, priority,\ + \ resiliency, availability" + service-type: + $ref: '#/components/schemas/tapi.connectivity.ServiceType' + connection-exclusion: + type: array + description: none + items: + type: string + coroute-inclusion: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceRef' + tapi.connectivity.ConnectivityContext: + type: object + properties: + connectivity-service: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityService' + connection: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.connectivity.Connection' + tapi.connectivity.ConnectivityContextWrapper: + type: object + properties: + tapi-connectivity:connectivity-context: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityContext' + tapi.connectivity.ConnectivityService: + allOf: + - $ref: '#/components/schemas/tapi.common.AdminStatePac' + - $ref: '#/components/schemas/tapi.common.GlobalClass' + - $ref: '#/components/schemas/tapi.connectivity.ConnectivityConstraint' + - $ref: '#/components/schemas/tapi.connectivity.ResilienceConstraint' + - $ref: '#/components/schemas/tapi.path.computation.RoutingConstraint' + - $ref: '#/components/schemas/tapi.path.computation.TopologyConstraint' + - type: object + properties: + end-point: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceEndPoint' + connection: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.connectivity.ConnectionRef' + description: "The ForwardingConstruct (FC) object class models enabled potential\ + \ for forwarding between two or more LTPs and like the LTP supports any\ + \ transport protocol including all circuit and packet forms.\r\n \ + \ At the lowest level of recursion, a FC represents a cross-connection\ + \ within an NE." + tapi.connectivity.ConnectivityServiceEndPoint: + allOf: + - $ref: '#/components/schemas/tapi.common.AdminStatePac' + - $ref: '#/components/schemas/tapi.common.LocalClass' + - type: object + properties: + protection-role: + $ref: '#/components/schemas/tapi.connectivity.ProtectionRole' + role: + $ref: '#/components/schemas/tapi.common.PortRole' + service-interface-point: + $ref: '#/components/schemas/tapi.common.ServiceInterfacePointRef' + peer-fwd-connectivity-service-end-point: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceEndPointRef' + layer-protocol-name: + $ref: '#/components/schemas/tapi.common.LayerProtocolName' + layer-protocol-qualifier: + type: string + description: none + connection-end-point: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.connectivity.ConnectionEndPointRef' + server-connectivity-service-end-point: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceEndPointRef' + protecting-connectivity-service-end-point: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceEndPointRef' + direction: + $ref: '#/components/schemas/tapi.common.PortDirection' + capacity: + $ref: '#/components/schemas/tapi.common.Capacity' + description: "The association of the FC to LTPs is made via EndPoints.\r\n\ + \ The EndPoint (EP) object class models the access to the FC\ + \ function. \r\n The traffic forwarding between the associated\ + \ EPs of the FC depends upon the type of FC and may be associated with FcSwitch\ + \ object instances. \r\n In cases where there is resilience\ + \ the EndPoint may convey the resilience role of the access to the FC. \r\ + \n It can represent a protected (resilient/reliable) point or\ + \ a protecting (unreliable working or protection) point.\r\n \ + \ The EP replaces the Protection Unit of a traditional protection model.\ + \ \r\n The ForwadingConstruct can be considered as a component\ + \ and the EndPoint as a Port on that component" + tapi.connectivity.ConnectivityServiceEndPointRef: + allOf: + - $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceRef' + - type: object + properties: + connectivity-service-end-point-local-id: + type: string + description: none + x-path: /tapi-common:context/tapi-connectivity:connectivity-context/tapi-connectivity:connectivity-service/tapi-connectivity:end-point/tapi-connectivity:local-id + description: none + tapi.connectivity.ConnectivityServiceEndPointRefWrapper: + type: object + properties: + peer-fwd-connectivity-service-end-point: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceEndPointRef' + tapi.connectivity.ConnectivityServiceEndPointWrapper: + type: object + properties: + end-point: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceEndPoint' + tapi.connectivity.ConnectivityServiceRef: + type: object + properties: + connectivity-service-uuid: + type: string + description: none + x-path: /tapi-common:context/tapi-connectivity:connectivity-context/tapi-connectivity:connectivity-service/tapi-connectivity:uuid + tapi.connectivity.ConnectivityServiceRefWrapper: + type: object + properties: + coroute-inclusion: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceRef' + tapi.connectivity.ConnectivityServiceWrapper: + type: object + properties: + connectivity-service: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityService' + tapi.connectivity.ContextAugmentation3: + type: object + properties: + connectivity-context: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityContext' + x-augmentation: + prefix: tapi-connectivity + namespace: urn:onf:otcc:yang:tapi-connectivity + tapi.connectivity.CoordinateType: + type: string + enum: + - NO_COORDINATE + - HOLD_OFF_TIME + - WAIT_FOR_NOTIFICATION + tapi.connectivity.CreateConnectivityService: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.connectivity.createconnectivityservice.Output' + tapi.connectivity.GetConnectionDetails: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.connectivity.getconnectiondetails.Output' + tapi.connectivity.GetConnectionEndPointDetails: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.connectivity.getconnectionendpointdetails.Output' + tapi.connectivity.GetConnectivityServiceDetails: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.connectivity.getconnectivityservicedetails.Output' + tapi.connectivity.GetConnectivityServiceList: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.connectivity.getconnectivityservicelist.Output' + tapi.connectivity.OwnedNodeEdgePointAugmentation1: + type: object + properties: + cep-list: + $ref: '#/components/schemas/tapi.connectivity.CepList' + x-augmentation: + prefix: tapi-connectivity + namespace: urn:onf:otcc:yang:tapi-connectivity + tapi.connectivity.ProtectionRole: + type: string + enum: + - WORK + - PROTECT + - PROTECTED + - NA + - WORK_RESTORE + - PROTECT_RESTORE + tapi.connectivity.ResilienceConstraint: + type: object + properties: + is-lock-out: + type: boolean + description: "The resource is configured to temporarily not be available\ + \ for use in the protection scheme(s) it is part of.\r\n \ + \ This overrides all other protection control states including forced.\r\ + \n If the item is locked out then it cannot be used under\ + \ any circumstances.\r\n Note: Only relevant when part\ + \ of a protection scheme." + default: false + max-switch-times: + type: integer + description: "Used to limit the maximum swtich times. When work fault disappears\ + \ , and traffic return to the original work path, switch counter reset." + format: int32 + restoration-coordinate-type: + $ref: '#/components/schemas/tapi.connectivity.CoordinateType' + is-coordinated-switching-both-ends: + type: boolean + description: Is operating such that switching at both ends of each flow + acorss the FC is coordinated at both ingress and egress ends. + default: false + hold-off-time: + type: integer + description: "This attribute indicates the time, in milliseconds, between\ + \ declaration of signal degrade or signal fail, and the initialization\ + \ of the protection switching algorithm." + format: int32 + is-frozen: + type: boolean + description: "Temporarily prevents any switch action to be taken and, as\ + \ such, freezes the current state. \r\n Until the freeze\ + \ is cleared, additional near-end external commands are rejected and fault\ + \ condition changes and received APS messages are ignored.\r\n \ + \ All administrative controls of any aspect of protection are\ + \ rejected." + default: false + wait-to-revert-time: + type: integer + description: "If the protection system is revertive, this attribute specifies\ + \ the time, in minutes, to wait after a fault clears on a higher priority\ + \ (preferred) resource before reverting to the preferred resource." + format: int32 + default: 15 + resilience-type: + $ref: '#/components/schemas/tapi.topology.ResilienceType' + preferred-restoration-layer: + type: array + description: Indicate which layer this resilience parameters package configured + for. + items: + $ref: '#/components/schemas/tapi.common.LayerProtocolName' + restore-priority: + type: integer + description: none + format: int32 + reversion-mode: + $ref: '#/components/schemas/tapi.connectivity.ReversionMode' + tapi.connectivity.ResilienceRoute: + allOf: + - $ref: '#/components/schemas/tapi.common.LocalClass' + - type: object + properties: + priority: + type: integer + description: "Value of 0 (zero) means 'unspecified priority'.\r\n \ + \ Highest priority is 1, sometimes referred as 'preferred'\ + \ or 'main' or 'intended' route.\r\n 2 has lower priority\ + \ than 1, 3 has lower priority than 2, etc." + format: int32 + route-state: + type: string + description: Current information on the route selection. + description: "This object adds resilience and state attributes to the Route.\r\ + \n When this object is not present, then the Route is intendend\ + \ as 'current' Route of the Connection." + tapi.connectivity.ResilienceRouteWrapper: + type: object + properties: + resilience-route-pac: + $ref: '#/components/schemas/tapi.connectivity.ResilienceRoute' + tapi.connectivity.ReversionMode: + type: string + enum: + - REVERTIVE + - NON-REVERTIVE + tapi.connectivity.Route: + allOf: + - $ref: '#/components/schemas/tapi.common.LocalClass' + - type: object + properties: + connection-end-point: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.connectivity.ConnectionEndPointRef' + resilience-route-pac: + $ref: '#/components/schemas/tapi.connectivity.ResilienceRoute' + description: "The Route of a Connection is modeled as a collection of Connection\ + \ End Points.\r\n The logical order of the Connection End Points\ + \ within the Route object can be inferred by the TAPI client by the knowledge\ + \ of the Topology information." + tapi.connectivity.RouteRef: + allOf: + - $ref: '#/components/schemas/tapi.connectivity.ConnectionRef' + - type: object + properties: + route-local-id: + type: string + description: none + x-path: /tapi-common:context/tapi-connectivity:connectivity-context/tapi-connectivity:connection/tapi-connectivity:route/tapi-connectivity:local-id + description: none + tapi.connectivity.RouteRefWrapper: + type: object + properties: + selected-route: + $ref: '#/components/schemas/tapi.connectivity.RouteRef' + tapi.connectivity.RouteWrapper: + type: object + properties: + route: + $ref: '#/components/schemas/tapi.connectivity.Route' + tapi.connectivity.SelectionControl: + type: string + enum: + - LOCK_OUT + - NORMAL + - MANUAL + - FORCED + tapi.connectivity.SelectionReason: + type: string + enum: + - LOCKOUT + - NORMAL + - MANUAL + - FORCED + - WAIT_TO_REVERT + - SIGNAL_DEGRADE + - SIGNAL_FAIL + tapi.connectivity.ServiceType: + type: string + enum: + - POINT_TO_POINT_CONNECTIVITY + - POINT_TO_MULTIPOINT_CONNECTIVITY + - MULTIPOINT_CONNECTIVITY + - ROOTED_MULTIPOINT_CONNECTIVITY + tapi.connectivity.Switch: + allOf: + - $ref: '#/components/schemas/tapi.common.LocalClass' + - type: object + properties: + selected-connection-end-point: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.connectivity.ConnectionEndPointRef' + selected-route: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.connectivity.RouteRef' + selection-control: + $ref: '#/components/schemas/tapi.connectivity.SelectionControl' + selection-reason: + $ref: '#/components/schemas/tapi.connectivity.SelectionReason' + switch-direction: + $ref: '#/components/schemas/tapi.common.PortDirection' + description: "The class models the switched forwarding of traffic (traffic\ + \ flow) between FcPorts (ConnectionEndPoints) and is present where there\ + \ is protection functionality in the FC (Connection). \r\n If\ + \ an FC exposes protection (having two or more FcPorts that provide alternative\ + \ identical inputs/outputs), the FC will have one or more associated FcSwitch\ + \ objects to represent the alternative flow choices visible at the edge\ + \ of the FC.\r\n The FC switch represents and defines a protection\ + \ switch structure encapsulated in the FC. \r\n Essentially performs\ + \ one of the functions of the Protection Group in a traditional model. It\ + \ associates to 2 or more FcPorts each playing the role of a Protection\ + \ Unit. \r\n One or more protection, i.e. standby/backup, FcPorts\ + \ provide protection for one or more working (i.e. regular/main/preferred)\ + \ FcPorts where either protection or working can feed one or more protected\ + \ FcPort.\r\n The switch may be used in revertive or non-revertive\ + \ (symmetric) mode. When in revertive mode it may define a waitToRestore\ + \ time.\r\n It may be used in one of several modes including\ + \ source switch, destination switched, source and destination switched etc\ + \ (covering cases such as 1+1 and 1:1).\r\n It may be locked\ + \ out (prevented from switching), force switched or manual switched.\r\n\ + \ It will indicate switch state and change of state.\r\n \ + \ The switch can be switched away from all sources such that it becomes\ + \ open and hence two coordinated switches can both feed the same LTP so\ + \ long as at least one of the two is switched away from all sources (is\ + \ 'open').\r\n The ability for a Switch to be 'high impedance'\ + \ allows bidirectional ForwardingConstructs to be overlaid on the same bidirectional\ + \ LTP where the appropriate control is enabled to prevent signal conflict.\r\ + \n This ability allows multiple alternate routes to be present\ + \ that otherwise would be in conflict." + tapi.connectivity.SwitchControl: + allOf: + - $ref: '#/components/schemas/tapi.common.GlobalClass' + - $ref: '#/components/schemas/tapi.connectivity.ResilienceConstraint' + - type: object + properties: + sub-switch-control: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.connectivity.SwitchControlRef' + switch: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.connectivity.Switch' + description: "Represents the capability to control and coordinate switches,\ + \ to add/delete/modify FCs and to add/delete/modify LTPs/LPs so as to realize\ + \ a protection scheme." + tapi.connectivity.SwitchControlRef: + allOf: + - $ref: '#/components/schemas/tapi.connectivity.ConnectionRef' + - type: object + properties: + switch-control-uuid: + type: string + description: none + x-path: /tapi-common:context/tapi-connectivity:connectivity-context/tapi-connectivity:connection/tapi-connectivity:switch-control/tapi-connectivity:uuid + description: none + tapi.connectivity.SwitchControlRefWrapper: + type: object + properties: + sub-switch-control: + $ref: '#/components/schemas/tapi.connectivity.SwitchControlRef' + tapi.connectivity.SwitchControlWrapper: + type: object + properties: + switch-control: + $ref: '#/components/schemas/tapi.connectivity.SwitchControl' + tapi.connectivity.SwitchWrapper: + type: object + properties: + switch: + $ref: '#/components/schemas/tapi.connectivity.Switch' + tapi.connectivity.UpdateConnectivityService: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.connectivity.updateconnectivityservice.Output' + tapi.connectivity.createconnectivityservice.Input: + type: object + properties: + topology-constraint: + $ref: '#/components/schemas/tapi.path.computation.TopologyConstraint' + end-point: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceEndPoint' + resilience-constraint: + $ref: '#/components/schemas/tapi.connectivity.ResilienceConstraint' + routing-constraint: + $ref: '#/components/schemas/tapi.path.computation.RoutingConstraint' + state: + type: string + description: none + connectivity-constraint: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityConstraint' + tapi.connectivity.createconnectivityservice.Output: + type: object + properties: + service: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityService' + tapi.connectivity.deleteconnectivityservice.Input: + type: object + properties: + service-id-or-name: + type: string + description: none + tapi.connectivity.getconnectiondetails.Input: + type: object + properties: + connection-id-or-name: + type: string + description: none + tapi.connectivity.getconnectiondetails.Output: + type: object + properties: + connection: + $ref: '#/components/schemas/tapi.connectivity.Connection' + tapi.connectivity.getconnectionendpointdetails.Input: + type: object + properties: + cep-id-or-name: + type: string + description: none + nep-id-or-name: + type: string + description: none + node-id-or-name: + type: string + description: none + topology-id-or-name: + type: string + description: none + tapi.connectivity.getconnectionendpointdetails.Output: + type: object + properties: + connection-end-point: + $ref: '#/components/schemas/tapi.connectivity.ConnectionEndPoint' + tapi.connectivity.getconnectivityservicedetails.Input: + type: object + properties: + service-id-or-name: + type: string + description: none + tapi.connectivity.getconnectivityservicedetails.Output: + type: object + properties: + service: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityService' + tapi.connectivity.getconnectivityservicelist.Output: + type: object + properties: + service: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityService' + tapi.connectivity.updateconnectivityservice.Input: + type: object + properties: + service-id-or-name: + type: string + description: none + topology-constraint: + $ref: '#/components/schemas/tapi.path.computation.TopologyConstraint' + end-point: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityServiceEndPoint' + resilience-constraint: + $ref: '#/components/schemas/tapi.connectivity.ResilienceConstraint' + routing-constraint: + $ref: '#/components/schemas/tapi.path.computation.RoutingConstraint' + state: + type: string + description: none + connectivity-constraint: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityConstraint' + tapi.connectivity.updateconnectivityservice.Output: + type: object + properties: + service: + $ref: '#/components/schemas/tapi.connectivity.ConnectivityService' + tapi.notification.AlarmInfo: + type: object + properties: + perceived-severity: + $ref: '#/components/schemas/tapi.notification.PerceivedSeverityType' + probable-cause: + type: string + description: none + service-affecting: + $ref: '#/components/schemas/tapi.notification.ServiceAffecting' + is-transient: + type: boolean + description: none + default: false + tapi.notification.AlarmInfoWrapper: + type: object + properties: + alarm-info: + $ref: '#/components/schemas/tapi.notification.AlarmInfo' + tapi.notification.ContextAugmentation1: + type: object + properties: + notification-context: + $ref: '#/components/schemas/tapi.notification.NotificationContext' + x-augmentation: + prefix: tapi-notification + namespace: urn:onf:otcc:yang:tapi-notification + tapi.notification.CreateNotificationSubscriptionService: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.notification.createnotificationsubscriptionservice.Output' + tapi.notification.DeleteNotificationSubscriptionService: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.notification.deletenotificationsubscriptionservice.Output' + tapi.notification.GetNotificationList: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.notification.getnotificationlist.Output' + tapi.notification.GetNotificationSubscriptionServiceDetails: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.notification.getnotificationsubscriptionservicedetails.Output' + tapi.notification.GetNotificationSubscriptionServiceList: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.notification.getnotificationsubscriptionservicelist.Output' + tapi.notification.GetSupportedNotificationTypes: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.notification.getsupportednotificationtypes.Output' + tapi.notification.NameAndValueChange: + type: object + properties: + value-name: + type: string + description: The name of the value. The value need not have a name. + old-value: + type: string + description: The value + new-value: + type: string + description: The value + tapi.notification.NameAndValueChangeWrapper: + type: object + properties: + changed-attributes: + $ref: '#/components/schemas/tapi.notification.NameAndValueChange' + tapi.notification.Notification: + allOf: + - $ref: '#/components/schemas/tapi.common.GlobalClass' + - type: object + properties: + target-object-type: + $ref: '#/components/schemas/tapi.notification.ObjectType' + additional-text: + type: string + description: none + event-time-stamp: + type: string + description: none + additional-info: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.common.NameAndValue' + sequence-number: + type: integer + description: "A monotonous increasing sequence number associated with\ + \ the notification.\r\n The exact semantics of how this\ + \ sequence number is assigned (per channel or subscription or source\ + \ or system) is left undefined." + format: int32 + tca-info: + $ref: '#/components/schemas/tapi.notification.TcaInfo' + target-object-identifier: + type: string + description: none + notification-type: + $ref: '#/components/schemas/tapi.notification.NotificationType' + target-object-name: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.common.NameAndValue' + layer-protocol-name: + $ref: '#/components/schemas/tapi.common.LayerProtocolName' + source-indicator: + $ref: '#/components/schemas/tapi.notification.SourceIndicator' + alarm-info: + $ref: '#/components/schemas/tapi.notification.AlarmInfo' + changed-attributes: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.notification.NameAndValueChange' + description: none + tapi.notification.NotificationChannel: + allOf: + - $ref: '#/components/schemas/tapi.common.LocalClass' + - type: object + properties: + next-sequence-no: + type: integer + description: The sequence number of the next notification that will be + published on the channel + format: int32 + stream-address: + type: string + description: "The address/location/URI of the channel/stream to which\ + \ the subscribed notifications are published.\r\n This\ + \ specifics of this is typically dependent on the implementation protocol\ + \ & mechanism and hence is typed as a string." + description: none + tapi.notification.NotificationChannelWrapper: + type: object + properties: + notification-channel: + $ref: '#/components/schemas/tapi.notification.NotificationChannel' + tapi.notification.NotificationContext: + type: object + properties: + notif-subscription: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.notification.NotificationSubscriptionService' + notification: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.notification.Notification' + tapi.notification.NotificationContextWrapper: + type: object + properties: + tapi-notification:notification-context: + $ref: '#/components/schemas/tapi.notification.NotificationContext' + tapi.notification.NotificationSubscriptionService: + allOf: + - $ref: '#/components/schemas/tapi.common.GlobalClass' + - type: object + properties: + notification: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.notification.Notification' + notification-channel: + $ref: '#/components/schemas/tapi.notification.NotificationChannel' + subscription-state: + $ref: '#/components/schemas/tapi.notification.SubscriptionState' + supported-object-types: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.notification.ObjectType' + supported-notification-types: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.notification.NotificationType' + subscription-filter: + $ref: '#/components/schemas/tapi.notification.SubscriptionFilter' + description: none + tapi.notification.NotificationSubscriptionServiceWrapper: + type: object + properties: + notif-subscription: + $ref: '#/components/schemas/tapi.notification.NotificationSubscriptionService' + tapi.notification.NotificationType: + type: string + enum: + - OBJECT_CREATION + - OBJECT_DELETION + - ATTRIBUTE_VALUE_CHANGE + - ALARM_EVENT + - THRESHOLD_CROSSING_ALERT + tapi.notification.NotificationWrapper: + type: object + properties: + notification: + $ref: '#/components/schemas/tapi.notification.Notification' + tapi.notification.ObjectType: + type: string + enum: + - TOPOLOGY + - NODE + - LINK + - CONNECTION + - PATH + - CONNECTIVITY_SERVICE + - VIRTUAL_NETWORK_SERVICE + - PATH_COMPUTATION_SERVICE + - NODE_EDGE_POINT + - SERVICE_INTERFACE_POINT + - CONNECTION_END_POINT + - MAINTENANCE_ENTITY_GROUP + - MAINTENANCE_ENTITY + - MEG_END_POINT + - MEG_INTERMEDIATE_POINT + - SWITCH_CONTROL + - SWITCH + - ROUTE + - NODE_RULE_GROUP + - INTER_RULE_GROUP + - RULE + - OAM_JOB + - ACCESS_PORT + - EQUIPMENT + - HOLDER + - PHYSICAL_SPAN + - ABSTRACT_STRAND + - DEVICE + tapi.notification.PerceivedSeverityType: + type: string + enum: + - CRITICAL + - MAJOR + - MINOR + - WARNING + - CLEARED + tapi.notification.PerceivedTcaSeverity: + type: string + enum: + - WARNING + - CLEAR + tapi.notification.ServiceAffecting: + type: string + enum: + - SERVICE_AFFECTING + - NOT_SERVICE_AFFECTING + - UNKNOWN + tapi.notification.SourceIndicator: + type: string + enum: + - RESOURCE_OPERATION + - MANAGEMENT_OPERATION + - UNKNOWN + tapi.notification.SubscriptionFilter: + allOf: + - $ref: '#/components/schemas/tapi.common.LocalClass' + - type: object + properties: + requested-notification-types: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.notification.NotificationType' + requested-object-identifier: + type: array + description: none + items: + type: string + requested-layer-protocols: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.common.LayerProtocolName' + include-content: + type: boolean + description: Indicates whether the published Notification includes content + or just the Notification Id (which enables retrieval of the notification + at the later stage) + default: false + requested-object-types: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.notification.ObjectType' + description: none + tapi.notification.SubscriptionFilterWrapper: + type: object + properties: + subscription-filter: + $ref: '#/components/schemas/tapi.notification.SubscriptionFilter' + tapi.notification.SubscriptionState: + type: string + enum: + - SUSPENDED + - ACTIVE + tapi.notification.TcaInfo: + type: object + properties: + threshold-crossing: + $ref: '#/components/schemas/tapi.notification.ThresholdCrossingType' + threshold-parameter: + type: string + description: none + is-transient: + type: boolean + description: none + default: false + threshold-value: + type: integer + description: none + format: int32 + perceived-severity: + $ref: '#/components/schemas/tapi.notification.PerceivedTcaSeverity' + suspect-interval-flag: + type: boolean + description: none + default: false + measurement-interval: + type: string + description: none + tapi.notification.TcaInfoWrapper: + type: object + properties: + tca-info: + $ref: '#/components/schemas/tapi.notification.TcaInfo' + tapi.notification.ThresholdCrossingType: + type: string + enum: + - THRESHOLD_ABOVE + - THRESHOLD_BELOW + - CLEARED + tapi.notification.UpdateNotificationSubscriptionService: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.notification.updatenotificationsubscriptionservice.Output' + tapi.notification.createnotificationsubscriptionservice.Input: + type: object + properties: + subscription-state: + $ref: '#/components/schemas/tapi.notification.SubscriptionState' + subscription-filter: + $ref: '#/components/schemas/tapi.notification.SubscriptionFilter' + tapi.notification.createnotificationsubscriptionservice.Output: + type: object + properties: + subscription-service: + $ref: '#/components/schemas/tapi.notification.NotificationSubscriptionService' + tapi.notification.deletenotificationsubscriptionservice.Input: + type: object + properties: + subscription-id-or-name: + type: string + description: none + tapi.notification.deletenotificationsubscriptionservice.Output: + type: object + properties: + subscription-service: + $ref: '#/components/schemas/tapi.notification.NotificationSubscriptionService' + tapi.notification.getnotificationlist.Input: + type: object + properties: + time-period: + type: string + description: none + subscription-id-or-name: + type: string + description: none + tapi.notification.getnotificationlist.Output: + type: object + properties: + notification: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.notification.Notification' + tapi.notification.getnotificationsubscriptionservicedetails.Input: + type: object + properties: + subscription-id-or-name: + type: string + description: none + tapi.notification.getnotificationsubscriptionservicedetails.Output: + type: object + properties: + subscription-service: + $ref: '#/components/schemas/tapi.notification.NotificationSubscriptionService' + tapi.notification.getnotificationsubscriptionservicelist.Output: + type: object + properties: + subscription-service: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.notification.NotificationSubscriptionService' + tapi.notification.getsupportednotificationtypes.Output: + type: object + properties: + supported-object-types: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.notification.ObjectType' + supported-notification-types: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.notification.NotificationType' + tapi.notification.updatenotificationsubscriptionservice.Input: + type: object + properties: + subscription-state: + $ref: '#/components/schemas/tapi.notification.SubscriptionState' + subscription-filter: + $ref: '#/components/schemas/tapi.notification.SubscriptionFilter' + subscription-id-or-name: + type: string + description: none + tapi.notification.updatenotificationsubscriptionservice.Output: + type: object + properties: + subscription-service: + $ref: '#/components/schemas/tapi.notification.NotificationSubscriptionService' + tapi.path.computation.ComputeP2PPath: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.path.computation.computep2ppath.Output' + tapi.path.computation.ContextAugmentation2: + type: object + properties: + path-computation-context: + $ref: '#/components/schemas/tapi.path.computation.PathComputationContext' + x-augmentation: + prefix: tapi-path-computation + namespace: urn:onf:otcc:yang:tapi-path-computation + tapi.path.computation.DeleteP2PPath: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.path.computation.deletep2ppath.Output' + tapi.path.computation.DiversityPolicy: + type: string + enum: + - SRLG + - SRNG + - SNG + - NODE + - LINK + tapi.path.computation.OptimizeP2Ppath: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.path.computation.optimizep2ppath.Output' + tapi.path.computation.Path: + allOf: + - $ref: '#/components/schemas/tapi.common.GlobalClass' + - type: object + properties: + layer-protocol-name: + $ref: '#/components/schemas/tapi.common.LayerProtocolName' + link: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.topology.LinkRef' + routing-constraint: + $ref: '#/components/schemas/tapi.path.computation.RoutingConstraint' + direction: + $ref: '#/components/schemas/tapi.common.ForwardingDirection' + description: Path is described by an ordered list of TE Links. A TE Link is + defined by a pair of Node/NodeEdgePoint IDs. A Connection is realized by + concatenating link resources (associated with a Link) and the lower-level + connections (cross-connections) in the different nodes + tapi.path.computation.PathComputationContext: + type: object + properties: + path-comp-service: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.path.computation.PathComputationService' + path: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.path.computation.Path' + tapi.path.computation.PathComputationContextWrapper: + type: object + properties: + tapi-path-computation:path-computation-context: + $ref: '#/components/schemas/tapi.path.computation.PathComputationContext' + tapi.path.computation.PathComputationService: + allOf: + - $ref: '#/components/schemas/tapi.common.GlobalClass' + - type: object + properties: + topology-constraint: + $ref: '#/components/schemas/tapi.path.computation.TopologyConstraint' + path: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.path.computation.PathRef' + objective-function: + $ref: '#/components/schemas/tapi.path.computation.PathObjectiveFunction' + end-point: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.path.computation.PathServiceEndPoint' + routing-constraint: + $ref: '#/components/schemas/tapi.path.computation.RoutingConstraint' + optimization-constraint: + $ref: '#/components/schemas/tapi.path.computation.PathOptimizationConstraint' + description: none + tapi.path.computation.PathComputationServiceWrapper: + type: object + properties: + path-comp-service: + $ref: '#/components/schemas/tapi.path.computation.PathComputationService' + tapi.path.computation.PathObjectiveFunction: + allOf: + - $ref: '#/components/schemas/tapi.common.LocalClass' + - type: object + properties: + link-utilization: + $ref: '#/components/schemas/tapi.common.DirectiveValue' + bandwidth-optimization: + $ref: '#/components/schemas/tapi.common.DirectiveValue' + cost-optimization: + $ref: '#/components/schemas/tapi.common.DirectiveValue' + resource-sharing: + $ref: '#/components/schemas/tapi.common.DirectiveValue' + concurrent-paths: + $ref: '#/components/schemas/tapi.common.DirectiveValue' + description: none + tapi.path.computation.PathObjectiveFunctionWrapper: + type: object + properties: + objective-function: + $ref: '#/components/schemas/tapi.path.computation.PathObjectiveFunction' + tapi.path.computation.PathOptimizationConstraint: + allOf: + - $ref: '#/components/schemas/tapi.common.LocalClass' + - type: object + properties: + traffic-interruption: + $ref: '#/components/schemas/tapi.common.DirectiveValue' + description: none + tapi.path.computation.PathOptimizationConstraintWrapper: + type: object + properties: + optimization-constraint: + $ref: '#/components/schemas/tapi.path.computation.PathOptimizationConstraint' + tapi.path.computation.PathRef: + type: object + properties: + path-uuid: + type: string + description: none + x-path: /tapi-common:context/tapi-path-computation:path-computation-context/tapi-path-computation:path/tapi-path-computation:uuid + tapi.path.computation.PathRefWrapper: + type: object + properties: + path: + $ref: '#/components/schemas/tapi.path.computation.PathRef' + tapi.path.computation.PathServiceEndPoint: + allOf: + - $ref: '#/components/schemas/tapi.common.LocalClass' + - type: object + properties: + role: + $ref: '#/components/schemas/tapi.common.PortRole' + service-interface-point: + $ref: '#/components/schemas/tapi.common.ServiceInterfacePointRef' + layer-protocol-name: + $ref: '#/components/schemas/tapi.common.LayerProtocolName' + layer-protocol-qualifier: + type: string + description: none + direction: + $ref: '#/components/schemas/tapi.common.PortDirection' + capacity: + $ref: '#/components/schemas/tapi.common.Capacity' + description: "The association of the FC to LTPs is made via EndPoints.\r\n\ + \ The EndPoint (EP) object class models the access to the FC\ + \ function. \r\n The traffic forwarding between the associated\ + \ EPs of the FC depends upon the type of FC and may be associated with FcSwitch\ + \ object instances. \r\n In cases where there is resilience\ + \ the EndPoint may convey the resilience role of the access to the FC. \r\ + \n It can represent a protected (resilient/reliable) point or\ + \ a protecting (unreliable working or protection) point.\r\n \ + \ The EP replaces the Protection Unit of a traditional protection model.\ + \ \r\n The ForwadingConstruct can be considered as a component\ + \ and the EndPoint as a Port on that component" + tapi.path.computation.PathServiceEndPointWrapper: + type: object + properties: + end-point: + $ref: '#/components/schemas/tapi.path.computation.PathServiceEndPoint' + tapi.path.computation.PathWrapper: + type: object + properties: + path: + $ref: '#/components/schemas/tapi.path.computation.Path' + tapi.path.computation.RouteObjectiveFunction: + type: string + enum: + - MIN_WORK_ROUTE_HOP + - MIN_WORK_ROUTE_COST + - MIN_WORK_ROUTE_LATENCY + - MIN_SUM_OF_WORK_AND_PROTECTION_ROUTE_HOP + - MIN_SUM_OF_WORK_AND_PROTECTION_ROUTE_COST + - MIN_SUM_OF_WORK_AND_PROTECTION_ROUTE_LATENCY + - LOAD_BALANCE_MAX_UNUSED_CAPACITY + tapi.path.computation.RoutingConstraint: + type: object + properties: + is-exclusive: + type: boolean + description: To distinguish if the resources are to be exclusive to the + service + default: true + max-allowed-cost: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriority' + diversity-policy: + $ref: '#/components/schemas/tapi.path.computation.DiversityPolicy' + route-objective-function: + $ref: '#/components/schemas/tapi.path.computation.RouteObjectiveFunction' + cost-characteristic: + type: array + description: The list of costs where each cost relates to some aspect of + the TopologicalEntity. + items: + $ref: '#/components/schemas/tapi.topology.CostCharacteristic' + max-allowed-hops: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriority' + max-allowed-delay: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriority' + latency-characteristic: + type: array + description: The effect on the latency of a queuing process. This only has + significant effect for packet based systems and has a complex characteristic. + items: + $ref: '#/components/schemas/tapi.topology.LatencyCharacteristic' + risk-diversity-characteristic: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.topology.RiskCharacteristic' + route-direction: + $ref: '#/components/schemas/tapi.common.ForwardingDirection' + tapi.path.computation.RoutingConstraintWrapper: + type: object + properties: + routing-constraint: + $ref: '#/components/schemas/tapi.path.computation.RoutingConstraint' + tapi.path.computation.TopologyConstraint: + type: object + properties: + include-node: + type: array + description: This is a loose constraint - that is it is unordered and could + be a partial list + items: + type: string + exclude-link: + type: array + description: none + items: + type: string + avoid-topology: + type: array + description: none + items: + type: string + exclude-path: + type: array + description: none + items: + type: string + include-link: + type: array + description: 'This is a loose constraint - that is it is unordered and could + be a partial list ' + items: + type: string + preferred-transport-layer: + type: array + description: soft constraint requested by client to indicate the layer(s) + of transport connection that it prefers to carry the service. This could + be same as the service layer or one of the supported server layers + items: + $ref: '#/components/schemas/tapi.common.LayerProtocolName' + exclude-node: + type: array + description: none + items: + type: string + include-topology: + type: array + description: none + items: + type: string + include-path: + type: array + description: none + items: + type: string + tapi.path.computation.TopologyConstraintWrapper: + type: object + properties: + topology-constraint: + $ref: '#/components/schemas/tapi.path.computation.TopologyConstraint' + tapi.path.computation.ValueOrPriority: + type: object + properties: + priority: + type: integer + description: none + format: int32 + value: + type: integer + description: none + format: int32 + tapi.path.computation.ValueOrPriorityWrapper: + type: object + properties: + max-allowed-cost: + $ref: '#/components/schemas/tapi.path.computation.ValueOrPriority' + tapi.path.computation.computep2ppath.Input: + type: object + properties: + topology-constraint: + $ref: '#/components/schemas/tapi.path.computation.TopologyConstraint' + routing-constraint: + $ref: '#/components/schemas/tapi.path.computation.RoutingConstraint' + objective-function: + $ref: '#/components/schemas/tapi.path.computation.PathObjectiveFunction' + sep: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.path.computation.PathServiceEndPoint' + tapi.path.computation.computep2ppath.Output: + type: object + properties: + service: + $ref: '#/components/schemas/tapi.path.computation.PathComputationService' + tapi.path.computation.deletep2ppath.Input: + type: object + properties: + path-id-or-name: + type: string + description: none + tapi.path.computation.deletep2ppath.Output: + type: object + properties: + service: + $ref: '#/components/schemas/tapi.path.computation.PathComputationService' + tapi.path.computation.optimizep2ppath.Input: + type: object + properties: + routing-constraint: + $ref: '#/components/schemas/tapi.path.computation.RoutingConstraint' + path-id-or-name: + type: string + description: none + optimization-constraint: + $ref: '#/components/schemas/tapi.path.computation.PathOptimizationConstraint' + objective-function: + $ref: '#/components/schemas/tapi.path.computation.PathObjectiveFunction' + tapi.path.computation.optimizep2ppath.Output: + type: object + properties: + service: + $ref: '#/components/schemas/tapi.path.computation.PathComputationService' + tapi.topology.ConnectionSpecReference: + type: object + properties: + connection-spec-name: + type: string + description: "The name of the connection type spec.\r\n This\ + \ can be used as a reference to a paper document where full formal machine\ + \ interpretable specs are not supported." + connection-spec-id: + type: string + description: "The reference to a formal spec. \r\n This reference\ + \ need not be provided (e.g., where there is no formal machine interpretable\ + \ spec for the type of connection)." + tapi.topology.ConnectionSpecReferenceWrapper: + type: object + properties: + connection-spec-reference: + $ref: '#/components/schemas/tapi.topology.ConnectionSpecReference' + tapi.topology.ContextAugmentation4: + type: object + properties: + topology-context: + $ref: '#/components/schemas/tapi.topology.TopologyContext' + x-augmentation: + prefix: tapi-topology + namespace: urn:onf:otcc:yang:tapi-topology + tapi.topology.CostCharacteristic: + type: object + properties: + cost-value: + type: string + description: The specific cost. + cost-algorithm: + type: string + description: The cost may vary based upon some properties of the TopologicalEntity. + The rules for the variation are conveyed by the costAlgorithm. + cost-name: + type: string + description: "The cost characteristic will related to some aspect of the\ + \ TopologicalEntity (e.g. $ cost, routing weight). This aspect will be\ + \ conveyed by the costName." + tapi.topology.CostCharacteristicWrapper: + type: object + properties: + cost-characteristic: + $ref: '#/components/schemas/tapi.topology.CostCharacteristic' + tapi.topology.ForwardingRule: + type: string + enum: + - MAY_FORWARD_ACROSS_GROUP + - MUST_FORWARD_ACROSS_GROUP + - CANNOT_FORWARD_ACROSS_GROUP + - NO_STATEMENT_ON_FORWARDING + - INTER_CONNECTION_CONTENTION + tapi.topology.GetLinkDetails: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.topology.getlinkdetails.Output' + tapi.topology.GetNodeDetails: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.topology.getnodedetails.Output' + tapi.topology.GetNodeEdgePointDetails: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.topology.getnodeedgepointdetails.Output' + tapi.topology.GetTopologyDetails: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.topology.gettopologydetails.Output' + tapi.topology.GetTopologyList: + type: object + properties: + output: + $ref: '#/components/schemas/tapi.topology.gettopologylist.Output' + tapi.topology.InterRuleGroup: + allOf: + - $ref: '#/components/schemas/tapi.common.CapacityPac' + - $ref: '#/components/schemas/tapi.common.GlobalClass' + - $ref: '#/components/schemas/tapi.topology.RiskParameterPac' + - $ref: '#/components/schemas/tapi.topology.TransferCostPac' + - $ref: '#/components/schemas/tapi.topology.TransferTimingPac' + - type: object + properties: + associated-node-rule-group: + type: array + description: "The NodeRuleGroups that the InterRuleGroup constrains interconnection\ + \ between.\r\n The CEPs of the NEPs of a referenced NodeRuleGroup\ + \ can interconnect to the CEPs of the NEPs of another referenced NodeRuleGroup\ + \ constrained by the rules of the InterRuleGroup." + items: + $ref: '#/components/schemas/tapi.topology.NodeRuleGroupRef' + rule: + type: array + description: The list of rules of the InterRuleGroup. + items: + $ref: '#/components/schemas/tapi.topology.Rule' + description: Rules that apply between groups of NEPs. + tapi.topology.InterRuleGroupWrapper: + type: object + properties: + inter-rule-group: + $ref: '#/components/schemas/tapi.topology.InterRuleGroup' + tapi.topology.LatencyCharacteristic: + type: object + properties: + traffic-property-name: + type: string + description: The identifier of the specific traffic property to which the + queuing latency applies. + jitter-characteristic: + type: string + description: "High frequency deviation from true periodicity of a signal\ + \ and therefore a small high rate of change of transfer latency.\r\n \ + \ Applies to TDM systems (and not packet)." + fixed-latency-characteristic: + type: string + description: A TopologicalEntity suffers delay caused by the realization + of the servers (e.g. distance related; FEC encoding etc.) along with some + client specific processing. This is the total average latency effect of + the TopologicalEntity + wander-characteristic: + type: string + description: "Low frequency deviation from true periodicity of a signal\ + \ and therefore a small low rate of change of transfer latency.\r\n \ + \ Applies to TDM systems (and not packet)." + queing-latency-characteristic: + type: string + description: The specific queuing latency for the traffic property. + tapi.topology.LatencyCharacteristicWrapper: + type: object + properties: + latency-characteristic: + $ref: '#/components/schemas/tapi.topology.LatencyCharacteristic' + tapi.topology.LayerProtocolTransitionPac: + type: object + properties: + transitioned-layer-protocol-name: + type: array + description: Provides the ordered structure of layer protocol transitions + encapsulated in the TopologicalEntity. The ordering relates to the LinkPort + role. + items: + type: string + tapi.topology.Link: + allOf: + - $ref: '#/components/schemas/tapi.common.AdminStatePac' + - $ref: '#/components/schemas/tapi.common.CapacityPac' + - $ref: '#/components/schemas/tapi.common.GlobalClass' + - $ref: '#/components/schemas/tapi.topology.LayerProtocolTransitionPac' + - $ref: '#/components/schemas/tapi.topology.RiskParameterPac' + - $ref: '#/components/schemas/tapi.topology.TransferCostPac' + - $ref: '#/components/schemas/tapi.topology.TransferIntegrityPac' + - $ref: '#/components/schemas/tapi.topology.TransferTimingPac' + - $ref: '#/components/schemas/tapi.topology.ValidationPac' + - type: object + properties: + layer-protocol-name: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.common.LayerProtocolName' + resilience-type: + $ref: '#/components/schemas/tapi.topology.ResilienceType' + node-edge-point: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.topology.NodeEdgePointRef' + direction: + $ref: '#/components/schemas/tapi.common.ForwardingDirection' + description: 'The Link object class models effective adjacency between two + or more ForwardingDomains (FD). ' + tapi.topology.LinkRef: + allOf: + - $ref: '#/components/schemas/tapi.topology.TopologyRef' + - type: object + properties: + link-uuid: + type: string + description: none + x-path: /tapi-common:context/tapi-topology:topology-context/tapi-topology:topology/tapi-topology:link/tapi-topology:uuid + description: none + tapi.topology.LinkRefWrapper: + type: object + properties: + supported-client-link: + $ref: '#/components/schemas/tapi.topology.LinkRef' + tapi.topology.LinkWrapper: + type: object + properties: + link: + $ref: '#/components/schemas/tapi.topology.Link' + tapi.topology.NetworkTopologyService: + allOf: + - $ref: '#/components/schemas/tapi.common.GlobalClass' + - type: object + properties: + topology: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.topology.TopologyRef' + description: none + tapi.topology.NetworkTopologyServiceWrapper: + type: object + properties: + nw-topology-service: + $ref: '#/components/schemas/tapi.topology.NetworkTopologyService' + tapi.topology.Node: + allOf: + - $ref: '#/components/schemas/tapi.common.AdminStatePac' + - $ref: '#/components/schemas/tapi.common.CapacityPac' + - $ref: '#/components/schemas/tapi.common.GlobalClass' + - $ref: '#/components/schemas/tapi.topology.TransferCostPac' + - $ref: '#/components/schemas/tapi.topology.TransferIntegrityPac' + - $ref: '#/components/schemas/tapi.topology.TransferTimingPac' + - type: object + properties: + layer-protocol-name: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.common.LayerProtocolName' + encap-topology: + $ref: '#/components/schemas/tapi.topology.TopologyRef' + owned-node-edge-point: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.topology.NodeEdgePoint' + node-rule-group: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.topology.NodeRuleGroup' + aggregated-node-edge-point: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.topology.NodeEdgePointRef' + description: "The ForwardingDomain (FD) object class models the ForwardingDomain\ + \ topological component which is used to effect forwarding of transport\ + \ characteristic information and offers the potential to enable forwarding.\r\ + \n At the lowest level of recursion, an FD (within a network\ + \ element (NE)) represents a switch matrix (i.e., a fabric). Note that an\ + \ NE can encompass multiple switch matrices (FDs). " + tapi.topology.NodeEdgePoint: + allOf: + - $ref: '#/components/schemas/tapi.common.AdminStatePac' + - $ref: '#/components/schemas/tapi.common.CapacityPac' + - $ref: '#/components/schemas/tapi.common.GlobalClass' + - $ref: '#/components/schemas/tapi.common.TerminationPac' + - type: object + properties: + link-port-role: + $ref: '#/components/schemas/tapi.common.PortRole' + mapped-service-interface-point: + type: array + description: NodeEdgePoint mapped to more than ServiceInterfacePoint (slicing/virtualizing) + or a ServiceInterfacePoint mapped to more than one NodeEdgePoint (load + balancing/Resilience) should be considered experimental + items: + $ref: '#/components/schemas/tapi.common.ServiceInterfacePointRef' + aggregated-node-edge-point: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.topology.NodeEdgePointRef' + layer-protocol-name: + $ref: '#/components/schemas/tapi.common.LayerProtocolName' + link-port-direction: + $ref: '#/components/schemas/tapi.common.PortDirection' + supported-cep-layer-protocol-qualifier: + type: array + description: none + items: + type: string + description: "The LogicalTerminationPoint (LTP) object class encapsulates\ + \ the termination and adaptation functions of one or more transport layers.\r\ + \n The structure of LTP supports all transport protocols including\ + \ circuit and packet forms." + tapi.topology.NodeEdgePointRef: + allOf: + - $ref: '#/components/schemas/tapi.topology.NodeRef' + - type: object + properties: + node-edge-point-uuid: + type: string + description: none + x-path: /tapi-common:context/tapi-topology:topology-context/tapi-topology:topology/tapi-topology:node/tapi-topology:owned-node-edge-point/tapi-topology:uuid + description: none + tapi.topology.NodeEdgePointRefWrapper: + type: object + properties: + node-edge-point: + $ref: '#/components/schemas/tapi.topology.NodeEdgePointRef' + tapi.topology.NodeRef: + allOf: + - $ref: '#/components/schemas/tapi.topology.TopologyRef' + - type: object + properties: + node-uuid: + type: string + description: none + x-path: /tapi-common:context/tapi-topology:topology-context/tapi-topology:topology/tapi-topology:node/tapi-topology:uuid + description: none + tapi.topology.NodeRuleGroup: + allOf: + - $ref: '#/components/schemas/tapi.common.CapacityPac' + - $ref: '#/components/schemas/tapi.common.GlobalClass' + - $ref: '#/components/schemas/tapi.topology.RiskParameterPac' + - $ref: '#/components/schemas/tapi.topology.TransferCostPac' + - $ref: '#/components/schemas/tapi.topology.TransferTimingPac' + - type: object + properties: + inter-rule-group: + type: array + description: "Nested NodeRuleGroups may have InterRuleGroups. The Superior\ + \ NodeRuleGroup contains the nested NodeRuleGroups and their associated\ + \ InterRuleGroups.\r\n This is equivalent to the Node-Topology\ + \ hierarchy." + items: + $ref: '#/components/schemas/tapi.topology.InterRuleGroup' + rule: + type: array + description: The list of rules of the NodeRuleGroup. + items: + $ref: '#/components/schemas/tapi.topology.Rule' + node-rule-group: + type: array + description: "NodeRuleGroups may be nested such that finer grained rules\ + \ may be applied.\r\n A nested rule group should have\ + \ a subset of the NEPs of the superior rule group." + items: + $ref: '#/components/schemas/tapi.topology.NodeRuleGroupRef' + node-edge-point: + type: array + description: NEPs and their client CEPs that the rules apply to. + items: + $ref: '#/components/schemas/tapi.topology.NodeEdgePointRef' + description: "Rules that apply to a group of NEPs.\r\n " + tapi.topology.NodeRuleGroupRef: + allOf: + - $ref: '#/components/schemas/tapi.topology.NodeRef' + - type: object + properties: + node-rule-group-uuid: + type: string + description: none + x-path: /tapi-common:context/tapi-topology:topology-context/tapi-topology:topology/tapi-topology:node/tapi-topology:node-rule-group/tapi-topology:uuid + description: none + tapi.topology.NodeRuleGroupRefWrapper: + type: object + properties: + associated-node-rule-group: + $ref: '#/components/schemas/tapi.topology.NodeRuleGroupRef' + tapi.topology.NodeRuleGroupWrapper: + type: object + properties: + node-rule-group: + $ref: '#/components/schemas/tapi.topology.NodeRuleGroup' + tapi.topology.PortRoleRule: + type: object + properties: + port-role-rule: + type: array + description: "Where the rule references more than one port role or where\ + \ there are rule intersections either as a result of overlay of rules\ + \ or inter rule group usage indicates role matching criteria for a connection\ + \ following the rules.\r\n For example if two port roles,\ + \ 'a' and 'b', are listed and the port role rule is 'different', this\ + \ means that a connection connecting points in that group must have port\ + \ roles that are different for each CEP in that group.\r\n \ + \ In the example if a connection can have n ports of role 'a' and\ + \ m ports of role 'b' then a maximum of two ports can be drawn from the\ + \ NEPs of the group and where there are two, one must be role 'a' and\ + \ one must be role 'b'." + items: + type: string + port-role: + type: array + description: The role(s) of the port(s) considered in the rule. + items: + type: string + tapi.topology.PortRoleRuleWrapper: + type: object + properties: + cep-port-role: + $ref: '#/components/schemas/tapi.topology.PortRoleRule' + tapi.topology.ProtectionType: + type: string + enum: + - NO_PROTECTON + - ONE_PLUS_ONE_PROTECTION + - ONE_PLUS_ONE_PROTECTION_WITH_DYNAMIC_RESTORATION + - PERMANENT_ONE_PLUS_ONE_PROTECTION + - ONE_FOR_ONE_PROTECTION + - DYNAMIC_RESTORATION + - PRE_COMPUTED_RESTORATION + - ONE_PLUS_ONE_PROTECTION_WITH_PRE_COMPUTED_RESTORATION + tapi.topology.ResilienceType: + type: object + properties: + restoration-policy: + $ref: '#/components/schemas/tapi.topology.RestorationPolicy' + protection-type: + $ref: '#/components/schemas/tapi.topology.ProtectionType' + tapi.topology.ResilienceTypeWrapper: + type: object + properties: + resilience-type: + $ref: '#/components/schemas/tapi.topology.ResilienceType' + tapi.topology.RestorationPolicy: + type: string + enum: + - PER_DOMAIN_RESTORATION + - END_TO_END_RESTORATION + - NA + tapi.topology.RiskCharacteristic: + type: object + properties: + risk-characteristic-name: + type: string + description: "The name of the risk characteristic. The characteristic may\ + \ be related to a specific degree of closeness.\r\n For\ + \ example a particular characteristic may apply to failures that are localized\ + \ (e.g. to one side of a road) where as another characteristic may relate\ + \ to failures that have a broader impact (e.g. both sides of a road that\ + \ crosses a bridge).\r\n Depending upon the importance\ + \ of the traffic being routed different risk characteristics will be evaluated." + risk-identifier-list: + type: array + description: A list of the identifiers of each physical/geographic unit + (with the specific risk characteristic) that is related to a segment of + the TopologicalEntity. + items: + type: string + tapi.topology.RiskCharacteristicWrapper: + type: object + properties: + risk-diversity-characteristic: + $ref: '#/components/schemas/tapi.topology.RiskCharacteristic' + tapi.topology.RiskParameterPac: + type: object + properties: + risk-characteristic: + type: array + description: A list of risk characteristics for consideration in an analysis + of shared risk. Each element of the list represents a specific risk consideration. + items: + $ref: '#/components/schemas/tapi.topology.RiskCharacteristic' + tapi.topology.Rule: + allOf: + - $ref: '#/components/schemas/tapi.common.LocalClass' + - type: object + properties: + complex-rule: + type: array + description: Allows for more complex rules where the basic rule system + is not sufficient. + items: + type: string + rule-type: + $ref: '#/components/schemas/tapi.topology.RuleType' + signal-property: + $ref: '#/components/schemas/tapi.topology.SignalPropertyRule' + connection-spec-reference: + type: array + description: "Identifies the type of connection that the rule applies\ + \ to. \r\n If the attribute is not present then the rule\ + \ applies to all types of connection supported by the device." + items: + $ref: '#/components/schemas/tapi.topology.ConnectionSpecReference' + cep-port-role: + type: array + description: "Indicates the port role to which the rule applies. \r\n\ + \ The port role is interpreted in the context of the\ + \ connection type which is identified by the connection spec. \r\n \ + \ The port role is not meaningful in the absence of a\ + \ connection spec reference.\r\n If a node rule group\ + \ carries a port role, that role applies also to the associated inter\ + \ rule where the combination of the roles in the node rule groups at\ + \ the ends of the inter group rule define the connection orientation.\r\ + \n For example a root-and-leaf connection may be used\ + \ in a node where a node rule group collects one set of NEPs has the\ + \ port role 'root' and another node rule group collects another set\ + \ of NEPs has the port role 'leaf' where these are joined by an inter\ + \ rule group. This combination specifies an allowed orientation of the\ + \ root-and-leaf connection.\r\n No port role statement\ + \ means all port roles are allowed." + items: + $ref: '#/components/schemas/tapi.topology.PortRoleRule' + cep-direction: + type: array + description: "cep direction is a list of port directions that the rule\ + \ applies to.\r\n No entry means all cep directions." + items: + $ref: '#/components/schemas/tapi.common.PortDirection' + override-priority: + type: integer + description: "The overridePriority allows for one rule in a rule group\ + \ to override another.\r\n Priority n rules override\ + \ priority n+1 rules.\r\n Rules of the same priority\ + \ override as follows (n overrides n+1):\r\n 1 - MustNot\r\ + \n 2 - Must\r\n 3 - May\r\n \ + \ 4 - Null\r\n Within a rule the flexibility rules\ + \ (signal, port role...) override as follows (n overriedes n+1):\r\n\ + \ 1 - Any\r\n 2 - Same\r\n \ + \ 3 - Different\r\n Where there are two or more 'Same'\ + \ rules, they will form an intersection where all must be met.\r\n \ + \ " + format: int32 + layer-protocol-qualifier: + type: array + description: "Qualifies a rule for a particular layerProtocol identifying\ + \ the qualifiers that the rule apples to.\r\n If the\ + \ attribute is not present then the rule applies to all relevant qualifiers\ + \ of the layer protocol of the parent entity." + items: + type: string + forwarding-rule: + $ref: '#/components/schemas/tapi.topology.ForwardingRule' + description: "Single complex rule statememt.\r\n A Node with no\ + \ rule group has no restrictions and is essentially May/Any\r\n \ + \ A node rule group constrain the CEP connectability in the Node.\r\n\ + \ A connection from a NEP must abide by all rules that relate\ + \ to that NEP\r\n Rules that are for a particular layerProtocolQualifier,\ + \ connectionSpecReference, cepPortRole and cepDirection combination must\ + \ be abided by in combination as dictated by overridePriority.\r\n \ + \ If a particular\r\n - connectionSpecReference does not\ + \ have any rule statements then it is not supported and connections of that\ + \ type are not possible within the rule group.\r\n - cepPortRole\ + \ of a particular connectionSpecReference does not have any rule statements\ + \ then it is not supported and connections of that connectionSpecReference\ + \ (type) cannot have that cepPortRole for CEPs from NEPs in that rule group.\r\ + \n - cepDirection for a particular connectionSpecReference does\ + \ not have any rule statements then it is not supported and connections\ + \ of that connectionSpecReference (type) cannot have that cepPortDirection\ + \ for CEPs from NEPs in that rule group.\r\n Rules that are for\ + \ different layerProtocolQualifiers or connectionSpecReferences are independent\ + \ and provide options for connection in the rule group.\r\n Some\ + \ rules may apply to multiple connectionSpecReferences and all cepPortRoles\ + \ and all cepDirections." + tapi.topology.RuleType: + type: string + enum: + - FORWARDING + - CAPACITY + - COST + - TIMING + - RISK + - GROUPING + tapi.topology.RuleWrapper: + type: object + properties: + rule: + $ref: '#/components/schemas/tapi.topology.Rule' + tapi.topology.SignalPropertyRule: + type: object + properties: + number-of-signal-values: + type: integer + description: The number of instances of this specific property that can + be supported by the group. + format: int32 + applicable-signal-value: + type: array + description: Specific values of the signal property to which the rule applies. + items: + type: string + signal-property-value-rule: + type: string + description: Indicates how the signal properties should be accounted for. + signal-property-name: + type: string + description: The name of the signal property to which the rule applies. + tapi.topology.SignalPropertyRuleWrapper: + type: object + properties: + signal-property: + $ref: '#/components/schemas/tapi.topology.SignalPropertyRule' + tapi.topology.Topology: + allOf: + - $ref: '#/components/schemas/tapi.common.GlobalClass' + - type: object + properties: + layer-protocol-name: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.common.LayerProtocolName' + link: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.topology.Link' + node: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.topology.Node' + description: "The ForwardingDomain (FD) object class models the ForwardingDomain\ + \ topological component which is used to effect forwarding of transport\ + \ characteristic information and offers the potential to enable forwarding.\ + \ \r\n At the lowest level of recursion, an FD (within a network\ + \ element (NE)) represents a switch matrix (i.e., a fabric). Note that an\ + \ NE can encompass multiple switch matrices (FDs). " + tapi.topology.TopologyContext: + type: object + properties: + nw-topology-service: + $ref: '#/components/schemas/tapi.topology.NetworkTopologyService' + topology: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.topology.Topology' + tapi.topology.TopologyContextWrapper: + type: object + properties: + tapi-topology:topology-context: + $ref: '#/components/schemas/tapi.topology.TopologyContext' + tapi.topology.TopologyRef: + type: object + properties: + topology-uuid: + type: string + description: none + x-path: /tapi-common:context/tapi-topology:topology-context/tapi-topology:topology/tapi-topology:uuid + tapi.topology.TopologyRefWrapper: + type: object + properties: + topology: + $ref: '#/components/schemas/tapi.topology.TopologyRef' + tapi.topology.TopologyWrapper: + type: object + properties: + topology: + $ref: '#/components/schemas/tapi.topology.Topology' + tapi.topology.TransferCostPac: + type: object + properties: + cost-characteristic: + type: array + description: The list of costs where each cost relates to some aspect of + the TopologicalEntity. + items: + $ref: '#/components/schemas/tapi.topology.CostCharacteristic' + tapi.topology.TransferIntegrityPac: + type: object + properties: + error-characteristic: + type: string + description: "Describes the degree to which the signal propagated can be\ + \ errored.\r\n Applies to TDM systems as the errored signal\ + \ will be propagated and not packet as errored packets will be discarded." + unavailable-time-characteristic: + type: string + description: Describes the duration for which there may be no valid signal + propagated. + server-integrity-process-characteristic: + type: string + description: Describes the effect of any server integrity enhancement process + on the characteristics of the TopologicalEntity. + delivery-order-characteristic: + type: string + description: "Describes the degree to which packets will be delivered out\ + \ of sequence.\r\n Does not apply to TDM as the TDM protocols\ + \ maintain strict order." + repeat-delivery-characteristic: + type: string + description: "Primarily applies to packet systems where a packet may be\ + \ delivered more than once (in fault recovery for example).\r\n \ + \ It can also apply to TDM where several frames may be received\ + \ twice due to switching in a system with a large differential propagation\ + \ delay." + loss-characteristic: + type: string + description: "Describes the acceptable characteristic of lost packets where\ + \ loss may result from discard due to errors or overflow.\r\n \ + \ Applies to packet systems and not TDM (as for TDM errored signals\ + \ are propagated unless grossly errored and overflow/underflow turns into\ + \ timing slips)." + tapi.topology.TransferTimingPac: + type: object + properties: + latency-characteristic: + type: array + description: The effect on the latency of a queuing process. This only has + significant effect for packet based systems and has a complex characteristic. + items: + $ref: '#/components/schemas/tapi.topology.LatencyCharacteristic' + tapi.topology.ValidationMechanism: + type: object + properties: + layer-protocol-adjacency-validated: + type: string + description: State of validatiion + validation-mechanism: + type: string + description: Name of mechanism used to validate adjacency + validation-robustness: + type: string + description: Quality of validation (i.e. how likely is the stated validation + to be invalid) + tapi.topology.ValidationMechanismWrapper: + type: object + properties: + validation-mechanism: + $ref: '#/components/schemas/tapi.topology.ValidationMechanism' + tapi.topology.ValidationPac: + type: object + properties: + validation-mechanism: + type: array + description: Provides details of the specific validation mechanism(s) used + to confirm the presence of an intended topologicalEntity. + items: + $ref: '#/components/schemas/tapi.topology.ValidationMechanism' + tapi.topology.getlinkdetails.Input: + type: object + properties: + link-id-or-name: + type: string + description: none + topology-id-or-name: + type: string + description: none + tapi.topology.getlinkdetails.Output: + type: object + properties: + link: + $ref: '#/components/schemas/tapi.topology.Link' + tapi.topology.getnodedetails.Input: + type: object + properties: + node-id-or-name: + type: string + description: none + topology-id-or-name: + type: string + description: none + tapi.topology.getnodedetails.Output: + type: object + properties: + node: + $ref: '#/components/schemas/tapi.topology.Node' + tapi.topology.getnodeedgepointdetails.Input: + type: object + properties: + ep-id-or-name: + type: string + description: none + node-id-or-name: + type: string + description: none + topology-id-or-name: + type: string + description: none + tapi.topology.getnodeedgepointdetails.Output: + type: object + properties: + node-edge-point: + $ref: '#/components/schemas/tapi.topology.NodeEdgePoint' + tapi.topology.gettopologydetails.Input: + type: object + properties: + topology-id-or-name: + type: string + description: none + tapi.topology.gettopologydetails.Output: + type: object + properties: + topology: + $ref: '#/components/schemas/tapi.topology.Topology' + tapi.topology.gettopologylist.Output: + type: object + properties: + topology: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.topology.Topology' + tapi.topology.node.OwnedNodeEdgePoint: + allOf: + - $ref: '#/components/schemas/tapi.connectivity.OwnedNodeEdgePointAugmentation1' + - $ref: '#/components/schemas/tapi.topology.NodeEdgePoint' + tapi.topology.node.OwnedNodeEdgePointWrapper: + type: object + properties: + owned-node-edge-point: + $ref: '#/components/schemas/tapi.topology.node.OwnedNodeEdgePoint' + tapi.topology.topology.Node: + allOf: + - $ref: '#/components/schemas/tapi.common.AdminStatePac' + - $ref: '#/components/schemas/tapi.common.CapacityPac' + - $ref: '#/components/schemas/tapi.common.GlobalClass' + - $ref: '#/components/schemas/tapi.topology.TransferCostPac' + - $ref: '#/components/schemas/tapi.topology.TransferIntegrityPac' + - $ref: '#/components/schemas/tapi.topology.TransferTimingPac' + - type: object + properties: + layer-protocol-name: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.common.LayerProtocolName' + encap-topology: + $ref: '#/components/schemas/tapi.topology.TopologyRef' + owned-node-edge-point: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.topology.node.OwnedNodeEdgePoint' + node-rule-group: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.topology.NodeRuleGroup' + aggregated-node-edge-point: + type: array + description: none + items: + $ref: '#/components/schemas/tapi.topology.NodeEdgePointRef' + description: none + tapi.topology.topology.NodeWrapper: + type: object + properties: + node: + $ref: '#/components/schemas/tapi.topology.topology.Node' + operations_tapicommongetserviceinterfacepointdetails_body: + type: object + properties: + input: + $ref: '#/components/schemas/tapi.common.getserviceinterfacepointdetails.Input' + operations_tapicommonupdateserviceinterfacepoint_body: + type: object + properties: + input: + $ref: '#/components/schemas/tapi.common.updateserviceinterfacepoint.Input' + operations_tapiconnectivitycreateconnectivityservice_body: + type: object + properties: + input: + $ref: '#/components/schemas/tapi.connectivity.createconnectivityservice.Input' + operations_tapiconnectivitydeleteconnectivityservice_body: + type: object + properties: + input: + $ref: '#/components/schemas/tapi.connectivity.deleteconnectivityservice.Input' + operations_tapiconnectivitygetconnectiondetails_body: + type: object + properties: + input: + $ref: '#/components/schemas/tapi.connectivity.getconnectiondetails.Input' + operations_tapiconnectivitygetconnectionendpointdetails_body: + type: object + properties: + input: + $ref: '#/components/schemas/tapi.connectivity.getconnectionendpointdetails.Input' + operations_tapiconnectivitygetconnectivityservicedetails_body: + type: object + properties: + input: + $ref: '#/components/schemas/tapi.connectivity.getconnectivityservicedetails.Input' + operations_tapiconnectivityupdateconnectivityservice_body: + type: object + properties: + input: + $ref: '#/components/schemas/tapi.connectivity.updateconnectivityservice.Input' + operations_tapinotificationcreatenotificationsubscriptionservice_body: + type: object + properties: + input: + $ref: '#/components/schemas/tapi.notification.createnotificationsubscriptionservice.Input' + operations_tapinotificationdeletenotificationsubscriptionservice_body: + type: object + properties: + input: + $ref: '#/components/schemas/tapi.notification.deletenotificationsubscriptionservice.Input' + operations_tapinotificationgetnotificationlist_body: + type: object + properties: + input: + $ref: '#/components/schemas/tapi.notification.getnotificationlist.Input' + operations_tapinotificationgetnotificationsubscriptionservicedetails_body: + type: object + properties: + input: + $ref: '#/components/schemas/tapi.notification.getnotificationsubscriptionservicedetails.Input' + operations_tapinotificationupdatenotificationsubscriptionservice_body: + type: object + properties: + input: + $ref: '#/components/schemas/tapi.notification.updatenotificationsubscriptionservice.Input' + operations_tapipathcomputationcomputep2ppath_body: + type: object + properties: + input: + $ref: '#/components/schemas/tapi.path.computation.computep2ppath.Input' + operations_tapipathcomputationdeletep2ppath_body: + type: object + properties: + input: + $ref: '#/components/schemas/tapi.path.computation.deletep2ppath.Input' + operations_tapipathcomputationoptimizep2ppath_body: + type: object + properties: + input: + $ref: '#/components/schemas/tapi.path.computation.optimizep2ppath.Input' + operations_tapitopologygetlinkdetails_body: + type: object + properties: + input: + $ref: '#/components/schemas/tapi.topology.getlinkdetails.Input' + operations_tapitopologygetnodedetails_body: + type: object + properties: + input: + $ref: '#/components/schemas/tapi.topology.getnodedetails.Input' + operations_tapitopologygetnodeedgepointdetails_body: + type: object + properties: + input: + $ref: '#/components/schemas/tapi.topology.getnodeedgepointdetails.Input' + operations_tapitopologygettopologydetails_body: + type: object + properties: + input: + $ref: '#/components/schemas/tapi.topology.gettopologydetails.Input' +x-original-swagger-version: "2.0" + diff --git a/hackfest/tapi/server/tapi_server/test/__init__.py b/hackfest/tapi/server/tapi_server/test/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4f5c01f4cbde45579c46cc85a60a93d1b9f0f0d3 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/test/__init__.py @@ -0,0 +1,16 @@ +import logging + +import connexion +from flask_testing import TestCase + +from tapi_server.encoder import JSONEncoder + + +class BaseTestCase(TestCase): + + def create_app(self): + logging.getLogger('connexion.operation').setLevel('ERROR') + app = connexion.App(__name__, specification_dir='../swagger/') + app.app.json_encoder = JSONEncoder + app.add_api('swagger.yaml') + return app.app diff --git a/hackfest/tapi/server/tapi_server/test/test_tapi_common_controller.py b/hackfest/tapi/server/tapi_server/test/test_tapi_common_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..2566442c18d6fe2f13a880ef15114bbd9c4388dc --- /dev/null +++ b/hackfest/tapi/server/tapi_server/test/test_tapi_common_controller.py @@ -0,0 +1,420 @@ +# coding: utf-8 + +from __future__ import absolute_import + +from flask import json +from six import BytesIO + +from tapi_server.models.operations_tapicommongetserviceinterfacepointdetails_body import OperationsTapicommongetserviceinterfacepointdetailsBody # noqa: E501 +from tapi_server.models.operations_tapicommonupdateserviceinterfacepoint_body import OperationsTapicommonupdateserviceinterfacepointBody # noqa: E501 +from tapi_server.models.tapi_common_bandwidth_profile_wrapper import TapiCommonBandwidthProfileWrapper # noqa: E501 +from tapi_server.models.tapi_common_capacity_value_wrapper import TapiCommonCapacityValueWrapper # noqa: E501 +from tapi_server.models.tapi_common_capacity_wrapper import TapiCommonCapacityWrapper # noqa: E501 +from tapi_server.models.tapi_common_context_wrapper import TapiCommonContextWrapper # noqa: E501 +from tapi_server.models.tapi_common_get_service_interface_point_details import TapiCommonGetServiceInterfacePointDetails # noqa: E501 +from tapi_server.models.tapi_common_get_service_interface_point_list import TapiCommonGetServiceInterfacePointList # noqa: E501 +from tapi_server.models.tapi_common_name_and_value_wrapper import TapiCommonNameAndValueWrapper # noqa: E501 +from tapi_server.models.tapi_common_service_interface_point_wrapper import TapiCommonServiceInterfacePointWrapper # noqa: E501 +from tapi_server.test import BaseTestCase + + +class TestTapiCommonController(BaseTestCase): + """TapiCommonController integration test stubs""" + + def test_data_tapi_commoncontext_delete(self): + """Test case for data_tapi_commoncontext_delete + + removes tapi.common.Context + """ + response = self.client.open( + '/data/tapi-common:context/', + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_get(self): + """Test case for data_tapi_commoncontext_get + + returns tapi.common.Context + """ + response = self.client.open( + '/data/tapi-common:context/', + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_name_post(self): + """Test case for data_tapi_commoncontext_name_post + + creates tapi.common.NameAndValue + """ + body = TapiCommonNameAndValueWrapper() + response = self.client.open( + '/data/tapi-common:context/name/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_namevalue_name_delete(self): + """Test case for data_tapi_commoncontext_namevalue_name_delete + + removes tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/name={value-name}/'.format(value_name='value_name_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/name={value-name}/'.format(value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_namevalue_name_put(self): + """Test case for data_tapi_commoncontext_namevalue_name_put + + creates or updates tapi.common.NameAndValue + """ + body = TapiCommonNameAndValueWrapper() + response = self.client.open( + '/data/tapi-common:context/name={value-name}/'.format(value_name='value_name_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_post(self): + """Test case for data_tapi_commoncontext_post + + creates tapi.common.Context + """ + body = TapiCommonContextWrapper() + response = self.client.open( + '/data/tapi-common:context/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_put(self): + """Test case for data_tapi_commoncontext_put + + creates or updates tapi.common.Context + """ + body = TapiCommonContextWrapper() + response = self.client.open( + '/data/tapi-common:context/', + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_service_interface_point_post(self): + """Test case for data_tapi_commoncontext_service_interface_point_post + + creates tapi.common.ServiceInterfacePoint + """ + body = TapiCommonServiceInterfacePointWrapper() + response = self.client.open( + '/data/tapi-common:context/service-interface-point/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_service_interface_pointuuid_available_capacity_bandwidth_profile_committed_burst_size_get(self): + """Test case for data_tapi_commoncontext_service_interface_pointuuid_available_capacity_bandwidth_profile_committed_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/service-interface-point={uuid}/available-capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_service_interface_pointuuid_available_capacity_bandwidth_profile_committed_information_rate_get(self): + """Test case for data_tapi_commoncontext_service_interface_pointuuid_available_capacity_bandwidth_profile_committed_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/service-interface-point={uuid}/available-capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_service_interface_pointuuid_available_capacity_bandwidth_profile_get(self): + """Test case for data_tapi_commoncontext_service_interface_pointuuid_available_capacity_bandwidth_profile_get + + returns tapi.common.BandwidthProfile + """ + response = self.client.open( + '/data/tapi-common:context/service-interface-point={uuid}/available-capacity/bandwidth-profile/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_service_interface_pointuuid_available_capacity_bandwidth_profile_peak_burst_size_get(self): + """Test case for data_tapi_commoncontext_service_interface_pointuuid_available_capacity_bandwidth_profile_peak_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/service-interface-point={uuid}/available-capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_service_interface_pointuuid_available_capacity_bandwidth_profile_peak_information_rate_get(self): + """Test case for data_tapi_commoncontext_service_interface_pointuuid_available_capacity_bandwidth_profile_peak_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/service-interface-point={uuid}/available-capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_service_interface_pointuuid_available_capacity_get(self): + """Test case for data_tapi_commoncontext_service_interface_pointuuid_available_capacity_get + + returns tapi.common.Capacity + """ + response = self.client.open( + '/data/tapi-common:context/service-interface-point={uuid}/available-capacity/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_service_interface_pointuuid_available_capacity_total_size_get(self): + """Test case for data_tapi_commoncontext_service_interface_pointuuid_available_capacity_total_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/service-interface-point={uuid}/available-capacity/total-size/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_service_interface_pointuuid_delete(self): + """Test case for data_tapi_commoncontext_service_interface_pointuuid_delete + + removes tapi.common.ServiceInterfacePoint + """ + response = self.client.open( + '/data/tapi-common:context/service-interface-point={uuid}/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_service_interface_pointuuid_get(self): + """Test case for data_tapi_commoncontext_service_interface_pointuuid_get + + returns tapi.common.ServiceInterfacePoint + """ + response = self.client.open( + '/data/tapi-common:context/service-interface-point={uuid}/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_service_interface_pointuuid_name_post(self): + """Test case for data_tapi_commoncontext_service_interface_pointuuid_name_post + + creates tapi.common.NameAndValue + """ + body = TapiCommonNameAndValueWrapper() + response = self.client.open( + '/data/tapi-common:context/service-interface-point={uuid}/name/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_service_interface_pointuuid_namevalue_name_delete(self): + """Test case for data_tapi_commoncontext_service_interface_pointuuid_namevalue_name_delete + + removes tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/service-interface-point={uuid}/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_service_interface_pointuuid_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_service_interface_pointuuid_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/service-interface-point={uuid}/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_service_interface_pointuuid_namevalue_name_put(self): + """Test case for data_tapi_commoncontext_service_interface_pointuuid_namevalue_name_put + + creates or updates tapi.common.NameAndValue + """ + body = TapiCommonNameAndValueWrapper() + response = self.client.open( + '/data/tapi-common:context/service-interface-point={uuid}/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_service_interface_pointuuid_put(self): + """Test case for data_tapi_commoncontext_service_interface_pointuuid_put + + creates or updates tapi.common.ServiceInterfacePoint + """ + body = TapiCommonServiceInterfacePointWrapper() + response = self.client.open( + '/data/tapi-common:context/service-interface-point={uuid}/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get(self): + """Test case for data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/service-interface-point={uuid}/total-potential-capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get(self): + """Test case for data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/service-interface-point={uuid}/total-potential-capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_bandwidth_profile_get(self): + """Test case for data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_bandwidth_profile_get + + returns tapi.common.BandwidthProfile + """ + response = self.client.open( + '/data/tapi-common:context/service-interface-point={uuid}/total-potential-capacity/bandwidth-profile/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get(self): + """Test case for data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/service-interface-point={uuid}/total-potential-capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get(self): + """Test case for data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/service-interface-point={uuid}/total-potential-capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_get(self): + """Test case for data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_get + + returns tapi.common.Capacity + """ + response = self.client.open( + '/data/tapi-common:context/service-interface-point={uuid}/total-potential-capacity/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_total_size_get(self): + """Test case for data_tapi_commoncontext_service_interface_pointuuid_total_potential_capacity_total_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/service-interface-point={uuid}/total-potential-capacity/total-size/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_commonget_service_interface_point_details_post(self): + """Test case for operations_tapi_commonget_service_interface_point_details_post + + operates on tapi.common.GetServiceInterfacePointDetails + """ + body = OperationsTapicommongetserviceinterfacepointdetailsBody() + response = self.client.open( + '/operations/tapi-common:get-service-interface-point-details/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_commonget_service_interface_point_list_post(self): + """Test case for operations_tapi_commonget_service_interface_point_list_post + + + """ + response = self.client.open( + '/operations/tapi-common:get-service-interface-point-list/', + method='POST') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_commonupdate_service_interface_point_post(self): + """Test case for operations_tapi_commonupdate_service_interface_point_post + + operates on tapi.common.UpdateServiceInterfacePoint + """ + body = OperationsTapicommonupdateserviceinterfacepointBody() + response = self.client.open( + '/operations/tapi-common:update-service-interface-point/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + +if __name__ == '__main__': + import unittest + unittest.main() diff --git a/hackfest/tapi/server/tapi_server/test/test_tapi_connectivity_controller.py b/hackfest/tapi/server/tapi_server/test/test_tapi_connectivity_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..4e909a16114fa0d4373265273230427352afbd97 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/test/test_tapi_connectivity_controller.py @@ -0,0 +1,2124 @@ +# coding: utf-8 + +from __future__ import absolute_import + +from flask import json +from six import BytesIO + +from tapi_server.models.operations_tapiconnectivitycreateconnectivityservice_body import OperationsTapiconnectivitycreateconnectivityserviceBody # noqa: E501 +from tapi_server.models.operations_tapiconnectivitydeleteconnectivityservice_body import OperationsTapiconnectivitydeleteconnectivityserviceBody # noqa: E501 +from tapi_server.models.operations_tapiconnectivitygetconnectiondetails_body import OperationsTapiconnectivitygetconnectiondetailsBody # noqa: E501 +from tapi_server.models.operations_tapiconnectivitygetconnectionendpointdetails_body import OperationsTapiconnectivitygetconnectionendpointdetailsBody # noqa: E501 +from tapi_server.models.operations_tapiconnectivitygetconnectivityservicedetails_body import OperationsTapiconnectivitygetconnectivityservicedetailsBody # noqa: E501 +from tapi_server.models.operations_tapiconnectivityupdateconnectivityservice_body import OperationsTapiconnectivityupdateconnectivityserviceBody # noqa: E501 +from tapi_server.models.tapi_common_bandwidth_profile_wrapper import TapiCommonBandwidthProfileWrapper # noqa: E501 +from tapi_server.models.tapi_common_capacity_value_wrapper import TapiCommonCapacityValueWrapper # noqa: E501 +from tapi_server.models.tapi_common_capacity_wrapper import TapiCommonCapacityWrapper # noqa: E501 +from tapi_server.models.tapi_common_name_and_value_wrapper import TapiCommonNameAndValueWrapper # noqa: E501 +from tapi_server.models.tapi_common_service_interface_point_ref_wrapper import TapiCommonServiceInterfacePointRefWrapper # noqa: E501 +from tapi_server.models.tapi_common_time_range_wrapper import TapiCommonTimeRangeWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_cep_list_wrapper import TapiConnectivityCepListWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_cep_role_wrapper import TapiConnectivityCepRoleWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_connection_end_point_ref_wrapper import TapiConnectivityConnectionEndPointRefWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_connection_end_point_wrapper import TapiConnectivityConnectionEndPointWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_connection_ref_wrapper import TapiConnectivityConnectionRefWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_connection_spec_reference_wrapper import TapiConnectivityConnectionSpecReferenceWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_connection_wrapper import TapiConnectivityConnectionWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_connectivity_context_wrapper import TapiConnectivityConnectivityContextWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_connectivity_service_end_point_ref_wrapper import TapiConnectivityConnectivityServiceEndPointRefWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_connectivity_service_end_point_wrapper import TapiConnectivityConnectivityServiceEndPointWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_connectivity_service_ref_wrapper import TapiConnectivityConnectivityServiceRefWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_connectivity_service_wrapper import TapiConnectivityConnectivityServiceWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_create_connectivity_service import TapiConnectivityCreateConnectivityService # noqa: E501 +from tapi_server.models.tapi_connectivity_get_connection_details import TapiConnectivityGetConnectionDetails # noqa: E501 +from tapi_server.models.tapi_connectivity_get_connection_end_point_details import TapiConnectivityGetConnectionEndPointDetails # noqa: E501 +from tapi_server.models.tapi_connectivity_get_connectivity_service_details import TapiConnectivityGetConnectivityServiceDetails # noqa: E501 +from tapi_server.models.tapi_connectivity_get_connectivity_service_list import TapiConnectivityGetConnectivityServiceList # noqa: E501 +from tapi_server.models.tapi_connectivity_resilience_route_wrapper import TapiConnectivityResilienceRouteWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_route_ref_wrapper import TapiConnectivityRouteRefWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_route_wrapper import TapiConnectivityRouteWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_switch_control_ref_wrapper import TapiConnectivitySwitchControlRefWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_switch_control_wrapper import TapiConnectivitySwitchControlWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_switch_wrapper import TapiConnectivitySwitchWrapper # noqa: E501 +from tapi_server.models.tapi_connectivity_update_connectivity_service import TapiConnectivityUpdateConnectivityService # noqa: E501 +from tapi_server.models.tapi_path_computation_value_or_priority_wrapper import TapiPathComputationValueOrPriorityWrapper # noqa: E501 +from tapi_server.models.tapi_topology_cost_characteristic_wrapper import TapiTopologyCostCharacteristicWrapper # noqa: E501 +from tapi_server.models.tapi_topology_latency_characteristic_wrapper import TapiTopologyLatencyCharacteristicWrapper # noqa: E501 +from tapi_server.models.tapi_topology_link_ref_wrapper import TapiTopologyLinkRefWrapper # noqa: E501 +from tapi_server.models.tapi_topology_node_edge_point_ref_wrapper import TapiTopologyNodeEdgePointRefWrapper # noqa: E501 +from tapi_server.models.tapi_topology_resilience_type_wrapper import TapiTopologyResilienceTypeWrapper # noqa: E501 +from tapi_server.models.tapi_topology_risk_characteristic_wrapper import TapiTopologyRiskCharacteristicWrapper # noqa: E501 +from tapi_server.test import BaseTestCase + + +class TestTapiConnectivityController(BaseTestCase): + """TapiConnectivityController integration test stubs""" + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_connection_end_pointtopology_uuidnode_uuidnode_edge_point_uuidconnection_end_point_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_connection_end_pointtopology_uuidnode_uuidnode_edge_point_uuidconnection_end_point_uuid_get + + returns tapi.connectivity.ConnectionEndPointRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/connection-end-point={topology-uuid},{node-uuid},{node-edge-point-uuid},{connection-end-point-uuid}/'.format(uuid='uuid_example', topology_uuid='topology_uuid_example', node_uuid='node_uuid_example', node_edge_point_uuid='node_edge_point_uuid_example', connection_end_point_uuid='connection_end_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_connection_spec_reference_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_connection_spec_reference_get + + returns tapi.connectivity.ConnectionSpecReference + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/connection-spec-reference/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_get + + returns tapi.connectivity.Connection + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_lower_connectionconnection_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_lower_connectionconnection_uuid_get + + returns tapi.connectivity.ConnectionRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/lower-connection={connection-uuid}/'.format(uuid='uuid_example', connection_uuid='connection_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_routelocal_id_connection_end_pointtopology_uuidnode_uuidnode_edge_point_uuidconnection_end_point_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_routelocal_id_connection_end_pointtopology_uuidnode_uuidnode_edge_point_uuidconnection_end_point_uuid_get + + returns tapi.connectivity.ConnectionEndPointRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/route={local-id}/connection-end-point={topology-uuid},{node-uuid},{node-edge-point-uuid},{connection-end-point-uuid}/'.format(uuid='uuid_example', local_id='local_id_example', topology_uuid='topology_uuid_example', node_uuid='node_uuid_example', node_edge_point_uuid='node_edge_point_uuid_example', connection_end_point_uuid='connection_end_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_routelocal_id_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_routelocal_id_get + + returns tapi.connectivity.Route + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/route={local-id}/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_routelocal_id_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_routelocal_id_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/route={local-id}/name={value-name}/'.format(uuid='uuid_example', local_id='local_id_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_routelocal_id_resilience_route_pac_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_routelocal_id_resilience_route_pac_get + + returns tapi.connectivity.ResilienceRoute + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/route={local-id}/resilience-route-pac/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_routelocal_id_resilience_route_pac_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_routelocal_id_resilience_route_pac_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/route={local-id}/resilience-route-pac/name={value-name}/'.format(uuid='uuid_example', local_id='local_id_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_supported_client_linktopology_uuidlink_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_supported_client_linktopology_uuidlink_uuid_get + + returns tapi.topology.LinkRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/supported-client-link={topology-uuid},{link-uuid}/'.format(uuid='uuid_example', topology_uuid='topology_uuid_example', link_uuid='link_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_get + + returns tapi.connectivity.SwitchControl + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/'.format(uuid='uuid_example', switch_control_uuid='switch_control_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/name={value-name}/'.format(uuid='uuid_example', switch_control_uuid='switch_control_uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_resilience_type_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_resilience_type_get + + returns tapi.topology.ResilienceType + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/resilience-type/'.format(uuid='uuid_example', switch_control_uuid='switch_control_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_sub_switch_controlconnection_uuidsub_switch_control_switch_control_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_sub_switch_controlconnection_uuidsub_switch_control_switch_control_uuid_get + + returns tapi.connectivity.SwitchControlRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/sub-switch-control={connection-uuid},{sub-switch-control-switch-control-uuid}/'.format(uuid='uuid_example', switch_control_uuid='switch_control_uuid_example', connection_uuid='connection_uuid_example', sub_switch_control_switch_control_uuid='sub_switch_control_switch_control_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_switchlocal_id_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_switchlocal_id_get + + returns tapi.connectivity.Switch + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/switch={local-id}/'.format(uuid='uuid_example', switch_control_uuid='switch_control_uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_switchlocal_id_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_switchlocal_id_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/switch={local-id}/name={value-name}/'.format(uuid='uuid_example', switch_control_uuid='switch_control_uuid_example', local_id='local_id_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_switchlocal_id_selected_connection_end_pointtopology_uuidnode_uuidnode_edge_point_uuidconnection_end_point_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_switchlocal_id_selected_connection_end_pointtopology_uuidnode_uuidnode_edge_point_uuidconnection_end_point_uuid_get + + returns tapi.connectivity.ConnectionEndPointRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/switch={local-id}/selected-connection-end-point={topology-uuid},{node-uuid},{node-edge-point-uuid},{connection-end-point-uuid}/'.format(uuid='uuid_example', switch_control_uuid='switch_control_uuid_example', local_id='local_id_example', topology_uuid='topology_uuid_example', node_uuid='node_uuid_example', node_edge_point_uuid='node_edge_point_uuid_example', connection_end_point_uuid='connection_end_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_switchlocal_id_selected_routeconnection_uuidroute_local_id_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectionuuid_switch_controlswitch_control_uuid_switchlocal_id_selected_routeconnection_uuidroute_local_id_get + + returns tapi.connectivity.RouteRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/switch={local-id}/selected-route={connection-uuid},{route-local-id}/'.format(uuid='uuid_example', switch_control_uuid='switch_control_uuid_example', local_id='local_id_example', connection_uuid='connection_uuid_example', route_local_id='route_local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_service_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_service_post + + creates tapi.connectivity.ConnectivityService + """ + body = TapiConnectivityConnectivityServiceWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_connectionconnection_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_connectionconnection_uuid_get + + returns tapi.connectivity.ConnectionRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/connection={connection-uuid}/'.format(uuid='uuid_example', connection_uuid='connection_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_coroute_inclusion_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_coroute_inclusion_delete + + removes tapi.connectivity.ConnectivityServiceRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/coroute-inclusion/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_coroute_inclusion_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_coroute_inclusion_get + + returns tapi.connectivity.ConnectivityServiceRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/coroute-inclusion/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_coroute_inclusion_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_coroute_inclusion_post + + creates tapi.connectivity.ConnectivityServiceRef + """ + body = TapiConnectivityConnectivityServiceRefWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/coroute-inclusion/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_coroute_inclusion_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_coroute_inclusion_put + + creates or updates tapi.connectivity.ConnectivityServiceRef + """ + body = TapiConnectivityConnectivityServiceRefWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/coroute-inclusion/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_cost_characteristic_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_cost_characteristic_post + + creates tapi.topology.CostCharacteristic + """ + body = TapiTopologyCostCharacteristicWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/cost-characteristic/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_cost_characteristiccost_name_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_cost_characteristiccost_name_delete + + removes tapi.topology.CostCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/cost-characteristic={cost-name}/'.format(uuid='uuid_example', cost_name='cost_name_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_cost_characteristiccost_name_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_cost_characteristiccost_name_get + + returns tapi.topology.CostCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/cost-characteristic={cost-name}/'.format(uuid='uuid_example', cost_name='cost_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_cost_characteristiccost_name_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_cost_characteristiccost_name_put + + creates or updates tapi.topology.CostCharacteristic + """ + body = TapiTopologyCostCharacteristicWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/cost-characteristic={cost-name}/'.format(uuid='uuid_example', cost_name='cost_name_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_delete + + removes tapi.connectivity.ConnectivityService + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_diversity_exclusion_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_diversity_exclusion_post + + creates tapi.connectivity.ConnectivityServiceRef + """ + body = TapiConnectivityConnectivityServiceRefWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/diversity-exclusion/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_diversity_exclusionconnectivity_service_uuid_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_diversity_exclusionconnectivity_service_uuid_delete + + removes tapi.connectivity.ConnectivityServiceRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/diversity-exclusion={connectivity-service-uuid}/'.format(uuid='uuid_example', connectivity_service_uuid='connectivity_service_uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_diversity_exclusionconnectivity_service_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_diversity_exclusionconnectivity_service_uuid_get + + returns tapi.connectivity.ConnectivityServiceRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/diversity-exclusion={connectivity-service-uuid}/'.format(uuid='uuid_example', connectivity_service_uuid='connectivity_service_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_diversity_exclusionconnectivity_service_uuid_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_diversity_exclusionconnectivity_service_uuid_put + + creates or updates tapi.connectivity.ConnectivityServiceRef + """ + body = TapiConnectivityConnectivityServiceRefWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/diversity-exclusion={connectivity-service-uuid}/'.format(uuid='uuid_example', connectivity_service_uuid='connectivity_service_uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_point_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_point_post + + creates tapi.connectivity.ConnectivityServiceEndPoint + """ + body = TapiConnectivityConnectivityServiceEndPointWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_delete + + removes tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_post + + creates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_put + + creates or updates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_delete + + removes tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example', local_id='local_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_post + + creates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example', local_id='local_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_put + + creates or updates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example', local_id='local_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_delete + + removes tapi.common.BandwidthProfile + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/'.format(uuid='uuid_example', local_id='local_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_get + + returns tapi.common.BandwidthProfile + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_delete + + removes tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_post + + creates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_put + + creates or updates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_delete + + removes tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example', local_id='local_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_post + + creates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example', local_id='local_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_put + + creates or updates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example', local_id='local_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_post + + creates tapi.common.BandwidthProfile + """ + body = TapiCommonBandwidthProfileWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/'.format(uuid='uuid_example', local_id='local_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_put + + creates or updates tapi.common.BandwidthProfile + """ + body = TapiCommonBandwidthProfileWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/'.format(uuid='uuid_example', local_id='local_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_delete + + removes tapi.common.Capacity + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/'.format(uuid='uuid_example', local_id='local_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_get + + returns tapi.common.Capacity + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_post + + creates tapi.common.Capacity + """ + body = TapiCommonCapacityWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/'.format(uuid='uuid_example', local_id='local_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_put + + creates or updates tapi.common.Capacity + """ + body = TapiCommonCapacityWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/'.format(uuid='uuid_example', local_id='local_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_total_size_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_total_size_delete + + removes tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/total-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_total_size_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_total_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/total-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_total_size_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_total_size_post + + creates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/total-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_total_size_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_total_size_put + + creates or updates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/total-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_connection_end_pointtopology_uuidnode_uuidnode_edge_point_uuidconnection_end_point_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_connection_end_pointtopology_uuidnode_uuidnode_edge_point_uuidconnection_end_point_uuid_get + + returns tapi.connectivity.ConnectionEndPointRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/connection-end-point={topology-uuid},{node-uuid},{node-edge-point-uuid},{connection-end-point-uuid}/'.format(uuid='uuid_example', local_id='local_id_example', topology_uuid='topology_uuid_example', node_uuid='node_uuid_example', node_edge_point_uuid='node_edge_point_uuid_example', connection_end_point_uuid='connection_end_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_delete + + removes tapi.connectivity.ConnectivityServiceEndPoint + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/'.format(uuid='uuid_example', local_id='local_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_get + + returns tapi.connectivity.ConnectivityServiceEndPoint + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_name_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_name_post + + creates tapi.common.NameAndValue + """ + body = TapiCommonNameAndValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/name/'.format(uuid='uuid_example', local_id='local_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_namevalue_name_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_namevalue_name_delete + + removes tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/name={value-name}/'.format(uuid='uuid_example', local_id='local_id_example', value_name='value_name_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/name={value-name}/'.format(uuid='uuid_example', local_id='local_id_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_namevalue_name_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_namevalue_name_put + + creates or updates tapi.common.NameAndValue + """ + body = TapiCommonNameAndValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/name={value-name}/'.format(uuid='uuid_example', local_id='local_id_example', value_name='value_name_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_peer_fwd_connectivity_service_end_point_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_peer_fwd_connectivity_service_end_point_delete + + removes tapi.connectivity.ConnectivityServiceEndPointRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/peer-fwd-connectivity-service-end-point/'.format(uuid='uuid_example', local_id='local_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_peer_fwd_connectivity_service_end_point_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_peer_fwd_connectivity_service_end_point_get + + returns tapi.connectivity.ConnectivityServiceEndPointRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/peer-fwd-connectivity-service-end-point/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_peer_fwd_connectivity_service_end_point_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_peer_fwd_connectivity_service_end_point_post + + creates tapi.connectivity.ConnectivityServiceEndPointRef + """ + body = TapiConnectivityConnectivityServiceEndPointRefWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/peer-fwd-connectivity-service-end-point/'.format(uuid='uuid_example', local_id='local_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_peer_fwd_connectivity_service_end_point_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_peer_fwd_connectivity_service_end_point_put + + creates or updates tapi.connectivity.ConnectivityServiceEndPointRef + """ + body = TapiConnectivityConnectivityServiceEndPointRefWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/peer-fwd-connectivity-service-end-point/'.format(uuid='uuid_example', local_id='local_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_protecting_connectivity_service_end_point_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_protecting_connectivity_service_end_point_delete + + removes tapi.connectivity.ConnectivityServiceEndPointRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/protecting-connectivity-service-end-point/'.format(uuid='uuid_example', local_id='local_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_protecting_connectivity_service_end_point_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_protecting_connectivity_service_end_point_get + + returns tapi.connectivity.ConnectivityServiceEndPointRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/protecting-connectivity-service-end-point/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_protecting_connectivity_service_end_point_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_protecting_connectivity_service_end_point_post + + creates tapi.connectivity.ConnectivityServiceEndPointRef + """ + body = TapiConnectivityConnectivityServiceEndPointRefWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/protecting-connectivity-service-end-point/'.format(uuid='uuid_example', local_id='local_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_protecting_connectivity_service_end_point_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_protecting_connectivity_service_end_point_put + + creates or updates tapi.connectivity.ConnectivityServiceEndPointRef + """ + body = TapiConnectivityConnectivityServiceEndPointRefWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/protecting-connectivity-service-end-point/'.format(uuid='uuid_example', local_id='local_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_put + + creates or updates tapi.connectivity.ConnectivityServiceEndPoint + """ + body = TapiConnectivityConnectivityServiceEndPointWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/'.format(uuid='uuid_example', local_id='local_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_server_connectivity_service_end_point_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_server_connectivity_service_end_point_delete + + removes tapi.connectivity.ConnectivityServiceEndPointRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/server-connectivity-service-end-point/'.format(uuid='uuid_example', local_id='local_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_server_connectivity_service_end_point_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_server_connectivity_service_end_point_get + + returns tapi.connectivity.ConnectivityServiceEndPointRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/server-connectivity-service-end-point/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_server_connectivity_service_end_point_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_server_connectivity_service_end_point_post + + creates tapi.connectivity.ConnectivityServiceEndPointRef + """ + body = TapiConnectivityConnectivityServiceEndPointRefWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/server-connectivity-service-end-point/'.format(uuid='uuid_example', local_id='local_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_server_connectivity_service_end_point_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_server_connectivity_service_end_point_put + + creates or updates tapi.connectivity.ConnectivityServiceEndPointRef + """ + body = TapiConnectivityConnectivityServiceEndPointRefWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/server-connectivity-service-end-point/'.format(uuid='uuid_example', local_id='local_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_service_interface_point_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_service_interface_point_delete + + removes tapi.common.ServiceInterfacePointRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/service-interface-point/'.format(uuid='uuid_example', local_id='local_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_service_interface_point_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_service_interface_point_get + + returns tapi.common.ServiceInterfacePointRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/service-interface-point/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_service_interface_point_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_service_interface_point_post + + creates tapi.common.ServiceInterfacePointRef + """ + body = TapiCommonServiceInterfacePointRefWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/service-interface-point/'.format(uuid='uuid_example', local_id='local_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_service_interface_point_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_end_pointlocal_id_service_interface_point_put + + creates or updates tapi.common.ServiceInterfacePointRef + """ + body = TapiCommonServiceInterfacePointRefWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/service-interface-point/'.format(uuid='uuid_example', local_id='local_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_get + + returns tapi.connectivity.ConnectivityService + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_latency_characteristic_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_latency_characteristic_post + + creates tapi.topology.LatencyCharacteristic + """ + body = TapiTopologyLatencyCharacteristicWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/latency-characteristic/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_latency_characteristictraffic_property_name_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_latency_characteristictraffic_property_name_delete + + removes tapi.topology.LatencyCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/latency-characteristic={traffic-property-name}/'.format(uuid='uuid_example', traffic_property_name='traffic_property_name_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_latency_characteristictraffic_property_name_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_latency_characteristictraffic_property_name_get + + returns tapi.topology.LatencyCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/latency-characteristic={traffic-property-name}/'.format(uuid='uuid_example', traffic_property_name='traffic_property_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_latency_characteristictraffic_property_name_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_latency_characteristictraffic_property_name_put + + creates or updates tapi.topology.LatencyCharacteristic + """ + body = TapiTopologyLatencyCharacteristicWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/latency-characteristic={traffic-property-name}/'.format(uuid='uuid_example', traffic_property_name='traffic_property_name_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_cost_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_cost_delete + + removes tapi.path.computation.ValueOrPriority + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/max-allowed-cost/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_cost_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_cost_get + + returns tapi.path.computation.ValueOrPriority + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/max-allowed-cost/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_cost_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_cost_post + + creates tapi.path.computation.ValueOrPriority + """ + body = TapiPathComputationValueOrPriorityWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/max-allowed-cost/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_cost_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_cost_put + + creates or updates tapi.path.computation.ValueOrPriority + """ + body = TapiPathComputationValueOrPriorityWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/max-allowed-cost/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_delay_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_delay_delete + + removes tapi.path.computation.ValueOrPriority + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/max-allowed-delay/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_delay_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_delay_get + + returns tapi.path.computation.ValueOrPriority + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/max-allowed-delay/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_delay_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_delay_post + + creates tapi.path.computation.ValueOrPriority + """ + body = TapiPathComputationValueOrPriorityWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/max-allowed-delay/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_delay_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_delay_put + + creates or updates tapi.path.computation.ValueOrPriority + """ + body = TapiPathComputationValueOrPriorityWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/max-allowed-delay/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_hops_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_hops_delete + + removes tapi.path.computation.ValueOrPriority + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/max-allowed-hops/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_hops_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_hops_get + + returns tapi.path.computation.ValueOrPriority + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/max-allowed-hops/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_hops_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_hops_post + + creates tapi.path.computation.ValueOrPriority + """ + body = TapiPathComputationValueOrPriorityWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/max-allowed-hops/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_hops_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_max_allowed_hops_put + + creates or updates tapi.path.computation.ValueOrPriority + """ + body = TapiPathComputationValueOrPriorityWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/max-allowed-hops/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_name_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_name_post + + creates tapi.common.NameAndValue + """ + body = TapiCommonNameAndValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/name/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_namevalue_name_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_namevalue_name_delete + + removes tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_namevalue_name_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_namevalue_name_put + + creates or updates tapi.common.NameAndValue + """ + body = TapiCommonNameAndValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_put + + creates or updates tapi.connectivity.ConnectivityService + """ + body = TapiConnectivityConnectivityServiceWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_burst_size_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_burst_size_delete + + removes tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_burst_size_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_burst_size_post + + creates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_burst_size_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_burst_size_put + + creates or updates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_information_rate_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_information_rate_delete + + removes tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_information_rate_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_information_rate_post + + creates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_information_rate_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_committed_information_rate_put + + creates or updates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_delete + + removes tapi.common.BandwidthProfile + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_get + + returns tapi.common.BandwidthProfile + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_burst_size_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_burst_size_delete + + removes tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_burst_size_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_burst_size_post + + creates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_burst_size_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_burst_size_put + + creates or updates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_information_rate_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_information_rate_delete + + removes tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_information_rate_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_information_rate_post + + creates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_information_rate_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_peak_information_rate_put + + creates or updates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_post + + creates tapi.common.BandwidthProfile + """ + body = TapiCommonBandwidthProfileWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_bandwidth_profile_put + + creates or updates tapi.common.BandwidthProfile + """ + body = TapiCommonBandwidthProfileWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_delete + + removes tapi.common.Capacity + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_get + + returns tapi.common.Capacity + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_post + + creates tapi.common.Capacity + """ + body = TapiCommonCapacityWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_put + + creates or updates tapi.common.Capacity + """ + body = TapiCommonCapacityWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_total_size_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_total_size_delete + + removes tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/total-size/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_total_size_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_total_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/total-size/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_total_size_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_total_size_post + + creates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/total-size/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_total_size_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_requested_capacity_total_size_put + + creates or updates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/total-size/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_resilience_type_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_resilience_type_delete + + removes tapi.topology.ResilienceType + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/resilience-type/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_resilience_type_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_resilience_type_get + + returns tapi.topology.ResilienceType + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/resilience-type/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_resilience_type_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_resilience_type_post + + creates tapi.topology.ResilienceType + """ + body = TapiTopologyResilienceTypeWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/resilience-type/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_resilience_type_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_resilience_type_put + + creates or updates tapi.topology.ResilienceType + """ + body = TapiTopologyResilienceTypeWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/resilience-type/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_risk_diversity_characteristic_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_risk_diversity_characteristic_post + + creates tapi.topology.RiskCharacteristic + """ + body = TapiTopologyRiskCharacteristicWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/risk-diversity-characteristic/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_risk_diversity_characteristicrisk_characteristic_name_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_risk_diversity_characteristicrisk_characteristic_name_delete + + removes tapi.topology.RiskCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/risk-diversity-characteristic={risk-characteristic-name}/'.format(uuid='uuid_example', risk_characteristic_name='risk_characteristic_name_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_risk_diversity_characteristicrisk_characteristic_name_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_risk_diversity_characteristicrisk_characteristic_name_get + + returns tapi.topology.RiskCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/risk-diversity-characteristic={risk-characteristic-name}/'.format(uuid='uuid_example', risk_characteristic_name='risk_characteristic_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_risk_diversity_characteristicrisk_characteristic_name_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_risk_diversity_characteristicrisk_characteristic_name_put + + creates or updates tapi.topology.RiskCharacteristic + """ + body = TapiTopologyRiskCharacteristicWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/risk-diversity-characteristic={risk-characteristic-name}/'.format(uuid='uuid_example', risk_characteristic_name='risk_characteristic_name_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_schedule_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_schedule_delete + + removes tapi.common.TimeRange + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/schedule/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_schedule_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_schedule_get + + returns tapi.common.TimeRange + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/schedule/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_schedule_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_schedule_post + + creates tapi.common.TimeRange + """ + body = TapiCommonTimeRangeWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/schedule/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_schedule_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_connectivity_serviceuuid_schedule_put + + creates or updates tapi.common.TimeRange + """ + body = TapiCommonTimeRangeWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/schedule/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_delete(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_delete + + removes tapi.connectivity.ConnectivityContext + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/', + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_get(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_get + + returns tapi.connectivity.ConnectivityContext + """ + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/', + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_post(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_post + + creates tapi.connectivity.ConnectivityContext + """ + body = TapiConnectivityConnectivityContextWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_connectivityconnectivity_context_put(self): + """Test case for data_tapi_commoncontext_tapi_connectivityconnectivity_context_put + + creates or updates tapi.connectivity.ConnectivityContext + """ + body = TapiConnectivityConnectivityContextWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-connectivity:connectivity-context/', + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_aggregated_connection_end_pointtopology_uuidaggregated_connection_end_point_node_uuidnode_edge_point_uuidaggregated_connection_end_point_connection_end_point_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_aggregated_connection_end_pointtopology_uuidaggregated_connection_end_point_node_uuidnode_edge_point_uuidaggregated_connection_end_point_connection_end_point_uuid_get + + returns tapi.connectivity.ConnectionEndPointRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/connection-end-point={connection-end-point-uuid}/aggregated-connection-end-point={topology-uuid},{aggregated-connection-end-point-node-uuid},{node-edge-point-uuid},{aggregated-connection-end-point-connection-end-point-uuid}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example', connection_end_point_uuid='connection_end_point_uuid_example', topology_uuid='topology_uuid_example', aggregated_connection_end_point_node_uuid='aggregated_connection_end_point_node_uuid_example', node_edge_point_uuid='node_edge_point_uuid_example', aggregated_connection_end_point_connection_end_point_uuid='aggregated_connection_end_point_connection_end_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_cep_role_connection_spec_reference_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_cep_role_connection_spec_reference_get + + returns tapi.connectivity.ConnectionSpecReference + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/connection-end-point={connection-end-point-uuid}/cep-role/connection-spec-reference/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example', connection_end_point_uuid='connection_end_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_cep_role_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_cep_role_get + + returns tapi.connectivity.CepRole + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/connection-end-point={connection-end-point-uuid}/cep-role/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example', connection_end_point_uuid='connection_end_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_client_node_edge_pointtopology_uuidclient_node_edge_point_node_uuidnode_edge_point_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_client_node_edge_pointtopology_uuidclient_node_edge_point_node_uuidnode_edge_point_uuid_get + + returns tapi.topology.NodeEdgePointRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/connection-end-point={connection-end-point-uuid}/client-node-edge-point={topology-uuid},{client-node-edge-point-node-uuid},{node-edge-point-uuid}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example', connection_end_point_uuid='connection_end_point_uuid_example', topology_uuid='topology_uuid_example', client_node_edge_point_node_uuid='client_node_edge_point_node_uuid_example', node_edge_point_uuid='node_edge_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_get + + returns tapi.connectivity.ConnectionEndPoint + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/connection-end-point={connection-end-point-uuid}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example', connection_end_point_uuid='connection_end_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/connection-end-point={connection-end-point-uuid}/name={value-name}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example', connection_end_point_uuid='connection_end_point_uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_parent_node_edge_point_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_connection_end_pointconnection_end_point_uuid_parent_node_edge_point_get + + returns tapi.topology.NodeEdgePointRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/connection-end-point={connection-end-point-uuid}/parent-node-edge-point/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example', connection_end_point_uuid='connection_end_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_tapi_connectivitycep_list_get + + returns tapi.connectivity.CepList + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_connectivitycreate_connectivity_service_post(self): + """Test case for operations_tapi_connectivitycreate_connectivity_service_post + + operates on tapi.connectivity.CreateConnectivityService + """ + body = OperationsTapiconnectivitycreateconnectivityserviceBody() + response = self.client.open( + '/operations/tapi-connectivity:create-connectivity-service/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_connectivitydelete_connectivity_service_post(self): + """Test case for operations_tapi_connectivitydelete_connectivity_service_post + + operates on tapi.connectivity.DeleteConnectivityService + """ + body = OperationsTapiconnectivitydeleteconnectivityserviceBody() + response = self.client.open( + '/operations/tapi-connectivity:delete-connectivity-service/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_connectivityget_connection_details_post(self): + """Test case for operations_tapi_connectivityget_connection_details_post + + operates on tapi.connectivity.GetConnectionDetails + """ + body = OperationsTapiconnectivitygetconnectiondetailsBody() + response = self.client.open( + '/operations/tapi-connectivity:get-connection-details/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_connectivityget_connection_end_point_details_post(self): + """Test case for operations_tapi_connectivityget_connection_end_point_details_post + + operates on tapi.connectivity.GetConnectionEndPointDetails + """ + body = OperationsTapiconnectivitygetconnectionendpointdetailsBody() + response = self.client.open( + '/operations/tapi-connectivity:get-connection-end-point-details/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_connectivityget_connectivity_service_details_post(self): + """Test case for operations_tapi_connectivityget_connectivity_service_details_post + + operates on tapi.connectivity.GetConnectivityServiceDetails + """ + body = OperationsTapiconnectivitygetconnectivityservicedetailsBody() + response = self.client.open( + '/operations/tapi-connectivity:get-connectivity-service-details/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_connectivityget_connectivity_service_list_post(self): + """Test case for operations_tapi_connectivityget_connectivity_service_list_post + + + """ + response = self.client.open( + '/operations/tapi-connectivity:get-connectivity-service-list/', + method='POST') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_connectivityupdate_connectivity_service_post(self): + """Test case for operations_tapi_connectivityupdate_connectivity_service_post + + operates on tapi.connectivity.UpdateConnectivityService + """ + body = OperationsTapiconnectivityupdateconnectivityserviceBody() + response = self.client.open( + '/operations/tapi-connectivity:update-connectivity-service/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + +if __name__ == '__main__': + import unittest + unittest.main() diff --git a/hackfest/tapi/server/tapi_server/test/test_tapi_notification_controller.py b/hackfest/tapi/server/tapi_server/test/test_tapi_notification_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..d4270b546c408cf8a0b06bd506a7cab1901be18b --- /dev/null +++ b/hackfest/tapi/server/tapi_server/test/test_tapi_notification_controller.py @@ -0,0 +1,556 @@ +# coding: utf-8 + +from __future__ import absolute_import + +from flask import json +from six import BytesIO + +from tapi_server.models.operations_tapinotificationcreatenotificationsubscriptionservice_body import OperationsTapinotificationcreatenotificationsubscriptionserviceBody # noqa: E501 +from tapi_server.models.operations_tapinotificationdeletenotificationsubscriptionservice_body import OperationsTapinotificationdeletenotificationsubscriptionserviceBody # noqa: E501 +from tapi_server.models.operations_tapinotificationgetnotificationlist_body import OperationsTapinotificationgetnotificationlistBody # noqa: E501 +from tapi_server.models.operations_tapinotificationgetnotificationsubscriptionservicedetails_body import OperationsTapinotificationgetnotificationsubscriptionservicedetailsBody # noqa: E501 +from tapi_server.models.operations_tapinotificationupdatenotificationsubscriptionservice_body import OperationsTapinotificationupdatenotificationsubscriptionserviceBody # noqa: E501 +from tapi_server.models.tapi_common_name_and_value_wrapper import TapiCommonNameAndValueWrapper # noqa: E501 +from tapi_server.models.tapi_notification_alarm_info_wrapper import TapiNotificationAlarmInfoWrapper # noqa: E501 +from tapi_server.models.tapi_notification_create_notification_subscription_service import TapiNotificationCreateNotificationSubscriptionService # noqa: E501 +from tapi_server.models.tapi_notification_delete_notification_subscription_service import TapiNotificationDeleteNotificationSubscriptionService # noqa: E501 +from tapi_server.models.tapi_notification_get_notification_list import TapiNotificationGetNotificationList # noqa: E501 +from tapi_server.models.tapi_notification_get_notification_subscription_service_details import TapiNotificationGetNotificationSubscriptionServiceDetails # noqa: E501 +from tapi_server.models.tapi_notification_get_notification_subscription_service_list import TapiNotificationGetNotificationSubscriptionServiceList # noqa: E501 +from tapi_server.models.tapi_notification_get_supported_notification_types import TapiNotificationGetSupportedNotificationTypes # noqa: E501 +from tapi_server.models.tapi_notification_name_and_value_change_wrapper import TapiNotificationNameAndValueChangeWrapper # noqa: E501 +from tapi_server.models.tapi_notification_notification_channel_wrapper import TapiNotificationNotificationChannelWrapper # noqa: E501 +from tapi_server.models.tapi_notification_notification_context_wrapper import TapiNotificationNotificationContextWrapper # noqa: E501 +from tapi_server.models.tapi_notification_notification_subscription_service_wrapper import TapiNotificationNotificationSubscriptionServiceWrapper # noqa: E501 +from tapi_server.models.tapi_notification_notification_wrapper import TapiNotificationNotificationWrapper # noqa: E501 +from tapi_server.models.tapi_notification_subscription_filter_wrapper import TapiNotificationSubscriptionFilterWrapper # noqa: E501 +from tapi_server.models.tapi_notification_tca_info_wrapper import TapiNotificationTcaInfoWrapper # noqa: E501 +from tapi_server.models.tapi_notification_update_notification_subscription_service import TapiNotificationUpdateNotificationSubscriptionService # noqa: E501 +from tapi_server.test import BaseTestCase + + +class TestTapiNotificationController(BaseTestCase): + """TapiNotificationController integration test stubs""" + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_delete(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_delete + + removes tapi.notification.NotificationContext + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/', + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_get(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_get + + returns tapi.notification.NotificationContext + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/', + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscription_post(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscription_post + + creates tapi.notification.NotificationSubscriptionService + """ + body = TapiNotificationNotificationSubscriptionServiceWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_delete(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_delete + + removes tapi.notification.NotificationSubscriptionService + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_get(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_get + + returns tapi.notification.NotificationSubscriptionService + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_name_post(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_name_post + + creates tapi.common.NameAndValue + """ + body = TapiCommonNameAndValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/name/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_namevalue_name_delete(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_namevalue_name_delete + + removes tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_namevalue_name_put(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_namevalue_name_put + + creates or updates tapi.common.NameAndValue + """ + body = TapiCommonNameAndValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notification_channel_get(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notification_channel_get + + returns tapi.notification.NotificationChannel + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification-channel/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notification_channel_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notification_channel_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification-channel/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_additional_infovalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_additional_infovalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification={notification-uuid}/additional-info={value-name}/'.format(uuid='uuid_example', notification_uuid='notification_uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_alarm_info_get(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_alarm_info_get + + returns tapi.notification.AlarmInfo + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification={notification-uuid}/alarm-info/'.format(uuid='uuid_example', notification_uuid='notification_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_changed_attributesvalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_changed_attributesvalue_name_get + + returns tapi.notification.NameAndValueChange + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification={notification-uuid}/changed-attributes={value-name}/'.format(uuid='uuid_example', notification_uuid='notification_uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_get + + returns tapi.notification.Notification + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification={notification-uuid}/'.format(uuid='uuid_example', notification_uuid='notification_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification={notification-uuid}/name={value-name}/'.format(uuid='uuid_example', notification_uuid='notification_uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_target_object_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_target_object_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification={notification-uuid}/target-object-name={value-name}/'.format(uuid='uuid_example', notification_uuid='notification_uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_tca_info_get(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_notificationnotification_uuid_tca_info_get + + returns tapi.notification.TcaInfo + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification={notification-uuid}/tca-info/'.format(uuid='uuid_example', notification_uuid='notification_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_put(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_put + + creates or updates tapi.notification.NotificationSubscriptionService + """ + body = TapiNotificationNotificationSubscriptionServiceWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_delete(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_delete + + removes tapi.notification.SubscriptionFilter + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/subscription-filter/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_get(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_get + + returns tapi.notification.SubscriptionFilter + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/subscription-filter/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_name_post(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_name_post + + creates tapi.common.NameAndValue + """ + body = TapiCommonNameAndValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/subscription-filter/name/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_namevalue_name_delete(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_namevalue_name_delete + + removes tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/subscription-filter/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/subscription-filter/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_namevalue_name_put(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_namevalue_name_put + + creates or updates tapi.common.NameAndValue + """ + body = TapiCommonNameAndValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/subscription-filter/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_post(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_post + + creates tapi.notification.SubscriptionFilter + """ + body = TapiNotificationSubscriptionFilterWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/subscription-filter/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_put(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notif_subscriptionuuid_subscription_filter_put + + creates or updates tapi.notification.SubscriptionFilter + """ + body = TapiNotificationSubscriptionFilterWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/subscription-filter/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_additional_infovalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_additional_infovalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notification={uuid}/additional-info={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_alarm_info_get(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_alarm_info_get + + returns tapi.notification.AlarmInfo + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notification={uuid}/alarm-info/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_changed_attributesvalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_changed_attributesvalue_name_get + + returns tapi.notification.NameAndValueChange + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notification={uuid}/changed-attributes={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_get(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_get + + returns tapi.notification.Notification + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notification={uuid}/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notification={uuid}/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_target_object_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_target_object_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notification={uuid}/target-object-name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_tca_info_get(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_notificationuuid_tca_info_get + + returns tapi.notification.TcaInfo + """ + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/notification={uuid}/tca-info/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_post(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_post + + creates tapi.notification.NotificationContext + """ + body = TapiNotificationNotificationContextWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_notificationnotification_context_put(self): + """Test case for data_tapi_commoncontext_tapi_notificationnotification_context_put + + creates or updates tapi.notification.NotificationContext + """ + body = TapiNotificationNotificationContextWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-notification:notification-context/', + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_notificationcreate_notification_subscription_service_post(self): + """Test case for operations_tapi_notificationcreate_notification_subscription_service_post + + operates on tapi.notification.CreateNotificationSubscriptionService + """ + body = OperationsTapinotificationcreatenotificationsubscriptionserviceBody() + response = self.client.open( + '/operations/tapi-notification:create-notification-subscription-service/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_notificationdelete_notification_subscription_service_post(self): + """Test case for operations_tapi_notificationdelete_notification_subscription_service_post + + operates on tapi.notification.DeleteNotificationSubscriptionService + """ + body = OperationsTapinotificationdeletenotificationsubscriptionserviceBody() + response = self.client.open( + '/operations/tapi-notification:delete-notification-subscription-service/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_notificationget_notification_list_post(self): + """Test case for operations_tapi_notificationget_notification_list_post + + operates on tapi.notification.GetNotificationList + """ + body = OperationsTapinotificationgetnotificationlistBody() + response = self.client.open( + '/operations/tapi-notification:get-notification-list/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_notificationget_notification_subscription_service_details_post(self): + """Test case for operations_tapi_notificationget_notification_subscription_service_details_post + + operates on tapi.notification.GetNotificationSubscriptionServiceDetails + """ + body = OperationsTapinotificationgetnotificationsubscriptionservicedetailsBody() + response = self.client.open( + '/operations/tapi-notification:get-notification-subscription-service-details/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_notificationget_notification_subscription_service_list_post(self): + """Test case for operations_tapi_notificationget_notification_subscription_service_list_post + + + """ + response = self.client.open( + '/operations/tapi-notification:get-notification-subscription-service-list/', + method='POST') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_notificationget_supported_notification_types_post(self): + """Test case for operations_tapi_notificationget_supported_notification_types_post + + + """ + response = self.client.open( + '/operations/tapi-notification:get-supported-notification-types/', + method='POST') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_notificationupdate_notification_subscription_service_post(self): + """Test case for operations_tapi_notificationupdate_notification_subscription_service_post + + operates on tapi.notification.UpdateNotificationSubscriptionService + """ + body = OperationsTapinotificationupdatenotificationsubscriptionserviceBody() + response = self.client.open( + '/operations/tapi-notification:update-notification-subscription-service/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + +if __name__ == '__main__': + import unittest + unittest.main() diff --git a/hackfest/tapi/server/tapi_server/test/test_tapi_path_computation_controller.py b/hackfest/tapi/server/tapi_server/test/test_tapi_path_computation_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..1c833fb966932dc77eced3563497c9b46373670c --- /dev/null +++ b/hackfest/tapi/server/tapi_server/test/test_tapi_path_computation_controller.py @@ -0,0 +1,1455 @@ +# coding: utf-8 + +from __future__ import absolute_import + +from flask import json +from six import BytesIO + +from tapi_server.models.operations_tapipathcomputationcomputep2ppath_body import OperationsTapipathcomputationcomputep2ppathBody # noqa: E501 +from tapi_server.models.operations_tapipathcomputationdeletep2ppath_body import OperationsTapipathcomputationdeletep2ppathBody # noqa: E501 +from tapi_server.models.operations_tapipathcomputationoptimizep2ppath_body import OperationsTapipathcomputationoptimizep2ppathBody # noqa: E501 +from tapi_server.models.tapi_common_bandwidth_profile_wrapper import TapiCommonBandwidthProfileWrapper # noqa: E501 +from tapi_server.models.tapi_common_capacity_value_wrapper import TapiCommonCapacityValueWrapper # noqa: E501 +from tapi_server.models.tapi_common_capacity_wrapper import TapiCommonCapacityWrapper # noqa: E501 +from tapi_server.models.tapi_common_name_and_value_wrapper import TapiCommonNameAndValueWrapper # noqa: E501 +from tapi_server.models.tapi_common_service_interface_point_ref_wrapper import TapiCommonServiceInterfacePointRefWrapper # noqa: E501 +from tapi_server.models.tapi_path_computation_compute_p2_p_path import TapiPathComputationComputeP2PPath # noqa: E501 +from tapi_server.models.tapi_path_computation_delete_p2_p_path import TapiPathComputationDeleteP2PPath # noqa: E501 +from tapi_server.models.tapi_path_computation_optimize_p2_ppath import TapiPathComputationOptimizeP2Ppath # noqa: E501 +from tapi_server.models.tapi_path_computation_path_computation_context_wrapper import TapiPathComputationPathComputationContextWrapper # noqa: E501 +from tapi_server.models.tapi_path_computation_path_computation_service_wrapper import TapiPathComputationPathComputationServiceWrapper # noqa: E501 +from tapi_server.models.tapi_path_computation_path_objective_function_wrapper import TapiPathComputationPathObjectiveFunctionWrapper # noqa: E501 +from tapi_server.models.tapi_path_computation_path_optimization_constraint_wrapper import TapiPathComputationPathOptimizationConstraintWrapper # noqa: E501 +from tapi_server.models.tapi_path_computation_path_ref_wrapper import TapiPathComputationPathRefWrapper # noqa: E501 +from tapi_server.models.tapi_path_computation_path_service_end_point_wrapper import TapiPathComputationPathServiceEndPointWrapper # noqa: E501 +from tapi_server.models.tapi_path_computation_path_wrapper import TapiPathComputationPathWrapper # noqa: E501 +from tapi_server.models.tapi_path_computation_routing_constraint_wrapper import TapiPathComputationRoutingConstraintWrapper # noqa: E501 +from tapi_server.models.tapi_path_computation_topology_constraint_wrapper import TapiPathComputationTopologyConstraintWrapper # noqa: E501 +from tapi_server.models.tapi_path_computation_value_or_priority_wrapper import TapiPathComputationValueOrPriorityWrapper # noqa: E501 +from tapi_server.models.tapi_topology_cost_characteristic_wrapper import TapiTopologyCostCharacteristicWrapper # noqa: E501 +from tapi_server.models.tapi_topology_latency_characteristic_wrapper import TapiTopologyLatencyCharacteristicWrapper # noqa: E501 +from tapi_server.models.tapi_topology_link_ref_wrapper import TapiTopologyLinkRefWrapper # noqa: E501 +from tapi_server.models.tapi_topology_risk_characteristic_wrapper import TapiTopologyRiskCharacteristicWrapper # noqa: E501 +from tapi_server.test import BaseTestCase + + +class TestTapiPathComputationController(BaseTestCase): + """TapiPathComputationController integration test stubs""" + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_delete + + removes tapi.path.computation.PathComputationContext + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/', + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_get + + returns tapi.path.computation.PathComputationContext + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/', + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_service_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_service_post + + creates tapi.path.computation.PathComputationService + """ + body = TapiPathComputationPathComputationServiceWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_delete + + removes tapi.path.computation.PathComputationService + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_point_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_point_post + + creates tapi.path.computation.PathServiceEndPoint + """ + body = TapiPathComputationPathServiceEndPointWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_delete + + removes tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_post + + creates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_burst_size_put + + creates or updates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_delete + + removes tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example', local_id='local_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_post + + creates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example', local_id='local_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_committed_information_rate_put + + creates or updates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example', local_id='local_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_delete + + removes tapi.common.BandwidthProfile + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/'.format(uuid='uuid_example', local_id='local_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_get + + returns tapi.common.BandwidthProfile + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_delete + + removes tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_post + + creates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_burst_size_put + + creates or updates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_delete + + removes tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example', local_id='local_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_post + + creates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example', local_id='local_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_peak_information_rate_put + + creates or updates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example', local_id='local_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_post + + creates tapi.common.BandwidthProfile + """ + body = TapiCommonBandwidthProfileWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/'.format(uuid='uuid_example', local_id='local_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_bandwidth_profile_put + + creates or updates tapi.common.BandwidthProfile + """ + body = TapiCommonBandwidthProfileWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/'.format(uuid='uuid_example', local_id='local_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_delete + + removes tapi.common.Capacity + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/'.format(uuid='uuid_example', local_id='local_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_get + + returns tapi.common.Capacity + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_post + + creates tapi.common.Capacity + """ + body = TapiCommonCapacityWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/'.format(uuid='uuid_example', local_id='local_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_put + + creates or updates tapi.common.Capacity + """ + body = TapiCommonCapacityWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/'.format(uuid='uuid_example', local_id='local_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_total_size_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_total_size_delete + + removes tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/total-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_total_size_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_total_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/total-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_total_size_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_total_size_post + + creates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/total-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_total_size_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_capacity_total_size_put + + creates or updates tapi.common.CapacityValue + """ + body = TapiCommonCapacityValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/total-size/'.format(uuid='uuid_example', local_id='local_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_delete + + removes tapi.path.computation.PathServiceEndPoint + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/'.format(uuid='uuid_example', local_id='local_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_get + + returns tapi.path.computation.PathServiceEndPoint + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_name_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_name_post + + creates tapi.common.NameAndValue + """ + body = TapiCommonNameAndValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/name/'.format(uuid='uuid_example', local_id='local_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_namevalue_name_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_namevalue_name_delete + + removes tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/name={value-name}/'.format(uuid='uuid_example', local_id='local_id_example', value_name='value_name_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/name={value-name}/'.format(uuid='uuid_example', local_id='local_id_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_namevalue_name_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_namevalue_name_put + + creates or updates tapi.common.NameAndValue + """ + body = TapiCommonNameAndValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/name={value-name}/'.format(uuid='uuid_example', local_id='local_id_example', value_name='value_name_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_put + + creates or updates tapi.path.computation.PathServiceEndPoint + """ + body = TapiPathComputationPathServiceEndPointWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/'.format(uuid='uuid_example', local_id='local_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_service_interface_point_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_service_interface_point_delete + + removes tapi.common.ServiceInterfacePointRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/service-interface-point/'.format(uuid='uuid_example', local_id='local_id_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_service_interface_point_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_service_interface_point_get + + returns tapi.common.ServiceInterfacePointRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/service-interface-point/'.format(uuid='uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_service_interface_point_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_service_interface_point_post + + creates tapi.common.ServiceInterfacePointRef + """ + body = TapiCommonServiceInterfacePointRefWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/service-interface-point/'.format(uuid='uuid_example', local_id='local_id_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_service_interface_point_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_end_pointlocal_id_service_interface_point_put + + creates or updates tapi.common.ServiceInterfacePointRef + """ + body = TapiCommonServiceInterfacePointRefWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/service-interface-point/'.format(uuid='uuid_example', local_id='local_id_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_get + + returns tapi.path.computation.PathComputationService + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_name_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_name_post + + creates tapi.common.NameAndValue + """ + body = TapiCommonNameAndValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/name/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_namevalue_name_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_namevalue_name_delete + + removes tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_namevalue_name_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_namevalue_name_put + + creates or updates tapi.common.NameAndValue + """ + body = TapiCommonNameAndValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_delete + + removes tapi.path.computation.PathObjectiveFunction + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/objective-function/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_get + + returns tapi.path.computation.PathObjectiveFunction + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/objective-function/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_name_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_name_post + + creates tapi.common.NameAndValue + """ + body = TapiCommonNameAndValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/objective-function/name/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_namevalue_name_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_namevalue_name_delete + + removes tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/objective-function/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/objective-function/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_namevalue_name_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_namevalue_name_put + + creates or updates tapi.common.NameAndValue + """ + body = TapiCommonNameAndValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/objective-function/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_post + + creates tapi.path.computation.PathObjectiveFunction + """ + body = TapiPathComputationPathObjectiveFunctionWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/objective-function/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_objective_function_put + + creates or updates tapi.path.computation.PathObjectiveFunction + """ + body = TapiPathComputationPathObjectiveFunctionWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/objective-function/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_delete + + removes tapi.path.computation.PathOptimizationConstraint + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/optimization-constraint/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_get + + returns tapi.path.computation.PathOptimizationConstraint + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/optimization-constraint/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_name_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_name_post + + creates tapi.common.NameAndValue + """ + body = TapiCommonNameAndValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/optimization-constraint/name/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_namevalue_name_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_namevalue_name_delete + + removes tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/optimization-constraint/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/optimization-constraint/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_namevalue_name_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_namevalue_name_put + + creates or updates tapi.common.NameAndValue + """ + body = TapiCommonNameAndValueWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/optimization-constraint/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_post + + creates tapi.path.computation.PathOptimizationConstraint + """ + body = TapiPathComputationPathOptimizationConstraintWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/optimization-constraint/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_optimization_constraint_put + + creates or updates tapi.path.computation.PathOptimizationConstraint + """ + body = TapiPathComputationPathOptimizationConstraintWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/optimization-constraint/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_pathpath_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_pathpath_uuid_get + + returns tapi.path.computation.PathRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/path={path-uuid}/'.format(uuid='uuid_example', path_uuid='path_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_put + + creates or updates tapi.path.computation.PathComputationService + """ + body = TapiPathComputationPathComputationServiceWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_cost_characteristic_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_cost_characteristic_post + + creates tapi.topology.CostCharacteristic + """ + body = TapiTopologyCostCharacteristicWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/cost-characteristic/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_cost_characteristiccost_name_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_cost_characteristiccost_name_delete + + removes tapi.topology.CostCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/cost-characteristic={cost-name}/'.format(uuid='uuid_example', cost_name='cost_name_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_cost_characteristiccost_name_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_cost_characteristiccost_name_get + + returns tapi.topology.CostCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/cost-characteristic={cost-name}/'.format(uuid='uuid_example', cost_name='cost_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_cost_characteristiccost_name_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_cost_characteristiccost_name_put + + creates or updates tapi.topology.CostCharacteristic + """ + body = TapiTopologyCostCharacteristicWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/cost-characteristic={cost-name}/'.format(uuid='uuid_example', cost_name='cost_name_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_delete + + removes tapi.path.computation.RoutingConstraint + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_get + + returns tapi.path.computation.RoutingConstraint + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_latency_characteristic_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_latency_characteristic_post + + creates tapi.topology.LatencyCharacteristic + """ + body = TapiTopologyLatencyCharacteristicWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/latency-characteristic/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_latency_characteristictraffic_property_name_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_latency_characteristictraffic_property_name_delete + + removes tapi.topology.LatencyCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/latency-characteristic={traffic-property-name}/'.format(uuid='uuid_example', traffic_property_name='traffic_property_name_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_latency_characteristictraffic_property_name_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_latency_characteristictraffic_property_name_get + + returns tapi.topology.LatencyCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/latency-characteristic={traffic-property-name}/'.format(uuid='uuid_example', traffic_property_name='traffic_property_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_latency_characteristictraffic_property_name_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_latency_characteristictraffic_property_name_put + + creates or updates tapi.topology.LatencyCharacteristic + """ + body = TapiTopologyLatencyCharacteristicWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/latency-characteristic={traffic-property-name}/'.format(uuid='uuid_example', traffic_property_name='traffic_property_name_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_cost_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_cost_delete + + removes tapi.path.computation.ValueOrPriority + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/max-allowed-cost/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_cost_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_cost_get + + returns tapi.path.computation.ValueOrPriority + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/max-allowed-cost/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_cost_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_cost_post + + creates tapi.path.computation.ValueOrPriority + """ + body = TapiPathComputationValueOrPriorityWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/max-allowed-cost/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_cost_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_cost_put + + creates or updates tapi.path.computation.ValueOrPriority + """ + body = TapiPathComputationValueOrPriorityWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/max-allowed-cost/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_delay_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_delay_delete + + removes tapi.path.computation.ValueOrPriority + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/max-allowed-delay/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_delay_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_delay_get + + returns tapi.path.computation.ValueOrPriority + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/max-allowed-delay/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_delay_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_delay_post + + creates tapi.path.computation.ValueOrPriority + """ + body = TapiPathComputationValueOrPriorityWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/max-allowed-delay/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_delay_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_delay_put + + creates or updates tapi.path.computation.ValueOrPriority + """ + body = TapiPathComputationValueOrPriorityWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/max-allowed-delay/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_hops_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_hops_delete + + removes tapi.path.computation.ValueOrPriority + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/max-allowed-hops/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_hops_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_hops_get + + returns tapi.path.computation.ValueOrPriority + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/max-allowed-hops/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_hops_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_hops_post + + creates tapi.path.computation.ValueOrPriority + """ + body = TapiPathComputationValueOrPriorityWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/max-allowed-hops/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_hops_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_max_allowed_hops_put + + creates or updates tapi.path.computation.ValueOrPriority + """ + body = TapiPathComputationValueOrPriorityWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/max-allowed-hops/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_post + + creates tapi.path.computation.RoutingConstraint + """ + body = TapiPathComputationRoutingConstraintWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_put + + creates or updates tapi.path.computation.RoutingConstraint + """ + body = TapiPathComputationRoutingConstraintWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_risk_diversity_characteristic_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_risk_diversity_characteristic_post + + creates tapi.topology.RiskCharacteristic + """ + body = TapiTopologyRiskCharacteristicWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/risk-diversity-characteristic/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_risk_diversity_characteristicrisk_characteristic_name_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_risk_diversity_characteristicrisk_characteristic_name_delete + + removes tapi.topology.RiskCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/risk-diversity-characteristic={risk-characteristic-name}/'.format(uuid='uuid_example', risk_characteristic_name='risk_characteristic_name_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_risk_diversity_characteristicrisk_characteristic_name_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_risk_diversity_characteristicrisk_characteristic_name_get + + returns tapi.topology.RiskCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/risk-diversity-characteristic={risk-characteristic-name}/'.format(uuid='uuid_example', risk_characteristic_name='risk_characteristic_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_risk_diversity_characteristicrisk_characteristic_name_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_routing_constraint_risk_diversity_characteristicrisk_characteristic_name_put + + creates or updates tapi.topology.RiskCharacteristic + """ + body = TapiTopologyRiskCharacteristicWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/risk-diversity-characteristic={risk-characteristic-name}/'.format(uuid='uuid_example', risk_characteristic_name='risk_characteristic_name_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_topology_constraint_delete(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_topology_constraint_delete + + removes tapi.path.computation.TopologyConstraint + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/topology-constraint/'.format(uuid='uuid_example'), + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_topology_constraint_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_topology_constraint_get + + returns tapi.path.computation.TopologyConstraint + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/topology-constraint/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_topology_constraint_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_topology_constraint_post + + creates tapi.path.computation.TopologyConstraint + """ + body = TapiPathComputationTopologyConstraintWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/topology-constraint/'.format(uuid='uuid_example'), + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_topology_constraint_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_path_comp_serviceuuid_topology_constraint_put + + creates or updates tapi.path.computation.TopologyConstraint + """ + body = TapiPathComputationTopologyConstraintWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/topology-constraint/'.format(uuid='uuid_example'), + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_get + + returns tapi.path.computation.Path + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_linktopology_uuidlink_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_linktopology_uuidlink_uuid_get + + returns tapi.topology.LinkRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/link={topology-uuid},{link-uuid}/'.format(uuid='uuid_example', topology_uuid='topology_uuid_example', link_uuid='link_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_cost_characteristiccost_name_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_cost_characteristiccost_name_get + + returns tapi.topology.CostCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/routing-constraint/cost-characteristic={cost-name}/'.format(uuid='uuid_example', cost_name='cost_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_get + + returns tapi.path.computation.RoutingConstraint + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/routing-constraint/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_latency_characteristictraffic_property_name_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_latency_characteristictraffic_property_name_get + + returns tapi.topology.LatencyCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/routing-constraint/latency-characteristic={traffic-property-name}/'.format(uuid='uuid_example', traffic_property_name='traffic_property_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_max_allowed_cost_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_max_allowed_cost_get + + returns tapi.path.computation.ValueOrPriority + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/routing-constraint/max-allowed-cost/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_max_allowed_delay_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_max_allowed_delay_get + + returns tapi.path.computation.ValueOrPriority + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/routing-constraint/max-allowed-delay/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_max_allowed_hops_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_max_allowed_hops_get + + returns tapi.path.computation.ValueOrPriority + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/routing-constraint/max-allowed-hops/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_risk_diversity_characteristicrisk_characteristic_name_get(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_pathuuid_routing_constraint_risk_diversity_characteristicrisk_characteristic_name_get + + returns tapi.topology.RiskCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/routing-constraint/risk-diversity-characteristic={risk-characteristic-name}/'.format(uuid='uuid_example', risk_characteristic_name='risk_characteristic_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_post(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_post + + creates tapi.path.computation.PathComputationContext + """ + body = TapiPathComputationPathComputationContextWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_path_computationpath_computation_context_put(self): + """Test case for data_tapi_commoncontext_tapi_path_computationpath_computation_context_put + + creates or updates tapi.path.computation.PathComputationContext + """ + body = TapiPathComputationPathComputationContextWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-path-computation:path-computation-context/', + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_path_computationcompute_p2_p_path_post(self): + """Test case for operations_tapi_path_computationcompute_p2_p_path_post + + operates on tapi.path.computation.ComputeP2PPath + """ + body = OperationsTapipathcomputationcomputep2ppathBody() + response = self.client.open( + '/operations/tapi-path-computation:compute-p-2-p-path/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_path_computationdelete_p2_p_path_post(self): + """Test case for operations_tapi_path_computationdelete_p2_p_path_post + + operates on tapi.path.computation.DeleteP2PPath + """ + body = OperationsTapipathcomputationdeletep2ppathBody() + response = self.client.open( + '/operations/tapi-path-computation:delete-p-2-p-path/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_path_computationoptimize_p2_ppath_post(self): + """Test case for operations_tapi_path_computationoptimize_p2_ppath_post + + operates on tapi.path.computation.OptimizeP2Ppath + """ + body = OperationsTapipathcomputationoptimizep2ppathBody() + response = self.client.open( + '/operations/tapi-path-computation:optimize-p-2-ppath/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + +if __name__ == '__main__': + import unittest + unittest.main() diff --git a/hackfest/tapi/server/tapi_server/test/test_tapi_topology_controller.py b/hackfest/tapi/server/tapi_server/test/test_tapi_topology_controller.py new file mode 100644 index 0000000000000000000000000000000000000000..2f528d43d7ed5f21f6fe72f8c81628d98cd0db38 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/test/test_tapi_topology_controller.py @@ -0,0 +1,1444 @@ +# coding: utf-8 + +from __future__ import absolute_import + +from flask import json +from six import BytesIO + +from tapi_server.models.operations_tapitopologygetlinkdetails_body import OperationsTapitopologygetlinkdetailsBody # noqa: E501 +from tapi_server.models.operations_tapitopologygetnodedetails_body import OperationsTapitopologygetnodedetailsBody # noqa: E501 +from tapi_server.models.operations_tapitopologygetnodeedgepointdetails_body import OperationsTapitopologygetnodeedgepointdetailsBody # noqa: E501 +from tapi_server.models.operations_tapitopologygettopologydetails_body import OperationsTapitopologygettopologydetailsBody # noqa: E501 +from tapi_server.models.tapi_common_bandwidth_profile_wrapper import TapiCommonBandwidthProfileWrapper # noqa: E501 +from tapi_server.models.tapi_common_capacity_value_wrapper import TapiCommonCapacityValueWrapper # noqa: E501 +from tapi_server.models.tapi_common_capacity_wrapper import TapiCommonCapacityWrapper # noqa: E501 +from tapi_server.models.tapi_common_name_and_value_wrapper import TapiCommonNameAndValueWrapper # noqa: E501 +from tapi_server.models.tapi_common_service_interface_point_ref_wrapper import TapiCommonServiceInterfacePointRefWrapper # noqa: E501 +from tapi_server.models.tapi_topology_connection_spec_reference_wrapper import TapiTopologyConnectionSpecReferenceWrapper # noqa: E501 +from tapi_server.models.tapi_topology_cost_characteristic_wrapper import TapiTopologyCostCharacteristicWrapper # noqa: E501 +from tapi_server.models.tapi_topology_get_link_details import TapiTopologyGetLinkDetails # noqa: E501 +from tapi_server.models.tapi_topology_get_node_details import TapiTopologyGetNodeDetails # noqa: E501 +from tapi_server.models.tapi_topology_get_node_edge_point_details import TapiTopologyGetNodeEdgePointDetails # noqa: E501 +from tapi_server.models.tapi_topology_get_topology_details import TapiTopologyGetTopologyDetails # noqa: E501 +from tapi_server.models.tapi_topology_get_topology_list import TapiTopologyGetTopologyList # noqa: E501 +from tapi_server.models.tapi_topology_inter_rule_group_wrapper import TapiTopologyInterRuleGroupWrapper # noqa: E501 +from tapi_server.models.tapi_topology_latency_characteristic_wrapper import TapiTopologyLatencyCharacteristicWrapper # noqa: E501 +from tapi_server.models.tapi_topology_link_wrapper import TapiTopologyLinkWrapper # noqa: E501 +from tapi_server.models.tapi_topology_network_topology_service_wrapper import TapiTopologyNetworkTopologyServiceWrapper # noqa: E501 +from tapi_server.models.tapi_topology_node_edge_point_ref_wrapper import TapiTopologyNodeEdgePointRefWrapper # noqa: E501 +from tapi_server.models.tapi_topology_node_owned_node_edge_point_wrapper import TapiTopologyNodeOwnedNodeEdgePointWrapper # noqa: E501 +from tapi_server.models.tapi_topology_node_rule_group_ref_wrapper import TapiTopologyNodeRuleGroupRefWrapper # noqa: E501 +from tapi_server.models.tapi_topology_node_rule_group_wrapper import TapiTopologyNodeRuleGroupWrapper # noqa: E501 +from tapi_server.models.tapi_topology_port_role_rule_wrapper import TapiTopologyPortRoleRuleWrapper # noqa: E501 +from tapi_server.models.tapi_topology_resilience_type_wrapper import TapiTopologyResilienceTypeWrapper # noqa: E501 +from tapi_server.models.tapi_topology_risk_characteristic_wrapper import TapiTopologyRiskCharacteristicWrapper # noqa: E501 +from tapi_server.models.tapi_topology_rule_wrapper import TapiTopologyRuleWrapper # noqa: E501 +from tapi_server.models.tapi_topology_signal_property_rule_wrapper import TapiTopologySignalPropertyRuleWrapper # noqa: E501 +from tapi_server.models.tapi_topology_topology_context_wrapper import TapiTopologyTopologyContextWrapper # noqa: E501 +from tapi_server.models.tapi_topology_topology_node_wrapper import TapiTopologyTopologyNodeWrapper # noqa: E501 +from tapi_server.models.tapi_topology_topology_ref_wrapper import TapiTopologyTopologyRefWrapper # noqa: E501 +from tapi_server.models.tapi_topology_topology_wrapper import TapiTopologyTopologyWrapper # noqa: E501 +from tapi_server.models.tapi_topology_validation_mechanism_wrapper import TapiTopologyValidationMechanismWrapper # noqa: E501 +from tapi_server.test import BaseTestCase + + +class TestTapiTopologyController(BaseTestCase): + """TapiTopologyController integration test stubs""" + + def test_data_tapi_commoncontext_tapi_topologytopology_context_delete(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_delete + + removes tapi.topology.context.TopologyContext + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/', + method='DELETE') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_get + + returns tapi.topology.context.TopologyContext + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/', + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_nw_topology_service_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_nw_topology_service_get + + returns tapi.topology.NetworkTopologyService + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/nw-topology-service/', + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_nw_topology_service_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_nw_topology_service_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/nw-topology-service/name={value-name}/'.format(value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_nw_topology_service_topologytopology_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_nw_topology_service_topologytopology_uuid_get + + returns tapi.topology.TopologyRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/nw-topology-service/topology={topology-uuid}/'.format(topology_uuid='topology_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_post(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_post + + creates tapi.topology.context.TopologyContext + """ + body = TapiTopologyTopologyContextWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_put(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_put + + creates or updates tapi.topology.context.TopologyContext + """ + body = TapiTopologyTopologyContextWrapper() + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/', + method='PUT', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_get + + returns tapi.topology.topologycontext.Topology + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/'.format(uuid='uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_bandwidth_profile_committed_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_bandwidth_profile_committed_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/available-capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example', link_uuid='link_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_bandwidth_profile_committed_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_bandwidth_profile_committed_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/available-capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example', link_uuid='link_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_bandwidth_profile_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_bandwidth_profile_get + + returns tapi.common.BandwidthProfile + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/available-capacity/bandwidth-profile/'.format(uuid='uuid_example', link_uuid='link_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_bandwidth_profile_peak_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_bandwidth_profile_peak_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/available-capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example', link_uuid='link_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_bandwidth_profile_peak_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_bandwidth_profile_peak_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/available-capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example', link_uuid='link_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_get + + returns tapi.common.Capacity + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/available-capacity/'.format(uuid='uuid_example', link_uuid='link_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_total_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_available_capacity_total_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/available-capacity/total-size/'.format(uuid='uuid_example', link_uuid='link_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_cost_characteristiccost_name_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_cost_characteristiccost_name_get + + returns tapi.topology.CostCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/cost-characteristic={cost-name}/'.format(uuid='uuid_example', link_uuid='link_uuid_example', cost_name='cost_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_get + + returns tapi.topology.Link + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/'.format(uuid='uuid_example', link_uuid='link_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_latency_characteristictraffic_property_name_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_latency_characteristictraffic_property_name_get + + returns tapi.topology.LatencyCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/latency-characteristic={traffic-property-name}/'.format(uuid='uuid_example', link_uuid='link_uuid_example', traffic_property_name='traffic_property_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/name={value-name}/'.format(uuid='uuid_example', link_uuid='link_uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_node_edge_pointtopology_uuidnode_uuidnode_edge_point_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_node_edge_pointtopology_uuidnode_uuidnode_edge_point_uuid_get + + returns tapi.topology.NodeEdgePointRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/node-edge-point={topology-uuid},{node-uuid},{node-edge-point-uuid}/'.format(uuid='uuid_example', link_uuid='link_uuid_example', topology_uuid='topology_uuid_example', node_uuid='node_uuid_example', node_edge_point_uuid='node_edge_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_resilience_type_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_resilience_type_get + + returns tapi.topology.ResilienceType + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/resilience-type/'.format(uuid='uuid_example', link_uuid='link_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_risk_characteristicrisk_characteristic_name_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_risk_characteristicrisk_characteristic_name_get + + returns tapi.topology.RiskCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/risk-characteristic={risk-characteristic-name}/'.format(uuid='uuid_example', link_uuid='link_uuid_example', risk_characteristic_name='risk_characteristic_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/total-potential-capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example', link_uuid='link_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/total-potential-capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example', link_uuid='link_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_bandwidth_profile_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_bandwidth_profile_get + + returns tapi.common.BandwidthProfile + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/total-potential-capacity/bandwidth-profile/'.format(uuid='uuid_example', link_uuid='link_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/total-potential-capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example', link_uuid='link_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/total-potential-capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example', link_uuid='link_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_get + + returns tapi.common.Capacity + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/total-potential-capacity/'.format(uuid='uuid_example', link_uuid='link_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_total_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_total_potential_capacity_total_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/total-potential-capacity/total-size/'.format(uuid='uuid_example', link_uuid='link_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_validation_mechanismvalidation_mechanism_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_linklink_uuid_validation_mechanismvalidation_mechanism_get + + returns tapi.topology.ValidationMechanism + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/validation-mechanism={validation-mechanism}/'.format(uuid='uuid_example', link_uuid='link_uuid_example', validation_mechanism='validation_mechanism_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/name={value-name}/'.format(uuid='uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_aggregated_node_edge_pointtopology_uuidaggregated_node_edge_point_node_uuidnode_edge_point_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_aggregated_node_edge_pointtopology_uuidaggregated_node_edge_point_node_uuidnode_edge_point_uuid_get + + returns tapi.topology.NodeEdgePointRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/aggregated-node-edge-point={topology-uuid},{aggregated-node-edge-point-node-uuid},{node-edge-point-uuid}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', topology_uuid='topology_uuid_example', aggregated_node_edge_point_node_uuid='aggregated_node_edge_point_node_uuid_example', node_edge_point_uuid='node_edge_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_bandwidth_profile_committed_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_bandwidth_profile_committed_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/available-capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_bandwidth_profile_committed_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_bandwidth_profile_committed_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/available-capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example', node_uuid='node_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_bandwidth_profile_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_bandwidth_profile_get + + returns tapi.common.BandwidthProfile + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/available-capacity/bandwidth-profile/'.format(uuid='uuid_example', node_uuid='node_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_bandwidth_profile_peak_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_bandwidth_profile_peak_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/available-capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_bandwidth_profile_peak_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_bandwidth_profile_peak_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/available-capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example', node_uuid='node_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_get + + returns tapi.common.Capacity + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/available-capacity/'.format(uuid='uuid_example', node_uuid='node_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_total_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_available_capacity_total_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/available-capacity/total-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_cost_characteristiccost_name_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_cost_characteristiccost_name_get + + returns tapi.topology.CostCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/cost-characteristic={cost-name}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', cost_name='cost_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_encap_topology_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_encap_topology_get + + returns tapi.topology.TopologyRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/encap-topology/'.format(uuid='uuid_example', node_uuid='node_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_get + + returns tapi.topology.topology.Node + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/'.format(uuid='uuid_example', node_uuid='node_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_latency_characteristictraffic_property_name_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_latency_characteristictraffic_property_name_get + + returns tapi.topology.LatencyCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/latency-characteristic={traffic-property-name}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', traffic_property_name='traffic_property_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/name={value-name}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_bandwidth_profile_committed_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_bandwidth_profile_committed_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/available-capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_bandwidth_profile_committed_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_bandwidth_profile_committed_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/available-capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_bandwidth_profile_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_bandwidth_profile_get + + returns tapi.common.BandwidthProfile + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/available-capacity/bandwidth-profile/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_bandwidth_profile_peak_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_bandwidth_profile_peak_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/available-capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_bandwidth_profile_peak_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_bandwidth_profile_peak_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/available-capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_get + + returns tapi.common.Capacity + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/available-capacity/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_total_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_available_capacity_total_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/available-capacity/total-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_cost_characteristiccost_name_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_cost_characteristiccost_name_get + + returns tapi.topology.CostCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/cost-characteristic={cost-name}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', cost_name='cost_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_get + + returns tapi.topology.NodeRuleGroup + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_associated_node_rule_grouptopology_uuidassociated_node_rule_group_node_uuidassociated_node_rule_group_node_rule_group_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_associated_node_rule_grouptopology_uuidassociated_node_rule_group_node_uuidassociated_node_rule_group_node_rule_group_uuid_get + + returns tapi.topology.NodeRuleGroupRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/associated-node-rule-group={topology-uuid},{associated-node-rule-group-node-uuid},{associated-node-rule-group-node-rule-group-uuid}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example', topology_uuid='topology_uuid_example', associated_node_rule_group_node_uuid='associated_node_rule_group_node_uuid_example', associated_node_rule_group_node_rule_group_uuid='associated_node_rule_group_node_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_bandwidth_profile_committed_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_bandwidth_profile_committed_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/available-capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_bandwidth_profile_committed_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_bandwidth_profile_committed_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/available-capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_bandwidth_profile_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_bandwidth_profile_get + + returns tapi.common.BandwidthProfile + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/available-capacity/bandwidth-profile/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_bandwidth_profile_peak_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_bandwidth_profile_peak_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/available-capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_bandwidth_profile_peak_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_bandwidth_profile_peak_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/available-capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_get + + returns tapi.common.Capacity + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/available-capacity/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_total_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_available_capacity_total_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/available-capacity/total-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_cost_characteristiccost_name_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_cost_characteristiccost_name_get + + returns tapi.topology.CostCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/cost-characteristic={cost-name}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example', cost_name='cost_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_get + + returns tapi.topology.InterRuleGroup + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_latency_characteristictraffic_property_name_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_latency_characteristictraffic_property_name_get + + returns tapi.topology.LatencyCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/latency-characteristic={traffic-property-name}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example', traffic_property_name='traffic_property_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/name={value-name}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_risk_characteristicrisk_characteristic_name_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_risk_characteristicrisk_characteristic_name_get + + returns tapi.topology.RiskCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/risk-characteristic={risk-characteristic-name}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example', risk_characteristic_name='risk_characteristic_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_rulelocal_id_cep_port_role_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_rulelocal_id_cep_port_role_get + + returns tapi.topology.PortRoleRule + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/rule={local-id}/cep-port-role/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_rulelocal_id_connection_spec_reference_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_rulelocal_id_connection_spec_reference_get + + returns tapi.topology.ConnectionSpecReference + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/rule={local-id}/connection-spec-reference/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_rulelocal_id_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_rulelocal_id_get + + returns tapi.topology.Rule + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/rule={local-id}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_rulelocal_id_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_rulelocal_id_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/rule={local-id}/name={value-name}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example', local_id='local_id_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_rulelocal_id_signal_property_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_rulelocal_id_signal_property_get + + returns tapi.topology.SignalPropertyRule + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/rule={local-id}/signal-property/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/total-potential-capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/total-potential-capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_bandwidth_profile_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_bandwidth_profile_get + + returns tapi.common.BandwidthProfile + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/total-potential-capacity/bandwidth-profile/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/total-potential-capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/total-potential-capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_get + + returns tapi.common.Capacity + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/total-potential-capacity/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_total_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_inter_rule_groupinter_rule_group_uuid_total_potential_capacity_total_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/total-potential-capacity/total-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', inter_rule_group_uuid='inter_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_latency_characteristictraffic_property_name_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_latency_characteristictraffic_property_name_get + + returns tapi.topology.LatencyCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/latency-characteristic={traffic-property-name}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', traffic_property_name='traffic_property_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/name={value-name}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_node_edge_pointtopology_uuidnode_edge_point_node_uuidnode_edge_point_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_node_edge_pointtopology_uuidnode_edge_point_node_uuidnode_edge_point_uuid_get + + returns tapi.topology.NodeEdgePointRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/node-edge-point={topology-uuid},{node-edge-point-node-uuid},{node-edge-point-uuid}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', topology_uuid='topology_uuid_example', node_edge_point_node_uuid='node_edge_point_node_uuid_example', node_edge_point_uuid='node_edge_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_node_rule_grouptopology_uuidnode_rule_group_node_uuidnode_rule_group_node_rule_group_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_node_rule_grouptopology_uuidnode_rule_group_node_uuidnode_rule_group_node_rule_group_uuid_get + + returns tapi.topology.NodeRuleGroupRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/node-rule-group={topology-uuid},{node-rule-group-node-uuid},{node-rule-group-node-rule-group-uuid}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', topology_uuid='topology_uuid_example', node_rule_group_node_uuid='node_rule_group_node_uuid_example', node_rule_group_node_rule_group_uuid='node_rule_group_node_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_risk_characteristicrisk_characteristic_name_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_risk_characteristicrisk_characteristic_name_get + + returns tapi.topology.RiskCharacteristic + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/risk-characteristic={risk-characteristic-name}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', risk_characteristic_name='risk_characteristic_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_rulelocal_id_cep_port_role_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_rulelocal_id_cep_port_role_get + + returns tapi.topology.PortRoleRule + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/rule={local-id}/cep-port-role/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_rulelocal_id_connection_spec_reference_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_rulelocal_id_connection_spec_reference_get + + returns tapi.topology.ConnectionSpecReference + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/rule={local-id}/connection-spec-reference/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_rulelocal_id_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_rulelocal_id_get + + returns tapi.topology.Rule + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/rule={local-id}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_rulelocal_id_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_rulelocal_id_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/rule={local-id}/name={value-name}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', local_id='local_id_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_rulelocal_id_signal_property_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_rulelocal_id_signal_property_get + + returns tapi.topology.SignalPropertyRule + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/rule={local-id}/signal-property/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example', local_id='local_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/total-potential-capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/total-potential-capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_bandwidth_profile_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_bandwidth_profile_get + + returns tapi.common.BandwidthProfile + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/total-potential-capacity/bandwidth-profile/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/total-potential-capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/total-potential-capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_get + + returns tapi.common.Capacity + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/total-potential-capacity/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_total_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_node_rule_groupnode_rule_group_uuid_total_potential_capacity_total_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/total-potential-capacity/total-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example', node_rule_group_uuid='node_rule_group_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_aggregated_node_edge_pointtopology_uuidaggregated_node_edge_point_node_uuidnode_edge_point_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_aggregated_node_edge_pointtopology_uuidaggregated_node_edge_point_node_uuidnode_edge_point_uuid_get + + returns tapi.topology.NodeEdgePointRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/aggregated-node-edge-point={topology-uuid},{aggregated-node-edge-point-node-uuid},{node-edge-point-uuid}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example', topology_uuid='topology_uuid_example', aggregated_node_edge_point_node_uuid='aggregated_node_edge_point_node_uuid_example', node_edge_point_uuid='node_edge_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_bandwidth_profile_committed_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_bandwidth_profile_committed_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/available-capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_bandwidth_profile_committed_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_bandwidth_profile_committed_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/available-capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_bandwidth_profile_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_bandwidth_profile_get + + returns tapi.common.BandwidthProfile + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/available-capacity/bandwidth-profile/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_bandwidth_profile_peak_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_bandwidth_profile_peak_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/available-capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_bandwidth_profile_peak_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_bandwidth_profile_peak_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/available-capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_get + + returns tapi.common.Capacity + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/available-capacity/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_total_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_available_capacity_total_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/available-capacity/total-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_get + + returns tapi.topology.node.OwnedNodeEdgePoint + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_mapped_service_interface_pointservice_interface_point_uuid_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_mapped_service_interface_pointservice_interface_point_uuid_get + + returns tapi.common.ServiceInterfacePointRef + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/mapped-service-interface-point={service-interface-point-uuid}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example', service_interface_point_uuid='service_interface_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_namevalue_name_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_namevalue_name_get + + returns tapi.common.NameAndValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/name={value-name}/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example', value_name='value_name_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/total-potential-capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/total-potential-capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_bandwidth_profile_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_bandwidth_profile_get + + returns tapi.common.BandwidthProfile + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/total-potential-capacity/bandwidth-profile/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/total-potential-capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/total-potential-capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_get + + returns tapi.common.Capacity + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/total-potential-capacity/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_total_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_owned_node_edge_pointowned_node_edge_point_uuid_total_potential_capacity_total_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/total-potential-capacity/total-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example', owned_node_edge_point_uuid='owned_node_edge_point_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_bandwidth_profile_committed_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/total-potential-capacity/bandwidth-profile/committed-burst-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_bandwidth_profile_committed_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/total-potential-capacity/bandwidth-profile/committed-information-rate/'.format(uuid='uuid_example', node_uuid='node_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_bandwidth_profile_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_bandwidth_profile_get + + returns tapi.common.BandwidthProfile + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/total-potential-capacity/bandwidth-profile/'.format(uuid='uuid_example', node_uuid='node_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_bandwidth_profile_peak_burst_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/total-potential-capacity/bandwidth-profile/peak-burst-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_bandwidth_profile_peak_information_rate_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/total-potential-capacity/bandwidth-profile/peak-information-rate/'.format(uuid='uuid_example', node_uuid='node_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_get + + returns tapi.common.Capacity + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/total-potential-capacity/'.format(uuid='uuid_example', node_uuid='node_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_total_size_get(self): + """Test case for data_tapi_commoncontext_tapi_topologytopology_context_topologyuuid_nodenode_uuid_total_potential_capacity_total_size_get + + returns tapi.common.CapacityValue + """ + response = self.client.open( + '/data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/total-potential-capacity/total-size/'.format(uuid='uuid_example', node_uuid='node_uuid_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_topologyget_link_details_post(self): + """Test case for operations_tapi_topologyget_link_details_post + + operates on tapi.topology.GetLinkDetails + """ + body = OperationsTapitopologygetlinkdetailsBody() + response = self.client.open( + '/operations/tapi-topology:get-link-details/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_topologyget_node_details_post(self): + """Test case for operations_tapi_topologyget_node_details_post + + operates on tapi.topology.GetNodeDetails + """ + body = OperationsTapitopologygetnodedetailsBody() + response = self.client.open( + '/operations/tapi-topology:get-node-details/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_topologyget_node_edge_point_details_post(self): + """Test case for operations_tapi_topologyget_node_edge_point_details_post + + operates on tapi.topology.GetNodeEdgePointDetails + """ + body = OperationsTapitopologygetnodeedgepointdetailsBody() + response = self.client.open( + '/operations/tapi-topology:get-node-edge-point-details/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_topologyget_topology_details_post(self): + """Test case for operations_tapi_topologyget_topology_details_post + + operates on tapi.topology.GetTopologyDetails + """ + body = OperationsTapitopologygettopologydetailsBody() + response = self.client.open( + '/operations/tapi-topology:get-topology-details/', + method='POST', + data=json.dumps(body), + content_type='application/yang-data+json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_operations_tapi_topologyget_topology_list_post(self): + """Test case for operations_tapi_topologyget_topology_list_post + + + """ + response = self.client.open( + '/operations/tapi-topology:get-topology-list/', + method='POST') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + +if __name__ == '__main__': + import unittest + unittest.main() diff --git a/hackfest/tapi/server/tapi_server/type_util.py b/hackfest/tapi/server/tapi_server/type_util.py new file mode 100644 index 0000000000000000000000000000000000000000..0563f81fd5345282a33705038dfa77fdcaa15872 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/type_util.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +import sys + +if sys.version_info < (3, 7): + import typing + + def is_generic(klass): + """ Determine whether klass is a generic class """ + return type(klass) == typing.GenericMeta + + def is_dict(klass): + """ Determine whether klass is a Dict """ + return klass.__extra__ == dict + + def is_list(klass): + """ Determine whether klass is a List """ + return klass.__extra__ == list + +else: + + def is_generic(klass): + """ Determine whether klass is a generic class """ + return hasattr(klass, '__origin__') + + def is_dict(klass): + """ Determine whether klass is a Dict """ + return klass.__origin__ == dict + + def is_list(klass): + """ Determine whether klass is a List """ + return klass.__origin__ == list diff --git a/hackfest/tapi/server/tapi_server/util.py b/hackfest/tapi/server/tapi_server/util.py new file mode 100644 index 0000000000000000000000000000000000000000..f627e2a294aef5a1069f9825a57a03c4e5df5db6 --- /dev/null +++ b/hackfest/tapi/server/tapi_server/util.py @@ -0,0 +1,142 @@ +import datetime + +import six +import typing +from tapi_server import type_util + + +def _deserialize(data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if klass in six.integer_types or klass in (float, str, bool, bytearray): + return _deserialize_primitive(data, klass) + elif klass == object: + return _deserialize_object(data) + elif klass == datetime.date: + return deserialize_date(data) + elif klass == datetime.datetime: + return deserialize_datetime(data) + elif type_util.is_generic(klass): + if type_util.is_list(klass): + return _deserialize_list(data, klass.__args__[0]) + if type_util.is_dict(klass): + return _deserialize_dict(data, klass.__args__[1]) + else: + return deserialize_model(data, klass) + + +def _deserialize_primitive(data, klass): + """Deserializes to primitive type. + + :param data: data to deserialize. + :param klass: class literal. + + :return: int, long, float, str, bool. + :rtype: int | long | float | str | bool + """ + try: + value = klass(data) + except UnicodeEncodeError: + value = six.u(data) + except TypeError: + value = data + return value + + +def _deserialize_object(value): + """Return an original value. + + :return: object. + """ + return value + + +def deserialize_date(string): + """Deserializes string to date. + + :param string: str. + :type string: str + :return: date. + :rtype: date + """ + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + + +def deserialize_datetime(string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :type string: str + :return: datetime. + :rtype: datetime + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + + +def deserialize_model(data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :type data: dict | list + :param klass: class literal. + :return: model object. + """ + instance = klass() + + if not instance.swagger_types: + return data + + for attr, attr_type in six.iteritems(instance.swagger_types): + if data is not None \ + and instance.attribute_map[attr] in data \ + and isinstance(data, (list, dict)): + value = data[instance.attribute_map[attr]] + setattr(instance, attr, _deserialize(value, attr_type)) + + return instance + + +def _deserialize_list(data, boxed_type): + """Deserializes a list and its elements. + + :param data: list to deserialize. + :type data: list + :param boxed_type: class literal. + + :return: deserialized list. + :rtype: list + """ + return [_deserialize(sub_data, boxed_type) + for sub_data in data] + + +def _deserialize_dict(data, boxed_type): + """Deserializes a dict and its elements. + + :param data: dict to deserialize. + :type data: dict + :param boxed_type: class literal. + + :return: deserialized dict. + :rtype: dict + """ + return {k: _deserialize(v, boxed_type) + for k, v in six.iteritems(data)} diff --git a/hackfest/tapi/server/test-requirements.txt b/hackfest/tapi/server/test-requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..2640639a25a3bffe0f449788303300a364c55cb7 --- /dev/null +++ b/hackfest/tapi/server/test-requirements.txt @@ -0,0 +1,7 @@ +flask_testing==0.8.0 +coverage>=4.0.3 +nose>=1.3.7 +pluggy>=0.3.1 +py>=1.4.31 +randomize>=0.13 +tox==3.20.1 diff --git a/hackfest/tapi/server/tox.ini b/hackfest/tapi/server/tox.ini new file mode 100644 index 0000000000000000000000000000000000000000..2751b218c1d2385c081c114c9094fc5e388126dc --- /dev/null +++ b/hackfest/tapi/server/tox.ini @@ -0,0 +1,10 @@ +[tox] +envlist = py38 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + nosetests \ + [] \ No newline at end of file diff --git a/hackfest/tapi/swagger-codegen-cli-3.0.35.jar b/hackfest/tapi/swagger-codegen-cli-3.0.35.jar new file mode 100644 index 0000000000000000000000000000000000000000..88f9085ea972daed2099d62c89d4a96d0e4bd730 Binary files /dev/null and b/hackfest/tapi/swagger-codegen-cli-3.0.35.jar differ diff --git a/hackfest/tapi/tapi-connectivity.yaml b/hackfest/tapi/tapi-connectivity.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f70ccbdc31cd141f939006de3d449d8c951c5368 --- /dev/null +++ b/hackfest/tapi/tapi-connectivity.yaml @@ -0,0 +1,15210 @@ +# 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. + +--- +swagger: "2.0" +info: + description: "\r\n This module contains TAPI Notification Model definitions.\r\ + \n Source: TapiNotification.uml\r\n - The TAPI YANG models included\ + \ in this TAPI release are a *normative* part of the TAPI SDK.\r\n - The\ + \ YANG specifications have been generated from the corresponding UML model using\ + \ the [ONF EAGLE UML2YANG mapping tool]\r\n \r\n and further edited manually to comply with the [ONF IISOMI UML2YANG\ + \ mapping guidelines]\r\n \r\n - Status of YANG model artifacts can be determined by referring\ + \ to the corresponding UML artifacts.\r\n As described in the UML models,\ + \ some artifacts are considered *experimental*, and thus the corresponding YANG\ + \ artifacts.\r\n - The ONF TAPI release process does not guarantee backward\ + \ compatibility of YANG models across major versions of TAPI releases.\r\n \ + \ The YANG model backward compatibility criteria are outlined in section\ + \ 11 of .\r\n YANG models included in this release may not be backward compatible\ + \ with previous TAPI releases.\r\n Copyright (c) 2018 Open Networking Foundation\ + \ (ONF). All rights reserved.\r\n License: This module is distributed under\ + \ the Apache License 2.0,\r\n This module contains TAPI Connectivity Model\ + \ definitions.\r\n Source: TapiConnectivity.uml\r\n - The TAPI YANG\ + \ models included in this TAPI release are a *normative* part of the TAPI SDK.\r\ + \n - The YANG specifications have been generated from the corresponding\ + \ UML model using the [ONF EAGLE UML2YANG mapping tool]\r\n \r\n and further edited manually to comply with the [ONF IISOMI UML2YANG\ + \ mapping guidelines]\r\n \r\n - Status of YANG model artifacts can be determined by referring\ + \ to the corresponding UML artifacts.\r\n As described in the UML models,\ + \ some artifacts are considered *experimental*, and thus the corresponding YANG\ + \ artifacts.\r\n - The ONF TAPI release process does not guarantee backward\ + \ compatibility of YANG models across major versions of TAPI releases.\r\n \ + \ The YANG model backward compatibility criteria are outlined in section 11\ + \ of .\r\n YANG models included in this release may not be backward compatible\ + \ with previous TAPI releases.\r\n Copyright (c) 2018 Open Networking Foundation\ + \ (ONF). All rights reserved.\r\n License: This module is distributed under\ + \ the Apache License 2.0.,\r\n This module contains TAPI Topology Model\ + \ definitions.\r\n Source: TapiTopology.uml\r\n - The TAPI YANG\ + \ models included in this TAPI release are a *normative* part of the TAPI SDK.\r\ + \n - The YANG specifications have been generated from the corresponding\ + \ UML model using the [ONF EAGLE UML2YANG mapping tool]\r\n \r\n and further edited manually to comply with the [ONF IISOMI UML2YANG\ + \ mapping guidelines]\r\n \r\n - Status of YANG model artifacts can be determined by referring\ + \ to the corresponding UML artifacts.\r\n As described in the UML models,\ + \ some artifacts are considered *experimental*, and thus the corresponding YANG\ + \ artifacts.\r\n - The ONF TAPI release process does not guarantee backward\ + \ compatibility of YANG models across major versions of TAPI releases.\r\n \ + \ The YANG model backward compatibility criteria are outlined in section\ + \ 11 of .\r\n YANG models included in this release may not be backward compatible\ + \ with previous TAPI releases.\r\n Copyright (c) 2018 Open Networking Foundation\ + \ (ONF). All rights reserved.\r\n License: This module is distributed under\ + \ the Apache License 2.0.,\r\n This module contains TAPI Common Model definitions.\r\ + \n Source: TapiCommon.uml\r\n - The TAPI YANG models included in\ + \ this TAPI release are a *normative* part of the TAPI SDK.\r\n - The YANG\ + \ specifications have been generated from the corresponding UML model using the\ + \ [ONF EAGLE UML2YANG mapping tool]\r\n \r\ + \n and further edited manually to comply with the [ONF IISOMI UML2YANG\ + \ mapping guidelines]\r\n \r\ + \n - Status of YANG model artifacts can be determined by referring to the\ + \ corresponding UML artifacts.\r\n As described in the UML models, some\ + \ artifacts are considered *experimental*, and thus the corresponding YANG artifacts.\r\ + \n - The ONF TAPI release process does not guarantee backward compatibility\ + \ of YANG models across major versions of TAPI releases.\r\n The YANG model\ + \ backward compatibility criteria are outlined in section 11 of .\r\ + \n YANG models included in this release may not be backward compatible\ + \ with previous TAPI releases.\r\n Copyright (c) 2018 Open Networking Foundation\ + \ (ONF). All rights reserved.\r\n License: This module is distributed under\ + \ the Apache License 2.0.,\r\n This module contains TAPI Path Computation\ + \ Model definitions.\r\n Source: TapiPathComputation.uml\r\n - The\ + \ TAPI YANG models included in this TAPI release are a *normative* part of the\ + \ TAPI SDK.\r\n - The YANG specifications have been generated from the\ + \ corresponding UML model using the [ONF EAGLE UML2YANG mapping tool]\r\n \ + \ \r\n and\ + \ further edited manually to comply with the [ONF IISOMI UML2YANG mapping guidelines]\r\ + \n \r\ + \n - Status of YANG model artifacts can be determined by referring to the\ + \ corresponding UML artifacts.\r\n As described in the UML models, some\ + \ artifacts are considered *experimental*, and thus the corresponding YANG artifacts.\r\ + \n - The ONF TAPI release process does not guarantee backward compatibility\ + \ of YANG models across major versions of TAPI releases.\r\n The YANG model\ + \ backward compatibility criteria are outlined in section 11 of .\r\ + \n YANG models included in this release may not be backward compatible\ + \ with previous TAPI releases.\r\n Copyright (c) 2018 Open Networking Foundation\ + \ (ONF). All rights reserved.\r\n License: This module is distributed under\ + \ the Apache License 2.0." + version: "2.1.3" + title: "tapi-notification,tapi-connectivity,tapi-topology,tapi-common,tapi-path-computation\ + \ API" +host: "localhost:1234" +consumes: +- "application/yang-data+json" +produces: +- "application/yang-data+json" +paths: + /data/tapi-common:context/: + get: + tags: + - "tapi-common" + summary: "returns tapi.common.Context" + description: "none" + parameters: [] + responses: + 200: + description: "tapi.common.Context" + schema: + $ref: "#/definitions/tapi.common.ContextWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-common" + summary: "creates tapi.common.Context" + description: "none" + parameters: + - in: "body" + name: "tapi.common.Context.body-param" + description: "tapi.common.Context to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.ContextWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-common" + summary: "creates or updates tapi.common.Context" + description: "none" + parameters: + - in: "body" + name: "tapi.common.Context.body-param" + description: "tapi.common.Context to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.ContextWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-common" + summary: "removes tapi.common.Context" + description: "none" + parameters: [] + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/name/: + post: + tags: + - "tapi-common" + summary: "creates tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - in: "body" + name: "tapi.common.NameAndValue.body-param" + description: "tapi.common.NameAndValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + /data/tapi-common:context/name={value-name}/: + get: + tags: + - "tapi-common" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-common" + summary: "creates or updates tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + - in: "body" + name: "tapi.common.NameAndValue.body-param" + description: "tapi.common.NameAndValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-common" + summary: "removes tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/service-interface-point/: + post: + tags: + - "tapi-common" + summary: "creates tapi.common.ServiceInterfacePoint" + description: "none" + parameters: + - in: "body" + name: "tapi.common.ServiceInterfacePoint.body-param" + description: "tapi.common.ServiceInterfacePoint to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.ServiceInterfacePointWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + /data/tapi-common:context/service-interface-point={uuid}/: + get: + tags: + - "tapi-common" + summary: "returns tapi.common.ServiceInterfacePoint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of service-interface-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.ServiceInterfacePoint" + schema: + $ref: "#/definitions/tapi.common.ServiceInterfacePointWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-common" + summary: "creates or updates tapi.common.ServiceInterfacePoint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of service-interface-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.ServiceInterfacePoint.body-param" + description: "tapi.common.ServiceInterfacePoint to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.ServiceInterfacePointWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-common" + summary: "removes tapi.common.ServiceInterfacePoint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of service-interface-point" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/service-interface-point={uuid}/available-capacity/: + get: + tags: + - "tapi-common" + summary: "returns tapi.common.Capacity" + description: "Capacity available to be assigned." + parameters: + - name: "uuid" + in: "path" + description: "Id of service-interface-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.Capacity" + schema: + $ref: "#/definitions/tapi.common.CapacityWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/service-interface-point={uuid}/available-capacity/bandwidth-profile/: + get: + tags: + - "tapi-common" + summary: "returns tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of service-interface-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.BandwidthProfile" + schema: + $ref: "#/definitions/tapi.common.BandwidthProfileWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/service-interface-point={uuid}/available-capacity/bandwidth-profile/committed-burst-size/: + get: + tags: + - "tapi-common" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of service-interface-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/service-interface-point={uuid}/available-capacity/bandwidth-profile/committed-information-rate/: + get: + tags: + - "tapi-common" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of service-interface-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/service-interface-point={uuid}/available-capacity/bandwidth-profile/peak-burst-size/: + get: + tags: + - "tapi-common" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of service-interface-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/service-interface-point={uuid}/available-capacity/bandwidth-profile/peak-information-rate/: + get: + tags: + - "tapi-common" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of service-interface-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/service-interface-point={uuid}/available-capacity/total-size/: + get: + tags: + - "tapi-common" + summary: "returns tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of service-interface-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/service-interface-point={uuid}/name/: + post: + tags: + - "tapi-common" + summary: "creates tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of service-interface-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.NameAndValue.body-param" + description: "tapi.common.NameAndValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + /data/tapi-common:context/service-interface-point={uuid}/name={value-name}/: + get: + tags: + - "tapi-common" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of service-interface-point" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-common" + summary: "creates or updates tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of service-interface-point" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + - in: "body" + name: "tapi.common.NameAndValue.body-param" + description: "tapi.common.NameAndValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-common" + summary: "removes tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of service-interface-point" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/service-interface-point={uuid}/total-potential-capacity/: + get: + tags: + - "tapi-common" + summary: "returns tapi.common.Capacity" + description: "An optimistic view of the capacity of the TopologicalEntity assuming\ + \ that any shared capacity is available to be taken." + parameters: + - name: "uuid" + in: "path" + description: "Id of service-interface-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.Capacity" + schema: + $ref: "#/definitions/tapi.common.CapacityWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/service-interface-point={uuid}/total-potential-capacity/bandwidth-profile/: + get: + tags: + - "tapi-common" + summary: "returns tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of service-interface-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.BandwidthProfile" + schema: + $ref: "#/definitions/tapi.common.BandwidthProfileWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/service-interface-point={uuid}/total-potential-capacity/bandwidth-profile/committed-burst-size/: + get: + tags: + - "tapi-common" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of service-interface-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/service-interface-point={uuid}/total-potential-capacity/bandwidth-profile/committed-information-rate/: + get: + tags: + - "tapi-common" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of service-interface-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/service-interface-point={uuid}/total-potential-capacity/bandwidth-profile/peak-burst-size/: + get: + tags: + - "tapi-common" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of service-interface-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/service-interface-point={uuid}/total-potential-capacity/bandwidth-profile/peak-information-rate/: + get: + tags: + - "tapi-common" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of service-interface-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/service-interface-point={uuid}/total-potential-capacity/total-size/: + get: + tags: + - "tapi-common" + summary: "returns tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of service-interface-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-connectivity:connectivity-context/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.ConnectivityContext" + description: "Augments the base TAPI Context with ConnectivityService information" + parameters: [] + responses: + 200: + description: "tapi.connectivity.ConnectivityContext" + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityContextWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.connectivity.ConnectivityContext" + description: "Augments the base TAPI Context with ConnectivityService information" + parameters: + - in: "body" + name: "tapi.connectivity.ConnectivityContext.body-param" + description: "tapi.connectivity.ConnectivityContext to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityContextWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.connectivity.ConnectivityContext" + description: "Augments the base TAPI Context with ConnectivityService information" + parameters: + - in: "body" + name: "tapi.connectivity.ConnectivityContext.body-param" + description: "tapi.connectivity.ConnectivityContext to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityContextWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.connectivity.ConnectivityContext" + description: "Augments the base TAPI Context with ConnectivityService information" + parameters: [] + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.Connection" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connection" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.Connection" + schema: + $ref: "#/definitions/tapi.connectivity.ConnectionWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/connection-end-point={topology-uuid},{node-uuid},{node-edge-point-uuid},{connection-end-point-uuid}/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.ConnectionEndPointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connection" + required: true + type: "string" + - name: "topology-uuid" + in: "path" + description: "Id of connection-end-point" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of connection-end-point" + required: true + type: "string" + - name: "node-edge-point-uuid" + in: "path" + description: "Id of connection-end-point" + required: true + type: "string" + - name: "connection-end-point-uuid" + in: "path" + description: "Id of connection-end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.ConnectionEndPointRef" + schema: + $ref: "#/definitions/tapi.connectivity.ConnectionEndPointRefWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/connection-spec-reference/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.ConnectionSpecReference" + description: "Provides the reference to the spec that defines the connection\ + \ type and cepRoles." + parameters: + - name: "uuid" + in: "path" + description: "Id of connection" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.ConnectionSpecReference" + schema: + $ref: "#/definitions/tapi.connectivity.ConnectionSpecReferenceWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/lower-connection={connection-uuid}/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.ConnectionRef" + description: "An Connection object supports a recursive aggregation relationship\ + \ such that the internal construction of an Connection can be exposed as multiple\ + \ lower level Connection objects (partitioning).\r\n Aggregation\ + \ is used as for the Node/Topology to allow changes in hierarchy. \r\n \ + \ Connection aggregation reflects Node/Topology aggregation.\ + \ \r\n The FC represents a Cross-Connection in an NE. The Cross-Connection\ + \ in an NE is not necessarily the lowest level of FC partitioning." + parameters: + - name: "uuid" + in: "path" + description: "Id of connection" + required: true + type: "string" + - name: "connection-uuid" + in: "path" + description: "Id of lower-connection" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.ConnectionRef" + schema: + $ref: "#/definitions/tapi.connectivity.ConnectionRefWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/name={value-name}/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of connection" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/route={local-id}/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.Route" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connection" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of route" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.Route" + schema: + $ref: "#/definitions/tapi.connectivity.RouteWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/route={local-id}/connection-end-point={topology-uuid},{node-uuid},{node-edge-point-uuid},{connection-end-point-uuid}/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.ConnectionEndPointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connection" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of route" + required: true + type: "string" + - name: "topology-uuid" + in: "path" + description: "Id of connection-end-point" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of connection-end-point" + required: true + type: "string" + - name: "node-edge-point-uuid" + in: "path" + description: "Id of connection-end-point" + required: true + type: "string" + - name: "connection-end-point-uuid" + in: "path" + description: "Id of connection-end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.ConnectionEndPointRef" + schema: + $ref: "#/definitions/tapi.connectivity.ConnectionEndPointRefWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/route={local-id}/name={value-name}/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of connection" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of route" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/route={local-id}/resilience-route-pac/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.ResilienceRoute" + description: "Provides optional resilience and state attributes to the Route." + parameters: + - name: "uuid" + in: "path" + description: "Id of connection" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of route" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.ResilienceRoute" + schema: + $ref: "#/definitions/tapi.connectivity.ResilienceRouteWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/route={local-id}/resilience-route-pac/name={value-name}/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of connection" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of route" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/supported-client-link={topology-uuid},{link-uuid}/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.topology.LinkRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connection" + required: true + type: "string" + - name: "topology-uuid" + in: "path" + description: "Id of supported-client-link" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of supported-client-link" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.LinkRef" + schema: + $ref: "#/definitions/tapi.topology.LinkRefWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.SwitchControl" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connection" + required: true + type: "string" + - name: "switch-control-uuid" + in: "path" + description: "Id of switch-control" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.SwitchControl" + schema: + $ref: "#/definitions/tapi.connectivity.SwitchControlWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/name={value-name}/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of connection" + required: true + type: "string" + - name: "switch-control-uuid" + in: "path" + description: "Id of switch-control" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/resilience-type/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.topology.ResilienceType" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connection" + required: true + type: "string" + - name: "switch-control-uuid" + in: "path" + description: "Id of switch-control" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.ResilienceType" + schema: + $ref: "#/definitions/tapi.topology.ResilienceTypeWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/sub-switch-control={connection-uuid},{sub-switch-control-switch-control-uuid}/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.SwitchControlRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connection" + required: true + type: "string" + - name: "switch-control-uuid" + in: "path" + description: "Id of switch-control" + required: true + type: "string" + - name: "connection-uuid" + in: "path" + description: "Id of sub-switch-control" + required: true + type: "string" + - name: "sub-switch-control-switch-control-uuid" + in: "path" + description: "Id of sub-switch-control" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.SwitchControlRef" + schema: + $ref: "#/definitions/tapi.connectivity.SwitchControlRefWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/switch={local-id}/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.Switch" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connection" + required: true + type: "string" + - name: "switch-control-uuid" + in: "path" + description: "Id of switch-control" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of switch" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.Switch" + schema: + $ref: "#/definitions/tapi.connectivity.SwitchWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/switch={local-id}/name={value-name}/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of connection" + required: true + type: "string" + - name: "switch-control-uuid" + in: "path" + description: "Id of switch-control" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of switch" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/switch={local-id}/selected-connection-end-point={topology-uuid},{node-uuid},{node-edge-point-uuid},{connection-end-point-uuid}/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.ConnectionEndPointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connection" + required: true + type: "string" + - name: "switch-control-uuid" + in: "path" + description: "Id of switch-control" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of switch" + required: true + type: "string" + - name: "topology-uuid" + in: "path" + description: "Id of selected-connection-end-point" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of selected-connection-end-point" + required: true + type: "string" + - name: "node-edge-point-uuid" + in: "path" + description: "Id of selected-connection-end-point" + required: true + type: "string" + - name: "connection-end-point-uuid" + in: "path" + description: "Id of selected-connection-end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.ConnectionEndPointRef" + schema: + $ref: "#/definitions/tapi.connectivity.ConnectionEndPointRefWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connection={uuid}/switch-control={switch-control-uuid}/switch={local-id}/selected-route={connection-uuid},{route-local-id}/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.RouteRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connection" + required: true + type: "string" + - name: "switch-control-uuid" + in: "path" + description: "Id of switch-control" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of switch" + required: true + type: "string" + - name: "connection-uuid" + in: "path" + description: "Id of selected-route" + required: true + type: "string" + - name: "route-local-id" + in: "path" + description: "Id of selected-route" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.RouteRef" + schema: + $ref: "#/definitions/tapi.connectivity.RouteRefWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service/: + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.connectivity.ConnectivityService" + description: "none" + parameters: + - in: "body" + name: "tapi.connectivity.ConnectivityService.body-param" + description: "tapi.connectivity.ConnectivityService to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.ConnectivityService" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.ConnectivityService" + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.connectivity.ConnectivityService" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.connectivity.ConnectivityService.body-param" + description: "tapi.connectivity.ConnectivityService to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.connectivity.ConnectivityService" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/connection={connection-uuid}/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.ConnectionRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "connection-uuid" + in: "path" + description: "Id of connection" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.ConnectionRef" + schema: + $ref: "#/definitions/tapi.connectivity.ConnectionRefWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/coroute-inclusion/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.ConnectivityServiceRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.ConnectivityServiceRef" + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceRefWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.connectivity.ConnectivityServiceRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.connectivity.ConnectivityServiceRef.body-param" + description: "tapi.connectivity.ConnectivityServiceRef to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceRefWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.connectivity.ConnectivityServiceRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.connectivity.ConnectivityServiceRef.body-param" + description: "tapi.connectivity.ConnectivityServiceRef to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceRefWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.connectivity.ConnectivityServiceRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/cost-characteristic/: + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.topology.CostCharacteristic" + description: "The list of costs where each cost relates to some aspect of the\ + \ TopologicalEntity." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.topology.CostCharacteristic.body-param" + description: "tapi.topology.CostCharacteristic to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.topology.CostCharacteristicWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/cost-characteristic={cost-name}/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.topology.CostCharacteristic" + description: "The list of costs where each cost relates to some aspect of the\ + \ TopologicalEntity." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "cost-name" + in: "path" + description: "Id of cost-characteristic" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.CostCharacteristic" + schema: + $ref: "#/definitions/tapi.topology.CostCharacteristicWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.topology.CostCharacteristic" + description: "The list of costs where each cost relates to some aspect of the\ + \ TopologicalEntity." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "cost-name" + in: "path" + description: "Id of cost-characteristic" + required: true + type: "string" + - in: "body" + name: "tapi.topology.CostCharacteristic.body-param" + description: "tapi.topology.CostCharacteristic to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.topology.CostCharacteristicWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.topology.CostCharacteristic" + description: "The list of costs where each cost relates to some aspect of the\ + \ TopologicalEntity." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "cost-name" + in: "path" + description: "Id of cost-characteristic" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/diversity-exclusion/: + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.connectivity.ConnectivityServiceRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.connectivity.ConnectivityServiceRef.body-param" + description: "tapi.connectivity.ConnectivityServiceRef to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceRefWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/diversity-exclusion={connectivity-service-uuid}/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.ConnectivityServiceRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "connectivity-service-uuid" + in: "path" + description: "Id of diversity-exclusion" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.ConnectivityServiceRef" + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceRefWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.connectivity.ConnectivityServiceRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "connectivity-service-uuid" + in: "path" + description: "Id of diversity-exclusion" + required: true + type: "string" + - in: "body" + name: "tapi.connectivity.ConnectivityServiceRef.body-param" + description: "tapi.connectivity.ConnectivityServiceRef to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceRefWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.connectivity.ConnectivityServiceRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "connectivity-service-uuid" + in: "path" + description: "Id of diversity-exclusion" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point/: + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.connectivity.ConnectivityServiceEndPoint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.connectivity.ConnectivityServiceEndPoint.body-param" + description: "tapi.connectivity.ConnectivityServiceEndPoint to be added to\ + \ list" + required: false + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceEndPointWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.ConnectivityServiceEndPoint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.ConnectivityServiceEndPoint" + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceEndPointWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.connectivity.ConnectivityServiceEndPoint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.connectivity.ConnectivityServiceEndPoint.body-param" + description: "tapi.connectivity.ConnectivityServiceEndPoint to be added or\ + \ updated" + required: false + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceEndPointWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.connectivity.ConnectivityServiceEndPoint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.Capacity" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.Capacity" + schema: + $ref: "#/definitions/tapi.common.CapacityWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.common.Capacity" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.Capacity.body-param" + description: "tapi.common.Capacity to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.common.Capacity" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.Capacity.body-param" + description: "tapi.common.Capacity to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.common.Capacity" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.BandwidthProfile" + schema: + $ref: "#/definitions/tapi.common.BandwidthProfileWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.BandwidthProfile.body-param" + description: "tapi.common.BandwidthProfile to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.BandwidthProfileWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.BandwidthProfile.body-param" + description: "tapi.common.BandwidthProfile to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.BandwidthProfileWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/total-size/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/connection-end-point={topology-uuid},{node-uuid},{node-edge-point-uuid},{connection-end-point-uuid}/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.ConnectionEndPointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - name: "topology-uuid" + in: "path" + description: "Id of connection-end-point" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of connection-end-point" + required: true + type: "string" + - name: "node-edge-point-uuid" + in: "path" + description: "Id of connection-end-point" + required: true + type: "string" + - name: "connection-end-point-uuid" + in: "path" + description: "Id of connection-end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.ConnectionEndPointRef" + schema: + $ref: "#/definitions/tapi.connectivity.ConnectionEndPointRefWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/name/: + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.NameAndValue.body-param" + description: "tapi.common.NameAndValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/name={value-name}/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + - in: "body" + name: "tapi.common.NameAndValue.body-param" + description: "tapi.common.NameAndValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/peer-fwd-connectivity-service-end-point/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.ConnectivityServiceEndPointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.ConnectivityServiceEndPointRef" + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceEndPointRefWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.connectivity.ConnectivityServiceEndPointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.connectivity.ConnectivityServiceEndPointRef.body-param" + description: "tapi.connectivity.ConnectivityServiceEndPointRef to be added\ + \ to list" + required: false + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceEndPointRefWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.connectivity.ConnectivityServiceEndPointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.connectivity.ConnectivityServiceEndPointRef.body-param" + description: "tapi.connectivity.ConnectivityServiceEndPointRef to be added\ + \ or updated" + required: false + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceEndPointRefWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.connectivity.ConnectivityServiceEndPointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/protecting-connectivity-service-end-point/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.ConnectivityServiceEndPointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.ConnectivityServiceEndPointRef" + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceEndPointRefWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.connectivity.ConnectivityServiceEndPointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.connectivity.ConnectivityServiceEndPointRef.body-param" + description: "tapi.connectivity.ConnectivityServiceEndPointRef to be added\ + \ to list" + required: false + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceEndPointRefWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.connectivity.ConnectivityServiceEndPointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.connectivity.ConnectivityServiceEndPointRef.body-param" + description: "tapi.connectivity.ConnectivityServiceEndPointRef to be added\ + \ or updated" + required: false + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceEndPointRefWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.connectivity.ConnectivityServiceEndPointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/server-connectivity-service-end-point/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.ConnectivityServiceEndPointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.ConnectivityServiceEndPointRef" + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceEndPointRefWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.connectivity.ConnectivityServiceEndPointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.connectivity.ConnectivityServiceEndPointRef.body-param" + description: "tapi.connectivity.ConnectivityServiceEndPointRef to be added\ + \ to list" + required: false + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceEndPointRefWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.connectivity.ConnectivityServiceEndPointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.connectivity.ConnectivityServiceEndPointRef.body-param" + description: "tapi.connectivity.ConnectivityServiceEndPointRef to be added\ + \ or updated" + required: false + schema: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceEndPointRefWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.connectivity.ConnectivityServiceEndPointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/end-point={local-id}/service-interface-point/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.ServiceInterfacePointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.ServiceInterfacePointRef" + schema: + $ref: "#/definitions/tapi.common.ServiceInterfacePointRefWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.common.ServiceInterfacePointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.ServiceInterfacePointRef.body-param" + description: "tapi.common.ServiceInterfacePointRef to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.ServiceInterfacePointRefWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.common.ServiceInterfacePointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.ServiceInterfacePointRef.body-param" + description: "tapi.common.ServiceInterfacePointRef to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.ServiceInterfacePointRefWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.common.ServiceInterfacePointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/latency-characteristic/: + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.topology.LatencyCharacteristic" + description: "The effect on the latency of a queuing process. This only has\ + \ significant effect for packet based systems and has a complex characteristic." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.topology.LatencyCharacteristic.body-param" + description: "tapi.topology.LatencyCharacteristic to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.topology.LatencyCharacteristicWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/latency-characteristic={traffic-property-name}/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.topology.LatencyCharacteristic" + description: "The effect on the latency of a queuing process. This only has\ + \ significant effect for packet based systems and has a complex characteristic." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "traffic-property-name" + in: "path" + description: "Id of latency-characteristic" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.LatencyCharacteristic" + schema: + $ref: "#/definitions/tapi.topology.LatencyCharacteristicWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.topology.LatencyCharacteristic" + description: "The effect on the latency of a queuing process. This only has\ + \ significant effect for packet based systems and has a complex characteristic." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "traffic-property-name" + in: "path" + description: "Id of latency-characteristic" + required: true + type: "string" + - in: "body" + name: "tapi.topology.LatencyCharacteristic.body-param" + description: "tapi.topology.LatencyCharacteristic to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.topology.LatencyCharacteristicWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.topology.LatencyCharacteristic" + description: "The effect on the latency of a queuing process. This only has\ + \ significant effect for packet based systems and has a complex characteristic." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "traffic-property-name" + in: "path" + description: "Id of latency-characteristic" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/max-allowed-cost/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.path.computation.ValueOrPriority" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 200: + description: "tapi.path.computation.ValueOrPriority" + schema: + $ref: "#/definitions/tapi.path.computation.ValueOrPriorityWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.path.computation.ValueOrPriority" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.ValueOrPriority.body-param" + description: "tapi.path.computation.ValueOrPriority to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.ValueOrPriorityWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.path.computation.ValueOrPriority" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.ValueOrPriority.body-param" + description: "tapi.path.computation.ValueOrPriority to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.ValueOrPriorityWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.path.computation.ValueOrPriority" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/max-allowed-delay/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.path.computation.ValueOrPriority" + description: "Delay unit is microseconds." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 200: + description: "tapi.path.computation.ValueOrPriority" + schema: + $ref: "#/definitions/tapi.path.computation.ValueOrPriorityWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.path.computation.ValueOrPriority" + description: "Delay unit is microseconds." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.ValueOrPriority.body-param" + description: "tapi.path.computation.ValueOrPriority to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.ValueOrPriorityWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.path.computation.ValueOrPriority" + description: "Delay unit is microseconds." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.ValueOrPriority.body-param" + description: "tapi.path.computation.ValueOrPriority to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.ValueOrPriorityWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.path.computation.ValueOrPriority" + description: "Delay unit is microseconds." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/max-allowed-hops/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.path.computation.ValueOrPriority" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 200: + description: "tapi.path.computation.ValueOrPriority" + schema: + $ref: "#/definitions/tapi.path.computation.ValueOrPriorityWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.path.computation.ValueOrPriority" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.ValueOrPriority.body-param" + description: "tapi.path.computation.ValueOrPriority to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.ValueOrPriorityWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.path.computation.ValueOrPriority" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.ValueOrPriority.body-param" + description: "tapi.path.computation.ValueOrPriority to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.ValueOrPriorityWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.path.computation.ValueOrPriority" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/name/: + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.common.NameAndValue.body-param" + description: "tapi.common.NameAndValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/name={value-name}/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + - in: "body" + name: "tapi.common.NameAndValue.body-param" + description: "tapi.common.NameAndValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.Capacity" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 200: + description: "tapi.common.Capacity" + schema: + $ref: "#/definitions/tapi.common.CapacityWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.common.Capacity" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.common.Capacity.body-param" + description: "tapi.common.Capacity to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.common.Capacity" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.common.Capacity.body-param" + description: "tapi.common.Capacity to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.common.Capacity" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 200: + description: "tapi.common.BandwidthProfile" + schema: + $ref: "#/definitions/tapi.common.BandwidthProfileWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.common.BandwidthProfile.body-param" + description: "tapi.common.BandwidthProfile to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.BandwidthProfileWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.common.BandwidthProfile.body-param" + description: "tapi.common.BandwidthProfile to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.BandwidthProfileWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/requested-capacity/total-size/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/resilience-type/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.topology.ResilienceType" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.ResilienceType" + schema: + $ref: "#/definitions/tapi.topology.ResilienceTypeWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.topology.ResilienceType" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.topology.ResilienceType.body-param" + description: "tapi.topology.ResilienceType to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.topology.ResilienceTypeWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.topology.ResilienceType" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.topology.ResilienceType.body-param" + description: "tapi.topology.ResilienceType to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.topology.ResilienceTypeWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.topology.ResilienceType" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/risk-diversity-characteristic/: + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.topology.RiskCharacteristic" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.topology.RiskCharacteristic.body-param" + description: "tapi.topology.RiskCharacteristic to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.topology.RiskCharacteristicWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + ? /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/risk-diversity-characteristic={risk-characteristic-name}/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.topology.RiskCharacteristic" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "risk-characteristic-name" + in: "path" + description: "Id of risk-diversity-characteristic" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.RiskCharacteristic" + schema: + $ref: "#/definitions/tapi.topology.RiskCharacteristicWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.topology.RiskCharacteristic" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "risk-characteristic-name" + in: "path" + description: "Id of risk-diversity-characteristic" + required: true + type: "string" + - in: "body" + name: "tapi.topology.RiskCharacteristic.body-param" + description: "tapi.topology.RiskCharacteristic to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.topology.RiskCharacteristicWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.topology.RiskCharacteristic" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - name: "risk-characteristic-name" + in: "path" + description: "Id of risk-diversity-characteristic" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-connectivity:connectivity-context/connectivity-service={uuid}/schedule/: + get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.TimeRange" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 200: + description: "tapi.common.TimeRange" + schema: + $ref: "#/definitions/tapi.common.TimeRangeWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-connectivity" + summary: "creates tapi.common.TimeRange" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.common.TimeRange.body-param" + description: "tapi.common.TimeRange to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.TimeRangeWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-connectivity" + summary: "creates or updates tapi.common.TimeRange" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + - in: "body" + name: "tapi.common.TimeRange.body-param" + description: "tapi.common.TimeRange to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.TimeRangeWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-connectivity" + summary: "removes tapi.common.TimeRange" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of connectivity-service" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-notification:notification-context/: + get: + tags: + - "tapi-notification" + summary: "returns tapi.notification.NotificationContext" + description: "Augments the base TAPI Context with NotificationService information" + parameters: [] + responses: + 200: + description: "tapi.notification.NotificationContext" + schema: + $ref: "#/definitions/tapi.notification.NotificationContextWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-notification" + summary: "creates tapi.notification.NotificationContext" + description: "Augments the base TAPI Context with NotificationService information" + parameters: + - in: "body" + name: "tapi.notification.NotificationContext.body-param" + description: "tapi.notification.NotificationContext to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.notification.NotificationContextWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-notification" + summary: "creates or updates tapi.notification.NotificationContext" + description: "Augments the base TAPI Context with NotificationService information" + parameters: + - in: "body" + name: "tapi.notification.NotificationContext.body-param" + description: "tapi.notification.NotificationContext to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.notification.NotificationContextWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-notification" + summary: "removes tapi.notification.NotificationContext" + description: "Augments the base TAPI Context with NotificationService information" + parameters: [] + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-notification:notification-context/notif-subscription/: + post: + tags: + - "tapi-notification" + summary: "creates tapi.notification.NotificationSubscriptionService" + description: "none" + parameters: + - in: "body" + name: "tapi.notification.NotificationSubscriptionService.body-param" + description: "tapi.notification.NotificationSubscriptionService to be added\ + \ to list" + required: false + schema: + $ref: "#/definitions/tapi.notification.NotificationSubscriptionServiceWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/: + get: + tags: + - "tapi-notification" + summary: "returns tapi.notification.NotificationSubscriptionService" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + responses: + 200: + description: "tapi.notification.NotificationSubscriptionService" + schema: + $ref: "#/definitions/tapi.notification.NotificationSubscriptionServiceWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-notification" + summary: "creates or updates tapi.notification.NotificationSubscriptionService" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + - in: "body" + name: "tapi.notification.NotificationSubscriptionService.body-param" + description: "tapi.notification.NotificationSubscriptionService to be added\ + \ or updated" + required: false + schema: + $ref: "#/definitions/tapi.notification.NotificationSubscriptionServiceWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-notification" + summary: "removes tapi.notification.NotificationSubscriptionService" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/name/: + post: + tags: + - "tapi-notification" + summary: "creates tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + - in: "body" + name: "tapi.common.NameAndValue.body-param" + description: "tapi.common.NameAndValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/name={value-name}/: + get: + tags: + - "tapi-notification" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-notification" + summary: "creates or updates tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + - in: "body" + name: "tapi.common.NameAndValue.body-param" + description: "tapi.common.NameAndValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-notification" + summary: "removes tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification-channel/: + get: + tags: + - "tapi-notification" + summary: "returns tapi.notification.NotificationChannel" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + responses: + 200: + description: "tapi.notification.NotificationChannel" + schema: + $ref: "#/definitions/tapi.notification.NotificationChannelWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification-channel/name={value-name}/ + : get: + tags: + - "tapi-notification" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification={notification-uuid}/: + get: + tags: + - "tapi-notification" + summary: "returns tapi.notification.Notification" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + - name: "notification-uuid" + in: "path" + description: "Id of notification" + required: true + type: "string" + responses: + 200: + description: "tapi.notification.Notification" + schema: + $ref: "#/definitions/tapi.notification.NotificationWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification={notification-uuid}/additional-info={value-name}/ + : get: + tags: + - "tapi-notification" + summary: "returns tapi.common.NameAndValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + - name: "notification-uuid" + in: "path" + description: "Id of notification" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of additional-info" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification={notification-uuid}/alarm-info/ + : get: + tags: + - "tapi-notification" + summary: "returns tapi.notification.AlarmInfo" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + - name: "notification-uuid" + in: "path" + description: "Id of notification" + required: true + type: "string" + responses: + 200: + description: "tapi.notification.AlarmInfo" + schema: + $ref: "#/definitions/tapi.notification.AlarmInfoWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification={notification-uuid}/changed-attributes={value-name}/ + : get: + tags: + - "tapi-notification" + summary: "returns tapi.notification.NameAndValueChange" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + - name: "notification-uuid" + in: "path" + description: "Id of notification" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of changed-attributes" + required: true + type: "string" + responses: + 200: + description: "tapi.notification.NameAndValueChange" + schema: + $ref: "#/definitions/tapi.notification.NameAndValueChangeWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification={notification-uuid}/name={value-name}/ + : get: + tags: + - "tapi-notification" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + - name: "notification-uuid" + in: "path" + description: "Id of notification" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification={notification-uuid}/target-object-name={value-name}/ + : get: + tags: + - "tapi-notification" + summary: "returns tapi.common.NameAndValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + - name: "notification-uuid" + in: "path" + description: "Id of notification" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of target-object-name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/notification={notification-uuid}/tca-info/ + : get: + tags: + - "tapi-notification" + summary: "returns tapi.notification.TcaInfo" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + - name: "notification-uuid" + in: "path" + description: "Id of notification" + required: true + type: "string" + responses: + 200: + description: "tapi.notification.TcaInfo" + schema: + $ref: "#/definitions/tapi.notification.TcaInfoWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/subscription-filter/: + get: + tags: + - "tapi-notification" + summary: "returns tapi.notification.SubscriptionFilter" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + responses: + 200: + description: "tapi.notification.SubscriptionFilter" + schema: + $ref: "#/definitions/tapi.notification.SubscriptionFilterWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-notification" + summary: "creates tapi.notification.SubscriptionFilter" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + - in: "body" + name: "tapi.notification.SubscriptionFilter.body-param" + description: "tapi.notification.SubscriptionFilter to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.notification.SubscriptionFilterWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-notification" + summary: "creates or updates tapi.notification.SubscriptionFilter" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + - in: "body" + name: "tapi.notification.SubscriptionFilter.body-param" + description: "tapi.notification.SubscriptionFilter to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.notification.SubscriptionFilterWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-notification" + summary: "removes tapi.notification.SubscriptionFilter" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/subscription-filter/name/: + post: + tags: + - "tapi-notification" + summary: "creates tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + - in: "body" + name: "tapi.common.NameAndValue.body-param" + description: "tapi.common.NameAndValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + ? /data/tapi-common:context/tapi-notification:notification-context/notif-subscription={uuid}/subscription-filter/name={value-name}/ + : get: + tags: + - "tapi-notification" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-notification" + summary: "creates or updates tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + - in: "body" + name: "tapi.common.NameAndValue.body-param" + description: "tapi.common.NameAndValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-notification" + summary: "removes tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of notif-subscription" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-notification:notification-context/notification={uuid}/: + get: + tags: + - "tapi-notification" + summary: "returns tapi.notification.Notification" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of notification" + required: true + type: "string" + responses: + 200: + description: "tapi.notification.Notification" + schema: + $ref: "#/definitions/tapi.notification.NotificationWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-notification:notification-context/notification={uuid}/additional-info={value-name}/: + get: + tags: + - "tapi-notification" + summary: "returns tapi.common.NameAndValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of notification" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of additional-info" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-notification:notification-context/notification={uuid}/alarm-info/: + get: + tags: + - "tapi-notification" + summary: "returns tapi.notification.AlarmInfo" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of notification" + required: true + type: "string" + responses: + 200: + description: "tapi.notification.AlarmInfo" + schema: + $ref: "#/definitions/tapi.notification.AlarmInfoWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-notification:notification-context/notification={uuid}/changed-attributes={value-name}/: + get: + tags: + - "tapi-notification" + summary: "returns tapi.notification.NameAndValueChange" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of notification" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of changed-attributes" + required: true + type: "string" + responses: + 200: + description: "tapi.notification.NameAndValueChange" + schema: + $ref: "#/definitions/tapi.notification.NameAndValueChangeWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-notification:notification-context/notification={uuid}/name={value-name}/: + get: + tags: + - "tapi-notification" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of notification" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-notification:notification-context/notification={uuid}/target-object-name={value-name}/: + get: + tags: + - "tapi-notification" + summary: "returns tapi.common.NameAndValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of notification" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of target-object-name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-notification:notification-context/notification={uuid}/tca-info/: + get: + tags: + - "tapi-notification" + summary: "returns tapi.notification.TcaInfo" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of notification" + required: true + type: "string" + responses: + 200: + description: "tapi.notification.TcaInfo" + schema: + $ref: "#/definitions/tapi.notification.TcaInfoWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-path-computation:path-computation-context/: + get: + tags: + - "tapi-path-computation" + summary: "returns tapi.path.computation.PathComputationContext" + description: "Augments the base TAPI Context with PathComputationService information" + parameters: [] + responses: + 200: + description: "tapi.path.computation.PathComputationContext" + schema: + $ref: "#/definitions/tapi.path.computation.PathComputationContextWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-path-computation" + summary: "creates tapi.path.computation.PathComputationContext" + description: "Augments the base TAPI Context with PathComputationService information" + parameters: + - in: "body" + name: "tapi.path.computation.PathComputationContext.body-param" + description: "tapi.path.computation.PathComputationContext to be added to\ + \ list" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.PathComputationContextWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.path.computation.PathComputationContext" + description: "Augments the base TAPI Context with PathComputationService information" + parameters: + - in: "body" + name: "tapi.path.computation.PathComputationContext.body-param" + description: "tapi.path.computation.PathComputationContext to be added or\ + \ updated" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.PathComputationContextWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.path.computation.PathComputationContext" + description: "Augments the base TAPI Context with PathComputationService information" + parameters: [] + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service/: + post: + tags: + - "tapi-path-computation" + summary: "creates tapi.path.computation.PathComputationService" + description: "none" + parameters: + - in: "body" + name: "tapi.path.computation.PathComputationService.body-param" + description: "tapi.path.computation.PathComputationService to be added to\ + \ list" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.PathComputationServiceWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/: + get: + tags: + - "tapi-path-computation" + summary: "returns tapi.path.computation.PathComputationService" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + responses: + 200: + description: "tapi.path.computation.PathComputationService" + schema: + $ref: "#/definitions/tapi.path.computation.PathComputationServiceWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.path.computation.PathComputationService" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.PathComputationService.body-param" + description: "tapi.path.computation.PathComputationService to be added or\ + \ updated" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.PathComputationServiceWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.path.computation.PathComputationService" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point/: + post: + tags: + - "tapi-path-computation" + summary: "creates tapi.path.computation.PathServiceEndPoint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.PathServiceEndPoint.body-param" + description: "tapi.path.computation.PathServiceEndPoint to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.PathServiceEndPointWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/: + get: + tags: + - "tapi-path-computation" + summary: "returns tapi.path.computation.PathServiceEndPoint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.path.computation.PathServiceEndPoint" + schema: + $ref: "#/definitions/tapi.path.computation.PathServiceEndPointWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.path.computation.PathServiceEndPoint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.PathServiceEndPoint.body-param" + description: "tapi.path.computation.PathServiceEndPoint to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.PathServiceEndPointWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.path.computation.PathServiceEndPoint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/ + : get: + tags: + - "tapi-path-computation" + summary: "returns tapi.common.Capacity" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.Capacity" + schema: + $ref: "#/definitions/tapi.common.CapacityWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-path-computation" + summary: "creates tapi.common.Capacity" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.Capacity.body-param" + description: "tapi.common.Capacity to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.common.Capacity" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.Capacity.body-param" + description: "tapi.common.Capacity to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.common.Capacity" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/ + : get: + tags: + - "tapi-path-computation" + summary: "returns tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.BandwidthProfile" + schema: + $ref: "#/definitions/tapi.common.BandwidthProfileWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-path-computation" + summary: "creates tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.BandwidthProfile.body-param" + description: "tapi.common.BandwidthProfile to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.BandwidthProfileWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.BandwidthProfile.body-param" + description: "tapi.common.BandwidthProfile to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.BandwidthProfileWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - "tapi-path-computation" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-path-computation" + summary: "creates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - "tapi-path-computation" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-path-computation" + summary: "creates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - "tapi-path-computation" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-path-computation" + summary: "creates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - "tapi-path-computation" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-path-computation" + summary: "creates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/capacity/total-size/ + : get: + tags: + - "tapi-path-computation" + summary: "returns tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-path-computation" + summary: "creates tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.CapacityValue.body-param" + description: "tapi.common.CapacityValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/name/: + post: + tags: + - "tapi-path-computation" + summary: "creates tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.NameAndValue.body-param" + description: "tapi.common.NameAndValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/name={value-name}/ + : get: + tags: + - "tapi-path-computation" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + - in: "body" + name: "tapi.common.NameAndValue.body-param" + description: "tapi.common.NameAndValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/end-point={local-id}/service-interface-point/ + : get: + tags: + - "tapi-path-computation" + summary: "returns tapi.common.ServiceInterfacePointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.ServiceInterfacePointRef" + schema: + $ref: "#/definitions/tapi.common.ServiceInterfacePointRefWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-path-computation" + summary: "creates tapi.common.ServiceInterfacePointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.ServiceInterfacePointRef.body-param" + description: "tapi.common.ServiceInterfacePointRef to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.ServiceInterfacePointRefWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.common.ServiceInterfacePointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + - in: "body" + name: "tapi.common.ServiceInterfacePointRef.body-param" + description: "tapi.common.ServiceInterfacePointRef to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.ServiceInterfacePointRefWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.common.ServiceInterfacePointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of end-point" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/name/: + post: + tags: + - "tapi-path-computation" + summary: "creates tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - in: "body" + name: "tapi.common.NameAndValue.body-param" + description: "tapi.common.NameAndValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/name={value-name}/: + get: + tags: + - "tapi-path-computation" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + - in: "body" + name: "tapi.common.NameAndValue.body-param" + description: "tapi.common.NameAndValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/objective-function/: + get: + tags: + - "tapi-path-computation" + summary: "returns tapi.path.computation.PathObjectiveFunction" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + responses: + 200: + description: "tapi.path.computation.PathObjectiveFunction" + schema: + $ref: "#/definitions/tapi.path.computation.PathObjectiveFunctionWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-path-computation" + summary: "creates tapi.path.computation.PathObjectiveFunction" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.PathObjectiveFunction.body-param" + description: "tapi.path.computation.PathObjectiveFunction to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.PathObjectiveFunctionWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.path.computation.PathObjectiveFunction" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.PathObjectiveFunction.body-param" + description: "tapi.path.computation.PathObjectiveFunction to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.PathObjectiveFunctionWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.path.computation.PathObjectiveFunction" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/objective-function/name/: + post: + tags: + - "tapi-path-computation" + summary: "creates tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - in: "body" + name: "tapi.common.NameAndValue.body-param" + description: "tapi.common.NameAndValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/objective-function/name={value-name}/ + : get: + tags: + - "tapi-path-computation" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + - in: "body" + name: "tapi.common.NameAndValue.body-param" + description: "tapi.common.NameAndValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/optimization-constraint/: + get: + tags: + - "tapi-path-computation" + summary: "returns tapi.path.computation.PathOptimizationConstraint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + responses: + 200: + description: "tapi.path.computation.PathOptimizationConstraint" + schema: + $ref: "#/definitions/tapi.path.computation.PathOptimizationConstraintWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-path-computation" + summary: "creates tapi.path.computation.PathOptimizationConstraint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.PathOptimizationConstraint.body-param" + description: "tapi.path.computation.PathOptimizationConstraint to be added\ + \ to list" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.PathOptimizationConstraintWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.path.computation.PathOptimizationConstraint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.PathOptimizationConstraint.body-param" + description: "tapi.path.computation.PathOptimizationConstraint to be added\ + \ or updated" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.PathOptimizationConstraintWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.path.computation.PathOptimizationConstraint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/optimization-constraint/name/: + post: + tags: + - "tapi-path-computation" + summary: "creates tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - in: "body" + name: "tapi.common.NameAndValue.body-param" + description: "tapi.common.NameAndValue to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/optimization-constraint/name={value-name}/ + : get: + tags: + - "tapi-path-computation" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + - in: "body" + name: "tapi.common.NameAndValue.body-param" + description: "tapi.common.NameAndValue to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/path={path-uuid}/: + get: + tags: + - "tapi-path-computation" + summary: "returns tapi.path.computation.PathRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "path-uuid" + in: "path" + description: "Id of path" + required: true + type: "string" + responses: + 200: + description: "tapi.path.computation.PathRef" + schema: + $ref: "#/definitions/tapi.path.computation.PathRefWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/: + get: + tags: + - "tapi-path-computation" + summary: "returns tapi.path.computation.RoutingConstraint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + responses: + 200: + description: "tapi.path.computation.RoutingConstraint" + schema: + $ref: "#/definitions/tapi.path.computation.RoutingConstraintWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-path-computation" + summary: "creates tapi.path.computation.RoutingConstraint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.RoutingConstraint.body-param" + description: "tapi.path.computation.RoutingConstraint to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.RoutingConstraintWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.path.computation.RoutingConstraint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.RoutingConstraint.body-param" + description: "tapi.path.computation.RoutingConstraint to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.RoutingConstraintWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.path.computation.RoutingConstraint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/cost-characteristic/ + : post: + tags: + - "tapi-path-computation" + summary: "creates tapi.topology.CostCharacteristic" + description: "The list of costs where each cost relates to some aspect of the\ + \ TopologicalEntity." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - in: "body" + name: "tapi.topology.CostCharacteristic.body-param" + description: "tapi.topology.CostCharacteristic to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.topology.CostCharacteristicWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/cost-characteristic={cost-name}/ + : get: + tags: + - "tapi-path-computation" + summary: "returns tapi.topology.CostCharacteristic" + description: "The list of costs where each cost relates to some aspect of the\ + \ TopologicalEntity." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "cost-name" + in: "path" + description: "Id of cost-characteristic" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.CostCharacteristic" + schema: + $ref: "#/definitions/tapi.topology.CostCharacteristicWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.topology.CostCharacteristic" + description: "The list of costs where each cost relates to some aspect of the\ + \ TopologicalEntity." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "cost-name" + in: "path" + description: "Id of cost-characteristic" + required: true + type: "string" + - in: "body" + name: "tapi.topology.CostCharacteristic.body-param" + description: "tapi.topology.CostCharacteristic to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.topology.CostCharacteristicWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.topology.CostCharacteristic" + description: "The list of costs where each cost relates to some aspect of the\ + \ TopologicalEntity." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "cost-name" + in: "path" + description: "Id of cost-characteristic" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/latency-characteristic/ + : post: + tags: + - "tapi-path-computation" + summary: "creates tapi.topology.LatencyCharacteristic" + description: "The effect on the latency of a queuing process. This only has\ + \ significant effect for packet based systems and has a complex characteristic." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - in: "body" + name: "tapi.topology.LatencyCharacteristic.body-param" + description: "tapi.topology.LatencyCharacteristic to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.topology.LatencyCharacteristicWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/latency-characteristic={traffic-property-name}/ + : get: + tags: + - "tapi-path-computation" + summary: "returns tapi.topology.LatencyCharacteristic" + description: "The effect on the latency of a queuing process. This only has\ + \ significant effect for packet based systems and has a complex characteristic." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "traffic-property-name" + in: "path" + description: "Id of latency-characteristic" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.LatencyCharacteristic" + schema: + $ref: "#/definitions/tapi.topology.LatencyCharacteristicWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.topology.LatencyCharacteristic" + description: "The effect on the latency of a queuing process. This only has\ + \ significant effect for packet based systems and has a complex characteristic." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "traffic-property-name" + in: "path" + description: "Id of latency-characteristic" + required: true + type: "string" + - in: "body" + name: "tapi.topology.LatencyCharacteristic.body-param" + description: "tapi.topology.LatencyCharacteristic to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.topology.LatencyCharacteristicWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.topology.LatencyCharacteristic" + description: "The effect on the latency of a queuing process. This only has\ + \ significant effect for packet based systems and has a complex characteristic." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "traffic-property-name" + in: "path" + description: "Id of latency-characteristic" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/max-allowed-cost/ + : get: + tags: + - "tapi-path-computation" + summary: "returns tapi.path.computation.ValueOrPriority" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + responses: + 200: + description: "tapi.path.computation.ValueOrPriority" + schema: + $ref: "#/definitions/tapi.path.computation.ValueOrPriorityWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-path-computation" + summary: "creates tapi.path.computation.ValueOrPriority" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.ValueOrPriority.body-param" + description: "tapi.path.computation.ValueOrPriority to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.ValueOrPriorityWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.path.computation.ValueOrPriority" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.ValueOrPriority.body-param" + description: "tapi.path.computation.ValueOrPriority to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.ValueOrPriorityWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.path.computation.ValueOrPriority" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/max-allowed-delay/ + : get: + tags: + - "tapi-path-computation" + summary: "returns tapi.path.computation.ValueOrPriority" + description: "Delay unit is microseconds." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + responses: + 200: + description: "tapi.path.computation.ValueOrPriority" + schema: + $ref: "#/definitions/tapi.path.computation.ValueOrPriorityWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-path-computation" + summary: "creates tapi.path.computation.ValueOrPriority" + description: "Delay unit is microseconds." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.ValueOrPriority.body-param" + description: "tapi.path.computation.ValueOrPriority to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.ValueOrPriorityWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.path.computation.ValueOrPriority" + description: "Delay unit is microseconds." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.ValueOrPriority.body-param" + description: "tapi.path.computation.ValueOrPriority to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.ValueOrPriorityWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.path.computation.ValueOrPriority" + description: "Delay unit is microseconds." + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/max-allowed-hops/ + : get: + tags: + - "tapi-path-computation" + summary: "returns tapi.path.computation.ValueOrPriority" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + responses: + 200: + description: "tapi.path.computation.ValueOrPriority" + schema: + $ref: "#/definitions/tapi.path.computation.ValueOrPriorityWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-path-computation" + summary: "creates tapi.path.computation.ValueOrPriority" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.ValueOrPriority.body-param" + description: "tapi.path.computation.ValueOrPriority to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.ValueOrPriorityWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.path.computation.ValueOrPriority" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.ValueOrPriority.body-param" + description: "tapi.path.computation.ValueOrPriority to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.ValueOrPriorityWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.path.computation.ValueOrPriority" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/risk-diversity-characteristic/ + : post: + tags: + - "tapi-path-computation" + summary: "creates tapi.topology.RiskCharacteristic" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - in: "body" + name: "tapi.topology.RiskCharacteristic.body-param" + description: "tapi.topology.RiskCharacteristic to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.topology.RiskCharacteristicWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/routing-constraint/risk-diversity-characteristic={risk-characteristic-name}/ + : get: + tags: + - "tapi-path-computation" + summary: "returns tapi.topology.RiskCharacteristic" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "risk-characteristic-name" + in: "path" + description: "Id of risk-diversity-characteristic" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.RiskCharacteristic" + schema: + $ref: "#/definitions/tapi.topology.RiskCharacteristicWrapper" + 400: + description: "Internal error" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.topology.RiskCharacteristic" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "risk-characteristic-name" + in: "path" + description: "Id of risk-diversity-characteristic" + required: true + type: "string" + - in: "body" + name: "tapi.topology.RiskCharacteristic.body-param" + description: "tapi.topology.RiskCharacteristic to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.topology.RiskCharacteristicWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.topology.RiskCharacteristic" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - name: "risk-characteristic-name" + in: "path" + description: "Id of risk-diversity-characteristic" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-path-computation:path-computation-context/path-comp-service={uuid}/topology-constraint/: + get: + tags: + - "tapi-path-computation" + summary: "returns tapi.path.computation.TopologyConstraint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + responses: + 200: + description: "tapi.path.computation.TopologyConstraint" + schema: + $ref: "#/definitions/tapi.path.computation.TopologyConstraintWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-path-computation" + summary: "creates tapi.path.computation.TopologyConstraint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.TopologyConstraint.body-param" + description: "tapi.path.computation.TopologyConstraint to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.TopologyConstraintWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-path-computation" + summary: "creates or updates tapi.path.computation.TopologyConstraint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + - in: "body" + name: "tapi.path.computation.TopologyConstraint.body-param" + description: "tapi.path.computation.TopologyConstraint to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.path.computation.TopologyConstraintWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-path-computation" + summary: "removes tapi.path.computation.TopologyConstraint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path-comp-service" + required: true + type: "string" + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/: + get: + tags: + - "tapi-path-computation" + summary: "returns tapi.path.computation.Path" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path" + required: true + type: "string" + responses: + 200: + description: "tapi.path.computation.Path" + schema: + $ref: "#/definitions/tapi.path.computation.PathWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/link={topology-uuid},{link-uuid}/: + get: + tags: + - "tapi-path-computation" + summary: "returns tapi.topology.LinkRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path" + required: true + type: "string" + - name: "topology-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.LinkRef" + schema: + $ref: "#/definitions/tapi.topology.LinkRefWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/name={value-name}/: + get: + tags: + - "tapi-path-computation" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of path" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/routing-constraint/: + get: + tags: + - "tapi-path-computation" + summary: "returns tapi.path.computation.RoutingConstraint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path" + required: true + type: "string" + responses: + 200: + description: "tapi.path.computation.RoutingConstraint" + schema: + $ref: "#/definitions/tapi.path.computation.RoutingConstraintWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/routing-constraint/cost-characteristic={cost-name}/ + : get: + tags: + - "tapi-path-computation" + summary: "returns tapi.topology.CostCharacteristic" + description: "The list of costs where each cost relates to some aspect of the\ + \ TopologicalEntity." + parameters: + - name: "uuid" + in: "path" + description: "Id of path" + required: true + type: "string" + - name: "cost-name" + in: "path" + description: "Id of cost-characteristic" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.CostCharacteristic" + schema: + $ref: "#/definitions/tapi.topology.CostCharacteristicWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/routing-constraint/latency-characteristic={traffic-property-name}/ + : get: + tags: + - "tapi-path-computation" + summary: "returns tapi.topology.LatencyCharacteristic" + description: "The effect on the latency of a queuing process. This only has\ + \ significant effect for packet based systems and has a complex characteristic." + parameters: + - name: "uuid" + in: "path" + description: "Id of path" + required: true + type: "string" + - name: "traffic-property-name" + in: "path" + description: "Id of latency-characteristic" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.LatencyCharacteristic" + schema: + $ref: "#/definitions/tapi.topology.LatencyCharacteristicWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/routing-constraint/max-allowed-cost/: + get: + tags: + - "tapi-path-computation" + summary: "returns tapi.path.computation.ValueOrPriority" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path" + required: true + type: "string" + responses: + 200: + description: "tapi.path.computation.ValueOrPriority" + schema: + $ref: "#/definitions/tapi.path.computation.ValueOrPriorityWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/routing-constraint/max-allowed-delay/: + get: + tags: + - "tapi-path-computation" + summary: "returns tapi.path.computation.ValueOrPriority" + description: "Delay unit is microseconds." + parameters: + - name: "uuid" + in: "path" + description: "Id of path" + required: true + type: "string" + responses: + 200: + description: "tapi.path.computation.ValueOrPriority" + schema: + $ref: "#/definitions/tapi.path.computation.ValueOrPriorityWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/routing-constraint/max-allowed-hops/: + get: + tags: + - "tapi-path-computation" + summary: "returns tapi.path.computation.ValueOrPriority" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path" + required: true + type: "string" + responses: + 200: + description: "tapi.path.computation.ValueOrPriority" + schema: + $ref: "#/definitions/tapi.path.computation.ValueOrPriorityWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-path-computation:path-computation-context/path={uuid}/routing-constraint/risk-diversity-characteristic={risk-characteristic-name}/ + : get: + tags: + - "tapi-path-computation" + summary: "returns tapi.topology.RiskCharacteristic" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of path" + required: true + type: "string" + - name: "risk-characteristic-name" + in: "path" + description: "Id of risk-diversity-characteristic" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.RiskCharacteristic" + schema: + $ref: "#/definitions/tapi.topology.RiskCharacteristicWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.context.TopologyContext" + description: "Augments the base TAPI Context with TopologyService information" + parameters: [] + responses: + 200: + description: "tapi.topology.TopologyContext" + schema: + $ref: "#/definitions/tapi.topology.TopologyContextWrapper" + 400: + description: "Internal error" + post: + tags: + - "tapi-topology" + summary: "creates tapi.topology.context.TopologyContext" + description: "Augments the base TAPI Context with TopologyService information" + parameters: + - in: "body" + name: "tapi.topology.context.TopologyContext.body-param" + description: "tapi.topology.TopologyContext to be added to list" + required: false + schema: + $ref: "#/definitions/tapi.topology.TopologyContextWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 409: + description: "Object already exists" + put: + tags: + - "tapi-topology" + summary: "creates or updates tapi.topology.context.TopologyContext" + description: "Augments the base TAPI Context with TopologyService information" + parameters: + - in: "body" + name: "tapi.topology.context.TopologyContext.body-param" + description: "tapi.topology.TopologyContext to be added or updated" + required: false + schema: + $ref: "#/definitions/tapi.topology.TopologyContextWrapper" + responses: + 201: + description: "Object created" + 400: + description: "Internal error" + 204: + description: "Object modified" + delete: + tags: + - "tapi-topology" + summary: "removes tapi.topology.context.TopologyContext" + description: "Augments the base TAPI Context with TopologyService information" + parameters: [] + responses: + 400: + description: "Internal error" + 204: + description: "Object deleted" + /data/tapi-common:context/tapi-topology:topology-context/nw-topology-service/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.NetworkTopologyService" + description: "none" + parameters: [] + responses: + 200: + description: "tapi.topology.NetworkTopologyService" + schema: + $ref: "#/definitions/tapi.topology.NetworkTopologyServiceWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/nw-topology-service/name={value-name}/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/nw-topology-service/topology={topology-uuid}/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.TopologyRef" + description: "none" + parameters: + - name: "topology-uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.TopologyRef" + schema: + $ref: "#/definitions/tapi.topology.TopologyRefWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.topologycontext.Topology" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.Topology" + schema: + $ref: "#/definitions/tapi.topology.TopologyWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.Link" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.Link" + schema: + $ref: "#/definitions/tapi.topology.LinkWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/available-capacity/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.common.Capacity" + description: "Capacity available to be assigned." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + responses: + 200: + description: "tapi.common.Capacity" + schema: + $ref: "#/definitions/tapi.common.CapacityWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/available-capacity/bandwidth-profile/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + responses: + 200: + description: "tapi.common.BandwidthProfile" + schema: + $ref: "#/definitions/tapi.common.BandwidthProfileWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/available-capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/available-capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/available-capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/available-capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/available-capacity/total-size/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/cost-characteristic={cost-name}/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.CostCharacteristic" + description: "The list of costs where each cost relates to some aspect of the\ + \ TopologicalEntity." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + - name: "cost-name" + in: "path" + description: "Id of cost-characteristic" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.CostCharacteristic" + schema: + $ref: "#/definitions/tapi.topology.CostCharacteristicWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/latency-characteristic={traffic-property-name}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.LatencyCharacteristic" + description: "The effect on the latency of a queuing process. This only has\ + \ significant effect for packet based systems and has a complex characteristic." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + - name: "traffic-property-name" + in: "path" + description: "Id of latency-characteristic" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.LatencyCharacteristic" + schema: + $ref: "#/definitions/tapi.topology.LatencyCharacteristicWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/name={value-name}/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/node-edge-point={topology-uuid},{node-uuid},{node-edge-point-uuid}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.NodeEdgePointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + - name: "topology-uuid" + in: "path" + description: "Id of node-edge-point" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node-edge-point" + required: true + type: "string" + - name: "node-edge-point-uuid" + in: "path" + description: "Id of node-edge-point" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.NodeEdgePointRef" + schema: + $ref: "#/definitions/tapi.topology.NodeEdgePointRefWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/resilience-type/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.ResilienceType" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.ResilienceType" + schema: + $ref: "#/definitions/tapi.topology.ResilienceTypeWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/risk-characteristic={risk-characteristic-name}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.RiskCharacteristic" + description: "A list of risk characteristics for consideration in an analysis\ + \ of shared risk. Each element of the list represents a specific risk consideration." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + - name: "risk-characteristic-name" + in: "path" + description: "Id of risk-characteristic" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.RiskCharacteristic" + schema: + $ref: "#/definitions/tapi.topology.RiskCharacteristicWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/total-potential-capacity/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.common.Capacity" + description: "An optimistic view of the capacity of the TopologicalEntity assuming\ + \ that any shared capacity is available to be taken." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + responses: + 200: + description: "tapi.common.Capacity" + schema: + $ref: "#/definitions/tapi.common.CapacityWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/total-potential-capacity/bandwidth-profile/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + responses: + 200: + description: "tapi.common.BandwidthProfile" + schema: + $ref: "#/definitions/tapi.common.BandwidthProfileWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/total-potential-capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/total-potential-capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/total-potential-capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/total-potential-capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/total-potential-capacity/total-size/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/link={link-uuid}/validation-mechanism={validation-mechanism}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.ValidationMechanism" + description: "Provides details of the specific validation mechanism(s) used\ + \ to confirm the presence of an intended topologicalEntity." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "link-uuid" + in: "path" + description: "Id of link" + required: true + type: "string" + - name: "validation-mechanism" + in: "path" + description: "Id of validation-mechanism" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.ValidationMechanism" + schema: + $ref: "#/definitions/tapi.topology.ValidationMechanismWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/name={value-name}/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.topology.Node" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.topology.Node" + schema: + $ref: "#/definitions/tapi.topology.topology.NodeWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/aggregated-node-edge-point={topology-uuid},{aggregated-node-edge-point-node-uuid},{node-edge-point-uuid}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.NodeEdgePointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "topology-uuid" + in: "path" + description: "Id of aggregated-node-edge-point" + required: true + type: "string" + - name: "aggregated-node-edge-point-node-uuid" + in: "path" + description: "Id of aggregated-node-edge-point" + required: true + type: "string" + - name: "node-edge-point-uuid" + in: "path" + description: "Id of aggregated-node-edge-point" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.NodeEdgePointRef" + schema: + $ref: "#/definitions/tapi.topology.NodeEdgePointRefWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/available-capacity/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.common.Capacity" + description: "Capacity available to be assigned." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + responses: + 200: + description: "tapi.common.Capacity" + schema: + $ref: "#/definitions/tapi.common.CapacityWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/available-capacity/bandwidth-profile/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + responses: + 200: + description: "tapi.common.BandwidthProfile" + schema: + $ref: "#/definitions/tapi.common.BandwidthProfileWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/available-capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/available-capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/available-capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/available-capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/available-capacity/total-size/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/cost-characteristic={cost-name}/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.CostCharacteristic" + description: "The list of costs where each cost relates to some aspect of the\ + \ TopologicalEntity." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "cost-name" + in: "path" + description: "Id of cost-characteristic" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.CostCharacteristic" + schema: + $ref: "#/definitions/tapi.topology.CostCharacteristicWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/encap-topology/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.TopologyRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.TopologyRef" + schema: + $ref: "#/definitions/tapi.topology.TopologyRefWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/latency-characteristic={traffic-property-name}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.LatencyCharacteristic" + description: "The effect on the latency of a queuing process. This only has\ + \ significant effect for packet based systems and has a complex characteristic." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "traffic-property-name" + in: "path" + description: "Id of latency-characteristic" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.LatencyCharacteristic" + schema: + $ref: "#/definitions/tapi.topology.LatencyCharacteristicWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/name={value-name}/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.NodeRuleGroup" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.NodeRuleGroup" + schema: + $ref: "#/definitions/tapi.topology.NodeRuleGroupWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/available-capacity/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.Capacity" + description: "Capacity available to be assigned." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.Capacity" + schema: + $ref: "#/definitions/tapi.common.CapacityWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/available-capacity/bandwidth-profile/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.BandwidthProfile" + schema: + $ref: "#/definitions/tapi.common.BandwidthProfileWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/available-capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/available-capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/available-capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/available-capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/available-capacity/total-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/cost-characteristic={cost-name}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.CostCharacteristic" + description: "The list of costs where each cost relates to some aspect of the\ + \ TopologicalEntity." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "cost-name" + in: "path" + description: "Id of cost-characteristic" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.CostCharacteristic" + schema: + $ref: "#/definitions/tapi.topology.CostCharacteristicWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.InterRuleGroup" + description: "Nested NodeRuleGroups may have InterRuleGroups. The Superior NodeRuleGroup\ + \ contains the nested NodeRuleGroups and their associated InterRuleGroups.\r\ + \n This is equivalent to the Node-Topology hierarchy." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.InterRuleGroup" + schema: + $ref: "#/definitions/tapi.topology.InterRuleGroupWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/associated-node-rule-group={topology-uuid},{associated-node-rule-group-node-uuid},{associated-node-rule-group-node-rule-group-uuid}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.NodeRuleGroupRef" + description: "The NodeRuleGroups that the InterRuleGroup constrains interconnection\ + \ between.\r\n The CEPs of the NEPs of a referenced NodeRuleGroup\ + \ can interconnect to the CEPs of the NEPs of another referenced NodeRuleGroup\ + \ constrained by the rules of the InterRuleGroup." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + - name: "topology-uuid" + in: "path" + description: "Id of associated-node-rule-group" + required: true + type: "string" + - name: "associated-node-rule-group-node-uuid" + in: "path" + description: "Id of associated-node-rule-group" + required: true + type: "string" + - name: "associated-node-rule-group-node-rule-group-uuid" + in: "path" + description: "Id of associated-node-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.NodeRuleGroupRef" + schema: + $ref: "#/definitions/tapi.topology.NodeRuleGroupRefWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/available-capacity/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.Capacity" + description: "Capacity available to be assigned." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.Capacity" + schema: + $ref: "#/definitions/tapi.common.CapacityWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/available-capacity/bandwidth-profile/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.BandwidthProfile" + schema: + $ref: "#/definitions/tapi.common.BandwidthProfileWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/available-capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/available-capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/available-capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/available-capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/available-capacity/total-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/cost-characteristic={cost-name}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.CostCharacteristic" + description: "The list of costs where each cost relates to some aspect of the\ + \ TopologicalEntity." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + - name: "cost-name" + in: "path" + description: "Id of cost-characteristic" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.CostCharacteristic" + schema: + $ref: "#/definitions/tapi.topology.CostCharacteristicWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/latency-characteristic={traffic-property-name}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.LatencyCharacteristic" + description: "The effect on the latency of a queuing process. This only has\ + \ significant effect for packet based systems and has a complex characteristic." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + - name: "traffic-property-name" + in: "path" + description: "Id of latency-characteristic" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.LatencyCharacteristic" + schema: + $ref: "#/definitions/tapi.topology.LatencyCharacteristicWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/name={value-name}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/risk-characteristic={risk-characteristic-name}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.RiskCharacteristic" + description: "A list of risk characteristics for consideration in an analysis\ + \ of shared risk. Each element of the list represents a specific risk consideration." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + - name: "risk-characteristic-name" + in: "path" + description: "Id of risk-characteristic" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.RiskCharacteristic" + schema: + $ref: "#/definitions/tapi.topology.RiskCharacteristicWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/rule={local-id}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.Rule" + description: "The list of rules of the InterRuleGroup." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of rule" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.Rule" + schema: + $ref: "#/definitions/tapi.topology.RuleWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/rule={local-id}/cep-port-role/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.PortRoleRule" + description: "Indicates the port role to which the rule applies. \r\n \ + \ The port role is interpreted in the context of the connection type\ + \ which is identified by the connection spec. \r\n The port\ + \ role is not meaningful in the absence of a connection spec reference.\r\n\ + \ If a node rule group carries a port role, that role applies\ + \ also to the associated inter rule where the combination of the roles in\ + \ the node rule groups at the ends of the inter group rule define the connection\ + \ orientation.\r\n For example a root-and-leaf connection may\ + \ be used in a node where a node rule group collects one set of NEPs has the\ + \ port role 'root' and another node rule group collects another set of NEPs\ + \ has the port role 'leaf' where these are joined by an inter rule group.\ + \ This combination specifies an allowed orientation of the root-and-leaf connection.\r\ + \n No port role statement means all port roles are allowed." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of rule" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.PortRoleRule" + schema: + $ref: "#/definitions/tapi.topology.PortRoleRuleWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/rule={local-id}/connection-spec-reference/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.ConnectionSpecReference" + description: "Identifies the type of connection that the rule applies to. \r\ + \n If the attribute is not present then the rule applies to\ + \ all types of connection supported by the device." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of rule" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.ConnectionSpecReference" + schema: + $ref: "#/definitions/tapi.topology.ConnectionSpecReferenceWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/rule={local-id}/name={value-name}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of rule" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/rule={local-id}/signal-property/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.SignalPropertyRule" + description: "The rule only applies to signals with the properties listed. \r\ + \n If the attribute is not present then the rule applies to\ + \ all signals." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of rule" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.SignalPropertyRule" + schema: + $ref: "#/definitions/tapi.topology.SignalPropertyRuleWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/total-potential-capacity/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.Capacity" + description: "An optimistic view of the capacity of the TopologicalEntity assuming\ + \ that any shared capacity is available to be taken." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.Capacity" + schema: + $ref: "#/definitions/tapi.common.CapacityWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/total-potential-capacity/bandwidth-profile/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.BandwidthProfile" + schema: + $ref: "#/definitions/tapi.common.BandwidthProfileWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/total-potential-capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/total-potential-capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/total-potential-capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/total-potential-capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/inter-rule-group={inter-rule-group-uuid}/total-potential-capacity/total-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "inter-rule-group-uuid" + in: "path" + description: "Id of inter-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/latency-characteristic={traffic-property-name}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.LatencyCharacteristic" + description: "The effect on the latency of a queuing process. This only has\ + \ significant effect for packet based systems and has a complex characteristic." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "traffic-property-name" + in: "path" + description: "Id of latency-characteristic" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.LatencyCharacteristic" + schema: + $ref: "#/definitions/tapi.topology.LatencyCharacteristicWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/name={value-name}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/node-edge-point={topology-uuid},{node-edge-point-node-uuid},{node-edge-point-uuid}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.NodeEdgePointRef" + description: "NEPs and their client CEPs that the rules apply to." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "topology-uuid" + in: "path" + description: "Id of node-edge-point" + required: true + type: "string" + - name: "node-edge-point-node-uuid" + in: "path" + description: "Id of node-edge-point" + required: true + type: "string" + - name: "node-edge-point-uuid" + in: "path" + description: "Id of node-edge-point" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.NodeEdgePointRef" + schema: + $ref: "#/definitions/tapi.topology.NodeEdgePointRefWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/node-rule-group={topology-uuid},{node-rule-group-node-uuid},{node-rule-group-node-rule-group-uuid}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.NodeRuleGroupRef" + description: "NodeRuleGroups may be nested such that finer grained rules may\ + \ be applied.\r\n A nested rule group should have a subset\ + \ of the NEPs of the superior rule group." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "topology-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "node-rule-group-node-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "node-rule-group-node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.NodeRuleGroupRef" + schema: + $ref: "#/definitions/tapi.topology.NodeRuleGroupRefWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/risk-characteristic={risk-characteristic-name}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.RiskCharacteristic" + description: "A list of risk characteristics for consideration in an analysis\ + \ of shared risk. Each element of the list represents a specific risk consideration." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "risk-characteristic-name" + in: "path" + description: "Id of risk-characteristic" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.RiskCharacteristic" + schema: + $ref: "#/definitions/tapi.topology.RiskCharacteristicWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/rule={local-id}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.Rule" + description: "The list of rules of the NodeRuleGroup." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of rule" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.Rule" + schema: + $ref: "#/definitions/tapi.topology.RuleWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/rule={local-id}/cep-port-role/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.PortRoleRule" + description: "Indicates the port role to which the rule applies. \r\n \ + \ The port role is interpreted in the context of the connection type\ + \ which is identified by the connection spec. \r\n The port\ + \ role is not meaningful in the absence of a connection spec reference.\r\n\ + \ If a node rule group carries a port role, that role applies\ + \ also to the associated inter rule where the combination of the roles in\ + \ the node rule groups at the ends of the inter group rule define the connection\ + \ orientation.\r\n For example a root-and-leaf connection may\ + \ be used in a node where a node rule group collects one set of NEPs has the\ + \ port role 'root' and another node rule group collects another set of NEPs\ + \ has the port role 'leaf' where these are joined by an inter rule group.\ + \ This combination specifies an allowed orientation of the root-and-leaf connection.\r\ + \n No port role statement means all port roles are allowed." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of rule" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.PortRoleRule" + schema: + $ref: "#/definitions/tapi.topology.PortRoleRuleWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/rule={local-id}/connection-spec-reference/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.ConnectionSpecReference" + description: "Identifies the type of connection that the rule applies to. \r\ + \n If the attribute is not present then the rule applies to\ + \ all types of connection supported by the device." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of rule" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.ConnectionSpecReference" + schema: + $ref: "#/definitions/tapi.topology.ConnectionSpecReferenceWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/rule={local-id}/name={value-name}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of rule" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/rule={local-id}/signal-property/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.SignalPropertyRule" + description: "The rule only applies to signals with the properties listed. \r\ + \n If the attribute is not present then the rule applies to\ + \ all signals." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + - name: "local-id" + in: "path" + description: "Id of rule" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.SignalPropertyRule" + schema: + $ref: "#/definitions/tapi.topology.SignalPropertyRuleWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/total-potential-capacity/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.Capacity" + description: "An optimistic view of the capacity of the TopologicalEntity assuming\ + \ that any shared capacity is available to be taken." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.Capacity" + schema: + $ref: "#/definitions/tapi.common.CapacityWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/total-potential-capacity/bandwidth-profile/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.BandwidthProfile" + schema: + $ref: "#/definitions/tapi.common.BandwidthProfileWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/total-potential-capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/total-potential-capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/total-potential-capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/total-potential-capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/node-rule-group={node-rule-group-uuid}/total-potential-capacity/total-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "node-rule-group-uuid" + in: "path" + description: "Id of node-rule-group" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.node.OwnedNodeEdgePoint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.node.OwnedNodeEdgePoint" + schema: + $ref: "#/definitions/tapi.topology.node.OwnedNodeEdgePointWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/aggregated-node-edge-point={topology-uuid},{aggregated-node-edge-point-node-uuid},{node-edge-point-uuid}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.topology.NodeEdgePointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + - name: "topology-uuid" + in: "path" + description: "Id of aggregated-node-edge-point" + required: true + type: "string" + - name: "aggregated-node-edge-point-node-uuid" + in: "path" + description: "Id of aggregated-node-edge-point" + required: true + type: "string" + - name: "node-edge-point-uuid" + in: "path" + description: "Id of aggregated-node-edge-point" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.NodeEdgePointRef" + schema: + $ref: "#/definitions/tapi.topology.NodeEdgePointRefWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/available-capacity/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.Capacity" + description: "Capacity available to be assigned." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.Capacity" + schema: + $ref: "#/definitions/tapi.common.CapacityWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/available-capacity/bandwidth-profile/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.BandwidthProfile" + schema: + $ref: "#/definitions/tapi.common.BandwidthProfileWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/available-capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/available-capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/available-capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/available-capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/available-capacity/total-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/mapped-service-interface-point={service-interface-point-uuid}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.ServiceInterfacePointRef" + description: "NodeEdgePoint mapped to more than ServiceInterfacePoint (slicing/virtualizing)\ + \ or a ServiceInterfacePoint mapped to more than one NodeEdgePoint (load balancing/Resilience)\ + \ should be considered experimental" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + - name: "service-interface-point-uuid" + in: "path" + description: "Id of mapped-service-interface-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.ServiceInterfacePointRef" + schema: + $ref: "#/definitions/tapi.common.ServiceInterfacePointRefWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/name={value-name}/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.CepList" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.CepList" + schema: + $ref: "#/definitions/tapi.connectivity.CepListWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/connection-end-point={connection-end-point-uuid}/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.ConnectionEndPoint" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + - name: "connection-end-point-uuid" + in: "path" + description: "Id of connection-end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.ConnectionEndPoint" + schema: + $ref: "#/definitions/tapi.connectivity.ConnectionEndPointWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/connection-end-point={connection-end-point-uuid}/aggregated-connection-end-point={topology-uuid},{aggregated-connection-end-point-node-uuid},{node-edge-point-uuid},{aggregated-connection-end-point-connection-end-point-uuid}/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.ConnectionEndPointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + - name: "connection-end-point-uuid" + in: "path" + description: "Id of connection-end-point" + required: true + type: "string" + - name: "topology-uuid" + in: "path" + description: "Id of aggregated-connection-end-point" + required: true + type: "string" + - name: "aggregated-connection-end-point-node-uuid" + in: "path" + description: "Id of aggregated-connection-end-point" + required: true + type: "string" + - name: "node-edge-point-uuid" + in: "path" + description: "Id of aggregated-connection-end-point" + required: true + type: "string" + - name: "aggregated-connection-end-point-connection-end-point-uuid" + in: "path" + description: "Id of aggregated-connection-end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.ConnectionEndPointRef" + schema: + $ref: "#/definitions/tapi.connectivity.ConnectionEndPointRefWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/connection-end-point={connection-end-point-uuid}/cep-role/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.CepRole" + description: "Defines the role of the CEP in the context of the connection spec.\r\ + \n There may be many cep role - connection spec combinations\ + \ for a particular CEP where each corresponds to a specific connection associated\ + \ with the CEP." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + - name: "connection-end-point-uuid" + in: "path" + description: "Id of connection-end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.CepRole" + schema: + $ref: "#/definitions/tapi.connectivity.CepRoleWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/connection-end-point={connection-end-point-uuid}/cep-role/connection-spec-reference/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.connectivity.ConnectionSpecReference" + description: "The reference to the spec that defines the cep role." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + - name: "connection-end-point-uuid" + in: "path" + description: "Id of connection-end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.connectivity.ConnectionSpecReference" + schema: + $ref: "#/definitions/tapi.connectivity.ConnectionSpecReferenceWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/connection-end-point={connection-end-point-uuid}/client-node-edge-point={topology-uuid},{client-node-edge-point-node-uuid},{node-edge-point-uuid}/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.topology.NodeEdgePointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + - name: "connection-end-point-uuid" + in: "path" + description: "Id of connection-end-point" + required: true + type: "string" + - name: "topology-uuid" + in: "path" + description: "Id of client-node-edge-point" + required: true + type: "string" + - name: "client-node-edge-point-node-uuid" + in: "path" + description: "Id of client-node-edge-point" + required: true + type: "string" + - name: "node-edge-point-uuid" + in: "path" + description: "Id of client-node-edge-point" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.NodeEdgePointRef" + schema: + $ref: "#/definitions/tapi.topology.NodeEdgePointRefWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/connection-end-point={connection-end-point-uuid}/name={value-name}/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.common.NameAndValue" + description: "List of names. A property of an entity with a value that is unique\ + \ in some namespace but may change during the life of the entity. A name carries\ + \ no semantics with respect to the purpose of the entity." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + - name: "connection-end-point-uuid" + in: "path" + description: "Id of connection-end-point" + required: true + type: "string" + - name: "value-name" + in: "path" + description: "Id of name" + required: true + type: "string" + responses: + 200: + description: "tapi.common.NameAndValue" + schema: + $ref: "#/definitions/tapi.common.NameAndValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/tapi-connectivity:cep-list/connection-end-point={connection-end-point-uuid}/parent-node-edge-point/ + : get: + tags: + - "tapi-connectivity" + summary: "returns tapi.topology.NodeEdgePointRef" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + - name: "connection-end-point-uuid" + in: "path" + description: "Id of connection-end-point" + required: true + type: "string" + responses: + 200: + description: "tapi.topology.NodeEdgePointRef" + schema: + $ref: "#/definitions/tapi.topology.NodeEdgePointRefWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/total-potential-capacity/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.Capacity" + description: "An optimistic view of the capacity of the TopologicalEntity assuming\ + \ that any shared capacity is available to be taken." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.Capacity" + schema: + $ref: "#/definitions/tapi.common.CapacityWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/total-potential-capacity/bandwidth-profile/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.BandwidthProfile" + schema: + $ref: "#/definitions/tapi.common.BandwidthProfileWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/total-potential-capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/total-potential-capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/total-potential-capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/total-potential-capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/owned-node-edge-point={owned-node-edge-point-uuid}/total-potential-capacity/total-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + - name: "owned-node-edge-point-uuid" + in: "path" + description: "Id of owned-node-edge-point" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/total-potential-capacity/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.common.Capacity" + description: "An optimistic view of the capacity of the TopologicalEntity assuming\ + \ that any shared capacity is available to be taken." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + responses: + 200: + description: "tapi.common.Capacity" + schema: + $ref: "#/definitions/tapi.common.CapacityWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/total-potential-capacity/bandwidth-profile/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.BandwidthProfile" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + responses: + 200: + description: "tapi.common.BandwidthProfile" + schema: + $ref: "#/definitions/tapi.common.BandwidthProfileWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/total-potential-capacity/bandwidth-profile/committed-burst-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/total-potential-capacity/bandwidth-profile/committed-information-rate/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/total-potential-capacity/bandwidth-profile/peak-burst-size/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + ? /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/total-potential-capacity/bandwidth-profile/peak-information-rate/ + : get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "none" + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + /data/tapi-common:context/tapi-topology:topology-context/topology={uuid}/node={node-uuid}/total-potential-capacity/total-size/: + get: + tags: + - "tapi-topology" + summary: "returns tapi.common.CapacityValue" + description: "Total capacity of the TopologicalEntity in MB/s. In case of bandwidthProfile,\ + \ this is expected to same as the committedInformationRate." + parameters: + - name: "uuid" + in: "path" + description: "Id of topology" + required: true + type: "string" + - name: "node-uuid" + in: "path" + description: "Id of node" + required: true + type: "string" + responses: + 200: + description: "tapi.common.CapacityValue" + schema: + $ref: "#/definitions/tapi.common.CapacityValueWrapper" + 400: + description: "Internal error" + /operations/tapi-common:get-service-interface-point-details/: + post: + tags: + - "tapi-common" + summary: "operates on tapi.common.GetServiceInterfacePointDetails" + description: "operates on tapi.common.GetServiceInterfacePointDetails" + parameters: + - in: "body" + name: "tapi.common.getserviceinterfacepointdetails.Input.body-param" + required: false + schema: + properties: + input: + $ref: "#/definitions/tapi.common.getserviceinterfacepointdetails.Input" + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.common.GetServiceInterfacePointDetails" + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-common:get-service-interface-point-list/: + post: + tags: + - "tapi-common" + parameters: [] + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.common.GetServiceInterfacePointList" + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-common:update-service-interface-point/: + post: + tags: + - "tapi-common" + summary: "operates on tapi.common.UpdateServiceInterfacePoint" + description: "operates on tapi.common.UpdateServiceInterfacePoint" + parameters: + - in: "body" + name: "tapi.common.updateserviceinterfacepoint.Input.body-param" + required: false + schema: + properties: + input: + $ref: "#/definitions/tapi.common.updateserviceinterfacepoint.Input" + responses: + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-connectivity:create-connectivity-service/: + post: + tags: + - "tapi-connectivity" + summary: "operates on tapi.connectivity.CreateConnectivityService" + description: "operates on tapi.connectivity.CreateConnectivityService" + parameters: + - in: "body" + name: "tapi.connectivity.createconnectivityservice.Input.body-param" + required: false + schema: + properties: + input: + $ref: "#/definitions/tapi.connectivity.createconnectivityservice.Input" + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.connectivity.CreateConnectivityService" + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-connectivity:delete-connectivity-service/: + post: + tags: + - "tapi-connectivity" + summary: "operates on tapi.connectivity.DeleteConnectivityService" + description: "operates on tapi.connectivity.DeleteConnectivityService" + parameters: + - in: "body" + name: "tapi.connectivity.deleteconnectivityservice.Input.body-param" + required: false + schema: + properties: + input: + $ref: "#/definitions/tapi.connectivity.deleteconnectivityservice.Input" + responses: + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-connectivity:get-connection-details/: + post: + tags: + - "tapi-connectivity" + summary: "operates on tapi.connectivity.GetConnectionDetails" + description: "operates on tapi.connectivity.GetConnectionDetails" + parameters: + - in: "body" + name: "tapi.connectivity.getconnectiondetails.Input.body-param" + required: false + schema: + properties: + input: + $ref: "#/definitions/tapi.connectivity.getconnectiondetails.Input" + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.connectivity.GetConnectionDetails" + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-connectivity:get-connection-end-point-details/: + post: + tags: + - "tapi-connectivity" + summary: "operates on tapi.connectivity.GetConnectionEndPointDetails" + description: "operates on tapi.connectivity.GetConnectionEndPointDetails" + parameters: + - in: "body" + name: "tapi.connectivity.getconnectionendpointdetails.Input.body-param" + required: false + schema: + properties: + input: + $ref: "#/definitions/tapi.connectivity.getconnectionendpointdetails.Input" + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.connectivity.GetConnectionEndPointDetails" + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-connectivity:get-connectivity-service-details/: + post: + tags: + - "tapi-connectivity" + summary: "operates on tapi.connectivity.GetConnectivityServiceDetails" + description: "operates on tapi.connectivity.GetConnectivityServiceDetails" + parameters: + - in: "body" + name: "tapi.connectivity.getconnectivityservicedetails.Input.body-param" + required: false + schema: + properties: + input: + $ref: "#/definitions/tapi.connectivity.getconnectivityservicedetails.Input" + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.connectivity.GetConnectivityServiceDetails" + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-connectivity:get-connectivity-service-list/: + post: + tags: + - "tapi-connectivity" + parameters: [] + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.connectivity.GetConnectivityServiceList" + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-connectivity:update-connectivity-service/: + post: + tags: + - "tapi-connectivity" + summary: "operates on tapi.connectivity.UpdateConnectivityService" + description: "operates on tapi.connectivity.UpdateConnectivityService" + parameters: + - in: "body" + name: "tapi.connectivity.updateconnectivityservice.Input.body-param" + required: false + schema: + properties: + input: + $ref: "#/definitions/tapi.connectivity.updateconnectivityservice.Input" + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.connectivity.UpdateConnectivityService" + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-notification:create-notification-subscription-service/: + post: + tags: + - "tapi-notification" + summary: "operates on tapi.notification.CreateNotificationSubscriptionService" + description: "operates on tapi.notification.CreateNotificationSubscriptionService" + parameters: + - in: "body" + name: "tapi.notification.createnotificationsubscriptionservice.Input.body-param" + required: false + schema: + properties: + input: + $ref: "#/definitions/tapi.notification.createnotificationsubscriptionservice.Input" + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.notification.CreateNotificationSubscriptionService" + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-notification:delete-notification-subscription-service/: + post: + tags: + - "tapi-notification" + summary: "operates on tapi.notification.DeleteNotificationSubscriptionService" + description: "operates on tapi.notification.DeleteNotificationSubscriptionService" + parameters: + - in: "body" + name: "tapi.notification.deletenotificationsubscriptionservice.Input.body-param" + required: false + schema: + properties: + input: + $ref: "#/definitions/tapi.notification.deletenotificationsubscriptionservice.Input" + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.notification.DeleteNotificationSubscriptionService" + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-notification:get-notification-list/: + post: + tags: + - "tapi-notification" + summary: "operates on tapi.notification.GetNotificationList" + description: "operates on tapi.notification.GetNotificationList" + parameters: + - in: "body" + name: "tapi.notification.getnotificationlist.Input.body-param" + required: false + schema: + properties: + input: + $ref: "#/definitions/tapi.notification.getnotificationlist.Input" + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.notification.GetNotificationList" + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-notification:get-notification-subscription-service-details/: + post: + tags: + - "tapi-notification" + summary: "operates on tapi.notification.GetNotificationSubscriptionServiceDetails" + description: "operates on tapi.notification.GetNotificationSubscriptionServiceDetails" + parameters: + - in: "body" + name: "tapi.notification.getnotificationsubscriptionservicedetails.Input.body-param" + required: false + schema: + properties: + input: + $ref: "#/definitions/tapi.notification.getnotificationsubscriptionservicedetails.Input" + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.notification.GetNotificationSubscriptionServiceDetails" + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-notification:get-notification-subscription-service-list/: + post: + tags: + - "tapi-notification" + parameters: [] + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.notification.GetNotificationSubscriptionServiceList" + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-notification:get-supported-notification-types/: + post: + tags: + - "tapi-notification" + parameters: [] + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.notification.GetSupportedNotificationTypes" + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-notification:update-notification-subscription-service/: + post: + tags: + - "tapi-notification" + summary: "operates on tapi.notification.UpdateNotificationSubscriptionService" + description: "operates on tapi.notification.UpdateNotificationSubscriptionService" + parameters: + - in: "body" + name: "tapi.notification.updatenotificationsubscriptionservice.Input.body-param" + required: false + schema: + properties: + input: + $ref: "#/definitions/tapi.notification.updatenotificationsubscriptionservice.Input" + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.notification.UpdateNotificationSubscriptionService" + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-path-computation:compute-p-2-p-path/: + post: + tags: + - "tapi-path-computation" + summary: "operates on tapi.path.computation.ComputeP2PPath" + description: "operates on tapi.path.computation.ComputeP2PPath" + parameters: + - in: "body" + name: "tapi.path.computation.computep2ppath.Input.body-param" + required: false + schema: + properties: + input: + $ref: "#/definitions/tapi.path.computation.computep2ppath.Input" + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.path.computation.ComputeP2PPath" + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-path-computation:delete-p-2-p-path/: + post: + tags: + - "tapi-path-computation" + summary: "operates on tapi.path.computation.DeleteP2PPath" + description: "operates on tapi.path.computation.DeleteP2PPath" + parameters: + - in: "body" + name: "tapi.path.computation.deletep2ppath.Input.body-param" + required: false + schema: + properties: + input: + $ref: "#/definitions/tapi.path.computation.deletep2ppath.Input" + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.path.computation.DeleteP2PPath" + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-path-computation:optimize-p-2-ppath/: + post: + tags: + - "tapi-path-computation" + summary: "operates on tapi.path.computation.OptimizeP2Ppath" + description: "operates on tapi.path.computation.OptimizeP2Ppath" + parameters: + - in: "body" + name: "tapi.path.computation.optimizep2ppath.Input.body-param" + required: false + schema: + properties: + input: + $ref: "#/definitions/tapi.path.computation.optimizep2ppath.Input" + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.path.computation.OptimizeP2Ppath" + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-topology:get-link-details/: + post: + tags: + - "tapi-topology" + summary: "operates on tapi.topology.GetLinkDetails" + description: "operates on tapi.topology.GetLinkDetails" + parameters: + - in: "body" + name: "tapi.topology.getlinkdetails.Input.body-param" + required: false + schema: + properties: + input: + $ref: "#/definitions/tapi.topology.getlinkdetails.Input" + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.topology.GetLinkDetails" + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-topology:get-node-details/: + post: + tags: + - "tapi-topology" + summary: "operates on tapi.topology.GetNodeDetails" + description: "operates on tapi.topology.GetNodeDetails" + parameters: + - in: "body" + name: "tapi.topology.getnodedetails.Input.body-param" + required: false + schema: + properties: + input: + $ref: "#/definitions/tapi.topology.getnodedetails.Input" + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.topology.GetNodeDetails" + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-topology:get-node-edge-point-details/: + post: + tags: + - "tapi-topology" + summary: "operates on tapi.topology.GetNodeEdgePointDetails" + description: "operates on tapi.topology.GetNodeEdgePointDetails" + parameters: + - in: "body" + name: "tapi.topology.getnodeedgepointdetails.Input.body-param" + required: false + schema: + properties: + input: + $ref: "#/definitions/tapi.topology.getnodeedgepointdetails.Input" + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.topology.GetNodeEdgePointDetails" + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-topology:get-topology-details/: + post: + tags: + - "tapi-topology" + summary: "operates on tapi.topology.GetTopologyDetails" + description: "operates on tapi.topology.GetTopologyDetails" + parameters: + - in: "body" + name: "tapi.topology.gettopologydetails.Input.body-param" + required: false + schema: + properties: + input: + $ref: "#/definitions/tapi.topology.gettopologydetails.Input" + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.topology.GetTopologyDetails" + 201: + description: "No response" + 400: + description: "Internal error" + /operations/tapi-topology:get-topology-list/: + post: + tags: + - "tapi-topology" + parameters: [] + responses: + 200: + description: "Correct response" + schema: + $ref: "#/definitions/tapi.topology.GetTopologyList" + 201: + description: "No response" + 400: + description: "Internal error" +definitions: + tapi.common.AdminStatePac: + type: "object" + properties: + operational-state: + description: "none" + $ref: "#/definitions/tapi.common.OperationalState" + lifecycle-state: + description: "none" + $ref: "#/definitions/tapi.common.LifecycleState" + administrative-state: + description: "none" + $ref: "#/definitions/tapi.common.AdministrativeState" + tapi.common.AdministrativeState: + type: "string" + enum: + - "LOCKED" + - "UNLOCKED" + tapi.common.BandwidthProfile: + type: "object" + properties: + committed-information-rate: + description: "none" + $ref: "#/definitions/tapi.common.CapacityValue" + coupling-flag: + type: "boolean" + description: "none" + default: false + bw-profile-type: + description: "none" + $ref: "#/definitions/tapi.common.BandwidthProfileType" + peak-information-rate: + description: "none" + $ref: "#/definitions/tapi.common.CapacityValue" + committed-burst-size: + description: "none" + $ref: "#/definitions/tapi.common.CapacityValue" + peak-burst-size: + description: "none" + $ref: "#/definitions/tapi.common.CapacityValue" + color-aware: + type: "boolean" + description: "none" + default: false + tapi.common.BandwidthProfileType: + type: "string" + enum: + - "MEF_10.x" + - "RFC_2697" + - "RFC_2698" + - "RFC_4115" + tapi.common.BandwidthProfileWrapper: + properties: + bandwidth-profile: + $ref: "#/definitions/tapi.common.BandwidthProfile" + tapi.common.Capacity: + type: "object" + properties: + bandwidth-profile: + description: "none" + $ref: "#/definitions/tapi.common.BandwidthProfile" + total-size: + description: "Total capacity of the TopologicalEntity in MB/s. In case of\ + \ bandwidthProfile, this is expected to same as the committedInformationRate." + $ref: "#/definitions/tapi.common.CapacityValue" + tapi.common.CapacityPac: + type: "object" + properties: + available-capacity: + description: "Capacity available to be assigned." + $ref: "#/definitions/tapi.common.Capacity" + total-potential-capacity: + description: "An optimistic view of the capacity of the TopologicalEntity\ + \ assuming that any shared capacity is available to be taken." + $ref: "#/definitions/tapi.common.Capacity" + tapi.common.CapacityUnit: + type: "string" + enum: + - "TB" + - "TBPS" + - "GB" + - "GBPS" + - "MB" + - "MBPS" + - "KB" + - "KBPS" + - "GHz" + - "MHz" + tapi.common.CapacityValue: + type: "object" + properties: + value: + type: "integer" + format: "int32" + description: "none" + unit: + description: "none" + $ref: "#/definitions/tapi.common.CapacityUnit" + tapi.common.CapacityValueWrapper: + properties: + committed-burst-size: + $ref: "#/definitions/tapi.common.CapacityValue" + tapi.common.CapacityWrapper: + properties: + available-capacity: + $ref: "#/definitions/tapi.common.Capacity" + tapi.common.Context: + allOf: + - $ref: "#/definitions/tapi.common.TapiContext" + - $ref: "#/definitions/tapi.connectivity.ContextAugmentation3" + - $ref: "#/definitions/tapi.notification.ContextAugmentation1" + - $ref: "#/definitions/tapi.path.computation.ContextAugmentation2" + - $ref: "#/definitions/tapi.topology.ContextAugmentation4" + tapi.common.ContextWrapper: + properties: + tapi-common:context: + $ref: "#/definitions/tapi.common.Context" + tapi.common.DirectiveValue: + type: "string" + enum: + - "MINIMIZE" + - "MAXIMIZE" + - "ALLOW" + - "DISALLOW" + - "DONT_CARE" + tapi.common.ForwardingDirection: + type: "string" + enum: + - "BIDIRECTIONAL" + - "UNIDIRECTIONAL" + - "UNDEFINED_OR_UNKNOWN" + tapi.common.GetServiceInterfacePointDetails: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.common.getserviceinterfacepointdetails.Output" + tapi.common.GetServiceInterfacePointList: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.common.getserviceinterfacepointlist.Output" + tapi.common.GlobalClass: + type: "object" + properties: + name: + type: "array" + description: "List of names. A property of an entity with a value that is\ + \ unique in some namespace but may change during the life of the entity.\ + \ A name carries no semantics with respect to the purpose of the entity." + items: + $ref: "#/definitions/tapi.common.NameAndValue" + uuid: + type: "string" + description: "UUID: An identifier that is universally unique within an identifier\ + \ space, where the identifier space is itself globally unique, and immutable.\ + \ An UUID carries no semantics with respect to the purpose or state of the\ + \ entity.\r\n UUID here uses string representation as defined\ + \ in RFC 4122. The canonical representation uses lowercase characters.\r\ + \n Pattern: [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-'\ + \ + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12} \r\n Example of a UUID\ + \ in string representation: f81d4fae-7dec-11d0-a765-00a0c91e6bf6" + tapi.common.LayerProtocolName: + type: "string" + enum: + - "ODU" + - "ETH" + - "DSR" + - "PHOTONIC_MEDIA" + tapi.common.LifecycleState: + type: "string" + enum: + - "PLANNED" + - "POTENTIAL_AVAILABLE" + - "POTENTIAL_BUSY" + - "INSTALLED" + - "PENDING_REMOVAL" + tapi.common.LocalClass: + type: "object" + properties: + name: + type: "array" + description: "List of names. A property of an entity with a value that is\ + \ unique in some namespace but may change during the life of the entity.\ + \ A name carries no semantics with respect to the purpose of the entity." + items: + $ref: "#/definitions/tapi.common.NameAndValue" + local-id: + type: "string" + description: "none" + tapi.common.NameAndValue: + type: "object" + properties: + value-name: + type: "string" + description: "The name of the value. The value need not have a name." + value: + type: "string" + description: "The value" + tapi.common.NameAndValueWrapper: + properties: + name: + $ref: "#/definitions/tapi.common.NameAndValue" + tapi.common.OperationalState: + type: "string" + enum: + - "DISABLED" + - "ENABLED" + tapi.common.OperationalStatePac: + type: "object" + properties: + operational-state: + description: "none" + $ref: "#/definitions/tapi.common.OperationalState" + lifecycle-state: + description: "none" + $ref: "#/definitions/tapi.common.LifecycleState" + tapi.common.PortDirection: + type: "string" + enum: + - "BIDIRECTIONAL" + - "INPUT" + - "OUTPUT" + - "UNIDENTIFIED_OR_UNKNOWN" + tapi.common.PortRole: + type: "string" + enum: + - "SYMMETRIC" + - "ROOT" + - "LEAF" + - "TRUNK" + - "UNKNOWN" + tapi.common.ServiceInterfacePoint: + allOf: + - $ref: "#/definitions/tapi.common.AdminStatePac" + - $ref: "#/definitions/tapi.common.CapacityPac" + - $ref: "#/definitions/tapi.common.GlobalClass" + - type: "object" + properties: + supported-layer-protocol-qualifier: + type: "array" + description: "none" + items: + type: "string" + layer-protocol-name: + description: "Usage of layerProtocolName [>1] in the ServiceInterfacePoint\ + \ should be considered experimental" + $ref: "#/definitions/tapi.common.LayerProtocolName" + direction: + description: "If direction attribute is missing the SIP instance is to be\ + \ intended as 'BIDIRECTIONAL'" + $ref: "#/definitions/tapi.common.PortDirection" + description: "The LogicalTerminationPoint (LTP) object class encapsulates the\ + \ termination and adaptation functions of one or more transport layers. \r\ + \n The structure of LTP supports all transport protocols including\ + \ circuit and packet forms." + tapi.common.ServiceInterfacePointRef: + type: "object" + properties: + service-interface-point-uuid: + type: "string" + description: "none" + x-path: "/tapi-common:context/tapi-common:service-interface-point/tapi-common:uuid" + tapi.common.ServiceInterfacePointRefWrapper: + properties: + service-interface-point: + $ref: "#/definitions/tapi.common.ServiceInterfacePointRef" + tapi.common.ServiceInterfacePointWrapper: + properties: + service-interface-point: + $ref: "#/definitions/tapi.common.ServiceInterfacePoint" + tapi.common.TapiContext: + allOf: + - $ref: "#/definitions/tapi.common.GlobalClass" + - type: "object" + properties: + service-interface-point: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.common.ServiceInterfacePoint" + description: "The Network Control Domain (NCD) object class represents the scope\ + \ of control that a particular SDN controller has with respect to a particular\ + \ network, (i.e., encompassing a designated set of interconnected (virtual)\ + \ network elements)." + tapi.common.TerminationDirection: + type: "string" + enum: + - "BIDIRECTIONAL" + - "SINK" + - "SOURCE" + - "UNDEFINED_OR_UNKNOWN" + tapi.common.TerminationPac: + type: "object" + properties: + termination-direction: + description: "The overall directionality of the LP. \r\n -\ + \ A BIDIRECTIONAL LP will have some SINK and/or SOURCE flowss.\r\n \ + \ - A SINK LP can only contain elements with SINK flows or CONTRA_DIRECTION_SOURCE\ + \ flows\r\n - A SOURCE LP can only contain SOURCE flows or\ + \ CONTRA_DIRECTION_SINK flows" + $ref: "#/definitions/tapi.common.TerminationDirection" + termination-state: + description: "Indicates whether the layer is terminated and if so how." + $ref: "#/definitions/tapi.common.TerminationState" + tapi.common.TerminationState: + type: "string" + enum: + - "LP_CAN_NEVER_TERMINATE" + - "LT_NOT_TERMINATED" + - "TERMINATED_SERVER_TO_CLIENT_FLOW" + - "TERMINATED_CLIENT_TO_SERVER_FLOW" + - "TERMINATED_BIDIRECTIONAL" + - "LT_PERMENANTLY_TERMINATED" + - "TERMINATION_STATE_UNKNOWN" + tapi.common.TimeRange: + type: "object" + properties: + end-time: + type: "string" + description: "none" + start-time: + type: "string" + description: "none" + tapi.common.TimeRangeWrapper: + properties: + schedule: + $ref: "#/definitions/tapi.common.TimeRange" + tapi.common.getserviceinterfacepointdetails.Input: + type: "object" + properties: + sip-id-or-name: + type: "string" + description: "none" + tapi.common.getserviceinterfacepointdetails.Output: + type: "object" + properties: + sip: + description: "none" + $ref: "#/definitions/tapi.common.ServiceInterfacePoint" + tapi.common.getserviceinterfacepointlist.Output: + type: "object" + properties: + sip: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.common.ServiceInterfacePoint" + tapi.common.updateserviceinterfacepoint.Input: + type: "object" + properties: + sip-id-or-name: + type: "string" + description: "none" + state: + description: "none" + $ref: "#/definitions/tapi.common.AdministrativeState" + tapi.connectivity.CepList: + type: "object" + properties: + connection-end-point: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.connectivity.ConnectionEndPoint" + tapi.connectivity.CepListWrapper: + properties: + tapi-connectivity:cep-list: + $ref: "#/definitions/tapi.connectivity.CepList" + tapi.connectivity.CepRole: + type: "object" + properties: + role-name: + type: "string" + description: "The name of the cep role in the context of the referenced spec." + connection-spec-reference: + description: "The reference to the spec that defines the cep role." + $ref: "#/definitions/tapi.connectivity.ConnectionSpecReference" + tapi.connectivity.CepRoleWrapper: + properties: + cep-role: + $ref: "#/definitions/tapi.connectivity.CepRole" + tapi.connectivity.Connection: + allOf: + - $ref: "#/definitions/tapi.common.GlobalClass" + - $ref: "#/definitions/tapi.common.OperationalStatePac" + - type: "object" + properties: + supported-client-link: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.topology.LinkRef" + lower-connection: + type: "array" + description: "An Connection object supports a recursive aggregation relationship\ + \ such that the internal construction of an Connection can be exposed\ + \ as multiple lower level Connection objects (partitioning).\r\n \ + \ Aggregation is used as for the Node/Topology to allow changes\ + \ in hierarchy. \r\n Connection aggregation reflects Node/Topology\ + \ aggregation. \r\n The FC represents a Cross-Connection\ + \ in an NE. The Cross-Connection in an NE is not necessarily the lowest\ + \ level of FC partitioning." + items: + $ref: "#/definitions/tapi.connectivity.ConnectionRef" + switch-control: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.connectivity.SwitchControl" + route: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.connectivity.Route" + connection-spec-reference: + description: "Provides the reference to the spec that defines the connection\ + \ type and cepRoles." + $ref: "#/definitions/tapi.connectivity.ConnectionSpecReference" + layer-protocol-name: + description: "none" + $ref: "#/definitions/tapi.common.LayerProtocolName" + connection-end-point: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.connectivity.ConnectionEndPointRef" + direction: + description: "none" + $ref: "#/definitions/tapi.common.ForwardingDirection" + description: "The ForwardingConstruct (FC) object class models enabled potential\ + \ for forwarding between two or more LTPs and like the LTP supports any transport\ + \ protocol including all circuit and packet forms.\r\n At the lowest\ + \ level of recursion, a FC represents a cross-connection within an NE." + tapi.connectivity.ConnectionEndPoint: + allOf: + - $ref: "#/definitions/tapi.common.GlobalClass" + - $ref: "#/definitions/tapi.common.OperationalStatePac" + - $ref: "#/definitions/tapi.common.TerminationPac" + - type: "object" + properties: + client-node-edge-point: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.topology.NodeEdgePointRef" + connection-port-role: + description: "Each EP of the FC has a role (e.g., working, protection, protected,\ + \ symmetric, hub, spoke, leaf, root) in the context of the FC with respect\ + \ to the FC function. " + $ref: "#/definitions/tapi.common.PortRole" + layer-protocol-name: + description: "none" + $ref: "#/definitions/tapi.common.LayerProtocolName" + layer-protocol-qualifier: + type: "string" + description: "none" + parent-node-edge-point: + description: "none" + $ref: "#/definitions/tapi.topology.NodeEdgePointRef" + cep-role: + type: "array" + description: "Defines the role of the CEP in the context of the connection\ + \ spec.\r\n There may be many cep role - connection spec\ + \ combinations for a particular CEP where each corresponds to a specific\ + \ connection associated with the CEP." + items: + $ref: "#/definitions/tapi.connectivity.CepRole" + aggregated-connection-end-point: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.connectivity.ConnectionEndPointRef" + connection-port-direction: + description: "The orientation of defined flow at the EndPoint." + $ref: "#/definitions/tapi.common.PortDirection" + description: "The LogicalTerminationPoint (LTP) object class encapsulates the\ + \ termination and adaptation functions of one or more transport layers. \r\ + \n The structure of LTP supports all transport protocols including\ + \ circuit and packet forms." + tapi.connectivity.ConnectionEndPointRef: + allOf: + - $ref: "#/definitions/tapi.topology.NodeEdgePointRef" + - type: "object" + properties: + connection-end-point-uuid: + type: "string" + description: "none" + x-path: "/tapi-common:context/tapi-topology:topology-context/tapi-topology:topology/tapi-topology:node/tapi-topology:owned-node-edge-point/tapi-connectivity:cep-list/tapi-connectivity:connection-end-point/tapi-connectivity:uuid" + description: "none" + tapi.connectivity.ConnectionEndPointRefWrapper: + properties: + connection-end-point: + $ref: "#/definitions/tapi.connectivity.ConnectionEndPointRef" + tapi.connectivity.ConnectionEndPointWrapper: + properties: + connection-end-point: + $ref: "#/definitions/tapi.connectivity.ConnectionEndPoint" + tapi.connectivity.ConnectionRef: + type: "object" + properties: + connection-uuid: + type: "string" + description: "none" + x-path: "/tapi-common:context/tapi-connectivity:connectivity-context/tapi-connectivity:connection/tapi-connectivity:uuid" + tapi.connectivity.ConnectionRefWrapper: + properties: + lower-connection: + $ref: "#/definitions/tapi.connectivity.ConnectionRef" + tapi.connectivity.ConnectionSpecReference: + type: "object" + properties: + connection-spec-name: + type: "string" + description: "The name of the connection spec.\r\n This can\ + \ be used alone (with no spec reference) where there is only a paper spec." + connection-spec-id: + type: "string" + description: "The reference to a formal spec. \r\n This reference\ + \ need not be provided (e.g., where there is no formal machine interpretable\ + \ spec for the type of connection)." + tapi.connectivity.ConnectionSpecReferenceWrapper: + properties: + connection-spec-reference: + $ref: "#/definitions/tapi.connectivity.ConnectionSpecReference" + tapi.connectivity.ConnectionWrapper: + properties: + connection: + $ref: "#/definitions/tapi.connectivity.Connection" + tapi.connectivity.ConnectivityConstraint: + type: "object" + properties: + service-layer: + description: "none" + $ref: "#/definitions/tapi.common.LayerProtocolName" + schedule: + description: "none" + $ref: "#/definitions/tapi.common.TimeRange" + connectivity-direction: + description: "none" + $ref: "#/definitions/tapi.common.ForwardingDirection" + requested-capacity: + description: "none" + $ref: "#/definitions/tapi.common.Capacity" + diversity-exclusion: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceRef" + connection-inclusion: + type: "array" + description: "A ConnectivityService may use one or more existing Connections.\r\ + \n A common traditional strategy is to set up “stranded”\ + \ connectivity in the core of the network as “express channels” (this is\ + \ essentially a serial compound link, but can be treated as simple connections)\r\ + \n A connection inclusion capability allows for adoption\ + \ of a discovered Connections.\r\n A ConnectivityService\ + \ is requested with a connection inclusion constraint that identifies a\ + \ connection (or chain of connections) that is bounded by CEPs that each\ + \ belong to a NEP that references a SIP that is referenced by a CSEP of\ + \ the ConnectivityService such that all CSEPs are satisfied by CEPs of the\ + \ existing Connection. will allow discovered Connections with no stated\ + \ intent to be associated with an intent via the ConnectivityService." + items: + type: "string" + service-level: + type: "string" + description: "An abstract value the meaning of which is mutually agreed –\ + \ typically represents metrics such as - Class of service, priority, resiliency,\ + \ availability" + service-type: + description: "none" + $ref: "#/definitions/tapi.connectivity.ServiceType" + connection-exclusion: + type: "array" + description: "none" + items: + type: "string" + coroute-inclusion: + description: "none" + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceRef" + tapi.connectivity.ConnectivityContext: + type: "object" + properties: + connectivity-service: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.connectivity.ConnectivityService" + connection: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.connectivity.Connection" + tapi.connectivity.ConnectivityContextWrapper: + properties: + tapi-connectivity:connectivity-context: + $ref: "#/definitions/tapi.connectivity.ConnectivityContext" + tapi.connectivity.ConnectivityService: + allOf: + - $ref: "#/definitions/tapi.common.AdminStatePac" + - $ref: "#/definitions/tapi.common.GlobalClass" + - $ref: "#/definitions/tapi.connectivity.ConnectivityConstraint" + - $ref: "#/definitions/tapi.connectivity.ResilienceConstraint" + - $ref: "#/definitions/tapi.path.computation.RoutingConstraint" + - $ref: "#/definitions/tapi.path.computation.TopologyConstraint" + - type: "object" + properties: + end-point: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceEndPoint" + connection: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.connectivity.ConnectionRef" + description: "The ForwardingConstruct (FC) object class models enabled potential\ + \ for forwarding between two or more LTPs and like the LTP supports any transport\ + \ protocol including all circuit and packet forms.\r\n At the lowest\ + \ level of recursion, a FC represents a cross-connection within an NE." + tapi.connectivity.ConnectivityServiceEndPoint: + allOf: + - $ref: "#/definitions/tapi.common.AdminStatePac" + - $ref: "#/definitions/tapi.common.LocalClass" + - type: "object" + properties: + protection-role: + description: "To specify the protection role of this Port when create or\ + \ update ConnectivityService." + $ref: "#/definitions/tapi.connectivity.ProtectionRole" + role: + description: "Each EP of the FC has a role (e.g., working, protection, protected,\ + \ symmetric, hub, spoke, leaf, root) in the context of the FC with respect\ + \ to the FC function. " + $ref: "#/definitions/tapi.common.PortRole" + service-interface-point: + description: "none" + $ref: "#/definitions/tapi.common.ServiceInterfacePointRef" + peer-fwd-connectivity-service-end-point: + description: "none" + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceEndPointRef" + layer-protocol-name: + description: "none" + $ref: "#/definitions/tapi.common.LayerProtocolName" + layer-protocol-qualifier: + type: "string" + description: "none" + connection-end-point: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.connectivity.ConnectionEndPointRef" + server-connectivity-service-end-point: + description: "none" + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceEndPointRef" + protecting-connectivity-service-end-point: + description: "none" + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceEndPointRef" + direction: + description: "The orientation of defined flow at the EndPoint." + $ref: "#/definitions/tapi.common.PortDirection" + capacity: + description: "none" + $ref: "#/definitions/tapi.common.Capacity" + description: "The association of the FC to LTPs is made via EndPoints.\r\n \ + \ The EndPoint (EP) object class models the access to the FC function.\ + \ \r\n The traffic forwarding between the associated EPs of the\ + \ FC depends upon the type of FC and may be associated with FcSwitch object\ + \ instances. \r\n In cases where there is resilience the EndPoint\ + \ may convey the resilience role of the access to the FC. \r\n \ + \ It can represent a protected (resilient/reliable) point or a protecting\ + \ (unreliable working or protection) point.\r\n The EP replaces\ + \ the Protection Unit of a traditional protection model. \r\n The\ + \ ForwadingConstruct can be considered as a component and the EndPoint as\ + \ a Port on that component" + tapi.connectivity.ConnectivityServiceEndPointRef: + allOf: + - $ref: "#/definitions/tapi.connectivity.ConnectivityServiceRef" + - type: "object" + properties: + connectivity-service-end-point-local-id: + type: "string" + description: "none" + x-path: "/tapi-common:context/tapi-connectivity:connectivity-context/tapi-connectivity:connectivity-service/tapi-connectivity:end-point/tapi-connectivity:local-id" + description: "none" + tapi.connectivity.ConnectivityServiceEndPointRefWrapper: + properties: + peer-fwd-connectivity-service-end-point: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceEndPointRef" + tapi.connectivity.ConnectivityServiceEndPointWrapper: + properties: + end-point: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceEndPoint" + tapi.connectivity.ConnectivityServiceRef: + type: "object" + properties: + connectivity-service-uuid: + type: "string" + description: "none" + x-path: "/tapi-common:context/tapi-connectivity:connectivity-context/tapi-connectivity:connectivity-service/tapi-connectivity:uuid" + tapi.connectivity.ConnectivityServiceRefWrapper: + properties: + coroute-inclusion: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceRef" + tapi.connectivity.ConnectivityServiceWrapper: + properties: + connectivity-service: + $ref: "#/definitions/tapi.connectivity.ConnectivityService" + tapi.connectivity.ContextAugmentation3: + type: "object" + properties: + connectivity-context: + description: "Augments the base TAPI Context with ConnectivityService information" + $ref: "#/definitions/tapi.connectivity.ConnectivityContext" + x-augmentation: + prefix: "tapi-connectivity" + namespace: "urn:onf:otcc:yang:tapi-connectivity" + tapi.connectivity.CoordinateType: + type: "string" + enum: + - "NO_COORDINATE" + - "HOLD_OFF_TIME" + - "WAIT_FOR_NOTIFICATION" + tapi.connectivity.CreateConnectivityService: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.connectivity.createconnectivityservice.Output" + tapi.connectivity.GetConnectionDetails: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.connectivity.getconnectiondetails.Output" + tapi.connectivity.GetConnectionEndPointDetails: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.connectivity.getconnectionendpointdetails.Output" + tapi.connectivity.GetConnectivityServiceDetails: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.connectivity.getconnectivityservicedetails.Output" + tapi.connectivity.GetConnectivityServiceList: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.connectivity.getconnectivityservicelist.Output" + tapi.connectivity.OwnedNodeEdgePointAugmentation1: + type: "object" + properties: + cep-list: + description: "none" + $ref: "#/definitions/tapi.connectivity.CepList" + x-augmentation: + prefix: "tapi-connectivity" + namespace: "urn:onf:otcc:yang:tapi-connectivity" + tapi.connectivity.ProtectionRole: + type: "string" + enum: + - "WORK" + - "PROTECT" + - "PROTECTED" + - "NA" + - "WORK_RESTORE" + - "PROTECT_RESTORE" + tapi.connectivity.ResilienceConstraint: + type: "object" + properties: + is-lock-out: + type: "boolean" + description: "The resource is configured to temporarily not be available for\ + \ use in the protection scheme(s) it is part of.\r\n This\ + \ overrides all other protection control states including forced.\r\n \ + \ If the item is locked out then it cannot be used under any\ + \ circumstances.\r\n Note: Only relevant when part of a protection\ + \ scheme." + default: false + max-switch-times: + type: "integer" + format: "int32" + description: "Used to limit the maximum swtich times. When work fault disappears\ + \ , and traffic return to the original work path, switch counter reset." + restoration-coordinate-type: + description: " The coordination mechanism between multi-layers." + $ref: "#/definitions/tapi.connectivity.CoordinateType" + is-coordinated-switching-both-ends: + type: "boolean" + description: "Is operating such that switching at both ends of each flow acorss\ + \ the FC is coordinated at both ingress and egress ends." + default: false + hold-off-time: + type: "integer" + format: "int32" + description: "This attribute indicates the time, in milliseconds, between\ + \ declaration of signal degrade or signal fail, and the initialization of\ + \ the protection switching algorithm." + is-frozen: + type: "boolean" + description: "Temporarily prevents any switch action to be taken and, as such,\ + \ freezes the current state. \r\n Until the freeze is cleared,\ + \ additional near-end external commands are rejected and fault condition\ + \ changes and received APS messages are ignored.\r\n All\ + \ administrative controls of any aspect of protection are rejected." + default: false + wait-to-revert-time: + type: "integer" + format: "int32" + description: "If the protection system is revertive, this attribute specifies\ + \ the time, in minutes, to wait after a fault clears on a higher priority\ + \ (preferred) resource before reverting to the preferred resource." + default: 15 + resilience-type: + description: "none" + $ref: "#/definitions/tapi.topology.ResilienceType" + preferred-restoration-layer: + type: "array" + description: "Indicate which layer this resilience parameters package configured\ + \ for." + items: + $ref: "#/definitions/tapi.common.LayerProtocolName" + restore-priority: + type: "integer" + format: "int32" + description: "none" + reversion-mode: + description: "Indcates whether the protection scheme is revertive or non-revertive." + $ref: "#/definitions/tapi.connectivity.ReversionMode" + tapi.connectivity.ResilienceRoute: + allOf: + - $ref: "#/definitions/tapi.common.LocalClass" + - type: "object" + properties: + priority: + type: "integer" + format: "int32" + description: "Value of 0 (zero) means 'unspecified priority'.\r\n \ + \ Highest priority is 1, sometimes referred as 'preferred' or\ + \ 'main' or 'intended' route.\r\n 2 has lower priority\ + \ than 1, 3 has lower priority than 2, etc." + route-state: + type: "string" + description: "Current information on the route selection." + description: "This object adds resilience and state attributes to the Route.\r\ + \n When this object is not present, then the Route is intendend\ + \ as 'current' Route of the Connection." + tapi.connectivity.ResilienceRouteWrapper: + properties: + resilience-route-pac: + $ref: "#/definitions/tapi.connectivity.ResilienceRoute" + tapi.connectivity.ReversionMode: + type: "string" + enum: + - "REVERTIVE" + - "NON-REVERTIVE" + tapi.connectivity.Route: + allOf: + - $ref: "#/definitions/tapi.common.LocalClass" + - type: "object" + properties: + connection-end-point: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.connectivity.ConnectionEndPointRef" + resilience-route-pac: + description: "Provides optional resilience and state attributes to the Route." + $ref: "#/definitions/tapi.connectivity.ResilienceRoute" + description: "The Route of a Connection is modeled as a collection of Connection\ + \ End Points.\r\n The logical order of the Connection End Points\ + \ within the Route object can be inferred by the TAPI client by the knowledge\ + \ of the Topology information." + tapi.connectivity.RouteRef: + allOf: + - $ref: "#/definitions/tapi.connectivity.ConnectionRef" + - type: "object" + properties: + route-local-id: + type: "string" + description: "none" + x-path: "/tapi-common:context/tapi-connectivity:connectivity-context/tapi-connectivity:connection/tapi-connectivity:route/tapi-connectivity:local-id" + description: "none" + tapi.connectivity.RouteRefWrapper: + properties: + selected-route: + $ref: "#/definitions/tapi.connectivity.RouteRef" + tapi.connectivity.RouteWrapper: + properties: + route: + $ref: "#/definitions/tapi.connectivity.Route" + tapi.connectivity.SelectionControl: + type: "string" + enum: + - "LOCK_OUT" + - "NORMAL" + - "MANUAL" + - "FORCED" + tapi.connectivity.SelectionReason: + type: "string" + enum: + - "LOCKOUT" + - "NORMAL" + - "MANUAL" + - "FORCED" + - "WAIT_TO_REVERT" + - "SIGNAL_DEGRADE" + - "SIGNAL_FAIL" + tapi.connectivity.ServiceType: + type: "string" + enum: + - "POINT_TO_POINT_CONNECTIVITY" + - "POINT_TO_MULTIPOINT_CONNECTIVITY" + - "MULTIPOINT_CONNECTIVITY" + - "ROOTED_MULTIPOINT_CONNECTIVITY" + tapi.connectivity.Switch: + allOf: + - $ref: "#/definitions/tapi.common.LocalClass" + - type: "object" + properties: + selected-connection-end-point: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.connectivity.ConnectionEndPointRef" + selected-route: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.connectivity.RouteRef" + selection-control: + description: "Degree of administrative control applied to the switch selection." + $ref: "#/definitions/tapi.connectivity.SelectionControl" + selection-reason: + description: "The reason for the current switch selection." + $ref: "#/definitions/tapi.connectivity.SelectionReason" + switch-direction: + description: "Indicates whether the switch selects from ingress to the FC\ + \ or to egress of the FC, or both." + $ref: "#/definitions/tapi.common.PortDirection" + description: "The class models the switched forwarding of traffic (traffic flow)\ + \ between FcPorts (ConnectionEndPoints) and is present where there is protection\ + \ functionality in the FC (Connection). \r\n If an FC exposes protection\ + \ (having two or more FcPorts that provide alternative identical inputs/outputs),\ + \ the FC will have one or more associated FcSwitch objects to represent the\ + \ alternative flow choices visible at the edge of the FC.\r\n The\ + \ FC switch represents and defines a protection switch structure encapsulated\ + \ in the FC. \r\n Essentially performs one of the functions of\ + \ the Protection Group in a traditional model. It associates to 2 or more\ + \ FcPorts each playing the role of a Protection Unit. \r\n One\ + \ or more protection, i.e. standby/backup, FcPorts provide protection for\ + \ one or more working (i.e. regular/main/preferred) FcPorts where either protection\ + \ or working can feed one or more protected FcPort.\r\n The switch\ + \ may be used in revertive or non-revertive (symmetric) mode. When in revertive\ + \ mode it may define a waitToRestore time.\r\n It may be used in\ + \ one of several modes including source switch, destination switched, source\ + \ and destination switched etc (covering cases such as 1+1 and 1:1).\r\n \ + \ It may be locked out (prevented from switching), force switched\ + \ or manual switched.\r\n It will indicate switch state and change\ + \ of state.\r\n The switch can be switched away from all sources\ + \ such that it becomes open and hence two coordinated switches can both feed\ + \ the same LTP so long as at least one of the two is switched away from all\ + \ sources (is 'open').\r\n The ability for a Switch to be 'high\ + \ impedance' allows bidirectional ForwardingConstructs to be overlaid on the\ + \ same bidirectional LTP where the appropriate control is enabled to prevent\ + \ signal conflict.\r\n This ability allows multiple alternate routes\ + \ to be present that otherwise would be in conflict." + tapi.connectivity.SwitchControl: + allOf: + - $ref: "#/definitions/tapi.common.GlobalClass" + - $ref: "#/definitions/tapi.connectivity.ResilienceConstraint" + - type: "object" + properties: + sub-switch-control: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.connectivity.SwitchControlRef" + switch: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.connectivity.Switch" + description: "Represents the capability to control and coordinate switches,\ + \ to add/delete/modify FCs and to add/delete/modify LTPs/LPs so as to realize\ + \ a protection scheme." + tapi.connectivity.SwitchControlRef: + allOf: + - $ref: "#/definitions/tapi.connectivity.ConnectionRef" + - type: "object" + properties: + switch-control-uuid: + type: "string" + description: "none" + x-path: "/tapi-common:context/tapi-connectivity:connectivity-context/tapi-connectivity:connection/tapi-connectivity:switch-control/tapi-connectivity:uuid" + description: "none" + tapi.connectivity.SwitchControlRefWrapper: + properties: + sub-switch-control: + $ref: "#/definitions/tapi.connectivity.SwitchControlRef" + tapi.connectivity.SwitchControlWrapper: + properties: + switch-control: + $ref: "#/definitions/tapi.connectivity.SwitchControl" + tapi.connectivity.SwitchWrapper: + properties: + switch: + $ref: "#/definitions/tapi.connectivity.Switch" + tapi.connectivity.UpdateConnectivityService: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.connectivity.updateconnectivityservice.Output" + tapi.connectivity.createconnectivityservice.Input: + type: "object" + properties: + topology-constraint: + description: "none" + $ref: "#/definitions/tapi.path.computation.TopologyConstraint" + end-point: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceEndPoint" + resilience-constraint: + description: "none" + $ref: "#/definitions/tapi.connectivity.ResilienceConstraint" + routing-constraint: + description: "none" + $ref: "#/definitions/tapi.path.computation.RoutingConstraint" + state: + type: "string" + description: "none" + connectivity-constraint: + description: "none" + $ref: "#/definitions/tapi.connectivity.ConnectivityConstraint" + tapi.connectivity.createconnectivityservice.Output: + type: "object" + properties: + service: + description: "none" + $ref: "#/definitions/tapi.connectivity.ConnectivityService" + tapi.connectivity.deleteconnectivityservice.Input: + type: "object" + properties: + service-id-or-name: + type: "string" + description: "none" + tapi.connectivity.getconnectiondetails.Input: + type: "object" + properties: + connection-id-or-name: + type: "string" + description: "none" + tapi.connectivity.getconnectiondetails.Output: + type: "object" + properties: + connection: + description: "none" + $ref: "#/definitions/tapi.connectivity.Connection" + tapi.connectivity.getconnectionendpointdetails.Input: + type: "object" + properties: + cep-id-or-name: + type: "string" + description: "none" + nep-id-or-name: + type: "string" + description: "none" + node-id-or-name: + type: "string" + description: "none" + topology-id-or-name: + type: "string" + description: "none" + tapi.connectivity.getconnectionendpointdetails.Output: + type: "object" + properties: + connection-end-point: + description: "none" + $ref: "#/definitions/tapi.connectivity.ConnectionEndPoint" + tapi.connectivity.getconnectivityservicedetails.Input: + type: "object" + properties: + service-id-or-name: + type: "string" + description: "none" + tapi.connectivity.getconnectivityservicedetails.Output: + type: "object" + properties: + service: + description: "none" + $ref: "#/definitions/tapi.connectivity.ConnectivityService" + tapi.connectivity.getconnectivityservicelist.Output: + type: "object" + properties: + service: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.connectivity.ConnectivityService" + tapi.connectivity.updateconnectivityservice.Input: + type: "object" + properties: + service-id-or-name: + type: "string" + description: "none" + topology-constraint: + description: "none" + $ref: "#/definitions/tapi.path.computation.TopologyConstraint" + end-point: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.connectivity.ConnectivityServiceEndPoint" + resilience-constraint: + description: "none" + $ref: "#/definitions/tapi.connectivity.ResilienceConstraint" + routing-constraint: + description: "none" + $ref: "#/definitions/tapi.path.computation.RoutingConstraint" + state: + type: "string" + description: "none" + connectivity-constraint: + description: "none" + $ref: "#/definitions/tapi.connectivity.ConnectivityConstraint" + tapi.connectivity.updateconnectivityservice.Output: + type: "object" + properties: + service: + description: "none" + $ref: "#/definitions/tapi.connectivity.ConnectivityService" + tapi.notification.AlarmInfo: + type: "object" + properties: + perceived-severity: + description: "none" + $ref: "#/definitions/tapi.notification.PerceivedSeverityType" + probable-cause: + type: "string" + description: "none" + service-affecting: + description: "none" + $ref: "#/definitions/tapi.notification.ServiceAffecting" + is-transient: + type: "boolean" + description: "none" + default: false + tapi.notification.AlarmInfoWrapper: + properties: + alarm-info: + $ref: "#/definitions/tapi.notification.AlarmInfo" + tapi.notification.ContextAugmentation1: + type: "object" + properties: + notification-context: + description: "Augments the base TAPI Context with NotificationService information" + $ref: "#/definitions/tapi.notification.NotificationContext" + x-augmentation: + prefix: "tapi-notification" + namespace: "urn:onf:otcc:yang:tapi-notification" + tapi.notification.CreateNotificationSubscriptionService: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.notification.createnotificationsubscriptionservice.Output" + tapi.notification.DeleteNotificationSubscriptionService: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.notification.deletenotificationsubscriptionservice.Output" + tapi.notification.GetNotificationList: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.notification.getnotificationlist.Output" + tapi.notification.GetNotificationSubscriptionServiceDetails: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.notification.getnotificationsubscriptionservicedetails.Output" + tapi.notification.GetNotificationSubscriptionServiceList: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.notification.getnotificationsubscriptionservicelist.Output" + tapi.notification.GetSupportedNotificationTypes: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.notification.getsupportednotificationtypes.Output" + tapi.notification.NameAndValueChange: + type: "object" + properties: + value-name: + type: "string" + description: "The name of the value. The value need not have a name." + old-value: + type: "string" + description: "The value" + new-value: + type: "string" + description: "The value" + tapi.notification.NameAndValueChangeWrapper: + properties: + changed-attributes: + $ref: "#/definitions/tapi.notification.NameAndValueChange" + tapi.notification.Notification: + allOf: + - $ref: "#/definitions/tapi.common.GlobalClass" + - type: "object" + properties: + target-object-type: + description: "none" + $ref: "#/definitions/tapi.notification.ObjectType" + additional-text: + type: "string" + description: "none" + event-time-stamp: + type: "string" + description: "none" + additional-info: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.common.NameAndValue" + sequence-number: + type: "integer" + format: "int32" + description: "A monotonous increasing sequence number associated with the\ + \ notification.\r\n The exact semantics of how this sequence\ + \ number is assigned (per channel or subscription or source or system)\ + \ is left undefined." + tca-info: + description: "none" + $ref: "#/definitions/tapi.notification.TcaInfo" + target-object-identifier: + type: "string" + description: "none" + notification-type: + description: "none" + $ref: "#/definitions/tapi.notification.NotificationType" + target-object-name: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.common.NameAndValue" + layer-protocol-name: + description: "none" + $ref: "#/definitions/tapi.common.LayerProtocolName" + source-indicator: + description: "none" + $ref: "#/definitions/tapi.notification.SourceIndicator" + alarm-info: + description: "none" + $ref: "#/definitions/tapi.notification.AlarmInfo" + changed-attributes: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.notification.NameAndValueChange" + description: "none" + tapi.notification.NotificationChannel: + allOf: + - $ref: "#/definitions/tapi.common.LocalClass" + - type: "object" + properties: + next-sequence-no: + type: "integer" + format: "int32" + description: "The sequence number of the next notification that will be\ + \ published on the channel" + stream-address: + type: "string" + description: "The address/location/URI of the channel/stream to which the\ + \ subscribed notifications are published.\r\n This specifics\ + \ of this is typically dependent on the implementation protocol & mechanism\ + \ and hence is typed as a string." + description: "none" + tapi.notification.NotificationChannelWrapper: + properties: + notification-channel: + $ref: "#/definitions/tapi.notification.NotificationChannel" + tapi.notification.NotificationContext: + type: "object" + properties: + notif-subscription: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.notification.NotificationSubscriptionService" + notification: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.notification.Notification" + tapi.notification.NotificationContextWrapper: + properties: + tapi-notification:notification-context: + $ref: "#/definitions/tapi.notification.NotificationContext" + tapi.notification.NotificationSubscriptionService: + allOf: + - $ref: "#/definitions/tapi.common.GlobalClass" + - type: "object" + properties: + notification: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.notification.Notification" + notification-channel: + description: "none" + $ref: "#/definitions/tapi.notification.NotificationChannel" + subscription-state: + description: "none" + $ref: "#/definitions/tapi.notification.SubscriptionState" + supported-object-types: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.notification.ObjectType" + supported-notification-types: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.notification.NotificationType" + subscription-filter: + description: "none" + $ref: "#/definitions/tapi.notification.SubscriptionFilter" + description: "none" + tapi.notification.NotificationSubscriptionServiceWrapper: + properties: + notif-subscription: + $ref: "#/definitions/tapi.notification.NotificationSubscriptionService" + tapi.notification.NotificationType: + type: "string" + enum: + - "OBJECT_CREATION" + - "OBJECT_DELETION" + - "ATTRIBUTE_VALUE_CHANGE" + - "ALARM_EVENT" + - "THRESHOLD_CROSSING_ALERT" + tapi.notification.NotificationWrapper: + properties: + notification: + $ref: "#/definitions/tapi.notification.Notification" + tapi.notification.ObjectType: + type: "string" + enum: + - "TOPOLOGY" + - "NODE" + - "LINK" + - "CONNECTION" + - "PATH" + - "CONNECTIVITY_SERVICE" + - "VIRTUAL_NETWORK_SERVICE" + - "PATH_COMPUTATION_SERVICE" + - "NODE_EDGE_POINT" + - "SERVICE_INTERFACE_POINT" + - "CONNECTION_END_POINT" + - "MAINTENANCE_ENTITY_GROUP" + - "MAINTENANCE_ENTITY" + - "MEG_END_POINT" + - "MEG_INTERMEDIATE_POINT" + - "SWITCH_CONTROL" + - "SWITCH" + - "ROUTE" + - "NODE_RULE_GROUP" + - "INTER_RULE_GROUP" + - "RULE" + - "OAM_JOB" + - "ACCESS_PORT" + - "EQUIPMENT" + - "HOLDER" + - "PHYSICAL_SPAN" + - "ABSTRACT_STRAND" + - "DEVICE" + tapi.notification.PerceivedSeverityType: + type: "string" + enum: + - "CRITICAL" + - "MAJOR" + - "MINOR" + - "WARNING" + - "CLEARED" + tapi.notification.PerceivedTcaSeverity: + type: "string" + enum: + - "WARNING" + - "CLEAR" + tapi.notification.ServiceAffecting: + type: "string" + enum: + - "SERVICE_AFFECTING" + - "NOT_SERVICE_AFFECTING" + - "UNKNOWN" + tapi.notification.SourceIndicator: + type: "string" + enum: + - "RESOURCE_OPERATION" + - "MANAGEMENT_OPERATION" + - "UNKNOWN" + tapi.notification.SubscriptionFilter: + allOf: + - $ref: "#/definitions/tapi.common.LocalClass" + - type: "object" + properties: + requested-notification-types: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.notification.NotificationType" + requested-object-identifier: + type: "array" + description: "none" + items: + type: "string" + requested-layer-protocols: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.common.LayerProtocolName" + include-content: + type: "boolean" + description: "Indicates whether the published Notification includes content\ + \ or just the Notification Id (which enables retrieval of the notification\ + \ at the later stage)" + default: false + requested-object-types: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.notification.ObjectType" + description: "none" + tapi.notification.SubscriptionFilterWrapper: + properties: + subscription-filter: + $ref: "#/definitions/tapi.notification.SubscriptionFilter" + tapi.notification.SubscriptionState: + type: "string" + enum: + - "SUSPENDED" + - "ACTIVE" + tapi.notification.TcaInfo: + type: "object" + properties: + threshold-crossing: + description: "none" + $ref: "#/definitions/tapi.notification.ThresholdCrossingType" + threshold-parameter: + type: "string" + description: "none" + is-transient: + type: "boolean" + description: "none" + default: false + threshold-value: + type: "integer" + format: "int32" + description: "none" + perceived-severity: + description: "none" + $ref: "#/definitions/tapi.notification.PerceivedTcaSeverity" + suspect-interval-flag: + type: "boolean" + description: "none" + default: false + measurement-interval: + type: "string" + description: "none" + tapi.notification.TcaInfoWrapper: + properties: + tca-info: + $ref: "#/definitions/tapi.notification.TcaInfo" + tapi.notification.ThresholdCrossingType: + type: "string" + enum: + - "THRESHOLD_ABOVE" + - "THRESHOLD_BELOW" + - "CLEARED" + tapi.notification.UpdateNotificationSubscriptionService: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.notification.updatenotificationsubscriptionservice.Output" + tapi.notification.createnotificationsubscriptionservice.Input: + type: "object" + properties: + subscription-state: + description: "none" + $ref: "#/definitions/tapi.notification.SubscriptionState" + subscription-filter: + description: "none" + $ref: "#/definitions/tapi.notification.SubscriptionFilter" + tapi.notification.createnotificationsubscriptionservice.Output: + type: "object" + properties: + subscription-service: + description: "none" + $ref: "#/definitions/tapi.notification.NotificationSubscriptionService" + tapi.notification.deletenotificationsubscriptionservice.Input: + type: "object" + properties: + subscription-id-or-name: + type: "string" + description: "none" + tapi.notification.deletenotificationsubscriptionservice.Output: + type: "object" + properties: + subscription-service: + description: "none" + $ref: "#/definitions/tapi.notification.NotificationSubscriptionService" + tapi.notification.getnotificationlist.Input: + type: "object" + properties: + time-period: + type: "string" + description: "none" + subscription-id-or-name: + type: "string" + description: "none" + tapi.notification.getnotificationlist.Output: + type: "object" + properties: + notification: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.notification.Notification" + tapi.notification.getnotificationsubscriptionservicedetails.Input: + type: "object" + properties: + subscription-id-or-name: + type: "string" + description: "none" + tapi.notification.getnotificationsubscriptionservicedetails.Output: + type: "object" + properties: + subscription-service: + description: "none" + $ref: "#/definitions/tapi.notification.NotificationSubscriptionService" + tapi.notification.getnotificationsubscriptionservicelist.Output: + type: "object" + properties: + subscription-service: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.notification.NotificationSubscriptionService" + tapi.notification.getsupportednotificationtypes.Output: + type: "object" + properties: + supported-object-types: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.notification.ObjectType" + supported-notification-types: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.notification.NotificationType" + tapi.notification.updatenotificationsubscriptionservice.Input: + type: "object" + properties: + subscription-state: + description: "none" + $ref: "#/definitions/tapi.notification.SubscriptionState" + subscription-filter: + description: "none" + $ref: "#/definitions/tapi.notification.SubscriptionFilter" + subscription-id-or-name: + type: "string" + description: "none" + tapi.notification.updatenotificationsubscriptionservice.Output: + type: "object" + properties: + subscription-service: + description: "none" + $ref: "#/definitions/tapi.notification.NotificationSubscriptionService" + tapi.path.computation.ComputeP2PPath: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.path.computation.computep2ppath.Output" + tapi.path.computation.ContextAugmentation2: + type: "object" + properties: + path-computation-context: + description: "Augments the base TAPI Context with PathComputationService information" + $ref: "#/definitions/tapi.path.computation.PathComputationContext" + x-augmentation: + prefix: "tapi-path-computation" + namespace: "urn:onf:otcc:yang:tapi-path-computation" + tapi.path.computation.DeleteP2PPath: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.path.computation.deletep2ppath.Output" + tapi.path.computation.DiversityPolicy: + type: "string" + enum: + - "SRLG" + - "SRNG" + - "SNG" + - "NODE" + - "LINK" + tapi.path.computation.OptimizeP2Ppath: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.path.computation.optimizep2ppath.Output" + tapi.path.computation.Path: + allOf: + - $ref: "#/definitions/tapi.common.GlobalClass" + - type: "object" + properties: + layer-protocol-name: + description: "none" + $ref: "#/definitions/tapi.common.LayerProtocolName" + link: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.topology.LinkRef" + routing-constraint: + description: "none" + $ref: "#/definitions/tapi.path.computation.RoutingConstraint" + direction: + description: "none" + $ref: "#/definitions/tapi.common.ForwardingDirection" + description: "Path is described by an ordered list of TE Links. A TE Link is\ + \ defined by a pair of Node/NodeEdgePoint IDs. A Connection is realized by\ + \ concatenating link resources (associated with a Link) and the lower-level\ + \ connections (cross-connections) in the different nodes" + tapi.path.computation.PathComputationContext: + type: "object" + properties: + path-comp-service: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.path.computation.PathComputationService" + path: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.path.computation.Path" + tapi.path.computation.PathComputationContextWrapper: + properties: + tapi-path-computation:path-computation-context: + $ref: "#/definitions/tapi.path.computation.PathComputationContext" + tapi.path.computation.PathComputationService: + allOf: + - $ref: "#/definitions/tapi.common.GlobalClass" + - type: "object" + properties: + topology-constraint: + description: "none" + $ref: "#/definitions/tapi.path.computation.TopologyConstraint" + path: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.path.computation.PathRef" + objective-function: + description: "none" + $ref: "#/definitions/tapi.path.computation.PathObjectiveFunction" + end-point: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.path.computation.PathServiceEndPoint" + routing-constraint: + description: "none" + $ref: "#/definitions/tapi.path.computation.RoutingConstraint" + optimization-constraint: + description: "none" + $ref: "#/definitions/tapi.path.computation.PathOptimizationConstraint" + description: "none" + tapi.path.computation.PathComputationServiceWrapper: + properties: + path-comp-service: + $ref: "#/definitions/tapi.path.computation.PathComputationService" + tapi.path.computation.PathObjectiveFunction: + allOf: + - $ref: "#/definitions/tapi.common.LocalClass" + - type: "object" + properties: + link-utilization: + description: "none" + $ref: "#/definitions/tapi.common.DirectiveValue" + bandwidth-optimization: + description: "none" + $ref: "#/definitions/tapi.common.DirectiveValue" + cost-optimization: + description: "none" + $ref: "#/definitions/tapi.common.DirectiveValue" + resource-sharing: + description: "none" + $ref: "#/definitions/tapi.common.DirectiveValue" + concurrent-paths: + description: "none" + $ref: "#/definitions/tapi.common.DirectiveValue" + description: "none" + tapi.path.computation.PathObjectiveFunctionWrapper: + properties: + objective-function: + $ref: "#/definitions/tapi.path.computation.PathObjectiveFunction" + tapi.path.computation.PathOptimizationConstraint: + allOf: + - $ref: "#/definitions/tapi.common.LocalClass" + - type: "object" + properties: + traffic-interruption: + description: "none" + $ref: "#/definitions/tapi.common.DirectiveValue" + description: "none" + tapi.path.computation.PathOptimizationConstraintWrapper: + properties: + optimization-constraint: + $ref: "#/definitions/tapi.path.computation.PathOptimizationConstraint" + tapi.path.computation.PathRef: + type: "object" + properties: + path-uuid: + type: "string" + description: "none" + x-path: "/tapi-common:context/tapi-path-computation:path-computation-context/tapi-path-computation:path/tapi-path-computation:uuid" + tapi.path.computation.PathRefWrapper: + properties: + path: + $ref: "#/definitions/tapi.path.computation.PathRef" + tapi.path.computation.PathServiceEndPoint: + allOf: + - $ref: "#/definitions/tapi.common.LocalClass" + - type: "object" + properties: + role: + description: "Each EP of the FC has a role (e.g., working, protection, protected,\ + \ symmetric, hub, spoke, leaf, root) in the context of the FC with respect\ + \ to the FC function. " + $ref: "#/definitions/tapi.common.PortRole" + service-interface-point: + description: "none" + $ref: "#/definitions/tapi.common.ServiceInterfacePointRef" + layer-protocol-name: + description: "none" + $ref: "#/definitions/tapi.common.LayerProtocolName" + layer-protocol-qualifier: + type: "string" + description: "none" + direction: + description: "The orientation of defined flow at the EndPoint." + $ref: "#/definitions/tapi.common.PortDirection" + capacity: + description: "none" + $ref: "#/definitions/tapi.common.Capacity" + description: "The association of the FC to LTPs is made via EndPoints.\r\n \ + \ The EndPoint (EP) object class models the access to the FC function.\ + \ \r\n The traffic forwarding between the associated EPs of the\ + \ FC depends upon the type of FC and may be associated with FcSwitch object\ + \ instances. \r\n In cases where there is resilience the EndPoint\ + \ may convey the resilience role of the access to the FC. \r\n \ + \ It can represent a protected (resilient/reliable) point or a protecting\ + \ (unreliable working or protection) point.\r\n The EP replaces\ + \ the Protection Unit of a traditional protection model. \r\n The\ + \ ForwadingConstruct can be considered as a component and the EndPoint as\ + \ a Port on that component" + tapi.path.computation.PathServiceEndPointWrapper: + properties: + end-point: + $ref: "#/definitions/tapi.path.computation.PathServiceEndPoint" + tapi.path.computation.PathWrapper: + properties: + path: + $ref: "#/definitions/tapi.path.computation.Path" + tapi.path.computation.RouteObjectiveFunction: + type: "string" + enum: + - "MIN_WORK_ROUTE_HOP" + - "MIN_WORK_ROUTE_COST" + - "MIN_WORK_ROUTE_LATENCY" + - "MIN_SUM_OF_WORK_AND_PROTECTION_ROUTE_HOP" + - "MIN_SUM_OF_WORK_AND_PROTECTION_ROUTE_COST" + - "MIN_SUM_OF_WORK_AND_PROTECTION_ROUTE_LATENCY" + - "LOAD_BALANCE_MAX_UNUSED_CAPACITY" + tapi.path.computation.RoutingConstraint: + type: "object" + properties: + is-exclusive: + type: "boolean" + description: "To distinguish if the resources are to be exclusive to the service" + default: true + max-allowed-cost: + description: "none" + $ref: "#/definitions/tapi.path.computation.ValueOrPriority" + diversity-policy: + description: "none" + $ref: "#/definitions/tapi.path.computation.DiversityPolicy" + route-objective-function: + description: "none" + $ref: "#/definitions/tapi.path.computation.RouteObjectiveFunction" + cost-characteristic: + type: "array" + description: "The list of costs where each cost relates to some aspect of\ + \ the TopologicalEntity." + items: + $ref: "#/definitions/tapi.topology.CostCharacteristic" + max-allowed-hops: + description: "none" + $ref: "#/definitions/tapi.path.computation.ValueOrPriority" + max-allowed-delay: + description: "Delay unit is microseconds." + $ref: "#/definitions/tapi.path.computation.ValueOrPriority" + latency-characteristic: + type: "array" + description: "The effect on the latency of a queuing process. This only has\ + \ significant effect for packet based systems and has a complex characteristic." + items: + $ref: "#/definitions/tapi.topology.LatencyCharacteristic" + risk-diversity-characteristic: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.topology.RiskCharacteristic" + route-direction: + description: "none" + $ref: "#/definitions/tapi.common.ForwardingDirection" + tapi.path.computation.RoutingConstraintWrapper: + properties: + routing-constraint: + $ref: "#/definitions/tapi.path.computation.RoutingConstraint" + tapi.path.computation.TopologyConstraint: + type: "object" + properties: + include-node: + type: "array" + description: "This is a loose constraint - that is it is unordered and could\ + \ be a partial list" + items: + type: "string" + exclude-link: + type: "array" + description: "none" + items: + type: "string" + avoid-topology: + type: "array" + description: "none" + items: + type: "string" + exclude-path: + type: "array" + description: "none" + items: + type: "string" + include-link: + type: "array" + description: "This is a loose constraint - that is it is unordered and could\ + \ be a partial list " + items: + type: "string" + preferred-transport-layer: + type: "array" + description: "soft constraint requested by client to indicate the layer(s)\ + \ of transport connection that it prefers to carry the service. This could\ + \ be same as the service layer or one of the supported server layers" + items: + $ref: "#/definitions/tapi.common.LayerProtocolName" + exclude-node: + type: "array" + description: "none" + items: + type: "string" + include-topology: + type: "array" + description: "none" + items: + type: "string" + include-path: + type: "array" + description: "none" + items: + type: "string" + tapi.path.computation.TopologyConstraintWrapper: + properties: + topology-constraint: + $ref: "#/definitions/tapi.path.computation.TopologyConstraint" + tapi.path.computation.ValueOrPriority: + type: "object" + properties: + priority: + type: "integer" + format: "int32" + description: "none" + value: + type: "integer" + format: "int32" + description: "none" + tapi.path.computation.ValueOrPriorityWrapper: + properties: + max-allowed-cost: + $ref: "#/definitions/tapi.path.computation.ValueOrPriority" + tapi.path.computation.computep2ppath.Input: + type: "object" + properties: + topology-constraint: + description: "none" + $ref: "#/definitions/tapi.path.computation.TopologyConstraint" + routing-constraint: + description: "none" + $ref: "#/definitions/tapi.path.computation.RoutingConstraint" + objective-function: + description: "none" + $ref: "#/definitions/tapi.path.computation.PathObjectiveFunction" + sep: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.path.computation.PathServiceEndPoint" + tapi.path.computation.computep2ppath.Output: + type: "object" + properties: + service: + description: "none" + $ref: "#/definitions/tapi.path.computation.PathComputationService" + tapi.path.computation.deletep2ppath.Input: + type: "object" + properties: + path-id-or-name: + type: "string" + description: "none" + tapi.path.computation.deletep2ppath.Output: + type: "object" + properties: + service: + description: "none" + $ref: "#/definitions/tapi.path.computation.PathComputationService" + tapi.path.computation.optimizep2ppath.Input: + type: "object" + properties: + routing-constraint: + description: "none" + $ref: "#/definitions/tapi.path.computation.RoutingConstraint" + path-id-or-name: + type: "string" + description: "none" + optimization-constraint: + description: "none" + $ref: "#/definitions/tapi.path.computation.PathOptimizationConstraint" + objective-function: + description: "none" + $ref: "#/definitions/tapi.path.computation.PathObjectiveFunction" + tapi.path.computation.optimizep2ppath.Output: + type: "object" + properties: + service: + description: "none" + $ref: "#/definitions/tapi.path.computation.PathComputationService" + tapi.topology.ConnectionSpecReference: + type: "object" + properties: + connection-spec-name: + type: "string" + description: "The name of the connection type spec.\r\n This\ + \ can be used as a reference to a paper document where full formal machine\ + \ interpretable specs are not supported." + connection-spec-id: + type: "string" + description: "The reference to a formal spec. \r\n This reference\ + \ need not be provided (e.g., where there is no formal machine interpretable\ + \ spec for the type of connection)." + tapi.topology.ConnectionSpecReferenceWrapper: + properties: + connection-spec-reference: + $ref: "#/definitions/tapi.topology.ConnectionSpecReference" + tapi.topology.ContextAugmentation4: + type: "object" + properties: + topology-context: + description: "Augments the base TAPI Context with TopologyService information" + $ref: "#/definitions/tapi.topology.TopologyContext" + x-augmentation: + prefix: "tapi-topology" + namespace: "urn:onf:otcc:yang:tapi-topology" + tapi.topology.CostCharacteristic: + type: "object" + properties: + cost-value: + type: "string" + description: "The specific cost." + cost-algorithm: + type: "string" + description: "The cost may vary based upon some properties of the TopologicalEntity.\ + \ The rules for the variation are conveyed by the costAlgorithm." + cost-name: + type: "string" + description: "The cost characteristic will related to some aspect of the TopologicalEntity\ + \ (e.g. $ cost, routing weight). This aspect will be conveyed by the costName." + tapi.topology.CostCharacteristicWrapper: + properties: + cost-characteristic: + $ref: "#/definitions/tapi.topology.CostCharacteristic" + tapi.topology.ForwardingRule: + type: "string" + enum: + - "MAY_FORWARD_ACROSS_GROUP" + - "MUST_FORWARD_ACROSS_GROUP" + - "CANNOT_FORWARD_ACROSS_GROUP" + - "NO_STATEMENT_ON_FORWARDING" + - "INTER_CONNECTION_CONTENTION" + tapi.topology.GetLinkDetails: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.topology.getlinkdetails.Output" + tapi.topology.GetNodeDetails: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.topology.getnodedetails.Output" + tapi.topology.GetNodeEdgePointDetails: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.topology.getnodeedgepointdetails.Output" + tapi.topology.GetTopologyDetails: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.topology.gettopologydetails.Output" + tapi.topology.GetTopologyList: + type: "object" + properties: + output: + $ref: "#/definitions/tapi.topology.gettopologylist.Output" + tapi.topology.InterRuleGroup: + allOf: + - $ref: "#/definitions/tapi.common.CapacityPac" + - $ref: "#/definitions/tapi.common.GlobalClass" + - $ref: "#/definitions/tapi.topology.RiskParameterPac" + - $ref: "#/definitions/tapi.topology.TransferCostPac" + - $ref: "#/definitions/tapi.topology.TransferTimingPac" + - type: "object" + properties: + associated-node-rule-group: + type: "array" + description: "The NodeRuleGroups that the InterRuleGroup constrains interconnection\ + \ between.\r\n The CEPs of the NEPs of a referenced NodeRuleGroup\ + \ can interconnect to the CEPs of the NEPs of another referenced NodeRuleGroup\ + \ constrained by the rules of the InterRuleGroup." + items: + $ref: "#/definitions/tapi.topology.NodeRuleGroupRef" + rule: + type: "array" + description: "The list of rules of the InterRuleGroup." + items: + $ref: "#/definitions/tapi.topology.Rule" + description: "Rules that apply between groups of NEPs." + tapi.topology.InterRuleGroupWrapper: + properties: + inter-rule-group: + $ref: "#/definitions/tapi.topology.InterRuleGroup" + tapi.topology.LatencyCharacteristic: + type: "object" + properties: + traffic-property-name: + type: "string" + description: "The identifier of the specific traffic property to which the\ + \ queuing latency applies." + jitter-characteristic: + type: "string" + description: "High frequency deviation from true periodicity of a signal and\ + \ therefore a small high rate of change of transfer latency.\r\n \ + \ Applies to TDM systems (and not packet)." + fixed-latency-characteristic: + type: "string" + description: "A TopologicalEntity suffers delay caused by the realization\ + \ of the servers (e.g. distance related; FEC encoding etc.) along with some\ + \ client specific processing. This is the total average latency effect of\ + \ the TopologicalEntity" + wander-characteristic: + type: "string" + description: "Low frequency deviation from true periodicity of a signal and\ + \ therefore a small low rate of change of transfer latency.\r\n \ + \ Applies to TDM systems (and not packet)." + queing-latency-characteristic: + type: "string" + description: "The specific queuing latency for the traffic property." + tapi.topology.LatencyCharacteristicWrapper: + properties: + latency-characteristic: + $ref: "#/definitions/tapi.topology.LatencyCharacteristic" + tapi.topology.LayerProtocolTransitionPac: + type: "object" + properties: + transitioned-layer-protocol-name: + type: "array" + description: "Provides the ordered structure of layer protocol transitions\ + \ encapsulated in the TopologicalEntity. The ordering relates to the LinkPort\ + \ role." + items: + type: "string" + tapi.topology.Link: + allOf: + - $ref: "#/definitions/tapi.common.AdminStatePac" + - $ref: "#/definitions/tapi.common.CapacityPac" + - $ref: "#/definitions/tapi.common.GlobalClass" + - $ref: "#/definitions/tapi.topology.LayerProtocolTransitionPac" + - $ref: "#/definitions/tapi.topology.RiskParameterPac" + - $ref: "#/definitions/tapi.topology.TransferCostPac" + - $ref: "#/definitions/tapi.topology.TransferIntegrityPac" + - $ref: "#/definitions/tapi.topology.TransferTimingPac" + - $ref: "#/definitions/tapi.topology.ValidationPac" + - type: "object" + properties: + layer-protocol-name: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.common.LayerProtocolName" + resilience-type: + description: "none" + $ref: "#/definitions/tapi.topology.ResilienceType" + node-edge-point: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.topology.NodeEdgePointRef" + direction: + description: "The directionality of the Link.\r\n Is applicable\ + \ to simple Links where all LinkEnds are BIDIRECTIONAL (the Link will\ + \ be BIDIRECTIONAL) or UNIDIRECTIONAL (the Link will be UNIDIRECTIONAL).\r\ + \n Is not present in more complex cases." + $ref: "#/definitions/tapi.common.ForwardingDirection" + description: "The Link object class models effective adjacency between two or\ + \ more ForwardingDomains (FD). " + tapi.topology.LinkRef: + allOf: + - $ref: "#/definitions/tapi.topology.TopologyRef" + - type: "object" + properties: + link-uuid: + type: "string" + description: "none" + x-path: "/tapi-common:context/tapi-topology:topology-context/tapi-topology:topology/tapi-topology:link/tapi-topology:uuid" + description: "none" + tapi.topology.LinkRefWrapper: + properties: + supported-client-link: + $ref: "#/definitions/tapi.topology.LinkRef" + tapi.topology.LinkWrapper: + properties: + link: + $ref: "#/definitions/tapi.topology.Link" + tapi.topology.NetworkTopologyService: + allOf: + - $ref: "#/definitions/tapi.common.GlobalClass" + - type: "object" + properties: + topology: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.topology.TopologyRef" + description: "none" + tapi.topology.NetworkTopologyServiceWrapper: + properties: + nw-topology-service: + $ref: "#/definitions/tapi.topology.NetworkTopologyService" + tapi.topology.Node: + allOf: + - $ref: "#/definitions/tapi.common.AdminStatePac" + - $ref: "#/definitions/tapi.common.CapacityPac" + - $ref: "#/definitions/tapi.common.GlobalClass" + - $ref: "#/definitions/tapi.topology.TransferCostPac" + - $ref: "#/definitions/tapi.topology.TransferIntegrityPac" + - $ref: "#/definitions/tapi.topology.TransferTimingPac" + - type: "object" + properties: + layer-protocol-name: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.common.LayerProtocolName" + encap-topology: + description: "none" + $ref: "#/definitions/tapi.topology.TopologyRef" + owned-node-edge-point: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.topology.NodeEdgePoint" + node-rule-group: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.topology.NodeRuleGroup" + aggregated-node-edge-point: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.topology.NodeEdgePointRef" + description: "The ForwardingDomain (FD) object class models the ForwardingDomain\ + \ topological component which is used to effect forwarding of transport characteristic\ + \ information and offers the potential to enable forwarding.\r\n \ + \ At the lowest level of recursion, an FD (within a network element (NE))\ + \ represents a switch matrix (i.e., a fabric). Note that an NE can encompass\ + \ multiple switch matrices (FDs). " + tapi.topology.NodeEdgePoint: + allOf: + - $ref: "#/definitions/tapi.common.AdminStatePac" + - $ref: "#/definitions/tapi.common.CapacityPac" + - $ref: "#/definitions/tapi.common.GlobalClass" + - $ref: "#/definitions/tapi.common.TerminationPac" + - type: "object" + properties: + link-port-role: + description: "Each LinkEnd of the Link has a role (e.g., symmetric, hub,\ + \ spoke, leaf, root) in the context of the Link with respect to the Link\ + \ function. " + $ref: "#/definitions/tapi.common.PortRole" + mapped-service-interface-point: + type: "array" + description: "NodeEdgePoint mapped to more than ServiceInterfacePoint (slicing/virtualizing)\ + \ or a ServiceInterfacePoint mapped to more than one NodeEdgePoint (load\ + \ balancing/Resilience) should be considered experimental" + items: + $ref: "#/definitions/tapi.common.ServiceInterfacePointRef" + aggregated-node-edge-point: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.topology.NodeEdgePointRef" + layer-protocol-name: + description: "none" + $ref: "#/definitions/tapi.common.LayerProtocolName" + link-port-direction: + description: "The orientation of defined flow at the LinkEnd." + $ref: "#/definitions/tapi.common.PortDirection" + supported-cep-layer-protocol-qualifier: + type: "array" + description: "none" + items: + type: "string" + description: "The LogicalTerminationPoint (LTP) object class encapsulates the\ + \ termination and adaptation functions of one or more transport layers.\r\n\ + \ The structure of LTP supports all transport protocols including\ + \ circuit and packet forms." + tapi.topology.NodeEdgePointRef: + allOf: + - $ref: "#/definitions/tapi.topology.NodeRef" + - type: "object" + properties: + node-edge-point-uuid: + type: "string" + description: "none" + x-path: "/tapi-common:context/tapi-topology:topology-context/tapi-topology:topology/tapi-topology:node/tapi-topology:owned-node-edge-point/tapi-topology:uuid" + description: "none" + tapi.topology.NodeEdgePointRefWrapper: + properties: + node-edge-point: + $ref: "#/definitions/tapi.topology.NodeEdgePointRef" + tapi.topology.NodeRef: + allOf: + - $ref: "#/definitions/tapi.topology.TopologyRef" + - type: "object" + properties: + node-uuid: + type: "string" + description: "none" + x-path: "/tapi-common:context/tapi-topology:topology-context/tapi-topology:topology/tapi-topology:node/tapi-topology:uuid" + description: "none" + tapi.topology.NodeRuleGroup: + allOf: + - $ref: "#/definitions/tapi.common.CapacityPac" + - $ref: "#/definitions/tapi.common.GlobalClass" + - $ref: "#/definitions/tapi.topology.RiskParameterPac" + - $ref: "#/definitions/tapi.topology.TransferCostPac" + - $ref: "#/definitions/tapi.topology.TransferTimingPac" + - type: "object" + properties: + inter-rule-group: + type: "array" + description: "Nested NodeRuleGroups may have InterRuleGroups. The Superior\ + \ NodeRuleGroup contains the nested NodeRuleGroups and their associated\ + \ InterRuleGroups.\r\n This is equivalent to the Node-Topology\ + \ hierarchy." + items: + $ref: "#/definitions/tapi.topology.InterRuleGroup" + rule: + type: "array" + description: "The list of rules of the NodeRuleGroup." + items: + $ref: "#/definitions/tapi.topology.Rule" + node-rule-group: + type: "array" + description: "NodeRuleGroups may be nested such that finer grained rules\ + \ may be applied.\r\n A nested rule group should have a\ + \ subset of the NEPs of the superior rule group." + items: + $ref: "#/definitions/tapi.topology.NodeRuleGroupRef" + node-edge-point: + type: "array" + description: "NEPs and their client CEPs that the rules apply to." + items: + $ref: "#/definitions/tapi.topology.NodeEdgePointRef" + description: "Rules that apply to a group of NEPs.\r\n " + tapi.topology.NodeRuleGroupRef: + allOf: + - $ref: "#/definitions/tapi.topology.NodeRef" + - type: "object" + properties: + node-rule-group-uuid: + type: "string" + description: "none" + x-path: "/tapi-common:context/tapi-topology:topology-context/tapi-topology:topology/tapi-topology:node/tapi-topology:node-rule-group/tapi-topology:uuid" + description: "none" + tapi.topology.NodeRuleGroupRefWrapper: + properties: + associated-node-rule-group: + $ref: "#/definitions/tapi.topology.NodeRuleGroupRef" + tapi.topology.NodeRuleGroupWrapper: + properties: + node-rule-group: + $ref: "#/definitions/tapi.topology.NodeRuleGroup" + tapi.topology.PortRoleRule: + type: "object" + properties: + port-role-rule: + type: "array" + description: "Where the rule references more than one port role or where there\ + \ are rule intersections either as a result of overlay of rules or inter\ + \ rule group usage indicates role matching criteria for a connection following\ + \ the rules.\r\n For example if two port roles, 'a' and 'b',\ + \ are listed and the port role rule is 'different', this means that a connection\ + \ connecting points in that group must have port roles that are different\ + \ for each CEP in that group.\r\n In the example if a connection\ + \ can have n ports of role 'a' and m ports of role 'b' then a maximum of\ + \ two ports can be drawn from the NEPs of the group and where there are\ + \ two, one must be role 'a' and one must be role 'b'." + items: + type: "string" + port-role: + type: "array" + description: "The role(s) of the port(s) considered in the rule." + items: + type: "string" + tapi.topology.PortRoleRuleWrapper: + properties: + cep-port-role: + $ref: "#/definitions/tapi.topology.PortRoleRule" + tapi.topology.ProtectionType: + type: "string" + enum: + - "NO_PROTECTON" + - "ONE_PLUS_ONE_PROTECTION" + - "ONE_PLUS_ONE_PROTECTION_WITH_DYNAMIC_RESTORATION" + - "PERMANENT_ONE_PLUS_ONE_PROTECTION" + - "ONE_FOR_ONE_PROTECTION" + - "DYNAMIC_RESTORATION" + - "PRE_COMPUTED_RESTORATION" + - "ONE_PLUS_ONE_PROTECTION_WITH_PRE_COMPUTED_RESTORATION" + tapi.topology.ResilienceType: + type: "object" + properties: + restoration-policy: + description: "none" + $ref: "#/definitions/tapi.topology.RestorationPolicy" + protection-type: + description: "none" + $ref: "#/definitions/tapi.topology.ProtectionType" + tapi.topology.ResilienceTypeWrapper: + properties: + resilience-type: + $ref: "#/definitions/tapi.topology.ResilienceType" + tapi.topology.RestorationPolicy: + type: "string" + enum: + - "PER_DOMAIN_RESTORATION" + - "END_TO_END_RESTORATION" + - "NA" + tapi.topology.RiskCharacteristic: + type: "object" + properties: + risk-characteristic-name: + type: "string" + description: "The name of the risk characteristic. The characteristic may\ + \ be related to a specific degree of closeness.\r\n For example\ + \ a particular characteristic may apply to failures that are localized (e.g.\ + \ to one side of a road) where as another characteristic may relate to failures\ + \ that have a broader impact (e.g. both sides of a road that crosses a bridge).\r\ + \n Depending upon the importance of the traffic being routed\ + \ different risk characteristics will be evaluated." + risk-identifier-list: + type: "array" + description: "A list of the identifiers of each physical/geographic unit (with\ + \ the specific risk characteristic) that is related to a segment of the\ + \ TopologicalEntity." + items: + type: "string" + tapi.topology.RiskCharacteristicWrapper: + properties: + risk-diversity-characteristic: + $ref: "#/definitions/tapi.topology.RiskCharacteristic" + tapi.topology.RiskParameterPac: + type: "object" + properties: + risk-characteristic: + type: "array" + description: "A list of risk characteristics for consideration in an analysis\ + \ of shared risk. Each element of the list represents a specific risk consideration." + items: + $ref: "#/definitions/tapi.topology.RiskCharacteristic" + tapi.topology.Rule: + allOf: + - $ref: "#/definitions/tapi.common.LocalClass" + - type: "object" + properties: + complex-rule: + type: "array" + description: "Allows for more complex rules where the basic rule system\ + \ is not sufficient." + items: + type: "string" + rule-type: + description: "The focus of the rule." + $ref: "#/definitions/tapi.topology.RuleType" + signal-property: + description: "The rule only applies to signals with the properties listed.\ + \ \r\n If the attribute is not present then the rule applies\ + \ to all signals." + $ref: "#/definitions/tapi.topology.SignalPropertyRule" + connection-spec-reference: + type: "array" + description: "Identifies the type of connection that the rule applies to.\ + \ \r\n If the attribute is not present then the rule applies\ + \ to all types of connection supported by the device." + items: + $ref: "#/definitions/tapi.topology.ConnectionSpecReference" + cep-port-role: + type: "array" + description: "Indicates the port role to which the rule applies. \r\n \ + \ The port role is interpreted in the context of the connection\ + \ type which is identified by the connection spec. \r\n \ + \ The port role is not meaningful in the absence of a connection spec\ + \ reference.\r\n If a node rule group carries a port role,\ + \ that role applies also to the associated inter rule where the combination\ + \ of the roles in the node rule groups at the ends of the inter group\ + \ rule define the connection orientation.\r\n For example\ + \ a root-and-leaf connection may be used in a node where a node rule group\ + \ collects one set of NEPs has the port role 'root' and another node rule\ + \ group collects another set of NEPs has the port role 'leaf' where these\ + \ are joined by an inter rule group. This combination specifies an allowed\ + \ orientation of the root-and-leaf connection.\r\n No port\ + \ role statement means all port roles are allowed." + items: + $ref: "#/definitions/tapi.topology.PortRoleRule" + cep-direction: + type: "array" + description: "cep direction is a list of port directions that the rule applies\ + \ to.\r\n No entry means all cep directions." + items: + $ref: "#/definitions/tapi.common.PortDirection" + override-priority: + type: "integer" + format: "int32" + description: "The overridePriority allows for one rule in a rule group to\ + \ override another.\r\n Priority n rules override priority\ + \ n+1 rules.\r\n Rules of the same priority override as\ + \ follows (n overrides n+1):\r\n 1 - MustNot\r\n \ + \ 2 - Must\r\n 3 - May\r\n 4 -\ + \ Null\r\n Within a rule the flexibility rules (signal,\ + \ port role...) override as follows (n overriedes n+1):\r\n \ + \ 1 - Any\r\n 2 - Same\r\n 3 - Different\r\ + \n Where there are two or more 'Same' rules, they will\ + \ form an intersection where all must be met.\r\n " + layer-protocol-qualifier: + type: "array" + description: "Qualifies a rule for a particular layerProtocol identifying\ + \ the qualifiers that the rule apples to.\r\n If the attribute\ + \ is not present then the rule applies to all relevant qualifiers of the\ + \ layer protocol of the parent entity." + items: + type: "string" + forwarding-rule: + description: "Rule that restricts the creation/deletion of a Connection\ + \ between points in the node rule group or related by the inter rule group\ + \ between node rule groups." + $ref: "#/definitions/tapi.topology.ForwardingRule" + description: "Single complex rule statememt.\r\n A Node with no rule\ + \ group has no restrictions and is essentially May/Any\r\n A node\ + \ rule group constrain the CEP connectability in the Node.\r\n \ + \ A connection from a NEP must abide by all rules that relate to that NEP\r\ + \n Rules that are for a particular layerProtocolQualifier, connectionSpecReference,\ + \ cepPortRole and cepDirection combination must be abided by in combination\ + \ as dictated by overridePriority.\r\n If a particular\r\n \ + \ - connectionSpecReference does not have any rule statements then\ + \ it is not supported and connections of that type are not possible within\ + \ the rule group.\r\n - cepPortRole of a particular connectionSpecReference\ + \ does not have any rule statements then it is not supported and connections\ + \ of that connectionSpecReference (type) cannot have that cepPortRole for\ + \ CEPs from NEPs in that rule group.\r\n - cepDirection for a particular\ + \ connectionSpecReference does not have any rule statements then it is not\ + \ supported and connections of that connectionSpecReference (type) cannot\ + \ have that cepPortDirection for CEPs from NEPs in that rule group.\r\n \ + \ Rules that are for different layerProtocolQualifiers or connectionSpecReferences\ + \ are independent and provide options for connection in the rule group.\r\n\ + \ Some rules may apply to multiple connectionSpecReferences and\ + \ all cepPortRoles and all cepDirections." + tapi.topology.RuleType: + type: "string" + enum: + - "FORWARDING" + - "CAPACITY" + - "COST" + - "TIMING" + - "RISK" + - "GROUPING" + tapi.topology.RuleWrapper: + properties: + rule: + $ref: "#/definitions/tapi.topology.Rule" + tapi.topology.SignalPropertyRule: + type: "object" + properties: + number-of-signal-values: + type: "integer" + format: "int32" + description: "The number of instances of this specific property that can be\ + \ supported by the group." + applicable-signal-value: + type: "array" + description: "Specific values of the signal property to which the rule applies." + items: + type: "string" + signal-property-value-rule: + type: "string" + description: "Indicates how the signal properties should be accounted for." + signal-property-name: + type: "string" + description: "The name of the signal property to which the rule applies." + tapi.topology.SignalPropertyRuleWrapper: + properties: + signal-property: + $ref: "#/definitions/tapi.topology.SignalPropertyRule" + tapi.topology.Topology: + allOf: + - $ref: "#/definitions/tapi.common.GlobalClass" + - type: "object" + properties: + layer-protocol-name: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.common.LayerProtocolName" + link: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.topology.Link" + node: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.topology.Node" + description: "The ForwardingDomain (FD) object class models the ForwardingDomain\ + \ topological component which is used to effect forwarding of transport characteristic\ + \ information and offers the potential to enable forwarding. \r\n \ + \ At the lowest level of recursion, an FD (within a network element (NE))\ + \ represents a switch matrix (i.e., a fabric). Note that an NE can encompass\ + \ multiple switch matrices (FDs). " + tapi.topology.TopologyContext: + type: "object" + properties: + nw-topology-service: + description: "none" + $ref: "#/definitions/tapi.topology.NetworkTopologyService" + topology: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.topology.Topology" + tapi.topology.TopologyContextWrapper: + properties: + tapi-topology:topology-context: + $ref: "#/definitions/tapi.topology.TopologyContext" + tapi.topology.TopologyRef: + type: "object" + properties: + topology-uuid: + type: "string" + description: "none" + x-path: "/tapi-common:context/tapi-topology:topology-context/tapi-topology:topology/tapi-topology:uuid" + tapi.topology.TopologyRefWrapper: + properties: + topology: + $ref: "#/definitions/tapi.topology.TopologyRef" + tapi.topology.TopologyWrapper: + properties: + topology: + $ref: "#/definitions/tapi.topology.Topology" + tapi.topology.TransferCostPac: + type: "object" + properties: + cost-characteristic: + type: "array" + description: "The list of costs where each cost relates to some aspect of\ + \ the TopologicalEntity." + items: + $ref: "#/definitions/tapi.topology.CostCharacteristic" + tapi.topology.TransferIntegrityPac: + type: "object" + properties: + error-characteristic: + type: "string" + description: "Describes the degree to which the signal propagated can be errored.\r\ + \n Applies to TDM systems as the errored signal will be propagated\ + \ and not packet as errored packets will be discarded." + unavailable-time-characteristic: + type: "string" + description: "Describes the duration for which there may be no valid signal\ + \ propagated." + server-integrity-process-characteristic: + type: "string" + description: "Describes the effect of any server integrity enhancement process\ + \ on the characteristics of the TopologicalEntity." + delivery-order-characteristic: + type: "string" + description: "Describes the degree to which packets will be delivered out\ + \ of sequence.\r\n Does not apply to TDM as the TDM protocols\ + \ maintain strict order." + repeat-delivery-characteristic: + type: "string" + description: "Primarily applies to packet systems where a packet may be delivered\ + \ more than once (in fault recovery for example).\r\n It\ + \ can also apply to TDM where several frames may be received twice due to\ + \ switching in a system with a large differential propagation delay." + loss-characteristic: + type: "string" + description: "Describes the acceptable characteristic of lost packets where\ + \ loss may result from discard due to errors or overflow.\r\n \ + \ Applies to packet systems and not TDM (as for TDM errored signals\ + \ are propagated unless grossly errored and overflow/underflow turns into\ + \ timing slips)." + tapi.topology.TransferTimingPac: + type: "object" + properties: + latency-characteristic: + type: "array" + description: "The effect on the latency of a queuing process. This only has\ + \ significant effect for packet based systems and has a complex characteristic." + items: + $ref: "#/definitions/tapi.topology.LatencyCharacteristic" + tapi.topology.ValidationMechanism: + type: "object" + properties: + layer-protocol-adjacency-validated: + type: "string" + description: "State of validatiion" + validation-mechanism: + type: "string" + description: "Name of mechanism used to validate adjacency" + validation-robustness: + type: "string" + description: "Quality of validation (i.e. how likely is the stated validation\ + \ to be invalid)" + tapi.topology.ValidationMechanismWrapper: + properties: + validation-mechanism: + $ref: "#/definitions/tapi.topology.ValidationMechanism" + tapi.topology.ValidationPac: + type: "object" + properties: + validation-mechanism: + type: "array" + description: "Provides details of the specific validation mechanism(s) used\ + \ to confirm the presence of an intended topologicalEntity." + items: + $ref: "#/definitions/tapi.topology.ValidationMechanism" + tapi.topology.getlinkdetails.Input: + type: "object" + properties: + link-id-or-name: + type: "string" + description: "none" + topology-id-or-name: + type: "string" + description: "none" + tapi.topology.getlinkdetails.Output: + type: "object" + properties: + link: + description: "none" + $ref: "#/definitions/tapi.topology.Link" + tapi.topology.getnodedetails.Input: + type: "object" + properties: + node-id-or-name: + type: "string" + description: "none" + topology-id-or-name: + type: "string" + description: "none" + tapi.topology.getnodedetails.Output: + type: "object" + properties: + node: + description: "none" + $ref: "#/definitions/tapi.topology.Node" + tapi.topology.getnodeedgepointdetails.Input: + type: "object" + properties: + ep-id-or-name: + type: "string" + description: "none" + node-id-or-name: + type: "string" + description: "none" + topology-id-or-name: + type: "string" + description: "none" + tapi.topology.getnodeedgepointdetails.Output: + type: "object" + properties: + node-edge-point: + description: "none" + $ref: "#/definitions/tapi.topology.NodeEdgePoint" + tapi.topology.gettopologydetails.Input: + type: "object" + properties: + topology-id-or-name: + type: "string" + description: "none" + tapi.topology.gettopologydetails.Output: + type: "object" + properties: + topology: + description: "none" + $ref: "#/definitions/tapi.topology.Topology" + tapi.topology.gettopologylist.Output: + type: "object" + properties: + topology: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.topology.Topology" + tapi.topology.node.OwnedNodeEdgePoint: + allOf: + - $ref: "#/definitions/tapi.connectivity.OwnedNodeEdgePointAugmentation1" + - $ref: "#/definitions/tapi.topology.NodeEdgePoint" + tapi.topology.node.OwnedNodeEdgePointWrapper: + properties: + owned-node-edge-point: + $ref: "#/definitions/tapi.topology.node.OwnedNodeEdgePoint" + tapi.topology.topology.Node: + allOf: + - $ref: "#/definitions/tapi.common.AdminStatePac" + - $ref: "#/definitions/tapi.common.CapacityPac" + - $ref: "#/definitions/tapi.common.GlobalClass" + - $ref: "#/definitions/tapi.topology.TransferCostPac" + - $ref: "#/definitions/tapi.topology.TransferIntegrityPac" + - $ref: "#/definitions/tapi.topology.TransferTimingPac" + - type: "object" + properties: + layer-protocol-name: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.common.LayerProtocolName" + encap-topology: + description: "none" + $ref: "#/definitions/tapi.topology.TopologyRef" + owned-node-edge-point: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.topology.node.OwnedNodeEdgePoint" + node-rule-group: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.topology.NodeRuleGroup" + aggregated-node-edge-point: + type: "array" + description: "none" + items: + $ref: "#/definitions/tapi.topology.NodeEdgePointRef" + description: "none" + tapi.topology.topology.NodeWrapper: + properties: + node: + $ref: "#/definitions/tapi.topology.topology.Node" diff --git a/hackfest/tapi/tapi_app/ols-topo.dot b/hackfest/tapi/tapi_app/ols-topo.dot new file mode 100644 index 0000000000000000000000000000000000000000..89122169f5d5b6c28fe365cec812aaca1eeeb476 --- /dev/null +++ b/hackfest/tapi/tapi_app/ols-topo.dot @@ -0,0 +1,16 @@ +strict digraph { +"node-1"; +"node-2"; +"node-3"; +"node-4"; +"node-1" -> "node-3"; +"node-1" -> "node-4"; +"node-2" -> "node-3"; +"node-2" -> "node-4"; +"node-3" -> "node-1"; +"node-3" -> "node-2"; +"node-3" -> "node-4"; +"node-4" -> "node-1"; +"node-4" -> "node-2"; +"node-4" -> "node-3"; +} diff --git a/hackfest/tapi/tapi_app/ols-topo.png b/hackfest/tapi/tapi_app/ols-topo.png new file mode 100644 index 0000000000000000000000000000000000000000..94ac969f94679d1bc9e7bad7f5810b153106a517 Binary files /dev/null and b/hackfest/tapi/tapi_app/ols-topo.png differ diff --git a/hackfest/tapi/tapi_app/requirements.sh b/hackfest/tapi/tapi_app/requirements.sh new file mode 100755 index 0000000000000000000000000000000000000000..56a5b20b4efe1b109144b61c0360dd9c042db141 --- /dev/null +++ b/hackfest/tapi/tapi_app/requirements.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. + + +sudo apt install graphviz +pip install -r requirements.txt diff --git a/hackfest/tapi/tapi_app/requirements.txt b/hackfest/tapi/tapi_app/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..43c1b1341f489fd80fe350d1e7916df6a3c5506d --- /dev/null +++ b/hackfest/tapi/tapi_app/requirements.txt @@ -0,0 +1,2 @@ +matplotlib == 3.6.1 +networkx == 2.6.3 diff --git a/hackfest/tapi/tapi_app/tapi_app.py b/hackfest/tapi/tapi_app/tapi_app.py new file mode 100644 index 0000000000000000000000000000000000000000..d0306028cd28b9cf550b8221b656dc7e1ca9f9c6 --- /dev/null +++ b/hackfest/tapi/tapi_app/tapi_app.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# 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. + +# -*- coding: utf-8 -*- + +import json, requests, networkx as nx +from requests.auth import HTTPBasicAuth + +IP = '127.0.0.1' +PORT = 8080 +TOPO_UUID = 'ols-topo' +TOPO_URL = 'http://{:s}:{:d}/restconf/data/tapi-common:context/'\ + 'tapi-topology:topology-context/topology={:s}/' + +def retrieve_topology(ip, port, topo_uuid, user='', passwd=''): + print ("Reading network-topology") + topo_url = TOPO_URL.format(ip, port, topo_uuid) + response = requests.get(topo_url, auth=HTTPBasicAuth(user, passwd)) + topology = response.json() + print ("Retrieved Topology: " + json.dumps(topology, indent=4)) + return topology + +def to_png_matplotlib(nwk_graph, topo_uuid): + import matplotlib.pyplot as plt + nx.draw(nwk_graph, pos=nx.spring_layout(nwk_graph, scale=500)) + plt.show(block=False) + plt.savefig('{:s}.png'.format(topo_uuid), format='PNG') + plt.close() + +def to_png_pydot(nwk_graph, topo_uuid): + from networkx.drawing.nx_pydot import write_dot, to_pydot + write_dot(nwk_graph, '{:s}.dot'.format(topo_uuid)) + dot_graph = to_pydot(nwk_graph) + with open('{:s}.png'.format(topo_uuid), 'wb') as f: + f.write(dot_graph.create(format='png')) + +def draw_topology(topology): + nwk_graph = nx.DiGraph() + + for node in topology['node']: + if node['owned-node-edge-point']: + nwk_graph.add_node(node['uuid']) + + for link in topology['link']: + node1 = link['node-edge-point'][0]['node-uuid'] + node2 = link['node-edge-point'][1]['node-uuid'] + nwk_graph.add_edge(node1, node2) + + #to_png_matplotlib(nwk_graph, topology['uuid']) + to_png_pydot(nwk_graph, topology['uuid']) + +if __name__ == "__main__": + draw_topology(retrieve_topology(IP, PORT, TOPO_UUID)) diff --git a/hackfest/tfs-descriptors/context-topology.json b/hackfest/tfs-descriptors/context-topology.json new file mode 100644 index 0000000000000000000000000000000000000000..36b3c44fd61fdec9d208a82a11d5a16c3671d004 --- /dev/null +++ b/hackfest/tfs-descriptors/context-topology.json @@ -0,0 +1,19 @@ +{ + "contexts": [ + { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_ids": [], + "service_ids": [] + } + ], + "topologies": [ + { + "topology_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_uuid": {"uuid": "admin"} + }, + "device_ids": [], + "link_ids": [] + } + ] +} diff --git a/hackfest/tfs-descriptors/device-all.json b/hackfest/tfs-descriptors/device-all.json new file mode 100644 index 0000000000000000000000000000000000000000..8cb8e031488f0dd1fa4176b8d20d01fe2d24abc9 --- /dev/null +++ b/hackfest/tfs-descriptors/device-all.json @@ -0,0 +1,84 @@ +{ + "devices": [ + { + "device_id": {"device_uuid": {"uuid": "R1"}}, + "device_type": "packet-router", + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "10.0.2.15"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "8301"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": { + "username": "admin", "password": "admin", + "force_running": false, "hostkey_verify": false, "look_for_keys": false, + "allow_agent": false, "delete_rule": true, "device_params": {"name": "default"}, + "manager_params": {"timeout" : 120} + }}} + ]}, + "device_operational_status": 1, + "device_drivers": [1], + "device_endpoints": [] + }, + { + "device_id": {"device_uuid": {"uuid": "R2"}}, + "device_type": "packet-router", + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "10.0.2.15"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "8302"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": { + "username": "admin", "password": "admin", + "force_running": false, "hostkey_verify": false, "look_for_keys": false, + "allow_agent": false, "delete_rule": true, "device_params": {"name": "default"}, + "manager_params": {"timeout" : 120} + }}} + ]}, + "device_operational_status": 1, + "device_drivers": [1], + "device_endpoints": [] + }, + { + "device_id": {"device_uuid": {"uuid": "R3"}}, + "device_type": "packet-router", + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "10.0.2.15"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "8303"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": { + "username": "admin", "password": "admin", + "force_running": false, "hostkey_verify": false, "look_for_keys": false, + "allow_agent": false, "delete_rule": true, "device_params": {"name": "default"}, + "manager_params": {"timeout" : 120} + }}} + ]}, + "device_operational_status": 1, + "device_drivers": [1], + "device_endpoints": [] + }, + { + "device_id": {"device_uuid": {"uuid": "R4"}}, + "device_type": "packet-router", + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "10.0.2.15"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "8304"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": { + "username": "admin", "password": "admin", + "force_running": false, "hostkey_verify": false, "look_for_keys": false, + "allow_agent": false, "delete_rule": true, "device_params": {"name": "default"}, + "manager_params": {"timeout" : 120} + }}} + ]}, + "device_operational_status": 1, + "device_drivers": [1], + "device_endpoints": [] + }, + { + "device_id": {"device_uuid": {"uuid": "OLS"}}, + "device_type": "open-line-system", + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "10.0.2.15"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "8080"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"timeout": 120}}} + ]}, + "device_operational_status": 1, + "device_drivers": [2], + "device_endpoints": [] + } + ] +} diff --git a/hackfest/tfs-descriptors/device-netconf-openconfig.json b/hackfest/tfs-descriptors/device-netconf-openconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..7e01f037e744493a8cd1190b2510ed3d4d1c86aa --- /dev/null +++ b/hackfest/tfs-descriptors/device-netconf-openconfig.json @@ -0,0 +1,21 @@ +{ + "devices": [ + { + "device_id": {"device_uuid": {"uuid": "R1"}}, + "device_type": "packet-router", + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "10.0.2.10"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "8300"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": { + "username": "admin", "password": "admin", + "force_running": false, "hostkey_verify": false, "look_for_keys": false, + "allow_agent": false, "delete_rule": true, "device_params": {"name": "default"}, + "manager_params": {"timeout" : 15} + }}} + ]}, + "device_operational_status": 1, + "device_drivers": [1], + "device_endpoints": [] + } + ] +} diff --git a/hackfest/tfs-descriptors/device-tapi-ols.json b/hackfest/tfs-descriptors/device-tapi-ols.json new file mode 100644 index 0000000000000000000000000000000000000000..3dcdc562edb50e0b63e69f5745600110dd42151c --- /dev/null +++ b/hackfest/tfs-descriptors/device-tapi-ols.json @@ -0,0 +1,16 @@ +{ + "devices": [ + { + "device_id": {"device_uuid": {"uuid": "OLS"}}, + "device_type": "open-line-system", + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "10.0.2.10"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "8080"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"timeout": 120}}} + ]}, + "device_operational_status": 1, + "device_drivers": [2], + "device_endpoints": [] + } + ] +} diff --git a/hackfest/tfs-descriptors/links.json b/hackfest/tfs-descriptors/links.json new file mode 100644 index 0000000000000000000000000000000000000000..8a991fd622ac89bcb6fafed5abe61de0c6e17641 --- /dev/null +++ b/hackfest/tfs-descriptors/links.json @@ -0,0 +1,63 @@ +{ + "links": [ + { + "link_id": {"link_uuid": {"uuid": "R1/1/1==OLS/node-1-port-15-input"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1"}}, "endpoint_uuid": {"uuid": "1/1"}}, + {"device_id": {"device_uuid": {"uuid": "OLS"}}, "endpoint_uuid": {"uuid": "node-1-port-15-input"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "OLS/node-1-port-15-output==R1/1/1"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "OLS"}}, "endpoint_uuid": {"uuid": "node-1-port-15-output"}}, + {"device_id": {"device_uuid": {"uuid": "R1"}}, "endpoint_uuid": {"uuid": "1/1"}} + ] + }, + + { + "link_id": {"link_uuid": {"uuid": "R2/1/1==OLS/node-2-port-15-input"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2"}}, "endpoint_uuid": {"uuid": "1/1"}}, + {"device_id": {"device_uuid": {"uuid": "OLS"}}, "endpoint_uuid": {"uuid": "node-2-port-15-input"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "OLS/node-2-port-15-output==R2/1/1"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "OLS"}}, "endpoint_uuid": {"uuid": "node-2-port-15-output"}}, + {"device_id": {"device_uuid": {"uuid": "R2"}}, "endpoint_uuid": {"uuid": "1/1"}} + ] + }, + + { + "link_id": {"link_uuid": {"uuid": "R3/1/1==OLS/node-3-port-15-input"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3"}}, "endpoint_uuid": {"uuid": "1/1"}}, + {"device_id": {"device_uuid": {"uuid": "OLS"}}, "endpoint_uuid": {"uuid": "node-3-port-15-input"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "OLS/node-3-port-15-output==R3/1/1"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "OLS"}}, "endpoint_uuid": {"uuid": "node-3-port-15-output"}}, + {"device_id": {"device_uuid": {"uuid": "R3"}}, "endpoint_uuid": {"uuid": "1/1"}} + ] + }, + + { + "link_id": {"link_uuid": {"uuid": "R4/1/1==OLS/node-4-port-15-input"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R4"}}, "endpoint_uuid": {"uuid": "1/1"}}, + {"device_id": {"device_uuid": {"uuid": "OLS"}}, "endpoint_uuid": {"uuid": "node-4-port-15-input"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "OLS/node-4-port-15-output==R4/1/1"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "OLS"}}, "endpoint_uuid": {"uuid": "node-4-port-15-output"}}, + {"device_id": {"device_uuid": {"uuid": "R4"}}, "endpoint_uuid": {"uuid": "1/1"}} + ] + } + ] +} diff --git a/hackfest/tfs-descriptors/old/device.json b/hackfest/tfs-descriptors/old/device.json new file mode 100644 index 0000000000000000000000000000000000000000..03736314dee9ea0a8aae27627361dcdd24457fca --- /dev/null +++ b/hackfest/tfs-descriptors/old/device.json @@ -0,0 +1,77 @@ +{ + "contexts": [ + { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_ids": [], + "service_ids": [] + } + ], + "topologies": [ + { + "topology_id": {"topology_uuid": {"uuid": "admin"}, "context_id": {"context_uuid": {"uuid": "admin"}}}, + "device_ids": [ + {"device_uuid": {"uuid": "R1"}}, + {"device_uuid": {"uuid": "R2"}}, + {"device_uuid": {"uuid": "R3"}} + ], + "link_ids": [ + {"link_uuid":{"uuid":"R1-1/1==R2-1/2"}}, + {"link_uuid":{"uuid":"R2-1/1==R3-1/2"}} + ] + } + ], + "devices": [ + { + "device_id": {"device_uuid": {"uuid": "R1"}}, + "device_type": "packet-router", + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "10.0.2.15"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "8301"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": "{\"username\": \"admin\", \"password\": \"admin\", \"force_running\": true, \"hostkey_verify\": false, \"look_for_keys\": false, \"allow_agent\": true, \"delete_rule\": false, \"device_params\" : {\"name\": \"default\"}, \"manager_params\" : {\"timeout\": 15}}"}} + ]}, + "device_operational_status": 1, + "device_drivers": [1], + "device_endpoints": [] + }, + { + "device_id": {"device_uuid": {"uuid": "R2"}}, + "device_type": "packet-router", + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "10.0.2.15"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "8302"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": "{\"username\": \"admin\", \"password\": \"admin\", \"force_running\": true, \"hostkey_verify\": false, \"look_for_keys\": false, \"allow_agent\": true, \"delete_rule\": false, \"device_params\" : {\"name\": \"default\"}, \"manager_params\" : {\"timeout\": 15}}"}} + ]}, + "device_operational_status": 1, + "device_drivers": [1], + "device_endpoints": [] + }, + { + "device_id": {"device_uuid": {"uuid": "R3"}}, + "device_type": "packet-router", + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "10.0.2.15"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "8303"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": "{\"username\": \"admin\", \"password\": \"admin\", \"force_running\": true, \"hostkey_verify\": false, \"look_for_keys\": false, \"allow_agent\": true, \"delete_rule\": false, \"device_params\" : {\"name\": \"default\"}, \"manager_params\" : {\"timeout\": 15}}"}} + ]}, + "device_operational_status": 1, + "device_drivers": [1], + "device_endpoints": [] + } + ], + "links": [ + { + "link_id":{"link_uuid":{"uuid":"R1-1/1==R2-1/2"}}, + "link_endpoint_ids":[ + {"device_id":{"device_uuid":{"uuid":"R1"}},"endpoint_uuid":{"uuid":"1/1"}}, + {"device_id":{"device_uuid":{"uuid":"R2"}},"endpoint_uuid":{"uuid":"1/2"}} + ] + }, + { + "link_id":{"link_uuid":{"uuid":"R2-1/1==R3-1/2"}}, + "link_endpoint_ids":[ + {"device_id":{"device_uuid":{"uuid":"R2"}},"endpoint_uuid":{"uuid":"1/1"}}, + {"device_id":{"device_uuid":{"uuid":"R3"}},"endpoint_uuid":{"uuid":"1/2"}} + ] + } + ] +} diff --git a/hackfest/tfs-descriptors/old/service.json b/hackfest/tfs-descriptors/old/service.json new file mode 100644 index 0000000000000000000000000000000000000000..a25d0171dbfdbf174a877151201752c76759514a --- /dev/null +++ b/hackfest/tfs-descriptors/old/service.json @@ -0,0 +1,27 @@ +{ + "contexts": [ + { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_ids": [], + "service_ids": [ + {"context_id":{"context_uuid":{"uuid":"admin"}},"service_uuid":{"uuid":"hackfest-svc"}} + ] + } + ], + "services": [ + { + "service_id":{"context_id":{"context_uuid":{"uuid":"admin"}},"service_uuid":{"uuid":"hackfest-svc"}}, + "service_type": 1, + "service_status":{"service_status": 1}, + "service_endpoint_ids":[ + {"device_id":{"device_uuid":{"uuid":"R1"}},"endpoint_uuid":{"uuid":"1/3"}}, + {"device_id":{"device_uuid":{"uuid":"R2"}},"endpoint_uuid":{"uuid":"1/3"}} + ], + "service_constraints":[ + {"custom": {"constraint_type": "bandwidth[gbps]", "constraint_value": "10.0"}}, + {"custom": {"constraint_type": "latency[ms]", "constraint_value": "20.0"}} + ], + "service_config":{"config_rules":[]} + } + ] +} diff --git a/hackfest/tfs-descriptors/service-l3vpn.json b/hackfest/tfs-descriptors/service-l3vpn.json new file mode 100644 index 0000000000000000000000000000000000000000..457ba1a509aebc5eaea8caa37a09ac62ef286f32 --- /dev/null +++ b/hackfest/tfs-descriptors/service-l3vpn.json @@ -0,0 +1,44 @@ +{ + "services": [ + { + "service_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "service_uuid": {"uuid": "netx-l3-svc"} + }, + "service_type": 1, + "service_status": {"service_status": 1}, + "service_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1"}}, "endpoint_uuid": {"uuid": "1/2"}}, + {"device_id": {"device_uuid": {"uuid": "R3"}}, "endpoint_uuid": {"uuid": "1/2"}} + ], + "service_constraints": [ + {"custom": {"constraint_type": "bandwidth[gbps]", "constraint_value": "10.0"}}, + {"custom": {"constraint_type": "latency[ms]", "constraint_value": "15.2"}} + ], + "service_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "/settings", "resource_value": { + "address_families": ["IPV4"], + "bgp_as": 65000, + "bgp_route_target": "65000:333", + "mtu": 1512 + }}}, + {"action": 1, "custom": {"resource_key": "/device[R1]/endpoint[1/2]/settings", "resource_value": { + "address_ip": "3.3.2.1", + "address_prefix": 24, + "route_distinguisher": "65000:123", + "router_id": "10.10.10.1", + "sub_interface_index": 400, + "vlan_id": 400 + }}}, + {"action": 1, "custom": {"resource_key": "/device[R3]/endpoint[1/2]/settings", "resource_value": { + "address_ip": "3.3.1.1", + "address_prefix": 24, + "route_distinguisher": "65000:321", + "router_id": "20.20.20.1", + "sub_interface_index": 400, + "vlan_id": 500 + }}} + ]} + } + ] +} diff --git a/hackfest/yang/binding_topology.py b/hackfest/yang/binding_topology.py new file mode 100644 index 0000000000000000000000000000000000000000..12ea1901b5a40b736434978b145a6d9110a16470 --- /dev/null +++ b/hackfest/yang/binding_topology.py @@ -0,0 +1,714 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class yc_port_topology__topology_node_port(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module topology - based on the path /topology/node/port. Each member element of + the container is represented as a class variable - with a specific + YANG type. + """ + __slots__ = ('_path_helper', '_extmethods', '__port_id','__layer_protocol_name',) + + _yang_name = 'port' + _yang_namespace = 'urn:topology' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__port_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="port-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + self.__layer_protocol_name = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH': {}, 'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='layer-protocol-name', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['topology', 'node', 'port'] + + def _get_port_id(self): + """ + Getter method for port_id, mapped from YANG variable /topology/node/port/port_id (string) + """ + return self.__port_id + + def _set_port_id(self, v, load=False): + """ + Setter method for port_id, mapped from YANG variable /topology/node/port/port_id (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_port_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_port_id() directly. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="port-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """port_id must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="port-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True)""", + }) + + self.__port_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_port_id(self): + self.__port_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="port-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + + + def _get_layer_protocol_name(self): + """ + Getter method for layer_protocol_name, mapped from YANG variable /topology/node/port/layer_protocol_name (layer-protocol-name) + """ + return self.__layer_protocol_name + + def _set_layer_protocol_name(self, v, load=False): + """ + Setter method for layer_protocol_name, mapped from YANG variable /topology/node/port/layer_protocol_name (layer-protocol-name) + If this variable is read-only (config: false) in the + source YANG file, then _set_layer_protocol_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_layer_protocol_name() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH': {}, 'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='layer-protocol-name', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """layer_protocol_name must be of a type compatible with layer-protocol-name""", + 'defined-type': "topology:layer-protocol-name", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH': {}, 'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='layer-protocol-name', is_config=True)""", + }) + + self.__layer_protocol_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_layer_protocol_name(self): + self.__layer_protocol_name = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={'ETH': {}, 'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='layer-protocol-name', is_config=True) + + port_id = __builtin__.property(_get_port_id, _set_port_id) + layer_protocol_name = __builtin__.property(_get_layer_protocol_name, _set_layer_protocol_name) + + + _pyangbind_elements = OrderedDict([('port_id', port_id), ('layer_protocol_name', layer_protocol_name), ]) + + +class yc_node_topology__topology_node(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module topology - based on the path /topology/node. Each member element of + the container is represented as a class variable - with a specific + YANG type. + """ + __slots__ = ('_path_helper', '_extmethods', '__node_id','__port',) + + _yang_name = 'node' + _yang_namespace = 'urn:topology' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + self.__port = YANGDynClass(base=YANGListType("port_id",yc_port_topology__topology_node_port, yang_name="port", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='port-id', extensions=None), is_container='list', yang_name="port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['topology', 'node'] + + def _get_node_id(self): + """ + Getter method for node_id, mapped from YANG variable /topology/node/node_id (string) + """ + return self.__node_id + + def _set_node_id(self, v, load=False): + """ + Setter method for node_id, mapped from YANG variable /topology/node/node_id (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_node_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node_id() directly. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node_id must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True)""", + }) + + self.__node_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_node_id(self): + self.__node_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="node-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + + + def _get_port(self): + """ + Getter method for port, mapped from YANG variable /topology/node/port (list) + """ + return self.__port + + def _set_port(self, v, load=False): + """ + Setter method for port, mapped from YANG variable /topology/node/port (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_port is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_port() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("port_id",yc_port_topology__topology_node_port, yang_name="port", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='port-id', extensions=None), is_container='list', yang_name="port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """port must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("port_id",yc_port_topology__topology_node_port, yang_name="port", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='port-id', extensions=None), is_container='list', yang_name="port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True)""", + }) + + self.__port = t + if hasattr(self, '_set'): + self._set() + + def _unset_port(self): + self.__port = YANGDynClass(base=YANGListType("port_id",yc_port_topology__topology_node_port, yang_name="port", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='port-id', extensions=None), is_container='list', yang_name="port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + + node_id = __builtin__.property(_get_node_id, _set_node_id) + port = __builtin__.property(_get_port, _set_port) + + + _pyangbind_elements = OrderedDict([('node_id', node_id), ('port', port), ]) + + +class yc_link_topology__topology_link(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module topology - based on the path /topology/link. Each member element of + the container is represented as a class variable - with a specific + YANG type. + """ + __slots__ = ('_path_helper', '_extmethods', '__link_id','__source_node','__target_node','__source_port','__target_port',) + + _yang_name = 'link' + _yang_namespace = 'urn:topology' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__link_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + self.__source_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + self.__target_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + self.__source_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + self.__target_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['topology', 'link'] + + def _get_link_id(self): + """ + Getter method for link_id, mapped from YANG variable /topology/link/link_id (string) + """ + return self.__link_id + + def _set_link_id(self, v, load=False): + """ + Setter method for link_id, mapped from YANG variable /topology/link/link_id (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_link_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link_id() directly. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="link-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link_id must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True)""", + }) + + self.__link_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_link_id(self): + self.__link_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="link-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:topology', defining_module='topology', yang_type='string', is_config=True) + + + def _get_source_node(self): + """ + Getter method for source_node, mapped from YANG variable /topology/link/source_node (leafref) + """ + return self.__source_node + + def _set_source_node(self, v, load=False): + """ + Setter method for source_node, mapped from YANG variable /topology/link/source_node (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_source_node is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source_node() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source_node must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True)""", + }) + + self.__source_node = t + if hasattr(self, '_set'): + self._set() + + def _unset_source_node(self): + self.__source_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + + + def _get_target_node(self): + """ + Getter method for target_node, mapped from YANG variable /topology/link/target_node (leafref) + """ + return self.__target_node + + def _set_target_node(self, v, load=False): + """ + Setter method for target_node, mapped from YANG variable /topology/link/target_node (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_target_node is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_target_node() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """target_node must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True)""", + }) + + self.__target_node = t + if hasattr(self, '_set'): + self._set() + + def _unset_target_node(self): + self.__target_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + + + def _get_source_port(self): + """ + Getter method for source_port, mapped from YANG variable /topology/link/source_port (leafref) + """ + return self.__source_port + + def _set_source_port(self, v, load=False): + """ + Setter method for source_port, mapped from YANG variable /topology/link/source_port (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_source_port is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source_port() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source_port must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True)""", + }) + + self.__source_port = t + if hasattr(self, '_set'): + self._set() + + def _unset_source_port(self): + self.__source_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + + + def _get_target_port(self): + """ + Getter method for target_port, mapped from YANG variable /topology/link/target_port (leafref) + """ + return self.__target_port + + def _set_target_port(self, v, load=False): + """ + Setter method for target_port, mapped from YANG variable /topology/link/target_port (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_target_port is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_target_port() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """target_port must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True)""", + }) + + self.__target_port = t + if hasattr(self, '_set'): + self._set() + + def _unset_target_port(self): + self.__target_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:topology', defining_module='topology', yang_type='leafref', is_config=True) + + link_id = __builtin__.property(_get_link_id, _set_link_id) + source_node = __builtin__.property(_get_source_node, _set_source_node) + target_node = __builtin__.property(_get_target_node, _set_target_node) + source_port = __builtin__.property(_get_source_port, _set_source_port) + target_port = __builtin__.property(_get_target_port, _set_target_port) + + + _pyangbind_elements = OrderedDict([('link_id', link_id), ('source_node', source_node), ('target_node', target_node), ('source_port', source_port), ('target_port', target_port), ]) + + +class yc_topology_topology__topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module topology - based on the path /topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + """ + __slots__ = ('_path_helper', '_extmethods', '__node','__link',) + + _yang_name = 'topology' + _yang_namespace = 'urn:topology' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__node = YANGDynClass(base=YANGListType("node_id",yc_node_topology__topology_node, yang_name="node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-id', extensions=None), is_container='list', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + self.__link = YANGDynClass(base=YANGListType("link_id",yc_link_topology__topology_link, yang_name="link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-id', extensions=None), is_container='list', yang_name="link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return ['topology'] + + def _get_node(self): + """ + Getter method for node, mapped from YANG variable /topology/node (list) + """ + return self.__node + + def _set_node(self, v, load=False): + """ + Setter method for node, mapped from YANG variable /topology/node (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_node is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_node() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("node_id",yc_node_topology__topology_node, yang_name="node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-id', extensions=None), is_container='list', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """node must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("node_id",yc_node_topology__topology_node, yang_name="node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-id', extensions=None), is_container='list', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True)""", + }) + + self.__node = t + if hasattr(self, '_set'): + self._set() + + def _unset_node(self): + self.__node = YANGDynClass(base=YANGListType("node_id",yc_node_topology__topology_node, yang_name="node", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='node-id', extensions=None), is_container='list', yang_name="node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + + + def _get_link(self): + """ + Getter method for link, mapped from YANG variable /topology/link (list) + """ + return self.__link + + def _set_link(self, v, load=False): + """ + Setter method for link, mapped from YANG variable /topology/link (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_link is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_link() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("link_id",yc_link_topology__topology_link, yang_name="link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-id', extensions=None), is_container='list', yang_name="link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """link must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("link_id",yc_link_topology__topology_link, yang_name="link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-id', extensions=None), is_container='list', yang_name="link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True)""", + }) + + self.__link = t + if hasattr(self, '_set'): + self._set() + + def _unset_link(self): + self.__link = YANGDynClass(base=YANGListType("link_id",yc_link_topology__topology_link, yang_name="link", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='link-id', extensions=None), is_container='list', yang_name="link", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='list', is_config=True) + + node = __builtin__.property(_get_node, _set_node) + link = __builtin__.property(_get_link, _set_link) + + + _pyangbind_elements = OrderedDict([('node', node), ('link', link), ]) + + +class topology(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module topology - based on the path /topology. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Basic example of network topology + """ + __slots__ = ('_path_helper', '_extmethods', '__topology',) + + _yang_name = 'topology' + _yang_namespace = 'urn:topology' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__topology = YANGDynClass(base=yc_topology_topology__topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [] + + def _get_topology(self): + """ + Getter method for topology, mapped from YANG variable /topology (container) + """ + return self.__topology + + def _set_topology(self, v, load=False): + """ + Setter method for topology, mapped from YANG variable /topology (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_topology is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_topology() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=yc_topology_topology__topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """topology must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=yc_topology_topology__topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='container', is_config=True)""", + }) + + self.__topology = t + if hasattr(self, '_set'): + self._set() + + def _unset_topology(self): + self.__topology = YANGDynClass(base=yc_topology_topology__topology, is_container='container', yang_name="topology", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:topology', defining_module='topology', yang_type='container', is_config=True) + + topology = __builtin__.property(_get_topology, _set_topology) + + + _pyangbind_elements = OrderedDict([('topology', topology), ]) + + diff --git a/hackfest/yang/connection/binding_connection.py b/hackfest/yang/connection/binding_connection.py new file mode 100644 index 0000000000000000000000000000000000000000..6da8d21d942afce3e3502783def6179bef406cae --- /dev/null +++ b/hackfest/yang/connection/binding_connection.py @@ -0,0 +1,411 @@ +# -*- coding: utf-8 -*- +from operator import attrgetter +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType +from pyangbind.lib.base import PybindBase +from collections import OrderedDict +from decimal import Decimal +from bitarray import bitarray +import six + +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class yc_connection_connection__connection(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module connection - based on the path /connection. Each member element of + the container is represented as a class variable - with a specific + YANG type. + """ + __slots__ = ('_path_helper', '_extmethods', '__connection_id','__source_node','__target_node','__source_port','__target_port','__bandwidth','__layer_protocol_name',) + + _yang_name = 'connection' + _yang_namespace = 'urn:connection' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__target_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + self.__layer_protocol_name = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ETH': {}, u'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='topology:layer-protocol-name', is_config=True) + self.__connection_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="connection-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:connection', defining_module='connection', yang_type='string', is_config=True) + self.__bandwidth = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='uint32', is_config=True) + self.__target_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + self.__source_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + self.__source_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [u'connection'] + + def _get_connection_id(self): + """ + Getter method for connection_id, mapped from YANG variable /connection/connection_id (string) + """ + return self.__connection_id + + def _set_connection_id(self, v, load=False): + """ + Setter method for connection_id, mapped from YANG variable /connection/connection_id (string) + If this variable is read-only (config: false) in the + source YANG file, then _set_connection_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_connection_id() directly. + """ + parent = getattr(self, "_parent", None) + if parent is not None and load is False: + raise AttributeError("Cannot set keys directly when" + + " within an instantiated list") + + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="connection-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:connection', defining_module='connection', yang_type='string', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """connection_id must be of a type compatible with string""", + 'defined-type': "string", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="connection-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:connection', defining_module='connection', yang_type='string', is_config=True)""", + }) + + self.__connection_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_connection_id(self): + self.__connection_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="connection-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='urn:connection', defining_module='connection', yang_type='string', is_config=True) + + + def _get_source_node(self): + """ + Getter method for source_node, mapped from YANG variable /connection/source_node (leafref) + """ + return self.__source_node + + def _set_source_node(self, v, load=False): + """ + Setter method for source_node, mapped from YANG variable /connection/source_node (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_source_node is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source_node() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source_node must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True)""", + }) + + self.__source_node = t + if hasattr(self, '_set'): + self._set() + + def _unset_source_node(self): + self.__source_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + + + def _get_target_node(self): + """ + Getter method for target_node, mapped from YANG variable /connection/target_node (leafref) + """ + return self.__target_node + + def _set_target_node(self, v, load=False): + """ + Setter method for target_node, mapped from YANG variable /connection/target_node (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_target_node is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_target_node() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """target_node must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True)""", + }) + + self.__target_node = t + if hasattr(self, '_set'): + self._set() + + def _unset_target_node(self): + self.__target_node = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-node", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + + + def _get_source_port(self): + """ + Getter method for source_port, mapped from YANG variable /connection/source_port (leafref) + """ + return self.__source_port + + def _set_source_port(self, v, load=False): + """ + Setter method for source_port, mapped from YANG variable /connection/source_port (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_source_port is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_source_port() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """source_port must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True)""", + }) + + self.__source_port = t + if hasattr(self, '_set'): + self._set() + + def _unset_source_port(self): + self.__source_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + + + def _get_target_port(self): + """ + Getter method for target_port, mapped from YANG variable /connection/target_port (leafref) + """ + return self.__target_port + + def _set_target_port(self, v, load=False): + """ + Setter method for target_port, mapped from YANG variable /connection/target_port (leafref) + If this variable is read-only (config: false) in the + source YANG file, then _set_target_port is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_target_port() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """target_port must be of a type compatible with leafref""", + 'defined-type': "leafref", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True)""", + }) + + self.__target_port = t + if hasattr(self, '_set'): + self._set() + + def _unset_target_port(self): + self.__target_port = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="target-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='leafref', is_config=True) + + + def _get_bandwidth(self): + """ + Getter method for bandwidth, mapped from YANG variable /connection/bandwidth (uint32) + """ + return self.__bandwidth + + def _set_bandwidth(self, v, load=False): + """ + Setter method for bandwidth, mapped from YANG variable /connection/bandwidth (uint32) + If this variable is read-only (config: false) in the + source YANG file, then _set_bandwidth is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_bandwidth() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='uint32', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """bandwidth must be of a type compatible with uint32""", + 'defined-type': "uint32", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='uint32', is_config=True)""", + }) + + self.__bandwidth = t + if hasattr(self, '_set'): + self._set() + + def _unset_bandwidth(self): + self.__bandwidth = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="bandwidth", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='uint32', is_config=True) + + + def _get_layer_protocol_name(self): + """ + Getter method for layer_protocol_name, mapped from YANG variable /connection/layer_protocol_name (topology:layer-protocol-name) + """ + return self.__layer_protocol_name + + def _set_layer_protocol_name(self, v, load=False): + """ + Setter method for layer_protocol_name, mapped from YANG variable /connection/layer_protocol_name (topology:layer-protocol-name) + If this variable is read-only (config: false) in the + source YANG file, then _set_layer_protocol_name is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_layer_protocol_name() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ETH': {}, u'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='topology:layer-protocol-name', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """layer_protocol_name must be of a type compatible with topology:layer-protocol-name""", + 'defined-type': "topology:layer-protocol-name", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ETH': {}, u'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='topology:layer-protocol-name', is_config=True)""", + }) + + self.__layer_protocol_name = t + if hasattr(self, '_set'): + self._set() + + def _unset_layer_protocol_name(self): + self.__layer_protocol_name = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ETH': {}, u'OPTICAL': {}},), is_leaf=True, yang_name="layer-protocol-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:connection', defining_module='connection', yang_type='topology:layer-protocol-name', is_config=True) + + connection_id = __builtin__.property(_get_connection_id, _set_connection_id) + source_node = __builtin__.property(_get_source_node, _set_source_node) + target_node = __builtin__.property(_get_target_node, _set_target_node) + source_port = __builtin__.property(_get_source_port, _set_source_port) + target_port = __builtin__.property(_get_target_port, _set_target_port) + bandwidth = __builtin__.property(_get_bandwidth, _set_bandwidth) + layer_protocol_name = __builtin__.property(_get_layer_protocol_name, _set_layer_protocol_name) + + + _pyangbind_elements = OrderedDict([('connection_id', connection_id), ('source_node', source_node), ('target_node', target_node), ('source_port', source_port), ('target_port', target_port), ('bandwidth', bandwidth), ('layer_protocol_name', layer_protocol_name), ]) + + +class connection(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module connection - based on the path /connection. Each member element of + the container is represented as a class variable - with a specific + YANG type. + + YANG Description: Basic example of network topology + """ + __slots__ = ('_path_helper', '_extmethods', '__connection',) + + _yang_name = 'connection' + _yang_namespace = 'urn:connection' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__connection = YANGDynClass(base=YANGListType("connection_id",yc_connection_connection__connection, yang_name="connection", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='connection-id', extensions=None), is_container='list', yang_name="connection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:connection', defining_module='connection', yang_type='list', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [] + + def _get_connection(self): + """ + Getter method for connection, mapped from YANG variable /connection (list) + """ + return self.__connection + + def _set_connection(self, v, load=False): + """ + Setter method for connection, mapped from YANG variable /connection (list) + If this variable is read-only (config: false) in the + source YANG file, then _set_connection is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_connection() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=YANGListType("connection_id",yc_connection_connection__connection, yang_name="connection", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='connection-id', extensions=None), is_container='list', yang_name="connection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:connection', defining_module='connection', yang_type='list', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """connection must be of a type compatible with list""", + 'defined-type': "list", + 'generated-type': """YANGDynClass(base=YANGListType("connection_id",yc_connection_connection__connection, yang_name="connection", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='connection-id', extensions=None), is_container='list', yang_name="connection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:connection', defining_module='connection', yang_type='list', is_config=True)""", + }) + + self.__connection = t + if hasattr(self, '_set'): + self._set() + + def _unset_connection(self): + self.__connection = YANGDynClass(base=YANGListType("connection_id",yc_connection_connection__connection, yang_name="connection", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='connection-id', extensions=None), is_container='list', yang_name="connection", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='urn:connection', defining_module='connection', yang_type='list', is_config=True) + + connection = __builtin__.property(_get_connection, _set_connection) + + + _pyangbind_elements = OrderedDict([('connection', connection), ]) + + diff --git a/hackfest/yang/connection/connection.py b/hackfest/yang/connection/connection.py new file mode 100644 index 0000000000000000000000000000000000000000..1b5effbd8db66dc2284a24c53ce41023378859c8 --- /dev/null +++ b/hackfest/yang/connection/connection.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 binding_connection import connection +from pyangbind.lib.serialise import pybindIETFXMLEncoder +import pyangbind.lib.pybindJSON as pybindJSON + +con = connection() +con1 = con.connection.add("con1") +con1.source_node = "node1" +con1.target_node = "node2" +con1.source_port = "node1portA" +con1.target_port = "node2portA" +con1.bandwidth = 1000 +con1.layer_protocol_name = "OPTICAL" + +print(pybindIETFXMLEncoder.serialise(con)) +print(pybindJSON.dumps(con)) diff --git a/hackfest/yang/connection/connection.tree b/hackfest/yang/connection/connection.tree new file mode 100644 index 0000000000000000000000000000000000000000..cf8954eb7ceeae52d22ba73b37c482804dcca068 --- /dev/null +++ b/hackfest/yang/connection/connection.tree @@ -0,0 +1,9 @@ +module: connection + +--rw connection* [connection-id] + +--rw connection-id string + +--rw source-node? -> /topology:topology/node/node-id + +--rw target-node? -> /topology:topology/node/node-id + +--rw source-port? -> /topology:topology/node/port/port-id + +--rw target-port? -> /topology:topology/node/port/port-id + +--rw bandwidth? uint32 + +--rw layer-protocol-name? topology:layer-protocol-name diff --git a/hackfest/yang/connection/connection.uml b/hackfest/yang/connection/connection.uml new file mode 100644 index 0000000000000000000000000000000000000000..9abf20da021b920eb4b34e963192c14e178318ad --- /dev/null +++ b/hackfest/yang/connection/connection.uml @@ -0,0 +1,38 @@ +'Download plantuml from http://plantuml.sourceforge.net/ +'Generate png with java -jar plantuml.jar +'Output in img/.png +'If Java spits out memory error increase heap size with java -Xmx1024m -jar plantuml.jar +@startuml img/connection.png +hide empty fields +hide empty methods +hide <> circle +hide <> circle +hide <> circle +hide <> stereotype +hide <> circle +page 1x1 +Title connection +package "topology:topology" as topology_topology { +} +note top of connection_connection : Namespace: urn:connection \nPrefix: connection \nOrganization : \nCTTC \nContact : \nricard.vilalta@cttc.es \nRevision : 2018-08-24 \n +package "connection:connection" as connection_connection { +topology_topology +-- connection_connection +class "connection" as connection << (M, #33CCFF) module>> +class "connection" as connection_I_connection_grouping <<(G,Lime) grouping>> +connection_I_connection_grouping : connection-id : string +connection_I_connection_grouping : source-node : leafref : /topology:topology/topology:node/topology:node-id +connection_I_connection_grouping : target-node : leafref : /topology:topology/topology:node/topology:node-id +connection_I_connection_grouping : source-port : leafref : /topology:topology/topology:node/topology:port/topology:port-id +connection_I_connection_grouping : target-port : leafref : /topology:topology/topology:node/topology:port/topology:port-id +connection_I_connection_grouping : bandwidth : uint32 +connection_I_connection_grouping : layer-protocol-name : topology:layer-protocol-name +class "connection" as connection_I_connection << (L, #FF7700) list>> +connection *-- "0..N" connection_I_connection +connection_I_connection : connection {uses} +} + +connection_I_connection --> connection_I_connection_grouping : uses +center footer + UML Generated : 2018-11-08 09:13 + endfooter +@enduml diff --git a/hackfest/yang/connection/connection.yang b/hackfest/yang/connection/connection.yang new file mode 100644 index 0000000000000000000000000000000000000000..b94f9f81d932c829c4bb13f1fdd85781e8a6cc33 --- /dev/null +++ b/hackfest/yang/connection/connection.yang @@ -0,0 +1,68 @@ +module connection { + + namespace "urn:connection"; + + prefix "connection"; + + import topology { + prefix "topology"; + } + + organization + "CTTC"; + + contact + "ricard.vilalta@cttc.es"; + + description + "Basic example of network topology"; + + revision "2018-08-24" { + description "Basic example of network topology"; + reference ""; + } + + /** + * Groupings + */ + grouping connection { + leaf connection-id { + type string; + } + leaf source-node { + type leafref { + path "/topology:topology/topology:node/topology:node-id"; + } + } + leaf target-node { + type leafref { + path "/topology:topology/topology:node/topology:node-id"; + } + } + leaf source-port { + type leafref { + path "/topology:topology/topology:node/topology:port/topology:port-id"; + } + } + leaf target-port { + type leafref { + path "/topology:topology/topology:node/topology:port/topology:port-id"; + } + } + leaf bandwidth { + type uint32; + } + leaf layer-protocol-name { + type topology:layer-protocol-name; + } + } + + /** + * Container/lists + */ + list connection { + key "connection-id"; + uses connection; + } + +} diff --git a/hackfest/yang/img/connection.png b/hackfest/yang/img/connection.png new file mode 100644 index 0000000000000000000000000000000000000000..f282df27e0ffaa079b007157c2078d1e95655d9e Binary files /dev/null and b/hackfest/yang/img/connection.png differ diff --git a/hackfest/yang/img/topology.png b/hackfest/yang/img/topology.png new file mode 100644 index 0000000000000000000000000000000000000000..69ea84a1ee6a1396233381841ffef1e00edeb88d Binary files /dev/null and b/hackfest/yang/img/topology.png differ diff --git a/hackfest/yang/plantuml.jar b/hackfest/yang/plantuml.jar new file mode 100644 index 0000000000000000000000000000000000000000..880a35ec71b4de28da4541603ee08c5189831791 Binary files /dev/null and b/hackfest/yang/plantuml.jar differ diff --git a/hackfest/yang/topology.py b/hackfest/yang/topology.py new file mode 100644 index 0000000000000000000000000000000000000000..24f8f0d97da0daa989f1336bca9a9c609e7398b8 --- /dev/null +++ b/hackfest/yang/topology.py @@ -0,0 +1,34 @@ +# 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 binding_topology import topology +from pyangbind.lib.serialise import pybindIETFXMLEncoder +import pyangbind.lib.pybindJSON as pybindJSON + +topo = topology() + +node1 = topo.topology.node.add("node1") +node1.port.add("node1portA") + +node2 = topo.topology.node.add("node2") +node2.port.add("node2portA") + +link = topo.topology.link.add("link1") +link.source_node = "node1" +link.target_node = "node2" +link.source_port = "node1portA" +link.target_port = "node2portA" + +print(pybindIETFXMLEncoder.serialise(topo)) +print(pybindJSON.dumps(topo)) diff --git a/hackfest/yang/topology.tree b/hackfest/yang/topology.tree new file mode 100644 index 0000000000000000000000000000000000000000..0baf4768f3cc85c5465d04b0ff1a55b939077167 --- /dev/null +++ b/hackfest/yang/topology.tree @@ -0,0 +1,13 @@ +module: topology + +--rw topology + +--rw node* [node-id] + | +--rw node-id string + | +--rw port* [port-id] + | +--rw port-id string + | +--rw layer-protocol-name? layer-protocol-name + +--rw link* [link-id] + +--rw link-id string + +--rw source-node? -> /topology/node/node-id + +--rw target-node? -> /topology/node/node-id + +--rw source-port? -> /topology/node/port/port-id + +--rw target-port? -> /topology/node/port/port-id diff --git a/hackfest/yang/topology.uml b/hackfest/yang/topology.uml new file mode 100644 index 0000000000000000000000000000000000000000..b4210312c1a594df306898de78835eb50989563d --- /dev/null +++ b/hackfest/yang/topology.uml @@ -0,0 +1,55 @@ +'Download plantuml from http://plantuml.sourceforge.net/ +'Generate png with java -jar plantuml.jar +'Output in img/.png +'If Java spits out memory error increase heap size with java -Xmx1024m -jar plantuml.jar +@startuml img/topology.png +hide empty fields +hide empty methods +hide <> circle +hide <> circle +hide <> circle +hide <> stereotype +hide <> circle +page 1x1 +Title topology +note top of topology_topology : Namespace: urn:topology \nPrefix: topology \nOrganization : \nCTTC \nContact : \nricard.vilalta@cttc.es \nRevision : 2018-08-24 \n +package "topology:topology" as topology_topology { +class "topology" as topology << (M, #33CCFF) module>> +enum "layer-protocol-name" as topology_I_layer_protocol_name { +ETH +OPTICAL +} +class "port" as topology_I_port_grouping <<(G,Lime) grouping>> +topology_I_port_grouping : port-id : string +topology_I_port_grouping : layer-protocol-name : layer-protocol-name +class "node" as topology_I_node_grouping <<(G,Lime) grouping>> +topology_I_node_grouping : node-id : string +class "port" as topology_I_node_I_port << (L, #FF7700) list>> +topology_I_node_grouping *-- "0..N" topology_I_node_I_port +topology_I_node_I_port : port {uses} +class "link" as topology_I_link_grouping <<(G,Lime) grouping>> +topology_I_link_grouping : link-id : string +topology_I_link_grouping : source-node : leafref : /topology/node/node-id +topology_I_link_grouping : target-node : leafref : /topology/node/node-id +topology_I_link_grouping : source-port : leafref : /topology/node/port/port-id +topology_I_link_grouping : target-port : leafref : /topology/node/port/port-id +class "topology" as topology_I_topology_grouping <<(G,Lime) grouping>> +class "node" as topology_I_topology_I_node << (L, #FF7700) list>> +topology_I_topology_grouping *-- "0..N" topology_I_topology_I_node +topology_I_topology_I_node : node {uses} +class "link" as topology_I_topology_I_link << (L, #FF7700) list>> +topology_I_topology_grouping *-- "0..N" topology_I_topology_I_link +topology_I_topology_I_link : link {uses} +class "topology" as topology_I_topology <> +topology *-- "1" topology_I_topology +topology_I_topology : topology {uses} +} + +topology_I_node_I_port --> topology_I_port_grouping : uses +topology_I_topology_I_node --> topology_I_node_grouping : uses +topology_I_topology_I_link --> topology_I_link_grouping : uses +topology_I_topology --> topology_I_topology_grouping : uses +center footer + UML Generated : 2022-10-10 17:35 + endfooter +@enduml diff --git a/hackfest/yang/topology.xml b/hackfest/yang/topology.xml new file mode 100644 index 0000000000000000000000000000000000000000..9baab0342e4020bbe5cb2cb0d549d73c66e7706f --- /dev/null +++ b/hackfest/yang/topology.xml @@ -0,0 +1,39 @@ + + + + + + node1 + + node1portA + + + + node2 + + node2portA + + + + link1 + node1 + node1portA + node2 + node2portA + + + diff --git a/hackfest/yang/topology.yang b/hackfest/yang/topology.yang new file mode 100644 index 0000000000000000000000000000000000000000..521ceacd817fa70e89609dca825db2c7fa9c8302 --- /dev/null +++ b/hackfest/yang/topology.yang @@ -0,0 +1,99 @@ +module topology { + + namespace "urn:topology"; + + prefix "topology"; + + organization + "CTTC"; + + contact + "ricard.vilalta@cttc.es"; + + description + "Basic example of network topology"; + + revision "2018-08-24" { + description "Basic example of network topology"; + reference ""; + } + + /** + * Typedefs / identities + */ + typedef layer-protocol-name { + type enumeration { + enum "ETH"; + enum "OPTICAL"; + } + } + + + /** + * Groupings + */ + grouping port { + leaf port-id { + type string; + } + leaf layer-protocol-name { + type layer-protocol-name; + } + + } + + grouping node { + leaf node-id { + type string; + } + list port { + key "port-id"; + uses port; + } + } + + grouping link { + leaf link-id { + type string; + } + leaf source-node { + type leafref { + path "/topology/node/node-id"; + } + } + leaf target-node { + type leafref { + path "/topology/node/node-id"; + } + } + leaf source-port { + type leafref { + path "/topology/node/port/port-id"; + } + } + leaf target-port { + type leafref { + path "/topology/node/port/port-id"; + } + } + } + + grouping topology { + list node { + key "node-id"; + uses node; + } + list link { + key "link-id"; + uses link; + } + } + + /** + * Container/lists + */ + container topology { + uses topology; + } + +} diff --git a/install_development_dependencies.sh b/install_development_dependencies.sh deleted file mode 100755 index 55b52803bd10950e18695eb39fadfbe98295aee0..0000000000000000000000000000000000000000 --- a/install_development_dependencies.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - - -# installing basic tools -pip install --upgrade pip setuptools wheel pip-tools pylint pytest pytest-benchmark coverage grpcio-tools - -# creating an empty file -echo "" > requirements.in - -#TODO: include here your component -COMPONENTS="compute context device service monitoring opticalcentralizedattackdetector opticalattackmitigator dbscanserving webui" - -# compiling dependencies from all components -for component in $COMPONENTS -do - echo "computing requirements for component $component" - diff requirements.in src/$component/requirements.in | grep '^>' | sed 's/^>\ //' >> requirements.in -done - -pip-compile --output-file=requirements.txt requirements.in -python -m pip install -r requirements.txt - -# removing the temporary files -rm requirements.in -rm requirements.txt diff --git a/install_requirements.sh b/install_requirements.sh new file mode 100755 index 0000000000000000000000000000000000000000..f2013d275e95feb59235837dd166330288aac458 --- /dev/null +++ b/install_requirements.sh @@ -0,0 +1,58 @@ +#!/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. + +# 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 +# dlt : under design +# pathcomp : under design +ALL_COMPONENTS="context device service compute monitoring webui interdomain slice" +ALL_COMPONENTS="${ALL_COMPONENTS} dbscanserving opticalattackmitigator opticalcentralizedattackdetector" +ALL_COMPONENTS="${ALL_COMPONENTS} l3_attackmitigator l3_centralizedattackdetector l3_distributedattackdetector" +TFS_COMPONENTS=${TFS_COMPONENTS:-$ALL_COMPONENTS} + +echo "Updating PIP, SetupTools and Wheel..." +pip install --upgrade pip # ensure next packages get the latest versions +pip install --upgrade setuptools wheel # bring basic tooling for other requirements +pip install --upgrade pip-tools pylint # bring tooling for package compilation and code linting +printf "\n" + +echo "Creating integrated requirements file..." +touch requirements.in +diff requirements.in common_requirements.in | grep '^>' | sed 's/^>\ //' >> requirements.in +printf "\n" + +echo "Collecting requirements from components..." +for COMPONENT in $TFS_COMPONENTS +do + if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then continue; fi + diff requirements.in src/$COMPONENT/requirements.in | grep '^>' | sed 's/^>\ //' >> requirements.in +done +printf "\n" + +echo "Compiling requirements..." +# Done in a single step to prevent breaking dependencies between components +pip-compile --quiet --output-file=requirements.txt requirements.in +printf "\n" + +echo "Installing requirements..." +python -m pip install -r requirements.txt +printf "\n" + +#echo "Removing the temporary files..." +rm requirements.in +rm requirements.txt +printf "\n" diff --git a/manifests/.gitlab-ci.yml b/manifests/.gitlab-ci.yml index d20b67e531c33bfeae9c796ed95488b4c81d0fe4..9444afea5e38ad05b777d0c850ac71c38d219421 100644 --- a/manifests/.gitlab-ci.yml +++ b/manifests/.gitlab-ci.yml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,10 +14,10 @@ # Deployment of the dependency services in Kubernetes Cluster -dependencies all: - stage: dependencies - script: - - kubectl version - - kubectl get all - - kubectl apply -f "manifests/prometheus.yaml" - - kubectl get all +#dependencies all: +# stage: dependencies +# script: +# - kubectl version +# - kubectl get all +# - kubectl apply -f "manifests/prometheus.yaml" +# - kubectl get all diff --git a/manifests/cockroachdb/README.md b/manifests/cockroachdb/README.md new file mode 100644 index 0000000000000000000000000000000000000000..bfd774f0f85ca567986ae452c30b4305b336c57e --- /dev/null +++ b/manifests/cockroachdb/README.md @@ -0,0 +1,62 @@ +# CockroachDB configuration preparation + +These steps reproduce how to generate Cockroach manifest files used in TeraFlowSDN and apply them to MicroK8s. +For stability reasons, we fix the versions providing the manifest files. +In future releases of TeraFlowSDN, we might consider dynamically downloading and modifying the files. + +- Ref: https://www.cockroachlabs.com/docs/stable/configure-cockroachdb-kubernetes.html + +## Steps: + +DEPLOY_PATH="manifests/cockroachdb" +OPERATOR_BASE_URL="https://raw.githubusercontent.com/cockroachdb/cockroach-operator/master" + +mkdir -p ${DEPLOY_PATH} + +# Apply Custom Resource Definition for the CockroachDB Operator +curl -o "${DEPLOY_PATH}/crds.yaml" "${OPERATOR_BASE_URL}/install/crds.yaml" +kubectl apply -f "${DEPLOY_PATH}/crds.yaml" + +# Deploy CockroachDB Operator +curl -o "${DEPLOY_PATH}/operator.yaml" "${OPERATOR_BASE_URL}/install/operator.yaml" +nano "${DEPLOY_PATH}/operator.yaml" +# - add env var: WATCH_NAMESPACE=%TFS_CRDB_NAMESPACE% +sed s/%TFS_CRDB_NAMESPACE%/crdb/g ${DEPLOY_PATH}/operator.yaml > ${DEPLOY_PATH}/tfs_crdb_operator.yaml +kubectl apply -f "${DEPLOY_PATH}/tfs_crdb_operator.yaml" + +# Deploy CockroachDB +curl -o "${DEPLOY_PATH}/cluster.yaml" "${OPERATOR_BASE_URL}/examples/example.yaml" +nano "${DEPLOY_PATH}/cluster.yaml" +# - set version +# - set number of replicas +kubectl create namespace crdb +kubectl apply --namespace crdb -f "${DEPLOY_PATH}/cluster.yaml" + +# Deploy CockroachDB Client +curl -o "${DEPLOY_PATH}/client-secure-operator.yaml" "${OPERATOR_BASE_URL}/examples/client-secure-operator.yaml" +kubectl create --namespace crdb -f "${DEPLOY_PATH}/client-secure-operator.yaml" + +# Add tfs user with admin rights +kubectl exec -it cockroachdb-client-secure --namespace crdb -- ./cockroach sql --certs-dir=/cockroach/cockroach-certs --host=cockroachdb-public + CREATE USER tfs WITH PASSWORD 'tfs123'; + GRANT admin TO tfs; + +# Expose CockroachDB SQL port (26257) +PORT=$(kubectl --namespace crdb get service cockroachdb-public -o 'jsonpath={.spec.ports[?(@.name=="sql")].port}') +PATCH='{"data": {"'${PORT}'": "crdb/cockroachdb-public:'${PORT}'"}}' +kubectl patch configmap nginx-ingress-tcp-microk8s-conf --namespace ingress --patch "${PATCH}" + +PORT_MAP='{"containerPort": '${PORT}', "hostPort": '${PORT}'}' +CONTAINER='{"name": "nginx-ingress-microk8s", "ports": ['${PORT_MAP}']}' +PATCH='{"spec": {"template": {"spec": {"containers": ['${CONTAINER}']}}}}' +kubectl patch daemonset nginx-ingress-microk8s-controller --namespace ingress --patch "${PATCH}" + +# Expose CockroachDB Console port (8080) +PORT=$(kubectl --namespace crdb get service cockroachdb-public -o 'jsonpath={.spec.ports[?(@.name=="http")].port}') +PATCH='{"data": {"'${PORT}'": "crdb/cockroachdb-public:'${PORT}'"}}' +kubectl patch configmap nginx-ingress-tcp-microk8s-conf --namespace ingress --patch "${PATCH}" + +PORT_MAP='{"containerPort": '${PORT}', "hostPort": '${PORT}'}' +CONTAINER='{"name": "nginx-ingress-microk8s", "ports": ['${PORT_MAP}']}' +PATCH='{"spec": {"template": {"spec": {"containers": ['${CONTAINER}']}}}}' +kubectl patch daemonset nginx-ingress-microk8s-controller --namespace ingress --patch "${PATCH}" diff --git a/manifests/cockroachdb/client-secure-operator.yaml b/manifests/cockroachdb/client-secure-operator.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f7f81c8339d4ba47722a0ef2a2236178f1b9e1b0 --- /dev/null +++ b/manifests/cockroachdb/client-secure-operator.yaml @@ -0,0 +1,51 @@ +# Copyright 2022 The Cockroach Authors +# +# 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 +# +# https://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. +# +# Generated, do not edit. Please edit this file instead: config/templates/client-secure-operator.yaml.in +# + +apiVersion: v1 +kind: Pod +metadata: + name: cockroachdb-client-secure +spec: + serviceAccountName: cockroachdb-sa + containers: + - name: cockroachdb-client-secure + image: cockroachdb/cockroach:v22.2.0 + imagePullPolicy: IfNotPresent + volumeMounts: + - name: client-certs + mountPath: /cockroach/cockroach-certs/ + command: + - sleep + - "2147483648" # 2^31 + terminationGracePeriodSeconds: 0 + volumes: + - name: client-certs + projected: + sources: + - secret: + name: cockroachdb-node + items: + - key: ca.crt + path: ca.crt + - secret: + name: cockroachdb-root + items: + - key: tls.crt + path: client.root.crt + - key: tls.key + path: client.root.key + defaultMode: 256 diff --git a/manifests/cockroachdb/cluster.yaml b/manifests/cockroachdb/cluster.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f7444c0067cc9c2c07b53c85d765bb81d1c20c05 --- /dev/null +++ b/manifests/cockroachdb/cluster.yaml @@ -0,0 +1,70 @@ +# Copyright 2022 The Cockroach Authors +# +# 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 +# +# https://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. +# +# Generated, do not edit. Please edit this file instead: config/templates/example.yaml.in +# + +apiVersion: crdb.cockroachlabs.com/v1alpha1 +kind: CrdbCluster +metadata: + # this translates to the name of the statefulset that is created + name: cockroachdb +spec: + dataStore: + pvc: + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: "60Gi" + volumeMode: Filesystem + resources: + requests: + # This is intentionally low to make it work on local k3d clusters. + cpu: 100m + memory: 1Gi + limits: + cpu: 1 + memory: 4Gi + tlsEnabled: true +# You can set either a version of the db or a specific image name +# cockroachDBVersion: v22.2.0 + image: + name: cockroachdb/cockroach:v22.2.0 + # nodes refers to the number of crdb pods that are created + # via the statefulset + nodes: 3 + additionalLabels: + crdb: is-cool + # affinity is a new API field that is behind a feature gate that is + # disabled by default. To enable please see the operator.yaml file. + + # The affinity field will accept any podSpec affinity rule. + # affinity: + # podAntiAffinity: + # preferredDuringSchedulingIgnoredDuringExecution: + # - weight: 100 + # podAffinityTerm: + # labelSelector: + # matchExpressions: + # - key: app.kubernetes.io/instance + # operator: In + # values: + # - cockroachdb + # topologyKey: kubernetes.io/hostname + + # nodeSelectors used to match against + # nodeSelector: + # worker-pool-name: crdb-workers diff --git a/manifests/cockroachdb/crds.yaml b/manifests/cockroachdb/crds.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1b5cd89ae7001b3e200c0de7da240b660c461f3b --- /dev/null +++ b/manifests/cockroachdb/crds.yaml @@ -0,0 +1,1385 @@ +# Copyright 2022 The Cockroach Authors +# +# 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 +# +# https://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: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: (unknown) + creationTimestamp: null + name: crdbclusters.crdb.cockroachlabs.com +spec: + group: crdb.cockroachlabs.com + names: + categories: + - all + - cockroachdb + kind: CrdbCluster + listKind: CrdbClusterList + plural: crdbclusters + shortNames: + - crdb + singular: crdbcluster + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: CrdbCluster is the CRD for the cockroachDB clusters API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: CrdbClusterSpec defines the desired state of a CockroachDB + Cluster that the operator maintains. + properties: + additionalAnnotations: + additionalProperties: + type: string + description: (Optional) Additional custom resource annotations that + are added to all resources. Changing `AdditionalAnnotations` field + will result in cockroachDB cluster restart. + type: object + additionalArgs: + description: '(Optional) Additional command line arguments for the + `cockroach` binary Default: ""' + items: + type: string + type: array + additionalLabels: + additionalProperties: + type: string + description: (Optional) Additional custom resource labels that are + added to all resources + type: object + affinity: + description: (Optional) If specified, the pod's scheduling constraints + properties: + nodeAffinity: + description: Describes node affinity scheduling rules for the + pod. + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods to + nodes that satisfy the affinity expressions specified by + this field, but it may choose a node that violates one or + more of the expressions. The node that is most preferred + is the one with the greatest sum of weights, i.e. for each + node that meets all of the scheduling requirements (resource + request, requiredDuringScheduling affinity expressions, + etc.), compute a sum by iterating through the elements of + this field and adding "weight" to the sum if the node matches + the corresponding matchExpressions; the node(s) with the + highest sum are the most preferred. + items: + description: An empty preferred scheduling term matches + all objects with implicit weight 0 (i.e. it's a no-op). + A null preferred scheduling term matches no objects (i.e. + is also a no-op). + properties: + preference: + description: A node selector term, associated with the + corresponding weight. + properties: + matchExpressions: + description: A list of node selector requirements + by node's labels. + items: + description: A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: The label key that the selector + applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + description: A list of node selector requirements + by node's fields. + items: + description: A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: The label key that the selector + applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + weight: + description: Weight associated with matching the corresponding + nodeSelectorTerm, in the range 1-100. + format: int32 + type: integer + required: + - preference + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the affinity requirements specified by this + field are not met at scheduling time, the pod will not be + scheduled onto the node. If the affinity requirements specified + by this field cease to be met at some point during pod execution + (e.g. due to an update), the system may or may not try to + eventually evict the pod from its node. + properties: + nodeSelectorTerms: + description: Required. A list of node selector terms. + The terms are ORed. + items: + description: A null or empty node selector term matches + no objects. The requirements of them are ANDed. The + TopologySelectorTerm type implements a subset of the + NodeSelectorTerm. + properties: + matchExpressions: + description: A list of node selector requirements + by node's labels. + items: + description: A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: The label key that the selector + applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchFields: + description: A list of node selector requirements + by node's fields. + items: + description: A node selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: The label key that the selector + applies to. + type: string + operator: + description: Represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists, DoesNotExist. Gt, and + Lt. + type: string + values: + description: An array of string values. If + the operator is In or NotIn, the values + array must be non-empty. If the operator + is Exists or DoesNotExist, the values array + must be empty. If the operator is Gt or + Lt, the values array must have a single + element, which will be interpreted as an + integer. This array is replaced during a + strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + type: array + required: + - nodeSelectorTerms + type: object + type: object + podAffinity: + description: Describes pod affinity scheduling rules (e.g. co-locate + this pod in the same node, zone, etc. as some other pod(s)). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods to + nodes that satisfy the affinity expressions specified by + this field, but it may choose a node that violates one or + more of the expressions. The node that is most preferred + is the one with the greatest sum of weights, i.e. for each + node that meets all of the scheduling requirements (resource + request, requiredDuringScheduling affinity expressions, + etc.), compute a sum by iterating through the elements of + this field and adding "weight" to the sum if the node has + pods which matches the corresponding podAffinityTerm; the + node(s) with the highest sum are the most preferred. + items: + description: The weights of all of the matched WeightedPodAffinityTerm + fields are added per-node to find the most preferred node(s) + properties: + podAffinityTerm: + description: Required. A pod affinity term, associated + with the corresponding weight. + properties: + labelSelector: + description: A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. + items: + description: A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. + properties: + key: + description: key is the label key that + the selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. + type: object + type: object + namespaces: + description: namespaces specifies which namespaces + the labelSelector applies to (matches against); + null or empty list means "this pod's namespace" + items: + type: string + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods + matching the labelSelector in the specified namespaces, + where co-located is defined as running on a node + whose value of the label with key topologyKey + matches that of any node on which any of the selected + pods is running. Empty topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + weight: + description: weight associated with matching the corresponding + podAffinityTerm, in the range 1-100. + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the affinity requirements specified by this + field are not met at scheduling time, the pod will not be + scheduled onto the node. If the affinity requirements specified + by this field cease to be met at some point during pod execution + (e.g. due to a pod label update), the system may or may + not try to eventually evict the pod from its node. When + there are multiple elements, the lists of nodes corresponding + to each podAffinityTerm are intersected, i.e. all terms + must be satisfied. + items: + description: Defines a set of pods (namely those matching + the labelSelector relative to the given namespace(s)) + that this pod should be co-located (affinity) or not co-located + (anti-affinity) with, where co-located is defined as running + on a node whose value of the label with key + matches that of any node on which a pod of the set of + pods is running + properties: + labelSelector: + description: A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: key is the label key that the + selector applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object + type: object + namespaces: + description: namespaces specifies which namespaces the + labelSelector applies to (matches against); null or + empty list means "this pod's namespace" + items: + type: string + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods matching + the labelSelector in the specified namespaces, where + co-located is defined as running on a node whose value + of the label with key topologyKey matches that of + any node on which any of the selected pods is running. + Empty topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + type: array + type: object + podAntiAffinity: + description: Describes pod anti-affinity scheduling rules (e.g. + avoid putting this pod in the same node, zone, etc. as some + other pod(s)). + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods to + nodes that satisfy the anti-affinity expressions specified + by this field, but it may choose a node that violates one + or more of the expressions. The node that is most preferred + is the one with the greatest sum of weights, i.e. for each + node that meets all of the scheduling requirements (resource + request, requiredDuringScheduling anti-affinity expressions, + etc.), compute a sum by iterating through the elements of + this field and adding "weight" to the sum if the node has + pods which matches the corresponding podAffinityTerm; the + node(s) with the highest sum are the most preferred. + items: + description: The weights of all of the matched WeightedPodAffinityTerm + fields are added per-node to find the most preferred node(s) + properties: + podAffinityTerm: + description: Required. A pod affinity term, associated + with the corresponding weight. + properties: + labelSelector: + description: A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are + ANDed. + items: + description: A label selector requirement + is a selector that contains values, a key, + and an operator that relates the key and + values. + properties: + key: + description: key is the label key that + the selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only "value". + The requirements are ANDed. + type: object + type: object + namespaces: + description: namespaces specifies which namespaces + the labelSelector applies to (matches against); + null or empty list means "this pod's namespace" + items: + type: string + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods + matching the labelSelector in the specified namespaces, + where co-located is defined as running on a node + whose value of the label with key topologyKey + matches that of any node on which any of the selected + pods is running. Empty topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + weight: + description: weight associated with matching the corresponding + podAffinityTerm, in the range 1-100. + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + requiredDuringSchedulingIgnoredDuringExecution: + description: If the anti-affinity requirements specified by + this field are not met at scheduling time, the pod will + not be scheduled onto the node. If the anti-affinity requirements + specified by this field cease to be met at some point during + pod execution (e.g. due to a pod label update), the system + may or may not try to eventually evict the pod from its + node. When there are multiple elements, the lists of nodes + corresponding to each podAffinityTerm are intersected, i.e. + all terms must be satisfied. + items: + description: Defines a set of pods (namely those matching + the labelSelector relative to the given namespace(s)) + that this pod should be co-located (affinity) or not co-located + (anti-affinity) with, where co-located is defined as running + on a node whose value of the label with key + matches that of any node on which a pod of the set of + pods is running + properties: + labelSelector: + description: A label query over a set of resources, + in this case pods. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a + selector that contains values, a key, and an + operator that relates the key and values. + properties: + key: + description: key is the label key that the + selector applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are + In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. If the + operator is Exists or DoesNotExist, the + values array must be empty. This array is + replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is "In", + and the values array contains only "value". The + requirements are ANDed. + type: object + type: object + namespaces: + description: namespaces specifies which namespaces the + labelSelector applies to (matches against); null or + empty list means "this pod's namespace" + items: + type: string + type: array + topologyKey: + description: This pod should be co-located (affinity) + or not co-located (anti-affinity) with the pods matching + the labelSelector in the specified namespaces, where + co-located is defined as running on a node whose value + of the label with key topologyKey matches that of + any node on which any of the selected pods is running. + Empty topologyKey is not allowed. + type: string + required: + - topologyKey + type: object + type: array + type: object + type: object + automountServiceAccountToken: + description: '(Optional) AutomountServiceAccountToken determines whether + or not the stateful set pods should automount the service account + token. This is the default behavior in Kubernetes. For backward + compatibility reasons, this value defaults to `false` here. Default: + false' + type: boolean + cache: + description: '(Optional) The total size for caches (`--cache` command + line parameter) Default: "25%"' + type: string + clientTLSSecret: + description: '(Optional) The secret with a certificate and a private + key for root database user Default: ""' + type: string + cockroachDBVersion: + description: '(Optional) CockroachDBVersion sets the explicit version + of the cockroachDB image Default: ""' + type: string + dataStore: + description: Database disk storage configuration + properties: + hostPath: + description: (Optional) Directory from the host node's filesystem + properties: + path: + description: 'Path of the directory on the host. If the path + is a symlink, it will follow the link to the real path. + More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + type: string + type: + description: 'Type for HostPath Volume Defaults to "" More + info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + type: string + required: + - path + type: object + pvc: + description: (Optional) Persistent volume to use + properties: + source: + description: (Optional) Existing PVC in the same namespace + properties: + claimName: + description: 'ClaimName is the name of a PersistentVolumeClaim + in the same namespace as the pod using this volume. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + type: string + readOnly: + description: Will force the ReadOnly setting in VolumeMounts. + Default false. + type: boolean + required: + - claimName + type: object + spec: + description: (Optional) PVC to request a new persistent volume + properties: + accessModes: + description: 'AccessModes contains the desired access + modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' + items: + type: string + type: array + dataSource: + description: 'This field can be used to specify either: + * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) + * An existing PVC (PersistentVolumeClaim) * An existing + custom resource that implements data population (Alpha) + In order to use custom resource types that implement + data population, the AnyVolumeDataSource feature gate + must be enabled. If the provisioner or an external controller + can support the specified data source, it will create + a new volume based on the contents of the specified + data source.' + properties: + apiGroup: + description: APIGroup is the group for the resource + being referenced. If APIGroup is not specified, + the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. + type: string + kind: + description: Kind is the type of resource being referenced + type: string + name: + description: Name is the name of resource being referenced + type: string + required: + - kind + - name + type: object + resources: + description: 'Resources represents the minimum resources + the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount + of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum amount + of compute resources required. If Requests is omitted + for a container, it defaults to Limits if that is + explicitly specified, otherwise to an implementation-defined + value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + type: object + selector: + description: A label query over volumes to consider for + binding. + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector + that contains values, a key, and an operator that + relates the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are In, + NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. + If the operator is In or NotIn, the values + array must be non-empty. If the operator is + Exists or DoesNotExist, the values array must + be empty. This array is replaced during a + strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. + A single {key,value} in the matchLabels map is equivalent + to an element of matchExpressions, whose key field + is "key", the operator is "In", and the values array + contains only "value". The requirements are ANDed. + type: object + type: object + storageClassName: + description: 'Name of the StorageClass required by the + claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + type: string + volumeMode: + description: volumeMode defines what type of volume is + required by the claim. Value of Filesystem is implied + when not included in claim spec. + type: string + volumeName: + description: VolumeName is the binding reference to the + PersistentVolume backing this claim. + type: string + type: object + type: object + supportsAutoResize: + description: '(Optional) SupportsAutoResize marks that a PVC will + resize without restarting the entire cluster Default: false' + type: boolean + type: object + grpcPort: + description: '(Optional) The database port (`--port` CLI parameter + when starting the service) Default: 26258' + format: int32 + type: integer + httpPort: + description: '(Optional) The web UI port (`--http-port` CLI parameter + when starting the service) Default: 8080' + format: int32 + type: integer + image: + description: (Optional) Container image information + properties: + name: + description: 'Container image with supported CockroachDB version. + This defaults to the version pinned to the operator and requires + a full container and tag/sha name. For instance: cockroachdb/cockroachdb:v20.1' + type: string + pullPolicy: + description: '(Optional) PullPolicy for the image, which defaults + to IfNotPresent. Default: IfNotPresent' + type: string + pullSecret: + description: (Optional) Secret name containing the dockerconfig + to use for a registry that requires authentication. The secret + must be configured first by the user. + type: string + required: + - name + type: object + ingress: + description: (Optional) Ingress defines the Ingress configuration + used to expose the services using Ingress + properties: + sql: + description: (Optional) Ingress options for SQL connections Adding/changing + the SQL host will result in rolling update of the crdb cluster + nodes + properties: + annotations: + additionalProperties: + type: string + description: (Optional) Annotations related to ingress resource + type: object + host: + description: host is host to be used for exposing service + type: string + ingressClassName: + description: (Optional) IngressClassName to be used by ingress + resource + type: string + tls: + description: (Optional) TLS describes the TLS certificate + info + items: + description: IngressTLS describes the transport layer security + associated with an Ingress. + properties: + hosts: + description: Hosts are a list of hosts included in the + TLS certificate. The values in this list must match + the name/s used in the tlsSecret. Defaults to the + wildcard host setting for the loadbalancer controller + fulfilling this Ingress, if left unspecified. + items: + type: string + type: array + x-kubernetes-list-type: atomic + secretName: + description: SecretName is the name of the secret used + to terminate TLS traffic on port 443. Field is left + optional to allow TLS routing based on SNI hostname + alone. If the SNI host in a listener conflicts with + the "Host" header field used by an IngressRule, the + SNI host is used for termination and value of the + Host header is used for routing. + type: string + type: object + type: array + required: + - host + type: object + ui: + description: (Optional) Ingress options for UI (HTTP) connections + properties: + annotations: + additionalProperties: + type: string + description: (Optional) Annotations related to ingress resource + type: object + host: + description: host is host to be used for exposing service + type: string + ingressClassName: + description: (Optional) IngressClassName to be used by ingress + resource + type: string + tls: + description: (Optional) TLS describes the TLS certificate + info + items: + description: IngressTLS describes the transport layer security + associated with an Ingress. + properties: + hosts: + description: Hosts are a list of hosts included in the + TLS certificate. The values in this list must match + the name/s used in the tlsSecret. Defaults to the + wildcard host setting for the loadbalancer controller + fulfilling this Ingress, if left unspecified. + items: + type: string + type: array + x-kubernetes-list-type: atomic + secretName: + description: SecretName is the name of the secret used + to terminate TLS traffic on port 443. Field is left + optional to allow TLS routing based on SNI hostname + alone. If the SNI host in a listener conflicts with + the "Host" header field used by an IngressRule, the + SNI host is used for termination and value of the + Host header is used for routing. + type: string + type: object + type: array + required: + - host + type: object + type: object + logConfigMap: + description: '(Optional) LogConfigMap define the config map which + contains log configuration used to send the logs through the proper + channels in the cockroachdb. Logging configuration is available + for cockroach version v21.1.0 onwards. The logging configuration + is taken in format of yaml file, you can check the logging configuration + here (https://www.cockroachlabs.com/docs/stable/configure-logs.html#default-logging-configuration) + The default logging for cockroach version v20.x or less is stderr, + logging API is ignored for older versions. NOTE: The `data` field + of map must contain an entry called `logging.yaml` that contains + config options.' + type: string + maxSQLMemory: + description: '(Optional) The maximum in-memory storage capacity available + to store temporary data for SQL queries (`--max-sql-memory` parameter) + Default: "25%"' + type: string + maxUnavailable: + description: (Optional) The maximum number of pods that can be unavailable + during a rolling update. This number is set in the PodDistruptionBudget + and defaults to 1. + format: int32 + type: integer + minAvailable: + description: (Optional) The min number of pods that can be unavailable + during a rolling update. This number is set in the PodDistruptionBudget + and defaults to 1. + format: int32 + type: integer + nodeSelector: + additionalProperties: + type: string + description: (Optional) If specified, the pod's nodeSelector + type: object + nodeTLSSecret: + description: '(Optional) The secret with certificates and a private + key for the TLS endpoint on the database port. The standard naming + of files is expected (tls.key, tls.crt, ca.crt) Default: ""' + type: string + nodes: + description: Number of nodes (pods) in the cluster + format: int32 + minimum: 3 + type: integer + podEnvVariables: + description: '(Optional) PodEnvVariables is a slice of environment + variables that are added to the pods Default: (empty list)' + items: + description: EnvVar represents an environment variable present in + a Container. + properties: + name: + description: Name of the environment variable. Must be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are expanded using + the previous defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be unchanged. + The $(VAR_NAME) syntax can be escaped with a double $$, ie: + $$(VAR_NAME). Escaped references will never be expanded, regardless + of whether the variable exists or not. Defaults to "".' + type: string + valueFrom: + description: Source for the environment variable's value. Cannot + be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap or its key + must be defined + type: boolean + required: + - key + type: object + fieldRef: + description: 'Selects a field of the pod: supports metadata.name, + metadata.namespace, `metadata.labels['''']`, `metadata.annotations['''']`, + spec.nodeName, spec.serviceAccountName, status.hostIP, + status.podIP, status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath is + written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in the specified + API version. + type: string + required: + - fieldPath + type: object + resourceFieldRef: + description: 'Selects a resource of the container: only + resources limits and requests (limits.cpu, limits.memory, + limits.ephemeral-storage, requests.cpu, requests.memory + and requests.ephemeral-storage) are currently supported.' + properties: + containerName: + description: 'Container name: required for volumes, + optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format of the exposed + resources, defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + secretKeyRef: + description: Selects a key of a secret in the pod's namespace + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the Secret or its key must + be defined + type: boolean + required: + - key + type: object + type: object + required: + - name + type: object + type: array + resources: + description: '(Optional) Database container resource limits. Any container + limits can be specified. Default: (not specified)' + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute resources + allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum amount of compute + resources required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, otherwise + to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + type: object + sqlPort: + description: '(Optional) The SQL Port number Default: 26257' + format: int32 + type: integer + tlsEnabled: + description: (Optional) TLSEnabled determines if TLS is enabled for + your CockroachDB Cluster + type: boolean + tolerations: + description: (Optional) Tolerations for scheduling pods onto some + dedicated nodes + items: + description: The pod this Toleration is attached to tolerates any + taint that matches the triple using the matching + operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match all + values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the + value. Valid operators are Exists and Equal. Defaults to Equal. + Exists is equivalent to wildcard for value, so that a pod + can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time + the toleration (which must be of effect NoExecute, otherwise + this field is ignored) tolerates the taint. By default, it + is not set, which means tolerate the taint forever (do not + evict). Zero and negative values will be treated as 0 (evict + immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array + topologySpreadConstraints: + description: (Optional) If specified, the pod's topology spread constraints + items: + description: TopologySpreadConstraint specifies how to spread matching + pods among the given topology. + properties: + labelSelector: + description: LabelSelector is used to find matching pods. Pods + that match this label selector are counted to determine the + number of pods in their corresponding topology domain. + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector + that contains values, a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are In, NotIn, + Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. + If the operator is In or NotIn, the values array + must be non-empty. If the operator is Exists or + DoesNotExist, the values array must be empty. This + array is replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. + A single {key,value} in the matchLabels map is equivalent + to an element of matchExpressions, whose key field is + "key", the operator is "In", and the values array contains + only "value". The requirements are ANDed. + type: object + type: object + maxSkew: + description: 'MaxSkew describes the degree to which pods may + be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, + it is the maximum permitted difference between the number + of matching pods in the target topology and the global minimum. + For example, in a 3-zone cluster, MaxSkew is set to 1, and + pods with the same labelSelector spread as 1/1/0: | zone1 + | zone2 | zone3 | | P | P | | - if MaxSkew is + 1, incoming pod can only be scheduled to zone3 to become 1/1/1; + scheduling it onto zone1(zone2) would make the ActualSkew(2-0) + on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming + pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, + it is used to give higher precedence to topologies that satisfy + it. It''s a required field. Default value is 1 and 0 is not + allowed.' + format: int32 + type: integer + topologyKey: + description: TopologyKey is the key of node labels. Nodes that + have a label with this key and identical values are considered + to be in the same topology. We consider each + as a "bucket", and try to put balanced number of pods into + each bucket. It's a required field. + type: string + whenUnsatisfiable: + description: 'WhenUnsatisfiable indicates how to deal with a + pod if it doesn''t satisfy the spread constraint. - DoNotSchedule + (default) tells the scheduler not to schedule it. - ScheduleAnyway + tells the scheduler to schedule the pod in any location, but + giving higher precedence to topologies that would help reduce + the skew. A constraint is considered "Unsatisfiable" for + an incoming pod if and only if every possible node assigment + for that pod would violate "MaxSkew" on some topology. For + example, in a 3-zone cluster, MaxSkew is set to 1, and pods + with the same labelSelector spread as 3/1/1: | zone1 | zone2 + | zone3 | | P P P | P | P | If WhenUnsatisfiable is + set to DoNotSchedule, incoming pod can only be scheduled to + zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on + zone2(zone3) satisfies MaxSkew(1). In other words, the cluster + can still be imbalanced, but scheduler won''t make it *more* + imbalanced. It''s a required field.' + type: string + required: + - maxSkew + - topologyKey + - whenUnsatisfiable + type: object + type: array + required: + - dataStore + - nodes + type: object + status: + description: CrdbClusterStatus defines the observed state of Cluster + properties: + clusterStatus: + description: OperatorStatus represent the status of the operator(Failed, + Starting, Running or Other) + type: string + conditions: + description: List of conditions representing the current status of + the cluster resource. + items: + description: ClusterCondition represents cluster status as it is + perceived by the operator + properties: + lastTransitionTime: + description: The time when the condition was updated + format: date-time + type: string + status: + description: 'Condition status: True, False or Unknown' + type: string + type: + description: Type/Name of the condition + type: string + required: + - lastTransitionTime + - status + - type + type: object + type: array + crdbcontainerimage: + description: CrdbContainerImage is the container that will be installed + type: string + operatorActions: + items: + description: ClusterAction represents cluster status as it is perceived + by the operator + properties: + lastTransitionTime: + description: The time when the condition was updated + format: date-time + type: string + message: + description: (Optional) Message related to the status of the + action + type: string + status: + description: 'Action status: Failed, Finished or Unknown' + type: string + type: + description: Type/Name of the action + type: string + required: + - lastTransitionTime + - status + - type + type: object + type: array + sqlHost: + description: SQLHost is the host to be used with SQL ingress + type: string + version: + description: Database service version. Not populated and is just a + placeholder currently. + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/manifests/cockroachdb/operator.yaml b/manifests/cockroachdb/operator.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2be72d329b48bc6f45d66f811c299140cda85e27 --- /dev/null +++ b/manifests/cockroachdb/operator.yaml @@ -0,0 +1,616 @@ +# Copyright 2022 The Cockroach Authors +# +# 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 +# +# https://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: Namespace +metadata: + labels: + control-plane: cockroach-operator + name: cockroach-operator-system +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + app: cockroach-operator + name: cockroach-operator-sa + namespace: cockroach-operator-system +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + creationTimestamp: null + name: cockroach-operator-role +rules: +- apiGroups: + - admissionregistration.k8s.io + resources: + - mutatingwebhookconfigurations + verbs: + - get + - patch + - update +- apiGroups: + - admissionregistration.k8s.io + resources: + - validatingwebhookconfigurations + verbs: + - get + - patch + - update +- apiGroups: + - apps + resources: + - statefulsets + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - apps + resources: + - statefulsets/finalizers + verbs: + - get + - list + - watch +- apiGroups: + - apps + resources: + - statefulsets/scale + verbs: + - get + - update + - watch +- apiGroups: + - apps + resources: + - statefulsets/status + verbs: + - get + - patch + - update +- apiGroups: + - batch + resources: + - jobs + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - batch + resources: + - jobs/finalizers + verbs: + - get + - list + - watch +- apiGroups: + - batch + resources: + - jobs/status + verbs: + - get +- apiGroups: + - certificates.k8s.io + resources: + - certificatesigningrequests + verbs: + - create + - delete + - get + - list + - patch + - watch +- apiGroups: + - certificates.k8s.io + resources: + - certificatesigningrequests/approval + verbs: + - update +- apiGroups: + - certificates.k8s.io + resources: + - certificatesigningrequests/status + verbs: + - get + - patch + - update +- apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - configmaps/status + verbs: + - get +- apiGroups: + - "" + resources: + - nodes + verbs: + - get + - list +- apiGroups: + - "" + resources: + - persistentvolumeclaims + verbs: + - list + - update +- apiGroups: + - "" + resources: + - pods + verbs: + - delete + - deletecollection + - get + - list +- apiGroups: + - "" + resources: + - pods/exec + verbs: + - create +- apiGroups: + - "" + resources: + - pods/log + verbs: + - get +- apiGroups: + - "" + resources: + - secrets + verbs: + - create + - get + - list + - patch + - update + - watch +- apiGroups: + - "" + resources: + - serviceaccounts + verbs: + - create + - get + - list + - watch +- apiGroups: + - "" + resources: + - services + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - "" + resources: + - services/finalizers + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - services/status + verbs: + - get + - patch + - update +- apiGroups: + - crdb.cockroachlabs.com + resources: + - crdbclusters + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - crdb.cockroachlabs.com + resources: + - crdbclusters/finalizers + verbs: + - update +- apiGroups: + - crdb.cockroachlabs.com + resources: + - crdbclusters/status + verbs: + - get + - patch + - update +- apiGroups: + - networking.k8s.io + resources: + - ingresses + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - networking.k8s.io + resources: + - ingresses/finalizers + verbs: + - get + - list + - watch +- apiGroups: + - networking.k8s.io + resources: + - ingresses/status + verbs: + - get +- apiGroups: + - policy + resources: + - poddisruptionbudgets + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - policy + resources: + - poddisruptionbudgets/finalizers + verbs: + - get + - list + - watch +- apiGroups: + - policy + resources: + - poddisruptionbudgets/status + verbs: + - get +- apiGroups: + - rbac.authorization.k8s.io + resources: + - rolebindings + verbs: + - create + - get + - list + - watch +- apiGroups: + - rbac.authorization.k8s.io + resources: + - roles + verbs: + - create + - get + - list + - watch +- apiGroups: + - security.openshift.io + resources: + - securitycontextconstraints + verbs: + - use +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: cockroach-operator-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: cockroach-operator-role +subjects: +- kind: ServiceAccount + name: cockroach-operator-sa + namespace: cockroach-operator-system +--- +apiVersion: v1 +kind: Service +metadata: + labels: + control-plane: cockroach-operator + name: cockroach-operator-webhook-service + namespace: cockroach-operator-system +spec: + ports: + - port: 443 + targetPort: 9443 + selector: + app: cockroach-operator +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: cockroach-operator + name: cockroach-operator-manager + namespace: cockroach-operator-system +spec: + replicas: 1 + selector: + matchLabels: + app: cockroach-operator + template: + metadata: + labels: + app: cockroach-operator + spec: + containers: + - args: + - -zap-log-level + - info + env: + - name: RELATED_IMAGE_COCKROACH_v20_1_4 + value: cockroachdb/cockroach:v20.1.4 + - name: RELATED_IMAGE_COCKROACH_v20_1_5 + value: cockroachdb/cockroach:v20.1.5 + - name: RELATED_IMAGE_COCKROACH_v20_1_8 + value: cockroachdb/cockroach:v20.1.8 + - name: RELATED_IMAGE_COCKROACH_v20_1_11 + value: cockroachdb/cockroach:v20.1.11 + - name: RELATED_IMAGE_COCKROACH_v20_1_12 + value: cockroachdb/cockroach:v20.1.12 + - name: RELATED_IMAGE_COCKROACH_v20_1_13 + value: cockroachdb/cockroach:v20.1.13 + - name: RELATED_IMAGE_COCKROACH_v20_1_15 + value: cockroachdb/cockroach:v20.1.15 + - name: RELATED_IMAGE_COCKROACH_v20_1_16 + value: cockroachdb/cockroach:v20.1.16 + - name: RELATED_IMAGE_COCKROACH_v20_1_17 + value: cockroachdb/cockroach:v20.1.17 + - name: RELATED_IMAGE_COCKROACH_v20_2_0 + value: cockroachdb/cockroach:v20.2.0 + - name: RELATED_IMAGE_COCKROACH_v20_2_1 + value: cockroachdb/cockroach:v20.2.1 + - name: RELATED_IMAGE_COCKROACH_v20_2_2 + value: cockroachdb/cockroach:v20.2.2 + - name: RELATED_IMAGE_COCKROACH_v20_2_3 + value: cockroachdb/cockroach:v20.2.3 + - name: RELATED_IMAGE_COCKROACH_v20_2_4 + value: cockroachdb/cockroach:v20.2.4 + - name: RELATED_IMAGE_COCKROACH_v20_2_5 + value: cockroachdb/cockroach:v20.2.5 + - name: RELATED_IMAGE_COCKROACH_v20_2_6 + value: cockroachdb/cockroach:v20.2.6 + - name: RELATED_IMAGE_COCKROACH_v20_2_8 + value: cockroachdb/cockroach:v20.2.8 + - name: RELATED_IMAGE_COCKROACH_v20_2_9 + value: cockroachdb/cockroach:v20.2.9 + - name: RELATED_IMAGE_COCKROACH_v20_2_10 + value: cockroachdb/cockroach:v20.2.10 + - name: RELATED_IMAGE_COCKROACH_v20_2_11 + value: cockroachdb/cockroach:v20.2.11 + - name: RELATED_IMAGE_COCKROACH_v20_2_12 + value: cockroachdb/cockroach:v20.2.12 + - name: RELATED_IMAGE_COCKROACH_v20_2_13 + value: cockroachdb/cockroach:v20.2.13 + - name: RELATED_IMAGE_COCKROACH_v20_2_14 + value: cockroachdb/cockroach:v20.2.14 + - name: RELATED_IMAGE_COCKROACH_v20_2_15 + value: cockroachdb/cockroach:v20.2.15 + - name: RELATED_IMAGE_COCKROACH_v20_2_16 + value: cockroachdb/cockroach:v20.2.16 + - name: RELATED_IMAGE_COCKROACH_v20_2_17 + value: cockroachdb/cockroach:v20.2.17 + - name: RELATED_IMAGE_COCKROACH_v20_2_18 + value: cockroachdb/cockroach:v20.2.18 + - name: RELATED_IMAGE_COCKROACH_v20_2_19 + value: cockroachdb/cockroach:v20.2.19 + - name: RELATED_IMAGE_COCKROACH_v21_1_0 + value: cockroachdb/cockroach:v21.1.0 + - name: RELATED_IMAGE_COCKROACH_v21_1_1 + value: cockroachdb/cockroach:v21.1.1 + - name: RELATED_IMAGE_COCKROACH_v21_1_2 + value: cockroachdb/cockroach:v21.1.2 + - name: RELATED_IMAGE_COCKROACH_v21_1_3 + value: cockroachdb/cockroach:v21.1.3 + - name: RELATED_IMAGE_COCKROACH_v21_1_4 + value: cockroachdb/cockroach:v21.1.4 + - name: RELATED_IMAGE_COCKROACH_v21_1_5 + value: cockroachdb/cockroach:v21.1.5 + - name: RELATED_IMAGE_COCKROACH_v21_1_6 + value: cockroachdb/cockroach:v21.1.6 + - name: RELATED_IMAGE_COCKROACH_v21_1_7 + value: cockroachdb/cockroach:v21.1.7 + - name: RELATED_IMAGE_COCKROACH_v21_1_9 + value: cockroachdb/cockroach:v21.1.9 + - name: RELATED_IMAGE_COCKROACH_v21_1_10 + value: cockroachdb/cockroach:v21.1.10 + - name: RELATED_IMAGE_COCKROACH_v21_1_11 + value: cockroachdb/cockroach:v21.1.11 + - name: RELATED_IMAGE_COCKROACH_v21_1_12 + value: cockroachdb/cockroach:v21.1.12 + - name: RELATED_IMAGE_COCKROACH_v21_1_13 + value: cockroachdb/cockroach:v21.1.13 + - name: RELATED_IMAGE_COCKROACH_v21_1_14 + value: cockroachdb/cockroach:v21.1.14 + - name: RELATED_IMAGE_COCKROACH_v21_1_15 + value: cockroachdb/cockroach:v21.1.15 + - name: RELATED_IMAGE_COCKROACH_v21_1_16 + value: cockroachdb/cockroach:v21.1.16 + - name: RELATED_IMAGE_COCKROACH_v21_1_17 + value: cockroachdb/cockroach:v21.1.17 + - name: RELATED_IMAGE_COCKROACH_v21_1_18 + value: cockroachdb/cockroach:v21.1.18 + - name: RELATED_IMAGE_COCKROACH_v21_1_19 + value: cockroachdb/cockroach:v21.1.19 + - name: RELATED_IMAGE_COCKROACH_v21_1_20 + value: cockroachdb/cockroach:v21.1.20 + - name: RELATED_IMAGE_COCKROACH_v21_1_21 + value: cockroachdb/cockroach:v21.1.21 + - name: RELATED_IMAGE_COCKROACH_v21_2_0 + value: cockroachdb/cockroach:v21.2.0 + - name: RELATED_IMAGE_COCKROACH_v21_2_1 + value: cockroachdb/cockroach:v21.2.1 + - name: RELATED_IMAGE_COCKROACH_v21_2_2 + value: cockroachdb/cockroach:v21.2.2 + - name: RELATED_IMAGE_COCKROACH_v21_2_3 + value: cockroachdb/cockroach:v21.2.3 + - name: RELATED_IMAGE_COCKROACH_v21_2_4 + value: cockroachdb/cockroach:v21.2.4 + - name: RELATED_IMAGE_COCKROACH_v21_2_5 + value: cockroachdb/cockroach:v21.2.5 + - name: RELATED_IMAGE_COCKROACH_v21_2_7 + value: cockroachdb/cockroach:v21.2.7 + - name: RELATED_IMAGE_COCKROACH_v21_2_8 + value: cockroachdb/cockroach:v21.2.8 + - name: RELATED_IMAGE_COCKROACH_v21_2_9 + value: cockroachdb/cockroach:v21.2.9 + - name: RELATED_IMAGE_COCKROACH_v21_2_10 + value: cockroachdb/cockroach:v21.2.10 + - name: RELATED_IMAGE_COCKROACH_v21_2_11 + value: cockroachdb/cockroach:v21.2.11 + - name: RELATED_IMAGE_COCKROACH_v21_2_12 + value: cockroachdb/cockroach:v21.2.12 + - name: RELATED_IMAGE_COCKROACH_v21_2_13 + value: cockroachdb/cockroach:v21.2.13 + - name: RELATED_IMAGE_COCKROACH_v21_2_14 + value: cockroachdb/cockroach:v21.2.14 + - name: RELATED_IMAGE_COCKROACH_v21_2_15 + value: cockroachdb/cockroach:v21.2.15 + - name: RELATED_IMAGE_COCKROACH_v21_2_16 + value: cockroachdb/cockroach:v21.2.16 + - name: RELATED_IMAGE_COCKROACH_v21_2_17 + value: cockroachdb/cockroach:v21.2.17 + - name: RELATED_IMAGE_COCKROACH_v22_1_0 + value: cockroachdb/cockroach:v22.1.0 + - name: RELATED_IMAGE_COCKROACH_v22_1_1 + value: cockroachdb/cockroach:v22.1.1 + - name: RELATED_IMAGE_COCKROACH_v22_1_2 + value: cockroachdb/cockroach:v22.1.2 + - name: RELATED_IMAGE_COCKROACH_v22_1_3 + value: cockroachdb/cockroach:v22.1.3 + - name: RELATED_IMAGE_COCKROACH_v22_1_4 + value: cockroachdb/cockroach:v22.1.4 + - name: RELATED_IMAGE_COCKROACH_v22_1_5 + value: cockroachdb/cockroach:v22.1.5 + - name: RELATED_IMAGE_COCKROACH_v22_1_7 + value: cockroachdb/cockroach:v22.1.7 + - name: RELATED_IMAGE_COCKROACH_v22_1_8 + value: cockroachdb/cockroach:v22.1.8 + - name: RELATED_IMAGE_COCKROACH_v22_1_10 + value: cockroachdb/cockroach:v22.1.10 + - name: RELATED_IMAGE_COCKROACH_v22_1_11 + value: cockroachdb/cockroach:v22.1.11 + - name: RELATED_IMAGE_COCKROACH_v22_1_12 + value: cockroachdb/cockroach:v22.1.12 + - name: RELATED_IMAGE_COCKROACH_v22_2_0 + value: cockroachdb/cockroach:v22.2.0 + - name: OPERATOR_NAME + value: cockroachdb + - name: WATCH_NAMESPACE + value: %TFS_CRDB_NAMESPACE% + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + image: cockroachdb/cockroach-operator:v2.9.0 + imagePullPolicy: IfNotPresent + name: cockroach-operator + resources: + requests: + cpu: 10m + memory: 32Mi + serviceAccountName: cockroach-operator-sa +--- +apiVersion: admissionregistration.k8s.io/v1 +kind: MutatingWebhookConfiguration +metadata: + creationTimestamp: null + name: cockroach-operator-mutating-webhook-configuration +webhooks: +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: cockroach-operator-webhook-service + namespace: cockroach-operator-system + path: /mutate-crdb-cockroachlabs-com-v1alpha1-crdbcluster + failurePolicy: Fail + name: mcrdbcluster.kb.io + rules: + - apiGroups: + - crdb.cockroachlabs.com + apiVersions: + - v1alpha1 + operations: + - CREATE + - UPDATE + resources: + - crdbclusters + sideEffects: None +--- +apiVersion: admissionregistration.k8s.io/v1 +kind: ValidatingWebhookConfiguration +metadata: + creationTimestamp: null + name: cockroach-operator-validating-webhook-configuration +webhooks: +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: cockroach-operator-webhook-service + namespace: cockroach-operator-system + path: /validate-crdb-cockroachlabs-com-v1alpha1-crdbcluster + failurePolicy: Fail + name: vcrdbcluster.kb.io + rules: + - apiGroups: + - crdb.cockroachlabs.com + apiVersions: + - v1alpha1 + operations: + - CREATE + - UPDATE + resources: + - crdbclusters + sideEffects: None diff --git a/manifests/cockroachdb/single-node.yaml b/manifests/cockroachdb/single-node.yaml new file mode 100644 index 0000000000000000000000000000000000000000..72454a0904fa70b6b4062dae8ef7e2e5d8625648 --- /dev/null +++ b/manifests/cockroachdb/single-node.yaml @@ -0,0 +1,84 @@ +# 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: + name: cockroachdb-public + labels: + app.kubernetes.io/component: database + app.kubernetes.io/instance: cockroachdb + app.kubernetes.io/name: cockroachdb +spec: + type: ClusterIP + selector: + app.kubernetes.io/component: database + app.kubernetes.io/instance: cockroachdb + app.kubernetes.io/name: cockroachdb + ports: + - name: http + port: 8080 + protocol: TCP + targetPort: 8080 + - name: sql + port: 26257 + protocol: TCP + targetPort: 26257 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: cockroachdb +spec: + selector: + matchLabels: + app.kubernetes.io/component: database + app.kubernetes.io/instance: cockroachdb + app.kubernetes.io/name: cockroachdb + serviceName: "cockroachdb-public" + replicas: 1 + minReadySeconds: 5 + template: + metadata: + labels: + app.kubernetes.io/component: database + app.kubernetes.io/instance: cockroachdb + app.kubernetes.io/name: cockroachdb + spec: + terminationGracePeriodSeconds: 10 + restartPolicy: Always + containers: + - name: cockroachdb + image: cockroachdb/cockroach:latest-v22.2 + args: + - start-single-node + ports: + - containerPort: 8080 + name: http + - containerPort: 26257 + name: sql + env: + - name: COCKROACH_DATABASE + value: "%CRDB_DATABASE%" + - name: COCKROACH_USER + value: "%CRDB_USERNAME%" + - name: COCKROACH_PASSWORD + value: "%CRDB_PASSWORD%" + resources: + requests: + cpu: "250m" + memory: 1Gi + limits: + cpu: "1" + memory: 2Gi diff --git a/manifests/computeservice.yaml b/manifests/computeservice.yaml index 0c8d0a6724a49f4dec0f903570ff04e49cb4e793..7e40ef988bc7dcb77960b224dfe5626ee95cfdfb 100644 --- a/manifests/computeservice.yaml +++ b/manifests/computeservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: registry.gitlab.com/teraflow-h2020/controller/compute:latest + image: labs.etsi.org:5050/tfs/controller/compute:latest imagePullPolicy: Always ports: - containerPort: 8080 diff --git a/manifests/contextservice.yaml b/manifests/contextservice.yaml index 04da586dfeb25a01a6f5267aa31441498ce4f2cc..b1e6eb89dc4ec92409dbd05bbe668987ea93828f 100644 --- a/manifests/contextservice.yaml +++ b/manifests/contextservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,34 +28,22 @@ spec: spec: terminationGracePeriodSeconds: 5 containers: - - name: redis - image: redis:6.2 - ports: - - containerPort: 6379 - resources: - requests: - cpu: 250m - memory: 512Mi - limits: - cpu: 700m - memory: 1024Mi - name: server - image: registry.gitlab.com/teraflow-h2020/controller/context:latest + image: labs.etsi.org:5050/tfs/controller/context:latest imagePullPolicy: Always ports: - containerPort: 1010 - - containerPort: 8080 + - containerPort: 9192 env: - - name: DB_BACKEND - value: "redis" - name: MB_BACKEND - value: "redis" - - name: REDIS_DATABASE_ID - value: "0" + value: "nats" - name: LOG_LEVEL value: "INFO" - - name: POPULATE_FAKE_DATA - value: "false" + envFrom: + - secretRef: + name: crdb-data + - secretRef: + name: nats-data readinessProbe: exec: command: ["/bin/grpc_health_probe", "-addr=:1010"] @@ -64,16 +52,18 @@ spec: command: ["/bin/grpc_health_probe", "-addr=:1010"] resources: requests: - cpu: 250m - memory: 512Mi + cpu: 50m + memory: 64Mi limits: - cpu: 700m - memory: 1024Mi + cpu: 500m + memory: 512Mi --- apiVersion: v1 kind: Service metadata: name: contextservice + labels: + app: contextservice spec: type: ClusterIP selector: @@ -83,7 +73,7 @@ spec: protocol: TCP port: 1010 targetPort: 1010 - - name: http + - name: metrics protocol: TCP - port: 8080 - targetPort: 8080 + port: 9192 + targetPort: 9192 diff --git a/manifests/dbscanservingservice.yaml b/manifests/dbscanservingservice.yaml index 9553ed556bddaa437d89881f0c4220ae6e418239..ae920143454da2c63bccc6eb74ea75670bad6eff 100644 --- a/manifests/dbscanservingservice.yaml +++ b/manifests/dbscanservingservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: registry.gitlab.com/teraflow-h2020/controller/dbscanserving:latest + image: labs.etsi.org:5050/tfs/controller/dbscanserving:latest imagePullPolicy: Always ports: - containerPort: 10006 diff --git a/manifests/deviceservice.yaml b/manifests/deviceservice.yaml index 171394f7c43b2447e898902c78d5276fe1bcbc7c..ca2c81f0f2e5d874066464ab0537adeec734cfbb 100644 --- a/manifests/deviceservice.yaml +++ b/manifests/deviceservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ spec: selector: matchLabels: app: deviceservice + replicas: 1 template: metadata: labels: @@ -28,10 +29,11 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: registry.gitlab.com/teraflow-h2020/controller/device:latest + image: labs.etsi.org:5050/tfs/controller/device:latest imagePullPolicy: Always ports: - containerPort: 2020 + - containerPort: 9192 env: - name: LOG_LEVEL value: "INFO" @@ -43,16 +45,18 @@ spec: command: ["/bin/grpc_health_probe", "-addr=:2020"] resources: requests: - cpu: 250m - memory: 512Mi + cpu: 50m + memory: 64Mi limits: - cpu: 700m - memory: 1024Mi + cpu: 500m + memory: 512Mi --- apiVersion: v1 kind: Service metadata: name: deviceservice + labels: + app: deviceservice spec: type: ClusterIP selector: @@ -62,3 +66,7 @@ spec: protocol: TCP port: 2020 targetPort: 2020 + - name: metrics + protocol: TCP + port: 9192 + targetPort: 9192 diff --git a/manifests/dltservice.yaml b/manifests/dltservice.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5e8f745f78b14ea4f8881b8992ef788ce89fdcc2 --- /dev/null +++ b/manifests/dltservice.yaml @@ -0,0 +1,100 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: dltservice +spec: + selector: + matchLabels: + app: dltservice + template: + metadata: + labels: + app: dltservice + spec: + terminationGracePeriodSeconds: 5 + containers: + - name: connector + image: labs.etsi.org:5050/tfs/controller/dlt-connector:latest + imagePullPolicy: Always + ports: + - containerPort: 8080 + - containerPort: 9192 + env: + - name: LOG_LEVEL + value: "INFO" + ## for debug purposes + #- name: DLT_GATEWAY_HOST + # value: "mock-blockchain.tfs-bchain.svc.cluster.local" + #- name: DLT_GATEWAY_PORT + # value: "50051" + readinessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:8080"] + livenessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:8080"] + resources: + requests: + cpu: 50m + memory: 64Mi + limits: + cpu: 500m + memory: 512Mi + - name: gateway + image: labs.etsi.org:5050/tfs/controller/dlt-gateway:latest + imagePullPolicy: Always + ports: + - containerPort: 50051 + #readinessProbe: + # httpGet: + # path: /health + # port: 8081 + # initialDelaySeconds: 5 + # timeoutSeconds: 5 + #livenessProbe: + # httpGet: + # path: /health + # port: 8081 + # initialDelaySeconds: 5 + # timeoutSeconds: 5 + resources: + requests: + cpu: 200m + memory: 512Mi + limits: + cpu: 700m + memory: 1024Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: dltservice + labels: + app: dltservice +spec: + type: ClusterIP + selector: + app: dltservice + ports: + - name: grpc + protocol: TCP + port: 8080 + targetPort: 8080 + - name: metrics + protocol: TCP + port: 9192 + targetPort: 9192 diff --git a/manifests/interdomainservice.yaml b/manifests/interdomainservice.yaml new file mode 100644 index 0000000000000000000000000000000000000000..79acf96def508837fd0b3def816d3e4c4e20a368 --- /dev/null +++ b/manifests/interdomainservice.yaml @@ -0,0 +1,71 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: interdomainservice +spec: + selector: + matchLabels: + app: interdomainservice + template: + metadata: + labels: + app: interdomainservice + spec: + terminationGracePeriodSeconds: 5 + containers: + - name: server + image: labs.etsi.org:5050/tfs/controller/interdomain:latest + imagePullPolicy: Always + ports: + - containerPort: 10010 + - containerPort: 9192 + env: + - name: LOG_LEVEL + value: "INFO" + readinessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:10010"] + livenessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:10010"] + resources: + requests: + cpu: 50m + memory: 64Mi + limits: + cpu: 500m + memory: 512Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: interdomainservice + labels: + app: interdomainservice +spec: + type: ClusterIP + selector: + app: interdomainservice + ports: + - name: grpc + protocol: TCP + port: 10010 + targetPort: 10010 + - name: metrics + protocol: TCP + port: 9192 + targetPort: 9192 diff --git a/manifests/l3_attackmitigatorservice.yaml b/manifests/l3_attackmitigatorservice.yaml index 2240776ebb2e234b58febe9520a4b9e07d42b6d4..dec1bc4d936a9db5758679691f0fb130a5d67324 100644 --- a/manifests/l3_attackmitigatorservice.yaml +++ b/manifests/l3_attackmitigatorservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: registry.gitlab.com/teraflow-h2020/controller/l3_attackmitigator:latest + image: labs.etsi.org:5050/tfs/controller/l3_attackmitigator:latest imagePullPolicy: Always ports: - containerPort: 10002 diff --git a/manifests/l3_centralizedattackdetectorservice.yaml b/manifests/l3_centralizedattackdetectorservice.yaml index fa7ee9dccd99982d35d7f7705e463ecee30c7c9b..0ef23ba512ac5397203baa4195ceebe17cf6c743 100644 --- a/manifests/l3_centralizedattackdetectorservice.yaml +++ b/manifests/l3_centralizedattackdetectorservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: registry.gitlab.com/teraflow-h2020/controller/l3_centralizedattackdetector:latest + image: labs.etsi.org:5050/tfs/controller/l3_centralizedattackdetector:latest imagePullPolicy: Always ports: - containerPort: 10001 diff --git a/manifests/l3_distributedattackdetectorservice.yaml b/manifests/l3_distributedattackdetectorservice.yaml index 6b28f68dd5e08561eb29e4512af330b26f6408cf..b363c1d5c5f82083d525959d6aedf337554f604a 100644 --- a/manifests/l3_distributedattackdetectorservice.yaml +++ b/manifests/l3_distributedattackdetectorservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: registry.gitlab.com/teraflow-h2020/controller/l3_distributedattackdetector:latest + image: labs.etsi.org:5050/tfs/controller/l3_distributedattackdetector:latest imagePullPolicy: Always ports: - containerPort: 10000 diff --git a/manifests/load_generatorservice.yaml b/manifests/load_generatorservice.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b94e11e725757fa2ec67de19f98ecfa6a03f085b --- /dev/null +++ b/manifests/load_generatorservice.yaml @@ -0,0 +1,67 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: load-generatorservice +spec: + selector: + matchLabels: + app: load-generatorservice + replicas: 1 + template: + metadata: + labels: + app: load-generatorservice + spec: + terminationGracePeriodSeconds: 5 + containers: + - name: server + image: labs.etsi.org:5050/tfs/controller/load_generator:latest + imagePullPolicy: Always + ports: + - containerPort: 50052 + env: + - name: LOG_LEVEL + value: "INFO" + readinessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:50052"] + livenessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:50052"] + resources: + requests: + cpu: 50m + memory: 64Mi + limits: + cpu: 500m + memory: 512Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: load-generatorservice + labels: + app: load-generatorservice +spec: + type: ClusterIP + selector: + app: load-generatorservice + ports: + - name: grpc + protocol: TCP + port: 50052 + targetPort: 50052 diff --git a/manifests/mock_blockchain.yaml b/manifests/mock_blockchain.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1093610f8a0cf4d735e16e99df56cb78fd6481fc --- /dev/null +++ b/manifests/mock_blockchain.yaml @@ -0,0 +1,64 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mock-blockchain +spec: + selector: + matchLabels: + app: mock-blockchain + template: + metadata: + labels: + app: mock-blockchain + spec: + terminationGracePeriodSeconds: 5 + containers: + - name: server + image: labs.etsi.org:5050/tfs/controller/mock_blockchain:latest + imagePullPolicy: Always + ports: + - containerPort: 50051 + env: + - name: LOG_LEVEL + value: "INFO" + readinessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:50051"] + livenessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:50051"] + resources: + requests: + cpu: 100m + memory: 512Mi + limits: + cpu: 700m + memory: 1024Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: mock-blockchain +spec: + type: ClusterIP + selector: + app: mock-blockchain + ports: + - name: grpc + protocol: TCP + port: 50051 + targetPort: 50051 diff --git a/manifests/monitoringservice.yaml b/manifests/monitoringservice.yaml index e6fa36d1a68e4e0f85776b511631b0b619ec100c..4447a1427980be6554228087924bf8e4ca775758 100644 --- a/manifests/monitoringservice.yaml +++ b/manifests/monitoringservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,36 +27,19 @@ spec: app: monitoringservice spec: terminationGracePeriodSeconds: 5 - restartPolicy: Always containers: - - name: influxdb - image: influxdb:1.8 - ports: - - containerPort: 8086 - envFrom: - - secretRef: - name: influxdb-secrets - readinessProbe: - exec: - command: ["curl", "-XGET", "localhost:8086/health"] - livenessProbe: - exec: - command: ["curl", "-XGET", "localhost:8086/health"] - resources: - requests: - cpu: 250m - memory: 512Mi - limits: - cpu: 700m - memory: 1024Mi - name: server - image: registry.gitlab.com/teraflow-h2020/controller/monitoring:latest + image: labs.etsi.org:5050/tfs/controller/monitoring:latest imagePullPolicy: Always ports: - containerPort: 7070 + - containerPort: 9192 + env: + - name: LOG_LEVEL + value: "INFO" envFrom: - - secretRef: - name: monitoring-secrets + - secretRef: + name: qdb-data readinessProbe: exec: command: ["/bin/grpc_health_probe", "-addr=:7070"] @@ -65,16 +48,18 @@ spec: command: ["/bin/grpc_health_probe", "-addr=:7070"] resources: requests: - cpu: 250m - memory: 512Mi + cpu: 50m + memory: 64Mi limits: - cpu: 700m - memory: 1024Mi + cpu: 500m + memory: 512Mi --- apiVersion: v1 kind: Service metadata: name: monitoringservice + labels: + app: monitoringservice spec: type: ClusterIP selector: @@ -84,7 +69,7 @@ spec: protocol: TCP port: 7070 targetPort: 7070 - - name: influxdb + - name: metrics protocol: TCP - port: 8086 - targetPort: 8086 + port: 9192 + targetPort: 9192 diff --git a/manifests/nginx_ingress_http.yaml b/manifests/nginx_ingress_http.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5db05d4af0e3594edd6186a5adbcb6733ed7d5c8 --- /dev/null +++ b/manifests/nginx_ingress_http.yaml @@ -0,0 +1,52 @@ +# 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: networking.k8s.io/v1 +kind: Ingress +metadata: + name: tfs-ingress + annotations: + nginx.ingress.kubernetes.io/rewrite-target: /$2 +spec: + rules: + - http: + paths: + - path: /webui(/|$)(.*) + pathType: Prefix + backend: + service: + name: webuiservice + port: + number: 8004 + - path: /grafana(/|$)(.*) + pathType: Prefix + backend: + service: + name: webuiservice + port: + number: 3000 + #- path: /context(/|$)(.*) + # pathType: Prefix + # backend: + # service: + # name: contextservice + # port: + # number: 8080 + - path: /()(restconf/.*) + pathType: Prefix + backend: + service: + name: computeservice + port: + number: 8080 diff --git a/manifests/opticalattackmitigatorservice.yaml b/manifests/opticalattackmitigatorservice.yaml index afe2e4069fbae2fd3b5300da614b4deb5d785fab..bfac05e40917aeca1f55c68ebf845937b46c9cdb 100644 --- a/manifests/opticalattackmitigatorservice.yaml +++ b/manifests/opticalattackmitigatorservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: registry.gitlab.com/teraflow-h2020/controller/opticalattackmitigator:latest + image: labs.etsi.org:5050/tfs/controller/opticalattackmitigator:latest imagePullPolicy: Always ports: - containerPort: 10007 diff --git a/manifests/opticalcentralizedattackdetectorservice.yaml b/manifests/opticalcentralizedattackdetectorservice.yaml index 664bcb54348e533ff40c7f882b5668f727a39053..13d4d97c222699544dc051564ec1609cad7ed7e1 100644 --- a/manifests/opticalcentralizedattackdetectorservice.yaml +++ b/manifests/opticalcentralizedattackdetectorservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: registry.gitlab.com/teraflow-h2020/controller/opticalcentralizedattackdetector:latest + image: labs.etsi.org:5050/tfs/controller/opticalcentralizedattackdetector:latest imagePullPolicy: Always ports: - containerPort: 10005 diff --git a/manifests/pathcompservice.yaml b/manifests/pathcompservice.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fd3599f429f48ebb3cf3f8d802f8f61f00e1b41d --- /dev/null +++ b/manifests/pathcompservice.yaml @@ -0,0 +1,98 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: pathcompservice +spec: + selector: + matchLabels: + app: pathcompservice + replicas: 1 + template: + metadata: + labels: + app: pathcompservice + spec: + terminationGracePeriodSeconds: 5 + containers: + - name: frontend + image: labs.etsi.org:5050/tfs/controller/pathcomp-frontend:latest + imagePullPolicy: Always + ports: + - containerPort: 10020 + - containerPort: 9192 + env: + - name: LOG_LEVEL + value: "INFO" + readinessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:10020"] + livenessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:10020"] + resources: + requests: + cpu: 50m + memory: 64Mi + limits: + cpu: 500m + memory: 512Mi + - name: backend + image: labs.etsi.org:5050/tfs/controller/pathcomp-backend:latest + imagePullPolicy: Always + #readinessProbe: + # httpGet: + # path: /health + # port: 8081 + # initialDelaySeconds: 5 + # timeoutSeconds: 5 + #livenessProbe: + # httpGet: + # path: /health + # port: 8081 + # initialDelaySeconds: 5 + # timeoutSeconds: 5 + resources: + requests: + cpu: 100m + memory: 256Mi + limits: + cpu: 700m + memory: 1024Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: pathcompservice + labels: + app: pathcompservice +spec: + type: ClusterIP + selector: + app: pathcompservice + ports: + - name: grpc + protocol: TCP + port: 10020 + targetPort: 10020 + - name: http + protocol: TCP + port: 8081 + targetPort: 8081 + - name: metrics + protocol: TCP + port: 9192 + targetPort: 9192 diff --git a/manifests/prometheus.yaml b/manifests/prometheus.yaml index 221123eea5cf8ba61d078ccfccd697d7c6c01127..43a766b6e2ae67e36d161c3063a8a2d3ccc875d3 100644 --- a/manifests/prometheus.yaml +++ b/manifests/prometheus.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/manifests/questdb/manifest.yaml b/manifests/questdb/manifest.yaml new file mode 100644 index 0000000000000000000000000000000000000000..50a2ce2c668603fe39a3d2b42fc6e5461dd7ef93 --- /dev/null +++ b/manifests/questdb/manifest.yaml @@ -0,0 +1,67 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: questdb +spec: + selector: + matchLabels: + app: questdb + serviceName: "questdb-public" + replicas: 1 + template: + metadata: + labels: + app: questdb + spec: + terminationGracePeriodSeconds: 5 + restartPolicy: Always + containers: + - name: metricsdb + image: questdb/questdb + ports: + - containerPort: 9000 + - containerPort: 9009 + - containerPort: 8812 + env: + - name: QDB_CAIRO_COMMIT_LAG + value: "1000" + - name: QDB_CAIRO_MAX_UNCOMMITTED_ROWS + value: "100000" +--- +apiVersion: v1 +kind: Service +metadata: + name: questdb-public + labels: + app: questdb +spec: + type: ClusterIP + selector: + app: questdb + ports: + - name: http + protocol: TCP + port: 9000 + targetPort: 9000 + - name: ilp + protocol: TCP + port: 9009 + targetPort: 9009 + - name: sql + protocol: TCP + port: 8812 + targetPort: 8812 diff --git a/manifests/servicemonitors.yaml b/manifests/servicemonitors.yaml new file mode 100644 index 0000000000000000000000000000000000000000..06c3390f4fddbcb6f8adec5d931989cc8a41cc68 --- /dev/null +++ b/manifests/servicemonitors.yaml @@ -0,0 +1,245 @@ +# 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: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + namespace: monitoring # namespace where prometheus is running + name: tfs-contextservice-metric + labels: + app: contextservice + #release: prometheus + #release: prom # name of the release + # ( VERY IMPORTANT: You need to know the correct release name by viewing + # the servicemonitor of Prometheus itself: Without the correct name, + # Prometheus cannot identify the metrics of the Flask app as the target.) +spec: + selector: + matchLabels: + # Target app service + #namespace: tfs + app: contextservice # same as above + #release: prometheus # same as above + endpoints: + - port: metrics # named port in target app + scheme: http + path: /metrics # path to scrape + interval: 5s # scrape interval + namespaceSelector: + any: false + matchNames: + - tfs # namespace where the app is running +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + namespace: monitoring # namespace where prometheus is running + name: tfs-deviceservice-metric + labels: + app: deviceservice + #release: prometheus + #release: prom # name of the release + # ( VERY IMPORTANT: You need to know the correct release name by viewing + # the servicemonitor of Prometheus itself: Without the correct name, + # Prometheus cannot identify the metrics of the Flask app as the target.) +spec: + selector: + matchLabels: + # Target app service + #namespace: tfs + app: deviceservice # same as above + #release: prometheus # same as above + endpoints: + - port: metrics # named port in target app + scheme: http + path: /metrics # path to scrape + interval: 5s # scrape interval + namespaceSelector: + any: false + matchNames: + - tfs # namespace where the app is running +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + namespace: monitoring # namespace where prometheus is running + name: tfs-serviceservice-metric + labels: + app: serviceservice + #release: prometheus + #release: prom # name of the release + # ( VERY IMPORTANT: You need to know the correct release name by viewing + # the servicemonitor of Prometheus itself: Without the correct name, + # Prometheus cannot identify the metrics of the Flask app as the target.) +spec: + selector: + matchLabels: + # Target app service + #namespace: tfs + app: serviceservice # same as above + #release: prometheus # same as above + endpoints: + - port: metrics # named port in target app + scheme: http + path: /metrics # path to scrape + interval: 5s # scrape interval + namespaceSelector: + any: false + matchNames: + - tfs # namespace where the app is running +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + namespace: monitoring # namespace where prometheus is running + name: tfs-sliceservice-metric + labels: + app: sliceservice + #release: prometheus + #release: prom # name of the release + # ( VERY IMPORTANT: You need to know the correct release name by viewing + # the servicemonitor of Prometheus itself: Without the correct name, + # Prometheus cannot identify the metrics of the Flask app as the target.) +spec: + selector: + matchLabels: + # Target app service + #namespace: tfs + app: sliceservice # same as above + #release: prometheus # same as above + endpoints: + - port: metrics # named port in target app + scheme: http + path: /metrics # path to scrape + interval: 5s # scrape interval + namespaceSelector: + any: false + matchNames: + - tfs # namespace where the app is running +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + namespace: monitoring # namespace where prometheus is running + name: tfs-pathcompservice-metric + labels: + app: pathcompservice + #release: prometheus + #release: prom # name of the release + # ( VERY IMPORTANT: You need to know the correct release name by viewing + # the servicemonitor of Prometheus itself: Without the correct name, + # Prometheus cannot identify the metrics of the Flask app as the target.) +spec: + selector: + matchLabels: + # Target app service + #namespace: tfs + app: pathcompservice # same as above + #release: prometheus # same as above + endpoints: + - port: metrics # named port in target app + scheme: http + path: /metrics # path to scrape + interval: 5s # scrape interval + namespaceSelector: + any: false + matchNames: + - tfs # namespace where the app is running +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + namespace: monitoring # namespace where prometheus is running + name: tfs-monitoringservice-metric + labels: + app: monitoringservice + #release: prometheus + #release: prom # name of the release + # ( VERY IMPORTANT: You need to know the correct release name by viewing + # the servicemonitor of Prometheus itself: Without the correct name, + # Prometheus cannot identify the metrics of the Flask app as the target.) +spec: + selector: + matchLabels: + # Target app service + #namespace: tfs + app: monitoringservice # same as above + #release: prometheus # same as above + endpoints: + - port: metrics # named port in target app + scheme: http + path: /metrics # path to scrape + interval: 5s # scrape interval + namespaceSelector: + any: false + matchNames: + - tfs # namespace where the app is running +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + namespace: monitoring # namespace where prometheus is running + name: tfs-dltservice-metric + labels: + app: dltservice + #release: prometheus + #release: prom # name of the release + # ( VERY IMPORTANT: You need to know the correct release name by viewing + # the servicemonitor of Prometheus itself: Without the correct name, + # Prometheus cannot identify the metrics of the Flask app as the target.) +spec: + selector: + matchLabels: + # Target app service + #namespace: tfs + app: dltservice # same as above + #release: prometheus # same as above + endpoints: + - port: metrics # named port in target app + scheme: http + path: /metrics # path to scrape + interval: 5s # scrape interval + namespaceSelector: + any: false + matchNames: + - tfs # namespace where the app is running +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + namespace: monitoring # namespace where prometheus is running + name: tfs-interdomainservice-metric + labels: + app: interdomainservice + #release: prometheus + #release: prom # name of the release + # ( VERY IMPORTANT: You need to know the correct release name by viewing + # the servicemonitor of Prometheus itself: Without the correct name, + # Prometheus cannot identify the metrics of the Flask app as the target.) +spec: + selector: + matchLabels: + # Target app service + #namespace: tfs + app: interdomainservice # same as above + #release: prometheus # same as above + endpoints: + - port: metrics # named port in target app + scheme: http + path: /metrics # path to scrape + interval: 5s # scrape interval + namespaceSelector: + any: false + matchNames: + - tfs # namespace where the app is running diff --git a/manifests/serviceservice.yaml b/manifests/serviceservice.yaml index 75832b94fa2a6ba97617641e7b249157508614bf..3fa4a6e0dc256ba964fd4ee26a8b7095bb2303f4 100644 --- a/manifests/serviceservice.yaml +++ b/manifests/serviceservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ spec: selector: matchLabels: app: serviceservice + replicas: 1 template: metadata: labels: @@ -28,10 +29,11 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: registry.gitlab.com/teraflow-h2020/controller/service:latest + image: labs.etsi.org:5050/tfs/controller/service:latest imagePullPolicy: Always ports: - containerPort: 3030 + - containerPort: 9192 env: - name: LOG_LEVEL value: "INFO" @@ -43,16 +45,18 @@ spec: command: ["/bin/grpc_health_probe", "-addr=:3030"] resources: requests: - cpu: 250m - memory: 512Mi + cpu: 50m + memory: 64Mi limits: - cpu: 700m - memory: 1024Mi + cpu: 500m + memory: 512Mi --- apiVersion: v1 kind: Service metadata: name: serviceservice + labels: + app: serviceservice spec: type: ClusterIP selector: @@ -62,3 +66,7 @@ spec: protocol: TCP port: 3030 targetPort: 3030 + - name: metrics + protocol: TCP + port: 9192 + targetPort: 9192 diff --git a/manifests/sliceservice.yaml b/manifests/sliceservice.yaml new file mode 100644 index 0000000000000000000000000000000000000000..447f6a1c77cc6862db3df3e83b73add3257a5c0d --- /dev/null +++ b/manifests/sliceservice.yaml @@ -0,0 +1,72 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: sliceservice +spec: + selector: + matchLabels: + app: sliceservice + replicas: 1 + template: + metadata: + labels: + app: sliceservice + spec: + terminationGracePeriodSeconds: 5 + containers: + - name: server + image: labs.etsi.org:5050/tfs/controller/slice:latest + imagePullPolicy: Always + ports: + - containerPort: 4040 + - containerPort: 9192 + env: + - name: LOG_LEVEL + value: "INFO" + readinessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:4040"] + livenessProbe: + exec: + command: ["/bin/grpc_health_probe", "-addr=:4040"] + resources: + requests: + cpu: 50m + memory: 64Mi + limits: + cpu: 500m + memory: 512Mi +--- +apiVersion: v1 +kind: Service +metadata: + name: sliceservice + labels: + app: sliceservice +spec: + type: ClusterIP + selector: + app: sliceservice + ports: + - name: grpc + protocol: TCP + port: 4040 + targetPort: 4040 + - name: metrics + protocol: TCP + port: 9192 + targetPort: 9192 diff --git a/manifests/webuiservice.yaml b/manifests/webuiservice.yaml index be7ad73d7ca92c7deabbb0a312d8f4b3889af28a..f25dbf6e501775d56f266699b1474429b42b2015 100644 --- a/manifests/webuiservice.yaml +++ b/manifests/webuiservice.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,13 +32,15 @@ spec: - 0 containers: - name: server - image: registry.gitlab.com/teraflow-h2020/controller/webui:latest + image: labs.etsi.org:5050/tfs/controller/webui:latest imagePullPolicy: Always ports: - - containerPort: 8004 # TODO: define the real port + - containerPort: 8004 env: - name: LOG_LEVEL - value: "DEBUG" + value: "INFO" + - name: WEBUISERVICE_SERVICE_BASEURL_HTTP + value: "/webui/" readinessProbe: httpGet: path: /healthz/ready @@ -53,32 +55,37 @@ spec: timeoutSeconds: 1 resources: requests: - cpu: 250m + cpu: 100m memory: 512Mi limits: cpu: 700m memory: 1024Mi - name: grafana - image: grafana/grafana:8.2.6 + image: grafana/grafana:8.5.11 imagePullPolicy: IfNotPresent ports: - containerPort: 3000 name: http-grafana protocol: TCP + env: + - name: GF_SERVER_ROOT_URL + value: "http://0.0.0.0:3000/grafana/" + - name: GF_SERVER_SERVE_FROM_SUB_PATH + value: "true" readinessProbe: failureThreshold: 3 httpGet: path: /robots.txt port: 3000 scheme: HTTP - initialDelaySeconds: 5 - periodSeconds: 5 + initialDelaySeconds: 10 + periodSeconds: 30 successThreshold: 1 timeoutSeconds: 2 livenessProbe: failureThreshold: 3 - initialDelaySeconds: 5 - periodSeconds: 5 + initialDelaySeconds: 30 + periodSeconds: 10 successThreshold: 1 tcpSocket: port: 3000 @@ -100,6 +107,9 @@ spec: selector: app: webuiservice ports: - - name: http + - name: webui port: 8004 targetPort: 8004 + - name: grafana + port: 3000 + targetPort: 3000 diff --git a/my_deploy.sh b/my_deploy.sh new file mode 100755 index 0000000000000000000000000000000000000000..6f0e64afe311b8e56446caabfac6329024c207a9 --- /dev/null +++ b/my_deploy.sh @@ -0,0 +1,93 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# ----- TeraFlowSDN ------------------------------------------------------------ + +# Set the URL of the internal MicroK8s Docker registry where the images will be uploaded to. +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 load_generator" + +# Set the tag you want to use for your images. +export TFS_IMAGE_TAG="dev" + +# Set the name of the Kubernetes namespace to deploy TFS to. +export TFS_K8S_NAMESPACE="tfs" + +# Set additional manifest files to be applied after the deployment +export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml" + +# Set the new Grafana admin password +export TFS_GRAFANA_PASSWORD="admin123+" + +# Disable skip-build flag to rebuild the Docker images. +export TFS_SKIP_BUILD="" + + +# ----- CockroachDB ------------------------------------------------------------ + +# Set the namespace where CockroackDB will be deployed. +export CRDB_NAMESPACE="crdb" + +# Set the database username to be used by Context. +export CRDB_USERNAME="tfs" + +# Set the database user's password to be used by Context. +export CRDB_PASSWORD="tfs123" + +# Set the database name to be used by Context. +export CRDB_DATABASE="tfs" + +# Set CockroachDB installation mode to 'single'. This option is convenient for development and testing. +# See ./deploy/all.sh or ./deploy/crdb.sh for additional details +export CRDB_DEPLOY_MODE="single" + +# Disable flag for dropping database, if exists. +export CRDB_DROP_DATABASE_IF_EXISTS="" + +# Disable flag for re-deploying CockroachDB from scratch. +export CRDB_REDEPLOY="" + + +# ----- NATS ------------------------------------------------------------------- + +# Set the namespace where NATS will be deployed. +export NATS_NAMESPACE="nats" + +# Disable flag for re-deploying NATS from scratch. +export NATS_REDEPLOY="" + + +# ----- QuestDB ---------------------------------------------------------------- + +# If not already set, set the namespace where QuestDB will be deployed. +export QDB_NAMESPACE="qdb" + +# If not already set, set the database username to be used by Monitoring. +export QDB_USERNAME="admin" + +# If not already set, set the database user's password to be used by Monitoring. +export QDB_PASSWORD="quest" + +# If not already set, set the table name to be used by Monitoring. +export QDB_TABLE="tfs_monitoring" + +## If not already set, disable flag for dropping table if exists. +#export QDB_DROP_TABLE_IF_EXISTS="" + +# If not already set, disable flag for re-deploying QuestDB from scratch. +export QDB_REDEPLOY="" diff --git a/nfvsdn22 b/nfvsdn22 new file mode 120000 index 0000000000000000000000000000000000000000..ac93a84be42e09c11106c5e0836bb4e51cc1fa1a --- /dev/null +++ b/nfvsdn22 @@ -0,0 +1 @@ +src/tests/nfvsdn22/ \ No newline at end of file diff --git a/oeccpsc22 b/oeccpsc22 new file mode 120000 index 0000000000000000000000000000000000000000..4f55befad3e8730c8b7eb1a4cf2fbc7600d1878b --- /dev/null +++ b/oeccpsc22 @@ -0,0 +1 @@ +src/tests/oeccpsc22/ \ No newline at end of file diff --git a/proto/.gitignore b/proto/.gitignore index 79d17a55d24e501e34b462c9005e8e5429fc43ba..d1dea37b3a85abaa18b5bd65d3ec0e1d3c6fe9b6 100644 --- a/proto/.gitignore +++ b/proto/.gitignore @@ -1,2 +1,7 @@ -src/ +src/*/* + +# used to prevent breaking symbolic links from source code folders +!src/*/.gitignore +!src/python/__init__.py + uml/generated diff --git a/proto/acl.proto b/proto/acl.proto new file mode 100644 index 0000000000000000000000000000000000000000..3dba735dccf44d584a998eb02b4835bac7ceddd1 --- /dev/null +++ b/proto/acl.proto @@ -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. + +syntax = "proto3"; +package acl; + +enum AclRuleTypeEnum { + ACLRULETYPE_UNDEFINED = 0; + ACLRULETYPE_IPV4 = 1; + ACLRULETYPE_IPV6 = 2; + ACLRULETYPE_L2 = 3; + ACLRULETYPE_MPLS = 4; + ACLRULETYPE_MIXED = 5; +} + +enum AclForwardActionEnum { + ACLFORWARDINGACTION_UNDEFINED = 0; + ACLFORWARDINGACTION_DROP = 1; + ACLFORWARDINGACTION_ACCEPT = 2; + ACLFORWARDINGACTION_REJECT = 3; +} + +enum AclLogActionEnum { + ACLLOGACTION_UNDEFINED = 0; + ACLLOGACTION_NOLOG = 1; + ACLLOGACTION_SYSLOG = 2; +} + +message AclMatch { + uint32 dscp = 1; + uint32 protocol = 2; + string src_address = 3; + string dst_address = 4; + uint32 src_port = 5; + uint32 dst_port = 6; + uint32 start_mpls_label = 7; + uint32 end_mpls_label = 8; +} + +message AclAction { + AclForwardActionEnum forward_action = 1; + AclLogActionEnum log_action = 2; +} + +message AclEntry { + uint32 sequence_id = 1; + string description = 2; + AclMatch match = 3; + AclAction action = 4; +} + +message AclRuleSet { + string name = 1; + AclRuleTypeEnum type = 2; + string description = 3; + string user_id = 4; + repeated AclEntry entries = 5; +} diff --git a/proto/attack_mitigator.proto b/proto/attack_mitigator.proto index e538a9d2e62f7bc0cf91497b6b13414c36e1bc41..0ec503bda8a633f880231474d1c133eb87be5cfc 100644 --- a/proto/attack_mitigator.proto +++ b/proto/attack_mitigator.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/automation.proto b/proto/automation.proto index 02aba0a9cd3d5867a8c7f5d6581ade426ea0c290..e2dbe33223566c4065ecb0086fbd8231a56834d4 100644 --- a/proto/automation.proto +++ b/proto/automation.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,9 +21,9 @@ service AutomationService { rpc ZtpGetDeviceRole(DeviceRoleId) returns (DeviceRole) {} rpc ZtpGetDeviceRolesByDeviceId(context.DeviceId) returns (DeviceRoleList) {} rpc ZtpAdd(DeviceRole) returns (DeviceRoleState) {} - rpc ZtpUpdate(DeviceRole) returns (DeviceRoleState) {} + rpc ZtpUpdate(DeviceRoleConfig) returns (DeviceRoleState) {} rpc ZtpDelete(DeviceRole) returns (DeviceRoleState) {} - rpc ZtpDeleteAll(Empty) returns (DeviceDeletionResult) {} + rpc ZtpDeleteAll(context.Empty) returns (DeviceDeletionResult) {} } enum DeviceRoleType { @@ -43,6 +43,11 @@ message DeviceRole { DeviceRoleType devRoleType = 2; } +message DeviceRoleConfig { + DeviceRole devRole = 1; + context.DeviceConfig devConfig = 2; +} + message DeviceRoleList { repeated DeviceRole devRole = 1; } @@ -56,8 +61,6 @@ message DeviceDeletionResult { repeated string deleted = 1; } -message Empty {} - enum ZtpDeviceState { ZTP_DEV_STATE_UNDEFINED = 0; ZTP_DEV_STATE_CREATED = 1; diff --git a/proto/centralized_attack_detector.proto b/proto/centralized_attack_detector.proto index 4ce34cfa443b67aa8d060802dca6c9c29b2f7087..7b4fc35f07b079955d4c347ecf3f728abd0292f5 100644 --- a/proto/centralized_attack_detector.proto +++ b/proto/centralized_attack_detector.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/compute.proto b/proto/compute.proto index 0e7c7a7386b5c8d5924f93745bc9aa3039b60703..ecc9a075f19cef180423db350d2153638be94265 100644 --- a/proto/compute.proto +++ b/proto/compute.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/context.proto b/proto/context.proto index 057f44c9b0207651495597fcbf345c1ca1f521ca..e403c4a22f2df62f695041c094cc1c6e6a193d5f 100644 --- a/proto/context.proto +++ b/proto/context.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,50 +15,63 @@ syntax = "proto3"; package context; +import "acl.proto"; import "kpi_sample_types.proto"; service ContextService { - rpc ListContextIds (Empty ) returns ( ContextIdList ) {} - rpc ListContexts (Empty ) returns ( ContextList ) {} - rpc GetContext (ContextId ) returns ( Context ) {} - rpc SetContext (Context ) returns ( ContextId ) {} - rpc RemoveContext (ContextId ) returns ( Empty ) {} - rpc GetContextEvents (Empty ) returns (stream ContextEvent ) {} - - rpc ListTopologyIds (ContextId ) returns ( TopologyIdList ) {} - rpc ListTopologies (ContextId ) returns ( TopologyList ) {} - rpc GetTopology (TopologyId ) returns ( Topology ) {} - rpc SetTopology (Topology ) returns ( TopologyId ) {} - rpc RemoveTopology (TopologyId ) returns ( Empty ) {} - rpc GetTopologyEvents (Empty ) returns (stream TopologyEvent ) {} - - rpc ListDeviceIds (Empty ) returns ( DeviceIdList ) {} - rpc ListDevices (Empty ) returns ( DeviceList ) {} - rpc GetDevice (DeviceId ) returns ( Device ) {} - rpc SetDevice (Device ) returns ( DeviceId ) {} - rpc RemoveDevice (DeviceId ) returns ( Empty ) {} - rpc GetDeviceEvents (Empty ) returns (stream DeviceEvent ) {} - - rpc ListLinkIds (Empty ) returns ( LinkIdList ) {} - rpc ListLinks (Empty ) returns ( LinkList ) {} - rpc GetLink (LinkId ) returns ( Link ) {} - rpc SetLink (Link ) returns ( LinkId ) {} - rpc RemoveLink (LinkId ) returns ( Empty ) {} - rpc GetLinkEvents (Empty ) returns (stream LinkEvent ) {} - - rpc ListServiceIds (ContextId ) returns ( ServiceIdList ) {} - rpc ListServices (ContextId ) returns ( ServiceList ) {} - rpc GetService (ServiceId ) returns ( Service ) {} - rpc SetService (Service ) returns ( ServiceId ) {} - rpc RemoveService (ServiceId ) returns ( Empty ) {} - rpc GetServiceEvents (Empty ) returns (stream ServiceEvent ) {} - - rpc ListConnectionIds (ServiceId ) returns ( ConnectionIdList) {} - rpc ListConnections (ServiceId ) returns ( ConnectionList ) {} - rpc GetConnection (ConnectionId) returns ( Connection ) {} - rpc SetConnection (Connection ) returns ( ConnectionId ) {} - rpc RemoveConnection (ConnectionId) returns ( Empty ) {} - rpc GetConnectionEvents(Empty ) returns (stream ConnectionEvent ) {} + rpc ListContextIds (Empty ) returns ( ContextIdList ) {} + rpc ListContexts (Empty ) returns ( ContextList ) {} + rpc GetContext (ContextId ) returns ( Context ) {} + rpc SetContext (Context ) returns ( ContextId ) {} + rpc RemoveContext (ContextId ) returns ( Empty ) {} + rpc GetContextEvents (Empty ) returns (stream ContextEvent ) {} + + rpc ListTopologyIds (ContextId ) returns ( TopologyIdList ) {} + rpc ListTopologies (ContextId ) returns ( TopologyList ) {} + rpc GetTopology (TopologyId ) returns ( Topology ) {} + rpc GetTopologyDetails (TopologyId ) returns ( TopologyDetails ) {} + rpc SetTopology (Topology ) returns ( TopologyId ) {} + rpc RemoveTopology (TopologyId ) returns ( Empty ) {} + rpc GetTopologyEvents (Empty ) returns (stream TopologyEvent ) {} + + rpc ListDeviceIds (Empty ) returns ( DeviceIdList ) {} + rpc ListDevices (Empty ) returns ( DeviceList ) {} + rpc GetDevice (DeviceId ) returns ( Device ) {} + rpc SetDevice (Device ) returns ( DeviceId ) {} + rpc RemoveDevice (DeviceId ) returns ( Empty ) {} + rpc GetDeviceEvents (Empty ) returns (stream DeviceEvent ) {} + + rpc ListEndPointNames (EndPointIdList) returns ( EndPointNameList) {} + + rpc ListLinkIds (Empty ) returns ( LinkIdList ) {} + rpc ListLinks (Empty ) returns ( LinkList ) {} + rpc GetLink (LinkId ) returns ( Link ) {} + rpc SetLink (Link ) returns ( LinkId ) {} + rpc RemoveLink (LinkId ) returns ( Empty ) {} + rpc GetLinkEvents (Empty ) returns (stream LinkEvent ) {} + + rpc ListServiceIds (ContextId ) returns ( ServiceIdList ) {} + rpc ListServices (ContextId ) returns ( ServiceList ) {} + rpc GetService (ServiceId ) returns ( Service ) {} + rpc SetService (Service ) returns ( ServiceId ) {} + rpc UnsetService (Service ) returns ( ServiceId ) {} + rpc RemoveService (ServiceId ) returns ( Empty ) {} + rpc GetServiceEvents (Empty ) returns (stream ServiceEvent ) {} + + rpc ListSliceIds (ContextId ) returns ( SliceIdList ) {} + rpc ListSlices (ContextId ) returns ( SliceList ) {} + rpc GetSlice (SliceId ) returns ( Slice ) {} + rpc SetSlice (Slice ) returns ( SliceId ) {} + rpc UnsetSlice (Slice ) returns ( SliceId ) {} + rpc RemoveSlice (SliceId ) returns ( Empty ) {} + rpc GetSliceEvents (Empty ) returns (stream SliceEvent ) {} + + rpc ListConnectionIds (ServiceId ) returns ( ConnectionIdList) {} + rpc ListConnections (ServiceId ) returns ( ConnectionList ) {} + rpc GetConnection (ConnectionId ) returns ( Connection ) {} + rpc SetConnection (Connection ) returns ( ConnectionId ) {} + rpc RemoveConnection (ConnectionId ) returns ( Empty ) {} + rpc GetConnectionEvents(Empty ) returns (stream ConnectionEvent ) {} } // ----- Generic ------------------------------------------------------------------------------------------------------- @@ -75,8 +88,12 @@ enum EventTypeEnum { EVENTTYPE_REMOVE = 3; } -message Event { +message Timestamp { double timestamp = 1; +} + +message Event { + Timestamp timestamp = 1; EventTypeEnum event_type = 2; } @@ -87,9 +104,11 @@ message ContextId { message Context { ContextId context_id = 1; - repeated TopologyId topology_ids = 2; - repeated ServiceId service_ids = 3; - TeraFlowController controller = 4; + string name = 2; + repeated TopologyId topology_ids = 3; + repeated ServiceId service_ids = 4; + repeated SliceId slice_ids = 5; + TeraFlowController controller = 6; } message ContextIdList { @@ -114,8 +133,16 @@ message TopologyId { message Topology { TopologyId topology_id = 1; - repeated DeviceId device_ids = 2; - repeated LinkId link_ids = 3; + string name = 2; + repeated DeviceId device_ids = 3; + repeated LinkId link_ids = 4; +} + +message TopologyDetails { + TopologyId topology_id = 1; + string name = 2; + repeated Device devices = 3; + repeated Link links = 4; } message TopologyIdList { @@ -139,11 +166,17 @@ message DeviceId { message Device { DeviceId device_id = 1; - string device_type = 2; - DeviceConfig device_config = 3; - DeviceOperationalStatusEnum device_operational_status = 4; - repeated DeviceDriverEnum device_drivers = 5; - repeated EndPoint device_endpoints = 6; + string name = 2; + string device_type = 3; + DeviceConfig device_config = 4; + DeviceOperationalStatusEnum device_operational_status = 5; + repeated DeviceDriverEnum device_drivers = 6; + repeated EndPoint device_endpoints = 7; + repeated Component component = 8; // Used for inventory +} + +message Component { + repeated string comp_string = 1; } message DeviceConfig { @@ -157,6 +190,7 @@ enum DeviceDriverEnum { DEVICEDRIVER_P4 = 3; DEVICEDRIVER_IETF_NETWORK_TOPOLOGY = 4; DEVICEDRIVER_ONF_TR_352 = 5; + DEVICEDRIVER_XR = 6; } enum DeviceOperationalStatusEnum { @@ -176,6 +210,7 @@ message DeviceList { message DeviceEvent { Event event = 1; DeviceId device_id = 2; + DeviceConfig device_config = 3; } @@ -186,7 +221,8 @@ message LinkId { message Link { LinkId link_id = 1; - repeated EndPointId link_endpoint_ids = 2; + string name = 2; + repeated EndPointId link_endpoint_ids = 3; } message LinkIdList { @@ -211,11 +247,13 @@ message ServiceId { message Service { ServiceId service_id = 1; - ServiceTypeEnum service_type = 2; - repeated EndPointId service_endpoint_ids = 3; - repeated Constraint service_constraints = 4; - ServiceStatus service_status = 5; - ServiceConfig service_config = 6; + string name = 2; + ServiceTypeEnum service_type = 3; + repeated EndPointId service_endpoint_ids = 4; + repeated Constraint service_constraints = 5; + ServiceStatus service_status = 6; + ServiceConfig service_config = 7; + Timestamp timestamp = 8; } enum ServiceTypeEnum { @@ -230,6 +268,7 @@ enum ServiceStatusEnum { SERVICESTATUS_PLANNED = 1; SERVICESTATUS_ACTIVE = 2; SERVICESTATUS_PENDING_REMOVAL = 3; + SERVICESTATUS_SLA_VIOLATED = 4; } message ServiceStatus { @@ -253,17 +292,106 @@ message ServiceEvent { ServiceId service_id = 2; } +// ----- Slice --------------------------------------------------------------------------------------------------------- +message SliceId { + ContextId context_id = 1; + Uuid slice_uuid = 2; +} + +message Slice { + SliceId slice_id = 1; + string name = 2; + repeated EndPointId slice_endpoint_ids = 3; + repeated Constraint slice_constraints = 4; + repeated ServiceId slice_service_ids = 5; + repeated SliceId slice_subslice_ids = 6; + SliceStatus slice_status = 7; + SliceConfig slice_config = 8; + SliceOwner slice_owner = 9; + Timestamp timestamp = 10; +} + +message SliceOwner { + Uuid owner_uuid = 1; + string owner_string = 2; +} + +enum SliceStatusEnum { + SLICESTATUS_UNDEFINED = 0; + SLICESTATUS_PLANNED = 1; + SLICESTATUS_INIT = 2; + SLICESTATUS_ACTIVE = 3; + SLICESTATUS_DEINIT = 4; + SLICESTATUS_SLA_VIOLATED = 5; +} + +message SliceStatus { + SliceStatusEnum slice_status = 1; +} + +message SliceConfig { + repeated ConfigRule config_rules = 1; +} + +message SliceIdList { + repeated SliceId slice_ids = 1; +} + +message SliceList { + repeated Slice slices = 1; +} + +message SliceEvent { + Event event = 1; + SliceId slice_id = 2; +} // ----- Connection ---------------------------------------------------------------------------------------------------- message ConnectionId { Uuid connection_uuid = 1; } +message ConnectionSettings_L0 { + string lsp_symbolic_name = 1; +} + +message ConnectionSettings_L2 { + string src_mac_address = 1; + string dst_mac_address = 2; + uint32 ether_type = 3; + uint32 vlan_id = 4; + uint32 mpls_label = 5; + uint32 mpls_traffic_class = 6; +} + +message ConnectionSettings_L3 { + string src_ip_address = 1; + string dst_ip_address = 2; + uint32 dscp = 3; + uint32 protocol = 4; + uint32 ttl = 5; +} + +message ConnectionSettings_L4 { + uint32 src_port = 1; + uint32 dst_port = 2; + uint32 tcp_flags = 3; + uint32 ttl = 4; +} + +message ConnectionSettings { + ConnectionSettings_L0 l0 = 1; + ConnectionSettings_L2 l2 = 2; + ConnectionSettings_L3 l3 = 3; + ConnectionSettings_L4 l4 = 4; +} + message Connection { ConnectionId connection_id = 1; ServiceId service_id = 2; repeated EndPointId path_hops_endpoint_ids = 3; repeated ServiceId sub_service_ids = 4; + ConnectionSettings settings = 5; } message ConnectionIdList { @@ -289,31 +417,129 @@ message EndPointId { message EndPoint { EndPointId endpoint_id = 1; - string endpoint_type = 2; - repeated kpi_sample_types.KpiSampleType kpi_sample_types = 3; + string name = 2; + string endpoint_type = 3; + repeated kpi_sample_types.KpiSampleType kpi_sample_types = 4; + Location endpoint_location = 5; +} + +message EndPointName { + EndPointId endpoint_id = 1; + string device_name = 2; + string endpoint_name = 3; + string endpoint_type = 4; +} + +message EndPointIdList { + repeated EndPointId endpoint_ids = 1; +} + +message EndPointNameList { + repeated EndPointName endpoint_names = 1; } // ----- Configuration ------------------------------------------------------------------------------------------------- enum ConfigActionEnum { CONFIGACTION_UNDEFINED = 0; - CONFIGACTION_SET = 1; - CONFIGACTION_DELETE = 2; + CONFIGACTION_SET = 1; + CONFIGACTION_DELETE = 2; +} + +message ConfigRule_Custom { + string resource_key = 1; + string resource_value = 2; +} + +message ConfigRule_ACL { + EndPointId endpoint_id = 1; + acl.AclRuleSet rule_set = 2; } message ConfigRule { ConfigActionEnum action = 1; - string resource_key = 2; - string resource_value = 3; + oneof config_rule { + ConfigRule_Custom custom = 2; + ConfigRule_ACL acl = 3; + } } // ----- Constraint ---------------------------------------------------------------------------------------------------- -message Constraint { +message Constraint_Custom { string constraint_type = 1; string constraint_value = 2; } +message Constraint_Schedule { + float start_timestamp = 1; + float duration_days = 2; +} + +message GPS_Position { + float latitude = 1; + float longitude = 2; +} + +message Location { + oneof location { + string region = 1; + GPS_Position gps_position = 2; + } +} + +message Constraint_EndPointLocation { + EndPointId endpoint_id = 1; + Location location = 2; +} + +message Constraint_EndPointPriority { + EndPointId endpoint_id = 1; + uint32 priority = 2; +} + +message Constraint_SLA_Latency { + float e2e_latency_ms = 1; +} + +message Constraint_SLA_Capacity { + float capacity_gbps = 1; +} + +message Constraint_SLA_Availability { + uint32 num_disjoint_paths = 1; + bool all_active = 2; +} + +enum IsolationLevelEnum { + NO_ISOLATION = 0; + PHYSICAL_ISOLATION = 1; + LOGICAL_ISOLATION = 2; + PROCESS_ISOLATION = 3; + PHYSICAL_MEMORY_ISOLATION = 4; + PHYSICAL_NETWORK_ISOLATION = 5; + VIRTUAL_RESOURCE_ISOLATION = 6; + NETWORK_FUNCTIONS_ISOLATION = 7; + SERVICE_ISOLATION = 8; +} + +message Constraint_SLA_Isolation_level { + repeated IsolationLevelEnum isolation_level = 1; +} + +message Constraint { + oneof constraint { + Constraint_Custom custom = 1; + Constraint_Schedule schedule = 2; + Constraint_EndPointLocation endpoint_location = 3; + Constraint_EndPointPriority endpoint_priority = 4; + Constraint_SLA_Capacity sla_capacity = 5; + Constraint_SLA_Latency sla_latency = 6; + Constraint_SLA_Availability sla_availability = 7; + Constraint_SLA_Isolation_level sla_isolation = 8; + } +} + // ----- Miscellaneous ------------------------------------------------------------------------------------------------- message TeraFlowController { diff --git a/proto/context_policy.proto b/proto/context_policy.proto new file mode 100644 index 0000000000000000000000000000000000000000..f6dae48306e2ef7fe8a0682185ec46e1f2ad637e --- /dev/null +++ b/proto/context_policy.proto @@ -0,0 +1,28 @@ +// 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. + +syntax = "proto3"; +package context_policy; + +import "context.proto"; +import "policy.proto"; + +// created as a separate service to prevent import-loops in context and policy +service ContextPolicyService { + rpc ListPolicyRuleIds(context.Empty ) returns (policy.PolicyRuleIdList) {} + rpc ListPolicyRules (context.Empty ) returns (policy.PolicyRuleList ) {} + rpc GetPolicyRule (policy.PolicyRuleId ) returns (policy.PolicyRule ) {} + rpc SetPolicyRule (policy.PolicyRule ) returns (policy.PolicyRuleId ) {} + rpc RemovePolicyRule (policy.PolicyRuleId ) returns (context.Empty ) {} +} diff --git a/proto/dbscanserving.proto b/proto/dbscanserving.proto index d7d0512b6c5215f05f0c2568a0271e11f8e03a6c..21ff45dfaf2b031a24b573e45f7c21827f0b11b4 100644 --- a/proto/dbscanserving.proto +++ b/proto/dbscanserving.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/device.proto b/proto/device.proto index f41e2891a85301da445367db2cf96f9a2d97d313..30e60079db6c1eb8641d10115f6f43840eabf39c 100644 --- a/proto/device.proto +++ b/proto/device.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/distributed_cybersecurity.proto b/proto/distributed_cybersecurity.proto index 664e1383f162ee874d1ef89b0e59c70ac2ee62e1..bc95fcc3d8c89ab0d9f705c4f2e8e482920ca70c 100644 --- a/proto/distributed_cybersecurity.proto +++ b/proto/distributed_cybersecurity.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/dlt.proto b/proto/dlt.proto deleted file mode 100644 index 29a0db198313533393a8f87a1fc328c9335e0a0a..0000000000000000000000000000000000000000 --- a/proto/dlt.proto +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -// -// 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. - -//Example of topology -syntax = "proto3"; -package dlt; - -import "context.proto"; - -service DltService { - rpc RecordToDlt ( DltRecord ) returns ( RecordStatus ) {} - rpc GetFromDlt ( DltRecordId ) returns ( DltRecord ) {} - rpc SubscribeToDlt ( DltRecordSubscription ) returns ( stream DltRecord ) {} - rpc GetDltStatus ( context.Empty ) returns ( DltStatus ) {} -} - -message DltRecordSubscription { - DltRecordType type = 1; - DltRecordOperation operation = 2; -} - -enum DltRecordType { - UNKNOWN = 0; - SERVICE = 1; - DEVICE = 2; - SLICE = 3; -} - -enum DltRecordOperation { - ADD = 0; - UPDATE = 1; - DELETE = 2; -} - -message DltRecord { - DltRecordId id = 1; - DltRecordType type = 2; - DltRecordOperation operation = 3; - string json = 4; -} - -message DltRecordId { - context.Uuid id = 1; -} - -message RecordStatus { - DltRecordId id = 1; - DltRecordStatusEnum status = 2; -} - -enum DltRecordStatusEnum { - REQUESTED = 0; - STORED = 1; - DISABLED = 2; -} - - -message DltStatus { - context.TeraFlowController ctl = 1; - DltStatusEnum status = 2; -} - -enum DltStatusEnum { - NOT_AVAILABLE = 0; - INITIALIZED = 1; - AVAILABLE = 2; - DEINIT = 3; -} - - - - diff --git a/proto/dlt_connector.proto b/proto/dlt_connector.proto new file mode 100644 index 0000000000000000000000000000000000000000..3a4d11dd9eff0793fb6dee0b8efbab7bd2d04f3f --- /dev/null +++ b/proto/dlt_connector.proto @@ -0,0 +1,58 @@ +// 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. + +syntax = "proto3"; +package dlt; + +import "context.proto"; + +service DltConnectorService { + rpc RecordAll (context.TopologyId) returns (context.Empty) {} + + rpc RecordAllDevices (context.TopologyId) returns (context.Empty) {} + rpc RecordDevice (DltDeviceId ) returns (context.Empty) {} + + rpc RecordAllLinks (context.TopologyId) returns (context.Empty) {} + rpc RecordLink (DltLinkId ) returns (context.Empty) {} + + rpc RecordAllServices(context.TopologyId) returns (context.Empty) {} + rpc RecordService (DltServiceId ) returns (context.Empty) {} + + rpc RecordAllSlices (context.TopologyId) returns (context.Empty) {} + rpc RecordSlice (DltSliceId ) returns (context.Empty) {} +} + +message DltDeviceId { + context.TopologyId topology_id = 1; + context.DeviceId device_id = 2; + bool delete = 3; +} + +message DltLinkId { + context.TopologyId topology_id = 1; + context.LinkId link_id = 2; + bool delete = 3; +} + +message DltServiceId { + context.TopologyId topology_id = 1; + context.ServiceId service_id = 2; + bool delete = 3; +} + +message DltSliceId { + context.TopologyId topology_id = 1; + context.SliceId slice_id = 2; + bool delete = 3; +} diff --git a/proto/dlt_gateway.proto b/proto/dlt_gateway.proto new file mode 100644 index 0000000000000000000000000000000000000000..6ae4fbb75ea3244a01549784390ad8af010b90eb --- /dev/null +++ b/proto/dlt_gateway.proto @@ -0,0 +1,97 @@ +// 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. + +syntax = "proto3"; +package dlt; + +import "context.proto"; + +service DltGatewayService { + rpc RecordToDlt (DltRecord ) returns ( DltRecordStatus ) {} + rpc GetFromDlt (DltRecordId ) returns ( DltRecord ) {} + rpc SubscribeToDlt(DltRecordSubscription ) returns (stream DltRecordEvent ) {} + rpc GetDltStatus (context.TeraFlowController) returns ( DltPeerStatus ) {} // NEC is checking if it is possible + rpc GetDltPeers (context.Empty ) returns ( DltPeerStatusList) {} // NEC is checking if it is possible +} + +enum DltRecordTypeEnum { + DLTRECORDTYPE_UNDEFINED = 0; + DLTRECORDTYPE_CONTEXT = 1; + DLTRECORDTYPE_TOPOLOGY = 2; + DLTRECORDTYPE_DEVICE = 3; + DLTRECORDTYPE_LINK = 4; + DLTRECORDTYPE_SERVICE = 5; + DLTRECORDTYPE_SLICE = 6; +} + +enum DltRecordOperationEnum { + DLTRECORDOPERATION_UNDEFINED = 0; + DLTRECORDOPERATION_ADD = 1; + DLTRECORDOPERATION_UPDATE = 2; + DLTRECORDOPERATION_DELETE = 3; +} + +enum DltRecordStatusEnum { + DLTRECORDSTATUS_UNDEFINED = 0; + DLTRECORDSTATUS_SUCCEEDED = 1; + DLTRECORDSTATUS_FAILED = 2; +} + +enum DltStatusEnum { + DLTSTATUS_UNDEFINED = 0; + DLTSTATUS_NOTAVAILABLE = 1; + DLTSTATUS_INITIALIZED = 2; + DLTSTATUS_AVAILABLE = 3; + DLTSTATUS_DEINIT = 4; +} + +message DltRecordId { + context.Uuid domain_uuid = 1; // unique identifier of domain owning the record + DltRecordTypeEnum type = 2; // type of record + context.Uuid record_uuid = 3; // unique identifier of the record within the domain context_uuid/topology_uuid +} + +message DltRecord { + DltRecordId record_id = 1; // record identifier + DltRecordOperationEnum operation = 2; // operation to be performed over the record + string data_json = 3; // record content: JSON-encoded record content +} + +message DltRecordSubscription { + // retrieved events have to match ALL conditions. + // i.e., type in types requested, AND operation in operations requested + // TODO: consider adding a more sophisticated filtering + repeated DltRecordTypeEnum type = 1; // selected event types, empty=all + repeated DltRecordOperationEnum operation = 2; // selected event operations, empty=all +} + +message DltRecordEvent { + context.Event event = 1; // common event data (timestamp & event_type) + DltRecordId record_id = 2; // record identifier associated with this event +} + +message DltRecordStatus { + DltRecordId record_id = 1; // identifier of the associated record + DltRecordStatusEnum status = 2; // status of the record + string error_message = 3; // error message in case of failure, empty otherwise +} + +message DltPeerStatus { + context.TeraFlowController controller = 1; // Identifier of the TeraFlow controller instance + DltStatusEnum status = 2; // Status of the TeraFlow controller instance +} + +message DltPeerStatusList { + repeated DltPeerStatus peers = 1; // List of peers and their status +} diff --git a/proto/forecaster.proto b/proto/forecaster.proto new file mode 100644 index 0000000000000000000000000000000000000000..5a4403b01c7f85d6d5b33548d0eaf463e39558cc --- /dev/null +++ b/proto/forecaster.proto @@ -0,0 +1,45 @@ +// 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. + +syntax = "proto3"; +package forecaster; + +import "context.proto"; + +service ForecasterService { + rpc GetForecastOfTopology (context.TopologyId) returns (Forecast) {} + rpc GetForecastOfLink(context.LinkId) returns (Forecast) {} + rpc CheckService (context.ServiceId) returns (ForecastPrediction) {} +} + +message SingleForecast { + context.Timestamp timestamp= 1; + double value = 2; +} + +message Forecast { + oneof uuid { + context.TopologyId topologyId= 1; + context.LinkId linkId = 2; + } + repeated SingleForecast forecast = 3; +} + +enum AvailabilityPredictionEnum { + FORECASTED_AVAILABILITY = 0; + FORECASTED_UNAVAILABILITY = 1; +} +message ForecastPrediction { + AvailabilityPredictionEnum prediction = 1; +} diff --git a/proto/generate_code_python.sh b/proto/generate_code_python.sh new file mode 100755 index 0000000000000000000000000000000000000000..5c5db5444d3ef31570019abbcd7eab4f1a305a48 --- /dev/null +++ b/proto/generate_code_python.sh @@ -0,0 +1,42 @@ +#!/bin/bash -eu +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Make folder containing the script the root folder for its execution +cd $(dirname $0) + +mkdir -p src/python +rm -rf src/python/*.py + +tee src/python/__init__.py << EOF > /dev/null +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +EOF + +# Generate Python code +python3 -m grpc_tools.protoc -I=./ --python_out=src/python/ --grpc_python_out=src/python/ *.proto + +# Arrange generated code imports to enable imports from arbitrary subpackages +find src/python -type f -iname *.py -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; diff --git a/proto/compile.sh b/proto/generate_uml.sh similarity index 82% rename from proto/compile.sh rename to proto/generate_uml.sh index 520ead69a95cdfd1a076aee221d672f81810b5f0..8bdd76ac5d504c7a93a997dd37092c749051bf3b 100755 --- a/proto/compile.sh +++ b/proto/generate_uml.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,12 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -python3 -m grpc_tools.protoc -I=./ --python_out=../src/ --grpc_python_out=../src/ *.proto #requires installation of protoc-gen-uml export PATH=${HOME}/protoc-gen-uml/target/universal/stage/bin:$PATH protoc --uml_out=uml/ -I ./ *.proto cd uml java -jar plantuml.7997.jar *.puml rm *.puml - - diff --git a/proto/health.proto b/proto/health.proto index 0252f5d877343864a75ff641d4a019e7cb6de499..f3057a7e72f9b37b4ad084dd72a5670c18355354 100644 --- a/proto/health.proto +++ b/proto/health.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/interdomain.proto b/proto/interdomain.proto index 7088586e27bad7cd241f0ca17353e621144073e9..3e44fb4477c400e8ca278bda38a7af6d142cebe0 100644 --- a/proto/interdomain.proto +++ b/proto/interdomain.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,23 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -//Example of topology syntax = "proto3"; package interdomain; import "context.proto"; -import "slice.proto"; service InterdomainService { - rpc Authenticate (context.TeraFlowController) returns (context.AuthenticationResult) {} - rpc LookUpSlice(slice.TransportSlice) returns (slice.SliceId) {} //Slice component or from interdomain component - rpc OrderSliceFromCatalog(slice.TransportSlice) returns (slice.SliceStatus) {} - rpc CreateSliceAndAddToCatalog(slice.TransportSlice) returns (slice.SliceStatus) {} + rpc Authenticate (context.TeraFlowController) returns (context.AuthenticationResult) {} // Deprecated + rpc RequestSlice (context.Slice ) returns (context.SliceId ) {} + rpc LookUpSlice (context.Slice ) returns (context.SliceId ) {} + rpc OrderSliceFromCatalog (context.Slice ) returns (context.Slice ) {} + rpc CreateSliceAndAddToCatalog(context.Slice ) returns (context.Slice ) {} + rpc OrderSliceWithSLA (context.Slice) returns (context.SliceId) {} // If slice with SLA already exists, returns slice. If not, it creates it. + rpc UpdateSlice (context.Slice ) returns (context.Slice ) {} } - - - - - - - diff --git a/proto/kpi_sample_types.proto b/proto/kpi_sample_types.proto index 7445a0f25a57df9793bd8761da024581988cf9e6..1ade4d69bf5a6c23d993cd37ed731eee10d7374e 100644 --- a/proto/kpi_sample_types.proto +++ b/proto/kpi_sample_types.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,9 +16,19 @@ syntax = "proto3"; package kpi_sample_types; enum KpiSampleType { - KPISAMPLETYPE_UNKNOWN = 0; - KPISAMPLETYPE_PACKETS_TRANSMITTED = 101; - KPISAMPLETYPE_PACKETS_RECEIVED = 102; - KPISAMPLETYPE_BYTES_TRANSMITTED = 201; - KPISAMPLETYPE_BYTES_RECEIVED = 202; + KPISAMPLETYPE_UNKNOWN = 0; + KPISAMPLETYPE_PACKETS_TRANSMITTED = 101; + KPISAMPLETYPE_PACKETS_RECEIVED = 102; + KPISAMPLETYPE_PACKETS_DROPPED = 103; + KPISAMPLETYPE_BYTES_TRANSMITTED = 201; + KPISAMPLETYPE_BYTES_RECEIVED = 202; + KPISAMPLETYPE_BYTES_DROPPED = 203; + KPISAMPLETYPE_ML_CONFIDENCE = 401; //. can be used by both optical and L3 without any issue + KPISAMPLETYPE_OPTICAL_SECURITY_STATUS = 501; //. can be used by both optical and L3 without any issue + KPISAMPLETYPE_L3_UNIQUE_ATTACK_CONNS = 601; + KPISAMPLETYPE_L3_TOTAL_DROPPED_PACKTS = 602; + KPISAMPLETYPE_L3_UNIQUE_ATTACKERS = 603; + KPISAMPLETYPE_L3_UNIQUE_COMPROMISED_CLIENTS = 604; + KPISAMPLETYPE_L3_SECURITY_STATUS_CRYPTO = 605; + KPISAMPLETYPE_SERVICE_LATENCY_MS = 701; } diff --git a/proto/l3_attackmitigator.proto b/proto/l3_attackmitigator.proto index 39333718a5904d1617ba827d35149687ff903b65..5ce9428b6f47318cf4bdd205c48645295ff26d71 100644 --- a/proto/l3_attackmitigator.proto +++ b/proto/l3_attackmitigator.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/l3_centralizedattackdetector.proto b/proto/l3_centralizedattackdetector.proto index 3cb1b0991b1dc4df2c268d511c0ebd6f9f9d80aa..2aeb8826e8662b6495f10a333145a9f6abe594b9 100644 --- a/proto/l3_centralizedattackdetector.proto +++ b/proto/l3_centralizedattackdetector.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/load_generator.proto b/proto/load_generator.proto new file mode 100644 index 0000000000000000000000000000000000000000..98f6eefda88db7abac4651857326952789a879ba --- /dev/null +++ b/proto/load_generator.proto @@ -0,0 +1,23 @@ +// 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. + +syntax = "proto3"; +package load_generator; + +import "context.proto"; + +service LoadGeneratorService { + rpc Start(context.Empty) returns (context.Empty) {} + rpc Stop (context.Empty) returns (context.Empty) {} +} diff --git a/proto/monitoring.proto b/proto/monitoring.proto index 293eb982a758e9869d8310134bd65bca6c8dfd32..3862973e056d6267d8defc68e77cbf3c8a10ebee 100644 --- a/proto/monitoring.proto +++ b/proto/monitoring.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,27 +19,66 @@ import "context.proto"; import "kpi_sample_types.proto"; service MonitoringService { - rpc CreateKpi (KpiDescriptor ) returns (KpiId ) {} - rpc GetKpiDescriptor(KpiId ) returns (KpiDescriptor) {} - rpc IncludeKpi (Kpi ) returns (context.Empty) {} - rpc MonitorKpi (MonitorKpiRequest) returns (context.Empty) {} - rpc GetStreamKpi (KpiId ) returns (stream Kpi ) {} - rpc GetInstantKpi (KpiId ) returns (Kpi ) {} + rpc SetKpi (KpiDescriptor ) returns (KpiId ) {} // Stable not final + rpc DeleteKpi (KpiId ) returns (context.Empty ) {} // Stable and final + rpc GetKpiDescriptor (KpiId ) returns (KpiDescriptor ) {} // Stable and final + rpc GetKpiDescriptorList (context.Empty ) returns (KpiDescriptorList ) {} // Stable and final + rpc IncludeKpi (Kpi ) returns (context.Empty ) {} // Stable and final + rpc MonitorKpi (MonitorKpiRequest ) returns (context.Empty ) {} // Stable and final + rpc QueryKpiData (KpiQuery ) returns (RawKpiTable ) {} // Not implemented + rpc SetKpiSubscription (SubsDescriptor ) returns (stream SubsResponse ) {} // Stable not final + rpc GetSubsDescriptor (SubscriptionID ) returns (SubsDescriptor ) {} // Stable and final + rpc GetSubscriptions (context.Empty ) returns (SubsList ) {} // Stable and final + rpc DeleteSubscription (SubscriptionID ) returns (context.Empty ) {} // Stable and final + rpc SetKpiAlarm (AlarmDescriptor ) returns (AlarmID ) {} // Stable not final + rpc GetAlarms (context.Empty ) returns (AlarmList ) {} // Stable and final + rpc GetAlarmDescriptor (AlarmID ) returns (AlarmDescriptor ) {} // Stable and final + rpc GetAlarmResponseStream(AlarmSubscription ) returns (stream AlarmResponse) {} // Not Stable not final + rpc DeleteAlarm (AlarmID ) returns (context.Empty ) {} // Stable and final + rpc GetStreamKpi (KpiId ) returns (stream Kpi ) {} // Stable not final + rpc GetInstantKpi (KpiId ) returns (Kpi ) {} // Stable not final } message KpiDescriptor { - string kpi_description = 1; - kpi_sample_types.KpiSampleType kpi_sample_type = 2; - context.DeviceId device_id = 3; - context.EndPointId endpoint_id = 4; - context.ServiceId service_id = 5; -// context.SliceId slice_id = 6; + KpiId kpi_id = 1; + string kpi_description = 2; + repeated KpiId kpi_id_list = 3; + kpi_sample_types.KpiSampleType kpi_sample_type = 4; + context.DeviceId device_id = 5; + context.EndPointId endpoint_id = 6; + context.ServiceId service_id = 7; + context.SliceId slice_id = 8; + context.ConnectionId connection_id = 9; } -message MonitorKpiRequest{ - KpiId kpi_id = 1; - float sampling_duration_s = 2; - float sampling_interval_s = 3; +message MonitorKpiRequest { + KpiId kpi_id = 1; + float monitoring_window_s = 2; + float sampling_rate_s = 3; + // Pending add field to reflect Available Device Protocols +} + +message KpiQuery { + repeated KpiId kpi_ids = 1; + float monitoring_window_s = 2; + uint32 last_n_samples = 3; // used when you want something like "get the last N many samples + context.Timestamp start_timestamp = 4; // used when you want something like "get the samples since X date/time" + context.Timestamp end_timestamp = 5; // used when you want something like "get the samples until X date/time" +} + + +message RawKpi { // cell + context.Timestamp timestamp = 1; + KpiValue kpi_value = 2; +} + +message RawKpiList { // column + KpiId kpi_id = 1; + repeated RawKpi raw_kpis = 2; +} + +message RawKpiTable { // table + repeated RawKpiList raw_kpi_lists = 1; } message KpiId { @@ -47,20 +86,88 @@ message KpiId { } message Kpi { - KpiId kpi_id = 1; - string timestamp = 2; - KpiValue kpi_value = 4; + KpiId kpi_id = 1; + context.Timestamp timestamp = 2; + KpiValue kpi_value = 3; +} + +message KpiValueRange { + KpiValue kpiMinValue = 1; + KpiValue kpiMaxValue = 2; + bool inRange = 3; // by default True + bool includeMinValue = 4; // False is outside the interval + bool includeMaxValue = 5; // False is outside the interval } message KpiValue { oneof value { - uint32 intVal = 1; - float floatVal = 2; - string stringVal = 3; - bool boolVal = 4; + int32 int32Val = 1; + uint32 uint32Val = 2; + int64 int64Val = 3; + uint64 uint64Val = 4; + float floatVal = 5; + string stringVal = 6; + bool boolVal = 7; } } + message KpiList { - repeated Kpi kpi_list = 1; + repeated Kpi kpi = 1; +} + +message KpiDescriptorList { + repeated KpiDescriptor kpi_descriptor_list = 1; +} + +message SubsDescriptor{ + SubscriptionID subs_id = 1; + KpiId kpi_id = 2; + float sampling_duration_s = 3; + float sampling_interval_s = 4; + context.Timestamp start_timestamp = 5; // used when you want something like "get the samples since X date/time" + context.Timestamp end_timestamp = 6; // used when you want something like "get the samples until X date/time" + // Pending add field to reflect Available Device Protocols +} + +message SubscriptionID { + context.Uuid subs_id = 1; +} + +message SubsResponse { + SubscriptionID subs_id = 1; + KpiList kpi_list = 2; +} + +message SubsList { + repeated SubsDescriptor subs_descriptor = 1; +} + +message AlarmDescriptor { + AlarmID alarm_id = 1; + string alarm_description = 2; + string name = 3; + KpiId kpi_id = 4; + KpiValueRange kpi_value_range = 5; + context.Timestamp timestamp = 6; +} + +message AlarmID{ + context.Uuid alarm_id = 1; +} + +message AlarmSubscription{ + AlarmID alarm_id = 1; + float subscription_timeout_s = 2; + float subscription_frequency_ms = 3; +} + +message AlarmResponse { + AlarmID alarm_id = 1; + string text = 2; + KpiList kpi_list = 3; +} + +message AlarmList { + repeated AlarmDescriptor alarm_descriptor = 1; } diff --git a/proto/optical_attack_mitigator.proto b/proto/optical_attack_mitigator.proto index 881f9fde375bb67b0362ca634ad84b45fb60220b..1dbb4e19a62f39dfcf85312ce3cb99472467993d 100644 --- a/proto/optical_attack_mitigator.proto +++ b/proto/optical_attack_mitigator.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/optical_centralized_attack_detector.proto b/proto/optical_centralized_attack_detector.proto index d480054f2ca3b1cf32cbb40c51df51c562f9b4d5..98ffeddc81c7533fccfd118075732a3f7799264f 100644 --- a/proto/optical_centralized_attack_detector.proto +++ b/proto/optical_centralized_attack_detector.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/pathcomp.proto b/proto/pathcomp.proto new file mode 100644 index 0000000000000000000000000000000000000000..181f05cc288b8c739eb55315868a4fbbe79702f3 --- /dev/null +++ b/proto/pathcomp.proto @@ -0,0 +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. + +syntax = "proto3"; +package pathcomp; + +import "context.proto"; + +service PathCompService { + rpc Compute(PathCompRequest) returns (PathCompReply) {} +} + +message Algorithm_ShortestPath {} + +message Algorithm_KShortestPath { + uint32 k_inspection = 1; + uint32 k_return = 2; +} + +message Algorithm_KDisjointPath { + uint32 num_disjoint = 1; +} + +message PathCompRequest { + repeated context.Service services = 1; + oneof algorithm { + Algorithm_ShortestPath shortest_path = 10; + Algorithm_KShortestPath k_shortest_path = 11; + Algorithm_KDisjointPath k_disjoint_path = 12; + } +} + +message PathCompReply { + // Services requested completed with possible missing fields, and + // sub-services required for supporting requested services on the + // underlying layers. + repeated context.Service services = 1; + + // Connections supporting the requested services and sub-services + // required for the underlying layers. + repeated context.Connection connections = 2; +} diff --git a/proto/policy.proto b/proto/policy.proto index 447eda2e19188a39a1980181d3018a25ed9f83c7..a6f16015035096c6baf13a7b4e707c06e9ab1727 100644 --- a/proto/policy.proto +++ b/proto/policy.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,25 +16,32 @@ syntax = "proto3"; package policy; import "context.proto"; +import "policy_condition.proto"; +import "policy_action.proto"; service PolicyService { - rpc PolicyAdd (PolicyRule) returns (PolicyRuleState) {} - rpc PolicyUpdate (PolicyRule) returns (PolicyRuleState) {} - rpc PolicyDelete (PolicyRule) returns (PolicyRuleState) {} - rpc GetPolicy (PolicyRuleId) returns (PolicyRule) {} - rpc GetPolicyByDeviceId (context.DeviceId) returns (PolicyRuleList) {} - rpc GetPolicyByServiceId (context.ServiceId) returns (PolicyRuleList) {} + rpc PolicyAddService (PolicyRuleService) returns (PolicyRuleState) {} + rpc PolicyAddDevice (PolicyRuleDevice) returns (PolicyRuleState) {} + rpc PolicyUpdateService (PolicyRuleService) returns (PolicyRuleState) {} + rpc PolicyUpdateDevice (PolicyRuleDevice) returns (PolicyRuleState) {} + rpc PolicyDelete (PolicyRuleId) returns (PolicyRuleState) {} + rpc GetPolicyService (PolicyRuleId) returns (PolicyRuleService) {} + rpc GetPolicyDevice (PolicyRuleId) returns (PolicyRuleDevice) {} + rpc GetPolicyByServiceId (context.ServiceId) returns (PolicyRuleServiceList) {} } -enum RuleState { - POLICY_INACTIVE = 0; // Rule is currently inactive - POLICY_PLANNED = 1; // Rule installation planned - POLICY_ACTIVE = 2; // Rule is currently active -} - -enum PolicyRuleType { - POLICYTYPE_DEVICE = 0; // Device-level - POLICYTYPE_NETWORK = 1; // Network-wide +enum PolicyRuleStateEnum { + POLICY_UNDEFINED = 0; // Undefined rule state + POLICY_FAILED = 1; // Rule failed + POLICY_INSERTED = 2; // Rule is just inserted + POLICY_VALIDATED = 3; // Rule content is correct + POLICY_PROVISIONED = 4; // Rule subscribed to Monitoring + POLICY_ACTIVE = 5; // Rule is currently active (alarm is just thrown by Monitoring) + POLICY_ENFORCED = 6; // Rule action is successfully enforced + POLICY_INEFFECTIVE = 7; // The applied rule action did not work as expected + POLICY_EFFECTIVE = 8; // The applied rule action did work as expected + POLICY_UPDATED = 9; // Operator requires a policy to change + POLICY_REMOVED = 10; // Operator requires to remove a policy } message PolicyRuleId { @@ -42,58 +49,65 @@ message PolicyRuleId { } message PolicyRuleState { - context.Uuid policyRuleId = 1; - RuleState policyRuleState = 2; + PolicyRuleStateEnum policyRuleState = 1; + string policyRuleStateMessage = 2; } -message PolicyRuleVariable { - string policyRuleVariable = 1; -} +// Basic policy rule attributes +message PolicyRuleBasic { + PolicyRuleId policyRuleId = 1; + PolicyRuleState policyRuleState = 2; //policy.proto:58:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default. + uint32 priority = 3; -message PolicyRuleValue { - string policyRuleValue = 1; + // Event-Condition-Action (ECA) model + repeated PolicyRuleCondition conditionList = 4; // When these policy conditions are met, an event is automatically thrown + BooleanOperator booleanOperator = 5; // Evaluation operator to be used + repeated PolicyRuleAction actionList = 6; // One or more actions should be applied } -// IETF draft: Framework for Use of ECA (Event Condition Action) in Network Self Management -// Source: https://datatracker.ietf.org/doc/draft-bwd-netmod-eca-framework/ -// Event -message PolicyRuleEvent { - context.Event event = 1; -} +// Service-oriented policy rule +message PolicyRuleService { + // Basic policy rule attributes + PolicyRuleBasic policyRuleBasic = 1; -// Condition -message PolicyRuleCondition { - PolicyRuleVariable polRuleConditionVar = 1; - PolicyRuleValue polRuleConditionVal = 2; + // Affected service and (some of) its device(s) + context.ServiceId serviceId = 2; + repeated context.DeviceId deviceList = 3; // List of devices this service is traversing (not exhaustive) } -// Action -message PolicyRuleAction { - PolicyRuleVariable polRuleActionVar = 1; - PolicyRuleValue polRuleActionVal = 2; +// Device-oriented policy rule +message PolicyRuleDevice { + // Basic policy rule attributes + PolicyRuleBasic policyRuleBasic = 1; + + // Affected device(s) + repeated context.DeviceId deviceList = 2; } -// Policy rule partially complies with IETF’s: -// RFC 3060: https://datatracker.ietf.org/doc/html/rfc3060 -// RFC 3460: https://datatracker.ietf.org/doc/html/rfc3460 -// Enhanced with a policy rule event according to the ECA model +// Wrapper policy rule object message PolicyRule { - // Basic policy rule attributes - PolicyRuleId policyRuleId = 1; - PolicyRuleType policyRuleType = 2; - uint32 PolicyRulePriority = 3; + oneof policy_rule { + PolicyRuleService service = 1; + PolicyRuleDevice device = 2; + } +} - // Event-Condition-Action model - PolicyRuleEvent event = 4; // A single event triggers the policy - repeated PolicyRuleCondition polRuleConditionList = 5; // One or more conditions must be met - repeated PolicyRuleAction polRuleActionList = 6; // One or more actions should be applied +// A list of policy rule IDs +message PolicyRuleIdList { + repeated PolicyRuleId policyRuleIdList = 1; +} + +// A list of service-oriented policy rules +message PolicyRuleServiceList { + repeated PolicyRuleService policyRuleServiceList = 1; +} - // Affected services and devices - repeated context.ServiceId serviceList = 7; - repeated context.DeviceId deviceList = 8; +// A list of device-oriented policy rules +message PolicyRuleDeviceList { + repeated PolicyRuleDevice policyRuleDeviceList = 1; } // A list of policy rules message PolicyRuleList { - repeated PolicyRule policyRuleList = 1; + repeated PolicyRule policyRules = 1; } diff --git a/proto/policy_action.proto b/proto/policy_action.proto new file mode 100644 index 0000000000000000000000000000000000000000..17dd721196c0ed407849aa23099477ea34d39ddd --- /dev/null +++ b/proto/policy_action.proto @@ -0,0 +1,40 @@ +// 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. + +syntax = "proto3"; +package policy; + +// Action +message PolicyRuleAction { + PolicyRuleActionEnum action = 1; + repeated PolicyRuleActionConfig action_config = 2; +} + +enum PolicyRuleActionEnum { + POLICYRULE_ACTION_NO_ACTION = 0; + POLICYRULE_ACTION_SET_DEVICE_STATUS = 1; + POLICYRULE_ACTION_ADD_SERVICE_CONFIGRULE = 2; + POLICYRULE_ACTION_ADD_SERVICE_CONSTRAINT = 3; +} + +// Action configuration +message PolicyRuleActionConfig { + string action_key = 1; + string action_value = 2; +} + +// message PolicyRuleAction { +// PolicyRuleActionEnum action = 1; +// repeated string parameters = 2; +// } \ No newline at end of file diff --git a/proto/policy_condition.proto b/proto/policy_condition.proto new file mode 100644 index 0000000000000000000000000000000000000000..2037af93c375838209e78a07ec95e25d469d1d5a --- /dev/null +++ b/proto/policy_condition.proto @@ -0,0 +1,43 @@ +// 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. + +syntax = "proto3"; +package policy; + +import "monitoring.proto"; + +// Condition +message PolicyRuleCondition { + monitoring.KpiId kpiId = 1; + NumericalOperator numericalOperator = 2; + monitoring.KpiValue kpiValue = 3; +} + +// Operator to be used when comparing Kpis with condition values +enum NumericalOperator { + POLICYRULE_CONDITION_NUMERICAL_UNDEFINED = 0; // Kpi numerical operator undefined + POLICYRULE_CONDITION_NUMERICAL_EQUAL = 1; // Kpi is equal with value + POLICYRULE_CONDITION_NUMERICAL_NOT_EQUAL = 2; // Kpi is not equal with value + POLICYRULE_CONDITION_NUMERICAL_LESS_THAN = 3; // Kpi is less than value + POLICYRULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL = 4; // Kpi is less than or equal with value + POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN = 5; // Kpi is greater than value + POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL = 6; // Kpi is less than or equal with value +} + +// Operator to be used when evaluating each condition +enum BooleanOperator { + POLICYRULE_CONDITION_BOOLEAN_UNDEFINED = 0; // Boolean operator undefined + POLICYRULE_CONDITION_BOOLEAN_AND = 1; // Boolean AND operator + POLICYRULE_CONDITION_BOOLEAN_OR = 2; // Boolean OR operator +} \ No newline at end of file diff --git a/proto/service.proto b/proto/service.proto index 90a2f2ecf32dcda0366281224d31725fb4f95622..21e5699413cc4842962af6ee9c204b383fc61ec0 100644 --- a/proto/service.proto +++ b/proto/service.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/proto/slice.proto b/proto/slice.proto index 73e945a40aa2e23d1780045600df2e3c794333f8..cad483c0fddb1000adeee7756a939fe5a3c3cbb7 100644 --- a/proto/slice.proto +++ b/proto/slice.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,43 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -//Example of topology syntax = "proto3"; package slice; import "context.proto"; service SliceService { - rpc CreateUpdateSlice (TransportSlice) returns (SliceStatus) {} - rpc DeleteSlice (TransportSlice) returns (context.Empty) {} -} - -message SliceEndpoint { - context.EndPoint port_id = 1; -} - -message TransportSlice { - SliceId slice_id = 1; - repeated slice.SliceEndpoint endpoints = 2; - repeated context.Constraint constraints = 3; - repeated context.ServiceId services = 4; - repeated SliceId subSlicesId = 5; - SliceStatus status = 6; -} - -message SliceId { - context.ContextId contextId = 1; - context.Uuid slice_id = 2; -} - -message SliceStatus { - slice.SliceId slice_id = 1; - SliceStatusEnum status = 2; -} - -enum SliceStatusEnum { - PLANNED = 0; - INIT = 1; - ACTIVE = 2; - DEINIT = 3; + rpc CreateSlice(context.Slice ) returns (context.SliceId) {} + rpc UpdateSlice(context.Slice ) returns (context.SliceId) {} + rpc DeleteSlice(context.SliceId) returns (context.Empty ) {} + rpc OrderSliceWithSLA(context.Slice) returns (context.SliceId) {} // If slice with SLA already exists, returns slice. If not, it creates it. + rpc RunSliceGrouping (context.Empty) returns (context.Empty) {} // Optimizes the underlying services and re-maps them to the requested slices. } diff --git a/proto/src/java/.gitignore b/proto/src/java/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..377ccd3fdffacc5b8e7260cff64905faf5e472f2 --- /dev/null +++ b/proto/src/java/.gitignore @@ -0,0 +1,2 @@ +* +!.gitkeep diff --git a/proto/src/java/.gitkeep b/proto/src/java/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/proto/src/python/.gitignore b/proto/src/python/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..53b5ddc0011f758f564b7560108243b5d5b02d0c --- /dev/null +++ b/proto/src/python/.gitignore @@ -0,0 +1,5 @@ +* +!.gitkeep + +# prevent breaking symbolic links on Python source code folders +!__init__.py diff --git a/proto/src/python/.gitkeep b/proto/src/python/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/proto/src/python/__init__.py b/proto/src/python/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf --- /dev/null +++ b/proto/src/python/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/proto/te.proto b/proto/te.proto index f811f86fed64220cd98d1d8439cca5af3dd8548a..983f6602b8cb961404843812e069348a2530dd73 100644 --- a/proto/te.proto +++ b/proto/te.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,10 +16,9 @@ syntax = "proto3"; package te; import "context.proto"; -import "service.proto"; service TEService { - rpc RequestLSP(service.Service ) returns (service.ServiceState) {} - rpc UpdateLSP (service.ServiceId) returns (service.ServiceState) {} - rpc DeleteLSP (service.ServiceId) returns (context.Empty ) {} + rpc RequestLSP(context.Service ) returns (context.ServiceStatus) {} + rpc UpdateLSP (context.ServiceId) returns (context.ServiceStatus) {} + rpc DeleteLSP (context.ServiceId) returns (context.Empty ) {} } diff --git a/proto/uml/acl.png b/proto/uml/acl.png new file mode 100644 index 0000000000000000000000000000000000000000..3cc4e0f9decb0ecac761c6ab971ecdb80890a4b4 Binary files /dev/null and b/proto/uml/acl.png differ diff --git a/proto/uml/context.png b/proto/uml/context.png index 57a2493cf8596d1f4e70f2e3056d1a9d71432aee..3ea3a6e21dd3eddba749c2f0b483d41b365ef11f 100644 Binary files a/proto/uml/context.png and b/proto/uml/context.png differ diff --git a/proto/uml/dlt.png b/proto/uml/dlt.png index 51988d55b4e63230ff62e647f1b52e5f9418ad25..f8d4e25c1881a932c49bf151eab56921a4ff8a7b 100644 Binary files a/proto/uml/dlt.png and b/proto/uml/dlt.png differ diff --git a/proto/uml/forecaster.png b/proto/uml/forecaster.png new file mode 100644 index 0000000000000000000000000000000000000000..d32e142959ca0060556ce6ce622552dc5ff4d416 Binary files /dev/null and b/proto/uml/forecaster.png differ diff --git a/proto/uml/monitoring.png b/proto/uml/monitoring.png index 676389fc6971457b3d0c4194484bb78b4be52404..4257b4d3f4b570fa9c51734480bd8c73e8c72622 100644 Binary files a/proto/uml/monitoring.png and b/proto/uml/monitoring.png differ diff --git a/proto/uml/pathcomp.png b/proto/uml/pathcomp.png new file mode 100644 index 0000000000000000000000000000000000000000..bd14fe5235febb43b24ffc52291696edc65c4e99 Binary files /dev/null and b/proto/uml/pathcomp.png differ diff --git a/proto/uml/policy.png b/proto/uml/policy.png index e4f5c52848b75643c3a8272fb0223147bced5b90..845a1e883223d7588ab20afabf559067cdc27454 100644 Binary files a/proto/uml/policy.png and b/proto/uml/policy.png differ diff --git a/proto/uml/slice.png b/proto/uml/slice.png deleted file mode 100644 index 01b62425b28f6bb5319a96ddd7fc5b62ff620620..0000000000000000000000000000000000000000 Binary files a/proto/uml/slice.png and /dev/null differ diff --git a/run_tests_docker.sh b/run_tests_docker.sh new file mode 100755 index 0000000000000000000000000000000000000000..d27c4e7d8a36f89b3b0b72e9c5725c80b520141f --- /dev/null +++ b/run_tests_docker.sh @@ -0,0 +1,73 @@ +#!/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. + + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# Set the URL of your local Docker registry where the images will be uploaded to. Leave it blank if you do not want to +# use any Docker registry. +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" + +# Set the tag you want to use for your images. +IMAGE_TAG="tf-dev" + +# Constants +TMP_FOLDER="./tmp" + +TMP_LOGS_FOLDER="$TMP_FOLDER/logs" +mkdir -p $TMP_LOGS_FOLDER + +for COMPONENT in $COMPONENTS; do + echo "Processing '$COMPONENT' component..." + IMAGE_NAME="$COMPONENT:$IMAGE_TAG" + IMAGE_URL="$REGISTRY_IMAGE/$IMAGE_NAME" + + echo " Building Docker image..." + BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log" + + if [ "$COMPONENT" == "automation" ] || [ "$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" + fi + + if [ -n "$REGISTRY_IMAGE" ]; then + echo "Pushing Docker image to '$REGISTRY_IMAGE'..." + + TAG_LOG="$TMP_LOGS_FOLDER/tag_${COMPONENT}.log" + docker tag "$IMAGE_NAME" "$IMAGE_URL" > "$TAG_LOG" + + PUSH_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}.log" + docker push "$IMAGE_URL" > "$PUSH_LOG" + fi +done + +echo "Preparing for running the tests..." + +if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi + +for COMPONENT in $COMPONENTS; do + IMAGE_NAME="$COMPONENT:$IMAGE_TAG" + echo " Running tests for $COMPONENT:" + docker run -it -d --name $COMPONENT $IMAGE_NAME --network=teraflowbridge + docker exec -it $COMPONENT bash -c "pytest --log-level=DEBUG --verbose $COMPONENT/tests/test_unitary.py" + docker stop $COMPONENT +done diff --git a/scripts/add_license_header_to_files.sh b/scripts/add_license_header_to_files.sh index 4da23894414cfc57cda9ea1277e144f8e7244056..4c11fc316484b2c8f02677337bacf09197ee12b7 100755 --- a/scripts/add_license_header_to_files.sh +++ b/scripts/add_license_header_to_files.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -26,6 +26,5 @@ docker run -it -v ${PWD}:/src ghcr.io/google/addlicense \ -ignore "src/**/target/generated-sources/grpc/*" -ignore "src/**/target/generated-sources/grpc/**" \ -ignore "src/**/*_pb2.py" -ignore "src/**/*_pb2_grpc.py" \ -ignore "src/device/service/drivers/openconfig/templates/**/*.xml" \ - -ignore "src/dlt/*" -ignore "src/dlt/**" \ -ignore "src/**/.mvn/*" -ignore "src/**/.mvn/**" \ * diff --git a/scripts/build_run_report_tests_locally.sh b/scripts/build_run_report_tests_locally.sh new file mode 100755 index 0000000000000000000000000000000000000000..7a44eef0282ec87bf5ebca33907d5dc0acb1e2f8 --- /dev/null +++ b/scripts/build_run_report_tests_locally.sh @@ -0,0 +1,57 @@ +#!/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. + +die () { + echo >&2 "$@" + exit 1 +} + +[ "$#" -eq 1 ] || die "component name required but not provided" + +COMPONENT_NAME=$1 # parameter +IMAGE_NAME="${COMPONENT_NAME}-local" +IMAGE_TAG="latest" + +if docker ps | grep $IMAGE_NAME +then + docker stop $IMAGE_NAME +fi + +if docker network list | grep teraflowbridge +then + echo "teraflowbridge is already created" +else + docker network create -d bridge teraflowbridge +fi + +docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$COMPONENT_NAME/Dockerfile . + +docker run --name $IMAGE_NAME -d -v "${PWD}/src/${COMPONENT_NAME}/tests:/home/${COMPONENT_NAME}/results" --network=teraflowbridge --rm $IMAGE_NAME:$IMAGE_TAG + +docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $COMPONENT_NAME/tests/ --junitxml=/home/${COMPONENT_NAME}/results/${COMPONENT_NAME}_report.xml" + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +echo +echo "Coverage report:" +echo "----------------" +docker exec -i $IMAGE_NAME bash -c "coverage report --include='${COMPONENT_NAME}/*' --show-missing" + +# docker stop $IMAGE_NAME +docker rm -f $IMAGE_NAME +docker network rm teraflowbridge diff --git a/scripts/cockroachdb_client.sh b/scripts/cockroachdb_client.sh new file mode 100755 index 0000000000000000000000000000000000000000..0300bb294dcc2dbf713a8515b3e5adc706247ec1 --- /dev/null +++ b/scripts/cockroachdb_client.sh @@ -0,0 +1,51 @@ +#!/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. + + +######################################################################################################################## +# Read deployment settings +######################################################################################################################## + +# If not already set, set the namespace where CockroackDB will be deployed. +export CRDB_NAMESPACE=${CRDB_NAMESPACE:-"crdb"} + +# If not already set, set the database username to be used by Context. +export CRDB_USERNAME=${CRDB_USERNAME:-"tfs"} + +# If not already set, set the database user's password to be used by Context. +export CRDB_PASSWORD=${CRDB_PASSWORD:-"tfs123"} + +# If not already set, set the database name to be used by Context. +export CRDB_DATABASE=${CRDB_DATABASE:-"tfs"} + +# If not already set, set CockroachDB installation mode. Accepted values are: 'single' and 'cluster'. +export CRDB_DEPLOY_MODE=${CRDB_DEPLOY_MODE:-"single"} + + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +if [ "$CRDB_DEPLOY_MODE" == "single" ]; then + CRDB_SQL_PORT=$(kubectl --namespace ${CRDB_NAMESPACE} get service cockroachdb-public -o 'jsonpath={.spec.ports[?(@.name=="sql")].port}') + CRDB_CLIENT_URL="postgresql://${CRDB_USERNAME}:${CRDB_PASSWORD}@cockroachdb-0:${CRDB_SQL_PORT}/defaultdb?sslmode=require" + kubectl exec -it --namespace ${CRDB_NAMESPACE} cockroachdb-0 -- \ + ./cockroach sql --certs-dir=/cockroach/cockroach-certs --url=${CRDB_CLIENT_URL} +elif [ "$CRDB_DEPLOY_MODE" == "cluster" ]; then + kubectl exec -it --namespace ${CRDB_NAMESPACE} cockroachdb-client-secure -- \ + ./cockroach sql --certs-dir=/cockroach/cockroach-certs --host=cockroachdb-public +else + echo "Unsupported value: CRDB_DEPLOY_MODE=$CRDB_DEPLOY_MODE" +fi diff --git a/scripts/create_component.sh b/scripts/create_component.sh new file mode 100755 index 0000000000000000000000000000000000000000..549f09bf40dde79c181d3205cd4da6427f4226dd --- /dev/null +++ b/scripts/create_component.sh @@ -0,0 +1,39 @@ +#!/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. + +COMPONENT_NAME=$1 +PROJECTDIR=`pwd` + +mkdir -p ${PROJECTDIR}/src/${COMPONENT_NAME} +mkdir -p ${PROJECTDIR}/src/${COMPONENT_NAME}/client +mkdir -p ${PROJECTDIR}/src/${COMPONENT_NAME}/service +mkdir -p ${PROJECTDIR}/src/${COMPONENT_NAME}/tests + +touch ${PROJECTDIR}/src/${COMPONENT_NAME}/client/__init__.py +touch ${PROJECTDIR}/src/${COMPONENT_NAME}/service/__init__.py +touch ${PROJECTDIR}/src/${COMPONENT_NAME}/tests/__init__.py +touch ${PROJECTDIR}/src/${COMPONENT_NAME}/.gitlab-ci.yml +touch ${PROJECTDIR}/src/${COMPONENT_NAME}/__init__.py +touch ${PROJECTDIR}/src/${COMPONENT_NAME}/Config.py +touch ${PROJECTDIR}/src/${COMPONENT_NAME}/Dockerfile +touch ${PROJECTDIR}/src/${COMPONENT_NAME}/requirements.in + +cd ${PROJECTDIR}/src +python gitlab-ci.yml_generator.py -t latest forecaster + +cd ${PROJECTDIR}/src/${COMPONENT_NAME} +mv .gitlab-ci.yml gitlab-ci.yaml +${PROJECTDIR}/scripts/add_license_header_to_files.sh +mv gitlab-ci.yaml .gitlab-ci.yml diff --git a/scripts/dump_logs.sh b/scripts/dump_logs.sh new file mode 100755 index 0000000000000000000000000000000000000000..f50f8b133a76dd58e0af2b5ab10ebdbf1b0f2869 --- /dev/null +++ b/scripts/dump_logs.sh @@ -0,0 +1,37 @@ +#!/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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +mkdir -p tmp/exec_logs/$TFS_K8S_NAMESPACE/ +rm tmp/exec_logs/$TFS_K8S_NAMESPACE/* + +PODS=$(kubectl get pods --namespace $TFS_K8S_NAMESPACE --no-headers --output=custom-columns=":metadata.name") +for POD in $PODS; do + CONTAINERS=$(kubectl get pods --namespace $TFS_K8S_NAMESPACE $POD -o jsonpath='{.spec.containers[*].name}') + for CONTAINER in $CONTAINERS; do + kubectl --namespace $TFS_K8S_NAMESPACE logs pod/${POD} --container ${CONTAINER} \ + > tmp/exec_logs/$TFS_K8S_NAMESPACE/$POD\_\_$CONTAINER.log + done +done diff --git a/configure_dashboards.sh b/scripts/old/configure_dashboards_in_kubernetes.sh similarity index 81% rename from configure_dashboards.sh rename to scripts/old/configure_dashboards_in_kubernetes.sh index e05d53b2af0487854db69ea8c837502f5ec24b7d..545e13cffe54c28fec5447314405172f3ac30473 100755 --- a/configure_dashboards.sh +++ b/scripts/old/configure_dashboards_in_kubernetes.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,11 +22,15 @@ INFLUXDB_USER=$(kubectl --namespace $K8S_NAMESPACE get secrets influxdb-secrets INFLUXDB_PASSWORD=$(kubectl --namespace $K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_ADMIN_PASSWORD}' | base64 --decode) INFLUXDB_DATABASE=$(kubectl --namespace $K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_DB}' | base64 --decode) -GRAFANA_HOSTNAME=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +# GRAFANA_HOSTNAME=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +# GRAFANA_HOSTNAME=`kubectl get service/webuiservice-public -n ${K8S_NAMESPACE} -o jsonpath='{.spec.clusterIP}'` +GRAFANA_HOSTNAME=`kubectl get nodes --selector=node-role.kubernetes.io/master -o jsonpath='{$.items[*].status.addresses[?(@.type=="InternalIP")].address}'` GRAFANA_PORT=$(kubectl get service webuiservice-public --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==3000)].nodePort}') +#GRAFANA_PORT=`kubectl get service/webuiservice-public -n ${K8S_NAMESPACE} -o jsonpath='{.spec.ports[1].nodePort}'` GRAFANA_USERNAME="admin" GRAFANA_PASSWORD=${GRAFANA_PASSWORD:-"admin123+"} GRAFANA_URL="http://${GRAFANA_USERNAME}:${GRAFANA_PASSWORD}@${GRAFANA_HOSTNAME}:${GRAFANA_PORT}" +echo "Connecting to grafana at URL: ${GRAFANA_URL}..." # Configure Grafana Admin Password # Ref: https://grafana.com/docs/grafana/latest/http_api/user/#change-password diff --git a/deploy_in_kubernetes.sh b/scripts/old/deploy_in_kubernetes.sh similarity index 91% rename from deploy_in_kubernetes.sh rename to scripts/old/deploy_in_kubernetes.sh index 0da87dbe5dc92d785b2a1b3aedda85288231b03f..c13a236664bde370a323f1663095afd72f72aaec 100755 --- a/deploy_in_kubernetes.sh +++ b/scripts/old/deploy_in_kubernetes.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ export EXTRA_MANIFESTS=${EXTRA_MANIFESTS:-""} ######################################################################################################################## # Constants -GITLAB_REPO_URL="registry.gitlab.com/teraflow-h2020/controller" +GITLAB_REPO_URL="labs.etsi.org:5050/tfs/controller" TMP_FOLDER="./tmp" # Create a tmp folder for files modified during the deployment @@ -81,7 +81,7 @@ for COMPONENT in $COMPONENTS; do if [ "$COMPONENT" == "automation" ] || [ "$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" + docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile . > "$BUILD_LOG" fi if [ -n "$REGISTRY_IMAGE" ]; then @@ -110,10 +110,12 @@ for COMPONENT in $COMPONENTS; do fi echo " Deploying '$COMPONENT' component to Kubernetes..." - DEPLOY_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}.log" + DEPLOY_LOG="$TMP_LOGS_FOLDER/deploy_${COMPONENT}.log" kubectl --namespace $K8S_NAMESPACE apply -f "$MANIFEST" > "$DEPLOY_LOG" - kubectl --namespace $K8S_NAMESPACE scale deployment --replicas=0 ${COMPONENT}service >> "$DEPLOY_LOG" - kubectl --namespace $K8S_NAMESPACE scale deployment --replicas=1 ${COMPONENT}service >> "$DEPLOY_LOG" + + COMPONENT_OBJNAME=$(echo "${COMPONENT}" | sed "s/\_/-/") + kubectl --namespace $K8S_NAMESPACE scale deployment --replicas=0 ${COMPONENT_OBJNAME}service >> "$DEPLOY_LOG" + kubectl --namespace $K8S_NAMESPACE scale deployment --replicas=1 ${COMPONENT_OBJNAME}service >> "$DEPLOY_LOG" printf "\n" done @@ -131,9 +133,12 @@ for COMPONENT in $COMPONENTS; do printf "\n" done -echo "Configuring DataStores and Dashboards..." -./configure_dashboards.sh -printf "\n\n" + +if [[ "$COMPONENTS" == *"webui"* ]]; then + echo "Configuring WebUI DataStores and Dashboards..." + ./configure_dashboards_in_kubernetes.sh + printf "\n\n" +fi echo "Reporting Deployment..." kubectl --namespace $K8S_NAMESPACE get all diff --git a/open_dashboard.sh b/scripts/old/open_dashboard.sh similarity index 67% rename from open_dashboard.sh rename to scripts/old/open_dashboard.sh index 6f87b207c24bfd7e61a8d37740ffe104c2dc85a5..4ea206f4538c27fe8563ce5c30ed837781f8d362 100755 --- a/open_dashboard.sh +++ b/scripts/old/open_dashboard.sh @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,10 +16,10 @@ # this script opens the dashboard -K8S_NAMESPACE=${K8S_NAMESPACE:-'tf-dev'} +K8S_NAMESPACE=${K8S_NAMESPACE:-'tfs'} -GRAFANA_IP=`kubectl get service/webuiservice -n ${K8S_NAMESPACE} -o jsonpath='{.spec.clusterIP}'` -GRAFANA_PORT=`kubectl get service/webuiservice -n ${K8S_NAMESPACE} -o jsonpath='{.spec.ports[1].port}'` +GRAFANA_IP=$(kubectl get service/webuiservice -n ${TFS_K8S_NAMESPACE} -o jsonpath='{.spec.clusterIP}') +GRAFANA_PORT=3000 #$(kubectl get service webuiservice --namespace $TFS_K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==3000)].nodePort}') URL=http://${GRAFANA_IP}:${GRAFANA_PORT} echo Opening Dashboard on URL ${URL} diff --git a/scripts/old/open_webui.sh b/scripts/old/open_webui.sh new file mode 100755 index 0000000000000000000000000000000000000000..5bb0082e16075238a72f4e439810703ecd016a58 --- /dev/null +++ b/scripts/old/open_webui.sh @@ -0,0 +1,88 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# this script opens the webui + +K8S_NAMESPACE=${K8S_NAMESPACE:-'tfs'} + +WEBUI_SERVICE_NAME="webuiservice" +WEBUI_IP=`kubectl get service ${WEBUI_SERVICE_NAME} -n ${K8S_NAMESPACE} -o jsonpath='{.spec.clusterIP}'` +# WEBUI_PORT=$(kubectl get service ${WEBUI_SERVICE_NAME} --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==8004)].nodePort}') +WEBUI_PORT=8004 +# GRAFANA_PORT=$(kubectl get service ${WEBUI_SERVICE_NAME} --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==3000)].nodePort}') +GRAFANA_PORT=3000 + +echo "Configuring WebUI DataStores and Dashboards..." +sleep 3 +INFLUXDB_HOST="monitoringservice" +INFLUXDB_PORT=$(kubectl --namespace $TFS_K8S_NAMESPACE get service/monitoringservice -o jsonpath='{.spec.ports[?(@.name=="influxdb")].port}') +INFLUXDB_URL="http://${INFLUXDB_HOST}:${INFLUXDB_PORT}" +INFLUXDB_USER=$(kubectl --namespace $TFS_K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_ADMIN_USER}' | base64 --decode) +INFLUXDB_PASSWORD=$(kubectl --namespace $TFS_K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_ADMIN_PASSWORD}' | base64 --decode) +INFLUXDB_DATABASE=$(kubectl --namespace $TFS_K8S_NAMESPACE get secrets influxdb-secrets -o jsonpath='{.data.INFLUXDB_DB}' | base64 --decode) +# Exposed through the ingress controller "tfs-ingress" +# GRAFANA_HOSTNAME="127.0.0.1" +# GRAFANA_PORT="80" +# GRAFANA_BASEURL="/grafana" +# Default Grafana credentials +GRAFANA_USERNAME="admin" +GRAFANA_PASSWORD="admin" +# Default Grafana API URL +GRAFANA_URL_DEFAULT=http://${GRAFANA_USERNAME}:${GRAFANA_PASSWORD}@${WEBUI_IP}:${GRAFANA_PORT} #"http://${GRAFANA_USERNAME}:${GRAFANA_PASSWORD}@${GRAFANA_HOSTNAME}:${GRAFANA_PORT}${GRAFANA_BASEURL}" +# Updated Grafana API URL +GRAFANA_URL_UPDATED=http://${GRAFANA_USERNAME}:${TFS_GRAFANA_PASSWORD}@${WEBUI_IP}:${GRAFANA_PORT} #"http://${GRAFANA_USERNAME}:${TFS_GRAFANA_PASSWORD}@${GRAFANA_HOSTNAME}:${GRAFANA_PORT}${GRAFANA_BASEURL}" +echo "Connecting to grafana at URL: ${GRAFANA_URL_DEFAULT}..." +# Configure Grafana Admin Password +# Ref: https://grafana.com/docs/grafana/latest/http_api/user/#change-password +curl -X PUT -H "Content-Type: application/json" -d '{ + "oldPassword": "'${GRAFANA_PASSWORD}'", + "newPassword": "'${TFS_GRAFANA_PASSWORD}'", + "confirmNew" : "'${TFS_GRAFANA_PASSWORD}'" +}' ${GRAFANA_URL_DEFAULT}/api/user/password +echo +# Create InfluxDB DataSource +# Ref: https://grafana.com/docs/grafana/latest/http_api/data_source/ +curl -X POST -H "Content-Type: application/json" -d '{ + "type" : "influxdb", + "name" : "InfluxDB", + "url" : "'"$INFLUXDB_URL"'", + "access" : "proxy", + "basicAuth": false, + "user" : "'"$INFLUXDB_USER"'", + "password" : "'"$INFLUXDB_PASSWORD"'", + "isDefault": true, + "database" : "'"$INFLUXDB_DATABASE"'" +}' ${GRAFANA_URL_UPDATED}/api/datasources +echo +# Create Monitoring Dashboard +# Ref: https://grafana.com/docs/grafana/latest/http_api/dashboard/ +curl -X POST -H "Content-Type: application/json" \ +-d '@src/webui/grafana_dashboard.json' \ +${GRAFANA_URL_UPDATED}/api/dashboards/db +echo +DASHBOARD_URL="${GRAFANA_URL_UPDATED}/api/dashboards/uid/tf-l3-monit" +DASHBOARD_ID=$(curl -s "${DASHBOARD_URL}" | jq '.dashboard.id') +curl -X POST ${GRAFANA_URL_UPDATED}/api/user/stars/dashboard/${DASHBOARD_ID} + +# Open WebUI +UI_URL="http://${WEBUI_IP}:${WEBUI_PORT}" +echo "Opening web UI on URL ${UI_URL}" +# curl -kL ${UI_URL} +python3 -m webbrowser ${UI_URL} + +# Open Dashboard +DASHB_URL="http://${WEBUI_IP}:${GRAFANA_PORT}" +echo "Opening Dashboard on URL ${DASHB_URL}" +# curl -kL ${DASHB_URL} +python3 -m webbrowser ${DASHB_URL} diff --git a/scripts/report_coverage_all.sh b/scripts/report_coverage_all.sh index a7e4797f3118a03c5f4db7eb384a67bdea4d795a..cf3a05c03c48f41d5960e317e27047b003ecb2d4 100755 --- a/scripts/report_coverage_all.sh +++ b/scripts/report_coverage_all.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ PROJECTDIR=`pwd` -cd $(dirname $0)/src +cd $PROJECTDIR/src RCFILE=$PROJECTDIR/coverage/.coveragerc echo diff --git a/scripts/report_coverage_common.sh b/scripts/report_coverage_common.sh index f69c57a01aa83a75263a2dc888951aeaf4867ca2..f7f1076bdb26c8185b26b4392448560199316945 100755 --- a/scripts/report_coverage_common.sh +++ b/scripts/report_coverage_common.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/report_coverage_compute.sh b/scripts/report_coverage_compute.sh index 15e9e3422e9c2674206dfd17fec9a4396ea77cca..4d986b5c36e6fdc2b1360881d2120c881f468535 100755 --- a/scripts/report_coverage_compute.sh +++ b/scripts/report_coverage_compute.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/report_coverage_context.sh b/scripts/report_coverage_context.sh index b39c45833189ca755a088983e9fbe341bb6dd471..2784bdf10e6ae8bd75e3630b6b1a3074e6081d63 100755 --- a/scripts/report_coverage_context.sh +++ b/scripts/report_coverage_context.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/report_coverage_device.sh b/scripts/report_coverage_device.sh index d7a1dc0841f9fb2fa495363b248747668d704886..c1bbb84734ae89ed8d380981312fd6618b89ae06 100755 --- a/scripts/report_coverage_device.sh +++ b/scripts/report_coverage_device.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/report_coverage_l3_attackmitigator.sh b/scripts/report_coverage_l3_attackmitigator.sh index c34283dbb91e21099ac5246566a3698c280b4725..80496eaf83060821930538ac94a7d3d6c59c2016 100755 --- a/scripts/report_coverage_l3_attackmitigator.sh +++ b/scripts/report_coverage_l3_attackmitigator.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/report_coverage_l3_centralizedattackdetector.sh b/scripts/report_coverage_l3_centralizedattackdetector.sh index 1060bae05eb383aea5d9caf6bd1b1a9e5e4cfeaa..d662dadb78eb12bfe84ad239d7ee7838c7df77ad 100755 --- a/scripts/report_coverage_l3_centralizedattackdetector.sh +++ b/scripts/report_coverage_l3_centralizedattackdetector.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/report_coverage_l3_distributedattackdetector.sh b/scripts/report_coverage_l3_distributedattackdetector.sh index 94c2a16f4c6ff9b0a6adfd0a45b59a208297c327..e83dd01e649ec67bfecbb2753ff12a811d25b8a4 100755 --- a/scripts/report_coverage_l3_distributedattackdetector.sh +++ b/scripts/report_coverage_l3_distributedattackdetector.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/report_coverage_pathcomp.sh b/scripts/report_coverage_pathcomp.sh new file mode 100755 index 0000000000000000000000000000000000000000..9e91fb2586df1bd71b3e8b22b6c8f7df253e2b15 --- /dev/null +++ b/scripts/report_coverage_pathcomp.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. + + +./report_coverage_all.sh | grep --color -E -i "^pathcomp/.*$|$" diff --git a/scripts/report_coverage_service.sh b/scripts/report_coverage_service.sh index 4a3c5cc067d009d6354939c06d9002f038bc0441..41c25bfabb91b792b9171763616045e0de89846f 100755 --- a/scripts/report_coverage_service.sh +++ b/scripts/report_coverage_service.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/tests/ofc22/show_deploy.sh b/scripts/report_coverage_slice.sh similarity index 80% rename from src/tests/ofc22/show_deploy.sh rename to scripts/report_coverage_slice.sh index 58fce79e32819478627c87b8a5fb8ea7701db2d7..64c68d492a45758969d170e145ab2d47ef3f55ac 100755 --- a/src/tests/ofc22/show_deploy.sh +++ b/scripts/report_coverage_slice.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,5 +14,4 @@ # limitations under the License. -K8S_NAMESPACE="ofc22" -kubectl --namespace $K8S_NAMESPACE get all +./report_coverage_all.sh | grep --color -E -i "^slice/.*$|$" diff --git a/scripts/run_tests_locally-compute.sh b/scripts/run_tests_locally-compute.sh new file mode 100755 index 0000000000000000000000000000000000000000..3fed523e541e1cc9dabb0a55579f38a3338b30b9 --- /dev/null +++ b/scripts/run_tests_locally-compute.sh @@ -0,0 +1,24 @@ +#!/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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + compute/tests/test_unitary.py diff --git a/scripts/run_tests_locally-context.sh b/scripts/run_tests_locally-context.sh new file mode 100755 index 0000000000000000000000000000000000000000..79bac938a44f72dfc61c3d9dad7c3322f9a04d3d --- /dev/null +++ b/scripts/run_tests_locally-context.sh @@ -0,0 +1,85 @@ +#!/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. + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc +COVERAGEFILE=$PROJECTDIR/coverage/.coverage + +# Destroy old coverage file and configure the correct folder on the .coveragerc file +rm -f $COVERAGEFILE +cat $PROJECTDIR/coverage/.coveragerc.template | sed s+~/tfs-ctrl+$PROJECTDIR+g > $RCFILE + +echo +echo "Pre-test clean-up:" +echo "------------------" +docker rm -f crdb nats +docker volume rm -f crdb +docker network rm tfs-br + +echo +echo "Pull Docker images:" +echo "-------------------" +docker pull cockroachdb/cockroach:latest-v22.2 +docker pull nats:2.9 + +echo +echo "Create test environment:" +echo "------------------------" +docker network create -d bridge --subnet=172.254.254.0/24 --gateway=172.254.254.1 --ip-range=172.254.254.0/24 tfs-br +docker volume create crdb +docker run --name crdb -d --network=tfs-br --ip 172.254.254.10 -p 26257:26257 -p 8080:8080 \ + --env COCKROACH_DATABASE=tfs_test --env COCKROACH_USER=tfs --env COCKROACH_PASSWORD=tfs123\ + --volume "crdb:/cockroach/cockroach-data" \ + cockroachdb/cockroach:latest-v22.2 start-single-node +docker run --name nats -d --network=tfs-br --ip 172.254.254.11 -p 4222:4222 -p 8222:8222 \ + nats:2.9 --http_port 8222 --user tfs --pass tfs123 + +echo +echo "Waiting for initialization..." +echo "-----------------------------" +#docker logs -f crdb 2>&1 | grep --max-count=1 'finished creating default user "tfs"' +while ! docker logs crdb 2>&1 | grep -q 'finished creating default user \"tfs\"'; do sleep 1; done +docker logs crdb +#docker logs -f nats 2>&1 | grep --max-count=1 'Server is ready' +while ! docker logs nats 2>&1 | grep -q 'Server is ready'; do sleep 1; done +docker logs nats +#sleep 10 +docker ps -a + +echo +echo "Run unitary tests and analyze code coverage:" +echo "--------------------------------------------" +export CRDB_URI="cockroachdb://tfs:tfs123@172.254.254.10:26257/tfs_test?sslmode=require" +export MB_BACKEND="nats" +export NATS_URI="nats://tfs:tfs123@172.254.254.11:4222" +export PYTHONPATH=/home/tfs/tfs-ctrl/src +# helpful pytest flags: --log-level=INFO -o log_cli=true --verbose --maxfail=1 --durations=0 +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose --maxfail=1 \ + context/tests/test_*.py + +echo +echo "Coverage report:" +echo "----------------" +#coverage report --rcfile=$RCFILE --sort cover --show-missing --skip-covered | grep --color -E -i "^context/.*$|$" +coverage report --rcfile=$RCFILE --sort cover --show-missing --skip-covered --include="context/*" + +echo +echo "Post-test clean-up:" +echo "-------------------" +docker rm -f crdb nats +docker volume rm -f crdb +docker network rm tfs-br diff --git a/scripts/run_tests_locally-device-all.sh b/scripts/run_tests_locally-device-all.sh new file mode 100755 index 0000000000000000000000000000000000000000..b44db77cea2dc56e4c40c0ccc8d2849a8fd5ba10 --- /dev/null +++ b/scripts/run_tests_locally-device-all.sh @@ -0,0 +1,37 @@ +#!/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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_emulated.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_openconfig.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_tapi.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_p4.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_microwave.py diff --git a/scripts/run_tests_locally-device-emulated.sh b/scripts/run_tests_locally-device-emulated.sh new file mode 100755 index 0000000000000000000000000000000000000000..0f1c74df0ef8cd8d309e6e8a28500e3d8fccc46c --- /dev/null +++ b/scripts/run_tests_locally-device-emulated.sh @@ -0,0 +1,24 @@ +#!/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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_emulated.py diff --git a/scripts/run_tests_locally-device-microwave.sh b/scripts/run_tests_locally-device-microwave.sh new file mode 100755 index 0000000000000000000000000000000000000000..e4cab1796b34504f40d9e0053ae9f97fb635202f --- /dev/null +++ b/scripts/run_tests_locally-device-microwave.sh @@ -0,0 +1,24 @@ +#!/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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_microwave.py diff --git a/scripts/run_tests_locally-device-openconfig.sh b/scripts/run_tests_locally-device-openconfig.sh new file mode 100755 index 0000000000000000000000000000000000000000..06a8c8e10819603dd07b9be9e2cb0bac8652477e --- /dev/null +++ b/scripts/run_tests_locally-device-openconfig.sh @@ -0,0 +1,24 @@ +#!/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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_openconfig.py diff --git a/scripts/run_tests_locally-device-p4.sh b/scripts/run_tests_locally-device-p4.sh new file mode 100755 index 0000000000000000000000000000000000000000..0d73e3564a55f3557733de746ac0f0ce02495519 --- /dev/null +++ b/scripts/run_tests_locally-device-p4.sh @@ -0,0 +1,24 @@ +#!/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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_p4.py diff --git a/scripts/run_tests_locally-device-tapi.sh b/scripts/run_tests_locally-device-tapi.sh new file mode 100755 index 0000000000000000000000000000000000000000..3a00f5857393949e0ef101a0072e54d5907bf51e --- /dev/null +++ b/scripts/run_tests_locally-device-tapi.sh @@ -0,0 +1,24 @@ +#!/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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + device/tests/test_unitary_tapi.py diff --git a/src/tests/ofc22/deploy_in_kubernetes.sh b/scripts/run_tests_locally-pathcomp-frontend.sh similarity index 56% rename from src/tests/ofc22/deploy_in_kubernetes.sh rename to scripts/run_tests_locally-pathcomp-frontend.sh index 1b725e5d629831d3c80be8ce8a09925e4bcc9c8e..4318b2f472a54f52be71d02d6344d24ccfd8e826 100755 --- a/src/tests/ofc22/deploy_in_kubernetes.sh +++ b/scripts/run_tests_locally-pathcomp-frontend.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,14 +14,15 @@ # limitations under the License. -# OFC 22 deployment settings +PROJECTDIR=`pwd` -export REGISTRY_IMAGE="" -export COMPONENTS="context device service compute webui automation monitoring" -export IMAGE_TAG="ofc22" -export K8S_NAMESPACE="ofc22" -export K8S_HOSTNAME="kubernetes-master" -export EXTRA_MANIFESTS="./ofc22/expose_services.yaml" -export GRAFANA_PASSWORD="admin123+" +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc -./deploy_in_kubernetes.sh +# Run unitary tests and analyze coverage of code at same time + +# Useful flags for pytest: +#-o log_cli=true -o log_file=service.log -o log_file_level=DEBUG + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + pathcomp/frontend/tests/test_unitary.py diff --git a/scripts/run_tests_locally-service.sh b/scripts/run_tests_locally-service.sh new file mode 100755 index 0000000000000000000000000000000000000000..e671b0fc89db38aa64137d754c45baa1730f61a3 --- /dev/null +++ b/scripts/run_tests_locally-service.sh @@ -0,0 +1,25 @@ +#!/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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + service/tests/test_unitary_task_scheduler.py \ + service/tests/test_unitary.py diff --git a/scripts/run_tests_locally-slice.sh b/scripts/run_tests_locally-slice.sh new file mode 100755 index 0000000000000000000000000000000000000000..9e5f47c18fcdfbc82316c345df35cad73e6fe4b0 --- /dev/null +++ b/scripts/run_tests_locally-slice.sh @@ -0,0 +1,24 @@ +#!/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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc + +# Run unitary tests and analyze coverage of code at same time +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + slice/tests/test_unitary.py diff --git a/scripts/run_tests_locally.sh b/scripts/run_tests_locally.sh index 1655d875e4f3cbb5922b773094422d32dff1ee2e..b609fbb391266702e6fc4be8c7a0aa7990596235 100755 --- a/scripts/run_tests_locally.sh +++ b/scripts/run_tests_locally.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -51,19 +51,16 @@ export INFLUXDB_DATABASE=$(kubectl --namespace $K8S_NAMESPACE get secrets influx # First destroy old coverage file rm -f $COVERAGEFILE -# Useful flags for pytest: -#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG - coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ common/orm/tests/test_unitary.py \ common/message_broker/tests/test_unitary.py \ - common/rpc_method_wrapper/tests/test_unitary.py + common/method_wrappers/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ context/tests/test_unitary.py coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ - device/tests/test_unitary.py + device/tests/test_unitary_emulated.py coverage run --rcfile=$RCFILE --append -m pytest -s --log-level=INFO --verbose \ l3_centralizedattackdetector/tests/test_unitary.py @@ -94,3 +91,9 @@ coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ monitoring/tests/test_unitary.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + slice/tests/test_unitary.py + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + pathcomp/tests/test_unitary.py diff --git a/scripts/show_logs_automation.sh b/scripts/show_logs_automation.sh new file mode 100755 index 0000000000000000000000000000000000000000..46c0dbba9752b207b11136535403f0c009d0a377 --- /dev/null +++ b/scripts/show_logs_automation.sh @@ -0,0 +1,27 @@ +#!/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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/automationservice diff --git a/scripts/show_logs_compute.sh b/scripts/show_logs_compute.sh new file mode 100755 index 0000000000000000000000000000000000000000..fc992eb43e5872b4522db6f5c8ce39207f12d559 --- /dev/null +++ b/scripts/show_logs_compute.sh @@ -0,0 +1,27 @@ +#!/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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/computeservice diff --git a/scripts/show_logs_context.sh b/scripts/show_logs_context.sh new file mode 100755 index 0000000000000000000000000000000000000000..1051e6fd5b830b73f4fb4df0486850935f1c8047 --- /dev/null +++ b/scripts/show_logs_context.sh @@ -0,0 +1,27 @@ +#!/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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/contextservice -c server diff --git a/scripts/show_logs_device.sh b/scripts/show_logs_device.sh new file mode 100755 index 0000000000000000000000000000000000000000..6a77c38152716f1e6fbf320671dda25d974431c8 --- /dev/null +++ b/scripts/show_logs_device.sh @@ -0,0 +1,27 @@ +#!/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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/deviceservice diff --git a/scripts/show_logs_dlt_connector.sh b/scripts/show_logs_dlt_connector.sh new file mode 100755 index 0000000000000000000000000000000000000000..9e1f21ab911f93003497bd764c5919e13db98c22 --- /dev/null +++ b/scripts/show_logs_dlt_connector.sh @@ -0,0 +1,27 @@ +#!/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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/dltservice -c connector diff --git a/scripts/show_logs_dlt_gateway.sh b/scripts/show_logs_dlt_gateway.sh new file mode 100755 index 0000000000000000000000000000000000000000..db29eebfaf8f424c628880ccc0cb7113fe913fde --- /dev/null +++ b/scripts/show_logs_dlt_gateway.sh @@ -0,0 +1,27 @@ +#!/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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/dltservice -c gateway diff --git a/scripts/show_logs_monitoring.sh b/scripts/show_logs_monitoring.sh new file mode 100755 index 0000000000000000000000000000000000000000..1a152a32216545f53607880c3908266f4ac41e95 --- /dev/null +++ b/scripts/show_logs_monitoring.sh @@ -0,0 +1,27 @@ +#!/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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/monitoringservice server diff --git a/scripts/show_logs_pathcomp_backend.sh b/scripts/show_logs_pathcomp_backend.sh new file mode 100755 index 0000000000000000000000000000000000000000..b60b4e06cdf9a197ef0024bf0b24d8c389eb8ae1 --- /dev/null +++ b/scripts/show_logs_pathcomp_backend.sh @@ -0,0 +1,27 @@ +#!/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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/pathcompservice -c backend diff --git a/scripts/show_logs_pathcomp_frontend.sh b/scripts/show_logs_pathcomp_frontend.sh new file mode 100755 index 0000000000000000000000000000000000000000..a08a67886dda07506d930e2fa705712ebe404680 --- /dev/null +++ b/scripts/show_logs_pathcomp_frontend.sh @@ -0,0 +1,27 @@ +#!/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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/pathcompservice -c frontend diff --git a/scripts/show_logs_service.sh b/scripts/show_logs_service.sh new file mode 100755 index 0000000000000000000000000000000000000000..7ca1c1c2f4286a5fc46f7d36197d376472b447ed --- /dev/null +++ b/scripts/show_logs_service.sh @@ -0,0 +1,27 @@ +#!/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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/serviceservice diff --git a/scripts/show_logs_slice.sh b/scripts/show_logs_slice.sh new file mode 100755 index 0000000000000000000000000000000000000000..c71bc92eaa4a8d411372fc0ad4194881a5a2a9c8 --- /dev/null +++ b/scripts/show_logs_slice.sh @@ -0,0 +1,27 @@ +#!/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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/sliceservice diff --git a/scripts/show_logs_webui.sh b/scripts/show_logs_webui.sh new file mode 100755 index 0000000000000000000000000000000000000000..450527be6b916cdf1430efc1ba89d98fd92a43aa --- /dev/null +++ b/scripts/show_logs_webui.sh @@ -0,0 +1,27 @@ +#!/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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/webuiservice -c server diff --git a/scripts/update_license_headers.py b/scripts/update_license_headers.py new file mode 100644 index 0000000000000000000000000000000000000000..f721425f89b84fe76783cd2f26b923c0c9005e5a --- /dev/null +++ b/scripts/update_license_headers.py @@ -0,0 +1,114 @@ +#!/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. + +# Run from ~/tfs-ctrl as: +# python scripts/update_license_headers.py + +import logging, os, re, sys +from io import TextIOWrapper + +logging.basicConfig(level=logging.INFO) +LOGGER = logging.getLogger(__name__) + +ROOT_PATH = '.' +FILE_PATH_SKIPPED = 'out-skipped.txt' +FILE_PATH_NO_HEADER = 'out-no-header.txt' +FILE_PATH_UPDATED = 'out-updated.txt' + +RE_OLD_COPYRIGHT = re.compile(r'Copyright\ 2021\-2023\ H2020\ TeraFlow\ \(https\:\/\/www\.teraflow\-h2020\.eu\/\)') +STR_NEW_COPYRIGHT = 'Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)' + +def skip_file(file_path : str) -> bool: + if file_path.endswith('.pyc'): return True + if file_path.endswith('_pb2_grpc.py'): return True + if file_path.endswith('_pb2.py'): return True + if file_path.endswith('.md'): return True + if file_path.endswith('.png'): return True + if file_path.endswith('.json'): return True + if file_path.endswith('.zip'): return True + if file_path.endswith('.zip'): return True + if file_path.endswith('.jar'): return True + if file_path.endswith('/tstat'): return True + if file_path.endswith('/.gitignore'): return True + if file_path.endswith('/.gitkeep'): return True + if file_path.endswith('/coverage/.coverage'): return True + if file_path.startswith('./netconf_openconfig/'): return True + if file_path.startswith('./tmp/'): return True + if '/manifests/cttc-ols/' in file_path: return True + if '/hackfest/netconf-oc/openconfig/' in file_path: return True + if '/.git/' in file_path: return True + if '/.vscode/' in file_path: return True + if '/.pytest_cache/' in file_path: return True + if '/__pycache__/' in file_path: return True + 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 '/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 + if FILE_PATH_SKIPPED in file_path: return True + if FILE_PATH_NO_HEADER in file_path: return True + if FILE_PATH_UPDATED in file_path: return True + if file_path in {'./LICENSE', './.python-version', './.env'}: return True + return False + +def process_line(line_in : str) -> str: + line_out = RE_OLD_COPYRIGHT.sub(STR_NEW_COPYRIGHT, line_in) + if line_out != line_in: return line_out + return line_in + +def process_file( + file_path : str, file_no_header : TextIOWrapper, file_skipped : TextIOWrapper, file_updated : TextIOWrapper +) -> None: + if skip_file(file_path): + file_skipped.write(file_path + '\n') + return + + LOGGER.info(' File {:s}...'.format(str(file_path))) + + temp_file_path = file_path + '.temp' + replaced = False + try: + with open(file_path, encoding='UTF-8') as source: + with open(temp_file_path, 'w', encoding='UTF-8') as target: + for line_in in source: + line_out = process_line(line_in) + target.write(line_out) + replaced = replaced or (line_out != line_in) + except: # pylint: disable=bare-except + replaced = False + + if not replaced: + file_no_header.write(file_path + '\n') + else: + file_updated.write(file_path + '\n') + + os.rename(temp_file_path, file_path) + +def main() -> int: + with open(FILE_PATH_NO_HEADER, 'w', encoding='UTF-8') as file_no_header: + with open(FILE_PATH_SKIPPED, 'w', encoding='UTF-8') as file_skipped: + with open(FILE_PATH_UPDATED, 'w', encoding='UTF-8') as file_updated: + for dirpath, _, filenames in os.walk(ROOT_PATH): + LOGGER.info('Folder {:s}...'.format(str(dirpath))) + for filename in filenames: + file_path = os.path.join(dirpath, filename) + process_file(file_path, file_no_header, file_skipped, file_updated) + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/__init__.py b/src/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/automation/.gitlab-ci.yml b/src/automation/.gitlab-ci.yml index 76cd4ea0d07496af864275cd63c5fbd8f94b7659..0dc6284a4086253e64138343a989055581eccdda 100644 --- a/src/automation/.gitlab-ci.yml +++ b/src/automation/.gitlab-ci.yml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -69,7 +69,6 @@ unit_test automation: coverage: '/JaCoCo Coverage Total: ([0-9]{1,3})%/' artifacts: reports: - cobertura: ${REPORTS_PATH}/cobertura.xml junit: - ${REPORTS_PATH}/surefire-reports/TEST-*.xml rules: @@ -80,22 +79,22 @@ unit_test automation: - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml -# Deployment of automation service in Kubernetes Cluster -deploy automation: - stage: deploy - needs: - - build automation - - unit_test automation - 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 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)' - when: manual - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - when: manual +## Deployment of automation service in Kubernetes Cluster +#deploy automation: +# stage: deploy +# needs: +# - build automation +# - unit_test automation +# 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 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)' +# when: manual +# - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' +# when: manual diff --git a/src/automation/README.md b/src/automation/README.md index 099980bcc4172bf9e5c2d59459f40ae4331696cf..e98d2b8ab62563f43cf2c1011e91fb2a1d08d378 100644 --- a/src/automation/README.md +++ b/src/automation/README.md @@ -1,28 +1,57 @@ -# Automation TeraFlow OS service +# TeraFlowSDN Automation service -The Automation service, also known as Zero-Touch Provisioning (ZTP), is tested on Ubuntu 20.04. Follow the instructions below to build, test, and run this service on your local environment. +This repository hosts the TeraFlowSDN Automation service, also known as Zero-Touch Provisioning (ZTP) service. +Follow the instructions below to build, test, and run this service on your local environment. -## Automation Teraflow OS service architecture +## TeraFlowSDN Automation service architecture -| The Automation Teraflow OS service architecture consists of six (6) interfaces listed below: | +The TeraFlowSDN Automation 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. | -| 2. The `ContextGateway` interface that communicates with a `Context` Service gRPC client and implements all the rpc functions that are described in `context.proto` file. | -| 3. The `DeviceGateway` interface that communicates with a `Device` Service gRPC client and implements all the rpc functions that are described in `device.proto` file. | -| 4. The `AutomationService` interface that implements the `addDevice()` method by communicating with a `Context` gRPC client & a `Device` gRPC client through the use of `ContextService` interface & `DeviceService` interface respectively. | -| 5. The `ContextService` interface that implements the `getDevice()` & `getDeviceEvents()` methods by communicating with a `Context` gRPC client through the use of `ContextGateway` interface. | -| 6. The `DeviceService` interface that implements the `getInitialConfiguration()` & `configureDevice()` methods by communicating with a `Device` gRPC client through the use of `DeviceGateway` interface. | +| 1. The `AutomationGateway` interface that implements all the RPC functions that are described in `automation.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. | +| 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. -## Run with dev profile +To quickly install Java 11 on a Debian-based Linux distro do: ```bash -./mvnw clean quarkus:dev +sudo apt-get install openjdk-11-jdk -y ``` -## Running tests +Feel free to try more recent Java versions. + +## Compile + +```bash +./mvnw compile +``` + +## Run tests + +```bash +./mvnw test +``` -Run unit and functional tests `./mvnw clean test` +## Run service + +```bash +./mvnw quarkus:dev +```` + +## Clean + +```bash +./mvnw clean +``` ## Deploying on a Kubernetes cluster @@ -30,10 +59,16 @@ To create the K8s manifest file under `target/kubernetes/kubernetes.yml` to be u ```bash ./mvnw clean package -DskipUTs -DskipITs -``` +``` To deploy the application in a K8s cluster run ```bash kubectl apply -f "manifests/automationservice.yaml" ``` + +## Maintainers + +This TeraFlowSDN service is implemented by [UBITECH](https://www.ubitech.eu). + +Feel free to contact Georgios Katsikas (gkatsikas at ubitech dot eu) in case you have questions. diff --git a/src/automation/mvnw b/src/automation/mvnw old mode 100755 new mode 100644 diff --git a/src/automation/pom.xml b/src/automation/pom.xml index bedee7b7f23296fa4adb7585191d19b5a917d689..2fd5fd263a698145f39c37ed358982de58dfee77 100644 --- a/src/automation/pom.xml +++ b/src/automation/pom.xml @@ -1,6 +1,6 @@ operation considered complete when IPM responds with suitable status code, + # including "accepted", that only means request is semantically good and queued. + # synchronous --> operation is considered complete once result is also reflected in GETs in REST API. + # lifecycle --> operation is considered successfull once IPM has completed pluggaable configuration + # or failed in it. This is typically unsuitable for production use + # (as some optics may be transiently unreachable), but is convenient for demos and testin. + consistency_mode = ConsistencyMode.from_str(settings.get("consistency-mode", "asynchronous")) + + self.__cm_connection = CmConnection(address, int(port), username, password, self.__timeout, tls_verify = tls_verify, consistency_mode=consistency_mode) + self.__constellation = None + + LOGGER.info(f"XrDriver instantiated, cm {address}:{port}, consistency mode {str(consistency_mode)}, {settings=}") + + def __str__(self): + return f"{self.__hub_module_name}@{self.__cm_address}" + + def Connect(self) -> bool: + LOGGER.info(f"Connect[{self}]") + with self.__lock: + if self.__started.is_set(): + return True + if not self.__cm_connection.Connect(): + return False + else: + self.__started.set() + return True + + def Disconnect(self) -> bool: + LOGGER.info(f"Disconnect[{self}]") + with self.__lock: + self.__terminate.set() + return True + + def GetInitialConfig(self) -> List[Tuple[str, Any]]: + LOGGER.info(f"GetInitialConfig[{self}]") + with self.__lock: + return [] + + #pylint: disable=dangerous-default-value + @metered_subclass_method(METRICS_POOL) + def GetConfig(self, resource_keys : List[str] = []) -> List[Tuple[str, Union[Any, None, Exception]]]: + LOGGER.info(f"GetConfig[{self}]: {resource_keys=}") + chk_type('resources', resource_keys, list) + + # Empty resource_keys means all resources. As we only have endpoints, we ignore parameter and always + # return everything. + + with self.__lock: + constellation = self.__cm_connection.get_constellation_by_hub_name(self.__hub_module_name) + if constellation: + self.__constellation = constellation + return [(f"/endpoints/endpoint[{ifname}]", {'uuid': ifname, 'type': 'optical', 'sample_types': {}}) for ifname in constellation.ifnames()] + else: + return [] + + @metered_subclass_method(METRICS_POOL) + def SetConfig(self, resources: List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + LOGGER.info(f"SetConfig[{self}]: {resources=}") + # Logged config seems like: + #[('/service[52ff5f0f-fda4-40bd-a0b1-066f4ff04079:optical]', '{"capacity_unit": "GHz", "capacity_value": 1, "direction": "UNIDIRECTIONAL", "input_sip": "XR HUB 1|XR-T4", "layer_protocol_name": "PHOTONIC_MEDIA", "layer_protocol_qualifier": "tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC", "output_sip": "XR LEAF 1|XR-T1", "uuid": "52ff5f0f-fda4-40bd-a0b1-066f4ff04079:optical"}')] + + with self.__lock: + if self.__constellation is None: + self.__constellation = self.__cm_connection.get_constellation_by_hub_name(self.__hub_module_name) + + if self.__constellation is None: + LOGGER.error("SetConfig: no valid constellation") + return [False] * len(resources) + + results = [] + if len(resources) == 0: + return results + + for key, config in resources: + service_uuid = self.__cm_connection.service_uuid(key) + if service_uuid: + config = json.loads(config) + results.append(tf.set_config_for_service(self.__cm_connection, self.__constellation, service_uuid, config)) + else: + results.append(False) + + return results + + @metered_subclass_method(METRICS_POOL) + def DeleteConfig(self, resources: List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + LOGGER.info(f"DeleteConfig[{self}]: {resources=}") + + # Input looks like: + # resources=[('/service[c8a35e81-88d8-4468-9afc-a8abd92a64d0:optical]', '{"uuid": "c8a35e81-88d8-4468-9afc-a8abd92a64d0:optical"}')] + + with self.__lock: + results = [] + if len(resources) == 0: + return results + + # Temporary dummy version + for key, _config in resources: + service_uuid = self.__cm_connection.service_uuid(key) + if service_uuid: + connection = self.__cm_connection.get_connection_by_teraflow_uuid(service_uuid) + if connection is None: + LOGGER.info(f"DeleteConfig: Connection {service_uuid} does not exist, delete is no-op") + results.append(True) + else: + was_deleted = self.__cm_connection.delete_connection(connection.href) + if was_deleted: + LOGGER.info(f"DeleteConfig: Connection {service_uuid} deleted (was {str(connection)})") + else: + LOGGER.info(f"DeleteConfig: Connection {service_uuid} delete failure (was {str(connection)})") + + if self.__constellation.is_vti_mode(): + active_tc = self.__cm_connection.get_transport_capacity_by_teraflow_uuid(service_uuid) + if active_tc is not None: + if self.__cm_connection.delete_transport_capacity(active_tc.href): + LOGGER.info(f"DeleteConfig: Transport Capacity {active_tc} deleted") + else: + LOGGER.error(f"DeleteConfig: Transport Capacity {active_tc} delete failure") + + results.append(was_deleted) + else: + results.append(False) + + return results + + @metered_subclass_method(METRICS_POOL) + def SubscribeState(self, subscriptions : List[Tuple[str, float, float]]) -> List[Union[bool, Exception]]: + # Not supported + return [False for _ in subscriptions] + + @metered_subclass_method(METRICS_POOL) + def UnsubscribeState(self, subscriptions : List[Tuple[str, float, float]]) -> List[Union[bool, Exception]]: + # Not supported + return [False for _ in subscriptions] + + def GetState( + self, blocking=False, terminate : Optional[threading.Event] = None + ) -> Iterator[Tuple[float, str, Any]]: + # Not supported + return [] diff --git a/src/device/service/drivers/xr/__init__.py b/src/device/service/drivers/xr/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf --- /dev/null +++ b/src/device/service/drivers/xr/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/src/device/service/drivers/xr/cm-cli.py b/src/device/service/drivers/xr/cm-cli.py new file mode 100644 index 0000000000000000000000000000000000000000..924ca0c966bbefd8b72c655ea788bdfd0ed08c5d --- /dev/null +++ b/src/device/service/drivers/xr/cm-cli.py @@ -0,0 +1,181 @@ +#!/usr/bin/env python3 +#pylint: disable=invalid-name, missing-function-docstring, line-too-long, logging-fstring-interpolation, missing-class-docstring, missing-module-docstring +# 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. + +# Test program for CmConnection +import argparse +import logging +import traceback +from typing import Tuple +from cm.cm_connection import CmConnection, ConsistencyMode +from cm.tf_service import TFService +from cm.transport_capacity import TransportCapacity +from cm.connection import Connection +import cm.tf as tf + +logging.basicConfig(level=logging.INFO) + +parser = argparse.ArgumentParser(description='CM Connectin Test Utility') +parser.add_argument('ip', help='CM IP address or domain name') +parser.add_argument('port', help='CM port', type=int) +parser.add_argument('username', help='Username') +parser.add_argument('password', help='Password') + +parser.add_argument('--list-constellations', action='store_true') +parser.add_argument('--show-constellation-by-hub-name', nargs='?', type=str) +parser.add_argument('--create-connection', nargs='?', type=str, help="uuid;ifname;ifname;capacity") +parser.add_argument('--modify-connection', nargs='?', type=str, help="href;uuid;ifname;ifname;capacity") +parser.add_argument('--show-connection-by-name', nargs='?', type=str) +parser.add_argument('--list-connections', action='store_true') +parser.add_argument('--delete-connection', nargs='?', type=str, help="connection id, e.g. \"/network-connections/4505d5d3-b2f3-40b8-8ec2-4a5b28523c03\"") +parser.add_argument('--list-transport-capacities', action='store_true') +parser.add_argument('--create-transport-capacity', nargs='?', type=str, help="uuid;ifname;ifname;capacity") +parser.add_argument('--emulate-tf-set-config-service', nargs='?', type=str, help="hubmodule;uuid;ifname;ifname;capacity or hubmodule;uuid;ifname;ifname;capacity;FORCE-VTI-ON") +parser.add_argument('--consistency-mode', nargs='?', type=str, help="asynchronous|synchronous|lifecycle;RETRY_INTERVAL_FLOAT_AS_S") +parser.add_argument('--timeout', help='REST call timeout in seconds (per request and total for consistency validation)', type=int, default=60) + +args = parser.parse_args() + +def cli_create_string_to_tf_service(cli_create_str: str) -> TFService: + sargs = cli_create_str.split(";") + if len(sargs) == 3: + return TFService(*sargs, 0) + if len(sargs) == 4: + sargs[-1] = int(sargs[-1]) + return TFService(*sargs) + print("Invalid object create arguments. Expecting \"oid;ifname1;ifname2;bandwidthgbits\" or \"oid;ifname1;ifname2\", where ifname is form \"MODULE|PORT\"") + exit(-1) + +def cli_modify_string_to_tf_service(cli_create_str: str) -> Tuple[str, TFService]: + sargs = cli_create_str.split(";") + if len(sargs) == 4: + return (sargs[0], TFService(*sargs[1:], 0)) + if len(sargs) == 5: + sargs[-1] = int(sargs[-1]) + return (sargs[0], TFService(*sargs[1:])) + print("Invalid object create arguments. Expecting \"href;oid;ifname1;ifname2;bandwidthgbits\" or \"href;oid;ifname1;ifname2\", where ifname is form \"MODULE|PORT\"") + exit(-1) + +if args.consistency_mode: + ca = args.consistency_mode.split(";") + if 2 != len(ca): + print("Invalid consistency mode specification. Expecting \"asynchronous|synchronous|lifecycle;RETRY_INTERVAL_FLOAT_AS_S\"") + exit(-1) + consistency_mode = ConsistencyMode.from_str(ca[0]) + try: + retry_interval = float(ca[1]) + except ValueError: + print("Invalid consistency mode retry interval (non-float)") + exit(-1) +else: + consistency_mode = ConsistencyMode.lifecycle + retry_interval = 0.2 + +cm = CmConnection(args.ip, args.port, args.username, args.password, timeout=args.timeout, tls_verify=False, consistency_mode=consistency_mode, retry_interval=retry_interval) +if not cm.Connect(): + exit(-1) + +if args.list_constellations: + constellations = cm.list_constellations() + for constellation in constellations: + print("Constellation:", constellation.constellation_id) + for if_name in constellation.ifnames(): + print(f" {if_name}") + +if args.show_constellation_by_hub_name: + constellation = cm.get_constellation_by_hub_name(args.show_constellation_by_hub_name) + if constellation: + print(f"Constellation: {constellation.constellation_id}, traffic-mode: {constellation.traffic_mode}") + for if_name in constellation.ifnames(): + print(f" {if_name}") + +if args.create_connection: + tf_service = cli_create_string_to_tf_service(args.create_connection) + connection = Connection(from_tf_service=tf_service) + created_service = cm.create_connection(connection) + if created_service: + print(f"Created {created_service} for {connection}") + else: + print(f"Failed to create {connection}") + +if args.modify_connection: + href, tf_service = cli_modify_string_to_tf_service(args.modify_connection) + mc_args = args.modify_connection.split(";") + connection = Connection(from_tf_service=tf_service) + result = cm.update_connection(href, connection) + if result: + print(f"Updated {href} for {connection}") + else: + print(f"Failed to update {href} for {connection}") + +if args.show_connection_by_name: + connection = cm.get_connection_by_name(args.show_connection_by_name) + if connection: + print(str(connection)) + +if args.list_connections: + connections = cm.get_connections() + for c in connections: + print(str(c)) + +if args.delete_connection: + was_deleted = cm.delete_connection(args.delete_connection) + if was_deleted: + print(f"Successfully deleted {args.delete_connection}") + else: + print(f"Failed to delete {args.delete_connection}") + +if args.list_transport_capacities: + tcs = cm.get_transport_capacities() + for tc in tcs: + print(str(tc)) + +if args.create_transport_capacity: + tf_service = cli_create_string_to_tf_service(args.create_transport_capacity) + tc = TransportCapacity(from_tf_service=tf_service) + created_service = cm.create_transport_capacity(tc) + if created_service: + print(f"Created {created_service} for {tc}") + else: + print(f"Failed to create {tc}") + +if args.emulate_tf_set_config_service: + eargs = args.emulate_tf_set_config_service.split(";") + if len(eargs) < 5: + print("Mandatory tokens missing for --emulate-tf-set-config-service") + exit(-1) + + hub_module_name, uuid, input_sip, output_sip, capacity_value = eargs[0:5] + capacity_value = int(capacity_value) + config = { + "input_sip": input_sip, + "output_sip": output_sip, + "capacity_value": capacity_value, + "capacity_unit": "gigabit" + } + + constellation = cm.get_constellation_by_hub_name(hub_module_name) + + # Allow testing some of the VTI code before we have CM that has VTI + if len(eargs) > 5 and eargs[5] == "FORCE-VTI-ON": + constellation.traffic_mode = "VTIMode" + + if constellation is None: + print(f"Unable to find constellation for hub-module {hub_module_name}") + exit(-1) + result = tf.set_config_for_service(cm, constellation, uuid, config) + print(f"Emulated SetConfig() for service result: {result}") + if isinstance(result, Exception): + traceback.print_exception(result) diff --git a/src/device/service/drivers/xr/cm/__init__.py b/src/device/service/drivers/xr/cm/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf --- /dev/null +++ b/src/device/service/drivers/xr/cm/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/src/device/service/drivers/xr/cm/cm_connection.py b/src/device/service/drivers/xr/cm/cm_connection.py new file mode 100644 index 0000000000000000000000000000000000000000..8ee9ee236c6bcfd504d4044dd023ef3a61fe4802 --- /dev/null +++ b/src/device/service/drivers/xr/cm/cm_connection.py @@ -0,0 +1,523 @@ +#pylint: disable=invalid-name, missing-function-docstring, line-too-long, logging-fstring-interpolation, missing-class-docstring, missing-module-docstring +# 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 __future__ import annotations +import collections.abc +import logging +import json +import time +from typing import Optional, List, Dict, Union +import re +import requests +import urllib3 +from enum import Enum +from .connection import Connection +from .transport_capacity import TransportCapacity +from .constellation import Constellation + +# https://confluence.infinera.com/display/CR/XR+Network+Service +# https://confluence.infinera.com/pages/viewpage.action?spaceKey=CR&title=XR+Network+Connection+Service#XRNetworkConnectionService-North-boundInterface +# https://bitbucket.infinera.com/projects/XRCM/repos/cm-api/browse/yaml/ncs/v1/ncs.yaml + +LOGGER = logging.getLogger(__name__) + +class ExpiringValue: + def __init__(self, value, expiry): + self.__value = value + self.__expiry = expiry + self.__created = time.monotonic() + + def get_value(self): + return self.__value + + def is_valid_for(self, duration): + if self.__created + self.__expiry >= time.monotonic()+duration: + return True + else: + return False + +class UnexpectedEmptyBody(Exception): + pass + +# This is enum, not a regular class, see https://docs.python.org/3/library/enum.html +# String based enums require python 3.11, so use nunber based and custom parser +class ConsistencyMode(Enum): + asynchronous = 0 + synchronous = 1 + lifecycle = 2 + + @staticmethod + def from_str(s: str) -> ConsistencyMode: + if "synchronous" == s: + return ConsistencyMode.synchronous + elif "lifecycle" == s: + return ConsistencyMode.lifecycle + # Async is the default + return ConsistencyMode.asynchronous + +class HttpResult: + def __init__(self, method: str, url: str, params: Dict[str, any] = None): + self.method = method + self.url = url + self.text = None + self.json = None + self.status_code = None + self.params = params + self.exception = None + + def __str__(self): + status_code = self.status_code if self.status_code is not None else "" + if self.text: + if len(self.text) > 1024: + body_text = self.text[:1024] + "..." + else: + body_text = self.text + else: + body_text = "NONE" + return f"{self.method} {self.url} {self.params}, status {status_code}, body {body_text}" + + def process_http_response(self, response: requests.Response, permit_empty_body:bool = False): + LOGGER.info(f"process_http_response(): {self.method}: {self.url} qparams={self.params} ==> {response.status_code}") + self.status_code = response.status_code + if response.content != b'null' and len(response.text): + self.text = response.text + + try: + r_json = json.loads(response.text) + self.json = r_json + except json.JSONDecodeError as json_err: + LOGGER.info(f"{self.method}: {self.url} ==> response json decode error: {str(json_err)}") + self.exception = json_err + elif not permit_empty_body: + raise UnexpectedEmptyBody(f"No body in HTTP response for {self.method} {self.url} (status code {response.status_code}") + + def __bool__(self): + # Error codes start at 400, codes below it are successes + return self.status_code is not None and self.text is not None and self.status_code < 400 and self.exception is None + + def is_valid_with_status_ignore_body(self, expected_status_code: int) -> bool: + return self.status_code is not None and self.status_code == expected_status_code and self.exception is None + + def is_valid_json_with_status(self, expected_status_code: int) -> bool: + return bool(self) and self.status_code == expected_status_code and self.json is not None + + def is_valid_json_list_with_status(self, expected_status_code: int, min_entries=-1, max_entries=-1) -> bool: + if not self.is_valid_json_with_status(expected_status_code): + return False + if not isinstance(self.json, collections.abc.Sequence): + return False + + if min_entries >=0 and len(self.json) < min_entries: + return False + + if max_entries >=0 and len(self.json) > max_entries: + return False + return True + + def is_valid_json_obj_with_status(self, expected_status_code: int) -> bool: + if not self.is_valid_json_with_status(expected_status_code): + return False + if not isinstance(self.json, collections.abc.Mapping): + return False + + return True + +class CmConnection: + CONSISTENCY_WAIT_LOG_INTERVAL = 1.0 + + def __init__(self, address: str, port: int, username: str, password: str, timeout=30, tls_verify=True, consistency_mode: ConsistencyMode = ConsistencyMode.asynchronous, retry_interval: float=0.2, max_consistency_tries:int = 100_000) -> None: + self.__tls_verify = tls_verify + if not tls_verify: + urllib3.disable_warnings() + + self.__consistency_mode = consistency_mode + self.__timeout = timeout + self.__retry_interval = retry_interval if retry_interval > 0.01 else 0.01 + # Consistency tries limit is mostly useful for testing where it can be use to make + # test cases faster without timing dependency + self.__max_consistency_tries = max_consistency_tries + self.__username = username + self.__password = password + self.__cm_root = 'https://' + address + ':' + str(port) + self.__access_token = None + + def __perform_request(self, http_result: HttpResult, permit_empty_body: bool, fn, *args, **kwargs): + try: + response = fn(*args, **kwargs) + http_result.process_http_response(response, permit_empty_body) + except requests.exceptions.Timeout as e: + LOGGER.info(f"{http_result} ==> timeout") + http_result.exception = e + except Exception as e: # pylint: disable=broad-except + es=str(e) + LOGGER.info(f"{http_result} ==> unexpected exception: {es}") + http_result.exception = e + return http_result + + def __post_w_headers(self, path, data, headers, data_as_json=True) -> HttpResult: + url = self.__cm_root + path + rv = HttpResult("POST", url) + if data_as_json: + self.__perform_request(rv, False, requests.post, url, headers=headers, json=data, timeout=self.__timeout, verify=self.__tls_verify) + else: + self.__perform_request(rv, False, requests.post, url, headers=headers, data=data, timeout=self.__timeout, verify=self.__tls_verify) + return rv + + def __post(self, path, data, data_as_json=True) -> HttpResult: + return self.__post_w_headers(path, data, self.__http_headers(), data_as_json=data_as_json) + + def __put(self, path: str, data: Union[str,Dict[str, any]], data_as_json:bool =True, permit_empty_body:bool =True) -> HttpResult: + url = self.__cm_root + path + rv = HttpResult("PUT", url) + if data_as_json: + self.__perform_request(rv, permit_empty_body, requests.put, url, headers=self.__http_headers(), json=data, timeout=self.__timeout, verify=self.__tls_verify) + else: + self.__perform_request(rv, permit_empty_body, requests.put, url, headers=self.__http_headers(), data=data, timeout=self.__timeout, verify=self.__tls_verify) + return rv + + def __get(self, path, params: Dict[str, any]=None) -> HttpResult: + url = self.__cm_root + path + rv = HttpResult("GET", url, params) + self.__perform_request(rv, False, requests.get, url, headers=self.__http_headers(), timeout=self.__timeout,verify=self.__tls_verify, params=params) + return rv + + def __delete(self, path, data=None) -> HttpResult: + url = self.__cm_root + path + rv = HttpResult("DELETE", url) + self.__perform_request(rv, True, requests.delete, url, headers=self.__http_headers(), data=data, timeout=self.__timeout, verify=self.__tls_verify) + return rv + + def __http_headers(self): + self.__ensure_valid_access_token() + if self.__access_token: + return {'Authorization': 'Bearer '+ self.__access_token.get_value()} + else: + return {} + + def __acquire_access_token(self): + path = '/realms/xr-cm/protocol/openid-connect/token' + req = { + "username": self.__username, + "password": self.__password, + "grant_type": "password", + "client_secret": "xr-web-client", + "client_id": "xr-web-client" + } + resp = self.__post_w_headers(path, req, None, data_as_json=False) + # Slightly more verbose check/logging of failures for authentication to help + # diagnose connectivity problems + if resp.status_code is None: + LOGGER.error("Failed to contact authentication API endpoint") + return False + if not resp.is_valid_json_obj_with_status(200): + LOGGER.error(f"Authentication failure, status code {resp.status_code}, data {resp.text}") + return False + if 'access_token' not in resp.json: + LOGGER.error(f"Authentication failure: missing access_token in JSON, status code {resp.status_code}, data {resp.text}") + return False + access_token = resp.json['access_token'] + expires = int(resp.json["expires_in"]) if "expires_in" in resp.json else 0 + LOGGER.info(f"Obtained access token {access_token}, expires in {expires}") + self.__access_token = ExpiringValue(access_token, expires) + return True + + def __ensure_valid_access_token(self): + if not self.__access_token or not self.__access_token.is_valid_for(60): + self.__acquire_access_token() + + def Connect(self) -> bool: + return self.__acquire_access_token() + + def list_constellations(self) -> List[Constellation]: + r = self.__get("/api/v1/ns/xr-networks?content=expanded") + if not r.is_valid_json_list_with_status(200): + return [] + return [Constellation(c) for c in r.json] + + + def get_constellation_by_hub_name(self, hub_module_name: str) -> Optional[Constellation]: + qparams = [ + ('content', 'expanded'), + ('q', '{"hubModule.state.module.moduleName": "' + hub_module_name + '"}') + ] + r = self.__get("/api/v1/ns/xr-networks?content=expanded", params=qparams) + if not r.is_valid_json_list_with_status(200, 1, 1): + return None + return Constellation(r.json[0]) + + def get_transport_capacities(self) -> List[TransportCapacity]: + r= self.__get("/api/v1/ns/transport-capacities?content=expanded") + if not r.is_valid_json_list_with_status(200): + return [] + return [TransportCapacity(from_json=t) for t in r.json] + + def get_transport_capacity_by_name(self, tc_name: str) -> Optional[Connection]: + qparams = [ + ('content', 'expanded'), + ('q', '{"state.name": "' + tc_name + '"}') + ] + r = self.__get("/api/v1/ns/transport-capacities?content=expanded", params=qparams) + if not r.is_valid_json_list_with_status(200, 1, 1): + return TransportCapacity(from_json=r.json[0]) + else: + return None + + def get_transport_capacity_by_teraflow_uuid(self, uuid: str) -> Optional[Connection]: + return self.get_transport_capacity_by_name(f"TF:{uuid}") + + def create_transport_capacity(self, tc: TransportCapacity) -> Optional[str]: + # Create wants a list, so wrap connection to list + tc_config = [tc.create_config()] + resp = self.__post("/api/v1/ns/transport-capacities", tc_config) + if resp.is_valid_json_list_with_status(202, 1, 1) and "href" in resp.json[0]: + tc.href = resp.json[0]["href"] + LOGGER.info(f"Created transport-capcity {tc}") + #LOGGER.info(self.__get(f"/api/v1/ns/transport-capacities{tc.href}?content=expanded")) + return tc.href + else: + return None + + def delete_transport_capacity(self, href: str) -> bool: + resp = self.__delete(f"/api/v1/ns/transport-capacities{href}") + + # Returns empty body + if resp.is_valid_with_status_ignore_body(202): + LOGGER.info(f"Deleted transport-capacity {href=}") + return True + else: + LOGGER.info(f"Deleting transport-capacity {href=} failed, status {resp.status_code}") + return False + + def apply_create_consistency(self, obj, get_fn): + # Asynchronous, no validation + if self.__consistency_mode == ConsistencyMode.asynchronous: + return obj + + ts_start = time.perf_counter() + log_ts = ts_start + get_result = get_fn() + valid = False + limit = self.__max_consistency_tries + while True: + if get_result: + if self.__consistency_mode == ConsistencyMode.synchronous: + valid = True + break + if get_result.life_cycle_info.is_terminal_state(): + valid = True + break + else: + ts = time.perf_counter() + if ts - log_ts >= self.CONSISTENCY_WAIT_LOG_INTERVAL: + log_ts = ts + LOGGER.info(f"apply_create_consistency(): waiting for life cycle state progress for {get_result}, current: {str(get_result.life_cycle_info)}, ellapsed time {ts-ts_start} seconds") + else: + ts = time.perf_counter() + if ts - log_ts >= self.CONSISTENCY_WAIT_LOG_INTERVAL: + log_ts = ts + LOGGER.info(f"apply_create_consistency(): waiting for REST API object for {obj}, ellapsed time {ts-ts_start} seconds") + limit -= 1 + if limit < 0 or time.perf_counter() - ts_start > self.__timeout: + break + time.sleep(self.__retry_interval) + get_result = get_fn() + + duration = time.perf_counter() - ts_start + if not valid: + if get_result: + LOGGER.info(f"Failed to apply create consistency for {get_result}, insufficient life-cycle-state progress ({str(get_result.life_cycle_info)}), duration {duration} seconds") + else: + LOGGER.info(f"Failed to apply create consistency for {obj}, REST object did not appear, duration {duration} seconds") + return None + else: + LOGGER.info(f"Applied create consistency for {get_result}, final life-cycle-state {str(get_result.life_cycle_info)}, duration {duration} seconds") + + return get_result + + def apply_delete_consistency(self, href: str, get_fn): + # Asynchronous, no validation + if self.__consistency_mode == ConsistencyMode.asynchronous: + return None + + ts_start = time.perf_counter() + log_ts = ts_start + get_result = get_fn() + valid = False + limit = self.__max_consistency_tries + while True: + if not get_result: + # Object no longer exist, so this is completely successful operation + valid = True + break + else: + # In delete, treat terminal life cycle state as criteria for ConsistencyMode.synchronous: + # This is unobvious, but in delete non-existence is stronger guarantee than just lifecycle + # (so this is exact opposite ) + if get_result.life_cycle_info.is_terminal_state() and self.__consistency_mode == ConsistencyMode.synchronous: + valid = True + break + else: + ts = time.perf_counter() + if ts - log_ts >= self.CONSISTENCY_WAIT_LOG_INTERVAL: + log_ts = ts + if get_result.life_cycle_info.is_terminal_state(): + LOGGER.info(f"apply_delete_consistency(): waiting for delete to be reflected in REST API for {get_result}, current life-cycle-state: {str(get_result.life_cycle_info)}, ellapsed time {ts-ts_start} seconds") + else: + LOGGER.info(f"apply_delete_consistency(): waiting for life cycle state progress for {get_result}, current: {str(get_result.life_cycle_info)}, ellapsed time {ts-ts_start} seconds") + + limit -= 1 + if limit < 0 or time.perf_counter() - ts_start > self.__timeout: + break + time.sleep(self.__retry_interval) + get_result = get_fn() + + duration = time.perf_counter() - ts_start + if not valid: + if get_result: + if not get_result.life_cycle_info.is_terminal_state(): + LOGGER.info(f"Failed to apply create delete for {get_result}, insufficient life-cycle-state progress ({str(get_result.life_cycle_info)}), duration {duration} seconds") + else: + LOGGER.info(f"Failed to apply delete consistency for {get_result}, REST object did not dissappear, duration {duration} seconds") + else: + LOGGER.info(f"Applied delete consistency for {href}, duration {duration} seconds") + + return get_result + + def create_connection(self, connection: Connection) -> Optional[str]: + # Create wants a list, so wrap connection to list + cfg = [connection.create_config()] + + resp = self.__post("/api/v1/ncs/network-connections", cfg) + if resp.is_valid_json_list_with_status(202, 1, 1) and "href" in resp.json[0]: + connection.href = resp.json[0]["href"] + LOGGER.info(f"IPM accepted create request for connection {connection}") + new_connection = self.apply_create_consistency(connection, lambda: self.get_connection_by_href(connection.href)) + if new_connection: + LOGGER.info(f"Created connection {new_connection}") + return new_connection.href + else: + LOGGER.error(f"Consistency failure for connection {connection}, result {resp}") + return None + else: + LOGGER.error(f"Create failure for connection {connection}, result {resp}") + return None + + def update_connection(self, href: str, connection: Connection, existing_connection: Optional[Connection]=None) -> Optional[str]: + cfg = connection.create_config() + + # Endpoint updates + # Current CM implementation returns 501 (not implemented) for all of these actions + + # CM does not accept endpoint updates properly in same format that is used in initial creation. + # Instead we work around by using more granular APIs. + if "endpoints" in cfg: + del cfg["endpoints"] + if existing_connection is None: + existing_connection = self.get_connection_by_href(href) + ep_deletes, ep_creates, ep_updates = connection.get_endpoint_updates(existing_connection) + #print(ep_deletes) + #print(ep_creates) + #print(ep_updates) + + # Perform deletes + for ep_href in ep_deletes: + resp = self.__delete(f"/api/v1/ncs{ep_href}") + if resp.is_valid_with_status_ignore_body(202): + LOGGER.info(f"update_connection: EP-UPDATE: Deleted connection endpoint {ep_href}") + else: + LOGGER.info(f"update_connection: EP-UPDATE: Failed to delete connection endpoint {ep_href}: {resp}") + + # Update capacities for otherwise similar endpoints + for ep_href, ep_cfg in ep_updates: + resp = self.__put(f"/api/v1/ncs{ep_href}", ep_cfg) + if resp.is_valid_with_status_ignore_body(202): + LOGGER.info(f"update_connection: EP-UPDATE: Updated connection endpoint {ep_href} with {ep_cfg}") + else: + LOGGER.info(f"update_connection: EP-UPDATE: Failed to update connection endpoint {ep_href} with {ep_cfg}: {resp}") + + # Perform adds + resp = self.__post(f"/api/v1/ncs{href}/endpoints", ep_creates) + if resp.is_valid_json_list_with_status(202, 1, 1) and "href" in resp.json[0]: + LOGGER.info(f"update_connection: EP-UPDATE: Created connection endpoints {resp.json[0]} with {ep_creates}") + else: + LOGGER.info(f"update_connection: EP-UPDATE: Failed to create connection endpoints {resp.json[0] if resp.json else None} with {ep_creates}: {resp}") + + # Connection update (excluding endpoints) + resp = self.__put(f"/api/v1/ncs{href}", cfg) + # Returns empty body + if resp.is_valid_with_status_ignore_body(202): + LOGGER.info(f"update_connection: Updated connection {connection}") + # Return href used for update to be consisten with create + return href + else: + LOGGER.error(f"update_connection: Update failure for connection {connection}, result {resp}") + return None + + def delete_connection(self, href: str) -> bool: + resp = self.__delete(f"/api/v1/ncs{href}") + #print(resp) + # Returns empty body + if resp.is_valid_with_status_ignore_body(202): + self.apply_delete_consistency(href, lambda: self.get_connection_by_href(href)) + LOGGER.info(f"Deleted connection {href=}") + return True + else: + return False + + # Always does the correct thing, that is update if present, otherwise create + def create_or_update_connection(self, connection: Connection) -> Optional[str]: + existing_connection = self.get_connection_by_name(connection.name) + if existing_connection: + return self.update_connection(existing_connection.href, connection, existing_connection) + else: + return self.create_connection(connection) + + def get_connection_by_name(self, connection_name: str) -> Optional[Connection]: + qparams = [ + ('content', 'expanded'), + ('q', '{"state.name": "' + connection_name + '"}') + ] + r = self.__get("/api/v1/ncs/network-connections", params=qparams) + if r.is_valid_json_list_with_status(200, 1, 1): + return Connection(from_json=r.json[0]) + else: + return None + + def get_connection_by_href(self, href: str) -> Optional[Connection]: + qparams = [ + ('content', 'expanded'), + ] + r = self.__get(f"/api/v1/ncs{href}", params=qparams) + if r.is_valid_json_obj_with_status(200): + return Connection(from_json=r.json) + else: + return None + + def get_connection_by_teraflow_uuid(self, uuid: str) -> Optional[Connection]: + return self.get_connection_by_name(f"TF:{uuid}") + + def get_connections(self): + r = self.__get("/api/v1/ncs/network-connections?content=expanded") + if r.is_valid_json_list_with_status(200): + return [Connection(from_json=c) for c in r.json] + else: + return [] + + def service_uuid(self, key: str) -> Optional[str]: + service = re.match(r"^/service\[(.+)\]$", key) + if service: + return service.group(1) + else: + return None diff --git a/src/device/service/drivers/xr/cm/connection.py b/src/device/service/drivers/xr/cm/connection.py new file mode 100644 index 0000000000000000000000000000000000000000..98736cce534685189069703d9560b9d34b1d8007 --- /dev/null +++ b/src/device/service/drivers/xr/cm/connection.py @@ -0,0 +1,228 @@ +#pylint: disable=invalid-name, missing-function-docstring, line-too-long, logging-fstring-interpolation, missing-class-docstring, missing-module-docstring +# 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 __future__ import annotations +from typing import Dict, Optional +from dataclasses import dataclass +from .tf_service import TFService +from .utils import make_selector, set_optional_parameter + +class InconsistentVlanConfiguration(Exception): + pass + +@dataclass +class CEndpoint: + module: str + port: str + # Emulated/translated VLAN. May also be a letter + # Only present on TF side, never on gets from CM. + # VLAN is never transmitted to wire on endpoint, it is purely an internal construct + # However VLAN is part of the whole connection + vlan: str + capacity: int + href: Optional[str] + + def ifname(self) -> str: + if self.vlan is None: + return self.module + "|" + self.port + else: + return self.module + "|" + self.port + "." + self.vlan + + def portname(self) -> str: + return self.module + "|" + self.port + + def __str__(self): + return f"({self.ifname()}, {self.capacity})" + + def create_config(self) -> Dict[str, any]: + cfg = { + # VLAN is intentionally ignored here (None argument below) + "selector": make_selector(self.module, self.port, None) + } + if self.capacity > 0: + cfg["capacity"] = self.capacity + + return cfg + +@dataclass +class LifeCycleInfo: + # State is None (if not known), or one of the following (in future there might be more, so lets not assuem too much) + # 'pendingConfiguration': This state occurs when one of the network connection modules is pending configuration or pending deletion. + # 'configured': This state occurs when all network connection modules are configured. + # 'configurationFailed': This state may occur when at least a configuration of a module from this network connection failed or timeout. + # 'pendingDeletion': This state may occur when a request to delete this network connection is being processed. + # 'deletionFailed': This state may occur when at least a removal of a module from this network connection failed or timeout. + # 'networkConflict': This state may occur when there is a conflict in a network connection module configuration. + # 'deleted': This state occurs when a network connection is removed. + state: Optional[str] + reason: Optional[str] + + def is_terminal_state(self) -> bool: + if self.state is None: + return True + if self.state.endswith('Failed') or self.state.endswith('Conflict'): + return True + if self.state == "configured" or self.state == "deleted": + return True + return False + + def __str__(self): + state_str = "unknown" if self.state is None else self.state + if self.reason: + return f"({state_str} (reason: {self.reason})" + return state_str + + @staticmethod + def new_from_top_level_json(json_dict: Dict[str, any]) -> LifeCycleInfo: + if "state" not in json_dict: + return LifeCycleInfo(None, None) + state = json_dict["state"] + return LifeCycleInfo(state.get("lifecycleState", None), state.get("lifecycleReason", None)) + + @staticmethod + def new_unknown() -> LifeCycleInfo: + return LifeCycleInfo(None, "not yet communicated with IPM") + +class ConnectionDeserializationError(Exception): + pass + +class Connection: + def __init__(self, from_json: Optional[Dict[str, any]] = None, from_tf_service: Optional[TFService] = None): + def get_endpoint_mod_aid(endpoint: Dict[str, any]) -> Optional[str]: + try: + return (endpoint["state"]["moduleIf"]["moduleName"], endpoint["state"]["moduleIf"]["clientIfAid"]) + except KeyError: + return None + + def get_endpoint_capacity(endpoint: Dict[str, any]) -> int: + try: + return int(endpoint["state"]["capacity"]) + except KeyError: + return 0 + + if from_json: + try: + config = from_json["config"] + state = from_json["state"] + self.name = state["name"] if "name" in state else None #Name is optional + self.serviceMode = state["serviceMode"] + # Implicit transport capacity is a string, where value "none" has special meaning. + # So "none" is correct value, not "None" for missing attribute + self.implicitTransportCapacity = config["implicitTransportCapacity"] if "implicitTransportCapacity" in config else "none" + self.mc = config["mc"] if "mc" in config else None + self.vlan_filter = state["outerVID"] if "outerVID" in state else None + self.href = from_json["href"] + + self.endpoints = [] + for ep in from_json["endpoints"]: + ep_mod_aip = get_endpoint_mod_aid(ep) + if ep_mod_aip: + self.endpoints.append(CEndpoint(*ep_mod_aip, None, get_endpoint_capacity(ep), ep["href"])) + + self.life_cycle_info = LifeCycleInfo.new_from_top_level_json(from_json) + self.cm_data = from_json + except KeyError as e: + raise ConnectionDeserializationError(f"Missing mandatory key {str(e)}") from e + elif from_tf_service: + self.href = None + self.name = from_tf_service.name() + self.endpoints = [CEndpoint(mod, port, vlan, from_tf_service.capacity, None) for mod,port,vlan in from_tf_service.get_endpoints_mod_aid_vlan()] + # Service mode guessing has to be AFTER endpoint assigment. + # The heuristic used is perfectly valid in context of TF where we always encode + # VLANs to interface names. Correspondingly cm-cli user has to know + # to use VLANs on low level test APIs when using VTI mode. + self.serviceMode = self.__guess_service_mode_from_emulated_enpoints() + if self.serviceMode == "XR-L1": + self.vlan_filter = None + self.mc = None + self.implicitTransportCapacity ="portMode" + else: + self.vlan_filter = str(self.__guess_vlan_id()) + " " # Needs to be in string format, can contain ranges, regexp is buggy, trailin space is needed for single VLAN + self.mc = "matchOuterVID" + # String "none" has a special meaning for implicitTransportCapacity + self.implicitTransportCapacity ="none" + + self.life_cycle_info = LifeCycleInfo.new_unknown() + self.cm_data = None + else: + # May support other initializations in future + raise ConnectionDeserializationError("JSON dict missing") + + def __str__(self): + name = self.name if self.name else "" + endpoints = ", ".join((str(ep) for ep in self.endpoints)) + return f"name: {name}, id: {self.href}, service-mode: {self.serviceMode}, end-points: [{endpoints}]" + + def __guess_service_mode_from_emulated_enpoints(self): + for ep in self.endpoints: + if ep.vlan is not None: + return "XR-VTI-P2P" + return "XR-L1" + + def __guess_vlan_id(self) -> int: + vlans = [] + for ep in self.endpoints: + if ep.vlan is not None and ep.vlan.isnumeric(): + vlans.append(int(ep.vlan)) + if not vlans: + raise InconsistentVlanConfiguration("VLAN ID is not encoded in TF interface names for VTI mode service") + else: + for vlan in vlans: + if vlan != vlans[0]: + raise InconsistentVlanConfiguration(f"VLAN configuration must match at both ends of the connection, {vlans[0]} != {vlan}") + return vlans[0] + + def create_config(self) -> Dict[str, any]: + cfg = {} + set_optional_parameter(cfg, "name", self.name) + cfg["serviceMode"] = self.serviceMode + cfg["implicitTransportCapacity"] = self.implicitTransportCapacity + if self.endpoints: + cfg["endpoints"] = [ep.create_config() for ep in self.endpoints] + set_optional_parameter(cfg, "outerVID", self.vlan_filter) + set_optional_parameter(cfg, "mc", self.mc) + #print(cfg) + return cfg + + def get_port_map(self) -> Dict[str, CEndpoint]: + return {ep.portname(): ep for ep in self.endpoints } + + # Type hint has to be string, because future annotations (enclosing class) + # is not yet widely available + def get_endpoint_updates(self, old: Optional['Connection']): # -> Tuple[List[str], List[Dict[str, any], List[Tuple[str, Dict[str, any]]]]]: + new_ports = self.get_port_map() + + if old is None: + return ([], [new_ep.create_config() for new_ep in new_ports.values()], []) + + # Can only compute difference against get from CM, as hrefs are needed + assert old.cm_data is not None + + old_ports = old.get_port_map() + + deletes = [] + creates = [] + updates = [] + for port, old_ep in old_ports.items(): + if port not in new_ports: + assert old_ep.href is not None + deletes.append(old_ep.href) + + for port, new_ep in new_ports.items(): + if port not in old_ports: + creates.append(new_ep.create_config()) + elif old_ports[port].capacity != new_ep.capacity: + updates.append((old_ports[port].href, {"capacity": new_ep.capacity})) + return deletes, creates, updates diff --git a/src/device/service/drivers/xr/cm/constellation.py b/src/device/service/drivers/xr/cm/constellation.py new file mode 100644 index 0000000000000000000000000000000000000000..f93be0eaeb9195bfe409242f6f535e3b4d8dd7b0 --- /dev/null +++ b/src/device/service/drivers/xr/cm/constellation.py @@ -0,0 +1,69 @@ +#pylint: disable=invalid-name, missing-function-docstring, line-too-long, logging-fstring-interpolation, missing-class-docstring, missing-module-docstring, wildcard-import, unused-wildcard-import +# 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 typing import List +from .utils import * + +class ConstellationDeserializationError(Exception): + pass + +class Constellation: + def __init__(self, from_json=None): + if from_json: + try: + self.constellation_id = from_json["id"] + self.__hub_interfaces = [] + self.__leaf_interfaces = [] + self.__traffic_mode = None + # Intentional simplification for Teraflow. Constellation could have + # diverse traffic modes, however that does not occur in intended TF usage. + if "hubModule" in from_json: + hub = from_json["hubModule"] + self.traffic_mode = hub["state"]["module"]["trafficMode"] + self.__hub_interfaces.extend(get_constellation_module_ifnames(hub)) + if "leafModules" in from_json: + for leaf in from_json["leafModules"]: + if not self.__traffic_mode: + self.traffic_mode = leaf["state"]["module"]["trafficMode"] + self.__leaf_interfaces.extend(get_constellation_module_ifnames(leaf)) + except KeyError as e: + raise ConstellationDeserializationError(f"Missing mandatory key {str(e)}") from e + else: + # May support other initializations in future + raise ConstellationDeserializationError("JSON dict missing") + + def add_vlan_posfix(ifname, is_hub): + if is_hub: + # +100 so we don't need to worry about special meanings of VLANs 0 and 1 + return [f"{ifname}.{vlan+100}" for vlan in range(0,16)] + else: + return [f"{ifname}.{chr(ord('a') + vlan)}" for vlan in range(0,16)] + + self.__vti_hub_interfaces = [] + self.__vti_leaf_interfaces = [] + if self.is_vti_mode(): + for ifname in self.__hub_interfaces: + self.__vti_hub_interfaces.extend(add_vlan_posfix(ifname, True)) + for ifname in self.__leaf_interfaces: + self.__vti_leaf_interfaces.extend(add_vlan_posfix(ifname, False)) + + def ifnames(self) -> List[str]: + if self.is_vti_mode(): + return self.__vti_hub_interfaces + self.__vti_leaf_interfaces + else: + return self.__hub_interfaces + self.__leaf_interfaces + + def is_vti_mode(self) -> bool: + return self.traffic_mode != "L1Mode" diff --git a/src/device/service/drivers/xr/cm/tests/__init__.py b/src/device/service/drivers/xr/cm/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf --- /dev/null +++ b/src/device/service/drivers/xr/cm/tests/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/src/device/service/drivers/xr/cm/tests/resources/connections-expanded.json b/src/device/service/drivers/xr/cm/tests/resources/connections-expanded.json new file mode 100644 index 0000000000000000000000000000000000000000..f4ee31189cb0dc698d4d79420bef4a8df6874b0e --- /dev/null +++ b/src/device/service/drivers/xr/cm/tests/resources/connections-expanded.json @@ -0,0 +1,294 @@ +[ + { + "config": { + "name": "FooBar123", + "serviceMode": "XR-L1", + "implicitTransportCapacity": "portMode" + }, + "endpoints": [ + { + "acs": [], + "config": { + "selector": {} + }, + "href": "/network-connections/4505d5d3-b2f3-40b8-8ec2-4a5b28523c03/endpoints/230516d0-7e38-44b1-b174-1ba7d4454ee6", + "id": "230516d0-7e38-44b1-b174-1ba7d4454ee6", + "parentId": "4505d5d3-b2f3-40b8-8ec2-4a5b28523c03", + "rt": [ + "cm.network-connection.endpoint" + ], + "state": { + "hostPort": { + "chassisId": "192.168.101.1", + "chassisIdSubtype": "networkAddress", + "name": "", + "portDescr": "et-1/0/0:0", + "portId": "et-1/0/0:0", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:11:01", + "sysName": "PaloAlto" + }, + "moduleIf": { + "clientIfAid": "XR-T1", + "clientIfColId": 1, + "clientIfPortSpeed": 100, + "currentRole": "leaf", + "macAddress": "00:0B:F8:00:01:01", + "moduleId": "555a0f6e-285d-4a97-70f2-9fa4201d422d", + "moduleName": "XR LEAF 1", + "serialNumber": "00000000B" + } + } + }, + { + "acs": [], + "config": { + "selector": {} + }, + "href": "/network-connections/4505d5d3-b2f3-40b8-8ec2-4a5b28523c03/endpoints/1d58ba8f-4d51-4213-83e1-97a0e0bdd388", + "id": "1d58ba8f-4d51-4213-83e1-97a0e0bdd388", + "parentId": "4505d5d3-b2f3-40b8-8ec2-4a5b28523c03", + "rt": [ + "cm.network-connection.endpoint" + ], + "state": { + "hostPort": { + "chassisId": "192.168.100.1", + "chassisIdSubtype": "networkAddress", + "name": "", + "portDescr": "et-1/0/0:0", + "portId": "et-1/0/0:0", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:00:11", + "sysName": "SanJose" + }, + "moduleIf": { + "clientIfAid": "XR-T1", + "clientIfColId": 1, + "clientIfPortSpeed": 100, + "currentRole": "hub", + "macAddress": "00:0B:F8:00:00:01", + "moduleId": "e1d3a030-4f19-4efc-50c0-5a48609ad356", + "moduleName": "XR HUB 1", + "serialNumber": "000000009" + } + } + } + ], + "href": "/network-connections/4505d5d3-b2f3-40b8-8ec2-4a5b28523c03", + "id": "4505d5d3-b2f3-40b8-8ec2-4a5b28523c03", + "lcs": [ + { + "config": { + "clientAid": "XR-T1", + "direction": "txRx", + "dscgAid": "XR-L1-C1-DSCG1", + "moduleId": "555a0f6e-285d-4a97-70f2-9fa4201d422d" + }, + "href": "/lcs/5872e191-774f-4ae9-841a-ea743be01973", + "id": "5872e191-774f-4ae9-841a-ea743be01973", + "parentIds": [ + "4505d5d3-b2f3-40b8-8ec2-4a5b28523c03" + ], + "rt": [ + "cm.network-connection.local-connection" + ], + "state": { + "clientAid": "XR-T1", + "colId": 1, + "direction": "txRx", + "dscgAid": "XR-L1-C1-DSCG1", + "lcAid": "XR-T1,XR-L1-C1-DSCG1-1-ODUji-1", + "lineAid": "XR-L1-C1-DSCG1-1-ODUji-1", + "macAddress": "00:0B:F8:00:01:01", + "moduleId": "555a0f6e-285d-4a97-70f2-9fa4201d422d", + "remoteClientAid": "XR-T1", + "remoteModuleId": "00:0B:F8:00:00:01" + } + }, + { + "config": { + "clientAid": "XR-T1", + "direction": "txRx", + "dscgAid": "XR-L1-C1-DSCG1", + "moduleId": "e1d3a030-4f19-4efc-50c0-5a48609ad356" + }, + "href": "/lcs/c96a7954-2d12-48aa-8cfb-6a3cf5566cb0", + "id": "c96a7954-2d12-48aa-8cfb-6a3cf5566cb0", + "parentIds": [ + "4505d5d3-b2f3-40b8-8ec2-4a5b28523c03" + ], + "rt": [ + "cm.network-connection.local-connection" + ], + "state": { + "clientAid": "XR-T1", + "colId": 1, + "direction": "txRx", + "dscgAid": "XR-L1-C1-DSCG1", + "lcAid": "XR-T1,XR-L1-C1-DSCG1-1-ODUji-1", + "lineAid": "XR-L1-C1-DSCG1-1-ODUji-1", + "macAddress": "00:0B:F8:00:00:01", + "moduleId": "e1d3a030-4f19-4efc-50c0-5a48609ad356", + "remoteClientAid": "XR-T1", + "remoteModuleId": "00:0B:F8:00:01:01" + } + } + ], + "rt": [ + "cm.network-connection" + ], + "state": { + "createdBy": "host", + "lifecycleState": "configured", + "name": "FooBar123", + "serviceMode": "XR-L1", + "implicitTransportCapacity": "portMode" + } + }, + { + "config": { + "serviceMode": "XR-L1", + "implicitTransportCapacity": "portMode" + }, + "endpoints": [ + { + "acs": [], + "config": { + "selector": {} + }, + "href": "/network-connections/138f0cc0-3dc6-4195-97c0-2cbed5fd59ba/endpoints/59027aa4-858b-4d62-86b9-0f2d3738619c", + "id": "59027aa4-858b-4d62-86b9-0f2d3738619c", + "parentId": "138f0cc0-3dc6-4195-97c0-2cbed5fd59ba", + "rt": [ + "cm.network-connection.endpoint" + ], + "state": { + "hostPort": { + "chassisId": "192.168.100.1", + "chassisIdSubtype": "networkAddress", + "name": "", + "portDescr": "et-2/0/0:0", + "portId": "et-2/0/0:0", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:00:21", + "sysName": "SanJose" + }, + "moduleIf": { + "clientIfAid": "XR-T1", + "clientIfColId": 1, + "clientIfPortSpeed": 100, + "currentRole": "hub", + "macAddress": "00:0B:F8:00:00:02", + "moduleId": "b6577725-9939-4b60-6be9-603bd210cde1", + "moduleName": "XR HUB 2", + "serialNumber": "00000000A" + } + } + }, + { + "acs": [], + "config": { + "selector": {} + }, + "href": "/network-connections/138f0cc0-3dc6-4195-97c0-2cbed5fd59ba/endpoints/b2fc53e2-41a1-4fe5-8f03-f91a11e52661", + "id": "b2fc53e2-41a1-4fe5-8f03-f91a11e52661", + "parentId": "138f0cc0-3dc6-4195-97c0-2cbed5fd59ba", + "rt": [ + "cm.network-connection.endpoint" + ], + "state": { + "hostPort": { + "chassisId": "192.168.101.3", + "chassisIdSubtype": "networkAddress", + "name": "", + "portDescr": "et-3/0/0:0", + "portId": "et-3/0/0:0", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:13:01", + "sysName": "Sunnnyvale" + }, + "moduleIf": { + "clientIfAid": "XR-T1", + "clientIfColId": 1, + "clientIfPortSpeed": 100, + "currentRole": "leaf", + "macAddress": "00:0B:F8:00:01:03", + "moduleId": "00c6875e-21bf-4934-51c7-125ebd8d0559", + "moduleName": "XR LEAF 3", + "serialNumber": "00000000D" + } + } + } + ], + "href": "/network-connections/138f0cc0-3dc6-4195-97c0-2cbed5fd59ba", + "id": "138f0cc0-3dc6-4195-97c0-2cbed5fd59ba", + "lcs": [ + { + "config": { + "clientAid": "XR-T1", + "direction": "txRx", + "dscgAid": "XR-L1-C1-DSCG1", + "moduleId": "00c6875e-21bf-4934-51c7-125ebd8d0559" + }, + "href": "/lcs/0f8fe422-4f4e-4e78-8489-ee85031e083c", + "id": "0f8fe422-4f4e-4e78-8489-ee85031e083c", + "parentIds": [ + "138f0cc0-3dc6-4195-97c0-2cbed5fd59ba" + ], + "rt": [ + "cm.network-connection.local-connection" + ], + "state": { + "clientAid": "XR-T1", + "colId": 1, + "direction": "txRx", + "dscgAid": "XR-L1-C1-DSCG1", + "lcAid": "XR-T1,XR-L1-C1-DSCG1-1-ODUji-1", + "lineAid": "XR-L1-C1-DSCG1-1-ODUji-1", + "macAddress": "00:0B:F8:00:01:03", + "moduleId": "00c6875e-21bf-4934-51c7-125ebd8d0559", + "remoteClientAid": "XR-T1", + "remoteModuleId": "00:0B:F8:00:00:02" + } + }, + { + "config": { + "clientAid": "XR-T1", + "direction": "txRx", + "dscgAid": "XR-L1-C1-DSCG1", + "moduleId": "b6577725-9939-4b60-6be9-603bd210cde1" + }, + "href": "/lcs/7c769310-22b5-4d4c-8e9d-386a8083c611", + "id": "7c769310-22b5-4d4c-8e9d-386a8083c611", + "parentIds": [ + "138f0cc0-3dc6-4195-97c0-2cbed5fd59ba" + ], + "rt": [ + "cm.network-connection.local-connection" + ], + "state": { + "clientAid": "XR-T1", + "colId": 1, + "direction": "txRx", + "dscgAid": "XR-L1-C1-DSCG1", + "lcAid": "XR-T1,XR-L1-C1-DSCG1-1-ODUji-1", + "lineAid": "XR-L1-C1-DSCG1-1-ODUji-1", + "macAddress": "00:0B:F8:00:00:02", + "moduleId": "b6577725-9939-4b60-6be9-603bd210cde1", + "remoteClientAid": "XR-T1", + "remoteModuleId": "00:0B:F8:00:01:03" + } + } + ], + "rt": [ + "cm.network-connection" + ], + "state": { + "createdBy": "host", + "lifecycleState": "configured", + "serviceMode": "XR-L1", + "implicitTransportCapacity": "portMode" + } + } +] \ No newline at end of file diff --git a/src/device/service/drivers/xr/cm/tests/resources/constellation-by-name-hub1.json b/src/device/service/drivers/xr/cm/tests/resources/constellation-by-name-hub1.json new file mode 100644 index 0000000000000000000000000000000000000000..061d6453edebc764a96fe3eaeace1168200b1a20 --- /dev/null +++ b/src/device/service/drivers/xr/cm/tests/resources/constellation-by-name-hub1.json @@ -0,0 +1,388 @@ +[ + { + "href": "/xr-networks/233e169b-5d88-481d-bfe2-c909a2a859dd", + "hubModule": { + "href": "/xr-networks/233e169b-5d88-481d-bfe2-c909a2a859dd/hubModule", + "id": "519cc31f-b736-4e4c-b78d-600562d92911", + "parentId": "233e169b-5d88-481d-bfe2-c909a2a859dd", + "rt": [ + "cm.xr-network.hubModule" + ], + "state": { + "endpoints": [ + { + "hostPort": { + "chassisId": "192.168.100.1", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-1/0/0:0", + "portId": "et-1/0/0:0", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:00:11", + "sysName": "SanJose" + }, + "moduleIf": { + "clientIfAid": "XR-T1", + "clientIfColId": 1, + "clientIfPortSpeed": 100 + } + }, + { + "hostPort": { + "chassisId": "192.168.100.1", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-1/0/0:1", + "portId": "et-1/0/0:1", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:00:12", + "sysName": "SanJose" + }, + "moduleIf": { + "clientIfAid": "XR-T2", + "clientIfColId": 2, + "clientIfPortSpeed": 100 + } + }, + { + "hostPort": { + "chassisId": "192.168.100.1", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-1/0/0:2", + "portId": "et-1/0/0:2", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:00:13", + "sysName": "SanJose" + }, + "moduleIf": { + "clientIfAid": "XR-T3", + "clientIfColId": 3, + "clientIfPortSpeed": 100 + } + }, + { + "hostPort": { + "chassisId": "192.168.100.1", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-1/0/0:3", + "portId": "et-1/0/0:3", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:00:14", + "sysName": "SanJose" + }, + "moduleIf": { + "clientIfAid": "XR-T4", + "clientIfColId": 4, + "clientIfPortSpeed": 100 + } + } + ], + "lifecycleState": "configured", + "module": { + "baudRate": 50, + "capacity": 400, + "clientPortMode": "ethernet", + "configuredRole": "auto", + "constellationFrequency": 192000000, + "currentRole": "hub", + "fiberConnectionMode": "dual", + "frequencyCtrl": "xr", + "macAddress": "00:0B:F8:00:00:01", + "modulation": "16QAM", + "moduleId": "d859de3c-c463-4be5-7a8d-a198275f10f4", + "moduleName": "XR HUB 1", + "ncoFrequency": 0, + "operatingFrequency": 192000000, + "roleStatus": "ready", + "serialNumber": "000000009", + "trafficMode": "L1Mode", + "txPowerTargetPerDsc": -6.4 + } + } + }, + "id": "233e169b-5d88-481d-bfe2-c909a2a859dd", + "leafModules": [ + { + "href": "/xr-networks/233e169b-5d88-481d-bfe2-c909a2a859dd/leafModules/7e9da66b-8bf8-4eea-b4a7-045e5ba3bfd8", + "id": "7e9da66b-8bf8-4eea-b4a7-045e5ba3bfd8", + "parentId": "233e169b-5d88-481d-bfe2-c909a2a859dd", + "rt": [ + "cm.xr-network.leafModule" + ], + "state": { + "endpoints": [ + { + "hostPort": { + "chassisId": "192.168.101.1", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-1/0/0:0", + "portId": "et-1/0/0:0", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:11:01", + "sysName": "PaloAlto" + }, + "moduleIf": { + "clientIfAid": "XR-T1", + "clientIfColId": 1, + "clientIfPortSpeed": 100 + } + } + ], + "lifecycleState": "configured", + "module": { + "baudRate": 50, + "capacity": 100, + "clientPortMode": "ethernet", + "configuredRole": "auto", + "constellationFrequency": 192000000, + "currentRole": "leaf", + "fiberConnectionMode": "dual", + "frequencyCtrl": "xr", + "macAddress": "00:0B:F8:00:01:01", + "maxAllowedDSCs": 4, + "modulation": "16QAM", + "moduleId": "7c33d7d0-4f7b-4525-5d57-58589adbd47c", + "moduleName": "XR LEAF 1", + "ncoFrequency": 0, + "operatingFrequency": 192000000, + "roleStatus": "ready", + "serialNumber": "00000000B", + "trafficMode": "L1Mode", + "txPowerTargetPerDsc": -6.4 + } + } + }, + { + "href": "/xr-networks/233e169b-5d88-481d-bfe2-c909a2a859dd/leafModules/7473b336-ef92-4508-b260-c096d05e4943", + "id": "7473b336-ef92-4508-b260-c096d05e4943", + "parentId": "233e169b-5d88-481d-bfe2-c909a2a859dd", + "rt": [ + "cm.xr-network.leafModule" + ], + "state": { + "endpoints": [ + { + "hostPort": { + "chassisId": "192.168.101.2", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-2/0/0:0", + "portId": "et-2/0/0:0", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:12:01", + "sysName": "Cupertino" + }, + "moduleIf": { + "clientIfAid": "XR-T1", + "clientIfColId": 1, + "clientIfPortSpeed": 100 + } + } + ], + "lifecycleState": "configured", + "module": { + "baudRate": 50, + "capacity": 100, + "clientPortMode": "ethernet", + "configuredRole": "auto", + "constellationFrequency": 192000000, + "currentRole": "leaf", + "fiberConnectionMode": "dual", + "frequencyCtrl": "xr", + "macAddress": "00:0B:F8:00:01:02", + "maxAllowedDSCs": 4, + "modulation": "16QAM", + "moduleId": "d68a6b4e-03e4-4c89-5ad5-c5e782325e40", + "moduleName": "XR LEAF 2", + "ncoFrequency": 0, + "operatingFrequency": 192000000, + "roleStatus": "ready", + "serialNumber": "00000000C", + "trafficMode": "L1Mode", + "txPowerTargetPerDsc": -6.4 + } + } + } + ], + "reachableModules": [ + { + "href": "/xr-networks/233e169b-5d88-481d-bfe2-c909a2a859dd/reachableModules/58785cd9-c642-43e4-a8b5-6d136acd8ae5", + "id": "58785cd9-c642-43e4-a8b5-6d136acd8ae5", + "parentId": "233e169b-5d88-481d-bfe2-c909a2a859dd", + "rt": [ + "cm.xr-network.reachableModule" + ], + "state": { + "discoveredTime": "2022-06-28T09:04:08Z", + "endpoints": [ + { + "hostPort": { + "chassisId": "192.168.101.3", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-3/0/0:0", + "portId": "et-3/0/0:0", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:13:01", + "sysName": "Sunnnyvale" + }, + "moduleIf": { + "clientIfAid": "XR-T1", + "clientIfColId": 1, + "clientIfPortSpeed": 100 + } + } + ], + "module": { + "baudRate": 50, + "capacity": 100, + "clientPortMode": "ethernet", + "configuredRole": "auto", + "constellationFrequency": 193000000, + "currentRole": "leaf", + "fiberConnectionMode": "dual", + "frequencyCtrl": "xr", + "macAddress": "00:0B:F8:00:01:03", + "modulation": "16QAM", + "moduleId": "572b2d8a-8d0b-40a0-5823-e53041ca2194", + "moduleName": "XR LEAF 3", + "ncoFrequency": 0, + "operatingFrequency": 193000000, + "roleStatus": "ready", + "serialNumber": "00000000D", + "trafficMode": "L1Mode", + "txPowerTargetPerDsc": -6.4 + } + } + }, + { + "href": "/xr-networks/233e169b-5d88-481d-bfe2-c909a2a859dd/reachableModules/be85d276-6f30-4c7b-9f63-de8679dfab85", + "id": "be85d276-6f30-4c7b-9f63-de8679dfab85", + "parentId": "233e169b-5d88-481d-bfe2-c909a2a859dd", + "rt": [ + "cm.xr-network.reachableModule" + ], + "state": { + "discoveredTime": "2022-06-28T09:04:05Z", + "endpoints": [ + { + "hostPort": { + "chassisId": "192.168.101.1", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-1/0/0:0", + "portId": "et-1/0/0:0", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:11:01", + "sysName": "PaloAlto" + }, + "moduleIf": { + "clientIfAid": "XR-T1", + "clientIfColId": 1, + "clientIfPortSpeed": 100 + } + } + ], + "module": { + "baudRate": 50, + "capacity": 100, + "clientPortMode": "ethernet", + "configuredRole": "auto", + "constellationFrequency": 192000000, + "currentRole": "leaf", + "fiberConnectionMode": "dual", + "frequencyCtrl": "xr", + "macAddress": "00:0B:F8:00:01:01", + "modulation": "16QAM", + "moduleId": "7c33d7d0-4f7b-4525-5d57-58589adbd47c", + "moduleName": "XR LEAF 1", + "ncoFrequency": 0, + "operatingFrequency": 192000000, + "roleStatus": "ready", + "serialNumber": "00000000B", + "trafficMode": "L1Mode", + "txPowerTargetPerDsc": -6.4 + } + } + }, + { + "href": "/xr-networks/233e169b-5d88-481d-bfe2-c909a2a859dd/reachableModules/212cf331-c133-4321-8e74-023549b9afee", + "id": "212cf331-c133-4321-8e74-023549b9afee", + "parentId": "233e169b-5d88-481d-bfe2-c909a2a859dd", + "rt": [ + "cm.xr-network.reachableModule" + ], + "state": { + "discoveredTime": "2022-06-28T09:04:06Z", + "endpoints": [ + { + "hostPort": { + "chassisId": "192.168.101.2", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-2/0/0:0", + "portId": "et-2/0/0:0", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:12:01", + "sysName": "Cupertino" + }, + "moduleIf": { + "clientIfAid": "XR-T1", + "clientIfColId": 1, + "clientIfPortSpeed": 100 + } + } + ], + "module": { + "baudRate": 50, + "capacity": 100, + "clientPortMode": "ethernet", + "configuredRole": "auto", + "constellationFrequency": 192000000, + "currentRole": "leaf", + "fiberConnectionMode": "dual", + "frequencyCtrl": "xr", + "macAddress": "00:0B:F8:00:01:02", + "modulation": "16QAM", + "moduleId": "d68a6b4e-03e4-4c89-5ad5-c5e782325e40", + "moduleName": "XR LEAF 2", + "ncoFrequency": 0, + "operatingFrequency": 192000000, + "roleStatus": "ready", + "serialNumber": "00000000C", + "trafficMode": "L1Mode", + "txPowerTargetPerDsc": -6.4 + } + } + } + ], + "rt": [ + "cm.xr-network" + ], + "state": { + "constellationFrequency": 192000000, + "controlLinks": [ + { + "conState": "active", + "destinationModuleId": "7c33d7d0-4f7b-4525-5d57-58589adbd47c", + "lastConStateChange": "2022-06-28T09:04:05Z", + "sourceModuleId": "d859de3c-c463-4be5-7a8d-a198275f10f4" + }, + { + "conState": "active", + "destinationModuleId": "d859de3c-c463-4be5-7a8d-a198275f10f4", + "lastConStateChange": "2022-06-28T09:04:05Z", + "sourceModuleId": "7c33d7d0-4f7b-4525-5d57-58589adbd47c" + }, + { + "conState": "active", + "destinationModuleId": "d68a6b4e-03e4-4c89-5ad5-c5e782325e40", + "lastConStateChange": "2022-06-28T09:04:06Z", + "sourceModuleId": "d859de3c-c463-4be5-7a8d-a198275f10f4" + }, + { + "conState": "active", + "destinationModuleId": "d859de3c-c463-4be5-7a8d-a198275f10f4", + "lastConStateChange": "2022-06-28T09:04:05Z", + "sourceModuleId": "d68a6b4e-03e4-4c89-5ad5-c5e782325e40" + } + ], + "lifecycleState": "configured", + "modulation": "16QAM" + } + } +] diff --git a/src/device/service/drivers/xr/cm/tests/resources/constellations-expanded.json b/src/device/service/drivers/xr/cm/tests/resources/constellations-expanded.json new file mode 100644 index 0000000000000000000000000000000000000000..cfe310f4b1340395d660f775d34086591a8e8827 --- /dev/null +++ b/src/device/service/drivers/xr/cm/tests/resources/constellations-expanded.json @@ -0,0 +1,662 @@ +[ + { + "href": "/xr-networks/6774cc4e-b0b1-43a1-923f-80fb1bec094b", + "hubModule": { + "href": "/xr-networks/6774cc4e-b0b1-43a1-923f-80fb1bec094b/hubModule", + "id": "353563a1-895f-4110-abec-8f59ffb5ecc7", + "parentId": "6774cc4e-b0b1-43a1-923f-80fb1bec094b", + "rt": [ + "cm.xr-network.hubModule" + ], + "state": { + "endpoints": [ + { + "hostPort": { + "chassisId": "192.168.100.1", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-2/0/0:0", + "portId": "et-2/0/0:0", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:00:21", + "sysName": "SanJose" + }, + "moduleIf": { + "clientIfAid": "XR-T1", + "clientIfColId": 1, + "clientIfPortSpeed": 100 + } + }, + { + "hostPort": { + "chassisId": "192.168.100.1", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-2/0/0:1", + "portId": "et-2/0/0:1", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:00:22", + "sysName": "SanJose" + }, + "moduleIf": { + "clientIfAid": "XR-T2", + "clientIfColId": 2, + "clientIfPortSpeed": 100 + } + }, + { + "hostPort": { + "chassisId": "192.168.100.1", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-2/0/0:2", + "portId": "et-2/0/0:2", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:00:23", + "sysName": "SanJose" + }, + "moduleIf": { + "clientIfAid": "XR-T3", + "clientIfColId": 3, + "clientIfPortSpeed": 100 + } + }, + { + "hostPort": { + "chassisId": "192.168.100.1", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-2/0/0:3", + "portId": "et-2/0/0:3", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:00:24", + "sysName": "SanJose" + }, + "moduleIf": { + "clientIfAid": "XR-T4", + "clientIfColId": 4, + "clientIfPortSpeed": 100 + } + } + ], + "lifecycleState": "configured", + "module": { + "baudRate": 50, + "capacity": 400, + "clientPortMode": "ethernet", + "configuredRole": "auto", + "constellationFrequency": 193000000, + "currentRole": "hub", + "fiberConnectionMode": "dual", + "frequencyCtrl": "xr", + "macAddress": "00:0B:F8:00:00:02", + "modulation": "16QAM", + "moduleId": "3a2b5cfe-6265-4b68-549d-340c58363b85", + "moduleName": "XR HUB 2", + "ncoFrequency": 0, + "operatingFrequency": 193000000, + "roleStatus": "ready", + "serialNumber": "00000000A", + "trafficMode": "L1Mode", + "txPowerTargetPerDsc": -6.4 + } + } + }, + "id": "6774cc4e-b0b1-43a1-923f-80fb1bec094b", + "leafModules": [ + { + "href": "/xr-networks/6774cc4e-b0b1-43a1-923f-80fb1bec094b/leafModules/e659ad54-9e6d-492c-ac56-09b3b681c5ed", + "id": "e659ad54-9e6d-492c-ac56-09b3b681c5ed", + "parentId": "6774cc4e-b0b1-43a1-923f-80fb1bec094b", + "rt": [ + "cm.xr-network.leafModule" + ], + "state": { + "endpoints": [ + { + "hostPort": { + "chassisId": "192.168.101.3", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-3/0/0:0", + "portId": "et-3/0/0:0", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:13:01", + "sysName": "Sunnnyvale" + }, + "moduleIf": { + "clientIfAid": "XR-T1", + "clientIfColId": 1, + "clientIfPortSpeed": 100 + } + } + ], + "lifecycleState": "configured", + "module": { + "baudRate": 50, + "capacity": 100, + "clientPortMode": "ethernet", + "configuredRole": "auto", + "constellationFrequency": 193000000, + "currentRole": "leaf", + "fiberConnectionMode": "dual", + "frequencyCtrl": "xr", + "macAddress": "00:0B:F8:00:01:03", + "modulation": "16QAM", + "moduleId": "572b2d8a-8d0b-40a0-5823-e53041ca2194", + "moduleName": "XR LEAF 3", + "ncoFrequency": 0, + "operatingFrequency": 193000000, + "roleStatus": "ready", + "serialNumber": "00000000D", + "trafficMode": "L1Mode", + "txPowerTargetPerDsc": -6.4 + } + } + } + ], + "reachableModules": [ + { + "href": "/xr-networks/6774cc4e-b0b1-43a1-923f-80fb1bec094b/reachableModules/ede4b98b-a6a7-48fa-89c0-b981e7d4a98c", + "id": "ede4b98b-a6a7-48fa-89c0-b981e7d4a98c", + "parentId": "6774cc4e-b0b1-43a1-923f-80fb1bec094b", + "rt": [ + "cm.xr-network.reachableModule" + ], + "state": { + "discoveredTime": "2022-06-28T09:04:08Z", + "endpoints": [ + { + "hostPort": { + "chassisId": "192.168.101.3", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-3/0/0:0", + "portId": "et-3/0/0:0", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:13:01", + "sysName": "Sunnnyvale" + }, + "moduleIf": { + "clientIfAid": "XR-T1", + "clientIfColId": 1, + "clientIfPortSpeed": 100 + } + } + ], + "module": { + "baudRate": 50, + "capacity": 100, + "clientPortMode": "ethernet", + "configuredRole": "auto", + "constellationFrequency": 193000000, + "currentRole": "leaf", + "fiberConnectionMode": "dual", + "frequencyCtrl": "xr", + "macAddress": "00:0B:F8:00:01:03", + "modulation": "16QAM", + "moduleId": "572b2d8a-8d0b-40a0-5823-e53041ca2194", + "moduleName": "XR LEAF 3", + "ncoFrequency": 0, + "operatingFrequency": 193000000, + "roleStatus": "ready", + "serialNumber": "00000000D", + "trafficMode": "L1Mode", + "txPowerTargetPerDsc": -6.4 + } + } + }, + { + "href": "/xr-networks/6774cc4e-b0b1-43a1-923f-80fb1bec094b/reachableModules/004ffffb-290f-45d8-90bf-4e0c914eb39c", + "id": "004ffffb-290f-45d8-90bf-4e0c914eb39c", + "parentId": "6774cc4e-b0b1-43a1-923f-80fb1bec094b", + "rt": [ + "cm.xr-network.reachableModule" + ], + "state": { + "discoveredTime": "2022-06-28T09:04:05Z", + "endpoints": [ + { + "hostPort": { + "chassisId": "192.168.101.1", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-1/0/0:0", + "portId": "et-1/0/0:0", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:11:01", + "sysName": "PaloAlto" + }, + "moduleIf": { + "clientIfAid": "XR-T1", + "clientIfColId": 1, + "clientIfPortSpeed": 100 + } + } + ], + "module": { + "baudRate": 50, + "capacity": 100, + "clientPortMode": "ethernet", + "configuredRole": "auto", + "constellationFrequency": 192000000, + "currentRole": "leaf", + "fiberConnectionMode": "dual", + "frequencyCtrl": "xr", + "macAddress": "00:0B:F8:00:01:01", + "modulation": "16QAM", + "moduleId": "7c33d7d0-4f7b-4525-5d57-58589adbd47c", + "moduleName": "XR LEAF 1", + "ncoFrequency": 0, + "operatingFrequency": 192000000, + "roleStatus": "ready", + "serialNumber": "00000000B", + "trafficMode": "L1Mode", + "txPowerTargetPerDsc": -6.4 + } + } + } + ], + "rt": [ + "cm.xr-network" + ], + "state": { + "constellationFrequency": 193000000, + "controlLinks": [ + { + "conState": "active", + "destinationModuleId": "3a2b5cfe-6265-4b68-549d-340c58363b85", + "lastConStateChange": "2022-06-28T09:04:07Z", + "sourceModuleId": "572b2d8a-8d0b-40a0-5823-e53041ca2194" + }, + { + "conState": "active", + "destinationModuleId": "572b2d8a-8d0b-40a0-5823-e53041ca2194", + "lastConStateChange": "2022-06-28T09:04:08Z", + "sourceModuleId": "3a2b5cfe-6265-4b68-549d-340c58363b85" + } + ], + "lifecycleState": "configured", + "modulation": "16QAM" + } + }, + { + "href": "/xr-networks/233e169b-5d88-481d-bfe2-c909a2a859dd", + "hubModule": { + "href": "/xr-networks/233e169b-5d88-481d-bfe2-c909a2a859dd/hubModule", + "id": "519cc31f-b736-4e4c-b78d-600562d92911", + "parentId": "233e169b-5d88-481d-bfe2-c909a2a859dd", + "rt": [ + "cm.xr-network.hubModule" + ], + "state": { + "endpoints": [ + { + "hostPort": { + "chassisId": "192.168.100.1", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-1/0/0:0", + "portId": "et-1/0/0:0", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:00:11", + "sysName": "SanJose" + }, + "moduleIf": { + "clientIfAid": "XR-T1", + "clientIfColId": 1, + "clientIfPortSpeed": 100 + } + }, + { + "hostPort": { + "chassisId": "192.168.100.1", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-1/0/0:1", + "portId": "et-1/0/0:1", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:00:12", + "sysName": "SanJose" + }, + "moduleIf": { + "clientIfAid": "XR-T2", + "clientIfColId": 2, + "clientIfPortSpeed": 100 + } + }, + { + "hostPort": { + "chassisId": "192.168.100.1", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-1/0/0:2", + "portId": "et-1/0/0:2", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:00:13", + "sysName": "SanJose" + }, + "moduleIf": { + "clientIfAid": "XR-T3", + "clientIfColId": 3, + "clientIfPortSpeed": 100 + } + }, + { + "hostPort": { + "chassisId": "192.168.100.1", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-1/0/0:3", + "portId": "et-1/0/0:3", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:00:14", + "sysName": "SanJose" + }, + "moduleIf": { + "clientIfAid": "XR-T4", + "clientIfColId": 4, + "clientIfPortSpeed": 100 + } + } + ], + "lifecycleState": "configured", + "module": { + "baudRate": 50, + "capacity": 400, + "clientPortMode": "ethernet", + "configuredRole": "auto", + "constellationFrequency": 192000000, + "currentRole": "hub", + "fiberConnectionMode": "dual", + "frequencyCtrl": "xr", + "macAddress": "00:0B:F8:00:00:01", + "modulation": "16QAM", + "moduleId": "d859de3c-c463-4be5-7a8d-a198275f10f4", + "moduleName": "XR HUB 1", + "ncoFrequency": 0, + "operatingFrequency": 192000000, + "roleStatus": "ready", + "serialNumber": "000000009", + "trafficMode": "L1Mode", + "txPowerTargetPerDsc": -6.4 + } + } + }, + "id": "233e169b-5d88-481d-bfe2-c909a2a859dd", + "leafModules": [ + { + "href": "/xr-networks/233e169b-5d88-481d-bfe2-c909a2a859dd/leafModules/7e9da66b-8bf8-4eea-b4a7-045e5ba3bfd8", + "id": "7e9da66b-8bf8-4eea-b4a7-045e5ba3bfd8", + "parentId": "233e169b-5d88-481d-bfe2-c909a2a859dd", + "rt": [ + "cm.xr-network.leafModule" + ], + "state": { + "endpoints": [ + { + "hostPort": { + "chassisId": "192.168.101.1", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-1/0/0:0", + "portId": "et-1/0/0:0", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:11:01", + "sysName": "PaloAlto" + }, + "moduleIf": { + "clientIfAid": "XR-T1", + "clientIfColId": 1, + "clientIfPortSpeed": 100 + } + } + ], + "lifecycleState": "configured", + "module": { + "baudRate": 50, + "capacity": 100, + "clientPortMode": "ethernet", + "configuredRole": "auto", + "constellationFrequency": 192000000, + "currentRole": "leaf", + "fiberConnectionMode": "dual", + "frequencyCtrl": "xr", + "macAddress": "00:0B:F8:00:01:01", + "maxAllowedDSCs": 4, + "modulation": "16QAM", + "moduleId": "7c33d7d0-4f7b-4525-5d57-58589adbd47c", + "moduleName": "XR LEAF 1", + "ncoFrequency": 0, + "operatingFrequency": 192000000, + "roleStatus": "ready", + "serialNumber": "00000000B", + "trafficMode": "L1Mode", + "txPowerTargetPerDsc": -6.4 + } + } + }, + { + "href": "/xr-networks/233e169b-5d88-481d-bfe2-c909a2a859dd/leafModules/7473b336-ef92-4508-b260-c096d05e4943", + "id": "7473b336-ef92-4508-b260-c096d05e4943", + "parentId": "233e169b-5d88-481d-bfe2-c909a2a859dd", + "rt": [ + "cm.xr-network.leafModule" + ], + "state": { + "endpoints": [ + { + "hostPort": { + "chassisId": "192.168.101.2", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-2/0/0:0", + "portId": "et-2/0/0:0", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:12:01", + "sysName": "Cupertino" + }, + "moduleIf": { + "clientIfAid": "XR-T1", + "clientIfColId": 1, + "clientIfPortSpeed": 100 + } + } + ], + "lifecycleState": "configured", + "module": { + "baudRate": 50, + "capacity": 100, + "clientPortMode": "ethernet", + "configuredRole": "auto", + "constellationFrequency": 192000000, + "currentRole": "leaf", + "fiberConnectionMode": "dual", + "frequencyCtrl": "xr", + "macAddress": "00:0B:F8:00:01:02", + "maxAllowedDSCs": 4, + "modulation": "16QAM", + "moduleId": "d68a6b4e-03e4-4c89-5ad5-c5e782325e40", + "moduleName": "XR LEAF 2", + "ncoFrequency": 0, + "operatingFrequency": 192000000, + "roleStatus": "ready", + "serialNumber": "00000000C", + "trafficMode": "L1Mode", + "txPowerTargetPerDsc": -6.4 + } + } + } + ], + "reachableModules": [ + { + "href": "/xr-networks/233e169b-5d88-481d-bfe2-c909a2a859dd/reachableModules/58785cd9-c642-43e4-a8b5-6d136acd8ae5", + "id": "58785cd9-c642-43e4-a8b5-6d136acd8ae5", + "parentId": "233e169b-5d88-481d-bfe2-c909a2a859dd", + "rt": [ + "cm.xr-network.reachableModule" + ], + "state": { + "discoveredTime": "2022-06-28T09:04:08Z", + "endpoints": [ + { + "hostPort": { + "chassisId": "192.168.101.3", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-3/0/0:0", + "portId": "et-3/0/0:0", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:13:01", + "sysName": "Sunnnyvale" + }, + "moduleIf": { + "clientIfAid": "XR-T1", + "clientIfColId": 1, + "clientIfPortSpeed": 100 + } + } + ], + "module": { + "baudRate": 50, + "capacity": 100, + "clientPortMode": "ethernet", + "configuredRole": "auto", + "constellationFrequency": 193000000, + "currentRole": "leaf", + "fiberConnectionMode": "dual", + "frequencyCtrl": "xr", + "macAddress": "00:0B:F8:00:01:03", + "modulation": "16QAM", + "moduleId": "572b2d8a-8d0b-40a0-5823-e53041ca2194", + "moduleName": "XR LEAF 3", + "ncoFrequency": 0, + "operatingFrequency": 193000000, + "roleStatus": "ready", + "serialNumber": "00000000D", + "trafficMode": "L1Mode", + "txPowerTargetPerDsc": -6.4 + } + } + }, + { + "href": "/xr-networks/233e169b-5d88-481d-bfe2-c909a2a859dd/reachableModules/be85d276-6f30-4c7b-9f63-de8679dfab85", + "id": "be85d276-6f30-4c7b-9f63-de8679dfab85", + "parentId": "233e169b-5d88-481d-bfe2-c909a2a859dd", + "rt": [ + "cm.xr-network.reachableModule" + ], + "state": { + "discoveredTime": "2022-06-28T09:04:05Z", + "endpoints": [ + { + "hostPort": { + "chassisId": "192.168.101.1", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-1/0/0:0", + "portId": "et-1/0/0:0", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:11:01", + "sysName": "PaloAlto" + }, + "moduleIf": { + "clientIfAid": "XR-T1", + "clientIfColId": 1, + "clientIfPortSpeed": 100 + } + } + ], + "module": { + "baudRate": 50, + "capacity": 100, + "clientPortMode": "ethernet", + "configuredRole": "auto", + "constellationFrequency": 192000000, + "currentRole": "leaf", + "fiberConnectionMode": "dual", + "frequencyCtrl": "xr", + "macAddress": "00:0B:F8:00:01:01", + "modulation": "16QAM", + "moduleId": "7c33d7d0-4f7b-4525-5d57-58589adbd47c", + "moduleName": "XR LEAF 1", + "ncoFrequency": 0, + "operatingFrequency": 192000000, + "roleStatus": "ready", + "serialNumber": "00000000B", + "trafficMode": "L1Mode", + "txPowerTargetPerDsc": -6.4 + } + } + }, + { + "href": "/xr-networks/233e169b-5d88-481d-bfe2-c909a2a859dd/reachableModules/212cf331-c133-4321-8e74-023549b9afee", + "id": "212cf331-c133-4321-8e74-023549b9afee", + "parentId": "233e169b-5d88-481d-bfe2-c909a2a859dd", + "rt": [ + "cm.xr-network.reachableModule" + ], + "state": { + "discoveredTime": "2022-06-28T09:04:06Z", + "endpoints": [ + { + "hostPort": { + "chassisId": "192.168.101.2", + "chassisIdSubtype": "networkAddress", + "portDescr": "et-2/0/0:0", + "portId": "et-2/0/0:0", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:12:01", + "sysName": "Cupertino" + }, + "moduleIf": { + "clientIfAid": "XR-T1", + "clientIfColId": 1, + "clientIfPortSpeed": 100 + } + } + ], + "module": { + "baudRate": 50, + "capacity": 100, + "clientPortMode": "ethernet", + "configuredRole": "auto", + "constellationFrequency": 192000000, + "currentRole": "leaf", + "fiberConnectionMode": "dual", + "frequencyCtrl": "xr", + "macAddress": "00:0B:F8:00:01:02", + "modulation": "16QAM", + "moduleId": "d68a6b4e-03e4-4c89-5ad5-c5e782325e40", + "moduleName": "XR LEAF 2", + "ncoFrequency": 0, + "operatingFrequency": 192000000, + "roleStatus": "ready", + "serialNumber": "00000000C", + "trafficMode": "L1Mode", + "txPowerTargetPerDsc": -6.4 + } + } + } + ], + "rt": [ + "cm.xr-network" + ], + "state": { + "constellationFrequency": 192000000, + "controlLinks": [ + { + "conState": "active", + "destinationModuleId": "7c33d7d0-4f7b-4525-5d57-58589adbd47c", + "lastConStateChange": "2022-06-28T09:04:05Z", + "sourceModuleId": "d859de3c-c463-4be5-7a8d-a198275f10f4" + }, + { + "conState": "active", + "destinationModuleId": "d859de3c-c463-4be5-7a8d-a198275f10f4", + "lastConStateChange": "2022-06-28T09:04:05Z", + "sourceModuleId": "7c33d7d0-4f7b-4525-5d57-58589adbd47c" + }, + { + "conState": "active", + "destinationModuleId": "d68a6b4e-03e4-4c89-5ad5-c5e782325e40", + "lastConStateChange": "2022-06-28T09:04:06Z", + "sourceModuleId": "d859de3c-c463-4be5-7a8d-a198275f10f4" + }, + { + "conState": "active", + "destinationModuleId": "d859de3c-c463-4be5-7a8d-a198275f10f4", + "lastConStateChange": "2022-06-28T09:04:05Z", + "sourceModuleId": "d68a6b4e-03e4-4c89-5ad5-c5e782325e40" + } + ], + "lifecycleState": "configured", + "modulation": "16QAM" + } + } +] \ No newline at end of file diff --git a/src/device/service/drivers/xr/cm/tests/resources/single-connection-2022-12.json b/src/device/service/drivers/xr/cm/tests/resources/single-connection-2022-12.json new file mode 100644 index 0000000000000000000000000000000000000000..d4c0262cdbcf68194ed831670ec3314d4b11a906 --- /dev/null +++ b/src/device/service/drivers/xr/cm/tests/resources/single-connection-2022-12.json @@ -0,0 +1,160 @@ +[ + { + "config": { + "implicitTransportCapacity": "portMode", + "name": "test2", + "serviceMode": "XR-L1" + }, + "endpoints": [ + { + "acs": [], + "config": { + "selector": { + "moduleIfSelectorByModuleName": { + "moduleClientIfAid": "XR-T2", + "moduleName": "XR HUB 1" + } + } + }, + "href": "/network-connections/38675444-3f08-4dbe-a9c4-523ef309a518/endpoints/4801ecf5-fe37-4b8e-864f-2a0409210cb0", + "id": "4801ecf5-fe37-4b8e-864f-2a0409210cb0", + "parentId": "38675444-3f08-4dbe-a9c4-523ef309a518", + "rt": [ + "cm.network-connection.endpoint" + ], + "state": { + "capacity": 100, + "hostPort": { + "chassisId": "192.168.100.1", + "chassisIdSubtype": "networkAddress", + "name": "", + "portDescr": "et-1/0/0:1", + "portId": "et-1/0/0:1", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:00:12", + "sysName": "SanJose" + }, + "moduleIf": { + "clientIfAid": "XR-T2", + "clientIfColId": 2, + "clientIfPortSpeed": 100, + "currentRole": "hub", + "macAddress": "00:0B:F8:00:00:01", + "moduleId": "68c23c59-3bcf-4d35-7042-a4a2d8a73e3f", + "moduleName": "XR HUB 1", + "serialNumber": "000000009" + } + } + }, + { + "acs": [], + "config": { + "selector": { + "moduleIfSelectorByModuleName": { + "moduleClientIfAid": "XR-T1", + "moduleName": "XR LEAF 2" + } + } + }, + "href": "/network-connections/38675444-3f08-4dbe-a9c4-523ef309a518/endpoints/123fc228-59ed-423e-8537-c189f3434a38", + "id": "123fc228-59ed-423e-8537-c189f3434a38", + "parentId": "38675444-3f08-4dbe-a9c4-523ef309a518", + "rt": [ + "cm.network-connection.endpoint" + ], + "state": { + "capacity": 100, + "hostPort": { + "chassisId": "192.168.101.2", + "chassisIdSubtype": "networkAddress", + "name": "", + "portDescr": "et-0/0/0:0", + "portId": "et-0/0/0:0", + "portIdSubtype": "interfaceName", + "portSourceMAC": "58:00:BB:00:12:01", + "sysName": "Cupertino" + }, + "moduleIf": { + "clientIfAid": "XR-T1", + "clientIfColId": 1, + "clientIfPortSpeed": 100, + "currentRole": "leaf", + "macAddress": "00:0B:F8:00:01:02", + "moduleId": "095a7a6b-1f69-4d2e-5581-cdffbb85e40f", + "moduleName": "XR LEAF 2", + "serialNumber": "00000000C" + } + } + } + ], + "href": "/network-connections/38675444-3f08-4dbe-a9c4-523ef309a518", + "id": "38675444-3f08-4dbe-a9c4-523ef309a518", + "lcs": [ + { + "config": { + "clientAid": "XR-T2", + "direction": "txRx", + "dscgAid": "XRCARRIERDSCG-3", + "moduleId": "68c23c59-3bcf-4d35-7042-a4a2d8a73e3f" + }, + "href": "/lcs/0d5929d8-6498-4c54-b38b-43c6cb85a18b", + "id": "0d5929d8-6498-4c54-b38b-43c6cb85a18b", + "parentIds": [ + "38675444-3f08-4dbe-a9c4-523ef309a518" + ], + "rt": [ + "cm.network-connection.local-connection" + ], + "state": { + "clientAid": "XR-T2", + "colId": 2, + "direction": "txRx", + "dscgAid": "XRCARRIERDSCG-3", + "lcAid": "XRLC-3", + "lineAid": "", + "macAddress": "00:0B:F8:00:00:01", + "moduleId": "68c23c59-3bcf-4d35-7042-a4a2d8a73e3f", + "remoteClientId": "", + "remoteModuleId": "" + } + }, + { + "config": { + "clientAid": "XR-T1", + "direction": "txRx", + "dscgAid": "XRCARRIERDSCG-3", + "moduleId": "095a7a6b-1f69-4d2e-5581-cdffbb85e40f" + }, + "href": "/lcs/1d6cc8bf-de89-4950-a01d-4b4522c65f8c", + "id": "1d6cc8bf-de89-4950-a01d-4b4522c65f8c", + "parentIds": [ + "38675444-3f08-4dbe-a9c4-523ef309a518" + ], + "rt": [ + "cm.network-connection.local-connection" + ], + "state": { + "clientAid": "XR-T1", + "colId": 1, + "direction": "txRx", + "dscgAid": "XRCARRIERDSCG-3", + "lcAid": "XRLC-3", + "lineAid": "", + "macAddress": "00:0B:F8:00:01:02", + "moduleId": "095a7a6b-1f69-4d2e-5581-cdffbb85e40f", + "remoteClientId": "", + "remoteModuleId": "" + } + } + ], + "rt": [ + "cm.network-connection" + ], + "state": { + "createdBy": "cm", + "lifecycleState": "configured", + "name": "test2", + "serviceMode": "XR-L1" + } + } +] \ No newline at end of file diff --git a/src/device/service/drivers/xr/cm/tests/resources/transport-capacities-swagger-example.json b/src/device/service/drivers/xr/cm/tests/resources/transport-capacities-swagger-example.json new file mode 100644 index 0000000000000000000000000000000000000000..f4f1b00a30aa60d15962eee5fd7471a978c0ee67 --- /dev/null +++ b/src/device/service/drivers/xr/cm/tests/resources/transport-capacities-swagger-example.json @@ -0,0 +1,165 @@ +[ + { + "href": "/transport-capacities/6ce3aa86-2685-44b0-9f86-49e6a6c991a8", + "rt": [ + "cm.transport-capacity" + ], + "id": "6ce3aa86-2685-44b0-9f86-49e6a6c991a8", + "config": { + "name": "Transport capacity service example", + "capacityMode": "dedicatedDownlinkSymmetric" + }, + "state": { + "name": "Transport capacity service example", + "capacityMode": "dedicatedDownlinkSymmetric", + "lifecycleState": "configured", + "labels": [] + }, + "endpoints": [ + { + "href": "/transport-capacities/6ce3aa86-2685-44b0-9f86-49e6a6c991a8/endpoints/4511bc3d-617b-4757-9f4c-41bc7d8912eb", + "rt": [ + "cm.transport-capacity.hub" + ], + "id": "4511bc3d-617b-4757-9f4c-41bc7d8912eb", + "parentId": "6ce3aa86-2685-44b0-9f86-49e6a6c991a8", + "config": { + "capacity": 100, + "selector": { + "hostPortSelector": { + "chassisIdSubtype": "macAddress", + "chassisId": "28:c0:da:3e:3e:40", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/1:2" + } + } + }, + "state": { + "capacity": 100, + "hostPort": { + "chassisIdSubtype": "macAddress", + "chassisId": "28:c0:da:3e:3e:40", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0", + "portSourceMAC": "da:3d:c2:4c:55:40", + "portDescr": "et-1/0/0:0" + }, + "moduleIf": { + "moduleId": "18e47620-8848-4c7e-710f-05c668478c57", + "moduleName": "XR Device", + "moduleMAC": "46:00:84:A0:0C:00", + "moduleSerialNumber": "12345678900", + "moduleCurrentRole": "hub", + "moduleClientIfColId": 1, + "clientIfAid": "XR T1", + "moduleClientIfPortSpeed": 100 + }, + "lifecycleState": "configured", + "labels": [] + } + }, + { + "href": "/transport-capacities/6ce3aa86-2685-44b0-9f86-49e6a6c991a8/endpoints/35e92b25-a682-4805-964a-6ce893a7aa56", + "rt": [ + "cm.transport-capacity.leaf" + ], + "id": "35e92b25-a682-4805-964a-6ce893a7aa56", + "parentId": "6ce3aa86-2685-44b0-9f86-49e6a6c991a8", + "config": { + "capacity": 100, + "selector": { + "hostPortSelector": { + "chassisIdSubtype": "macAddress", + "chassisId": "00:99:F8:2c:01:01", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0" + } + } + }, + "state": { + "capacity": 100, + "hostPort": { + "chassisIdSubtype": "macAddress", + "chassisId": "00:99:F8:2c:01:01", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0", + "portSourceMAC": "da:3d:c2:4c:55:40", + "portDescr": "et-1/0/0:0" + }, + "moduleIf": { + "moduleId": "23ffd75e-1a30-11ec-9621-0242ac130002", + "moduleName": "XR Device 2", + "moduleMAC": "46:00:84:A0:0C:02", + "moduleSerialNumber": "12345678902", + "moduleCurrentRole": "Leaf", + "moduleClientIfColId": 2, + "clientIfAid": "XR T1", + "moduleClientIfPortSpeed": 100 + }, + "lifecycleState": "configured", + "labels": [] + } + } + ], + "capacity-links": [ + { + "href": "/capacity-links/d9580972-7a72-43e7-91d9-5473251040ca", + "rt": [ + "cm.capacity-link" + ], + "id": "d9580972-7a72-43e7-91d9-5473251040ca", + "parentId": "6ce3aa86-2685-44b0-9f86-49e6a6c991a8", + "config": { + "directionality": "biDir", + "hubModule": { + "moduleId": "18e47620-8848-4c7e-710f-05c668478c57", + "dscgShared": false, + "dscs": [ + 7, + 5, + 3, + 1 + ] + }, + "leafModule": { + "moduleId": "23ffd75e-1a30-11ec-9621-0242ac130002", + "dscgShared": false, + "dscs": [ + 3, + 1, + 2, + 4 + ] + } + }, + "state": { + "directionality": "biDir", + "hubModule": { + "moduleId": "18e47620-8848-4c7e-710f-05c668478c57", + "dscgId": "552d4e35-c7fc-4fdf-bb31-1688f926582e", + "dscgShared": false, + "dscs": [ + 7, + 5, + 3, + 1 + ], + "lifecycleState": "configured" + }, + "leafModule": { + "moduleId": "23ffd75e-1a30-11ec-9621-0242ac130002", + "dscgId": "831884a0-fac7-4f1a-8c0d-74f82498921c", + "dscgShared": false, + "dscs": [ + 3, + 1, + 2, + 4 + ], + "lifecycleState": "configured" + } + } + } + ] + } + ] \ No newline at end of file diff --git a/src/device/service/drivers/xr/cm/tests/test_cm_connection.py b/src/device/service/drivers/xr/cm/tests/test_cm_connection.py new file mode 100644 index 0000000000000000000000000000000000000000..4f45be686c2c3a0f619d58230b2c52ed66a3eb6f --- /dev/null +++ b/src/device/service/drivers/xr/cm/tests/test_cm_connection.py @@ -0,0 +1,81 @@ +#pylint: disable=invalid-name, missing-function-docstring, line-too-long, logging-fstring-interpolation, missing-class-docstring, missing-module-docstring +# 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 inspect +import os +import requests_mock + +#from ..tf_service import TFService +from ..cm_connection import CmConnection + +access_token = r'{"access_token":"eyI3...","expires_in":3600,"refresh_expires_in":0,"refresh_token":"ey...","token_type":"Bearer","not-before-policy":0,"session_state":"f6e235c4-4ca4-4258-bede-4f2b7125adfb","scope":"profile email offline_access"}' + +resources = os.path.join(os.path.dirname(os.path.abspath(inspect.stack()[0][1])), "resources") +with open(os.path.join(resources, "constellations-expanded.json"), "r", encoding="UTF-8") as f: + res_constellations = f.read() +with open(os.path.join(resources, "constellation-by-name-hub1.json"), "r", encoding="UTF-8") as f: + res_constellation_by_name_hub1 = f.read() + +def mock_cm_connectivity(): + m = requests_mock.Mocker() + m.post('https://127.0.0.1:9999/realms/xr-cm/protocol/openid-connect/token', text=access_token) + return m + +def test_cmc_connect(): + # Valid access token + with requests_mock.Mocker() as m: + m.post('https://127.0.0.1:9999/realms/xr-cm/protocol/openid-connect/token', text=access_token) + cm = CmConnection("127.0.0.1", 9999, "xr-user", "xr-password", tls_verify=False) + assert cm.Connect() + + # Valid JSON but no access token + with requests_mock.Mocker() as m: + m.post('https://127.0.0.1:9999/realms/xr-cm/protocol/openid-connect/token', text=r'{"a": "b"}') + cm = CmConnection("127.0.0.1", 9999, "xr-user", "xr-password", tls_verify=False) + assert not cm.Connect() + + # Invalid JSON + with requests_mock.Mocker() as m: + m.post('https://127.0.0.1:9999/realms/xr-cm/protocol/openid-connect/token', text=r'}}}') + cm = CmConnection("127.0.0.1", 9999, "xr-user", "xr-password", tls_verify=False) + assert not cm.Connect() + + with requests_mock.Mocker() as m: + # No mock present for the destination + cm = CmConnection("127.0.0.1", 9999, "xr-user", "xr-password", tls_verify=False) + assert not cm.Connect() + +def test_cmc_get_constellations(): + with mock_cm_connectivity() as m: + m.get("https://127.0.0.1:9999/api/v1/ns/xr-networks?content=expanded", text=res_constellations) + cm = CmConnection("127.0.0.1", 9999, "xr-user", "xr-password", tls_verify=False) + assert cm.Connect() + + # List all constellations + constellations = cm.list_constellations() + assert len(constellations) == 2 + cids = [c.constellation_id for c in constellations] + assert cids == ["6774cc4e-b0b1-43a1-923f-80fb1bec094b", "233e169b-5d88-481d-bfe2-c909a2a859dd"] + ifnames = [c.ifnames() for c in constellations] + assert ifnames == [['XR HUB 2|XR-T1', 'XR HUB 2|XR-T2', 'XR HUB 2|XR-T3', 'XR HUB 2|XR-T4', 'XR LEAF 3|XR-T1'], + ['XR HUB 1|XR-T1', 'XR HUB 1|XR-T2', 'XR HUB 1|XR-T3', 'XR HUB 1|XR-T4', 'XR LEAF 1|XR-T1', 'XR LEAF 2|XR-T1']] + + # Get constellation by hub module name + m.get("https://127.0.0.1:9999/api/v1/ns/xr-networks?content=expanded&content=expanded&q=%7B%22hubModule.state.module.moduleName%22%3A+%22XR+HUB+1%22%7D", text=res_constellation_by_name_hub1) + constellation = cm.get_constellation_by_hub_name("XR HUB 1") + assert constellation + assert constellation.ifnames() == ['XR HUB 1|XR-T1', 'XR HUB 1|XR-T2', 'XR HUB 1|XR-T3', 'XR HUB 1|XR-T4', 'XR LEAF 1|XR-T1', 'XR LEAF 2|XR-T1'] + assert constellation.constellation_id == "233e169b-5d88-481d-bfe2-c909a2a859dd" + \ No newline at end of file diff --git a/src/device/service/drivers/xr/cm/tests/test_connection.py b/src/device/service/drivers/xr/cm/tests/test_connection.py new file mode 100644 index 0000000000000000000000000000000000000000..dc330a1e015726d875dfab6a1b52bfa2689c3eed --- /dev/null +++ b/src/device/service/drivers/xr/cm/tests/test_connection.py @@ -0,0 +1,110 @@ +#pylint: disable=invalid-name, missing-function-docstring, line-too-long, logging-fstring-interpolation, missing-class-docstring, missing-module-docstring +# 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 inspect +import os +import json +import pytest + +from ..tf_service import TFService +from ..connection import Connection, InconsistentVlanConfiguration, ConnectionDeserializationError + +resources = os.path.join(os.path.dirname(os.path.abspath(inspect.stack()[0][1])), "resources") + +def test_connection_json(): + with open(os.path.join(resources, "connections-expanded.json"), "r", encoding="UTF-8") as f: + j = json.load(f) + connection = Connection(j[0]) + + assert connection.name == "FooBar123" + assert "name: FooBar123, id: /network-connections/4505d5d3-b2f3-40b8-8ec2-4a5b28523c03, service-mode: XR-L1, end-points: [(XR LEAF 1|XR-T1, 0), (XR HUB 1|XR-T1, 0)]" == str(connection) + assert "configured" == str(connection.life_cycle_info) + assert connection.life_cycle_info.is_terminal_state() + + config = connection.create_config() + expected_config = {'name': 'FooBar123', 'serviceMode': 'XR-L1', 'implicitTransportCapacity': 'portMode', 'endpoints': [{'selector': {'moduleIfSelectorByModuleName': {'moduleName': 'XR LEAF 1', 'moduleClientIfAid': 'XR-T1'}}}, {'selector': {'moduleIfSelectorByModuleName': {'moduleName': 'XR HUB 1', 'moduleClientIfAid': 'XR-T1'}}}]} + assert config == expected_config + + # Remove mandatory key from leaf endpoint. It will not be parsed, but hub endpoint will + del j[0]["endpoints"][0]["state"]["moduleIf"]["clientIfAid"] + connection = Connection(j[0]) + assert "name: FooBar123, id: /network-connections/4505d5d3-b2f3-40b8-8ec2-4a5b28523c03, service-mode: XR-L1, end-points: [(XR HUB 1|XR-T1, 0)]" == str(connection) + + # Remove Name, it is optional (although TF will always configure it) + del j[0]["state"]["name"] + connection = Connection(j[0]) + assert "name: , id: /network-connections/4505d5d3-b2f3-40b8-8ec2-4a5b28523c03, service-mode: XR-L1, end-points: [(XR HUB 1|XR-T1, 0)]" == str(connection) + + # Remove mandatory key, will raise an exception + del j[0]["state"] + with pytest.raises(ConnectionDeserializationError, match=r"Missing mandatory key 'state'"): + _connection = Connection(j[0]) + +def test_connection_ep_change_compute(): + with open(os.path.join(resources, "connections-expanded.json"), "r", encoding="UTF-8") as f: + j = json.load(f) + existing_connection = Connection(j[0]) + + # Changing only capacity + new_connection = Connection(from_tf_service=TFService("FooBar123", "XR LEAF 1|XR-T1", "XR HUB 1|XR-T1", 25)) + ep_deletes, ep_creates, ep_updates = new_connection.get_endpoint_updates(existing_connection) + assert not ep_deletes + assert not ep_creates + assert ep_updates == [('/network-connections/4505d5d3-b2f3-40b8-8ec2-4a5b28523c03/endpoints/230516d0-7e38-44b1-b174-1ba7d4454ee6', {'capacity': 25}), ('/network-connections/4505d5d3-b2f3-40b8-8ec2-4a5b28523c03/endpoints/1d58ba8f-4d51-4213-83e1-97a0e0bdd388', {'capacity': 25})] + + # Change one of endpoints + new_connection = Connection(from_tf_service=TFService("FooBar123", "XR LEAF 1|XR-T1", "XR HUB 1|changed here", 0)) + ep_deletes, ep_creates, ep_updates = new_connection.get_endpoint_updates(existing_connection) + assert ep_deletes == ['/network-connections/4505d5d3-b2f3-40b8-8ec2-4a5b28523c03/endpoints/1d58ba8f-4d51-4213-83e1-97a0e0bdd388'] + assert ep_creates == [{'selector': {'moduleIfSelectorByModuleName': {'moduleClientIfAid': 'changed here', 'moduleName': 'XR HUB 1'}}}] + assert not ep_updates + + # Change one of the endpoints and capacity + new_connection = Connection(from_tf_service=TFService("FooBar123", "XR LEAF 1|XR-T1", "XR HUB 1|changed here", 125)) + ep_deletes, ep_creates, ep_updates = new_connection.get_endpoint_updates(existing_connection) + assert ep_deletes == ['/network-connections/4505d5d3-b2f3-40b8-8ec2-4a5b28523c03/endpoints/1d58ba8f-4d51-4213-83e1-97a0e0bdd388'] + assert ep_creates == [{'selector': {'moduleIfSelectorByModuleName': {'moduleClientIfAid': 'changed here', 'moduleName': 'XR HUB 1'}}, "capacity": 125}] + assert ep_updates == [('/network-connections/4505d5d3-b2f3-40b8-8ec2-4a5b28523c03/endpoints/230516d0-7e38-44b1-b174-1ba7d4454ee6', {'capacity': 125})] + + # No change at all + new_connection = Connection(from_tf_service=TFService("FooBar123", "XR LEAF 1|XR-T1", "XR HUB 1|XR-T1", 0)) + ep_deletes, ep_creates, ep_updates = new_connection.get_endpoint_updates(existing_connection) + assert not ep_deletes + assert not ep_creates + assert not ep_updates + + # Order of endpoints does not matter + new_connection = Connection(from_tf_service=TFService("FooBar123", "XR HUB 1|XR-T1", "XR LEAF 1|XR-T1", 0)) + ep_deletes, ep_creates, ep_updates = new_connection.get_endpoint_updates(existing_connection) + assert not ep_deletes + assert not ep_creates + assert not ep_updates + +def test_connection_from_service(): + # Port mode + connection = Connection(from_tf_service=TFService("FooBar123", "XR LEAF 1|XR-T1", "XR HUB 1|XR-T1", 0)) + assert connection.create_config() == {'name': 'TF:FooBar123', 'serviceMode': 'XR-L1', 'implicitTransportCapacity': 'portMode', 'endpoints': [{'selector': {'moduleIfSelectorByModuleName': {'moduleName': 'XR LEAF 1', 'moduleClientIfAid': 'XR-T1'}}}, {'selector': {'moduleIfSelectorByModuleName': {'moduleName': 'XR HUB 1', 'moduleClientIfAid': 'XR-T1'}}}]} + assert '(unknown (reason: not yet communicated with IPM)' == str(connection.life_cycle_info) + assert connection.life_cycle_info.is_terminal_state() + + # VTI mode + connection = Connection(from_tf_service=TFService("FooBar123", "XR LEAF 1|XR-T1.A", "XR HUB 1|XR-T1.100", 0)) + # In endpoint selectors VLANs are note present (CM does not know about them, encoding them to aids is purely internal to Teraflow) + # However VLAN adds outerVID and some other fields + assert connection.create_config() == {'name': 'TF:FooBar123', 'serviceMode': 'XR-VTI-P2P', 'implicitTransportCapacity': 'none', 'endpoints': [{'selector': {'moduleIfSelectorByModuleName': {'moduleName': 'XR LEAF 1', 'moduleClientIfAid': 'XR-T1'}}}, {'selector': {'moduleIfSelectorByModuleName': {'moduleName': 'XR HUB 1', 'moduleClientIfAid': 'XR-T1'}}}], 'outerVID': '100 ', 'mc': 'matchOuterVID'} + + # Invalid configuration, differring VLANs on different sides + with pytest.raises(InconsistentVlanConfiguration) as _e_info: + Connection(from_tf_service=TFService("FooBar123", "XR LEAF 1|XR-T1.200", "XR HUB 1|XR-T1.100", 0)) diff --git a/src/device/service/drivers/xr/cm/tests/test_constellation.py b/src/device/service/drivers/xr/cm/tests/test_constellation.py new file mode 100644 index 0000000000000000000000000000000000000000..b0f5803caa2c5832ceba28991fef9744e45f4795 --- /dev/null +++ b/src/device/service/drivers/xr/cm/tests/test_constellation.py @@ -0,0 +1,39 @@ +#pylint: disable=invalid-name, missing-function-docstring, line-too-long, logging-fstring-interpolation, missing-class-docstring, missing-module-docstring +# 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 inspect +import os +import json +import pytest +from ..constellation import Constellation, ConstellationDeserializationError + +resources = os.path.join(os.path.dirname(os.path.abspath(inspect.stack()[0][1])), "resources") + +def test_constellation_json(): + # With a name + with open(os.path.join(resources, "constellations-expanded.json"), "r", encoding="UTF-8") as f: + j = json.load(f) + + # Proper constellation with endpoints + constellation = Constellation(j[1]) + assert constellation.constellation_id == "233e169b-5d88-481d-bfe2-c909a2a859dd" + assert not constellation.is_vti_mode() + print(constellation.ifnames()) + assert ['XR HUB 1|XR-T1', 'XR HUB 1|XR-T2', 'XR HUB 1|XR-T3', 'XR HUB 1|XR-T4', 'XR LEAF 1|XR-T1', 'XR LEAF 2|XR-T1'] == constellation.ifnames() + + # Remove mandatory key, will raise an exception + del j[0]["hubModule"]["state"] + with pytest.raises(ConstellationDeserializationError, match=r"Missing mandatory key 'state'"): + _constellation = Constellation(j[0]) diff --git a/src/device/service/drivers/xr/cm/tests/test_transport_capacitity.py b/src/device/service/drivers/xr/cm/tests/test_transport_capacitity.py new file mode 100644 index 0000000000000000000000000000000000000000..1897b11110e4bcd790769ed29f8e9f5521f461db --- /dev/null +++ b/src/device/service/drivers/xr/cm/tests/test_transport_capacitity.py @@ -0,0 +1,59 @@ +#pylint: disable=invalid-name, missing-function-docstring, line-too-long, logging-fstring-interpolation, missing-class-docstring, missing-module-docstring +# 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 inspect +import os +import json + +from ..tf_service import TFService +from ..transport_capacity import TransportCapacity + +resources = os.path.join(os.path.dirname(os.path.abspath(inspect.stack()[0][1])), "resources") + +def test_transport_capacity_json(): + # Swagger example has been manually edited to match schema, that is moduleClientIfAid --> clientIfAid in state + # Also names of leafs have been fixed to be unique + # Once CM implementation is available, actual data obtained from CM should be used as a test vector + with open(os.path.join(resources, "transport-capacities-swagger-example.json"), "r", encoding="UTF-8") as f: + j = json.load(f) + + # A pre-planned constellation without endpoints + tc = TransportCapacity(j[0]) + assert str(tc) == "name: Transport capacity service example, id: /transport-capacities/6ce3aa86-2685-44b0-9f86-49e6a6c991a8, capacity-mode: dedicatedDownlinkSymmetric, end-points: [(XR Device|XR T1, 100), (XR Device 2|XR T1, 100)]" + + config = tc.create_config() + assert config == {'config': {'name': 'Transport capacity service example'}, 'endpoints': [{'capacity': 100, 'selector': {'moduleIfSelectorByModuleName': {'moduleName': 'XR Device', 'moduleClientIfAid': 'XR T1'}}}, {'capacity': 100, 'selector': {'moduleIfSelectorByModuleName': {'moduleName': 'XR Device 2', 'moduleClientIfAid': 'XR T1'}}}]} + +def test_transport_capacity_comparison(): + # Same content must compare same + t1=TransportCapacity(from_tf_service=TFService("foo", "Hub|T1", "Leaf 1|T2", 25)) + t2=TransportCapacity(from_tf_service=TFService("foo", "Hub|T1", "Leaf 1|T2", 25)) + assert t1 == t2 + + # Order of endpoints does not matter: + t2=TransportCapacity(from_tf_service=TFService("foo", "Leaf 1|T2", "Hub|T1", 25)) + assert t1 == t2 + + # Different bandwidth + t2=TransportCapacity(from_tf_service=TFService("foo", "Hub|T1", "Leaf 1|T2", 50)) + assert t1 != t2 + + # Different leaf module + t2=TransportCapacity(from_tf_service=TFService("foo", "Hub|T1", "Leaf 2|T2", 25)) + assert t1 != t2 + + # Different leaf interface + t2=TransportCapacity(from_tf_service=TFService("foo", "Hub|T1", "Leaf 1|T3", 25)) + assert t1 != t2 diff --git a/src/device/service/drivers/xr/cm/tests/test_xr_service_set_config.py b/src/device/service/drivers/xr/cm/tests/test_xr_service_set_config.py new file mode 100644 index 0000000000000000000000000000000000000000..3bfd63def82ae89f53ab6ec3a5fc18bd79ecd38f --- /dev/null +++ b/src/device/service/drivers/xr/cm/tests/test_xr_service_set_config.py @@ -0,0 +1,201 @@ +#pylint: disable=invalid-name, missing-function-docstring, line-too-long, logging-fstring-interpolation, missing-class-docstring, missing-module-docstring +# 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 inspect +import os +import json +import traceback +import copy +import requests_mock + +from ..cm_connection import CmConnection, ConsistencyMode +from ..tf import set_config_for_service + +access_token = r'{"access_token":"eyI3...","expires_in":3600,"refresh_expires_in":0,"refresh_token":"ey...","token_type":"Bearer","not-before-policy":0,"session_state":"f6e235c4-4ca4-4258-bede-4f2b7125adfb","scope":"profile email offline_access"}' + +resources = os.path.join(os.path.dirname(os.path.abspath(inspect.stack()[0][1])), "resources") +with open(os.path.join(resources, "constellation-by-name-hub1.json"), "r", encoding="UTF-8") as f: + res_constellation_by_name_hub1 = f.read() +with open(os.path.join(resources, "connections-expanded.json"), "r", encoding="UTF-8") as f: + j = json.load(f) + # Fake reference data to have the name this test case needs for the given teraflow UUID + # (=no need for too large set of reference material) + j[0]["state"]["name"] = "TF:12345ABCDEFGHIJKLMN" + res_connection_by_name_json = [j[0]] # Single item list + +def mock_cm(): + m = requests_mock.Mocker() + m.post('https://127.0.0.1:9999/realms/xr-cm/protocol/openid-connect/token', text=access_token) + m.get("https://127.0.0.1:9999/api/v1/ns/xr-networks?content=expanded&content=expanded&q=%7B%22hubModule.state.module.moduleName%22%3A+%22XR+HUB+1%22%7D", text=res_constellation_by_name_hub1) + m.post("https://127.0.0.1:9999/api/v1/ncs/network-connections", text='[{"href":"/network-connections/c3b31608-0bb7-4a4f-9f9a-88b24a059432","rt":["cm.network-connection"]}]', status_code=202) + return m + +uuid = "12345ABCDEFGHIJKLMN" +config = { + "input_sip": "XR HUB 1|XR-T4;", + "output_sip": "XR LEAF 1|XR-T1", + "capacity_value": 125, + "capacity_unit": "gigabit" +} + +def _validate_result(result, expect): + if isinstance(result, Exception): + traceback.print_exception(result) + assert result is expect # Not, "is", not ==, we want type checking in this case, as also an exception can be returned (as return value) + +def test_xr_set_config(): + with mock_cm() as m: + cm = CmConnection("127.0.0.1", 9999, "xr-user", "xr-password", tls_verify=False) + assert cm.Connect() + + constellation = cm.get_constellation_by_hub_name("XR HUB 1") + assert constellation + + result = set_config_for_service(cm, constellation, uuid, config) + _validate_result(result, True) + + called_mocks = [(r._request.method, r._request.url) for r in m._adapter.request_history] + expected_mocks = [ + ('POST', 'https://127.0.0.1:9999/realms/xr-cm/protocol/openid-connect/token'), # Authentication + ('GET', 'https://127.0.0.1:9999/api/v1/ns/xr-networks?content=expanded&content=expanded&q=%7B%22hubModule.state.module.moduleName%22%3A+%22XR+HUB+1%22%7D'), # Hub module by name + ('GET', 'https://127.0.0.1:9999/api/v1/ncs/network-connections?content=expanded&q=%7B%22state.name%22%3A+%22TF%3A12345ABCDEFGHIJKLMN%22%7D'), # Get by name, determine update or create + ('POST', 'https://127.0.0.1:9999/api/v1/ncs/network-connections') # Create + ] + assert called_mocks == expected_mocks + +# In life cycle tests, multiple queries are performed by the driver to check life cycle progress. +# Extend expected mock to match called mock length by replicating the last item (the repeated GET) +def repeat_last_expected(expected: list[tuple], called: list[tuple]) -> list[tuple]: + diff = len(called) - len(expected) + if diff > 0: + expected = list(expected) # Don't modify the original list + expected.extend([expected[-1]] * diff) + return expected + +def test_xr_set_config_consistency_lifecycle(): + with mock_cm() as m: + cm = CmConnection("127.0.0.1", 9999, "xr-user", "xr-password", tls_verify=False, consistency_mode=ConsistencyMode.lifecycle, retry_interval=0, timeout=1, max_consistency_tries=3) + assert cm.Connect() + + constellation = cm.get_constellation_by_hub_name("XR HUB 1") + assert constellation + + # Note that JSON here is for different object, but we are not inspecting fields where it would matter (e.g. IDs). + json_terminal = res_connection_by_name_json[0] + json_non_terminal = copy.deepcopy(json_terminal) + json_non_terminal["state"]["lifecycleState"] = "pendingConfiguration" + # We go trough 404 and non-terminal lstate first and then terminal state. + m.get("https://127.0.0.1:9999/api/v1/ncs/network-connections/c3b31608-0bb7-4a4f-9f9a-88b24a059432", + [{'text': '', 'status_code': 404}, + { 'json': json_non_terminal, 'status_code': 200 }, + {'json': json_terminal, 'status_code': 200 }]) + + result = set_config_for_service(cm, constellation, uuid, config) + _validate_result(result, True) + + called_mocks = [(r._request.method, r._request.url) for r in m._adapter.request_history] + expected_mocks = [ + ('POST', 'https://127.0.0.1:9999/realms/xr-cm/protocol/openid-connect/token'), # Authentication + ('GET', 'https://127.0.0.1:9999/api/v1/ns/xr-networks?content=expanded&content=expanded&q=%7B%22hubModule.state.module.moduleName%22%3A+%22XR+HUB+1%22%7D'), # Hub module by name + ('GET', 'https://127.0.0.1:9999/api/v1/ncs/network-connections?content=expanded&q=%7B%22state.name%22%3A+%22TF%3A12345ABCDEFGHIJKLMN%22%7D'), # Get by name, determine update or create + ('POST', 'https://127.0.0.1:9999/api/v1/ncs/network-connections'), # Create + ('GET', 'https://127.0.0.1:9999/api/v1/ncs/network-connections/c3b31608-0bb7-4a4f-9f9a-88b24a059432?content=expanded'), # Life cycle state check --> no REST API object + ('GET', 'https://127.0.0.1:9999/api/v1/ncs/network-connections/c3b31608-0bb7-4a4f-9f9a-88b24a059432?content=expanded'), # Life cycle state check --> non-terminal + ('GET', 'https://127.0.0.1:9999/api/v1/ncs/network-connections/c3b31608-0bb7-4a4f-9f9a-88b24a059432?content=expanded') # Life cycle state check --> terminal + ] + assert called_mocks == expected_mocks + + ################################################################################ + # Same as before, but without life cycle progress + m.reset_mock() + m.get("https://127.0.0.1:9999/api/v1/ncs/network-connections/c3b31608-0bb7-4a4f-9f9a-88b24a059432", + [{'text': '', 'status_code': 401}, + { 'json': json_non_terminal, 'status_code': 200 }]) + + result = set_config_for_service(cm, constellation, uuid, config) + _validate_result(result, False) # Service creation failure due to insufficient progress + + called_mocks = [(r._request.method, r._request.url) for r in m._adapter.request_history] + expected_mocks_no_connect = [ + ('GET', 'https://127.0.0.1:9999/api/v1/ncs/network-connections?content=expanded&q=%7B%22state.name%22%3A+%22TF%3A12345ABCDEFGHIJKLMN%22%7D'), # Get by name, determine update or create + ('POST', 'https://127.0.0.1:9999/api/v1/ncs/network-connections'), # Create + ('GET', 'https://127.0.0.1:9999/api/v1/ncs/network-connections/c3b31608-0bb7-4a4f-9f9a-88b24a059432?content=expanded'), # Life cycle state check --> no REST API object + ('GET', 'https://127.0.0.1:9999/api/v1/ncs/network-connections/c3b31608-0bb7-4a4f-9f9a-88b24a059432?content=expanded'), # Life cycle state check --> non-terminal + ] + assert called_mocks == repeat_last_expected(expected_mocks_no_connect, called_mocks) + + ################################################################################ + # Same as before, but CmConnection no longer requiring lifcycle progress + m.reset_mock() + cm = CmConnection("127.0.0.1", 9999, "xr-user", "xr-password", tls_verify=False, consistency_mode=ConsistencyMode.synchronous, retry_interval=0, timeout=1, max_consistency_tries=3) + assert cm.Connect() + constellation = cm.get_constellation_by_hub_name("XR HUB 1") + assert constellation + m.get("https://127.0.0.1:9999/api/v1/ncs/network-connections/c3b31608-0bb7-4a4f-9f9a-88b24a059432", + [{'text': '', 'status_code': 401}, + { 'json': json_non_terminal, 'status_code': 200 }]) + result = set_config_for_service(cm, constellation, uuid, config) + _validate_result(result, True) + called_mocks = [(r._request.method, r._request.url) for r in m._adapter.request_history] + assert called_mocks == expected_mocks[:2] + expected_mocks_no_connect + + ################################################################################ + # Same as above, but without REST object appearing + m.reset_mock() + cm = CmConnection("127.0.0.1", 9999, "xr-user", "xr-password", tls_verify=False, consistency_mode=ConsistencyMode.synchronous, retry_interval=0, timeout=1, max_consistency_tries=3) + assert cm.Connect() + constellation = cm.get_constellation_by_hub_name("XR HUB 1") + assert constellation + m.get("https://127.0.0.1:9999/api/v1/ncs/network-connections/c3b31608-0bb7-4a4f-9f9a-88b24a059432", + [{'text': '', 'status_code': 401}]) + result = set_config_for_service(cm, constellation, uuid, config) + _validate_result(result, False) + called_mocks = [(r._request.method, r._request.url) for r in m._adapter.request_history] + assert called_mocks == repeat_last_expected(expected_mocks[:2] + expected_mocks_no_connect, called_mocks) + + +def test_xr_set_config_update_case(): + with mock_cm() as m: + cm = CmConnection("127.0.0.1", 9999, "xr-user", "xr-password", tls_verify=False) + assert cm.Connect() + + constellation = cm.get_constellation_by_hub_name("XR HUB 1") + assert constellation + + # Fake existing service (--> update path is taken) + m.get("https://127.0.0.1:9999/api/v1/ncs/network-connections?content=expanded&q=%7B%22state.name%22%3A+%22TF%3A12345ABCDEFGHIJKLMN%22%7D", json=res_connection_by_name_json) + # Delete endpoint that is no longer necessary + m.delete("https://127.0.0.1:9999/api/v1/ncs/network-connections/4505d5d3-b2f3-40b8-8ec2-4a5b28523c03/endpoints/1d58ba8f-4d51-4213-83e1-97a0e0bdd388", text="", status_code = 202) + # Update changed endpoint + m.put("https://127.0.0.1:9999/api/v1/ncs/network-connections/4505d5d3-b2f3-40b8-8ec2-4a5b28523c03/endpoints/230516d0-7e38-44b1-b174-1ba7d4454ee6", text="", status_code = 202) + # Create the newly added endpoint + m.post("https://127.0.0.1:9999/api/v1/ncs/network-connections/4505d5d3-b2f3-40b8-8ec2-4a5b28523c03/endpoints", json=[{"href":"/network-connections/4505d5d3-b2f3-40b8-8ec2-4a5b28523c03/endpoint/somethingplausible","rt":["plausible"]}], status_code=202) + # Update the connection itself + m.put("https://127.0.0.1:9999/api/v1/ncs/network-connections/4505d5d3-b2f3-40b8-8ec2-4a5b28523c03", text="", status_code=202) + + result = set_config_for_service(cm, constellation, uuid, config) + _validate_result(result, True) + + called_mocks = [(r._request.method, r._request.url) for r in m._adapter.request_history] + expected_mocks = [ + ('POST', 'https://127.0.0.1:9999/realms/xr-cm/protocol/openid-connect/token'), # Authentication + ('GET', 'https://127.0.0.1:9999/api/v1/ns/xr-networks?content=expanded&content=expanded&q=%7B%22hubModule.state.module.moduleName%22%3A+%22XR+HUB+1%22%7D'), # Hub module by name + ('GET', 'https://127.0.0.1:9999/api/v1/ncs/network-connections?content=expanded&q=%7B%22state.name%22%3A+%22TF%3A12345ABCDEFGHIJKLMN%22%7D'), # Get by name, determine update or create + ('DELETE', 'https://127.0.0.1:9999/api/v1/ncs/network-connections/4505d5d3-b2f3-40b8-8ec2-4a5b28523c03/endpoints/1d58ba8f-4d51-4213-83e1-97a0e0bdd388'), # Delete unnecessary endpoint + ('PUT', 'https://127.0.0.1:9999/api/v1/ncs/network-connections/4505d5d3-b2f3-40b8-8ec2-4a5b28523c03/endpoints/230516d0-7e38-44b1-b174-1ba7d4454ee6'), # Update changed endpoint + ('POST', 'https://127.0.0.1:9999/api/v1/ncs/network-connections/4505d5d3-b2f3-40b8-8ec2-4a5b28523c03/endpoints'), # Add new endpoint + ('PUT', 'https://127.0.0.1:9999/api/v1/ncs/network-connections/4505d5d3-b2f3-40b8-8ec2-4a5b28523c03') # Update the connection itself + ] + assert called_mocks == expected_mocks diff --git a/src/device/service/drivers/xr/cm/tf.py b/src/device/service/drivers/xr/cm/tf.py new file mode 100644 index 0000000000000000000000000000000000000000..c44cb0c9f3ce0e755ce375908a520374e639e40f --- /dev/null +++ b/src/device/service/drivers/xr/cm/tf.py @@ -0,0 +1,71 @@ +#pylint: disable=invalid-name, missing-function-docstring, line-too-long, logging-fstring-interpolation, missing-class-docstring, missing-module-docstring +# 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 typing import Dict, Union +import logging +from .cm_connection import CmConnection +from .constellation import Constellation +from .tf_service import TFService +from .transport_capacity import TransportCapacity +from .connection import Connection + +LOGGER = logging.getLogger(__name__) + +def _get_value_or_default(config: Dict[str, any], key: str, default_value: any) -> any: + if key not in config: + return default_value + else: + return config[key] + +def _get_capacity(config) -> int: + if "capacity_unit" not in config or "capacity_value" not in config: + return 0 + if config["capacity_unit"] != "gigabit": + return 0 + return config["capacity_value"] + +def set_config_for_service(cm_connection: CmConnection, constellation: Constellation, uuid: str, config: Dict[str, any]) -> Union[bool, Exception]: + try: + service = TFService(uuid, config["input_sip"], config["output_sip"], _get_capacity(config)) + if constellation.is_vti_mode(): + desired_tc = TransportCapacity(from_tf_service=service) + active_tc = cm_connection.get_transport_capacity_by_name(service.name()) + if desired_tc != active_tc: + if active_tc: + LOGGER.info(f"set_config_for_service: Transport Capacity change for {uuid}, ({active_tc=}, {desired_tc=}), performing service impacting update") + # Remove previous connection (if any) + active_connection = cm_connection.get_connection_by_name(service.name()) + if active_connection: + cm_connection.delete_connection(active_connection.href) + # Delete old TC + cm_connection.delete_transport_capacity(active_tc.href) + if desired_tc: + href = cm_connection.create_transport_capacity(desired_tc) + if not href: + LOGGER.error(f"set_config_for_service: Failed to create Transport Capacity ({desired_tc=})") + return False + connection = Connection(from_tf_service=service) + href = cm_connection.create_or_update_connection(connection) + if href: + LOGGER.info(f"set_config_for_service: Created service {uuid} as {href} (connection={str(connection)})") + return True + else: + LOGGER.error(f"set_config_for_service: Service creation failure for {uuid} (connection={str(connection)})") + return False + # Intentionally catching all exceptions, as they are stored in a list as return values + # by the caller + # pylint: disable=broad-except + except Exception as e: + return e diff --git a/src/device/service/drivers/xr/cm/tf_service.py b/src/device/service/drivers/xr/cm/tf_service.py new file mode 100644 index 0000000000000000000000000000000000000000..98b122fa5f72c69f19ef02e4f5179111b594c041 --- /dev/null +++ b/src/device/service/drivers/xr/cm/tf_service.py @@ -0,0 +1,67 @@ +#pylint: disable=invalid-name, missing-function-docstring, line-too-long, logging-fstring-interpolation, missing-class-docstring, missing-module-docstring, wildcard-import, unused-wildcard-import +# 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 math +from dataclasses import dataclass +from typing import Tuple, Optional, Dict, List +from .utils import * + +@dataclass(init=False) +class TFService: + input_sip: str + output_sip: str + uuid: str + capacity: int + + def __init__(self, uuid, input_sip, output_sip, capacity): + self.uuid = uuid + self.input_sip = input_sip + self.output_sip = output_sip + # Capacity must be in multiples of 25 gigabits + if 0 == capacity: + self.capacity = 0 + else: + self.capacity = math.ceil(capacity/25) * 25 + + def __str__(self): + return f"({self.uuid}, {self.input_sip}, {self.output_sip}, {self.capacity})" + + def name(self) -> str: + return f"TF:{self.uuid}" + + def input_mod_aid_vlan(self) -> Tuple[str, str, Optional[str]]: + return ifname_to_module_aid_vlan(self.input_sip) + + def output_mod_aid_vlan(self) -> Tuple[str, str, Optional[str]]: + return ifname_to_module_aid_vlan(self.output_sip) + + # Return endpoints in a form suitable for selectors in various + # JSON constructs used by the CM API + def get_endpoint_selectors(self) -> List[Dict]: + return [make_selector(*self.input_mod_aid_vlan()), make_selector(*self.output_mod_aid_vlan())] + + # -> List[Tuple(str, str)] + def get_endpoints_mod_aid(self): + m1, a1, _ = self.input_mod_aid_vlan() + m2, a2, _ = self.output_mod_aid_vlan() + + return [(m1, a1), (m2, a2)] + + # -> List[Tuple(str, str)] + def get_endpoints_mod_aid_vlan(self): + m1, a1, v1 = self.input_mod_aid_vlan() + m2, a2, v2 = self.output_mod_aid_vlan() + + return [(m1, a1, v1), (m2, a2, v2)] diff --git a/src/device/service/drivers/xr/cm/transport_capacity.py b/src/device/service/drivers/xr/cm/transport_capacity.py new file mode 100644 index 0000000000000000000000000000000000000000..a13073d003ddca20888f8b0ef3c60ae59d0c8b32 --- /dev/null +++ b/src/device/service/drivers/xr/cm/transport_capacity.py @@ -0,0 +1,109 @@ +#pylint: disable=invalid-name, missing-function-docstring, line-too-long, logging-fstring-interpolation, missing-class-docstring, missing-module-docstring +# 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 typing import Optional, Dict +from dataclasses import dataclass + +from .utils import make_selector + +from .tf_service import TFService + +@dataclass +class TCEndpoint: + module: str + port: str + capacity: int + + def ifname(self) -> str: + return self.module + "|" + self.port + + def __str__(self): + return f"({self.ifname()}, {self.capacity})" + + def create_config(self) -> Dict[str, any]: + cfg = { + "capacity": self.capacity, + "selector": make_selector(self.module, self.port, None) + } + return cfg + +class TransportCapacityDeserializationError(Exception): + pass + +class TransportCapacity: + def __init__(self, from_json=None, from_tf_service: Optional[TFService] = None): + def get_endpoint_from_json(endpoint: dict[str, any]) -> Optional[TCEndpoint]: + try: + return TCEndpoint(endpoint["state"]["moduleIf"]["moduleName"], endpoint["state"]["moduleIf"]["clientIfAid"], + endpoint["state"]["capacity"]) + except KeyError: + return None + + if from_json: + try: + self.href = from_json["href"] + + state = from_json["state"] + # Name is optional + self.name = state["name"] if "name" in state else None + self.capacity_mode = state["capacityMode"] + + self.endpoints = [] + for epj in from_json["endpoints"]: + ep = get_endpoint_from_json(epj) + if ep: + self.endpoints.append(ep) + + #self.__cm_data = from_json + except KeyError as e: + raise TransportCapacityDeserializationError(f"Missing mandatory key {str(e)}") from e + elif from_tf_service: + self.href = None + self.state = "tfInternalObject" + self.name = from_tf_service.name() + self.capacity_mode = "dedicatedDownlinkSymmetric" + self.endpoints = [TCEndpoint(mod, port, from_tf_service.capacity) for mod,port in from_tf_service.get_endpoints_mod_aid()] + #self.__cm_data = None + else: + # May support other initializations in future + raise TransportCapacityDeserializationError("Initializer missing") + + # Return suitable config for CM + def create_config(self) -> Dict[str, any]: + cfg = {} + if self.name is not None: + cfg["config"] = {"name": self.name } + cfg["endpoints"] = [ep.create_config() for ep in self.endpoints] + return cfg + + def __str__(self): + name = self.name if self.name else "" + endpoints = ", ".join((str(ep) for ep in self.endpoints)) + return f"name: {name}, id: {self.href}, capacity-mode: {self.capacity_mode}, end-points: [{endpoints}]" + + # Comparison for purpose of re-configuring + def __eq__(self, obj): + if not isinstance(obj, TransportCapacity): + return False + if self.name != obj.name: + return False + if self.capacity_mode != obj.capacity_mode: + return False + if sorted(self.endpoints, key=str) != sorted(obj.endpoints, key=str): + return False + return True + + def __ne__(self, obj): + return not self == obj diff --git a/src/device/service/drivers/xr/cm/utils.py b/src/device/service/drivers/xr/cm/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..9bfdc93853b233a8085b0ebcbce86032840f8578 --- /dev/null +++ b/src/device/service/drivers/xr/cm/utils.py @@ -0,0 +1,71 @@ +#pylint: disable=invalid-name, missing-function-docstring, line-too-long, logging-fstring-interpolation, missing-class-docstring, missing-module-docstring +# 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 typing import Any, Tuple, Optional, Dict + +class InvalidIfnameError(Exception): + def __init__(self, ifname): + # Call the base class constructor with the parameters it needs + super().__init__(f"Invalid interface name {ifname}, expecting format \"MODULENAME|PORTNAME\" or \"MODULENAME|PORTNAME.VLAN\"") + +def ifname_to_module_and_aid(ifname: str) -> Tuple[str, str]: + a = ifname.split("|") + if len(a) != 2: + raise InvalidIfnameError(ifname) + return (a[0], a[1]) + +def virtual_aid_to_aid_and_vlan(ifname: str) -> Tuple[str, Optional[str]]: + a = ifname.split(".") + if len(a) == 1: + return (ifname, None) + if len(a) != 2: + raise InvalidIfnameError(ifname) + return (a[0], a[1]) + +def ifname_to_module_aid_vlan(ifname: str) -> Tuple[str, str, Optional[str]]: + module, aid = ifname_to_module_and_aid(ifname) + aid, vlan = virtual_aid_to_aid_and_vlan(aid) + return (module, aid, vlan) + +# For some reason when writing config, selector has moduleClientIfAid, when reading +# state it has clientIfAid... +def make_selector(mod, aid, _vlan) -> Dict[str, Any]: + selector = { + "moduleIfSelectorByModuleName": { + "moduleName": mod, + "moduleClientIfAid": aid, + } + } + return selector + +def get_constellation_module_ifnames(module): + ifnames = [] + try: + module_state = module["state"] + module_name = module_state["module"]["moduleName"] + if "endpoints" in module_state: + for endpoint in module_state["endpoints"]: + try: + ifname = endpoint["moduleIf"]["clientIfAid"] + ifnames.append(f"{module_name}|{ifname}") + except KeyError: + pass + except KeyError: + pass + return ifnames + +def set_optional_parameter(container: Dict[str, any], key:str, value: Optional[any]): + if value is not None: + container[key] = value diff --git a/src/device/service/drivers/xr/ipm_rest_api_0_6_71.json b/src/device/service/drivers/xr/ipm_rest_api_0_6_71.json new file mode 100644 index 0000000000000000000000000000000000000000..72c641c5da6add9d32f094a18728030056869312 --- /dev/null +++ b/src/device/service/drivers/xr/ipm_rest_api_0_6_71.json @@ -0,0 +1,26618 @@ +{ + "openapi": "3.0.2", + "info": { + "description": "Infinera XR Optics Intelligent Pluggables Manager Application API", + "title": "IPM", + "version": "1.0", + "x-initials": "NDUS", + "x-cm-api-version": "v0.6.71" + }, + "servers": [ + { + "url": "/api/v1" + } + ], + "paths": { + "/modules": { + "get": { + "operationId": "getModules", + "parameters": [ + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.module" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of modules" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all modules" + } + }, + "/modules/{moduleId}": { + "delete": { + "operationId": "deleteSpecificModule", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "delete specific module" + }, + "get": { + "operationId": "getModuleByID", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.module" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific module data" + }, + "put": { + "operationId": "UpdateModule", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.module.update" + } + } + }, + "description": "Update Module", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "update module data" + } + }, + "/modules/{moduleId}/linePtps": { + "get": { + "operationId": "getLinePtps", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.module.linePtp" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of module line ports" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all module line ports" + } + }, + "/modules/{moduleId}/linePtps/{linePtpColId}": { + "get": { + "operationId": "getLinePtpByID", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Line port identifier within module.", + "explode": false, + "in": "path", + "name": "linePtpColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.module.linePtp" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific module line port data" + }, + "put": { + "operationId": "UpdateLinePtp", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Line port identifier within module.", + "explode": false, + "in": "path", + "name": "linePtpColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.module.linePtp.update" + } + } + }, + "description": "Update module line port", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Update module line port data" + } + }, + "/modules/{moduleId}/ethernetClients": { + "get": { + "operationId": "getEthernetClients", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.module.ethernetClient" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of ethernetClients" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all module client ethernet interfaces" + } + }, + "/modules/{moduleId}/ethernetClients/{ethernetColId}": { + "get": { + "operationId": "getEthernetClientByID", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Ethernet client signal identifier within module.", + "explode": false, + "in": "path", + "name": "ethernetColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.module.ethernetClient" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific client ethernet interface data" + }, + "put": { + "operationId": "updateEthernetClient", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Ethernet client signal identifier within module.", + "explode": false, + "in": "path", + "name": "ethernetColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.module.ethernetClient.update" + } + } + }, + "description": "Update client ethernet interface", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Update module client ethernet interface data" + } + }, + "/modules/{moduleId}/ethernetClients/{ethernetColId}/acs": { + "get": { + "operationId": "getEthernetClientAcs", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Ethernet client signal identifier within module.", + "explode": false, + "in": "path", + "name": "ethernetColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.module.ethernetClient.ac" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of ethernetClients" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all attachment circuits of a module client ethernet interface" + } + }, + "/modules/{moduleId}/ethernetClients/{ethernetColId}/acs/{acColId}": { + "get": { + "operationId": "getEthernetClientAcByID", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Ethernet client signal identifier within module.", + "explode": false, + "in": "path", + "name": "ethernetColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "attachment circuit identifier within module client ethernet interface.", + "explode": false, + "in": "path", + "name": "acColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.module.ethernetClient.ac" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific client ethernet attachment circuit data" + } + }, + "/modules/{moduleId}/localConnections": { + "get": { + "operationId": "getLcs", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.module.localConnection" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of local connections" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all module localConnections" + } + }, + "/modules/{moduleId}/localConnections/{lcColId}": { + "get": { + "operationId": "getLcByID", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "local connection identifier within module.", + "explode": false, + "in": "path", + "name": "lcColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.module.localConnection" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific module local connection data" + } + }, + "/modules/{moduleId}/otus": { + "get": { + "operationId": "getOtus", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.module.otu" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of otus" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all module OTUs" + } + }, + "/modules/{moduleId}/otus/{otuColId}": { + "get": { + "operationId": "getOtuByID", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "OTU signal identifier within module.", + "explode": false, + "in": "path", + "name": "otuColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.module.otu" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific module OTU data" + }, + "put": { + "operationId": "updateOtu", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "OTU signal identifier within module.", + "explode": false, + "in": "path", + "name": "otuColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.module.otu.update" + } + } + }, + "description": "Update OTU", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Update module OTU data" + } + }, + "/modules/{moduleId}/otus/{otuColId}/odus": { + "get": { + "operationId": "getOdus", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "OTU signal identifier within module.", + "explode": false, + "in": "path", + "name": "otuColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.module.odu" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of hosts" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all module ODUs" + } + }, + "/modules/{moduleId}/otus/{otuColId}/odus/{oduColId}": { + "get": { + "operationId": "getOduByID", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "OTU signal identifier within module.", + "explode": false, + "in": "path", + "name": "otuColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "ODU signal identifier within module.", + "explode": false, + "in": "path", + "name": "oduColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.module.odu" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific module ODU data" + } + }, + "/modules/{moduleId}/linePtps/{linePtpColId}/carriers": { + "get": { + "operationId": "getCarriers", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Line port identifier within module.", + "explode": false, + "in": "path", + "name": "linePtpColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of module carriers" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all module carriers" + } + }, + "/modules/{moduleId}/linePtps/{linePtpColId}/carriers/{carrierColId}": { + "get": { + "operationId": "getCarrierByID", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Line port identifier within module.", + "explode": false, + "in": "path", + "name": "linePtpColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Carrier identifier within module line port.", + "explode": false, + "in": "path", + "name": "carrierColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific module carrier data" + }, + "put": { + "operationId": "updateCarrier", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Line port identifier within module.", + "explode": false, + "in": "path", + "name": "linePtpColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Carrier identifier within module line port.", + "explode": false, + "in": "path", + "name": "carrierColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.update" + } + } + }, + "description": "Update Carrier", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Update module Carrier data" + } + }, + "/modules/{moduleId}/linePtps/{linePtpColId}/carriers/{carrierColId}/dscgs": { + "get": { + "operationId": "getDscgs", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Line port identifier within module.", + "explode": false, + "in": "path", + "name": "linePtpColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Carrier identifier within module line port.", + "explode": false, + "in": "path", + "name": "carrierColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dscg" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of otus" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all module Dscgs" + } + }, + "/modules/{moduleId}/linePtps/{linePtpColId}/carriers/{carrierColId}/dscgs/{dscgColId}": { + "get": { + "operationId": "getDscgByID", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Line port identifier within module.", + "explode": false, + "in": "path", + "name": "linePtpColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Carrier identifier within module line port.", + "explode": false, + "in": "path", + "name": "carrierColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "DSCG identifier within module carrier.", + "explode": false, + "in": "path", + "name": "dscgColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dscg" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific module dscg data" + } + }, + "/modules/{moduleId}/linePtps/{linePtpColId}/carriers/{carrierColId}/dscs": { + "get": { + "operationId": "getCarrierDscs", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Line port identifier within module.", + "explode": false, + "in": "path", + "name": "linePtpColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Carrier identifier within module line port.", + "explode": false, + "in": "path", + "name": "carrierColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dsc" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of modules" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all carrier dscs" + } + }, + "/modules/{moduleId}/linePtps/{linePtpColId}/carriers/{carrierColId}/dscs/{dscColId}": { + "get": { + "operationId": "getCarrierDscByID", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Line port identifier within module.", + "explode": false, + "in": "path", + "name": "linePtpColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Carrier identifier within module line port.", + "explode": false, + "in": "path", + "name": "carrierColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "DSC identifier within module carrier.", + "explode": false, + "in": "path", + "name": "dscColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dsc" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific carrier dsc data" + }, + "put": { + "operationId": "UpdateCarrierDsc", + "parameters": [ + { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Line port identifier within module.", + "explode": false, + "in": "path", + "name": "linePtpColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Carrier identifier within module line port.", + "explode": false, + "in": "path", + "name": "carrierColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "DSC identifier within module carrier.", + "explode": false, + "in": "path", + "name": "dscColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dsc.update" + } + } + }, + "description": "Update carrier DSC", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Update carrier DSC data" + } + }, + "/devices": { + "get": { + "operationId": "getDevices", + "parameters": [ + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": [ + { + "href": "/devices/02dbd2b0-3baf-43f0-51c8-5da9498709e4", + "rt": [ + "cm.device" + ], + "id": "02dbd2b0-3baf-43f0-51c8-5da9498709e4", + "config": { + "status": "onboarded" + }, + "state": { + "moduleName": "XR LEAF 1", + "piid": "abb81108-8bbf-4222-9bf3-0a6bbb75ac65", + "dmn": { + "language": "en", + "value": "Infinera" + }, + "ownershipStatus": "owned", + "status": "onboarded", + "online": true + } + } + ], + "schema": { + "items": { + "$ref": "#/components/schemas/cm.device" + }, + "type": "array" + } + } + }, + "description": "Sucessful response containing an array of network connections" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieves available devices cached in the system" + }, + "put": { + "operationId": "UpdateDevices", + "requestBody": { + "content": { + "application/json": { + "example": [ + { + "id": "02dbd2b0-3baf-43f0-51c8-5da9498709e4", + "config": { + "status": "onboarded" + } + }, + { + "id": "230bfea9-1579-412d-54b9-860e8a832608", + "config": { + "status": "offboarded" + } + } + ], + "schema": { + "items": { + "$ref": "#/components/schemas/cm.device.updateRequest" + }, + "type": "array" + } + } + }, + "description": "Update device onboard status", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "update Devices" + } + }, + "/devices/{deviceIdx}": { + "get": { + "operationId": "getDeviceByID", + "parameters": [ + { + "description": "Index into the device list", + "explode": false, + "in": "path", + "name": "deviceIdx", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "href": "/devices/02dbd2b0-3baf-43f0-51c8-5da9498709e4", + "rt": [ + "cm.device" + ], + "id": "02dbd2b0-3baf-43f0-51c8-5da9498709e4", + "config": { + "status": "onboarded" + }, + "state": { + "moduleName": "XR LEAF 1", + "piid": "abb81108-8bbf-4222-9bf3-0a6bbb75ac65", + "dmn": { + "language": "en", + "value": "Infinera" + }, + "ownershipStatus": "owned", + "status": "onboarded", + "online": true + } + }, + "schema": { + "$ref": "#/components/schemas/cm.device" + } + } + }, + "description": "Successful response containing the specified device" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific device cached in the system" + }, + "put": { + "operationId": "UpdateDevice", + "parameters": [ + { + "description": "Index into the device list", + "explode": false, + "in": "path", + "name": "deviceIdx", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "example": { + "status": "onboarded" + }, + "schema": { + "$ref": "#/components/schemas/cm.device.config" + } + } + }, + "description": "Update specific device onboard status", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "update Device" + } + }, + "/sw/actions": { + "get": { + "operationId": "getSwCtrlActions", + "parameters": [ + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.sw.action" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of software control action objects" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of software control action objects" + }, + "post": { + "operationId": "createSwCtrlActions", + "requestBody": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.sw.action.create" + }, + "maxLength": 1, + "type": "array" + } + } + }, + "description": "Software control actions", + "required": true + }, + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.resource" + }, + "type": "array" + } + } + }, + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Create software control actions" + } + }, + "/sw/actions/{actionId}": { + "get": { + "operationId": "getSwCtrlActionByID", + "parameters": [ + { + "description": "Software control action identifier within the sw action list", + "explode": false, + "in": "path", + "name": "actionId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.sw.action" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific software control action data" + } + }, + "/sw/moduleActions/": { + "get": { + "operationId": "getSwCtrlModuleActions", + "parameters": [ + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.sw.moduleAction" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of module software control actions" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of module software control actions of an action request" + } + }, + "/sw/moduleActions/{moduleActionId}": { + "get": { + "operationId": "getSwCtrlModuleActionByID", + "parameters": [ + { + "description": "Software control action identifier within the module sw action list", + "explode": false, + "in": "path", + "name": "moduleActionId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.sw.moduleAction" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific module software control action data" + } + }, + "/sw/inventory/ctrl": { + "get": { + "operationId": "getSwImages", + "parameters": [ + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.sw.ctrl" + }, + "type": "array" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all XR module SW images" + } + }, + "/sw/inventory/device/{deviceId}/ctrl": { + "get": { + "operationId": "getSwCtrlByID", + "parameters": [ + { + "description": "Device identifier (XR pluggable module or NDU).", + "explode": false, + "in": "path", + "name": "deviceId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.sw.ctrl" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific software control object data" + } + }, + "/sw/inventory/device/{deviceId}/swBanks": { + "get": { + "operationId": "getSwBanks", + "parameters": [ + { + "description": "Device identifier (XR pluggable module or NDU).", + "explode": false, + "in": "path", + "name": "deviceId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.sw.banks" + } + } + }, + "description": "Successful response containing an array of hosts" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all software banks in a XR pluggable module or ndu device" + } + }, + "/sw/inventory/device/{deviceId}/swBanks/{swBankColId}": { + "get": { + "operationId": "getSwBankByID", + "parameters": [ + { + "description": "Device identifier (XR pluggable module or NDU).", + "explode": false, + "in": "path", + "name": "deviceId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Software bank identifier within module.\n- '1': Refers to Bank A\n- '2': Refers to Bank B\n", + "explode": false, + "in": "path", + "name": "swBankColId", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.sw.bank" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific software bank data" + } + }, + "/network-connections": { + "get": { + "operationId": "getConnections", + "parameters": [ + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.network-connection" + }, + "type": "array" + } + } + }, + "description": "Successful" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all network connections" + }, + "post": { + "operationId": "createConnections", + "requestBody": { + "content": { + "application/json": { + "example": [ + { + "name": "connection 01: Sunnyvale <> San Jose", + "owner": "CM", + "endpoints": [ + { + "hostPortSelector": { + "chassisIdSubtype": "macAddress", + "chassisId": "28:c0:da:3e:3e:40", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/1:2" + } + }, + { + "hostPortSelector": { + "chassisIdSubtype": "macAddress", + "chassisId": "00:0B:F8:00:01:01", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0" + } + } + ] + } + ], + "schema": { + "items": { + "$ref": "#/components/schemas/cm.network-connection.create" + }, + "maxLength": 30, + "type": "array" + } + } + }, + "description": "Network connection configuration data", + "required": true + }, + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.resource" + }, + "type": "array" + } + } + }, + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "example": { + "errors": [ + { + "code": "NCS-07-006", + "message": "Missing endpoint selector configuration" + } + ] + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Create network connections" + } + }, + "/network-connections/{ncId}": { + "delete": { + "operationId": "deleteConnection", + "parameters": [ + { + "description": "Connection identifier within the connection list", + "explode": false, + "in": "path", + "name": "ncId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "example": { + "errors": [ + { + "code": "NCS-07-006", + "message": "Network-Connection must be owned by CM" + } + ] + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Delete specific network connection" + }, + "get": { + "operationId": "getConnectionByID", + "parameters": [ + { + "description": "Connection identifier within the connection list", + "explode": false, + "in": "path", + "name": "ncId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.network-connection" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific network connection data" + }, + "put": { + "operationId": "updateConnection", + "parameters": [ + { + "description": "Connection identifier within the connection list", + "explode": false, + "in": "path", + "name": "ncId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "example": { + "name": "connection 01: Sunnyvale <> San Jose", + "owner": "CM" + }, + "schema": { + "$ref": "#/components/schemas/cm.network-connection.update" + } + } + }, + "description": "Update connection", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Update specific network connection data" + } + }, + "/network-connections/{ncId}/endpoints": { + "get": { + "operationId": "getConnectionEndpoints", + "parameters": [ + { + "description": "Connection identifier within the connection list", + "explode": false, + "in": "path", + "name": "ncId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.network-connection.endpoint" + }, + "type": "array" + } + } + }, + "description": "Successful" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve network connection endpoints" + }, + "post": { + "operationId": "createConnectionEndpoints", + "parameters": [ + { + "description": "Connection identifier within the connection list", + "explode": false, + "in": "path", + "name": "ncId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.network-connection.endpoint.create" + }, + "maxLength": 30, + "type": "array" + } + } + }, + "description": "Connection endpoints info", + "required": true + }, + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.resource" + }, + "type": "array" + } + } + }, + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Create network connection endpoints" + } + }, + "/network-connections/{ncId}/endpoints/{epId}": { + "delete": { + "operationId": "deleteConnectionEndpoint", + "parameters": [ + { + "description": "Connection identifier within the connection list", + "explode": false, + "in": "path", + "name": "ncId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Endpoint identifier within the connection", + "explode": false, + "in": "path", + "name": "epId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "example": { + "errors": [ + { + "code": "NCS-07-006", + "message": "Network-Connection must be owned by CM" + } + ] + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Delete specific network connection endpoint" + }, + "get": { + "operationId": "getConnectionEndpointByID", + "parameters": [ + { + "description": "Connection identifier within the connection list", + "explode": false, + "in": "path", + "name": "ncId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Endpoint identifier within the connection", + "explode": false, + "in": "path", + "name": "epId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.network-connection.endpoint" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific endpoint data from a network connection" + }, + "put": { + "operationId": "updateConnectionEndpoint", + "parameters": [ + { + "description": "Connection identifier within the connection list", + "explode": false, + "in": "path", + "name": "ncId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Endpoint identifier within the connection", + "explode": false, + "in": "path", + "name": "epId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.network-connection.endpoint.update" + } + } + }, + "description": "Update connection endpoint", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Update specific network connection endpoint data" + } + }, + "/lcs": { + "get": { + "operationId": "getLocalConnections", + "parameters": [ + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.network-connection.local-connection" + }, + "type": "array" + } + } + }, + "description": "Successful" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all local connections with associated network connections information" + } + }, + "/lcs/{lcId}": { + "get": { + "operationId": "getConnectionLocalConnectionByID", + "parameters": [ + { + "description": "Local connection identifier within the connection scope", + "explode": false, + "in": "path", + "name": "lcId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.network-connection.local-connection" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific local connection data with associated network connections" + } + }, + "/acs": { + "get": { + "operationId": "getAcs", + "parameters": [ + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.network-connection.ac" + }, + "type": "array" + } + } + }, + "description": "Successful" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all attachment circuits with associated network connections information" + } + }, + "/acs/{acId}": { + "get": { + "operationId": "getAcByID", + "parameters": [ + { + "description": "Attachment circuit identifier within the connection scope", + "explode": false, + "in": "path", + "name": "acId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.network-connection.ac" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific attachment circuit data with associated network connections" + } + }, + "/xr-networks": { + "get": { + "operationId": "getConstellations", + "parameters": [ + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.xr-network" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of xr networks" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all xr-network objects" + }, + "post": { + "operationId": "createConstellation", + "requestBody": { + "content": { + "application/json": { + "example": [ + { + "config": { + "name": "Sunnyvale Constellation", + "constellationFrequency": 193000000, + "modulation": "16QAM" + }, + "hubModule": { + "config": { + "selector": { + "hostPortSelector": { + "chassisIdSubtype": "macAddress", + "chassisId": "28:c0:da:3e:3e:40", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/1:2" + } + }, + "module": { + "trafficMode": "L1Mode", + "fiberConnectionMode": "dual", + "maxAllowedDSCs": 16 + } + } + }, + "leafModules": [ + { + "config": { + "selector": { + "hostPortSelector": { + "chassisIdSubtype": "macAddress", + "chassisId": "00:0B:F8:00:01:01", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0" + } + }, + "module": { + "trafficMode": "L1Mode", + "fiberConnectionMode": "dual" + } + } + }, + { + "config": { + "selector": { + "hostPortSelector": { + "chassisIdSubtype": "macAddress", + "chassisId": "00:99:F8:2c:01:01", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0" + } + }, + "module": { + "trafficMode": "L1Mode", + "fiberConnectionMode": "dual" + } + } + } + ] + } + ], + "schema": { + "items": { + "$ref": "#/components/schemas/cm.xr-network.createRequest" + }, + "maxLength": 30, + "type": "array" + } + } + }, + "description": "Constellation info", + "required": true + }, + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.resource" + }, + "type": "array" + } + } + }, + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Create xr-network" + } + }, + "/xr-networks/{networkId}": { + "delete": { + "operationId": "deleteConstellation", + "parameters": [ + { + "description": "Index into the xr-network list", + "explode": false, + "in": "path", + "name": "networkId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "delete specific xr-network" + }, + "get": { + "operationId": "getConstellationByID", + "parameters": [ + { + "description": "Index into the xr-network list", + "explode": false, + "in": "path", + "name": "networkId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.xr-network" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific xr-network data" + }, + "put": { + "operationId": "UpdateConstellation", + "parameters": [ + { + "description": "Index into the xr-network list", + "explode": false, + "in": "path", + "name": "networkId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.xr-network.update" + } + } + }, + "description": "Update xr-network", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Update xr-network" + } + }, + "/xr-networks/{networkId}/hubModule": { + "get": { + "operationId": "getConstellationHub", + "parameters": [ + { + "description": "Index into the xr-network list", + "explode": false, + "in": "path", + "name": "networkId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.xr-network.hubModule" + }, + "type": "array" + } + } + }, + "description": "Successful response containing xr-network hub node" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve xr-network hub info" + }, + "put": { + "operationId": "UpdateConstellationHub", + "parameters": [ + { + "description": "Index into the xr-network list", + "explode": false, + "in": "path", + "name": "networkId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.xr-network.node.update" + } + } + }, + "description": "Update hub module constellation parameters", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Update hub module constellation parameters" + } + }, + "/xr-networks/{networkId}/leafModules": { + "get": { + "operationId": "getConstellationLeafModules", + "parameters": [ + { + "description": "Index into the xr-network list", + "explode": false, + "in": "path", + "name": "networkId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.xr-network.leafModule" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of xr-network leaf modules" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve xr-network leaf modules" + }, + "post": { + "operationId": "createConstellationLeafModule", + "parameters": [ + { + "description": "Index into the xr-network list", + "explode": false, + "in": "path", + "name": "networkId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.xr-network.node.create" + }, + "maxLength": 30, + "type": "array" + } + } + }, + "description": "Constellation leaf module info", + "required": true + }, + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.resource" + }, + "type": "array" + } + } + }, + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Add xr-network leaf modules" + } + }, + "/xr-networks/{networkId}/leafModules/{nodeId}": { + "delete": { + "operationId": "deleteConstellationLeafModule", + "parameters": [ + { + "description": "Index into the xr-network list", + "explode": false, + "in": "path", + "name": "networkId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Index of leaf module into xr-network list", + "explode": false, + "in": "path", + "name": "nodeId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "delete specific xr-network leaf module" + }, + "get": { + "operationId": "getConstellationLeafModuleByID", + "parameters": [ + { + "description": "Index into the xr-network list", + "explode": false, + "in": "path", + "name": "networkId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Index of leaf module into xr-network list", + "explode": false, + "in": "path", + "name": "nodeId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.xr-network.leafModule" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific xr-network leaf module data" + }, + "put": { + "operationId": "UpdateConstellationLeafModule", + "parameters": [ + { + "description": "Index into the xr-network list", + "explode": false, + "in": "path", + "name": "networkId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Index of leaf module into xr-network list", + "explode": false, + "in": "path", + "name": "nodeId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.xr-network.node.update" + } + } + }, + "description": "Update leaf module constellation parameters", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Update leaf module constellation parameters" + } + }, + "/xr-networks/{networkId}/reachableModules": { + "get": { + "operationId": "getConstellationreachableModules", + "parameters": [ + { + "description": "Index into the xr-network list", + "explode": false, + "in": "path", + "name": "networkId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.xr-network.reachableModule" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of xr-network reachableModules" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve xr-network reachableModules" + } + }, + "/xr-networks/{networkId}/reachableModules/{nodeId}": { + "get": { + "operationId": "getConstellationReachableModuleByID", + "parameters": [ + { + "description": "Index into the xr-network list", + "explode": false, + "in": "path", + "name": "networkId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Index of leaf module into xr-network list", + "explode": false, + "in": "path", + "name": "nodeId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.xr-network.reachableModule" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific xr-network reachableModule data" + } + }, + "/transport-capacities": { + "get": { + "operationId": "getTransportCapacities", + "parameters": [ + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.transport-capacity" + }, + "type": "array" + } + } + }, + "description": "Successful" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all transport-capacity services" + }, + "post": { + "operationId": "createTransportCapacities", + "requestBody": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.transport-capacity.createRequest" + }, + "maxLength": 30, + "type": "array" + } + } + }, + "description": "transport-capacity configuration data", + "required": true + }, + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.resource" + }, + "type": "array" + } + } + }, + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Create transport-capacity services" + } + }, + "/transport-capacities/{tcId}": { + "delete": { + "operationId": "deleteTransportCapacity", + "parameters": [ + { + "description": "Index into the transport-connection list", + "explode": false, + "in": "path", + "name": "tcId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Delete specific transport-capacity" + }, + "get": { + "operationId": "getTransportCapacityByID", + "parameters": [ + { + "description": "Index into the transport-connection list", + "explode": false, + "in": "path", + "name": "tcId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.transport-capacity" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific transport-capacity data" + }, + "put": { + "operationId": "UpdateTransportCapacity", + "parameters": [ + { + "description": "Index into the transport-connection list", + "explode": false, + "in": "path", + "name": "tcId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.transport-capacity.update" + } + } + }, + "description": "Update transport-capacity", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Update specific transport-capacity data" + } + }, + "/transport-capacities/{tcId}/endpoints": { + "get": { + "operationId": "getTransportCapacityEndpoints", + "parameters": [ + { + "description": "Index into the transport-connection list", + "explode": false, + "in": "path", + "name": "tcId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.transport-capacity.endpoint" + }, + "type": "array" + } + } + }, + "description": "Successful" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve transport-capacity connection endpoints" + } + }, + "/transport-capacities/{tcId}/endpoints/{epId}": { + "get": { + "operationId": "getTransportCapacityEndpointByID", + "parameters": [ + { + "description": "Index into the transport-connection list", + "explode": false, + "in": "path", + "name": "tcId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Endpoint identifier within the transport-connection", + "explode": false, + "in": "path", + "name": "epId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.transport-capacity.endpoint" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific endpoint data from a transport-capacity connection" + }, + "put": { + "operationId": "updateTransportCapacityEndpoint", + "parameters": [ + { + "description": "Index into the transport-connection list", + "explode": false, + "in": "path", + "name": "tcId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Endpoint identifier within the transport-connection", + "explode": false, + "in": "path", + "name": "epId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.transport-capacity.endpoint.update" + } + } + }, + "description": "Update transport-capacity endpoint", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Update specific transport-capacity connection endpoint data" + } + }, + "/capacity-links": { + "get": { + "operationId": "getCapacityLinks", + "parameters": [ + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.capacity-link" + }, + "type": "array" + } + } + }, + "description": "Successful" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all capacity-links" + } + }, + "/capacity-links/{clId}": { + "get": { + "operationId": "getCapacityLinkByID", + "parameters": [ + { + "description": "Index into the capacity-link list", + "explode": false, + "in": "path", + "name": "clId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.capacity-link" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific capacity-link data" + } + }, + "/subscriptions": { + "get": { + "operationId": "getSubscriptions", + "responses": { + "200": { + "content": { + "application/json": { + "example": [ + { + "href": "/subscription/a9575258-c1ce-4c35-9930-d3d902061cf3", + "rt": [ + "cm.subscription" + ], + "subscriptionId": "a9575258-c1ce-4c35-9930-d3d902061cf3", + "subscriptionName": "ConstellationNeighboursTable", + "notificationChannel": { + "streamAddress": "/api/v1/ws/a9575258-c1ce-4c35-9930-d3d902061cf3" + }, + "subscriptionFilters": [ + { + "requestedNotificationTypes": [ + "AVC" + ], + "requestedResources": [ + { + "resourceType": "cm.network", + "ids": [ + "c664b89e-6a3c-4747-559f-d79d0563a6a9" + ] + } + ] + }, + { + "requestedNotificationTypes": [ + "AVC" + ], + "requestedResources": [ + { + "resourceType": "cm.network", + "moduleIds": [ + "0705ee6f-2c79-40c0-41ce-967da13fbf8f" + ] + } + ] + }, + { + "requestedNotificationTypes": [ + "AVC" + ], + "requestedResources": [ + { + "resourceType": "cm.module", + "moduleIds": [ + "0705ee6f-2c79-40c0-41ce-967da13fbf8f" + ] + } + ] + } + ] + } + ], + "schema": { + "items": { + "$ref": "#/components/schemas/cm.subscription" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array subscriptions" + }, + "400": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-001", + "message": "Invalid URI: /api/v1/eg/subscriptions/?error" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-xxx", + "message": "xxxTBDxxx" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-xxx", + "message": "xxxTBDxxx" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-xxx", + "message": "xxxTBDxxx" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-xxx", + "message": "xxxTBDxxx" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-xxx", + "message": "xxxTBDxxx" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of subscriptions" + }, + "post": { + "operationId": "createSubscriptions", + "requestBody": { + "content": { + "application/json": { + "example": [ + { + "subscriptionName": "ConstellationNeighboursTable", + "subscriptionFilters": [ + { + "requestedNotificationTypes": [ + "AVC" + ], + "requestedResources": [ + { + "resourceType": "cm.network", + "ids": [ + "c664b89e-6a3c-4747-559f-d79d0563a6a9" + ] + } + ] + }, + { + "requestedNotificationTypes": [ + "AVC" + ], + "requestedResources": [ + { + "resourceType": "cm.network", + "moduleIds": [ + "0705ee6f-2c79-40c0-41ce-967da13fbf8f" + ] + } + ] + }, + { + "requestedNotificationTypes": [ + "AVC" + ], + "requestedResources": [ + { + "resourceType": "cm.network", + "moduleIds": [ + "0705ee6f-2c79-40c0-41ce-967da13fbf8f" + ] + } + ] + } + ] + } + ], + "schema": { + "items": { + "$ref": "#/components/schemas/cm.subscription.request" + }, + "maxLength": 30, + "type": "array" + } + } + }, + "description": "Subscription info", + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "example": [ + { + "subscriptionId": "a9575258-c1ce-4c35-9930-d3d902061cf3", + "notificationChannel": { + "streamAddress": "/ws/a9575258-c1ce-4c35-9930-d3d902061cf3" + } + } + ], + "schema": { + "items": { + "$ref": "#/components/schemas/cm.subscription.response" + }, + "type": "array" + } + } + }, + "description": "Request has been fulfilled and new a new subscription resource has been created." + }, + "400": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-01-001", + "message": "Invalid request body: line \"5\"; parameter: \"subscriptionFilter.resourceType\"; value: \"cm.invalidResourceType\"" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-xxx", + "message": "xxxTBDxxx" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-xxx", + "message": "xxxTBDxxx" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "503": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-xxx", + "message": "xxxTBDxxx" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-xxx", + "message": "xxxTBDxxx" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Create Subscriptions" + } + }, + "/subscriptions/{subscriptionIdx}": { + "delete": { + "operationId": "deleteSubscription", + "parameters": [ + { + "description": "Index into the Hosts list", + "explode": false, + "in": "path", + "name": "subscriptionIdx", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-xxx", + "message": "xxxTBDxxx" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-xxx", + "message": "xxxTBDxxx" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-xxx", + "message": "xxxTBDxxx" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-002", + "message": "Path: \"/subscriptions/0e64146b-1335-4fa6-61ad-f05f9fdde3e0\"; Resource Type: \"cm.subscription\"; ID: \"0e64146b-1335-4fa6-61ad-f05f9fdde3e0\"" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-xxx", + "message": "xxxTBDxxx" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-xxx", + "message": "xxxTBDxxx" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Delete subscription" + }, + "get": { + "operationId": "getSubscriptionById", + "parameters": [ + { + "description": "Index into the Hosts list", + "explode": false, + "in": "path", + "name": "subscriptionIdx", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.subscription" + } + } + }, + "description": "Successful response containing subscription data" + }, + "401": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-xxx", + "message": "xxxTBDxxx" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-xxx", + "message": "xxxTBDxxx" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-002", + "message": "Path: \"/subscriptions/0e64146b-1335-4fa6-61ad-f05f9fdde3e0\"; Resource Type: \"cm.subscription\"; ID: \"0e64146b-1335-4fa6-61ad-f05f9fdde3e0\"" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-xxx", + "message": "xxxTBDxxx" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-xxx", + "message": "xxxTBDxxx" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific subscription data" + }, + "put": { + "operationId": "UpdateSubscription", + "parameters": [ + { + "description": "Index into the Hosts list", + "explode": false, + "in": "path", + "name": "subscriptionIdx", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.subscription.request" + } + } + }, + "description": "Subscription data to be updated", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-01-001", + "message": "Invalid request body: line \"5\"; parameter: \"subscriptionFilter.resourceType\"; value: \"cm.invalidResourceType\"" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-xxx", + "message": "xxxTBDxxx" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-xxx", + "message": "xxxTBDxxx" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-002", + "message": "Path: \"/subscriptions/0e64146b-1335-4fa6-61ad-f05f9fdde3e0\"; Resource Type: \"cm.subscription\"; ID: \"0e64146b-1335-4fa6-61ad-f05f9fdde3e0\"" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-xxx", + "message": "xxxTBDxxx" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "example": { + "errors": { + "code": "EG-00-xxx", + "message": "xxxTBDxxx" + } + }, + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Update subscription data" + } + }, + "/{subscriptionIdx}": { + "description": "WebSocket endpoints for existing subscriptions", + "servers": [ + { + "url": "/api/v1/ws" + } + ] + }, + "/hosts": { + "get": { + "operationId": "getHosts", + "parameters": [ + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": [ + { + "href": "/hosts/d9672ef1-ddc1-cd6b-3c77-ea86b442545a", + "rt": [ + "cm.host" + ], + "id": "d9672ef1-ddc1-cd6b-3c77-ea86b442545a", + "config": { + "name": "Sunnyvale Router 001", + "managedBy": "CM", + "location": { + "latitude": 20, + "longitude": 134.1 + }, + "selector": { + "hostSelectorByChassisId": { + "chassisIdSubtype": "macAddress", + "chassisId": "28:c0:da:3e:3e:40" + } + }, + "labels": { + "region": "West Coast", + "city": "Sunnyvale" + } + }, + "state": { + "name": "Sunnyvale Router 001", + "chassisIdSubtype": "macAddress", + "chassisId": "28:c0:da:3e:3e:40", + "sysName": "Vendor A Router", + "sysDescr": "", + "managedBy": "CM", + "lldpState": "Present", + "location": { + "latitude": 37.368832, + "longitude": -122.036346 + }, + "labels": { + "region": "West Coast", + "city": "Sunnyvale" + } + }, + "ports": [ + { + "href": "/hosts/d9672ef1-ddc1-cd6b-3c77-ea86b442545a/ports/5f8c47b4-c02a-6242-260c-185dd04b8faf", + "rt": [ + "cm.host.port" + ], + "id": "5f8c47b4-c02a-6242-260c-185dd04b8faf", + "config": { + "name": "towards San Jose", + "managedBy": "CM", + "selector": { + "ifSelectorByHostPortSourceMAC": { + "portSourceMAC": "28:c0:da:3e:3e:44" + } + }, + "labels": { + "region": "West Coast", + "city": "Sunnyvale" + } + }, + "state": { + "name": "towards San Jose", + "managedBy": "CM", + "lldpState": "Present", + "hostPort": { + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0", + "portSourceMAC": "28:c0:da:3e:3e:44" + }, + "moduleIf": { + "moduleId": "aa079e7c-02df-43ed-636e-71f7bfc212ff", + "moduleName": "Sunnyvale-1/0/0", + "macAddress": "00:0B:F8:00:01:01", + "serialNumber": "12345678901", + "clientIfAid": "XR-T1" + }, + "labels": { + "region": "West Coast", + "city": "Sunnyvale" + } + } + }, + { + "href": "/hosts/d9672ef1-ddc1-cd6b-3c77-ea86b442545a/ports/4868c57e-0f4f-11ec-82a8-0242ac130003", + "rt": [ + "cm.host.port" + ], + "id": "4868c57e-0f4f-11ec-82a8-0242ac130003", + "config": { + "name": "towards Santa Clara", + "managedBy": "CM", + "selector": { + "ifSelectorByModuleMAC": { + "moduleMAC": "00:0B:F8:00:01:01", + "clientIfAid": "XR-T1" + } + }, + "labels": { + "region": "West Coast", + "city": "Sunnyvale" + } + }, + "state": { + "name": "towards Santa Clara", + "managedBy": "Host", + "lldpState": "Present", + "hostPort": { + "portIdSubtype": "interfaceName", + "portId": "et-1/0/2:0", + "portSourceMAC": "58:00:BB:00:00:12" + }, + "moduleIf": { + "moduleId": "4e58f211-oa575-41ae-65d6-54fbeba5a2fe", + "moduleName": "Sunnyvale-1/0/2", + "macAddress": "00:0B:F8:00:01:01", + "serialNumber": "12345678901", + "clientIfAid": "XR-T2" + }, + "labels": { + "region": "West Coast", + "city": "Sunnyvale" + } + } + } + ] + } + ], + "schema": { + "items": { + "$ref": "#/components/schemas/cm.host" + }, + "type": "array" + } + } + }, + "description": "Sucessful response containing an array of hosts" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all hosts" + }, + "post": { + "operationId": "createHosts", + "requestBody": { + "content": { + "application/json": { + "example": [ + { + "name": "Sunnyvale Router 001", + "location": { + "latitude": 37.368832, + "longitude": -122.036346 + }, + "selector": { + "hostSelectorByChassisId": { + "chassisIdSubtype": "macAddress", + "chassisId": "28:c0:da:3e:3e:40" + } + }, + "labels": { + "region": "West Coast", + "city": "Sunnyvale" + } + }, + { + "name": "Santa Clara", + "location": { + "latitude": 37.354107, + "longitude": -121.955238 + }, + "selector": { + "hostSelectorByChassisId": { + "chassisIdSubtype": "macAddress", + "chassisId": "28:c0:da:3e:3e:10" + } + } + } + ], + "schema": { + "items": { + "$ref": "#/components/schemas/cm.host.create" + }, + "maxLength": 30, + "type": "array" + } + } + }, + "description": "Host info", + "required": true + }, + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.resource" + }, + "type": "array" + } + } + }, + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Create hosts" + } + }, + "/hosts/{hostId}": { + "delete": { + "operationId": "deleteSpecificHost", + "parameters": [ + { + "description": "Index into the Hosts list", + "explode": false, + "in": "path", + "name": "hostId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "delete specific host" + }, + "get": { + "operationId": "getHostByID", + "parameters": [ + { + "description": "Index into the Hosts list", + "explode": false, + "in": "path", + "name": "hostId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "href": "/hosts/d9672ef1-ddc1-cd6b-3c77-ea86b442545a", + "rt": [ + "cm.host" + ], + "id": "d9672ef1-ddc1-cd6b-3c77-ea86b442545a", + "config": { + "name": "Sunnyvale Router 001", + "managedBy": "CM", + "location": { + "latitude": 37.368832, + "longitude": -122.036346 + }, + "selector": { + "hostSelectorByChassisId": { + "chassisIdSubtype": "macAddress", + "chassisId": "28:c0:da:3e:3e:40" + } + }, + "labels": { + "region": "West Coast", + "city": "Sunnyvale" + }, + "ports": [ + { + "href": "/hosts/d9672ef1-ddc1-cd6b-3c77-ea86b442545a/ports/5f8c47b4-c02a-6242-260c-185dd04b8faf" + }, + { + "href": "/hosts/d9672ef1-ddc1-cd6b-3c77-ea86b442545a/ports/4868c57e-0f4f-11ec-82a8-0242ac130003" + } + ] + }, + "state": { + "name": "Sunnyvale Router 001", + "chassisIdSubtype": "macAddress", + "chassisId": "28:c0:da:3e:3e:40", + "sysName": "Vendor A Router", + "sysDescr": "", + "lldpState": "Present", + "managedBy": "CM", + "location": { + "latitude": 37.368832, + "longitude": -122.036346 + }, + "labels": { + "region": "West Coast", + "city": "Sunnyvale" + }, + "ports": [ + { + "href": "/hosts/d9672ef1-ddc1-cd6b-3c77-ea86b442545a/ports/5f8c47b4-c02a-6242-260c-185dd04b8faf", + "rt": [ + "cm.host.port" + ] + }, + { + "href": "/hosts/d9672ef1-ddc1-cd6b-3c77-ea86b442545a/ports/4868c57e-0f4f-11ec-82a8-0242ac130003", + "rt": [ + "cm.host.port" + ] + } + ] + } + }, + "schema": { + "$ref": "#/components/schemas/cm.host" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific host data" + }, + "put": { + "operationId": "UpdateHost", + "parameters": [ + { + "description": "Index into the Hosts list", + "explode": false, + "in": "path", + "name": "hostId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "example": { + "name": "Madrid Router 001", + "location": { + "latitude": 40.416775, + "longitude": -3.70379 + } + }, + "schema": { + "$ref": "#/components/schemas/cm.host.update" + } + } + }, + "description": "Update Host", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "update host" + } + }, + "/hosts/{hostId}/ports": { + "get": { + "operationId": "getHostPorts", + "parameters": [ + { + "description": "Index into the Hosts list", + "explode": false, + "in": "path", + "name": "hostId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": [ + { + "href": "/hosts/d9672ef1-ddc1-cd6b-3c77-ea86b442545a/ports/5f8c47b4-c02a-6242-260c-185dd04b8faf", + "rt": [ + "cm.host.port" + ] + }, + { + "href": "/hosts/d9672ef1-ddc1-cd6b-3c77-ea86b442545a/ports/4868c57e-0f4f-11ec-82a8-0242ac130003", + "rt": [ + "cm.host.port" + ] + } + ], + "schema": { + "items": { + "$ref": "#/components/schemas/cm.host.port" + }, + "type": "array" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve host' ports" + }, + "post": { + "operationId": "createHostPorts", + "parameters": [ + { + "description": "Index into the Hosts list", + "explode": false, + "in": "path", + "name": "hostId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "example": [ + { + "name": "towards Lisbon", + "managedBy": "CM", + "selector": { + "ifSelectorByHostPortId": { + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0" + } + }, + "labels": { + "region": "Iberia", + "city": "Madrid" + } + } + ], + "schema": { + "items": { + "$ref": "#/components/schemas/cm.host.port.create" + }, + "maxLength": 30, + "type": "array" + } + } + }, + "description": "Host ports info", + "required": true + }, + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.resource" + }, + "type": "array" + } + } + }, + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Create host ports" + } + }, + "/hosts/{hostId}/ports/{portIdx}": { + "delete": { + "operationId": "deleteHostPort", + "parameters": [ + { + "description": "Index into the Hosts list", + "explode": false, + "in": "path", + "name": "hostId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Index into the Ports list", + "explode": false, + "in": "path", + "name": "portIdx", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "delete specific host port" + }, + "get": { + "operationId": "getHostPort", + "parameters": [ + { + "description": "Index into the Hosts list", + "explode": false, + "in": "path", + "name": "hostId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Index into the Ports list", + "explode": false, + "in": "path", + "name": "portIdx", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.host.port" + } + } + }, + "description": "Successful" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + } + }, + "summary": "Retrieve specific host's port" + }, + "put": { + "operationId": "updateHostPort", + "parameters": [ + { + "description": "Index into the Hosts list", + "explode": false, + "in": "path", + "name": "hostId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Index into the Ports list", + "explode": false, + "in": "path", + "name": "portIdx", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.host.port.update" + } + } + }, + "description": "Update Host Port", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "update hosts' Port" + } + }, + "/ndus": { + "get": { + "operationId": "getNdus", + "parameters": [ + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.ndu" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of NDUs" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all NDUs" + } + }, + "/ndus/{nduId}": { + "delete": { + "operationId": "deleteSpecificNdu", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "delete specific NDU" + }, + "get": { + "operationId": "getNduByID", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific NDU data" + }, + "put": { + "operationId": "UpdateNdu", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.update" + } + } + }, + "description": "Update NDU", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "update NDU data" + } + }, + "/ndus/{nduId}/ports": { + "get": { + "operationId": "getNduPorts", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.ndu.port" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of NDU ports" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all NDU ports" + } + }, + "/ndus/{nduId}/ports/{nduPortColId}": { + "get": { + "operationId": "getNduPortByID", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "NDU port identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduPortColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.port" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific NDU port data" + }, + "put": { + "operationId": "UpdateNduPort", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "NDU port identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduPortColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.port.update" + } + } + }, + "description": "Update NDU port", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Update NDU port data" + } + }, + "/ndus/{nduId}/ports/{nduPortColId}/toms": { + "get": { + "operationId": "getNduToms", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "NDU port identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduPortColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.ndu.port.tom" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of NDU TOMs" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all NDU TOMs" + } + }, + "/ndus/{nduId}/ports/{nduPortColId}/toms/{nduTomColId}": { + "get": { + "operationId": "getNduTomByID", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "NDU port identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduPortColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Tom identifier within NDU port.", + "explode": false, + "in": "path", + "name": "nduTomColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.port.tom" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific NDU port TOM data" + }, + "put": { + "operationId": "UpdateNduTom", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "NDU port identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduPortColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Tom identifier within NDU port.", + "explode": false, + "in": "path", + "name": "nduTomColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.port.tom.update" + } + } + }, + "description": "Update NDU TOM", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Update NDU port TOM data" + } + }, + "/ndus/{nduId}/ports/{nduPortColId}/xrs": { + "get": { + "operationId": "getNduXRs", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "NDU port identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduPortColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.ndu.port.xr" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of NDU XRs" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all NDU XR pluggable interfaces" + } + }, + "/ndus/{nduId}/ports/{nduPortColId}/xrs/{nduXrColId}": { + "get": { + "operationId": "getNduXrByID", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "NDU port identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduPortColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "XR pluggable identifier within NDU port.", + "explode": false, + "in": "path", + "name": "nduXrColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.port.xr" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific NDU port XR pluggable data" + }, + "put": { + "operationId": "UpdateNduXr", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "NDU port identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduPortColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "XR pluggable identifier within NDU port.", + "explode": false, + "in": "path", + "name": "nduXrColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.port.xr.update" + } + } + }, + "description": "Update NDU XR pluggable", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Update NDU port XR pluggable data" + } + }, + "/ndus/{nduId}/ports/{nduPortColId}/edfas": { + "get": { + "operationId": "getNduEdfas", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "NDU port identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduPortColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.ndu.port.edfa" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of NDU EDFAa" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all NDU EDFAa" + } + }, + "/ndus/{nduId}/ports/{nduPortColId}/edfas/{nduEdfaColId}": { + "get": { + "operationId": "getNduEdfaByID", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "NDU port identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduPortColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Edfa identifier within NDU port.", + "explode": false, + "in": "path", + "name": "nduEdfaColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.port.edfa" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific NDU port EDFA data" + }, + "put": { + "operationId": "UpdateNduEdfa", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "NDU port identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduPortColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Edfa identifier within NDU port.", + "explode": false, + "in": "path", + "name": "nduEdfaColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.port.edfa.update" + } + } + }, + "description": "Update NDU EDFA", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Update NDU port EDFA data" + } + }, + "/ndus/{nduId}/ports/{nduPortColId}/voas": { + "get": { + "operationId": "getNduVoas", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "NDU port identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduPortColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.ndu.port.voa" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of NDU VOAs" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all NDU VOAs" + } + }, + "/ndus/{nduId}/ports/{nduPortColId}/voas/{nduVoaColId}": { + "get": { + "operationId": "getNduVoaByID", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "NDU port identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduPortColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "VOA identifier within NDU port.", + "explode": false, + "in": "path", + "name": "nduVoaColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.port.voa" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific NDU port VOA data" + }, + "put": { + "operationId": "UpdateNduVoa", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "NDU port identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduPortColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "VOA identifier within NDU port.", + "explode": false, + "in": "path", + "name": "nduVoaColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.port.voa.update" + } + } + }, + "description": "Update NDU VOA", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Update NDU port VOA data" + } + }, + "/ndus/{nduId}/lineptps": { + "get": { + "operationId": "getNduLinePtps", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.ndu.linePtp" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of NDU line ports" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all NDU line ports" + } + }, + "/ndus/{nduId}/lineptps/{nduLinePtpColId}": { + "get": { + "operationId": "getNduLinePtpByID", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Line port identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduLinePtpColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.linePtp" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific NDU line port data" + } + }, + "/ndus/{nduId}/lineptps/{nduLinePtpColId}/carriers": { + "get": { + "operationId": "getNduLinePtpCarriers", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Line port identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduLinePtpColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.ndu.linePtp.carrier" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of NDU line port carriers" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all NDU line port carriers" + } + }, + "/ndus/{nduId}/lineptps/{nduLinePtpColId}/carriers/{nduCarrierColId}": { + "get": { + "operationId": "getNduLinePtpCarrierByID", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Line port identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduLinePtpColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Carrier identifier within NDU line port.", + "explode": false, + "in": "path", + "name": "nduCarrierColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.linePtp.carrier" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific NDU line port carrier data" + } + }, + "/ndus/{nduId}/tribPtps": { + "get": { + "operationId": "getNduTribPtps", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.ndu.tribPtp" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of NDU tributary ports" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all NDU tributary ports" + } + }, + "/ndus/{nduId}/tribPtps/{nduTribPtpColId}": { + "get": { + "operationId": "getNduTribPtpByID", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Triburaty port identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduTribPtpColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.tribPtp" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific NDU tributary port data" + }, + "put": { + "operationId": "UpdateNduTribPtp", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Triburaty port identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduTribPtpColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.tribPtp.update" + } + } + }, + "description": "Update NDU tributary port", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Update NDU tributary port data" + } + }, + "/ndus/{nduId}/otus": { + "get": { + "operationId": "getNduOtus", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.ndu.otu" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of NDU OTUs" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all NDU OTUs" + } + }, + "/ndus/{nduId}/otus/{nduOtuColId}": { + "get": { + "operationId": "getNduOtuByID", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "OTU signal identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduOtuColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.otu" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific NDU OTU data" + }, + "put": { + "operationId": "updateNduOtu", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "OTU signal identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduOtuColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.otu.update" + } + } + }, + "description": "Update NDU OTU", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Update NDU OTU data" + } + }, + "/ndus/{nduId}/otus/{nduOtuColId}/odus": { + "get": { + "operationId": "getNduOdus", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "OTU signal identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduOtuColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.ndu.otu.odu" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of ODUs" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of ODUs from a NDU OTU" + } + }, + "/ndus/{nduId}/otus/{nduOtuColId}/odus/{nduOduColId}": { + "get": { + "operationId": "getNduOduByID", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "OTU signal identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduOtuColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "ODU signal identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduOduColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.otu.odu" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific ODU data from a NDU OTU" + } + }, + "/ndus/{nduId}/ethernetClients": { + "get": { + "operationId": "getNduEthernetClients", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.ndu.ethernetClient" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of NDU ethernet clients" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all NDU ethernet clients" + } + }, + "/ndus/{nduId}/ethernetClients/{nduEthernetColId}": { + "get": { + "operationId": "getNduEthernetClientByID", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Ethernet client signal identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduEthernetColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.ethernetClient" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific NDU ethernet client data" + }, + "put": { + "operationId": "updateNduEthernetClient", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Ethernet client signal identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduEthernetColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.ethernetClient.update" + } + } + }, + "description": "Update NDU Ethernet client", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Update NDU Ethernet client data" + } + }, + "/ndus/{nduId}/trails": { + "get": { + "operationId": "getNduTrails", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.ndu.trail" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of NDU trails" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all NDU trail" + } + }, + "/ndus/{nduId}/trails/{nduTrailColId}": { + "get": { + "operationId": "getNduTrailByID", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Trail identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduTrailColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.trail" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific NDU ethernetClient data" + } + }, + "/ndus/{nduId}/fans": { + "get": { + "operationId": "getNduFans", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/cm.ndu.fan" + }, + "type": "array" + } + } + }, + "description": "Successful response containing an array of NDU fan modules" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all NDU fan modules" + } + }, + "/ndus/{nduId}/fans/{nduFanColId}": { + "get": { + "operationId": "getNduFanByID", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Fan identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduFanColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.fan" + } + } + }, + "description": "Successful" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve specific NDU fan module data" + } + }, + "/ndus/{nduId}/pem": { + "get": { + "operationId": "getNduPem", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.pem" + } + } + }, + "description": "Successful response containing an NDU pem module" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all NDU pem module" + }, + "put": { + "operationId": "updateNduPem", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.pem.update" + } + } + }, + "description": "Update NDU PEM", + "required": true + }, + "responses": { + "202": { + "description": "Request has been accepted for processing, but the processing has not been completed." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Update NDU PEM data" + } + }, + "/ndus/{nduId}/leds": { + "get": { + "operationId": "getNduLeds", + "parameters": [ + { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + { + "description": "Query content type\n- 'base' indicates response payload links are not resolved.\n- 'all' indicates that response payload is resolved (i.e. resource representation) and links are not resolved.\n- 'expanded' indicates that response payload and links are resolved\n", + "in": "query", + "name": "content", + "required": false, + "schema": { + "default": "base", + "enum": [ + "base", + "all", + "expanded" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/cm.ndu.leds" + } + } + }, + "description": "Successful response containing an NDU LEDs" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "BadRequest" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Not Found" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Service Unavailable" + }, + "504": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors" + } + } + }, + "description": "Gateway Timeout" + } + }, + "summary": "Retrieve list of all NDU LEDs" + } + } + }, + "components": { + "parameters": { + "moduleId": { + "description": "Module identifier.", + "explode": false, + "in": "path", + "name": "moduleId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + "linePtpColId": { + "description": "Line port identifier within module.", + "explode": false, + "in": "path", + "name": "linePtpColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "carrierColId": { + "description": "Carrier identifier within module line port.", + "explode": false, + "in": "path", + "name": "carrierColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "dscgColId": { + "description": "DSCG identifier within module carrier.", + "explode": false, + "in": "path", + "name": "dscgColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "dscColId": { + "description": "DSC identifier within module carrier.", + "explode": false, + "in": "path", + "name": "dscColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "otuColId": { + "description": "OTU signal identifier within module.", + "explode": false, + "in": "path", + "name": "otuColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "oduColId": { + "description": "ODU signal identifier within module.", + "explode": false, + "in": "path", + "name": "oduColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "ethernetColId": { + "description": "Ethernet client signal identifier within module.", + "explode": false, + "in": "path", + "name": "ethernetColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "hostNeighborColId": { + "description": "hostNeighbor data identifier.", + "explode": false, + "in": "path", + "name": "hostNeighborColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "ethernetLldpColId": { + "description": "ethernet LLDP data identifier.", + "explode": false, + "in": "path", + "name": "ethernetLldpColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "lcColId": { + "description": "local connection identifier within module.", + "explode": false, + "in": "path", + "name": "lcColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "acColId": { + "description": "attachment circuit identifier within module client ethernet interface.", + "explode": false, + "in": "path", + "name": "acColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "deviceIdx": { + "description": "Index into the device list", + "explode": false, + "in": "path", + "name": "deviceIdx", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + "actionId": { + "description": "Software control action identifier within the sw action list", + "explode": false, + "in": "path", + "name": "actionId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + "moduleActionId": { + "description": "Software control action identifier within the module sw action list", + "explode": false, + "in": "path", + "name": "moduleActionId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + "deviceId": { + "description": "Device identifier (XR pluggable module or NDU).", + "explode": false, + "in": "path", + "name": "deviceId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + "swBankColId": { + "description": "Software bank identifier within module.\n- '1': Refers to Bank A\n- '2': Refers to Bank B\n", + "explode": false, + "in": "path", + "name": "swBankColId", + "required": true, + "schema": { + "format": "int64", + "type": "integer" + }, + "style": "simple" + }, + "ncId": { + "description": "Connection identifier within the connection list", + "explode": false, + "in": "path", + "name": "ncId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + "epId": { + "description": "Endpoint identifier within the transport-connection", + "explode": false, + "in": "path", + "name": "epId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + "lcId": { + "description": "Local connection identifier within the connection scope", + "explode": false, + "in": "path", + "name": "lcId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + "acId": { + "description": "Attachment circuit identifier within the connection scope", + "explode": false, + "in": "path", + "name": "acId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + "networkId": { + "description": "Index into the xr-network list", + "explode": false, + "in": "path", + "name": "networkId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + "nodeId": { + "description": "Index of leaf module into xr-network list", + "explode": false, + "in": "path", + "name": "nodeId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + "tcId": { + "description": "Index into the transport-connection list", + "explode": false, + "in": "path", + "name": "tcId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + "clId": { + "description": "Index into the capacity-link list", + "explode": false, + "in": "path", + "name": "clId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + "subscriptionIdx": { + "description": "Index into the Hosts list", + "explode": false, + "in": "path", + "name": "subscriptionIdx", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + "hostId": { + "description": "Index into the Hosts list", + "explode": false, + "in": "path", + "name": "hostId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + "portIdx": { + "description": "Index into the Ports list", + "explode": false, + "in": "path", + "name": "portIdx", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + "nduId": { + "description": "NDU identifier.", + "explode": false, + "in": "path", + "name": "nduId", + "required": true, + "schema": { + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "type": "string" + }, + "style": "simple" + }, + "nduPortColId": { + "description": "NDU port identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduPortColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "nduTomColId": { + "description": "Tom identifier within NDU port.", + "explode": false, + "in": "path", + "name": "nduTomColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "nduXrColId": { + "description": "XR pluggable identifier within NDU port.", + "explode": false, + "in": "path", + "name": "nduXrColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "nduEdfaColId": { + "description": "Edfa identifier within NDU port.", + "explode": false, + "in": "path", + "name": "nduEdfaColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "nduVoaColId": { + "description": "VOA identifier within NDU port.", + "explode": false, + "in": "path", + "name": "nduVoaColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "nduLinePtpColId": { + "description": "Line port identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduLinePtpColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "nduTribPtpColId": { + "description": "Triburaty port identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduTribPtpColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "nduCarrierColId": { + "description": "Carrier identifier within NDU line port.", + "explode": false, + "in": "path", + "name": "nduCarrierColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "nduOtuColId": { + "description": "OTU signal identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduOtuColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "nduOduColId": { + "description": "ODU signal identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduOduColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "nduEthernetColId": { + "description": "Ethernet client signal identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduEthernetColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "nduTrailColId": { + "description": "Trail identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduTrailColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + }, + "nduFanColId": { + "description": "Fan identifier within NDU.", + "explode": false, + "in": "path", + "name": "nduFanColId", + "required": true, + "schema": { + "type": "integer" + }, + "style": "simple" + } + }, + "schemas": { + "cm.module": { + "description": "Definition of host object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "config": { + "$ref": "#/components/schemas/cm.module.config" + }, + "state": { + "$ref": "#/components/schemas/cm.module.state" + }, + "linePtps": { + "$ref": "#/components/schemas/cm.module.linePtps" + }, + "otus": { + "$ref": "#/components/schemas/cm.module.otus" + }, + "ethernetClients": { + "$ref": "#/components/schemas/cm.module.ethernetClients" + }, + "localConnections": { + "$ref": "#/components/schemas/cm.module.localConnections" + } + } + }, + "cm.module.config": { + "additionalProperties": false, + "description": "Definition of module configurable parameters", + "properties": { + "moduleName": { + "$ref": "#/components/schemas/cm.module.parameters.moduleName" + }, + "labels": { + "$ref": "#/components/schemas/cm.parameters.labels" + } + }, + "type": "object" + }, + "cm.module.state": { + "description": "Definition of module state object", + "properties": { + "moduleName": { + "$ref": "#/components/schemas/xr.device.n" + }, + "moduleAid": { + "$ref": "#/components/schemas/xr.device.aid" + }, + "labels": { + "$ref": "#/components/schemas/cm.parameters.labels" + }, + "configuredRole": { + "$ref": "#/components/schemas/xr.configuration.configuredRole" + }, + "currentRole": { + "$ref": "#/components/schemas/xr.configuration.currentRole" + }, + "roleStatus": { + "$ref": "#/components/schemas/xr.configuration.roleStatus" + }, + "trafficMode": { + "$ref": "#/components/schemas/xr.configuration.trafficMode" + }, + "serdesRate": { + "$ref": "#/components/schemas/xr.configuration.serdesRate" + }, + "fiberConnectionMode": { + "$ref": "#/components/schemas/xr.configuration.fiberConnectionMode" + }, + "tcMode": { + "$ref": "#/components/schemas/xr.configuration.tcMode" + }, + "connectivityState": { + "$ref": "#/components/schemas/cm.module.parameters.connectivityState" + }, + "hwDescription": { + "$ref": "#/components/schemas/cm.module.state.hwDescription" + } + } + }, + "cm.module.state.hwDescription": { + "description": "Definition of module platform properties", + "properties": { + "pi": { + "$ref": "#/components/schemas/xr.platform.pi" + }, + "mnfv": { + "$ref": "#/components/schemas/xr.platform.mnfv" + }, + "mnmn": { + "$ref": "#/components/schemas/xr.platform.mnmn" + }, + "mnmo": { + "$ref": "#/components/schemas/xr.platform.mnmo" + }, + "mnhw": { + "$ref": "#/components/schemas/xr.platform.mnhw" + }, + "mndt": { + "$ref": "#/components/schemas/xr.platform.mndt" + }, + "serialNumber": { + "$ref": "#/components/schemas/xr.platform.mnsel" + }, + "clei": { + "$ref": "#/components/schemas/xr.platform.clei" + }, + "macAddress": { + "$ref": "#/components/schemas/xr.platform.macAddress" + }, + "connectorType": { + "$ref": "#/components/schemas/xr.platform.connectorType" + }, + "formFactor": { + "$ref": "#/components/schemas/xr.platform.formFactor" + }, + "piid": { + "$ref": "#/components/schemas/xr.device.piid" + }, + "dmn": { + "$ref": "#/components/schemas/xr.device.dmn" + }, + "sv": { + "$ref": "#/components/schemas/xr.device.sv" + }, + "icv": { + "$ref": "#/components/schemas/xr.device.icv" + } + }, + "x-oapi-codegen-extra-tags": { + "bson": "hwDescription" + } + }, + "cm.module.parameters.moduleName": { + "description": "Property to change the device name. This is also reflected in the same property in oic.wk.d", + "maxLength": 64, + "title": "Device name", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "moduleName" + } + }, + "cm.module.parameters.connectivityState": { + "description": "The CM connectivity state between the CM and the device.", + "enum": [ + "active", + "inactive" + ], + "title": "Connectivity state", + "type": "string", + "x-enum-varnames": [ + "Active", + "Inactive" + ], + "x-oapi-codegen-extra-tags": { + "bson": "connectivityState" + } + }, + "cm.module.update": { + "additionalProperties": false, + "description": "Definition of module editable parameters", + "minProperties": 1, + "properties": { + "moduleName": { + "$ref": "#/components/schemas/cm.module.parameters.moduleName" + }, + "labels": { + "$ref": "#/components/schemas/cm.parameters.labels" + } + }, + "type": "object" + }, + "cm.module.linePtp": { + "description": "Definition of module line port object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/xr.common.colId" + }, + "config": { + "$ref": "#/components/schemas/cm.module.linePtp.config" + }, + "state": { + "$ref": "#/components/schemas/cm.module.linePtp.state" + }, + "carriers": { + "$ref": "#/components/schemas/cm.module.linePtp.carriers" + } + } + }, + "cm.module.linePtps": { + "items": { + "$ref": "#/components/schemas/cm.module.linePtp" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "linePtps" + } + }, + "cm.module.linePtp.config": { + "additionalProperties": false, + "description": "Definition of module port configurable parameters", + "properties": { + "administrativeState": { + "$ref": "#/components/schemas/cm.module.linePtp.parameters.administrativeState" + } + }, + "type": "object" + }, + "cm.module.linePtp.state": { + "description": "Definition of module line port state object", + "properties": { + "linePtpAid": { + "$ref": "#/components/schemas/xr.lineptp.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/xr.lineptp.parentAid" + }, + "administrativeState": { + "$ref": "#/components/schemas/cm.module.linePtp.parameters.administrativeState" + }, + "operStatus": { + "$ref": "#/components/schemas/xr.lineptp.operStatus" + }, + "discoveredNeighbors": { + "$ref": "#/components/schemas/cm.module.linePtp.discoveredNeighbors" + }, + "ctrlPlaneNeighbors": { + "$ref": "#/components/schemas/cm.module.linePtp.ctrlPlaneNeighbors" + } + }, + "type": "object" + }, + "cm.module.linePtp.ctrlPlaneNeighbor": { + "properties": { + "macAddress": { + "$ref": "#/components/schemas/xr.controlplane.neighbor.macAddress" + }, + "currentRole": { + "$ref": "#/components/schemas/xr.controlplane.neighbor.currentRole" + }, + "constellationFrequency": { + "$ref": "#/components/schemas/xr.controlplane.neighbor.constellationFrequency" + }, + "conState": { + "$ref": "#/components/schemas/xr.controlplane.neighbor.conState" + }, + "lastConStateChange": { + "$ref": "#/components/schemas/xr.controlplane.neighbor.lastConStateChange" + } + } + }, + "cm.module.linePtp.ctrlPlaneNeighbors": { + "description": "Array of XR modules to which control plane connectivity is, or has been, established.", + "items": { + "$ref": "#/components/schemas/cm.module.linePtp.ctrlPlaneNeighbor" + }, + "maxItems": 20, + "minItems": 0, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "ctrlPlaneNeighbors" + } + }, + "cm.module.linePtp.discoveredNeighbor": { + "properties": { + "macAddress": { + "$ref": "#/components/schemas/xr.discovered.neighbor.macAddress" + }, + "currentRole": { + "$ref": "#/components/schemas/xr.discovered.neighbor.currentRole" + }, + "discoveredTime": { + "$ref": "#/components/schemas/xr.discovered.neighbor.discoveredTime" + }, + "constellationFrequency": { + "$ref": "#/components/schemas/xr.discovered.neighbor.constellationFrequency" + } + } + }, + "cm.module.linePtp.discoveredNeighbors": { + "description": "Array of XR modules discovered in the last performed fast scan.\nEntities in the ctrlPlaneNeighbors array will not be shown here.\n", + "items": { + "$ref": "#/components/schemas/cm.module.linePtp.discoveredNeighbor" + }, + "maxItems": 10, + "minItems": 0, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "discoveredNeighbors" + } + }, + "cm.module.linePtp.parameters.administrativeState": { + "description": "Configurable admin state of the line side port", + "enum": [ + "lock", + "unlock", + "maintenance" + ], + "title": "Administrative State", + "type": "string", + "x-enum-varnames": [ + "Lock", + "Unlock", + "Maintenance" + ], + "x-oapi-codegen-extra-tags": { + "bson": "administrativeState" + }, + "x-trafficAffecting": true + }, + "cm.module.linePtp.update": { + "additionalProperties": false, + "description": "Definition of module line port editable parameters", + "minProperties": 1, + "properties": { + "administrativeState": { + "$ref": "#/components/schemas/cm.module.linePtp.parameters.administrativeState" + } + }, + "type": "object" + }, + "cm.module.linePtp.carrier": { + "description": "Definition of module carrier object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/xr.common.colId" + }, + "config": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.config" + }, + "state": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.state" + }, + "dscgs": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dscgs" + }, + "dscs": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dscs" + } + } + }, + "cm.module.linePtp.carriers": { + "items": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "carriers" + } + }, + "cm.module.linePtp.carrier.config": { + "description": "Definition of module carrier configurable parameters", + "properties": { + "loopback": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.parameters.loopback" + } + }, + "type": "object" + }, + "cm.module.linePtp.carrier.state": { + "description": "Definition of module carrier state object", + "properties": { + "carrierAid": { + "$ref": "#/components/schemas/xr.carrier.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/xr.carrier.parentAid" + }, + "frequencyCtrl": { + "$ref": "#/components/schemas/xr.carrier.frequencyCtrl" + }, + "constellationFrequency": { + "$ref": "#/components/schemas/xr.carrier.constellationFrequency" + }, + "operatingFrequency": { + "$ref": "#/components/schemas/xr.carrier.operatingFrequency" + }, + "ncoFrequency": { + "$ref": "#/components/schemas/xr.carrier.ncoFrequency" + }, + "modulation": { + "$ref": "#/components/schemas/xr.carrier.modulation" + }, + "capacity": { + "$ref": "#/components/schemas/xr.carrier.capacity" + }, + "clientPortMode": { + "$ref": "#/components/schemas/xr.carrier.clientPortMode" + }, + "baudRate": { + "$ref": "#/components/schemas/xr.carrier.baudRate" + }, + "maxAllowedDSCs": { + "$ref": "#/components/schemas/xr.carrier.maxAllowedDSCs" + }, + "txPowerTargetPerDsc": { + "$ref": "#/components/schemas/xr.carrier.txPowerTargetPerDsc" + }, + "loopback": { + "$ref": "#/components/schemas/xr.carrier.diagnostic.loopback" + } + }, + "type": "object" + }, + "cm.module.linePtp.carrier.parameters.loopback": { + "default": "disabled", + "description": "Enable/Disable loopback", + "enum": [ + "disabled", + "terminal" + ], + "title": "Loopback", + "type": "string", + "x-enum-varnames": [ + "Disabled", + "Terminal" + ], + "x-oapi-codegen-extra-tags": { + "bson": "loopback" + }, + "x-trafficAffecting": true + }, + "cm.module.linePtp.carrier.update": { + "additionalProperties": false, + "description": "Definition of module carrier editable parameters", + "minProperties": 1, + "properties": { + "loopback": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.parameters.loopback" + } + }, + "type": "object" + }, + "cm.module.linePtp.carrier.dsc": { + "description": "Definition of module dsc object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/xr.common.colId" + }, + "config": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dsc.config" + }, + "state": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dsc.state" + } + } + }, + "cm.module.linePtp.carrier.dscs": { + "items": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dsc" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "dscs" + } + }, + "cm.module.linePtp.carrier.dsc.config": { + "additionalProperties": false, + "description": "Definition of module dsc configurable parameters", + "properties": { + "usability": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dsc.parameters.usability" + }, + "txEnabled": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dsc.parameters.txEnabled" + }, + "rxEnabled": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dsc.parameters.rxEnabled" + }, + "facPRBSGenEnabled": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dsc.parameters.facPRBSGenEnabled" + }, + "facPRBSMonEnabled": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dsc.parameters.facPRBSMonEnabled" + }, + "powerOffset": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dsc.parameters.powerOffset" + } + }, + "type": "object" + }, + "cm.module.linePtp.carrier.dsc.state": { + "description": "Definition of module dsc state object", + "properties": { + "dscAid": { + "$ref": "#/components/schemas/xr.carrier.dsc.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/xr.carrier.dsc.parentAid" + }, + "cDsc": { + "$ref": "#/components/schemas/xr.carrier.dsc.cDsc" + }, + "usability": { + "$ref": "#/components/schemas/xr.carrier.dsc.usability" + }, + "txEnabled": { + "$ref": "#/components/schemas/xr.carrier.dsc.txEnabled" + }, + "rxEnabled": { + "$ref": "#/components/schemas/xr.carrier.dsc.rxEnabled" + }, + "txStatus": { + "$ref": "#/components/schemas/xr.carrier.dsc.txStatus" + }, + "rxStatus": { + "$ref": "#/components/schemas/xr.carrier.dsc.rxStatus" + }, + "powerOffset": { + "$ref": "#/components/schemas/xr.carrier.dsc.powerOffset" + }, + "facPRBSGenEnabled": { + "$ref": "#/components/schemas/xr.carrier.dsc.diagnostic.facPRBSGenEnabled" + }, + "facPRBSMonEnabled": { + "$ref": "#/components/schemas/xr.carrier.dsc.diagnostic.facPRBSMonEnabled" + } + }, + "type": "object" + }, + "cm.module.linePtp.carrier.dsc.parameters.usability": { + "default": "usable", + "description": "Usability of this DSC. Configurable to control the allowed uses.\n * `usable` - DSC is usable for either PRBS or data.\n * `prbsOnly` - DSC is usable only for PRBS. This is done for optical power balancing reasons.\n * `reserved` - DSC is reserved and is not usable for either PRBS or data.\n", + "enum": [ + "usable", + "prbsOnly", + "reserved" + ], + "title": "Usability", + "type": "string", + "x-enum-varnames": [ + "Usable", + "PRBS only", + "Reserved" + ], + "x-oapi-codegen-extra-tags": { + "bson": "usability" + }, + "x-trafficAffecting": true + }, + "cm.module.linePtp.carrier.dsc.parameters.txEnabled": { + "default": false, + "description": "Configurable to enable/disable Tx transmission on this DSC. \nWhen disabled, this prevents any traffic from going out of the DSC.\n", + "title": "TX Enabled", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "txEnabled" + }, + "x-trafficAffecting": true + }, + "cm.module.linePtp.carrier.dsc.parameters.rxEnabled": { + "default": true, + "description": "Configurable to enable/disable the DSC to receive traffic.", + "title": "Rx Enabled", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "rxEnabled" + }, + "x-trafficAffecting": true + }, + "cm.module.linePtp.carrier.dsc.parameters.facPRBSGenEnabled": { + "default": false, + "description": "Configurable to enable/disable facility PRBS test pattern generation", + "title": "Facility PRBS generation", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "facPRBSGenEnabled" + }, + "x-trafficAffecting": true + }, + "cm.module.linePtp.carrier.dsc.parameters.facPRBSMonEnabled": { + "default": false, + "description": "Configurable to enable/disable facility PRBS test pattern monitoring", + "title": "Facility PRBS monitoring", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "facPRBSMonEnabled" + }, + "x-trafficAffecting": true + }, + "cm.module.linePtp.carrier.dsc.parameters.powerOffset": { + "default": 0, + "description": "Power offset relative to the average DSC power.", + "format": "double", + "maximum": 6, + "minimum": -6, + "multipleOf": 0.1, + "title": "Power offset", + "type": "number", + "x-unit": "dB", + "x-oapi-codegen-extra-tags": { + "bson": "powerOffset" + }, + "x-trafficAffecting": true + }, + "cm.module.linePtp.carrier.dsc.update": { + "additionalProperties": false, + "description": "Definition of module dsc editable parameters", + "minProperties": 1, + "properties": { + "usability": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dsc.parameters.usability" + }, + "txEnabled": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dsc.parameters.txEnabled" + }, + "rxEnabled": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dsc.parameters.rxEnabled" + }, + "facPRBSGenEnabled": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dsc.parameters.facPRBSGenEnabled" + }, + "facPRBSMonEnabled": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dsc.parameters.facPRBSMonEnabled" + }, + "powerOffset": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dsc.parameters.powerOffset" + } + }, + "type": "object" + }, + "cm.module.linePtp.carrier.dscg": { + "description": "Definition of module dscg object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/xr.common.colId" + }, + "state": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dscg.state" + } + } + }, + "cm.module.linePtp.carrier.dscgs": { + "items": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dscg" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "dscgs" + } + }, + "cm.module.linePtp.carrier.dscg.state": { + "description": "Definition of module dscg state object", + "properties": { + "dscgAid": { + "$ref": "#/components/schemas/xr.carrier.dscg.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/xr.carrier.dscg.parentAid" + }, + "txDSCs": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dscg.txDSCs" + }, + "rxDSCs": { + "$ref": "#/components/schemas/cm.module.linePtp.carrier.dscg.rxDSCs" + } + }, + "type": "object" + }, + "cm.module.linePtp.carrier.dscg.txDSCs": { + "items": { + "$ref": "#/components/schemas/xr.carrier.dsc.aid" + }, + "maxItems": 16, + "minItems": 0, + "type": "array", + "uniqueItems": true, + "x-oapi-codegen-extra-tags": { + "bson": "txDSCs" + } + }, + "cm.module.linePtp.carrier.dscg.rxDSCs": { + "items": { + "$ref": "#/components/schemas/xr.carrier.dsc.aid" + }, + "maxItems": 16, + "minItems": 0, + "type": "array", + "uniqueItems": true, + "x-oapi-codegen-extra-tags": { + "bson": "rxDSCs" + } + }, + "cm.module.otu": { + "description": "Definition of module otu object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/xr.common.colId" + }, + "config": { + "$ref": "#/components/schemas/cm.module.otu.config" + }, + "state": { + "$ref": "#/components/schemas/cm.module.otu.state" + }, + "odus": { + "$ref": "#/components/schemas/cm.module.odus" + } + } + }, + "cm.module.otus": { + "items": { + "$ref": "#/components/schemas/cm.module.otu" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "otus" + } + }, + "cm.module.otu.config": { + "additionalProperties": false, + "description": "Definition of module otu configurable parameters", + "properties": { + "txTTI": { + "$ref": "#/components/schemas/cm.module.otu.parameters.txTTI" + }, + "expectedTTI": { + "$ref": "#/components/schemas/cm.module.otu.parameters.expectedTTI" + }, + "facPRBSGen": { + "$ref": "#/components/schemas/cm.module.otu.parameters.facPRBSGen" + }, + "facPRBSMon": { + "$ref": "#/components/schemas/cm.module.otu.parameters.facPRBSMon" + } + }, + "type": "object" + }, + "cm.module.otu.state": { + "description": "Definition of module otu state object", + "properties": { + "otuAid": { + "$ref": "#/components/schemas/xr.otu.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/xr.otu.parentAid" + }, + "otuType": { + "$ref": "#/components/schemas/xr.otu.otuType" + }, + "rate": { + "$ref": "#/components/schemas/xr.otu.rate" + }, + "operStatus": { + "$ref": "#/components/schemas/xr.otu.operStatus" + }, + "txTTI": { + "$ref": "#/components/schemas/xr.otu.txTTI" + }, + "rxTTI": { + "$ref": "#/components/schemas/xr.otu.rxTTI" + }, + "expectedTTI": { + "$ref": "#/components/schemas/xr.otu.expectedTTI" + }, + "facPRBSGen": { + "$ref": "#/components/schemas/xr.otu.diagnostic.facPRBSGen" + }, + "facPRBSMon": { + "$ref": "#/components/schemas/xr.otu.diagnostic.facPRBSMon" + } + }, + "type": "object" + }, + "cm.module.otu.parameters.txTTI": { + "default": "", + "description": "Up to 64 byte string for transmitting as TTI.", + "maxLength": 64, + "title": "Transmit TTI", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "txTTI" + } + }, + "cm.module.otu.parameters.expectedTTI": { + "default": "", + "description": "Up to 64 byte string of TTI that is expected to be received.", + "maxLength": 64, + "title": "Expected TTI", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "expectedTTI" + } + }, + "cm.module.otu.parameters.facPRBSGen": { + "default": "disabled", + "description": "Enable/Disable facility PRBS test pattern generation", + "enum": [ + "enabled", + "disabled" + ], + "title": "Facility PRBS generation", + "type": "string", + "x-enum-varnames": [ + "Enabled", + "Disabled" + ], + "x-oapi-codegen-extra-tags": { + "bson": "facPRBSGen" + }, + "x-trafficAffecting": true + }, + "cm.module.otu.parameters.facPRBSMon": { + "default": "disabled", + "description": "Enable/Disable facility PRBS test pattern monitoring", + "enum": [ + "enabled", + "disabled" + ], + "title": "Facility PRBS monitoring", + "type": "string", + "x-enum-varnames": [ + "Enabled", + "Disabled" + ], + "x-oapi-codegen-extra-tags": { + "bson": "facPRBSMon" + }, + "x-trafficAffecting": true + }, + "cm.module.otu.update": { + "additionalProperties": false, + "description": "Definition of module otu editable parameters", + "minProperties": 1, + "properties": { + "txTTI": { + "$ref": "#/components/schemas/cm.module.otu.parameters.txTTI" + }, + "expectedTTI": { + "$ref": "#/components/schemas/cm.module.otu.parameters.expectedTTI" + }, + "facPRBSGen": { + "$ref": "#/components/schemas/cm.module.otu.parameters.facPRBSGen" + }, + "facPRBSMon": { + "$ref": "#/components/schemas/cm.module.otu.parameters.facPRBSMon" + } + }, + "type": "object" + }, + "cm.module.odu": { + "description": "Definition of module odu object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/xr.common.colId" + }, + "state": { + "$ref": "#/components/schemas/cm.module.odu.state" + } + } + }, + "cm.module.odus": { + "items": { + "$ref": "#/components/schemas/cm.module.odu" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "odus" + } + }, + "cm.module.odu.state": { + "description": "Definition of module odu state object", + "properties": { + "oduAid": { + "$ref": "#/components/schemas/xr.otu.odu.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/xr.otu.odu.parentAid" + }, + "oduType": { + "$ref": "#/components/schemas/xr.otu.odu.oduType" + }, + "operStatus": { + "$ref": "#/components/schemas/xr.otu.odu.operStatus" + } + } + }, + "cm.module.ethernetClient": { + "description": "Definition of module ethernetClient object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/xr.common.colId" + }, + "config": { + "$ref": "#/components/schemas/cm.module.ethernetClient.config" + }, + "state": { + "$ref": "#/components/schemas/cm.module.ethernetClient.state" + }, + "acs": { + "$ref": "#/components/schemas/cm.module.ethernetClient.acs" + } + } + }, + "cm.module.ethernetClients": { + "items": { + "$ref": "#/components/schemas/cm.module.ethernetClient" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "ethernetClients" + } + }, + "cm.module.ethernetClient.config": { + "additionalProperties": false, + "description": "Definition of module ethernetClient configuration object", + "properties": { + "fecMode": { + "$ref": "#/components/schemas/cm.module.ethernetClient.parameters.fecMode" + }, + "loopbackType": { + "$ref": "#/components/schemas/cm.module.ethernetClient.parameters.loopbackType" + }, + "loopbackMode": { + "$ref": "#/components/schemas/cm.module.ethernetClient.parameters.loopbackMode" + }, + "lldp": { + "$ref": "#/components/schemas/cm.module.ethernetClient.config.lldp" + } + }, + "type": "object" + }, + "cm.module.ethernetClient.config.lldp": { + "additionalProperties": false, + "description": "Definition of module ethernetClient ethernetLLDP configurable parameters", + "properties": { + "adminStatus": { + "$ref": "#/components/schemas/cm.module.ethernetClient.ethernetLLDP.parameters.adminStatus" + }, + "gccFwd": { + "$ref": "#/components/schemas/cm.module.ethernetClient.ethernetLLDP.parameters.gccFwd" + }, + "hostRxDrop": { + "$ref": "#/components/schemas/cm.module.ethernetClient.ethernetLLDP.parameters.hostRxDrop" + }, + "TTLUsage": { + "$ref": "#/components/schemas/cm.module.ethernetClient.ethernetLLDP.parameters.TTLUsage" + }, + "clrStats": { + "$ref": "#/components/schemas/cm.module.ethernetClient.ethernetLLDP.parameters.clrStats" + }, + "flushHostDb": { + "$ref": "#/components/schemas/cm.module.ethernetClient.ethernetLLDP.parameters.flushHostDb" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "lldp" + } + }, + "cm.module.ethernetClient.state": { + "description": "Definition of module ethernetClient state parameters", + "properties": { + "clientIfAid": { + "$ref": "#/components/schemas/xr.ethernet.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/xr.ethernet.parentAid" + }, + "clientIfPortSpeed": { + "$ref": "#/components/schemas/xr.ethernet.portSpeed" + }, + "fecType": { + "$ref": "#/components/schemas/xr.ethernet.fecType" + }, + "fecMode": { + "$ref": "#/components/schemas/xr.ethernet.fecMode" + }, + "loopbackType": { + "$ref": "#/components/schemas/xr.ethernet.diagnostic.loopbackType" + }, + "loopbackMode": { + "$ref": "#/components/schemas/xr.ethernet.diagnostic.loopbackMode" + }, + "lldp": { + "$ref": "#/components/schemas/cm.module.ethernetClient.state.lldp" + } + }, + "type": "object" + }, + "cm.module.ethernetClient.state.lldp": { + "description": "Definition of module ethernetClient ethernetLLDP state parameters", + "properties": { + "lldpconfigAid": { + "$ref": "#/components/schemas/xr.ethernet.lldpconfig.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/xr.ethernet.lldpconfig.parentAid" + }, + "adminStatus": { + "$ref": "#/components/schemas/xr.ethernet.lldpconfig.adminStatus" + }, + "gccFwd": { + "$ref": "#/components/schemas/xr.ethernet.lldpconfig.gccFwd" + }, + "hostRxDrop": { + "$ref": "#/components/schemas/xr.ethernet.lldpconfig.hostRxDrop" + }, + "TTLUsage": { + "$ref": "#/components/schemas/xr.ethernet.lldpconfig.TTLUsage" + }, + "tooManyNeighbors": { + "$ref": "#/components/schemas/xr.ethernet.lldpconfig.tooManyNeighbors" + }, + "clrStats": { + "$ref": "#/components/schemas/xr.ethernet.lldpconfig.clrStats" + }, + "flushHostDb": { + "$ref": "#/components/schemas/xr.ethernet.lldpconfig.flushHostDb" + }, + "neighbors": { + "$ref": "#/components/schemas/cm.module.ethernetClient.state.lldp.neighbors" + } + }, + "x-oapi-codegen-extra-tags": { + "bson": "lldp" + } + }, + "cm.module.ethernetClient.state.lldp.neighbors": { + "items": { + "$ref": "#/components/schemas/cm.module.ethernetClient.state.lldp.neighbor" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "neighbors" + } + }, + "cm.module.ethernetClient.state.lldp.neighbor": { + "description": "Definition of module host neighbors state parameters", + "properties": { + "hostneighborAid": { + "$ref": "#/components/schemas/xr.ethernet.hostneighbors.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/xr.ethernet.hostneighbors.parentAid" + }, + "portSourceMAC": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.localPortSourceMAC" + }, + "chassisIdSubtype": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.chassisIdSubtype" + }, + "chassisId": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.chassisId" + }, + "portIdSubtype": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.portIdSubtype" + }, + "portId": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.portId" + }, + "portDescr": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.portDescr" + }, + "sysName": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.sysName" + }, + "sysDescr": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.sysDescr" + }, + "sysTTL": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.sysTTL" + }, + "lldpPDU": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.lldpPDU" + } + }, + "x-oapi-codegen-extra-tags": { + "bson": "neighbor" + } + }, + "cm.module.ethernetClient.parameters.fecMode": { + "default": "enabled", + "description": "Forward error correction mode of operation", + "enum": [ + "enabled", + "disabled" + ], + "title": "Forward error correction mode", + "type": "string", + "x-enum-varnames": [ + "Enabled", + "Disabled" + ], + "x-oapi-codegen-extra-tags": { + "bson": "fecMode" + }, + "x-trafficAffecting": true + }, + "cm.module.ethernetClient.parameters.loopbackType": { + "default": "loopbackAndContinue", + "description": "Loopback type.\n* `loopbackAndContinue` - Signal is looped back and is also forwarded downstream.\n* `loopback` - Signal is looped back and LF maintenance signal is sent downstream.\n", + "enum": [ + "loopbackAndContinue", + "loopback" + ], + "title": "Loopback type", + "type": "string", + "x-enum-varnames": [ + "Loopback and continue", + "Loopback" + ], + "x-oapi-codegen-extra-tags": { + "bson": "loopbackType" + } + }, + "cm.module.ethernetClient.parameters.loopbackMode": { + "default": "disabled", + "description": "Post-FEC Loopback mode for the ethernet client.", + "enum": [ + "disabled", + "facility", + "terminal" + ], + "title": "Loopback mode", + "type": "string", + "x-enum-varnames": [ + "Disabled", + "Facility", + "Terminal" + ], + "x-oapi-codegen-extra-tags": { + "bson": "loopbackMode" + }, + "x-trafficAffecting": true + }, + "cm.module.ethernetClient.ethernetLLDP.parameters.adminStatus": { + "default": "disabled", + "description": "Administrative state to Enable/Disable LLDP in rxOnly mode.", + "enum": [ + "rxOnly", + "disabled" + ], + "title": "Admin state", + "type": "string", + "x-enum-varnames": [ + "RX only", + "Disabled" + ], + "x-oapi-codegen-extra-tags": { + "bson": "adminStatus" + } + }, + "cm.module.ethernetClient.ethernetLLDP.parameters.gccFwd": { + "default": false, + "description": "Enable/Disable forwarding of untagged LLDP frames over GCC.\n * `true` - Enabled.\n * `false` - Disabled.\n", + "title": "Forward GCC", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "gccFwd" + } + }, + "cm.module.ethernetClient.ethernetLLDP.parameters.hostRxDrop": { + "default": false, + "description": "Enable/Disable LLDP drop in Rx direction of Ethernet Client ports.\n * `true`: - Enabled.\n * `false`: - Disabled.\n", + "title": "LLDP drop", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "hostRxDrop" + } + }, + "cm.module.ethernetClient.ethernetLLDP.parameters.TTLUsage": { + "default": true, + "description": "Enable/Disable usage of TTL values for flushing/starting LLDP internal flush timer.\n * `true`: - Enabled.\n * `false`: - Disabled.\n", + "title": "TTL usage", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "TTLUsage" + } + }, + "cm.module.ethernetClient.ethernetLLDP.parameters.clrStats": { + "default": false, + "description": "Action to clear LLDP statistics. Set to true to trigger the action. Server resets it to false when action is completed.", + "title": "Clear LLDP statistics", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "clrStats" + } + }, + "cm.module.ethernetClient.ethernetLLDP.parameters.flushHostDb": { + "default": false, + "description": "Action to flush the learned host system information. Set to true to trigger the action. Server resets it to false when action is completed.", + "title": "Flush neighbor information", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "flushHostDb" + } + }, + "cm.module.ethernetClient.update": { + "additionalProperties": false, + "description": "Definition of module ethernetClient editable object", + "minProperties": 1, + "properties": { + "fecMode": { + "$ref": "#/components/schemas/cm.module.ethernetClient.parameters.fecMode" + }, + "loopbackType": { + "$ref": "#/components/schemas/cm.module.ethernetClient.parameters.loopbackType" + }, + "loopbackMode": { + "$ref": "#/components/schemas/cm.module.ethernetClient.parameters.loopbackMode" + }, + "lldp": { + "$ref": "#/components/schemas/cm.module.ethernetClient.update.lldp" + } + }, + "type": "object" + }, + "cm.module.ethernetClient.update.lldp": { + "additionalProperties": false, + "description": "Definition of module ethernetClient lldp editable parameters", + "minProperties": 1, + "properties": { + "adminStatus": { + "$ref": "#/components/schemas/cm.module.ethernetClient.ethernetLLDP.parameters.adminStatus" + }, + "gccFwd": { + "$ref": "#/components/schemas/cm.module.ethernetClient.ethernetLLDP.parameters.gccFwd" + }, + "hostRxDrop": { + "$ref": "#/components/schemas/cm.module.ethernetClient.ethernetLLDP.parameters.hostRxDrop" + }, + "TTLUsage": { + "$ref": "#/components/schemas/cm.module.ethernetClient.ethernetLLDP.parameters.TTLUsage" + }, + "clrStats": { + "$ref": "#/components/schemas/cm.module.ethernetClient.ethernetLLDP.parameters.clrStats" + }, + "flushHostDb": { + "$ref": "#/components/schemas/cm.module.ethernetClient.ethernetLLDP.parameters.flushHostDb" + } + }, + "type": "object" + }, + "cm.module.ethernetClient.ac": { + "description": "Definition of module ethernetClient attachmentCircuit object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/xr.common.colId" + }, + "state": { + "$ref": "#/components/schemas/cm.module.ethernetClient.attachmentCircuit.state" + } + } + }, + "cm.module.ethernetClient.acs": { + "items": { + "$ref": "#/components/schemas/cm.module.ethernetClient.ac" + }, + "maxItems": 16, + "minItems": 0, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "acs" + } + }, + "cm.module.ethernetClient.attachmentCircuit.state": { + "description": "Definition of module ethernet client attachment circuit state parameters", + "properties": { + "attachmentCircuitAid": { + "$ref": "#/components/schemas/xr.ethernet.ac.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/xr.ethernet.ac.parentAid" + }, + "capacity": { + "$ref": "#/components/schemas/xr.ethernet.ac.capacity" + }, + "imc": { + "$ref": "#/components/schemas/xr.ethernet.ac.imc" + }, + "imcOuterVID": { + "$ref": "#/components/schemas/xr.ethernet.ac.imcOuterVID" + }, + "emc": { + "$ref": "#/components/schemas/xr.ethernet.ac.emc" + }, + "emcOuterVID": { + "$ref": "#/components/schemas/xr.ethernet.ac.emcOuterVID" + } + }, + "type": "object" + }, + "cm.module.localConnection": { + "description": "Definition of module localConnection object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/xr.common.colId" + }, + "state": { + "$ref": "#/components/schemas/cm.module.localConnection.state" + } + } + }, + "cm.module.localConnections": { + "items": { + "$ref": "#/components/schemas/cm.module.localConnection" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "localConnections" + } + }, + "cm.module.localConnection.state": { + "description": "Definition of module ethernetClient state parameters", + "properties": { + "lcAid": { + "$ref": "#/components/schemas/xr.lc.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/xr.lc.parentAid" + }, + "direction": { + "$ref": "#/components/schemas/xr.lc.direction" + }, + "clientAid": { + "$ref": "#/components/schemas/xr.lc.clientAid" + }, + "dscgAid": { + "$ref": "#/components/schemas/xr.lc.dscgAid" + }, + "lineAid": { + "$ref": "#/components/schemas/xr.lc.lineAid" + }, + "remoteModuleId": { + "$ref": "#/components/schemas/xr.lc.remoteModuleId" + }, + "remoteClientId": { + "$ref": "#/components/schemas/xr.lc.remoteClientId" + } + } + }, + "errors": { + "properties": { + "errors": { + "description": "List of errors for a given request", + "items": { + "$ref": "#/components/schemas/cm.error" + }, + "type": "array" + } + }, + "type": "object" + }, + "cm.error": { + "description": "Error message.", + "minLength": 1, + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "code", + "message" + ], + "title": "Error Message", + "type": "object" + }, + "cm.parameters.href": { + "description": "Resource HREF", + "title": "ResourceHREF", + "type": "string", + "uniqueItems": true, + "x-oapi-codegen-extra-tags": { + "bson": "href" + } + }, + "cm.parameters.rt": { + "description": "Resource Type or set of Resource Types", + "items": { + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "title": "Resource Type", + "type": "array", + "uniqueItems": true, + "x-oapi-codegen-extra-tags": { + "bson": "rt" + } + }, + "cm.parameters.uuid": { + "description": "Object identifier", + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "title": "ID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "id" + } + }, + "cm.parameters.labels": { + "additionalProperties": { + "maxLength": 64, + "minLength": 1, + "pattern": "^([A-Za-z0-9_\\-.,: ]*)$", + "type": "string" + }, + "description": "Assign key:value labels to objects", + "title": "Labels", + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "labels" + } + }, + "xr.device.n": { + "description": "Friendly name of the device", + "maxLength": 64, + "readOnly": true, + "title": "Module name", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "moduleName" + } + }, + "xr.device.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "maxLength": 64, + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "moduleAid" + } + }, + "xr.configuration.configuredRole": { + "default": "auto", + "description": "Module role configured by user.\nPossible values:\n- auto: When role is automatically assigned by XR or by user via the Host interface\n- hub\n- leaf\n", + "enum": [ + "hub", + "leaf", + "auto" + ], + "title": "Configured Role", + "type": "string", + "x-enum-varnames": [ + "Hub", + "Leaf", + "Auto" + ], + "x-oapi-codegen-extra-tags": { + "bson": "configuredRole" + } + }, + "xr.configuration.currentRole": { + "default": "unknown", + "description": "Current module role\nPossible values:\n- unknown\n- hub\n- leaf\n", + "enum": [ + "hub", + "leaf", + "unknown" + ], + "readOnly": true, + "title": "Current Role", + "type": "string", + "x-enum-varnames": [ + "Hub", + "Leaf", + "Unknown" + ], + "x-oapi-codegen-extra-tags": { + "bson": "currentRole" + } + }, + "xr.configuration.roleStatus": { + "default": "scanning", + "description": "Transitional state when currentRole is unknown or user is changing currentRole to a new role.\nPossible values:\n- scanning\n- changeInProgress\n- ready\n", + "enum": [ + "scanning", + "changeInProgress", + "ready" + ], + "readOnly": true, + "title": "Role Status", + "type": "string", + "x-enum-varnames": [ + "Scanning", + "Change in progress", + "Ready" + ], + "x-oapi-codegen-extra-tags": { + "bson": "roleStatus" + } + }, + "xr.configuration.trafficMode": { + "default": "L1Mode", + "description": "Possible Values:\n- L1Mode: Allows transparent transport of client traffic between XR hub and leaf client ports\n- VTIMode: Allows transport of VLAN flows between an XR hub client port to 1 or more XR leaf client ports\n", + "enum": [ + "L1Mode", + "VTIMode" + ], + "title": "Traffic mode", + "type": "string", + "x-enum-varnames": [ + "L1 mode", + "VTI mode" + ], + "x-oapi-codegen-extra-tags": { + "bson": "trafficMode" + } + }, + "xr.configuration.serdesRate": { + "default": "25", + "description": "Rate of serdes lanes as configured by the Host device in Gbps", + "enum": [ + "undefined", + "25", + "50" + ], + "readOnly": true, + "title": "Serdes lane rate", + "type": "string", + "x-enum-varnames": [ + "Undefined", + "25", + "50" + ], + "x-unit": "Gbps", + "x-oapi-codegen-extra-tags": { + "bson": "serdesRate" + } + }, + "xr.configuration.fiberConnectionMode": { + "description": "Possible Values:\n- single: only one fiber is connected for by-directional traffic\n- dual: separate fibers for transmit and receive\n", + "enum": [ + "single", + "dual" + ], + "title": "Fiber Mode", + "type": "string", + "x-enum-varnames": [ + "Single", + "Dual" + ], + "x-oapi-codegen-extra-tags": { + "bson": "fiberConnectionMode" + } + }, + "xr.configuration.tcMode": { + "default": true, + "description": "Enable/Disable IEEE 1588 Transparent Clock for VTI-mode.\n- true: Enabled\n- false: Disabled\n", + "title": "1588 Transparent Clock", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "tcMode" + } + }, + "xr.platform.pi": { + "description": "Unique UUID for the hardware platform calculated from the mac address", + "maxLength": 36, + "minLength": 36, + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "readOnly": true, + "title": "Platform UUID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "pi" + } + }, + "xr.platform.mnfv": { + "description": "Manufacturer's firmware version", + "maxLength": 64, + "readOnly": true, + "title": "Firmware version", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "mnfv" + } + }, + "xr.platform.mnmn": { + "description": "Manufacturer name", + "maxLength": 64, + "readOnly": true, + "title": "Manufacturer", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "mnmn" + } + }, + "xr.platform.mnmo": { + "description": "Manufacturer's Model/Part number", + "maxLength": 64, + "readOnly": true, + "title": "Model number", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "mnmo" + } + }, + "xr.platform.mnhw": { + "description": "Platform Hardware Version", + "maxLength": 64, + "readOnly": true, + "title": "HW Version", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "mnhw" + } + }, + "xr.platform.mndt": { + "description": "HW Manufacturing date", + "pattern": "([0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|2[0-9]|1[0-9]|0[1-9])", + "readOnly": true, + "title": "Manufacturing date", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "mndt" + } + }, + "xr.platform.mnsel": { + "description": "Device Serial number", + "maxLength": 64, + "readOnly": true, + "title": "Serial number", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "serialNumber" + } + }, + "xr.platform.clei": { + "description": "Globally unique 10-character alphanumeric intelligent code identifying equipment in a structured naming format", + "readOnly": true, + "title": "CLEI Code", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "clei" + } + }, + "xr.platform.macAddress": { + "description": "Device MAC Address", + "readOnly": true, + "title": "MAC address", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "macAddress" + } + }, + "xr.platform.connectorType": { + "description": "Module connector type", + "enum": [ + "lcConnector" + ], + "readOnly": true, + "title": "Connector type", + "type": "string", + "x-enum-varnames": [ + "LC connector" + ], + "x-oapi-codegen-extra-tags": { + "bson": "connectorType" + } + }, + "xr.platform.formFactor": { + "description": "Module form factor", + "enum": [ + "cfp2-dco", + "qsfp-dd" + ], + "readOnly": true, + "title": "Form factor", + "type": "string", + "x-enum-varnames": [ + "CFP2-DCO", + "QSFP-DD" + ], + "x-oapi-codegen-extra-tags": { + "bson": "formFactor" + } + }, + "xr.device.piid": { + "description": "Protocol independent unique identifier for the Device that is immutable.", + "maxLength": 36, + "minLength": 36, + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "readOnly": true, + "title": "PIID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "piid" + } + }, + "xr.device.dmn": { + "properties": { + "language": { + "$ref": "#/components/schemas/xr.device.dmn.language" + }, + "value": { + "$ref": "#/components/schemas/xr.device.dmn.value" + } + }, + "x-oapi-codegen-extra-tags": { + "bson": "dmn" + } + }, + "xr.device.dmn.language": { + "description": "Format pattern according to IETF RFC 5646 (language tag).", + "pattern": "[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})", + "title": "Language", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "language" + } + }, + "xr.device.dmn.value": { + "description": "Vendor name", + "maxLength": 64, + "readOnly": true, + "title": "Vendor", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "value" + } + }, + "xr.device.sv": { + "description": "Software version.", + "maxLength": 64, + "readOnly": true, + "title": "Software version", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "sv" + } + }, + "xr.device.icv": { + "description": "Device HW version.", + "maxLength": 64, + "readOnly": true, + "title": "Hardware version", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "icv" + } + }, + "cm.parameters.parentId": { + "description": "Parent Object identifier", + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "title": "Parent ID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "parentId" + } + }, + "xr.common.colId": { + "description": "Object identifier in the supporting collection.", + "readOnly": true, + "title": "Collection Id", + "type": "integer", + "x-oapi-codegen-extra-tags": { + "bson": "colId" + } + }, + "xr.lineptp.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "maxLength": 64, + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "linePtpAid" + } + }, + "xr.lineptp.parentAid": { + "items": { + "$ref": "#/components/schemas/xr.device.aid" + }, + "maxItems": 1, + "minItems": 1, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "xr.lineptp.operStatus": { + "description": "Operational Status of line port.", + "enum": [ + "enabled", + "disabled" + ], + "readOnly": true, + "title": "Operational status", + "type": "string", + "x-enum-varnames": [ + "Enabled", + "Disabled" + ], + "x-oapi-codegen-extra-tags": { + "bson": "operStatus" + } + }, + "xr.controlplane.neighbor.macAddress": { + "description": "MAC address of the XR neighbor", + "readOnly": true, + "title": "MAC address", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "macAddress" + } + }, + "xr.controlplane.neighbor.currentRole": { + "description": "Role of the XR neighbor", + "enum": [ + "hub", + "leaf", + "unknown" + ], + "readOnly": true, + "title": "Current role", + "type": "string", + "x-enum-varnames": [ + "Hub", + "Leaf", + "Unknown" + ], + "x-oapi-codegen-extra-tags": { + "bson": "currentRole" + } + }, + "xr.controlplane.neighbor.constellationFrequency": { + "description": "Carrier center frequency of the Hub module within the constellation.", + "readOnly": true, + "title": "Constellation frequency", + "type": "integer", + "x-unit": "MHz", + "x-oapi-codegen-extra-tags": { + "bson": "constellationFrequency" + } + }, + "xr.controlplane.neighbor.conState": { + "description": "Shows if the control plane towards this XR module is currently active or not", + "enum": [ + "active", + "inactive" + ], + "readOnly": true, + "title": "Connection Status", + "type": "string", + "x-enum-varnames": [ + "Active", + "Inactive" + ], + "x-oapi-codegen-extra-tags": { + "bson": "conState" + } + }, + "xr.controlplane.neighbor.lastConStateChange": { + "description": "Timestamp of last change in connectivity in date-time format pattern according to IETF RFC 3339.\nIf conState is inactive, this timestamp shows when connectivity was lost.\nIf conState is active this timestamp shows when connection was established.\n", + "format": "date-time", + "readOnly": true, + "title": "Update Time", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "lastConStateChange" + } + }, + "xr.discovered.neighbor.macAddress": { + "description": "Device MAC address of the discovered XR neighbor", + "readOnly": true, + "title": "MAC address", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "macAddress" + } + }, + "xr.discovered.neighbor.currentRole": { + "description": "Role of the discovered XR neighbor", + "enum": [ + "hub", + "leaf", + "unknown" + ], + "readOnly": true, + "title": "Current role", + "type": "string", + "x-enum-varnames": [ + "Hub", + "Leaf", + "Unknown" + ], + "x-oapi-codegen-extra-tags": { + "bson": "currentRole" + } + }, + "xr.discovered.neighbor.discoveredTime": { + "description": "Timestamp of latest discovered beacon message from this XR neighbor in date-time format pattern according to IETF RFC 3339.", + "format": "date-time", + "readOnly": true, + "title": "Discovery Time", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "discoveredTime" + } + }, + "xr.discovered.neighbor.constellationFrequency": { + "description": "Constellation frequency of the discovered XR neighbor. I.e. the frequency at which this neighbor was discovered.", + "readOnly": true, + "title": "Constellation Frequency", + "type": "integer", + "x-unit": "MHz", + "x-oapi-codegen-extra-tags": { + "bson": "constellationFrequency" + } + }, + "xr.carrier.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "maxLength": 64, + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "carrierAid" + } + }, + "xr.carrier.parentAid": { + "items": { + "$ref": "#/components/schemas/xr.lineptp.aid" + }, + "maxItems": 1, + "minItems": 1, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "xr.carrier.frequencyCtrl": { + "default": "xr", + "description": "Shows the ownership of the constellation frequency configuration.\nPossible Values:\n- xr: hubFrequency can also be configured by XR CM\n- host: host system where the module is inserted is the master of constellationFrequency configuration.\n", + "enum": [ + "xr", + "host" + ], + "readOnly": true, + "title": "Frequency control", + "type": "string", + "x-enum-varnames": [ + "XR", + "Host" + ], + "x-oapi-codegen-extra-tags": { + "bson": "frequencyCtrl" + } + }, + "xr.carrier.constellationFrequency": { + "description": "The center frequency in MHz of the Hub within the constellation. \nConfigurable on both Hub and Leaf modules when frequencyCtrl is \"xr\".\nPossible values:\n- Minimum: 191000000\n- Maximum: 196100000\nOr\n- Value '0': used for \"Undefined\"\n", + "readOnly": true, + "title": "Constellation Frequency", + "type": "integer", + "x-unit": "MHz", + "x-oapi-codegen-extra-tags": { + "bson": "constellationFrequency" + } + }, + "xr.carrier.operatingFrequency": { + "description": "Carrier center frequency.\nPossible values:\n- Minimum: 191000000\n- Maximum: 196100000\n Or\n- Value '0': used for \"Undefined\"\n", + "readOnly": true, + "title": "Operating frequency", + "type": "integer", + "x-unit": "MHz", + "x-oapi-codegen-extra-tags": { + "bson": "operatingFrequency" + } + }, + "xr.carrier.ncoFrequency": { + "description": "Nominal carrier central frequency overloaded in MHz. \nPossible values:\n- Minimum: 191000000\n- Maximum: 196100000\n Or\n- Value '0': used for \"Undefined\".\n", + "readOnly": true, + "title": "Nominal central frequency overloaded", + "type": "integer", + "x-unit": "MHz", + "x-oapi-codegen-extra-tags": { + "bson": "ncoFrequency" + } + }, + "xr.carrier.modulation": { + "default": "16QAM", + "description": "Constellation carrier signal modulation (applied to Hub and leaf modules).\nPossible values: '16QAM', 'QPSK' ' 8QAM'\n", + "enum": [ + "16QAM", + "QPSK", + "8QAM" + ], + "title": "Modulation", + "type": "string", + "x-enum-varnames": [ + "16QAM", + "QPSK", + "8QAM" + ], + "x-oapi-codegen-extra-tags": { + "bson": "modulation" + } + }, + "xr.carrier.capacity": { + "description": "Modulation and maximum digital subcarriers determine the capacity in Gbps.\nPossible values: [ 25,50,100,200,300,400 ]\n", + "enum": [ + 25, + 50, + 100, + 200, + 300, + 400 + ], + "readOnly": true, + "title": "Capacity", + "type": "integer", + "x-enum-varnames": [ + "25", + "50", + "100", + "200", + "300", + "400" + ], + "x-unit": "Gbps", + "x-oapi-codegen-extra-tags": { + "bson": "capacity" + } + }, + "xr.carrier.clientPortMode": { + "default": "ethernet", + "description": "User can configure expected client port type", + "enum": [ + "ethernet", + "ethernetOtn" + ], + "title": "Client port mode", + "type": "string", + "x-enum-varnames": [ + "Ethernet", + "Ethernet or OTN" + ], + "x-oapi-codegen-extra-tags": { + "bson": "clientPortMode" + } + }, + "xr.carrier.baudRate": { + "description": "Baud rate in Giga-baud", + "readOnly": true, + "title": "Baud rate", + "type": "integer", + "x-unit": "GBd", + "x-oapi-codegen-extra-tags": { + "bson": "baudRate" + } + }, + "xr.carrier.maxAllowedDSCs": { + "description": "Number of digital subcarriers allowed to be used", + "enum": [ + 2, + 4, + 8, + 16 + ], + "readOnly": true, + "title": "Max number of digital subcarriers", + "type": "integer", + "x-enum-varnames": [ + "2", + "4", + "8", + "16" + ], + "x-oapi-codegen-extra-tags": { + "bson": "maxAllowedDSCs" + } + }, + "xr.carrier.txPowerTargetPerDsc": { + "default": -100, + "description": "Target power per DSC (applicable for all DSCs on the carrier) in dBm.\nPossible values:\n- Minimum: -35\n- Maximum: 0\n- Step: 0.1\n Or\n- Value '-100': used for \"Not configured\"\n", + "format": "double", + "maximum": 0, + "minimum": -100, + "multipleOf": 0.1, + "title": "Target power per DSC", + "type": "number", + "x-unit": "dBm", + "x-oapi-codegen-extra-tags": { + "bson": "txPowerTargetPerDsc" + } + }, + "xr.carrier.diagnostic.loopback": { + "default": "disabled", + "description": "Enable/Disable loopback", + "enum": [ + "disabled", + "terminal" + ], + "title": "Loopback", + "type": "string", + "x-enum-varnames": [ + "Disabled", + "Terminal" + ], + "x-oapi-codegen-extra-tags": { + "bson": "loopback" + }, + "x-trafficAffecting": true + }, + "xr.carrier.dsc.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "maxLength": 64, + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "dscAid" + } + }, + "xr.carrier.dsc.parentAid": { + "items": { + "$ref": "#/components/schemas/xr.carrier.aid" + }, + "maxItems": 1, + "minItems": 1, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "xr.carrier.dsc.cDsc": { + "description": "Constellation/Hub DSC ID assigned to a Leaf module. \nIn case of a Hub module, it defaults to the DSC instance ID (e.g., 1 to 16 when Hub is a 400G module\n", + "title": "Constellation DSC", + "type": "integer" + }, + "xr.carrier.dsc.usability": { + "default": "usable", + "description": "Usability of this DSC. Configurable to control the allowed uses.\n * `usable` - DSC is usable for either PRBS or data.\n * `prbsOnly` - DSC is usable only for PRBS. This is done for optical power balancing reasons.\n * `reserved` - DSC is reserved and is not usable for either PRBS or data.\n", + "enum": [ + "usable", + "prbsOnly", + "reserved" + ], + "title": "Usability", + "type": "string", + "x-enum-varnames": [ + "Usable", + "PRBS only", + "Reserved" + ], + "x-oapi-codegen-extra-tags": { + "bson": "usability" + }, + "x-trafficAffecting": true + }, + "xr.carrier.dsc.txEnabled": { + "default": false, + "description": "Configurable to enable/disable Tx transmission on this DSC. When disabled, this prevents any traffic from going out of the DSC.", + "title": "TX Enabled", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "txEnabled" + }, + "x-trafficAffecting": true + }, + "xr.carrier.dsc.rxEnabled": { + "default": true, + "description": "Configurable to enable/disable the DSC to receive traffic.", + "title": "Rx Enabled", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "rxEnabled" + }, + "x-trafficAffecting": true + }, + "xr.carrier.dsc.txStatus": { + "description": "Current DSC TX status.", + "enum": [ + "disabled", + "data", + "prbs" + ], + "readOnly": true, + "title": "TX status", + "type": "string", + "x-enum-varnames": [ + "Disabled", + "Data", + "PRBS" + ], + "x-oapi-codegen-extra-tags": { + "bson": "txStatus" + } + }, + "xr.carrier.dsc.rxStatus": { + "description": "Current DSC RX status.", + "enum": [ + "disabled", + "data", + "prbs" + ], + "readOnly": true, + "title": "RX status", + "type": "string", + "x-enum-varnames": [ + "Disabled", + "Data", + "PRBS" + ], + "x-oapi-codegen-extra-tags": { + "bson": "rxStatus" + } + }, + "xr.carrier.dsc.powerOffset": { + "default": 0, + "description": "Power offset relative to the average DSC power.", + "format": "double", + "maximum": 6, + "minimum": -6, + "multipleOf": 0.1, + "title": "Power offset", + "type": "number", + "x-unit": "dB", + "x-oapi-codegen-extra-tags": { + "bson": "powerOffset" + }, + "x-trafficAffecting": true + }, + "xr.carrier.dsc.diagnostic.facPRBSGenEnabled": { + "default": false, + "description": "Configurable to enable/disable facility PRBS test pattern generation", + "title": "Facility PRBS generation", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "facPRBSGenEnabled" + }, + "x-trafficAffecting": true + }, + "xr.carrier.dsc.diagnostic.facPRBSMonEnabled": { + "default": false, + "description": "Configurable to enable/disable facility PRBS test pattern monitoring", + "title": "Facility PRBS monitoring", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "facPRBSMonEnabled" + }, + "x-trafficAffecting": true + }, + "xr.carrier.dscg.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "maxLength": 64, + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "dscgAid" + } + }, + "xr.carrier.dscg.parentAid": { + "items": { + "$ref": "#/components/schemas/xr.carrier.aid" + }, + "maxItems": 1, + "minItems": 1, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "xr.otu.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "maxLength": 64, + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "otuAid" + } + }, + "xr.otu.parentAid": { + "items": { + "$ref": "#/components/schemas/xr.carrier.dscg.aid" + }, + "maxItems": 1, + "minItems": 1, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "xr.otu.otuType": { + "description": "OTU Type", + "enum": [ + "OTUCni", + "OTUCn", + "OTUCni-M", + "OTU4" + ], + "readOnly": true, + "title": "OTU type", + "type": "string", + "x-enum-varnames": [ + "OTUCni", + "OTUCn", + "OTUCni-M", + "OTU4" + ], + "x-oapi-codegen-extra-tags": { + "bson": "otuType" + } + }, + "xr.otu.rate": { + "description": "Rate of the OTU.", + "enum": [ + 25, + 50, + 100, + 200, + 400 + ], + "readOnly": true, + "title": "Rate", + "type": "integer", + "x-enum-varnames": [ + "25", + "50", + "100", + "200", + "400" + ], + "x-unit": "Gbps", + "x-oapi-codegen-extra-tags": { + "bson": "rate" + } + }, + "xr.otu.operStatus": { + "description": "Operational Status of OTU.", + "enum": [ + "enabled", + "disabled" + ], + "readOnly": true, + "title": "Operational status", + "type": "string", + "x-enum-varnames": [ + "Enabled", + "Disabled" + ], + "x-oapi-codegen-extra-tags": { + "bson": "operStatus" + } + }, + "xr.otu.txTTI": { + "default": "", + "description": "Up to 64 byte string for transmitting as TTI.", + "maxLength": 64, + "title": "Transmit TTI", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "txTTI" + } + }, + "xr.otu.rxTTI": { + "description": "Up to 64 byte string of received TTI.", + "maxLength": 64, + "readOnly": true, + "title": "Received TTI", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "rxTTI" + } + }, + "xr.otu.expectedTTI": { + "default": "", + "description": "Up to 64 byte string of TTI that is expected to be received.", + "maxLength": 64, + "title": "Expected TTI", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "expectedTTI" + } + }, + "xr.otu.diagnostic.facPRBSGen": { + "default": "disabled", + "description": "Enable/Disable facility PRBS test pattern generation", + "enum": [ + "enabled", + "disabled" + ], + "title": "Facility PRBS generation", + "type": "string", + "x-enum-varnames": [ + "Enabled", + "Disabled" + ], + "x-oapi-codegen-extra-tags": { + "bson": "facPRBSGen" + }, + "x-trafficAffecting": true + }, + "xr.otu.diagnostic.facPRBSMon": { + "default": "disabled", + "description": "Enable/Disable facility PRBS test pattern monitoring", + "enum": [ + "enabled", + "disabled" + ], + "title": "Facility PRBS monitoring", + "type": "string", + "x-enum-varnames": [ + "Enabled", + "Disabled" + ], + "x-oapi-codegen-extra-tags": { + "bson": "facPRBSMon" + }, + "x-trafficAffecting": true + }, + "xr.otu.odu.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "maxLength": 64, + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "oduAid" + } + }, + "xr.otu.odu.parentAid": { + "items": { + "$ref": "#/components/schemas/xr.carrier.aid" + }, + "maxItems": 1, + "minItems": 1, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "xr.otu.odu.oduType": { + "description": "ODU type", + "enum": [ + "ODUCni", + "ODUflexi", + "ODUCni-M", + "ODU4i" + ], + "readOnly": true, + "title": "ODU type", + "type": "string", + "x-enum-varnames": [ + "ODUCni", + "ODUflexi", + "ODUCni-M", + "ODU4i" + ], + "x-oapi-codegen-extra-tags": { + "bson": "oduType" + } + }, + "xr.otu.odu.operStatus": { + "description": "Operational Status of ODU.", + "enum": [ + "enabled", + "disabled" + ], + "readOnly": true, + "title": "Operational status", + "type": "string", + "x-enum-varnames": [ + "Enabled", + "Disabled" + ], + "x-oapi-codegen-extra-tags": { + "bson": "operStatus" + } + }, + "xr.ethernet.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "maxLength": 64, + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "clientIfAid" + } + }, + "xr.ethernet.parentAid": { + "items": { + "$ref": "#/components/schemas/xr.device.aid" + }, + "maxItems": 1, + "minItems": 1, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "xr.ethernet.portSpeed": { + "description": "Ethernet port speed in Gbps", + "enum": [ + 100, + 400, + 200, + 50, + 25 + ], + "readOnly": true, + "title": "Port speed", + "type": "integer", + "x-enum-varnames": [ + "100", + "400", + "200", + "50", + "25" + ], + "x-unit": "Gbps", + "x-oapi-codegen-extra-tags": { + "bson": "clientIfPortSpeed" + } + }, + "xr.ethernet.fecType": { + "description": "Automatically set by the module based on SerDes and Port configuration.", + "enum": [ + "KR4", + "KP4" + ], + "readOnly": true, + "title": "Fec type", + "type": "string", + "x-enum-varnames": [ + "KR4", + "KP4" + ], + "x-oapi-codegen-extra-tags": { + "bson": "fecType" + } + }, + "xr.ethernet.fecMode": { + "default": "enabled", + "description": "Forward error correction mode of operation", + "enum": [ + "enabled", + "disabled" + ], + "title": "Forward error correction mode", + "type": "string", + "x-enum-varnames": [ + "Enabled", + "Disabled" + ], + "x-oapi-codegen-extra-tags": { + "bson": "fecMode" + }, + "x-trafficAffecting": true + }, + "xr.ethernet.diagnostic.loopbackType": { + "default": "loopbackAndContinue", + "description": "Loopback type.\n- 'loopbackAndContinue': Signal is looped back and is also forwarded downstream.\n- 'loopback': Signal is looped back and LF maintenance signal is sent downstream.\n", + "enum": [ + "loopbackAndContinue", + "loopback" + ], + "title": "Loopback type", + "type": "string", + "x-enum-varnames": [ + "Loopback and continue", + "Loopback" + ], + "x-oapi-codegen-extra-tags": { + "bson": "loopbackType" + } + }, + "xr.ethernet.diagnostic.loopbackMode": { + "default": "disabled", + "description": "Post-FEC Loopback mode for the ethernet client.", + "enum": [ + "disabled", + "facility", + "terminal" + ], + "title": "Loopback mode", + "type": "string", + "x-enum-varnames": [ + "Disabled", + "Facility", + "Terminal" + ], + "x-oapi-codegen-extra-tags": { + "bson": "loopbackMode" + }, + "x-trafficAffecting": true + }, + "xr.ethernet.lldpconfig.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "maxLength": 64, + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "lldpconfigAid" + } + }, + "xr.ethernet.lldpconfig.parentAid": { + "items": { + "$ref": "#/components/schemas/xr.ethernet.aid" + }, + "maxItems": 1, + "minItems": 1, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "xr.ethernet.lldpconfig.adminStatus": { + "default": "disabled", + "description": "Administrative state to Enable/Disable LLDP in rxOnly mode.", + "enum": [ + "rxOnly", + "disabled" + ], + "title": "Administrative State", + "type": "string", + "x-enum-varnames": [ + "RX only", + "Disabled" + ], + "x-oapi-codegen-extra-tags": { + "bson": "adminStatus" + } + }, + "xr.ethernet.lldpconfig.gccFwd": { + "default": false, + "description": "Enable/Disable forwarding of untagged LLDP frames over GCC.\n * `true` - Enabled.\n * `false` - Disabled.\n", + "title": "Forward GCC", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "gccFwd" + } + }, + "xr.ethernet.lldpconfig.hostRxDrop": { + "default": false, + "description": "Enable/Disable LLDP drop in Rx direction of Ethernet Client ports.\n * `true`: - Enabled.\n * `false`: - Disabled.\n", + "title": "LLDP drop", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "hostRxDrop" + } + }, + "xr.ethernet.lldpconfig.TTLUsage": { + "default": true, + "description": "Enable/Disable usage of TTL values for flushing/starting LLDP internal flush timer.\n * `true`: - Enabled.\n * `false`: - Disabled.\n", + "title": "TTL usage", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "TTLUsage" + } + }, + "xr.ethernet.lldpconfig.tooManyNeighbors": { + "description": "Indication that this LLDP Agent has too many discovered neighbors.", + "readOnly": true, + "title": "Too many neighbors", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "tooManyNeighbors" + } + }, + "xr.ethernet.lldpconfig.clrStats": { + "default": false, + "description": "Action to clear LLDP statistics.\nSet to true to trigger the action.\nServer resets it to false when action is completed.\n", + "title": "Clear LLDP statistics", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "clrStats" + } + }, + "xr.ethernet.lldpconfig.flushHostDb": { + "default": false, + "description": "Action to flush the learned host system information.\nSet to true to trigger the action.\nServer resets it to false when action is completed.\n", + "title": "Flush neighbor information", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "flushHostDb" + } + }, + "xr.ethernet.hostneighbors.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "maxLength": 64, + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "hostneighborAid" + } + }, + "xr.ethernet.hostneighbors.parentAid": { + "items": { + "$ref": "#/components/schemas/xr.ethernet.aid" + }, + "maxItems": 1, + "minItems": 1, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "xr.ethernet.neighbor.localPortSourceMAC": { + "description": "Neighbor MAC addres", + "readOnly": true, + "title": "MAC address", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "portSourceMAC" + } + }, + "xr.ethernet.neighbor.chassisIdSubtype": { + "default": "macAddress", + "description": "Encoding of chassisId within LLDP data.", + "enum": [ + "reserved", + "chassisComponent", + "interfaceAlias", + "portComponent", + "macAddress", + "networkAddress", + "interfaceName", + "local" + ], + "readOnly": true, + "title": "LLDP Chassis ID encoding", + "type": "string", + "x-enum-varnames": [ + "Reserved", + "Chassis component", + "Interface alias", + "Port component", + "MAC address", + "Network address", + "Interface name", + "Locally assigned" + ], + "x-oapi-codegen-extra-tags": { + "bson": "chassisIdSubtype" + } + }, + "xr.ethernet.neighbor.chassisId": { + "description": "Host chassis ID within LLDP data.", + "readOnly": true, + "title": "LLDP Chassis ID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "chassisId" + } + }, + "xr.ethernet.neighbor.portIdSubtype": { + "default": "macAddress", + "description": "Encoding of portId within LLDP data.", + "enum": [ + "interfaceAlias", + "portComponent", + "macAddress", + "networkAddress", + "interfaceName", + "agentCircuitId", + "local" + ], + "readOnly": true, + "title": "LLDP Port ID encoding", + "type": "string", + "x-enum-varnames": [ + "Interface alias", + "Port component", + "MAC address", + "Network address", + "Interface name", + "Agent circuit ID", + "Locally assigned" + ], + "x-oapi-codegen-extra-tags": { + "bson": "portIdSubtype" + } + }, + "xr.ethernet.neighbor.portId": { + "description": "Host port ID within LLDP data.", + "readOnly": true, + "title": "LLDP Port ID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "portId" + } + }, + "xr.ethernet.neighbor.portDescr": { + "description": "Port Description of Neighbor within LLDP data.", + "readOnly": true, + "title": "LLDP Port description", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "portDescr" + } + }, + "xr.ethernet.neighbor.sysName": { + "description": "Host System Name within LLDP data.", + "readOnly": true, + "title": "LLDP System Name", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "sysName" + } + }, + "xr.ethernet.neighbor.sysDescr": { + "description": "Host System description within LLDP data.", + "readOnly": true, + "title": "LLDP System Description", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "sysDescr" + } + }, + "xr.ethernet.neighbor.sysTTL": { + "description": "LLDP TTL (time to live) of Neighbor, in seconds", + "readOnly": true, + "title": "Neighbor LLDP TTL", + "type": "integer", + "x-unit": "s", + "x-oapi-codegen-extra-tags": { + "bson": "sysTTL" + } + }, + "xr.ethernet.neighbor.lldpPDU": { + "description": "Complete LLDP PDU received from this Neighbor, to enable external analysis and extraction of additional TLVs.", + "readOnly": true, + "title": "LLDP PDU", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "lldpPDU" + } + }, + "xr.ethernet.ac.aid": { + "description": "Attachment Circuit Access Identifier (AID) - unique instance within a xr.ethernet resource type.", + "maxLength": 64, + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "attachmentCircuitAid" + } + }, + "xr.ethernet.ac.parentAid": { + "items": { + "$ref": "#/components/schemas/xr.ethernet.aid" + }, + "maxItems": 1, + "minItems": 1, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "xr.ethernet.ac.capacity": { + "description": "Capacity of the attachment circuit expressed in multiples of 25Gbps.", + "maximum": 16, + "minimum": 1, + "title": "Rate", + "type": "integer", + "x-unit": "Gbps", + "x-oapi-codegen-extra-tags": { + "bson": "capacity" + } + }, + "xr.ethernet.ac.imc": { + "description": "Ingress match criteria of the AC for traffic coming from the host", + "enum": [ + "matchAll", + "matchOuterVID", + "none" + ], + "title": "Ingress Match Criteria", + "type": "string", + "x-enum-varnames": [ + "Match all", + "Match outer VLAN Id", + "None" + ], + "x-oapi-codegen-extra-tags": { + "bson": "imc" + } + }, + "xr.ethernet.ac.imcOuterVID": { + "description": "String format listing of one or more individual VLAN IDs separated by \"&\" and/or ranges of VLAN IDs connected with \"&&\". For example \"10 & 20 & 50 && 100\" to represent the 52 VLAN IDs 10, 20 and 50-100.", + "pattern": "((409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])\\&\\& (409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9]))* | ((409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])\\&)* | (409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])", + "title": "Ingress Match Criteria VLAN IDs", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "imcOuterVID" + } + }, + "xr.ethernet.ac.emc": { + "description": "Egress match criteria of the AC for traffic going out to the host", + "enum": [ + "matchAll", + "matchOuterVID", + "none" + ], + "title": "Egress Match Criteria", + "type": "string", + "x-enum-varnames": [ + "Match all", + "Match outer VLAN Id", + "None" + ], + "x-oapi-codegen-extra-tags": { + "bson": "emc" + } + }, + "xr.ethernet.ac.emcOuterVID": { + "description": "String format listing of one or more individual VLAN IDs separated by \"&\" and/or ranges of VLAN IDs connected with \"&&\". For example \"10 & 20 & 50 && 100\" to represent the 52 VLAN IDs 10, 20 and 50-100.", + "pattern": "((409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])\\&\\& (409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9]))* | ((409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])\\&)* | (409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])", + "title": "Egress Match Criteria VLAN IDs", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "emcOuterVID" + } + }, + "xr.lc.aid": { + "description": "Access Identifier (AID) of a local connection", + "maxLength": 64, + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "lcAid" + } + }, + "xr.lc.parentAid": { + "items": { + "$ref": "#/components/schemas/xr.common.aid" + }, + "maxItems": 2, + "minItems": 2, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "xr.common.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "maxLength": 64, + "readOnly": true, + "title": "Access identifier", + "type": "string" + }, + "xr.lc.direction": { + "default": "txRx", + "description": "Directionality of the local connection. \nPossible values:\n- 'txRx': Both Transmit (Client to Line) and Receive (Line to Client) direction \n- 'tx': Client to Line direction only. \n- 'rx': Line to Client direction only.\n", + "enum": [ + "txRx", + "tx", + "rx" + ], + "title": "Directionality of the LC.", + "type": "string", + "x-enum-varnames": [ + "Tx and RX", + "TX only", + "RX only" + ], + "x-oapi-codegen-extra-tags": { + "bson": "direction" + } + }, + "xr.lc.clientAid": { + "description": "Points to the AID of the connected client side resource of the LC. \nThis could be an ethernet resource or a specific attachment circuit on an ethernet resource.\n", + "title": "Client side AID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "clientAid" + } + }, + "xr.lc.dscgAid": { + "description": "Points to the AID of the DSCG which is used at the optical layer at the line side. This is entered as part of LC creation.", + "title": "DSCG AID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "dscgAid" + } + }, + "xr.lc.lineAid": { + "description": "Points to the AID of the connected LO-ODU resource at the line side of the LC.", + "readOnly": true, + "title": "Line side AID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "lineAid" + } + }, + "xr.lc.remoteModuleId": { + "description": "Remote service endpoint module ID. Set by Host device as part of service creation.", + "readOnly": true, + "title": "Remote module ID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "remoteModuleId" + } + }, + "xr.lc.remoteClientId": { + "description": "Remote service endpoint client resource AID. Set by Host device as part of service creation.", + "readOnly": true, + "title": "Remote module Client AID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "remoteClientId" + } + }, + "cm.device": { + "description": "Device data definition for onboarding tool", + "example": { + "href": "/devices/02dbd2b0-3baf-43f0-51c8-5da9498709e4", + "rt": [ + "cm.device" + ], + "id": "02dbd2b0-3baf-43f0-51c8-5da9498709e4", + "config": { + "status": "onboarded" + }, + "state": { + "moduleName": "XR LEAF 1", + "piid": "abb81108-8bbf-4222-9bf3-0a6bbb75ac65", + "dmn": { + "language": "en", + "value": "Infinera" + }, + "ownershipStatus": "owned", + "status": "onboarded", + "online": true + } + }, + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "config": { + "$ref": "#/components/schemas/cm.device.config" + }, + "state": { + "$ref": "#/components/schemas/cm.device.state" + } + }, + "type": "object" + }, + "cm.device.config": { + "additionalProperties": false, + "description": "Configurable device parameters", + "properties": { + "status": { + "$ref": "#/components/schemas/cm.device.config.parameters.status" + } + }, + "type": "object" + }, + "cm.device.state": { + "description": "Definition of device state parameters", + "properties": { + "moduleName": { + "$ref": "#/components/schemas/xr.device.n" + }, + "piid": { + "$ref": "#/components/schemas/xr.device.piid" + }, + "dmn": { + "$ref": "#/components/schemas/xr.device.dmn" + }, + "ownership": { + "$ref": "#/components/schemas/cm.device.parameters.ownershipStatus" + }, + "status": { + "$ref": "#/components/schemas/cm.device.state.parameters.status" + }, + "online": { + "$ref": "#/components/schemas/cm.device.parameters.online" + } + }, + "type": "object" + }, + "cm.device.parameters.ownershipStatus": { + "description": "Device ownership status\nPossible values:\n- 'readytobeowned': The device is discovered and ready to be owned\n- 'owned': Device is owned by this onboard tool user\n- 'ownedbyother': Device is owned by another user\n- 'unknown': Device is unsecure or status cannot be obtained\n", + "enum": [ + "readytobeowned", + "owned", + "ownedbyother", + "unknown" + ], + "readOnly": true, + "title": "Status", + "type": "string", + "x-enum-varnames": [ + "Ready to be owned", + "Owned", + "Owned by other", + "Unknown" + ] + }, + "cm.device.parameters.online": { + "description": "Indicates if device is currently reachable", + "readOnly": true, + "title": "Online", + "type": "boolean" + }, + "cm.device.config.parameters.status": { + "description": "Device onboard status configuration", + "enum": [ + "onboarded", + "offboarded" + ], + "title": "Status", + "type": "string", + "x-enum-varnames": [ + "Onboarded", + "Offboarded" + ] + }, + "cm.device.state.parameters.status": { + "description": "Device onboard status state", + "enum": [ + "discovered", + "onboardPending", + "onboarded", + "onboardFailed", + "offboardPending", + "offboardFailed", + "offboarded" + ], + "readOnly": true, + "title": "Status", + "type": "string", + "x-enum-varnames": [ + "Discovered", + "Onboard pending", + "Onboarded", + "Onboard failed", + "Offboard pending", + "Offboard failed", + "Offboarded" + ] + }, + "cm.device.updateRequest": { + "additionalProperties": false, + "description": "Object used in the request body of PUT requests in /devices endpoint.\nContains the device identifier and its onboard status.\n", + "properties": { + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "config": { + "$ref": "#/components/schemas/cm.device.update" + } + }, + "required": [ + "config", + "id" + ], + "type": "object" + }, + "cm.device.update": { + "additionalProperties": false, + "description": "Configurable device parameters", + "minProperties": 1, + "properties": { + "status": { + "$ref": "#/components/schemas/cm.device.config.parameters.status" + } + }, + "type": "object" + }, + "cm.sw.action": { + "description": "Definition of CM software action requests", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "config": { + "$ref": "#/components/schemas/cm.sw.action.config" + }, + "state": { + "$ref": "#/components/schemas/cm.sw.action.state" + }, + "moduleActions": { + "$ref": "#/components/schemas/cm.sw.moduleActions" + } + } + }, + "cm.sw.action.config": { + "additionalProperties": false, + "description": "Definition of software action configuration parameters", + "properties": { + "name": { + "$ref": "#/components/schemas/cm.parameters.name" + }, + "selectors": { + "$ref": "#/components/schemas/cm.sw.action.config.selectors" + }, + "operations": { + "$ref": "#/components/schemas/cm.sw.action.config.operations" + } + }, + "type": "object" + }, + "cm.sw.action.config.selectors": { + "description": "List of software action target modules.\nModules can be specified individually (via module ID), per constellation, per NDU or per host.\n", + "items": { + "$ref": "#/components/schemas/cm.sw.action.config.selector" + }, + "minItems": 1, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "selectors" + } + }, + "cm.sw.action.config.selector": { + "maxProperties": 1, + "minProperties": 1, + "properties": { + "moduleIds": { + "$ref": "#/components/schemas/cm.sw.action.config.selector.moduleIds" + }, + "nduIds": { + "$ref": "#/components/schemas/cm.sw.action.config.selector.nduIds" + } + }, + "type": "object" + }, + "cm.sw.action.config.selector.moduleIds": { + "items": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "minItems": 1, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "moduleIds" + } + }, + "cm.sw.action.config.selector.nduIds": { + "items": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "minItems": 1, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "nduIds" + } + }, + "cm.sw.action.config.operations": { + "description": "List of software actions to be executed on target modules.\nPossible values:\n- 'clearBank' \n- 'validateUrl'\n- 'download'\n- 'prepareUpgrade'\n- 'commit'\n- 'abort' \nIf multiple modules are target, action is executed in parallel for different modules.\nIf multiple operations are defined, they are executed per module with the following priority:\n- 1: 'abort'\n- 2: 'activate' with 'rollback' option\n- 3: 'clearBank'\n- 4: 'validateUrl'\n- 5: 'download'\n- 6: 'prepareUpgrade'\n- 8: 'activate' with 'apply' option\nIf an operation fails , remaining module operations are aborted.\nIf an 'abort' operation is executed, remaining operations for that module are aborted.\nIf an 'activate' with 'rollback' option is executed, remaining operations for that module are aborted.\n", + "items": { + "$ref": "#/components/schemas/cm.sw.action.config.operation" + }, + "minItems": 1, + "title": "Actions", + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "operations" + } + }, + "cm.sw.action.config.operation": { + "additionalProperties": false, + "maxProperties": 1, + "minProperties": 1, + "properties": { + "clearBank": { + "$ref": "#/components/schemas/cm.sw.action.config.operation.clearBank" + }, + "validateUrl": { + "$ref": "#/components/schemas/cm.sw.action.config.operation.validateUrl" + }, + "download": { + "$ref": "#/components/schemas/cm.sw.action.config.operation.download" + }, + "prepareUpgrade": { + "$ref": "#/components/schemas/cm.sw.action.config.operation.prepareUpgrade" + }, + "activate": { + "$ref": "#/components/schemas/cm.sw.action.config.operation.activate" + }, + "abort": { + "$ref": "#/components/schemas/cm.sw.action.config.operation.abort" + } + }, + "type": "object" + }, + "cm.sw.action.config.operation.clearBank": { + "description": "Operation to delete the software image and associated configuration from the inactive bank.", + "enum": [ + true + ], + "title": "clear", + "type": "boolean", + "x-enum-varnames": [ + "True" + ], + "x-oapi-codegen-extra-tags": { + "bson": "clearBank" + } + }, + "cm.sw.action.config.operation.validateUrl": { + "additionalProperties": false, + "description": "Operation to validate that the software image file is available at specified location.", + "minProperties": 1, + "properties": { + "swURL": { + "$ref": "#/components/schemas/cm.sw.action.parameters.swURL" + } + }, + "title": "validate", + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "validateUrl" + } + }, + "cm.sw.action.config.operation.download": { + "additionalProperties": false, + "description": "Operation to executes the download of the software image to the upgrade bank.", + "minProperties": 1, + "properties": { + "swURL": { + "$ref": "#/components/schemas/cm.sw.action.parameters.swURL" + } + }, + "title": "download", + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "download" + } + }, + "cm.sw.action.config.operation.prepareUpgrade": { + "description": "Operation to classify the upgrade impact (i.e., the impact of executing the software in the upgrade bank).\nResult is available on upgradeClassification property of the respective module swCtrl object.\n", + "enum": [ + true + ], + "title": "clear", + "type": "boolean", + "x-enum-varnames": [ + "True" + ], + "x-oapi-codegen-extra-tags": { + "bson": "prepareUpgrade" + } + }, + "cm.sw.action.config.operation.activate": { + "additionalProperties": false, + "description": "Operation to execute software image and commit it upon successful module restart.\nIf executed with 'apply' option, execution is done over the upgrade bank image\n(note that after commit, the former upgrade bank becomes active bank and the former active bank becomes previous bank).\nIf executed with 'rollback' option, execution is done over the previous active bank image\n(note that no commit is executed after module restart)\n", + "minProperties": 1, + "properties": { + "option": { + "$ref": "#/components/schemas/cm.sw.action.parameters.activateOptions" + } + }, + "title": "clear", + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "activate" + } + }, + "cm.sw.action.config.operation.abort": { + "description": "Operation to abort module current action (if any) and clear pending operations.", + "enum": [ + true + ], + "title": "Abort", + "type": "boolean", + "x-enum-varnames": [ + "True" + ], + "x-oapi-codegen-extra-tags": { + "bson": "abort" + } + }, + "cm.sw.action.state": { + "description": "Definition of module state object", + "properties": { + "lifecycleState": { + "$ref": "#/components/schemas/cm.sw.action.state.parameters.lifecycleState" + } + } + }, + "cm.sw.action.parameters.swURL": { + "description": "Source of software package for download to upgrade bank.", + "format": "uri", + "maxLength": 255, + "title": "Software URL", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "swURL" + } + }, + "cm.sw.action.parameters.activateOptions": { + "description": "Activate operation options.\nPossible values:\n- 'apply': Activation is done over the upgrade bank image and is committed upon successful module restart.\n- 'rollback': Activation is done over the previous active bank image and no commit is issue upon module restart.\n", + "enum": [ + "apply", + "rollback" + ], + "title": "Activate option", + "type": "string", + "x-enum-varnames": [ + "Apply", + "Rollback" + ], + "x-oapi-codegen-extra-tags": { + "bson": "option" + } + }, + "cm.sw.action.state.parameters.lifecycleState": { + "description": "Provides the aggregated status of a software module action.\nPossible values:\n- 'pending': This state occurs when all module operations related to this request are not yet created or in pending state.\n- 'executing': This state occurs when all module operations related to this request are currently under execution.\n- 'partiallyExecuted': This state may occur when at least one module operation related to this request is in executed state.\n- 'executed': This state occurs when all module operations related to this request are in executed state.\n- 'partiallyFailed': This state may occur when at least one module operation related to this request is in failed state.\n- 'failed': This state occurs when all module operations related to this request are in failed state.\n- 'deleted': This state occurs when an action is removed.\n", + "enum": [ + "pending", + "executing", + "partiallyExecuted", + "executed", + "partiallyFailed", + "failed", + "deleted" + ], + "readOnly": true, + "title": "Lifecycle State", + "type": "string", + "x-enum-varnames": [ + "Pending", + "Executing", + "Partially executed", + "Executed", + "Partially failed", + "Failed", + "Deleted" + ] + }, + "cm.sw.action.create": { + "additionalProperties": false, + "description": "Software action creation parameters", + "properties": { + "name": { + "$ref": "#/components/schemas/cm.parameters.name" + }, + "selectors": { + "$ref": "#/components/schemas/cm.sw.action.config.selectors" + }, + "operations": { + "$ref": "#/components/schemas/cm.sw.action.config.operations" + } + }, + "required": [ + "operations", + "selectors" + ], + "type": "object" + }, + "cm.sw.moduleAction": { + "description": "Definition of CM operations resulting from a software action request", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "state": { + "$ref": "#/components/schemas/cm.sw.moduleAction.state" + } + }, + "title": "Operations" + }, + "cm.sw.moduleActions": { + "items": { + "$ref": "#/components/schemas/cm.sw.moduleAction" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "moduleActions" + } + }, + "cm.sw.moduleAction.state": { + "description": "Definition of moduleAction state object", + "properties": { + "moduleId": { + "$ref": "#/components/schemas/xr.device.di" + }, + "action": { + "$ref": "#/components/schemas/cm.sw.moduleAction.action" + }, + "actionDate": { + "$ref": "#/components/schemas/cm.sw.moduleAction.parameters.actionDate" + }, + "actionSource": { + "$ref": "#/components/schemas/cm.sw.moduleAction.parameters.actionSource" + }, + "moduleSwmStatus": { + "$ref": "#/components/schemas/cm.sw.moduleAction.parameters.moduleSwmStatus" + }, + "actionResult": { + "$ref": "#/components/schemas/cm.sw.moduleAction.state.actionResult" + }, + "lifecycleState": { + "$ref": "#/components/schemas/cm.sw.moduleAction.parameters.lifecycleState" + } + } + }, + "cm.sw.moduleAction.action": { + "description": "Definition of module software operations", + "maxProperties": 1, + "minProperties": 1, + "properties": { + "wipeoutBank": { + "$ref": "#/components/schemas/cm.sw.moduleAction.action.wipeoutBank" + }, + "validateSwUrl": { + "$ref": "#/components/schemas/cm.sw.moduleAction.action.validateSwUrl" + }, + "download": { + "$ref": "#/components/schemas/cm.sw.moduleAction.action.download" + }, + "classifyUpgradeImpact": { + "$ref": "#/components/schemas/cm.sw.moduleAction.action.classifyUpgradeImpact" + }, + "execute": { + "$ref": "#/components/schemas/cm.sw.moduleAction.action.execute" + }, + "commit": { + "$ref": "#/components/schemas/cm.sw.moduleAction.action.commit" + }, + "abort": { + "$ref": "#/components/schemas/cm.sw.moduleAction.action.abort" + }, + "rollback": { + "$ref": "#/components/schemas/cm.sw.moduleAction.action.rollback" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "action" + } + }, + "cm.sw.moduleAction.action.wipeoutBank": { + "additionalProperties": false, + "description": "Action to delete the SW and associated configuration in this Bank. Set to true to trigger the action..\nUpon completion, the module cm.sw.moduleAction.actionResult 'result' parameter is updated.\n", + "enum": [ + true + ], + "type": "object", + "x-enum-varnames": [ + "True" + ], + "x-oapi-codegen-extra-tags": { + "bson": "wipeoutBank" + } + }, + "cm.sw.moduleAction.action.validateSwUrl": { + "additionalProperties": false, + "description": "Action to validate software image location.\nUpon completion, the module cm.swCtrl.state.actionResult 'moduleClassification' and 'result' parameters is updated.\n", + "properties": { + "source": { + "$ref": "#/components/schemas/cm.sw.moduleAction.parameters.source" + } + }, + "required": [ + "source" + ], + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "validateSwUrl" + } + }, + "cm.sw.moduleAction.action.download": { + "additionalProperties": false, + "description": "Action to download software image to upgrade bank.\nUpon execution, the module cm.swCtrl.config.swURL parameter is updated to the source URL and an URL validation is executed. \nDuring execution, the module cm.swCtrl.state.status parameter is updated to [1] 'Downloading'.\nDuring execution, the module cm.swCtrl.state.downloadProgress parameter is updated to reflect the download process.\nUpon completion, the module cm.sw.moduleAction.actionResult 'moduleClassification' and 'result' parameters are updated.\n", + "properties": { + "source": { + "$ref": "#/components/schemas/cm.sw.moduleAction.parameters.source" + } + }, + "required": [ + "source" + ], + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "download" + } + }, + "cm.sw.moduleAction.action.classifyUpgradeImpact": { + "additionalProperties": false, + "description": "Action to validate the software image in upgrade bank.\nUpon completion, the module cm.sw.moduleAction.actionResult 'upgradeClassification' and 'result' parameters are updated.\n", + "enum": [ + true + ], + "type": "object", + "x-enum-varnames": [ + "True" + ], + "x-oapi-codegen-extra-tags": { + "bson": "classifyUpgradeImpact" + } + }, + "cm.sw.moduleAction.action.execute": { + "additionalProperties": false, + "description": "Action to execute software in upgradeBank.\nUpon completion, the module cm.sw.moduleAction.actionResult 'result' parameter is updated.\n", + "enum": [ + true + ], + "type": "object", + "x-enum-varnames": [ + "True" + ], + "x-oapi-codegen-extra-tags": { + "bson": "executeSwImage" + } + }, + "cm.sw.moduleAction.action.commit": { + "additionalProperties": false, + "description": "Action to commit software in upgradeBank. \nAfter restart, previous active bank becomes inactive and previous bank, the upgrade bank becomes active bank.\nUpon completion, the module cm.sw.moduleAction.actionResult 'result' parameter is updated.\n", + "enum": [ + true + ], + "type": "object", + "x-enum-varnames": [ + "True" + ], + "x-oapi-codegen-extra-tags": { + "bson": "commitSwImage" + } + }, + "cm.sw.moduleAction.action.abort": { + "additionalProperties": false, + "description": "Action to abort current upgrade process. \nUpon completion, the module cm.sw.moduleAction.actionResult 'result' parameter is updated.\n", + "enum": [ + true + ], + "type": "object", + "x-enum-varnames": [ + "True" + ], + "x-oapi-codegen-extra-tags": { + "bson": "abortSwUpgrade" + } + }, + "cm.sw.moduleAction.action.rollback": { + "additionalProperties": false, + "description": "Action to fall back to previous running bank. \nUpon completion, the module cm.sw.moduleAction.actionResult 'result' parameter is updated.\n", + "enum": [ + true + ], + "type": "object", + "x-enum-varnames": [ + "True" + ], + "x-oapi-codegen-extra-tags": { + "bson": "rollback" + } + }, + "cm.sw.moduleAction.state.actionResult": { + "description": "Action' result as reported by module.\n'downloadProgress' property is only applicable to 'download' action\n'upgradeClassification' property is only applicable to 'classifyUpgradeImpact' action\n", + "properties": { + "downloadProgress": { + "$ref": "#/components/schemas/cm.sw.moduleAction.actionResult.parameters.downloadProgress" + }, + "moduleClassification": { + "$ref": "#/components/schemas/cm.sw.moduleAction.actionResult.parameters.moduleClassification" + }, + "upgradeClassification": { + "$ref": "#/components/schemas/cm.sw.moduleAction.actionResult.parameters.upgradeClassification" + }, + "result": { + "$ref": "#/components/schemas/cm.sw.moduleAction.actionResult.parameters.result" + } + }, + "readOnly": true, + "title": "Action result", + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "actionResult" + } + }, + "cm.sw.moduleAction.parameters.source": { + "description": "Software image URL", + "title": "Source", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "source" + } + }, + "cm.sw.moduleAction.parameters.actionDate": { + "description": "Timestamp in date-time format pattern according to IETF RFC 3339.", + "format": "date-time", + "readOnly": true, + "title": "Action Date", + "type": "string" + }, + "cm.sw.moduleAction.parameters.actionSource": { + "description": "Defines the source of the module action request.\nPossible values:\n- '0': NA\n- '1': CM\n- '2': Host\n", + "enum": [ + 0, + 1, + 2 + ], + "readOnly": true, + "title": "Action Source", + "type": "integer", + "x-enum-varnames": [ + "Not applicable", + "IPM", + "Host" + ] + }, + "cm.sw.moduleAction.parameters.moduleSwmStatus": { + "description": "State of ongoing download or upgrade procedure. \nWhen no upgrade procedure is in progress the status is Idle.\nPossible values:\n- '0': Idle\n- '1': Downloading\n- '2': Executing\n- '3': Restarting\n- '4': runningNotCommitted\n- '5': Committing\n- '6': Reverting\n- '7': Falling Back\n", + "readOnly": true, + "title": "Status", + "type": "integer" + }, + "cm.sw.moduleAction.actionResult.parameters.downloadProgress": { + "description": "Percentage of SW package download, 0-100, when download is in progress.\n", + "readOnly": true, + "title": "Download progress", + "type": "integer" + }, + "cm.sw.moduleAction.actionResult.parameters.moduleClassification": { + "description": "Classification of the module so a client can identify which XR Deliverable Packages are suitable for it.", + "maxLength": 40, + "readOnly": true, + "title": "Module classification", + "type": "string" + }, + "cm.sw.moduleAction.actionResult.parameters.upgradeClassification": { + "description": "Classification of upgrade impact of executing the software in upgradeBank. \nResult of swm Action to classify upgrade impact.\nPossible values:\n- '0': Upgrade not classified yet\n- '1': Upgrade classification failed\n- '2': Configuration cannot be migrated\n- '3': Service affecting upgrade\n- '4': Non-service affecting upgrade\n", + "readOnly": true, + "title": "Upgrade classification", + "type": "integer" + }, + "cm.sw.moduleAction.actionResult.parameters.result": { + "description": "Result of the last completed swm Action.\nEither successfully or reason for failure.\nResult is Unknown during the execution of an action.\nPossible value:\n- '0': Unknown\n- '1': Success\n- '2': Fail -Invalid or unreachable software URL\n- '3': Fail -Not Enough RAM\n- '4': Fail -Not Enough Flash\n- '5': Fail -Connection Lost\n- '6': Fail -SW validation failure\n- '7': Wrong SW For Module\n- '8': Validating\n- '9': Downloading\n- '10': Upgrade Classificating\n- '21': Activate Fail - Connection Lost\n- '22': Activate Fail - SW execute failure\n- '23': Activate Fail - Commit failure\n- '24': Executing software in upgradeBank\n- '25': Committing software in upgradeBank\n- '25': Falling back - Execute software in previous Bank\n- '30': Aborting\n", + "readOnly": true, + "title": "Action Result", + "type": "integer" + }, + "cm.sw.moduleAction.parameters.lifecycleState": { + "description": "Provides the status of a software module action.\nPossible values:\n- 'pending': This state occurs when the module configuration was not yet sent to the module.\n- 'executing': This state occurs when the module configuration was sent to the module and is currently under execution.\n- 'executed': This state occurs when the module configuration was already executed and reported finished.\n- 'failed': This state occurs when the module configuration was rejected by the module.\n- 'deleted': This state occurs when a moduleAction is removed.\n", + "enum": [ + "pending", + "executing", + "executed", + "failed", + "deleted" + ], + "readOnly": true, + "title": "Lifecycle State", + "type": "string", + "x-enum-varnames": [ + "Pending", + "Executing", + "Executed", + "Failed", + "Deleted" + ] + }, + "cm.sw.ctrl": { + "description": "Definition of CM module/ndu software control object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "state": { + "$ref": "#/components/schemas/cm.sw.ctrl.state" + }, + "swBanks": { + "$ref": "#/components/schemas/cm.sw.banks" + } + } + }, + "cm.sw.ctrl.state": { + "description": "Definition of module/ndu software bank state parameters", + "properties": { + "deviceType": { + "$ref": "#/components/schemas/cm.parameters.deviceType" + }, + "deviceId": { + "$ref": "#/components/schemas/cm.parameters.deviceId" + }, + "deviceName": { + "$ref": "#/components/schemas/xr.device.n" + }, + "deviceLabels": { + "$ref": "#/components/schemas/cm.parameters.labels" + }, + "activeBank": { + "$ref": "#/components/schemas/xr.swmctrl.activeBank" + }, + "committedBank": { + "$ref": "#/components/schemas/xr.swmctrl.committedBank" + }, + "previousActiveBank": { + "$ref": "#/components/schemas/xr.swmctrl.previousActiveBank" + }, + "status": { + "$ref": "#/components/schemas/xr.swmctrl.swmStatus" + }, + "latestAction": { + "$ref": "#/components/schemas/cm.sw.ctrl.state.latestAction" + }, + "latestStatusChangedTime": { + "$ref": "#/components/schemas/xr.swmctrl.latestStatusChangedTime" + } + } + }, + "cm.sw.ctrl.state.latestAction": { + "description": "Module latest action parameters", + "properties": { + "timestamp": { + "$ref": "#/components/schemas/xr.swmctrl.recentSWMActionDateTime" + }, + "action": { + "$ref": "#/components/schemas/xr.swmctrl.recentSWMAction" + }, + "source": { + "$ref": "#/components/schemas/xr.swmctrl.recentSWMActionSource" + }, + "bank": { + "$ref": "#/components/schemas/xr.swmctrl.recentSWMActionUpgradeBank" + }, + "swUrl": { + "$ref": "#/components/schemas/xr.swmctrl.recentSWMActionSWURL" + }, + "revertTimeout": { + "$ref": "#/components/schemas/xr.swmctrl.recentSWMActionRevertTimeout" + }, + "downloadProgress": { + "$ref": "#/components/schemas/xr.swmctrl.recentDownloadProgress" + }, + "upgradeClassification": { + "$ref": "#/components/schemas/xr.swmctrl.recentUpgradeClassification" + }, + "result": { + "$ref": "#/components/schemas/xr.swmctrl.recentSWMActionResult" + } + } + }, + "cm.sw.bank": { + "description": "Definition of xr-network object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/xr.common.colId" + }, + "state": { + "$ref": "#/components/schemas/cm.sw.bank.state" + } + } + }, + "cm.sw.banks": { + "items": { + "$ref": "#/components/schemas/cm.sw.bank" + }, + "maxItems": 2, + "minItems": 2, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "swBanks" + } + }, + "cm.sw.bank.state": { + "description": "Definition of module software bank state parameters", + "properties": { + "version": { + "$ref": "#/components/schemas/xr.swmbank.version" + }, + "bankStatus": { + "$ref": "#/components/schemas/cm.sw.bank.state.bankStatus" + }, + "imageStatus": { + "$ref": "#/components/schemas/cm.sw.bank.state.imageStatus" + }, + "configCompVersion": { + "$ref": "#/components/schemas/xr.swmbank.configCompVersion" + }, + "configDataSentry": { + "$ref": "#/components/schemas/xr.swmbank.configDataSentry" + }, + "imageActivationHistory": { + "$ref": "#/components/schemas/cm.sw.bank.state.imageActivationHistory" + }, + "imageConfiguration": { + "$ref": "#/components/schemas/cm.sw.bank.state.imageConfiguration" + }, + "action": { + "$ref": "#/components/schemas/xr.swmbank.action" + } + } + }, + "cm.sw.bank.state.bankStatus": { + "description": "Indicates the software bank status\nPossible values:\n- 'empty': Software bank image is empty\n- 'installing': Software image is under installation\n- 'installed': Software image is installed in the bank\n- 'invalid': Signature of the software in this bank is invalid\n", + "enum": [ + "empty", + "installing", + "installed", + "invalid" + ], + "readOnly": true, + "title": "Bank status", + "type": "string", + "x-enum-varnames": [ + "Empty", + "Installing", + "Installed", + "Invalid" + ] + }, + "cm.sw.bank.state.imageStatus": { + "description": "Indicates the software image status in the bank\nPossible values:\n- 'notApplicable': Bank is empty\n- 'inactive': Software image is currently\n- 'running':\n- 'runningNotCommitted'\n", + "enum": [ + "notApplicable", + "inactive", + "running", + "runningNotCommitted" + ], + "readOnly": true, + "title": "Image status", + "type": "string", + "x-enum-varnames": [ + "Not applicable", + "Inactive", + "Running", + "Running not committed" + ] + }, + "cm.sw.bank.state.imageActivationHistory": { + "description": "Indicates the software image status in the bank\nPossible values:\n- 'notApplicable': Software image in the bank was never activated\n- 'failed': Software image latest activation failed\n- 'succeed': Software image latest activation succeed\n", + "enum": [ + "notApplicable", + "failed", + "succeed" + ], + "readOnly": true, + "title": "Image status", + "type": "string", + "x-enum-varnames": [ + "Not applicable", + "Failed", + "Succeed" + ] + }, + "cm.sw.bank.state.imageConfiguration": { + "description": "Indicates the software image status in the bank\nPossible values:\n- 'notApplicable': Software image is invalid or not present.\n- 'none': Software in this bank has no associated config data.\n- 'upgradeNotClassified': Software in this bank has associated config data but upgrade classification was not executed.\n- 'upgradeClassificationFailed': Software upgrade classification failed.\n- 'invalidUpgradeConfiguration': Software configuration cannot be migrated.\n- 'validUpgradeServiceAffecting': Software configuration is valid and upgrade is service affecting.\n- 'validUpgradeNonServiceAffecting': Software configuration is valid and upgrade is non-service affecting.\n- 'validRunning': Software configuration is valid and applied.\n", + "enum": [ + "notApplicable", + "none", + "upgradeNotClassified", + "upgradeClassificationFailed", + "invalidUpgradeConfiguration", + "validUpgradeServiceAffecting", + "validUpgradeNonServiceAffecting", + "validRunning" + ], + "readOnly": true, + "title": "Image status", + "type": "string", + "x-enum-varnames": [ + "Not applicable", + "None", + "Upgrade not classified", + "Upgrade classification failed", + "Invalid upgrade configuration", + "Valid upgrade service affecting", + "Valid upgrade non service affecting", + "Valid running" + ] + }, + "cm.resource": { + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + } + }, + "type": "object" + }, + "cm.parameters.name": { + "description": "User defined object name.\n", + "maxLength": 64, + "pattern": "^([A-Za-z0-9_\\-.,: ]*)$", + "title": "Name", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "name" + } + }, + "xr.device.di": { + "description": "Device identifier.", + "readOnly": true, + "title": "Device identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "moduleId" + } + }, + "cm.parameters.deviceType": { + "description": "Device type\nPossible values:\n- 'ndu'\n- 'moduleHub'\n- 'moduleLeaf'\n- 'moduleUnknown\n", + "enum": [ + "ndu", + "moduleHub", + "moduleLeaf", + "moduleUnknown" + ], + "readOnly": true, + "type": "string", + "x-enum-varnames": [ + "NDU", + "Hub", + "Leaf", + "Unknown" + ], + "x-oapi-codegen-extra-tags": { + "bson": "deviceType" + } + }, + "cm.parameters.deviceId": { + "description": "Object identifier", + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "title": "ID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "deviceId" + } + }, + "xr.swmctrl.activeBank": { + "description": "Bank ID of currently active running SW.", + "readOnly": true, + "title": "Running SW bank", + "type": "integer", + "x-oapi-codegen-extra-tags": { + "bson": "activeBank" + } + }, + "xr.swmctrl.committedBank": { + "description": "Bank ID of currently committed SW. \n0 = NoValue, 1 = A, 2 = B. \nThis will be the Bank to be used at startup.\n", + "readOnly": true, + "title": "Module Classification", + "type": "integer", + "x-oapi-codegen-extra-tags": { + "bson": "committedBank" + } + }, + "xr.swmctrl.previousActiveBank": { + "description": "Bank ID of the previously Active Bank before the currently running SW. 0 is used for N/A.", + "readOnly": true, + "title": "Previous SW bank", + "type": "integer", + "x-oapi-codegen-extra-tags": { + "bson": "previousActiveBank" + } + }, + "xr.swmctrl.swmStatus": { + "description": "State of ongoing download or upgrade procedure.\nWhen no upgrade procedure is in progress the status is Idle.\n- '0': Idle\n- '1': Downloading\n- '2': Executing\n- '3': Restarting\n- '4': runningNotCommitted\n- '5': Committing\n- '6': Reverting\n- '7': Falling Back\n", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + "readOnly": true, + "type": "integer", + "x-enum-varnames": [ + "Idle", + "Downloading", + "Executing", + "Restarting", + "runningNotCommitted", + "Committing", + "Reverting", + "Falling Back" + ], + "x-oapi-codegen-extra-tags": { + "bson": "status" + } + }, + "xr.swmctrl.latestStatusChangedTime": { + "description": "Timestamp of last sw change in date-time format pattern according to IETF RFC 3339.\nEmpty if there is no image in the bank.\n", + "format": "date-time", + "readOnly": true, + "title": "Request Date", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "latestChangedDate" + } + }, + "xr.swmctrl.recentSWMActionDateTime": { + "format": "date-time", + "readOnly": true, + "title": "Action Date Time", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "timestamp" + } + }, + "xr.swmctrl.recentSWMAction": { + "default": 0, + "description": "Software Management Action. \nSet to a non-zero value to trigger the different SWM actions.\n- '0': No Action\n- '1': Validate swURL\n- '2': Start software download to upgradeBank\n- '3': Classify upgrade impact. I.e. the impact of executing the software in upgradeBank. Result is seen on upgradeClassification property.\n- '4': Execute software in upgradeBank\n- '5': Commit software in runningBank\n- '6': Execute software in previousBank (Fallback)\n- '7': Abort\n", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + "readOnly": true, + "title": "SWM Action", + "type": "integer", + "x-enum-varnames": [ + "No Action", + "Validate swURL", + "Start software download to upgradeBank", + "Classify upgrade impact.", + "Execute software in upgradeBank", + "Commit software in runningBank", + "Execute software in previousBank (Fallback)", + "Abort" + ], + "x-oapi-codegen-extra-tags": { + "bson": "action" + } + }, + "xr.swmctrl.recentSWMActionSource": { + "description": "- 0: NA \n- 1: CM \n- 2: Host\n", + "enum": [ + 0, + 1, + 2 + ], + "readOnly": true, + "type": "integer", + "x-enum-varnames": [ + "Not applicable", + "CM", + "Host" + ], + "x-oapi-codegen-extra-tags": { + "bson": "source" + } + }, + "xr.swmctrl.recentSWMActionUpgradeBank": { + "default": 0, + "description": "Bank ID used for swm Actions. \nInactive bank ID is used if not set.\n", + "maximum": 2, + "minimum": 0, + "readOnly": true, + "title": "Upgrade SW bank", + "type": "integer", + "x-oapi-codegen-extra-tags": { + "bson": "bank" + } + }, + "xr.swmctrl.recentSWMActionSWURL": { + "default": "", + "description": "Source of software package for download to upgradebank. \nSet to empty if it is not applicable for the recent SWM cction.\n", + "format": "uri", + "maxLength": 255, + "readOnly": true, + "title": "SW URL", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "swUrl" + } + }, + "xr.swmctrl.recentSWMActionRevertTimeout": { + "default": 120, + "description": "Seconds until automatic revert to previousBank after executing new SW, unless the new SW is committed. 0 used for no revert. Set to empty if it is not applicable for the recent SWM action.", + "readOnly": true, + "title": "Revert timeout", + "type": "integer", + "x-unit": "s", + "x-oapi-codegen-extra-tags": { + "bson": "revertTimeout" + } + }, + "xr.swmctrl.recentDownloadProgress": { + "description": "Percentage of SW package download, 0-100, when download is in progress. \n255 is used for \"N/A\" when no download is in progress. \nSet to empty if it is not applicable for the recent SWM action.\n", + "readOnly": true, + "title": "Download progress", + "type": "integer", + "x-unit": "%", + "x-oapi-codegen-extra-tags": { + "bson": "downloadProgress" + } + }, + "xr.swmctrl.recentUpgradeClassification": { + "description": "Classification of upgrade impact of executing the software in upgradeBank. \nResult of swmAction to classify upgrade impact. \nSet to empty if it is not applicable for the recent SWM action.\nPossible values:\n- '0': Upgrade not classified yet\n- '1': Upgrade classification failed\n- '2': Configuration cannot be migrated\n- '3': Service affecting upgrade\n- '4': Non-service affecting upgrade\n", + "readOnly": true, + "title": "Upgrade classification", + "type": "integer", + "x-oapi-codegen-extra-tags": { + "bson": "upgradeClassification" + } + }, + "xr.swmctrl.recentSWMActionResult": { + "description": "Result of the last completed swmAction. \nEither successfull or reason for failure.\nResult is Unknown during the execution of an SWM action and can be monitored to see both when an SWM action is completed and the result.\nPossible values:\n- '0': Unknown\n- '1': Success. The last SWM action was run successfully.\n- '2': Invalid or unreachable software URL. \n- '3': Not Enough RAM \n- '4': Not Enough Flash\n- '5': Connection Lost\n- '6': SW validation failure\n- '7': SW execute failure\n- '8': Commit failure\n- '9': Wrong SW For Module.\n", + "readOnly": true, + "title": "Last Action Result", + "type": "integer", + "x-oapi-codegen-extra-tags": { + "bson": "result" + } + }, + "xr.swmbank.version": { + "description": "Version of the SW deliverable stored in this bank.", + "maxLength": 20, + "readOnly": true, + "title": "Version", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "version" + } + }, + "xr.swmbank.configCompVersion": { + "description": "This is compiled into the SW. \nSee Migration above for details Divided into Major Minor Version. \n0xFFFFFFFF = n/a, i.e. there is no data\n", + "readOnly": true, + "title": "Configuration Compatibility Version", + "type": "integer", + "x-oapi-codegen-extra-tags": { + "bson": "configCompVersion" + } + }, + "xr.swmbank.configDataSentry": { + "description": "Incremented at every change of user configuration. \nThis refers to the data stored in association with this specific version. \n0xFFFFFFFF = n/a, i.e. there is no data.\n", + "readOnly": true, + "title": "Configuration Data Sentry", + "type": "integer", + "x-oapi-codegen-extra-tags": { + "bson": "configDataSentry" + } + }, + "xr.swmbank.action": { + "description": "Bank operation.\nPossible values:\n- 'none'\n- 'wipeout': Action to delete the SW and associated configuration in this Bank. Set to true to trigger the action.\n", + "enum": [ + "wipeout", + "none" + ], + "title": "Action", + "type": "string", + "x-enum-varnames": [ + "Wipeout", + "None" + ], + "x-oapi-codegen-extra-tags": { + "bson": "action" + } + }, + "cm.network-connection": { + "description": "Definition of network connection", + "example": { + "href": "/network-connections/d9672ef1-ddc1-cd6b-3c77-ea86b442545a", + "rt": [ + "cm.network-connection" + ], + "id": "d9672ef1-ddc1-cd6b-3c77-ea86b442545a", + "config": { + "name": "connection 01: Sunnyvale <> San Jose", + "serviceMode": "portMode", + "labels": { + "region": "West Coast" + } + }, + "state": { + "name": "connection 01: Sunnyvale <> San Jose", + "createdBy": "cm", + "lifecycleState": "configured", + "operationalStatus": "enabled", + "labels": { + "region": "West Coast" + } + }, + "endpoints": [ + { + "href": "/network-connections/d9672ef1-ddc1-cd6b-3c77-ea86b442545a/endpoints/9d37cb82-e7e3-45f0-bf9d-0a9f9b7ffd72", + "rt": [ + "cm.network-connection.endpoint" + ], + "id": "9d37cb82-e7e3-45f0-bf9d-0a9f9b7ffd72", + "parentId": "d9672ef1-ddc1-cd6b-3c77-ea86b442545a", + "config": { + "selector": { + "ifSelectorByHostPortId": { + "chassisIdSubtype": "macAddress", + "chassisId": "28:c0:da:3e:3e:40", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/1:2" + } + } + }, + "state": { + "hostPort": { + "chassisIdSubtype": "macAddress", + "chassisId": "28:c0:da:3e:3e:40", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/1:2", + "portSourceMAC": "28:c0:da:3e:3e:44" + }, + "moduleIf": { + "moduleId": "18e47620-8848-4c7e-710f-05c668478c57", + "moduleName": "XR Device", + "moduleMAC": "3c:2c:99:c0:89:00", + "moduleSerialNumber": "12345678900", + "moduleRole": "hub", + "moduleClientIfColId": 2, + "moduleClientIfAid": "XR T2", + "moduleClientIfPortSpeed": 100 + } + } + }, + { + "href": "/network-connections/d9672ef1-ddc1-cd6b-3c77-ea86b442545a/endpoints/bc8079be-8b19-4f28-a47e-9b30c8fe41f6", + "rt": [ + "cm.network-connection.endpoint" + ], + "id": "bc8079be-8b19-4f28-a47e-9b30c8fe41f6", + "parentId": "d9672ef1-ddc1-cd6b-3c77-ea86b442545a", + "config": { + "selector": { + "ifSelectorByHostPortId": { + "chassisIdSubtype": "macAddress", + "chassisId": "00:0B:F8:00:01:01", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0" + } + } + }, + "state": { + "hostPort": { + "chassisIdSubtype": "macAddress", + "chassisId": "00:0B:F8:00:01:01", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0", + "portSourceMAC": "28:c0:da:3e:3e:44" + }, + "moduleIf": { + "moduleId": "37fb48e6-bc3f-4f98-766c-5e8fdc7d0335", + "moduleName": "XR Device", + "moduleMAC": "2b-d3-3f-e4-77-c2", + "moduleSerialNumber": "12345678901", + "moduleClientIfAid": "XR T1", + "role": "leaf" + }, + "bandwidth": 100, + "policy": { + "ingressMatchCriteria": "matchAll", + "ingressMatchOuterVlanId": "", + "egressMatchCriteria": "matchAll", + "egressMatchOuterVlanId": "" + } + } + } + ], + "localConnections": [ + { + "href": "/network-connections/d9672ef1-ddc1-cd6b-3c77-ea86b442545a/local-connections/138ffcf5-5e77-4121-9e84-9fb9e677cbc4", + "rt": [ + "cm.network-connection.localConnection" + ], + "id": "138ffcf5-5e77-4121-9e84-9fb9e677cbc4", + "parentId": "d9672ef1-ddc1-cd6b-3c77-ea86b442545a", + "config": { + "moduleId": "37fb48e6-bc3f-4f98-766c-5e8fdc7d0335", + "clientAid": "XR T1", + "dscgAid": "XR-L1-C1-DSCG1", + "directionality": "biDir" + }, + "state": { + "lcColId": 1, + "aid": "XR-T1,XR-L1-C1-ODUCni-1-ODUji-1", + "directionality": "biDir", + "moduleId": "37fb48e6-bc3f-4f98-766c-5e8fdc7d0335", + "moduleMAC": "2b-d3-3f-e4-77-c2", + "clientAid": "XR-T1", + "lineAid": "XR-L1-C1-ODUCni-1-ODUji-1", + "dscgAid": "XR-L1-C1-DSCG1", + "remoteModuleMAC": "3c:2c:99:c0:89:00", + "remoteClientAid": "XR T2" + } + }, + { + "href": "/network-connections/d9672ef1-ddc1-cd6b-3c77-ea86b442545a/local-connections/92c8cd71-4d8b-412f-90b4-de4ec3448eb2", + "rt": [ + "cm.network-connection.localConnection" + ], + "id": "92c8cd71-4d8b-412f-90b4-de4ec3448eb2", + "parentId": "d9672ef1-ddc1-cd6b-3c77-ea86b442545a", + "config": { + "moduleId": "18e47620-8848-4c7e-710f-05c668478c57", + "clientAid": "XR T2", + "dscgAid": "XR-L1-C1-DSCG1", + "directionality": "biDir" + }, + "state": { + "lcColId": 1, + "aid": "XR-T2,XR-L1-C1-ODUCni-1-ODUji-1", + "directionality": "biDir", + "moduleId": "18e47620-8848-4c7e-710f-05c668478c57", + "moduleMAC": "2b-d3-3f-e4-77-c2", + "clientAid": "XR-T2", + "lineAid": "XR-L1-C1-ODUCni-1-ODUji-1", + "dscgAid": "XR-L1-C1-DSCG1", + "remoteModuleMAC": "3c:2c:99:c0:89:00", + "remoteClientAid": "XR T2" + } + } + ] + }, + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "config": { + "$ref": "#/components/schemas/cm.network-connection.config" + }, + "state": { + "$ref": "#/components/schemas/cm.network-connection.state" + }, + "endpoints": { + "$ref": "#/components/schemas/cm.network-connection.endpoints" + }, + "lcs": { + "$ref": "#/components/schemas/cm.network-connection.local-connections" + } + }, + "type": "object" + }, + "cm.network-connection.config": { + "additionalProperties": false, + "description": "Definition of network connection configurable parameters", + "properties": { + "name": { + "$ref": "#/components/schemas/cm.parameters.name" + }, + "serviceMode": { + "$ref": "#/components/schemas/cm.network-connection.parameters.serviceMode" + }, + "mc": { + "$ref": "#/components/schemas/cm.network-connection.parameters.mc" + }, + "outerVID": { + "$ref": "#/components/schemas/cm.network-connection.parameters.outerVID" + }, + "labels": { + "$ref": "#/components/schemas/cm.parameters.labels" + } + }, + "type": "object" + }, + "cm.network-connection.state": { + "description": "Definition of network connection state parameters", + "properties": { + "name": { + "$ref": "#/components/schemas/cm.parameters.name" + }, + "serviceMode": { + "$ref": "#/components/schemas/cm.network-connection.parameters.serviceMode" + }, + "createdBy": { + "$ref": "#/components/schemas/cm.network-connection.parameters.createdBy" + }, + "lifecycleState": { + "$ref": "#/components/schemas/cm.network-connection.parameters.lifecycleState" + }, + "lifecycleStateCause": { + "$ref": "#/components/schemas/cm.parameters.lifecycleStateCause" + }, + "operationalStatus": { + "$ref": "#/components/schemas/cm.network-connection.parameters.operationalStatus" + }, + "labels": { + "$ref": "#/components/schemas/cm.parameters.labels" + } + }, + "type": "object" + }, + "cm.network-connection.parameters.serviceMode": { + "default": "portMode", + "description": "Provides the network connection type.\nPossible values:\n- 'portMode': Provides transparent transport of Ethernet or OTN traffic between XR hub and leaf client ports\n- 'vtiP2mpMode': Provides transport of VLAN flows between XR hub and leaf client ports where downstream traffic and bandwidth from Hub module can be shared by multiple Leaf modules\n- 'vtiP2pSymmetric': Provides transport of VLAN flows between XR hub and leaf client ports using a symmetric P2P bidirectional (upstream and downstream) flow between a Hub and a Leaf module\n- 'vtiP2pAsymmetric': Provides transport of VLAN flows between XR hub and leaf client ports using an asymmetric P2P bidirectional (upstream and downstream) flow between a Hub and a Leaf module\n", + "enum": [ + "portMode", + "vtiP2mpMode", + "vtiP2pSymmetric", + "vtiP2pAsymmetric" + ], + "title": "Service Mode", + "type": "string", + "x-enum-varnames": [ + "Port mode", + "VTI P2MP mode", + "VTI P2MP symmetric", + "VTI P2MP asymmetric" + ], + "x-oapi-codegen-extra-tags": { + "bson": "serviceMode" + } + }, + "cm.network-connection.parameters.createdBy": { + "description": "Indicates whether network-connection orchestration should be done through CM interface or through Host interface\nPossible values: 'host', 'cm'\n- 'host': Created through host interface and discovered by CM\n Cannot be edited or deleted through CM interface\n- 'cm': Created through CM interface\n Can be edited or deleted through CM interface\n", + "enum": [ + "host", + "cm" + ], + "readOnly": true, + "title": "Created by", + "type": "string", + "x-enum-varnames": [ + "Host", + "IPM" + ], + "x-oapi-codegen-extra-tags": { + "bson": "createdBy" + } + }, + "cm.network-connection.parameters.lifecycleState": { + "description": "Provides the configuration status of a network connection.\nPossible values:\n- 'pendingConfiguration': This state occurs when one of the network connection modules is pending configuration or pending deletion.\n- 'configured': This state occurs when all network connection modules are configured.\n- 'configurationFailed': This state may occur when at least a configuration of a module from this network connection failed or timeout.\n- 'pendingDeletion': This state may occur when a request to delete this network connection is being processed.\n- 'deletionFailed': This state may occur when at least a removal of a module from this network connection failed or timeout.\n- 'networkConflict': This state may occur when there is a conflict in a network connection module configuration.\n- 'deleted': This state occurs when a network connection is removed.\n", + "enum": [ + "pendingConfiguration", + "configured", + "configurationFailed", + "pendingDeletion", + "deletionFailed", + "networkConflict", + "deleted" + ], + "readOnly": true, + "title": "Lifecycle State", + "type": "string", + "x-enum-varnames": [ + "Pending configuration", + "Configured", + "Configuration failed", + "Pending deletion", + "Deletion failed", + "Network conflict", + "Deleted" + ], + "x-oapi-codegen-extra-tags": { + "bson": "lifecycleState" + } + }, + "cm.network-connection.parameters.operationalStatus": { + "description": "Operational Status.", + "enum": [ + "enabled", + "disabled" + ], + "readOnly": true, + "title": "Operational status", + "type": "string", + "x-enum-varnames": [ + "Enabled", + "Disabled" + ], + "x-oapi-codegen-extra-tags": { + "bson": "operationalStatus" + } + }, + "cm.network-connection.parameters.mc": { + "description": "Match Criteria applied to the packets received from network side before sending to the client side.\nPossible Values:\n- 'matchAll': All packets from the associated client interface\n- 'matchOuterVID': Based on outer VLAN ID\n- 'none'\n", + "enum": [ + "matchAll", + "matchOuterVID", + "none" + ], + "type": "string", + "x-enum-varnames": [ + "Match all", + "Match outer VLAN Id", + "None" + ], + "x-oapi-codegen-extra-tags": { + "bson": "mc" + } + }, + "cm.network-connection.parameters.outerVID": { + "description": "String format listing of one or more individual VLAN IDs separated by \"&\" and/or ranges of VLAN IDs connected with \"&&\". \nExample \"10 & 20 & 50 && 100\" represents the VLAN IDs 10, 20 and 50-100.\n", + "pattern": "((409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])\\&\\& (409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9]))* | ((409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])\\&)* | (409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])", + "title": "Match Criteria VLAN IDs", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "outerVID" + } + }, + "cm.network-connection.create": { + "additionalProperties": false, + "description": "Definition of network connection creation parameters", + "properties": { + "name": { + "$ref": "#/components/schemas/cm.parameters.name" + }, + "serviceMode": { + "$ref": "#/components/schemas/cm.network-connection.parameters.serviceMode" + }, + "mc": { + "$ref": "#/components/schemas/cm.network-connection.parameters.mc" + }, + "outerVID": { + "$ref": "#/components/schemas/cm.network-connection.parameters.outerVID" + }, + "labels": { + "$ref": "#/components/schemas/cm.parameters.labels" + }, + "endpoints": { + "items": { + "$ref": "#/components/schemas/cm.network-connection.endpoint.create" + }, + "minItems": 2, + "type": "array" + } + }, + "required": [ + "endpoints", + "name", + "serviceMode" + ], + "type": "object" + }, + "cm.network-connection.update": { + "additionalProperties": false, + "description": "Definition of network connection configurable parameters", + "minProperties": 1, + "properties": { + "name": { + "$ref": "#/components/schemas/cm.parameters.name" + }, + "serviceMode": { + "$ref": "#/components/schemas/cm.network-connection.parameters.serviceMode" + }, + "mc": { + "$ref": "#/components/schemas/cm.network-connection.parameters.mc" + }, + "outerVID": { + "$ref": "#/components/schemas/cm.network-connection.parameters.outerVID" + }, + "labels": { + "$ref": "#/components/schemas/cm.parameters.labels" + } + }, + "type": "object" + }, + "cm.network-connection.endpoint": { + "description": "Definition of network connection endpoint object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "config": { + "$ref": "#/components/schemas/cm.network-connection.endpoint.config" + }, + "state": { + "$ref": "#/components/schemas/cm.network-connection.endpoint.state" + }, + "acs": { + "$ref": "#/components/schemas/cm.network-connection.acs" + } + } + }, + "cm.network-connection.endpoints": { + "description": "List of network connection endpoints", + "items": { + "$ref": "#/components/schemas/cm.network-connection.endpoint" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "endpoints" + } + }, + "cm.network-connection.endpoint.config": { + "additionalProperties": false, + "description": "Definition of network connection endpoint configurable parameters", + "properties": { + "selector": { + "$ref": "#/components/schemas/cm.selectors.ifSelector" + }, + "capacity": { + "$ref": "#/components/schemas/cm.network-connection.endpoint.parameters.capacity" + } + }, + "type": "object" + }, + "cm.network-connection.endpoint.state": { + "description": "Definition of network-connection endpoint state object", + "properties": { + "hostPort": { + "$ref": "#/components/schemas/cm.interface.hostPort" + }, + "moduleIf": { + "$ref": "#/components/schemas/cm.interface.moduleIf" + }, + "capacity": { + "$ref": "#/components/schemas/cm.network-connection.endpoint.parameters.capacity" + } + } + }, + "cm.network-connection.endpoint.parameters.capacity": { + "description": "Client to network capacity of the attachment circuit.\nPossible values are defined in multiples of 25Gbps up to maximum module rate.\n", + "title": "Capacity", + "type": "integer", + "x-unit": "Gbps", + "x-oapi-codegen-extra-tags": { + "bson": "capacity" + } + }, + "cm.network-connection.endpoint.create": { + "additionalProperties": false, + "description": "Definition of network connection endpoint creation parameters", + "properties": { + "selector": { + "$ref": "#/components/schemas/cm.selectors.ifSelector" + }, + "capacity": { + "$ref": "#/components/schemas/cm.network-connection.endpoint.parameters.capacity" + } + }, + "required": [ + "selector" + ], + "type": "object" + }, + "cm.network-connection.endpoint.update": { + "additionalProperties": false, + "description": "Definition of network connection endpoint editable parameters", + "properties": { + "capacity": { + "$ref": "#/components/schemas/cm.network-connection.endpoint.parameters.capacity" + } + }, + "required": [ + "capacity" + ], + "type": "object" + }, + "cm.network-connection.ac": { + "description": "Attachment circuit", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentIds": { + "$ref": "#/components/schemas/cm.parameters.parentIds" + }, + "config": { + "$ref": "#/components/schemas/cm.network-connection.ac.config" + }, + "state": { + "$ref": "#/components/schemas/cm.network-connection.ac.state" + } + }, + "type": "object" + }, + "cm.network-connection.acs": { + "description": "List of attachment circuits", + "items": { + "$ref": "#/components/schemas/cm.network-connection.ac" + }, + "maxItems": 2, + "minItems": 1, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "acs" + } + }, + "cm.network-connection.ac.config": { + "description": "Definition attachment circuit configurable parameters", + "properties": { + "capacity": { + "$ref": "#/components/schemas/cm.network-connection.ac.parameters.capacity" + }, + "imc": { + "$ref": "#/components/schemas/cm.network-connection.ac.parameters.imc" + }, + "imcOuterVID": { + "$ref": "#/components/schemas/cm.network-connection.ac.parameters.imcOuterVID" + }, + "emc": { + "$ref": "#/components/schemas/cm.network-connection.ac.parameters.emc" + }, + "emcOuterVID": { + "$ref": "#/components/schemas/cm.network-connection.ac.parameters.emcOuterVID" + } + }, + "type": "object" + }, + "cm.network-connection.ac.state": { + "description": "Definition of the attachment circuit state parameters.", + "properties": { + "colId": { + "$ref": "#/components/schemas/xr.common.colId" + }, + "capacity": { + "$ref": "#/components/schemas/xr.ethernet.ac.capacity" + }, + "imc": { + "$ref": "#/components/schemas/xr.ethernet.ac.imc" + }, + "imcOuterVID": { + "$ref": "#/components/schemas/xr.ethernet.ac.imcOuterVID" + }, + "emc": { + "$ref": "#/components/schemas/xr.ethernet.ac.emc" + }, + "emcOuterVID": { + "$ref": "#/components/schemas/xr.ethernet.ac.emcOuterVID" + }, + "lifecycleState": { + "$ref": "#/components/schemas/cm.network-connection.ac.parameters.lifecycleState" + } + }, + "type": "object" + }, + "cm.network-connection.ac.parameters.capacity": { + "description": "Client to network capacity of the attachment circuit.\nPossible values are defined in multiples of 25Gbps up to maximum module rate.\n", + "title": "Capacity", + "type": "integer", + "x-unit": "Gbps", + "x-oapi-codegen-extra-tags": { + "bson": "capacity" + } + }, + "cm.network-connection.ac.parameters.imc": { + "description": "Ingress Match Criteria applied to the packets received from client port before sending to the network side.\nPossible Values:\n- 'matchAll': All packets from the associated client interface\n- 'matchOuterVID': Based on outer VLAN ID\n- 'none'\n", + "enum": [ + "matchAll", + "matchOuterVID", + "none" + ], + "type": "string", + "x-enum-varnames": [ + "Match all", + "Match outer VLAN Id", + "None" + ], + "x-oapi-codegen-extra-tags": { + "bson": "imc" + } + }, + "cm.network-connection.ac.parameters.emc": { + "description": "Egress Match Criteria applied to the packets received from network side before sending to the client side.\nPossible Values:\n- 'matchAll': All packets from the associated client interface\n- 'matchOuterVID': Based on outer VLAN ID\n- 'none'\n", + "enum": [ + "matchAll", + "matchOuterVID", + "none" + ], + "type": "string", + "x-enum-varnames": [ + "Match all", + "Match outer VLAN Id", + "None" + ], + "x-oapi-codegen-extra-tags": { + "bson": "emc" + } + }, + "cm.network-connection.ac.parameters.imcOuterVID": { + "description": "String format listing of one or more individual VLAN IDs separated by \"&\" and/or ranges of VLAN IDs connected with \"&&\".\nExample \"10 & 20 & 50 && 100\" represents the VLAN IDs 10, 20 and 50-100.\n", + "pattern": "((409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])\\&\\& (409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9]))* | ((409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])\\&)* | (409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])", + "title": "Ingress Match Criteria VLAN IDs", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "imcOuterVID" + } + }, + "cm.network-connection.ac.parameters.emcOuterVID": { + "description": "String format listing of one or more individual VLAN IDs separated by \"&\" and/or ranges of VLAN IDs connected with \"&&\". \nExample \"10 & 20 & 50 && 100\" represents the VLAN IDs 10, 20 and 50-100.\n", + "pattern": "((409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])\\&\\& (409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9]))* | ((409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])\\&)* | (409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|[1-9])", + "title": "Egress Match Criteria VLAN IDs", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "emcOuterVID" + } + }, + "cm.network-connection.ac.parameters.lifecycleState": { + "description": "Provides the configuration status of an attachment circuit.\nPossible values:\n- 'pendingConfiguration': This state occurs when the module ac configuration is required.\n- 'configured': This state occurs when the module is configured in the network according to its ac requirements.\n- 'configurationFailed': This state occurs when the module ac configuration failed or timeout.\n- 'pendingDeletion': This state occurs when the module shall be removed from the current network-connection.\n- 'deletionFailed': This state occurs when the configuration to remove the module from the network-connection failed or timeout.\n- 'networkConflict': The current module configuration does not match the request or was already a member of other existing network-connection.\n- 'deleted': This state occurs when the current module is removed from the network-connection.\n", + "title": "Lifecycle State" + }, + "cm.network-connection.local-connection": { + "description": "Cross-connection between ethernet interface and optical line interface within a device", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentIds": { + "$ref": "#/components/schemas/cm.parameters.parentIds" + }, + "config": { + "$ref": "#/components/schemas/cm.network-connection.local-connection.config" + }, + "state": { + "$ref": "#/components/schemas/cm.network-connection.local-connection.state" + } + }, + "type": "object" + }, + "cm.network-connection.local-connections": { + "description": "List of local connections", + "items": { + "$ref": "#/components/schemas/cm.network-connection.local-connection" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "lcs" + } + }, + "cm.network-connection.local-connection.config": { + "additionalProperties": false, + "description": "Definition of local-connection configurable parameters", + "properties": { + "moduleId": { + "$ref": "#/components/schemas/cm.network-connection.local-connection.parameters.moduleId" + }, + "clientAid": { + "$ref": "#/components/schemas/cm.network-connection.local-connection.parameters.clientAid" + }, + "dscgAid": { + "$ref": "#/components/schemas/cm.network-connection.local-connection.parameters.dscgAid" + }, + "direction": { + "$ref": "#/components/schemas/cm.network-connection.local-connection.parameters.direction" + } + }, + "type": "object" + }, + "cm.network-connection.local-connection.state": { + "description": "Definition of network-connection state parameters", + "properties": { + "lcAid": { + "$ref": "#/components/schemas/xr.lc.aid" + }, + "colId": { + "$ref": "#/components/schemas/xr.common.colId" + }, + "direction": { + "$ref": "#/components/schemas/xr.lc.direction" + }, + "moduleId": { + "$ref": "#/components/schemas/xr.device.di" + }, + "macAddress": { + "$ref": "#/components/schemas/xr.platform.macAddress" + }, + "clientAid": { + "$ref": "#/components/schemas/xr.lc.clientAid" + }, + "lineAid": { + "$ref": "#/components/schemas/xr.lc.lineAid" + }, + "dscgAid": { + "$ref": "#/components/schemas/xr.lc.dscgAid" + }, + "remoteModuleId": { + "$ref": "#/components/schemas/xr.lc.remoteModuleId" + }, + "remoteClientAid": { + "$ref": "#/components/schemas/xr.lc.remoteClientId" + } + }, + "type": "object" + }, + "cm.network-connection.local-connection.parameters.moduleId": { + "description": "Module identifier", + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "title": "ID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "moduleId" + } + }, + "cm.network-connection.local-connection.parameters.clientAid": { + "description": "Access Identifier (AID) within module and client interface collection.", + "maxLength": 64, + "title": "Client AID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "clientAid" + } + }, + "cm.network-connection.local-connection.parameters.dscgAid": { + "description": "Access Identifier (AID) within module and DSCG collection.", + "maxLength": 64, + "title": "DSCG AID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "dscgAid" + } + }, + "cm.network-connection.local-connection.parameters.direction": { + "description": "Directionality of the local connection. \nPossible values:\n- 'txRx': Both Transmit (Client to Line) and Receive (Line to Client) direction \n- 'tx': Client to Line direction only. \n- 'rx': Line to Client direction only.\n", + "enum": [ + "txRx", + "tx", + "rx" + ], + "title": "Directionality of the LC.", + "type": "string", + "x-enum-varnames": [ + "TX and RX", + "TX only", + "RX only" + ], + "x-oapi-codegen-extra-tags": { + "bson": "direction" + } + }, + "cm.parameters.lifecycleStateCause": { + "description": "Detailed information regarding the object lifecycle state.", + "properties": { + "action": { + "$ref": "#/components/schemas/cm.lifecycleStateCause.parameters.action" + }, + "timestamp": { + "$ref": "#/components/schemas/cm.lifecycleStateCause.parameters.timestamp" + }, + "traceId": { + "$ref": "#/components/schemas/cm.lifecycleStateCause.parameters.traceId" + }, + "errors": { + "items": { + "$ref": "#/components/schemas/cm.error" + }, + "type": "array" + } + }, + "title": "Lifecycle State Cause", + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "lifecycleStateCause" + } + }, + "cm.lifecycleStateCause.parameters.action": { + "description": "Internal id of the action that triggered the current lifecycle state change.", + "readOnly": true, + "title": "Action", + "type": "integer", + "x-oapi-codegen-extra-tags": { + "bson": "action" + } + }, + "cm.lifecycleStateCause.parameters.timestamp": { + "description": "Timestamp of the action that triggered the current lifecycle state change in date-time format pattern according to IETF RFC 3339.", + "format": "date-time", + "readOnly": true, + "title": "Timestamp", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "timestamp" + } + }, + "cm.lifecycleStateCause.parameters.traceId": { + "description": "Id assigned to the request, job, or action that triggered the current lifecycle state change.", + "readOnly": true, + "title": "Trace Id", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "traceId" + } + }, + "cm.selectors.ifSelector": { + "description": "Definition of selector", + "maxProperties": 1, + "minProperties": 1, + "properties": { + "hostPortSelectorByName": { + "$ref": "#/components/schemas/cm.selector.hostPortSelectorByName" + }, + "hostPortSelectorByPortId": { + "$ref": "#/components/schemas/cm.selector.hostPortSelectorByPortId" + }, + "hostPortSelectorBySysName": { + "$ref": "#/components/schemas/cm.selector.hostPortSelectorBySysName" + }, + "hostPortSelectorByPortSourceMAC": { + "$ref": "#/components/schemas/cm.selector.hostPortSelectorByPortSourceMAC" + }, + "moduleIfSelectorByModuleId": { + "$ref": "#/components/schemas/cm.selector.moduleIfSelectorByModuleId" + }, + "moduleIfSelectorByModuleName": { + "$ref": "#/components/schemas/cm.selector.moduleIfSelectorByModuleName" + }, + "moduleIfSelectorByModuleMAC": { + "$ref": "#/components/schemas/cm.selector.moduleIfSelectorByModuleMAC" + }, + "moduleIfSelectorByModuleSerialNumber": { + "$ref": "#/components/schemas/cm.selector.moduleIfSelectorByModuleSerialNumber" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "selector" + } + }, + "cm.selector.hostPortSelectorByName": { + "additionalProperties": false, + "description": "Definition of host port selector based on host port name information", + "maxProperties": 3, + "minProperties": 3, + "properties": { + "name": { + "$ref": "#/components/schemas/cm.parameters.name" + }, + "portIdSubtype": { + "$ref": "#/components/schemas/cm.selector.hostPortSelector.parameters.portIdSubtype" + }, + "portId": { + "$ref": "#/components/schemas/cm.selector.hostPortSelector.parameters.portId" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "hostPortSelectorByName" + } + }, + "cm.selector.hostPortSelector.parameters.portIdSubtype": { + "description": "Only applicable when pre-planning objects.\nIf defined, this parameter is used as matching criteria for associating the host port to a module client interface using the tuple chassisIdSubtype, chassisId, portIdSubtype, portId.\n", + "enum": [ + "interfaceAlias", + "portComponent", + "macAddress", + "networkAddress", + "interfaceName", + "agentCircuitId", + "local" + ], + "title": "LLDP Port ID encoding", + "type": "string", + "x-enum-varnames": [ + "Interface alias", + "Port component", + "MAC address", + "Network address", + "Interface name", + "Agent circuit ID", + "Locally assigned" + ], + "x-oapi-codegen-extra-tags": { + "bson": "portIdSubtype" + } + }, + "cm.selector.hostPortSelector.parameters.portId": { + "description": "Only applicable when pre-planning objects.\nIf defined, this parameter is used as matching criteria for associating the host port to a module client interface using the tuple chassisIdSubtype, chassisId, portIdSubtype, portId.\n", + "title": "LLDP Port ID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "portId" + } + }, + "cm.selector.hostPortSelectorByPortId": { + "additionalProperties": false, + "description": "Definition of host port selector based on host port id and chassis id information", + "maxProperties": 4, + "minProperties": 4, + "properties": { + "chassisIdSubtype": { + "$ref": "#/components/schemas/cm.selector.hostSelector.parameters.chassisIdSubtype" + }, + "chassisId": { + "$ref": "#/components/schemas/cm.selector.hostSelector.parameters.chassisId" + }, + "portIdSubtype": { + "$ref": "#/components/schemas/cm.selector.hostPortSelector.parameters.portIdSubtype" + }, + "portId": { + "$ref": "#/components/schemas/cm.selector.hostPortSelector.parameters.portId" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "hostPortSelectorByPortId" + } + }, + "cm.selector.hostSelector.parameters.chassisIdSubtype": { + "default": "macAddress", + "description": "Value of chassisIdSubtype (encoding of chassisId) within LLDP data.\nOnly applicable when pre-planning objects.\nIf defined, this parameter is used as matching criteria when associating discovered XR modules.\n", + "enum": [ + "reserved", + "chassisComponent", + "interfaceAlias", + "portComponent", + "macAddress", + "networkAddress", + "interfaceName", + "local" + ], + "title": "LLDP Chassis ID encoding", + "type": "string", + "x-enum-varnames": [ + "Reserved", + "Chassis component", + "Interface alias", + "Port component", + "MAC address", + "Network address", + "Interface name", + "Locally assigned" + ], + "x-oapi-codegen-extra-tags": { + "bson": "chassisIdSubtype" + } + }, + "cm.selector.hostSelector.parameters.chassisId": { + "description": "Value of chassisId within LLDP data\nOnly applicable when pre-planning objects.\nIf defined, this parameter is used as matching criteria when associating discovered XR modules.\n", + "title": "LLDP Chassis ID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "chassisId" + } + }, + "cm.selector.hostPortSelectorBySysName": { + "additionalProperties": false, + "description": "Definition of host port selector based on host port id and host system name information", + "maxProperties": 3, + "minProperties": 3, + "properties": { + "sysName": { + "$ref": "#/components/schemas/cm.selector.hostSelector.parameters.sysName" + }, + "portIdSubtype": { + "$ref": "#/components/schemas/cm.selector.hostPortSelector.parameters.portIdSubtype" + }, + "portId": { + "$ref": "#/components/schemas/cm.selector.hostPortSelector.parameters.portId" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "hostPortSelectorBySysName" + } + }, + "cm.selector.hostSelector.parameters.sysName": { + "description": "Value of System Name within LLDP data\nOnly applicable when pre-planning objects.\nIf defined, this parameter is used as matching criteria when associating discovered XR modules.\n", + "title": "LLDP System Name", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "sysName" + } + }, + "cm.selector.hostPortSelectorByPortSourceMAC": { + "additionalProperties": false, + "description": "Definition of host port selector based on host port source MAC address id information", + "maxProperties": 1, + "minProperties": 1, + "properties": { + "portSourceMAC": { + "$ref": "#/components/schemas/cm.selector.hostPortSelector.parameters.portSourceMAC" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "hostPortSelectorByPortSourceMAC" + } + }, + "cm.selector.hostPortSelector.parameters.portSourceMAC": { + "description": "Only applicable when pre-planning objects.\nIf defined, this parameter is used as matching criteria for associating the host port to a module client interface using the portSourceMAC.\n", + "title": "Host Port MAC Address", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "portSourceMAC" + } + }, + "cm.selector.moduleIfSelectorByModuleId": { + "additionalProperties": false, + "description": "Definition of host port selector based on module id information", + "maxProperties": 2, + "minProperties": 2, + "properties": { + "moduleId": { + "$ref": "#/components/schemas/cm.selector.moduleSelector.parameters.moduleId" + }, + "moduleClientIfAid": { + "$ref": "#/components/schemas/cm.selector.moduleIfSelector.parameters.moduleClientIfAid" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "moduleIfSelectorByModuleId" + } + }, + "cm.selector.moduleSelector.parameters.moduleId": { + "description": "Only applicable when pre-planning objects.\nIf defined, this parameter is used as matching criteria when associating discovered XR modules using moduleId.\n", + "title": "Module Identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "moduleId" + } + }, + "cm.selector.moduleIfSelector.parameters.moduleClientIfAid": { + "description": "TODO\n", + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "moduleClientIfAid" + } + }, + "cm.selector.moduleIfSelectorByModuleName": { + "additionalProperties": false, + "description": "Definition of host port selector based on module serial number information", + "maxProperties": 2, + "minProperties": 2, + "properties": { + "moduleName": { + "$ref": "#/components/schemas/cm.selector.moduleSelector.parameters.moduleName" + }, + "moduleClientIfAid": { + "$ref": "#/components/schemas/cm.selector.moduleIfSelector.parameters.moduleClientIfAid" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "moduleIfSelectorByModuleName" + } + }, + "cm.selector.moduleSelector.parameters.moduleName": { + "description": "Only applicable when pre-planning objects.\nIf defined, this parameter is used as matching criteria when associating discovered XR modules.\n", + "title": "Name", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "moduleName" + } + }, + "cm.selector.moduleIfSelectorByModuleMAC": { + "additionalProperties": false, + "description": "Definition of host port selector based on module MAC address information", + "maxProperties": 2, + "minProperties": 2, + "properties": { + "moduleMAC": { + "$ref": "#/components/schemas/cm.selector.moduleSelector.parameters.moduleMAC" + }, + "moduleClientIfAid": { + "$ref": "#/components/schemas/cm.selector.moduleIfSelector.parameters.moduleClientIfAid" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "moduleIfSelectorByModuleMAC" + } + }, + "cm.selector.moduleSelector.parameters.moduleMAC": { + "description": "Only applicable when pre-planning objects.\nIf defined, this parameter is used as matching criteria when associating discovered XR modules.\n", + "title": "MAC Address", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "moduleMAC" + } + }, + "cm.selector.moduleIfSelectorByModuleSerialNumber": { + "additionalProperties": false, + "description": "Definition of host port selector based on module serial number information", + "maxProperties": 2, + "minProperties": 2, + "properties": { + "moduleSerialNumber": { + "$ref": "#/components/schemas/cm.selector.moduleSelector.parameters.moduleSerialNumber" + }, + "moduleClientIfAid": { + "$ref": "#/components/schemas/cm.selector.moduleIfSelector.parameters.moduleClientIfAid" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "moduleIfSelectorByModuleSerialNumber" + } + }, + "cm.selector.moduleSelector.parameters.moduleSerialNumber": { + "description": "Only applicable when pre-planning objects.\nIf defined, this parameter is used as matching criteria when associating discovered XR modules.\n", + "title": "Serial number", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "moduleSerialNumber" + } + }, + "cm.interface.hostPort": { + "description": "Definition of interface host parameters", + "properties": { + "name": { + "$ref": "#/components/schemas/cm.parameters.name" + }, + "hostName": { + "$ref": "#/components/schemas/cm.parameters.hostName" + }, + "chassisIdSubtype": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.chassisIdSubtype" + }, + "chassisId": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.chassisId" + }, + "sysName": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.sysName" + }, + "portIdSubtype": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.portIdSubtype" + }, + "portId": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.portId" + }, + "portSourceMAC": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.localPortSourceMAC" + }, + "portDescr": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.portDescr" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "hostPort" + } + }, + "cm.parameters.hostName": { + "description": "User defined object name.", + "maxLength": 64, + "pattern": "^([A-Za-z0-9_\\-.,: ]*)$", + "title": "Name", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "hostName" + } + }, + "cm.interface.moduleIf": { + "description": "Definition of interface module parameters", + "properties": { + "moduleId": { + "$ref": "#/components/schemas/xr.device.di" + }, + "moduleName": { + "$ref": "#/components/schemas/xr.device.n" + }, + "macAddress": { + "$ref": "#/components/schemas/xr.platform.macAddress" + }, + "serialNumber": { + "$ref": "#/components/schemas/xr.platform.mnsel" + }, + "currentRole": { + "$ref": "#/components/schemas/xr.configuration.currentRole" + }, + "clientIfColId": { + "$ref": "#/components/schemas/xr.ethernet.colId" + }, + "clientIfAid": { + "$ref": "#/components/schemas/xr.ethernet.aid" + }, + "clientIfPortSpeed": { + "$ref": "#/components/schemas/xr.ethernet.portSpeed" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "moduleIf" + } + }, + "cm.parameters.parentIds": { + "description": "List of Parent Object identifiers", + "items": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "title": "Parent IDs", + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentIds" + } + }, + "xr.ethernet.colId": { + "description": "Object identifier in the supporting Ethernet collection.", + "title": "Collection Id", + "type": "integer", + "x-oapi-codegen-extra-tags": { + "bson": "clientIfColId" + } + }, + "cm.xr-network": { + "description": "Definition of xr-network object", + "example": { + "href": "/networks/5f8c47b4-c02a-6242-260c-185dd04b8faf", + "rt": [ + "cm.network" + ], + "id": "5f8c47b4-c02a-6242-260c-185dd04b8faf", + "config": { + "name": "Sunnyvale Constellation", + "constellationFrequency": 193100000, + "modulation": "16QAM" + }, + "state": { + "name": "Sunnyvale Constellation", + "constellationFrequency": 193100000, + "modulation": "16QAM", + "lifecycleState": "configured", + "reachableModules": [ + { + "discoveredTime": "2022-04-05T14:32Z", + "module": { + "moduleId": "c85c2904-1794-11ec-9621-0242ac130002", + "moduleName": "XR Device", + "moduleMAC": "46:00:84:A0:0C:03", + "moduleSerialNumber": "12345678903", + "configuredRole": "Auto", + "currentRole": "Hub", + "roleStatus": "Ready", + "trafficMode": "L1Mode", + "fiberConnectionMode": "dual", + "frequencyCtrl": "XR", + "constellationFrequency": 194100000, + "operatingFrequency": 194100000, + "ncoFrequency": 194100000, + "modulation": "16QAM", + "capacity": 400, + "clientPortMode": "ethernet", + "baudRate": 32, + "maxAllowedDSCs": 16, + "txPowerTargetPerDsc": -6.4 + }, + "endpoints": [ + { + "hostPort": { + "chassisIdSubtype": "macAddress", + "chassisId": "49:48:59:74:0F:05", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0", + "portSourceMAC": "6F:B9:08:F0:C2:49", + "portDescr": "et-1/0/0:0" + }, + "module": { + "moduleId": "c85c2904-1794-11ec-9621-0242ac130002", + "moduleName": "XR Device", + "moduleMAC": "46:00:84:A0:0C:03", + "moduleSerialNumber": "12345678903", + "moduleCurrentRole": "Hub", + "moduleClientIfColId": 1, + "moduleClientIfAid": "XR T1", + "moduleClientIfPortSpeed": 400 + } + } + ] + }, + { + "discoveredTime": "2022-04-05T14:32Z", + "module": { + "moduleId": "18e47620-8848-4c7e-710f-05c668478c57", + "moduleName": "XR Device", + "moduleMAC": "46:00:84:A0:0C:00", + "moduleSerialNumber": "12345678900", + "configuredRole": "Auto", + "currentRole": "hub", + "roleStatus": "Ready", + "trafficMode": "L1Mode", + "fiberConnectionMode": "dual", + "frequencyCtrl": "XR", + "constellationFrequency": 193100000, + "operatingFrequency": 193100000, + "ncoFrequency": 193100000, + "modulation": "16QAM", + "capacity": 400, + "clientPortMode": "ethernet", + "baudRate": 32, + "maxAllowedDSCs": 16, + "txPowerTargetPerDsc": -6.4, + "endpoints": [ + { + "hostPort": { + "chassisIdSubtype": "macAddress", + "chassisId": "28:c0:da:3e:3e:40", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0", + "portSourceMAC": "da:3d:c2:4c:55:40", + "portDescr": "et-1/0/0:0" + }, + "moduleIf": { + "moduleId": "18e47620-8848-4c7e-710f-05c668478c57", + "moduleName": "XR Device", + "moduleMAC": "46:00:84:A0:0C:00", + "moduleSerialNumber": "12345678900", + "moduleCurrentRole": "hub", + "moduleClientIfColId": 1, + "moduleClientIfAid": "XR T1", + "moduleClientIfPortSpeed": 100 + } + }, + { + "hostPort": { + "chassisIdSubtype": "macAddress", + "chassisId": "28:c0:da:3e:3e:40", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/1:0", + "portSourceMAC": "04:34:D6:88:A8:CB", + "portDescr": "et-1/0/1:0" + }, + "moduleIf": { + "moduleId": "18e47620-8848-4c7e-710f-05c668478c57", + "moduleName": "XR Device", + "moduleMAC": "46:00:84:A0:0C:00", + "moduleSerialNumber": "12345678900", + "moduleCurrentRole": "hub", + "moduleClientIfColId": 2, + "moduleClientIfAid": "XR T2", + "moduleClientIfPortSpeed": 100 + } + } + ] + } + }, + { + "discoveredTime": "2022-04-05T14:32Z", + "module": { + "moduleId": "153a21fc-1a30-11ec-9621-0242ac130002", + "moduleName": "XR Device", + "moduleMAC": "46:00:84:A0:0C:02", + "moduleSerialNumber": "12345678901", + "configuredRole": "Auto", + "currentRole": "Leaf", + "roleStatus": "Ready", + "trafficMode": "L1Mode", + "fiberConnectionMode": "dual", + "frequencyCtrl": "XR", + "constellationFrequency": 193100000, + "operatingFrequency": 193074500, + "ncoFrequency": 193074500, + "modulation": "16QAM", + "capacity": 100, + "clientPortMode": "ethernet", + "baudRate": 32, + "maxAllowedDSCs": 4, + "txPowerTargetPerDsc": -6.4, + "endpoints": [ + { + "hostPort": { + "chassisIdSubtype": "macAddress", + "chassisId": "00:0B:F8:00:01:01", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0", + "portSourceMAC": "8C:23:5E:E9:72:1C", + "portDescr": "et-1/0/0:0" + }, + "moduleIf": { + "moduleId": "153a21fc-1a30-11ec-9621-0242ac130002", + "moduleName": "XR Device", + "moduleMAC": "46:00:84:A0:0C:02", + "moduleSerialNumber": "12345678901", + "moduleCurrentRole": "Leaf", + "moduleClientIfColId": 1, + "moduleClientIfAid": "XR T1", + "moduleClientIfPortSpeed": 100 + } + }, + { + "hostPort": { + "chassisIdSubtype": "macAddress", + "chassisId": "00:0B:F8:00:01:01", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/1:0", + "portSourceMAC": "B9:0B:80:0E:0B:70", + "portDescr": "et-1/0/1:0" + }, + "moduleIf": { + "moduleId": "153a21fc-1a30-11ec-9621-0242ac130002", + "moduleName": "XR Device", + "moduleMAC": "46:00:84:A0:0C:02", + "moduleSerialNumber": "12345678901", + "moduleCurrentRole": "Leaf", + "moduleClientIfColId": 2, + "moduleClientIfAid": "XR T2", + "moduleClientIfPortSpeed": 100 + } + } + ] + } + }, + { + "discoveredTime": "2022-04-05T14:32Z", + "module": { + "moduleId": "23ffd75e-1a30-11ec-9621-0242ac130002", + "moduleName": "XR Device", + "moduleMAC": "46:00:84:A0:0C:02", + "moduleSerialNumber": "12345678902", + "configuredRole": "Auto", + "currentRole": "Leaf", + "roleStatus": "Ready", + "trafficMode": "L1Mode", + "frequencyCtrl": "XR", + "fiberConnectionMode": "dual", + "constellationFrequency": 193100000, + "operatingFrequency": 193074500, + "ncoFrequency": 193074500, + "modulation": "16QAM", + "capacity": 100, + "clientPortMode": "ethernet", + "baudRate": 32, + "maxAllowedDSCs": 4, + "txPowerTargetPerDsc": -6.4, + "endpoints": [ + { + "hostPort": { + "chassisIdSubtype": "macAddress", + "chassisId": "00:99:F8:2c:01:01", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0", + "portSourceMAC": "da:3d:c2:4c:55:40", + "portDescr": "et-1/0/0:0" + }, + "moduleIf": { + "moduleId": "23ffd75e-1a30-11ec-9621-0242ac130002", + "moduleName": "XR Device", + "moduleMAC": "46:00:84:A0:0C:02", + "moduleSerialNumber": "12345678902", + "moduleCurrentRole": "Leaf", + "moduleClientIfColId": 2, + "moduleClientIfAid": "XR T1", + "moduleClientIfPortSpeed": 100 + } + } + ] + } + } + ], + "controlLinks": [ + { + "sourceModuleId": "18e47620-8848-4c7e-710f-05c668478c57", + "destinationModuleId": "153a21fc-1a30-11ec-9621-0242ac130002", + "conState": "Active", + "lastConStateChange": 1628084981 + }, + { + "sourceModuleId": "153a21fc-1a30-11ec-9621-0242ac130002", + "destinationModuleId": "18e47620-8848-4c7e-710f-05c668478c57", + "conState": "Active", + "lastConStateChange": 1628084981 + }, + { + "sourceModuleId": "18e47620-8848-4c7e-710f-05c668478c57", + "destinationModuleId": "23ffd75e-1a30-11ec-9621-0242ac130002", + "conState": "Active", + "lastConStateChange": 1628081381 + }, + { + "sourceModuleId": "23ffd75e-1a30-11ec-9621-0242ac130002", + "destinationModuleId": "18e47620-8848-4c7e-710f-05c668478c57", + "conState": "Active", + "lastConStateChange": 1628081381 + } + ], + "availableServices": [ + { + "type": "100G", + "maximum": 4, + "available": 2, + "used": 2 + }, + { + "type": "75G", + "maximum": 4, + "available": 0, + "used": 0 + }, + { + "type": "50G", + "maximum": 8, + "available": 0, + "used": 0 + }, + { + "type": "25G", + "maximum": 16, + "available": 0, + "used": 0 + } + ] + }, + "hub": { + "href": "/networks/5f8c47b4-c02a-6242-260c-185dd04b8faf/hub/80da9300-8e6d-49d6-890f-c6436188b0fb", + "rt": [ + "cm.xr-network.hub" + ], + "id": "80da9300-8e6d-49d6-890f-c6436188b0fb", + "parentId": "5f8c47b4-c02a-6242-260c-185dd04b8faf", + "config": { + "selector": { + "hostPortSelector": { + "chassisIdSubtype": "macAddress", + "chassisId": "28:c0:da:3e:3e:40", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/1:2" + } + }, + "module": { + "trafficMode": "L1Mode", + "fiberConnectionMode": "dual", + "maxAllowedDSCs": 16 + } + }, + "state": { + "lifecycleState": "configured", + "module": { + "moduleId": "18e47620-8848-4c7e-710f-05c668478c57", + "moduleName": "XR Device", + "moduleMAC": "46:00:84:A0:0C:00", + "moduleSerialNumber": "12345678900", + "configuredRole": "Auto", + "currentRole": "hub", + "roleStatus": "Ready", + "trafficMode": "L1Mode", + "fiberConnectionMode": "dual", + "frequencyCtrl": "XR", + "constellationFrequency": 193100000, + "operatingFrequency": 193100000, + "ncoFrequency": 193100000, + "modulation": "16QAM", + "capacity": 400, + "clientPortMode": "ethernet", + "baudRate": 32, + "maxAllowedDSCs": 16, + "txPowerTargetPerDsc": -6.4 + }, + "endpoints": [ + { + "hostPort": { + "chassisIdSubtype": "macAddress", + "chassisId": "28:c0:da:3e:3e:40", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0", + "portSourceMAC": "da:3d:c2:4c:55:40", + "portDescr": "et-1/0/0:0" + }, + "moduleIf": { + "moduleId": "18e47620-8848-4c7e-710f-05c668478c57", + "moduleName": "XR Device", + "moduleMAC": "46:00:84:A0:0C:00", + "moduleSerialNumber": "12345678900", + "moduleCurrentRole": "hub", + "moduleClientIfColId": 1, + "moduleClientIfAid": "XR T1", + "moduleClientIfPortSpeed": 100 + } + }, + { + "hostPort": { + "chassisIdSubtype": "macAddress", + "chassisId": "28:c0:da:3e:3e:40", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/1:0", + "portSourceMAC": "04:34:D6:88:A8:CB", + "portDescr": "et-1/0/1:0" + }, + "moduleIf": { + "moduleId": "18e47620-8848-4c7e-710f-05c668478c57", + "moduleName": "XR Device", + "moduleMAC": "46:00:84:A0:0C:00", + "moduleSerialNumber": "12345678900", + "moduleCurrentRole": "hub", + "moduleClientIfColId": 2, + "moduleClientIfAid": "XR T2", + "moduleClientIfPortSpeed": 100 + } + } + ] + } + }, + "leafModules": [ + { + "href": "/networks/5f8c47b4-c02a-6242-260c-185dd04b8faf/leafModules/0f4d67fe-02aa-44ec-a5d8-4c7a71b240cb", + "rt": [ + "cm.xr-network.hub" + ], + "id": "0f4d67fe-02aa-44ec-a5d8-4c7a71b240cb", + "parentId": "5f8c47b4-c02a-6242-260c-185dd04b8faf", + "config": { + "selector": { + "hostPortSelector": { + "chassisIdSubtype": "macAddress", + "chassisId": "00:0B:F8:00:01:01", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0" + } + }, + "module": { + "trafficMode": "L1Mode", + "fiberConnectionMode": "dual" + } + }, + "state": { + "lifecycleState": "configured", + "module": { + "moduleId": "153a21fc-1a30-11ec-9621-0242ac130002", + "moduleName": "XR Device", + "moduleMAC": "46:00:84:A0:0C:02", + "moduleSerialNumber": "12345678901", + "configuredRole": "Auto", + "currentRole": "Leaf", + "roleStatus": "Ready", + "trafficMode": "L1Mode", + "fiberConnectionMode": "dual", + "frequencyCtrl": "XR", + "constellationFrequency": 193100000, + "operatingFrequency": 193074500, + "ncoFrequency": 193074500, + "modulation": "16QAM", + "capacity": 100, + "clientPortMode": "ethernet", + "baudRate": 32, + "maxAllowedDSCs": 4, + "txPowerTargetPerDsc": -6.4 + }, + "endpoints": [ + { + "hostPort": { + "chassisIdSubtype": "macAddress", + "chassisId": "00:0B:F8:00:01:01", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0", + "portSourceMAC": "8C:23:5E:E9:72:1C", + "portDescr": "et-1/0/0:0" + }, + "moduleIf": { + "moduleId": "153a21fc-1a30-11ec-9621-0242ac130002", + "moduleName": "XR Device", + "moduleMAC": "46:00:84:A0:0C:02", + "moduleSerialNumber": "12345678901", + "moduleCurrentRole": "Leaf", + "moduleClientIfColId": 1, + "moduleClientIfAid": "XR T1", + "moduleClientIfPortSpeed": 100 + } + }, + { + "hostPort": { + "chassisIdSubtype": "macAddress", + "chassisId": "00:0B:F8:00:01:01", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/1:0", + "portSourceMAC": "B9:0B:80:0E:0B:70", + "portDescr": "et-1/0/1:0" + }, + "moduleIf": { + "moduleId": "153a21fc-1a30-11ec-9621-0242ac130002", + "moduleName": "XR Device", + "moduleMAC": "46:00:84:A0:0C:02", + "moduleSerialNumber": "12345678901", + "moduleCurrentRole": "Leaf", + "moduleClientIfColId": 2, + "moduleClientIfAid": "XR T2", + "moduleClientIfPortSpeed": 100 + } + } + ] + } + }, + { + "href": "/networks/5f8c47b4-c02a-6242-260c-185dd04b8faf/leafModules/0a6cd54a-7767-43b9-915b-0ccc643412b9", + "rt": [ + "cm.xr-network.hub" + ], + "id": "0a6cd54a-7767-43b9-915b-0ccc643412b9", + "parentId": "5f8c47b4-c02a-6242-260c-185dd04b8faf", + "config": { + "selector": { + "hostPortSelector": { + "chassisIdSubtype": "macAddress", + "chassisId": "00:99:F8:2c:01:01", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0" + } + }, + "module": { + "trafficMode": "L1Mode", + "fiberConnectionMode": "dual" + } + }, + "state": { + "lifecycleState": "configured", + "module": { + "moduleId": "23ffd75e-1a30-11ec-9621-0242ac130002", + "moduleName": "XR Device", + "moduleMAC": "46:00:84:A0:0C:02", + "moduleSerialNumber": "12345678902", + "configuredRole": "Auto", + "currentRole": "Leaf", + "roleStatus": "Ready", + "trafficMode": "L1Mode", + "frequencyCtrl": "XR", + "fiberConnectionMode": "dual", + "constellationFrequency": 193100000, + "operatingFrequency": 193074500, + "ncoFrequency": 193074500, + "modulation": "16QAM", + "capacity": 100, + "clientPortMode": "ethernet", + "baudRate": 32, + "maxAllowedDSCs": 4, + "txPowerTargetPerDsc": -6.4 + }, + "endpoints": [ + { + "hostPort": { + "chassisIdSubtype": "macAddress", + "chassisId": "00:99:F8:2c:01:01", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0", + "portSourceMAC": "da:3d:c2:4c:55:40", + "portDescr": "et-1/0/0:0" + }, + "moduleIf": { + "moduleId": "23ffd75e-1a30-11ec-9621-0242ac130002", + "moduleName": "XR Device", + "moduleMAC": "46:00:84:A0:0C:02", + "moduleSerialNumber": "12345678902", + "moduleCurrentRole": "Leaf", + "moduleClientIfColId": 2, + "moduleClientIfAid": "XR T1", + "moduleClientIfPortSpeed": 100 + } + } + ] + } + } + ] + }, + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "config": { + "$ref": "#/components/schemas/cm.xr-network.config" + }, + "state": { + "$ref": "#/components/schemas/cm.xr-network.state" + }, + "hubModule": { + "$ref": "#/components/schemas/cm.xr-network.hubModule" + }, + "leafModules": { + "$ref": "#/components/schemas/cm.xr-network.leafModules" + }, + "reachableModules": { + "$ref": "#/components/schemas/cm.xr-network.reachableModules" + } + }, + "type": "object" + }, + "cm.xr-network.config": { + "additionalProperties": false, + "description": "Definition of xr-network configurable parameters", + "properties": { + "name": { + "$ref": "#/components/schemas/cm.xr-network.parameters.name" + }, + "constellationFrequency": { + "$ref": "#/components/schemas/cm.xr-network.parameters.constellationFrequency" + }, + "modulation": { + "$ref": "#/components/schemas/cm.xr-network.parameters.modulation" + } + }, + "type": "object" + }, + "cm.xr-network.state": { + "description": "Definition of constellation state", + "properties": { + "name": { + "$ref": "#/components/schemas/cm.xr-network.parameters.name" + }, + "constellationFrequency": { + "$ref": "#/components/schemas/xr.carrier.constellationFrequency" + }, + "modulation": { + "$ref": "#/components/schemas/xr.carrier.modulation" + }, + "lifecycleState": { + "$ref": "#/components/schemas/cm.xr-network.parameters.lifecycleState" + }, + "lifecycleStateCause": { + "$ref": "#/components/schemas/cm.parameters.lifecycleStateCause" + }, + "controlLinks": { + "$ref": "#/components/schemas/cm.xr-network.state.controlLinks" + }, + "availableServices": { + "$ref": "#/components/schemas/cm.xr-network.state.availableServices" + } + }, + "type": "object" + }, + "cm.xr-network.state.controlLink": { + "description": "Definition of constellation control link parameters", + "properties": { + "sourceModuleId": { + "$ref": "#/components/schemas/xr.controlplane.neighbor.sourceModuleId" + }, + "destinationModuleId": { + "$ref": "#/components/schemas/xr.controlplane.neighbor.destinationModuleId" + }, + "conState": { + "$ref": "#/components/schemas/xr.controlplane.neighbor.conState" + }, + "lastConStateChange": { + "$ref": "#/components/schemas/xr.controlplane.neighbor.lastConStateChange" + } + }, + "type": "object" + }, + "cm.xr-network.state.controlLinks": { + "description": "List of constellation control links", + "items": { + "$ref": "#/components/schemas/cm.xr-network.state.controlLink" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "controlLinks" + } + }, + "cm.xr-network.state.availableService": { + "description": "Possible, used and available services on the constellation", + "properties": { + "type": { + "$ref": "#/components/schemas/cm.xr-network.availableService.parameters.type" + }, + "maximum": { + "$ref": "#/components/schemas/cm.xr-network.availableService.parameters.maximum" + }, + "available": { + "$ref": "#/components/schemas/cm.xr-network.availableService.parameters.available" + }, + "used": { + "$ref": "#/components/schemas/cm.xr-network.availableService.parameters.used" + } + }, + "type": "object" + }, + "cm.xr-network.state.availableServices": { + "description": "List of possible and configured services over the constellation", + "items": { + "$ref": "#/components/schemas/cm.xr-network.state.availableService" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "availableServices" + } + }, + "cm.xr-network.parameters.name": { + "description": "User defined xr-network name", + "maxLength": 64, + "title": "Name", + "type": "string", + "uniqueItems": true, + "x-oapi-codegen-extra-tags": { + "bson": "name" + } + }, + "cm.xr-network.parameters.constellationFrequency": { + "description": "Carrier center frequency of the Hub module within the constellation (applied to Hub and leaf modules).", + "maximum": 196100000, + "minimum": 191000000, + "title": "Frequency", + "type": "integer", + "x-unit": "MHz", + "x-oapi-codegen-extra-tags": { + "bson": "constellationFrequency" + } + }, + "cm.xr-network.parameters.modulation": { + "description": "Constellation carrier signal mdoulation (applied to Hub and leaf modules).\nPossible values: '16QAM', 'QPSK' ' 8QAM'\n", + "enum": [ + "16QAM", + "QPSK", + "8QAM" + ], + "title": "Modulation", + "type": "string", + "x-enum-varnames": [ + "16QAM", + "QPSK", + "8QAM" + ], + "x-oapi-codegen-extra-tags": { + "bson": "modulation" + } + }, + "cm.xr-network.parameters.lifecycleState": { + "description": "Provides the configuration status of an object.\nPossible values:\n- 'pendingConfiguration': This state occurs when one of the xr-network modules is pending configuration or pending deletion.\n- 'configured': This state occurs when all xr-network modules are configured. \n- 'configurationFailed': This state may occur when at least a configuration of a module from this xr-network failed or timeout.\n- 'pendingDeletion': This state may occur when a request to delete this xr-network is being processed.\n- 'deletionFailed': This state may occur when at least a removal of a module from this xr-network failed or timeout.\n- 'networkConflict': This state may occur when there is a conflict in a xr-network module configuration.\n- 'deleted': This state occurs when a xr-network is removed.\n", + "enum": [ + "pendingConfiguration", + "configured", + "configurationFailed", + "pendingDeletion", + "deletionFailed", + "networkConflict", + "deleted" + ], + "readOnly": true, + "title": "Lifecycle State", + "type": "string", + "x-enum-varnames": [ + "Pending configuration", + "Configured", + "Configuration failed", + "Pending deletion", + "Deletion failed", + "Network conflict", + "Deleted" + ], + "x-oapi-codegen-extra-tags": { + "bson": "lifecycleState" + } + }, + "cm.xr-network.availableService.parameters.type": { + "description": "Represents the bandwidth of the possible services in the hub module\nPossible values:\n- 400G\n- 100G\n- 75G\n- 50G\n- 25G\n", + "enum": [ + "100G", + "75G", + "50G", + "25G" + ], + "title": "Bandwidth", + "type": "string", + "x-enum-varnames": [ + "100G", + "75G", + "50G", + "25G" + ], + "x-oapi-codegen-extra-tags": { + "bson": "type" + } + }, + "cm.xr-network.availableService.parameters.maximum": { + "description": "Number of maximum services of the above type that can exist in the constellation.", + "title": "Maximum", + "type": "integer", + "x-oapi-codegen-extra-tags": { + "bson": "maximum" + } + }, + "cm.xr-network.availableService.parameters.available": { + "description": "Number of available services of the above type that can be configured in the constellation taking in account the existing hub and leaf modules available resources.", + "title": "Available", + "type": "integer", + "x-oapi-codegen-extra-tags": { + "bson": "available" + } + }, + "cm.xr-network.availableService.parameters.used": { + "description": "Number of maximum services of the above type that exist in the constellation.", + "title": "Used", + "type": "integer", + "x-oapi-codegen-extra-tags": { + "bson": "used" + } + }, + "cm.xr-network.createRequest": { + "additionalProperties": false, + "description": "Object used in the request body of POST requests in /xr-networks endpoint.\nContains the xr-network, hub and leaf module configuration parameters.\n", + "properties": { + "config": { + "$ref": "#/components/schemas/cm.xr-network.create" + }, + "hubModule": { + "$ref": "#/components/schemas/cm.xr-network.node.create" + }, + "leafModules": { + "items": { + "$ref": "#/components/schemas/cm.xr-network.node.create" + }, + "type": "array" + } + }, + "required": [ + "config", + "hubModule" + ], + "type": "object" + }, + "cm.xr-network.create": { + "additionalProperties": false, + "description": "Definition of xr-network configurable parameters", + "properties": { + "name": { + "$ref": "#/components/schemas/cm.xr-network.parameters.name" + }, + "constellationFrequency": { + "$ref": "#/components/schemas/cm.xr-network.parameters.constellationFrequency" + }, + "modulation": { + "$ref": "#/components/schemas/cm.xr-network.parameters.modulation" + } + }, + "required": [ + "constellationFrequency", + "modulation", + "name" + ], + "type": "object" + }, + "cm.xr-network.update": { + "additionalProperties": false, + "description": "Definition of xr-network editable parameters", + "minProperties": 1, + "properties": { + "name": { + "$ref": "#/components/schemas/cm.xr-network.parameters.name" + }, + "constellationFrequency": { + "$ref": "#/components/schemas/cm.xr-network.parameters.constellationFrequency" + }, + "modulation": { + "$ref": "#/components/schemas/cm.xr-network.parameters.modulation" + } + }, + "type": "object" + }, + "cm.xr-network.hubModule": { + "$ref": "#/components/schemas/cm.xr-network.node" + }, + "cm.xr-network.leafModule": { + "$ref": "#/components/schemas/cm.xr-network.node" + }, + "cm.xr-network.leafModules": { + "description": "List of network connection endpoints", + "items": { + "$ref": "#/components/schemas/cm.xr-network.leafModule" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "leafModules" + } + }, + "cm.xr-network.reachableModule": { + "$ref": "#/components/schemas/cm.xr-network.node" + }, + "cm.xr-network.reachableModules": { + "description": "List of reachable modules of this network", + "items": { + "$ref": "#/components/schemas/cm.xr-network.reachableModule" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "reachableModules" + } + }, + "cm.xr-network.node": { + "description": "Definition of xr-network module object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "config": { + "$ref": "#/components/schemas/cm.xr-network.node.config" + }, + "state": { + "$ref": "#/components/schemas/cm.xr-network.node.state" + } + } + }, + "cm.xr-network.node.config": { + "additionalProperties": false, + "description": "Definition of constellation hub and leaf module configurable parameters", + "properties": { + "selector": { + "$ref": "#/components/schemas/cm.selectors.moduleSelector" + }, + "module": { + "$ref": "#/components/schemas/cm.xr-network.node.config.module" + } + }, + "type": "object" + }, + "cm.xr-network.node.config.module": { + "additionalProperties": false, + "description": "Definition of constellation hub and leaf module configurable parameters", + "properties": { + "trafficMode": { + "$ref": "#/components/schemas/cm.xr-network.node.module.parameters.trafficMode" + }, + "fiberConnectionMode": { + "$ref": "#/components/schemas/cm.xr-network.node.module.parameters.fiberConnectionMode" + }, + "maxAllowedDSCs": { + "$ref": "#/components/schemas/cm.xr-network.node.module.parameters.maxAllowedDSCs" + }, + "txPowerTargetPerDsc": { + "$ref": "#/components/schemas/cm.xr-network.node.module.parameters.txPowerTargetPerDsc" + } + }, + "type": "object" + }, + "cm.xr-network.node.state": { + "description": "Definition of constellation hub and leaf module state object", + "properties": { + "lifecycleState": { + "$ref": "#/components/schemas/cm.xr-network.node.parameters.lifecycleState" + }, + "lifecycleStateCause": { + "$ref": "#/components/schemas/cm.parameters.lifecycleStateCause" + }, + "discoveredTime": { + "$ref": "#/components/schemas/xr.discovered.neighbor.discoveredTime" + }, + "module": { + "$ref": "#/components/schemas/cm.xr-network.node.state.module" + }, + "endpoints": { + "$ref": "#/components/schemas/cm.xr-network.node.state.endpoints" + } + } + }, + "cm.xr-network.node.state.module": { + "description": "Definition of constellation hub and leaf module state parameters", + "properties": { + "moduleId": { + "$ref": "#/components/schemas/xr.device.di" + }, + "moduleName": { + "$ref": "#/components/schemas/xr.device.n" + }, + "macAddress": { + "$ref": "#/components/schemas/xr.platform.macAddress" + }, + "serialNumber": { + "$ref": "#/components/schemas/xr.platform.mnsel" + }, + "configuredRole": { + "$ref": "#/components/schemas/xr.configuration.configuredRole" + }, + "currentRole": { + "$ref": "#/components/schemas/xr.configuration.currentRole" + }, + "roleStatus": { + "$ref": "#/components/schemas/xr.configuration.roleStatus" + }, + "trafficMode": { + "$ref": "#/components/schemas/xr.configuration.trafficMode" + }, + "fiberConnectionMode": { + "$ref": "#/components/schemas/xr.configuration.fiberConnectionMode" + }, + "frequencyCtrl": { + "$ref": "#/components/schemas/xr.carrier.frequencyCtrl" + }, + "constellationFrequency": { + "$ref": "#/components/schemas/xr.carrier.constellationFrequency" + }, + "operatingFrequency": { + "$ref": "#/components/schemas/xr.carrier.operatingFrequency" + }, + "ncoFrequency": { + "$ref": "#/components/schemas/xr.carrier.ncoFrequency" + }, + "modulation": { + "$ref": "#/components/schemas/xr.carrier.modulation" + }, + "capacity": { + "$ref": "#/components/schemas/xr.carrier.capacity" + }, + "clientPortMode": { + "$ref": "#/components/schemas/xr.carrier.clientPortMode" + }, + "baudRate": { + "$ref": "#/components/schemas/xr.carrier.baudRate" + }, + "maxAllowedDSCs": { + "$ref": "#/components/schemas/cm.xr-network.node.module.parameters.maxAllowedDSCs" + }, + "txPowerTargetPerDsc": { + "$ref": "#/components/schemas/xr.carrier.txPowerTargetPerDsc" + } + }, + "type": "object" + }, + "cm.xr-network.node.state.endpoint": { + "description": "Result of module association", + "properties": { + "hostPort": { + "$ref": "#/components/schemas/cm.interface.hostPort" + }, + "moduleIf": { + "$ref": "#/components/schemas/cm.xr-network.node.state.endpoint.moduleIf" + } + }, + "type": "object" + }, + "cm.xr-network.node.state.endpoint.moduleIf": { + "description": "Definition of selector", + "properties": { + "clientIfColId": { + "$ref": "#/components/schemas/xr.ethernet.colId" + }, + "clientIfAid": { + "$ref": "#/components/schemas/xr.ethernet.aid" + }, + "clientIfPortSpeed": { + "$ref": "#/components/schemas/xr.ethernet.portSpeed" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "moduleIf" + } + }, + "cm.xr-network.node.state.endpoints": { + "description": "List of module client interfaces", + "items": { + "$ref": "#/components/schemas/cm.xr-network.node.state.endpoint" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "endpoints" + } + }, + "cm.xr-network.node.module.parameters.trafficMode": { + "description": "Possible Values:\n- L1Mode: Allows transparent transport of client traffic between XR hub and leaf module client ports\n- VTIMode: Allows transport of VLAN flows between an XR hub module client port to 1 or more XR leaf module client ports\n", + "enum": [ + "L1Mode", + "VTIMode" + ], + "title": "Traffic Mode", + "type": "string", + "x-enum-varnames": [ + "L1 mode", + "VTI mode" + ], + "x-oapi-codegen-extra-tags": { + "bson": "trafficMode" + } + }, + "cm.xr-network.node.module.parameters.fiberConnectionMode": { + "description": "Possible Values:\n- single: only one fiber is connected for by-directional traffic\n- dual: separate fibers for transmit and receive\n", + "enum": [ + "single", + "dual" + ], + "title": "Fiber Mode", + "type": "string", + "x-enum-varnames": [ + "Single", + "Dual" + ], + "x-oapi-codegen-extra-tags": { + "bson": "fiberConnectionMode" + } + }, + "cm.xr-network.node.module.parameters.maxAllowedDSCs": { + "description": "Number of digital subcarriers allowed to be used", + "enum": [ + 2, + 4, + 8, + 16 + ], + "title": "Max DSCs", + "type": "integer", + "x-enum-varnames": [ + "2", + "4", + "8", + "16" + ], + "x-oapi-codegen-extra-tags": { + "bson": "maxAllowedDSCs" + } + }, + "cm.xr-network.node.module.parameters.txPowerTargetPerDsc": { + "default": -100, + "description": "Target power per DSC.\nApplicable for all DSCs on the Carrier.\nValue \"-100 us\" used for \"Not configured\".\n", + "format": "double", + "maximum": 0, + "minimum": -100, + "multipleOf": 0.1, + "title": "Target power per DSC", + "type": "number", + "x-unit": "dBm", + "x-oapi-codegen-extra-tags": { + "bson": "txPowerTargetPerDsc" + } + }, + "cm.xr-network.node.parameters.lifecycleState": { + "description": "Provides the configuration status of a node within a network.\nPossible values:\n- 'pendingConfiguration': This state occurs when the module xr-network configuration is required.\n- 'configured': This state occurs when the module is configured in the network according to its xr-network requirements.\n- 'configurationFailed': This state occurs when the module xr-network configuration failed or timeout.\n- 'pendingDeletion': This state occurs when the module shall be removed from the current xr-network.\n- 'deletionFailed': This state occurs when the configuration to remove the module from the xr-network failed or timeout.\n- 'networkConflict': The current module configuration does not match the request or was already a member of other existing xr-network.\n- 'deleted': This state occurs when the current module is removed from the xr-network.\n", + "enum": [ + "pendingConfiguration", + "configured", + "configurationFailed", + "pendingDeletion", + "deletionFailed", + "networkConflict", + "deleted" + ], + "readOnly": true, + "title": "Lifecycle State", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "lifecycleState" + } + }, + "cm.xr-network.node.create": { + "additionalProperties": false, + "description": "Definition of constellation hub and leaf module creation parameters", + "properties": { + "selector": { + "$ref": "#/components/schemas/cm.selectors.moduleSelector" + }, + "module": { + "$ref": "#/components/schemas/cm.xr-network.node.module.create" + } + }, + "required": [ + "module", + "selector" + ], + "type": "object" + }, + "cm.xr-network.node.module.create": { + "additionalProperties": false, + "description": "Definition of constellation hub and leaf module creation parameters", + "properties": { + "trafficMode": { + "$ref": "#/components/schemas/cm.xr-network.node.module.parameters.trafficMode" + }, + "fiberConnectionMode": { + "$ref": "#/components/schemas/cm.xr-network.node.module.parameters.fiberConnectionMode" + }, + "maxAllowedDSCs": { + "$ref": "#/components/schemas/cm.xr-network.node.module.parameters.maxAllowedDSCs" + }, + "txPowerTargetPerDsc": { + "$ref": "#/components/schemas/cm.xr-network.node.module.parameters.txPowerTargetPerDsc" + } + }, + "required": [ + "trafficMode" + ], + "type": "object" + }, + "cm.xr-network.node.update": { + "properties": { + "module": { + "$ref": "#/components/schemas/cm.xr-network.node.module.update" + } + } + }, + "cm.xr-network.node.module.update": { + "additionalProperties": false, + "description": "Definition of constellation hub and leaf module editable parameters", + "minProperties": 1, + "properties": { + "trafficMode": { + "$ref": "#/components/schemas/cm.xr-network.node.module.parameters.trafficMode" + }, + "fiberConnectionMode": { + "$ref": "#/components/schemas/cm.xr-network.node.module.parameters.fiberConnectionMode" + }, + "maxAllowedDSCs": { + "$ref": "#/components/schemas/cm.xr-network.node.module.parameters.maxAllowedDSCs" + }, + "txPowerTargetPerDsc": { + "$ref": "#/components/schemas/cm.xr-network.node.module.parameters.txPowerTargetPerDsc" + } + }, + "type": "object" + }, + "cm.transport-capacity": { + "description": "Definition of transport-capacity object", + "example": { + "href": "/transport-capacities/6ce3aa86-2685-44b0-9f86-49e6a6c991a8", + "rt": [ + "cm.transport-capacity" + ], + "id": "6ce3aa86-2685-44b0-9f86-49e6a6c991a8", + "config": { + "name": "Transport capacity service example", + "capacityMode": "dedicatedDownlinkSymmetric" + }, + "state": { + "name": "Transport capacity service example", + "capacityMode": "dedicatedDownlinkSymmetric", + "lifecycleState": "configured", + "labels": [] + }, + "endpoints": [ + { + "href": "/transport-capacities/6ce3aa86-2685-44b0-9f86-49e6a6c991a8/endpoints/4511bc3d-617b-4757-9f4c-41bc7d8912eb", + "rt": [ + "cm.transport-capacity.hub" + ], + "id": "4511bc3d-617b-4757-9f4c-41bc7d8912eb", + "parentId": "6ce3aa86-2685-44b0-9f86-49e6a6c991a8", + "config": { + "capacity": 100, + "selector": { + "hostPortSelector": { + "chassisIdSubtype": "macAddress", + "chassisId": "28:c0:da:3e:3e:40", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/1:2" + } + } + }, + "state": { + "capacity": 100, + "hostPort": { + "chassisIdSubtype": "macAddress", + "chassisId": "28:c0:da:3e:3e:40", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0", + "portSourceMAC": "da:3d:c2:4c:55:40", + "portDescr": "et-1/0/0:0" + }, + "moduleIf": { + "moduleId": "18e47620-8848-4c7e-710f-05c668478c57", + "moduleName": "XR Device", + "moduleMAC": "46:00:84:A0:0C:00", + "moduleSerialNumber": "12345678900", + "moduleCurrentRole": "hub", + "moduleClientIfColId": 1, + "moduleClientIfAid": "XR T1", + "moduleClientIfPortSpeed": 100 + }, + "lifecycleState": "configured", + "labels": [] + } + }, + { + "href": "/transport-capacities/6ce3aa86-2685-44b0-9f86-49e6a6c991a8/endpoints/35e92b25-a682-4805-964a-6ce893a7aa56", + "rt": [ + "cm.transport-capacity.leaf" + ], + "id": "35e92b25-a682-4805-964a-6ce893a7aa56", + "parentId": "6ce3aa86-2685-44b0-9f86-49e6a6c991a8", + "config": { + "capacity": 100, + "selector": { + "hostPortSelector": { + "chassisIdSubtype": "macAddress", + "chassisId": "00:99:F8:2c:01:01", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0" + } + } + }, + "state": { + "capacity": 100, + "hostPort": { + "chassisIdSubtype": "macAddress", + "chassisId": "00:99:F8:2c:01:01", + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0", + "portSourceMAC": "da:3d:c2:4c:55:40", + "portDescr": "et-1/0/0:0" + }, + "moduleIf": { + "moduleId": "23ffd75e-1a30-11ec-9621-0242ac130002", + "moduleName": "XR Device", + "moduleMAC": "46:00:84:A0:0C:02", + "moduleSerialNumber": "12345678902", + "moduleCurrentRole": "Leaf", + "moduleClientIfColId": 2, + "moduleClientIfAid": "XR T1", + "moduleClientIfPortSpeed": 100 + }, + "lifecycleState": "configured", + "labels": [] + } + } + ], + "capacity-links": [ + { + "href": "/capacity-links/d9580972-7a72-43e7-91d9-5473251040ca", + "rt": [ + "cm.capacity-link" + ], + "id": "d9580972-7a72-43e7-91d9-5473251040ca", + "parentId": "6ce3aa86-2685-44b0-9f86-49e6a6c991a8", + "config": { + "directionality": "biDir", + "hubModule": { + "moduleId": "18e47620-8848-4c7e-710f-05c668478c57", + "dscgShared": false, + "dscs": [ + 7, + 5, + 3, + 1 + ] + }, + "leafModule": { + "moduleId": "23ffd75e-1a30-11ec-9621-0242ac130002", + "dscgShared": false, + "dscs": [ + 3, + 1, + 2, + 4 + ] + } + }, + "state": { + "directionality": "biDir", + "hubModule": { + "moduleId": "18e47620-8848-4c7e-710f-05c668478c57", + "dscgId": "552d4e35-c7fc-4fdf-bb31-1688f926582e", + "dscgShared": false, + "dscs": [ + 7, + 5, + 3, + 1 + ], + "lifecycleState": "configured" + }, + "leafModule": { + "moduleId": "23ffd75e-1a30-11ec-9621-0242ac130002", + "dscgId": "831884a0-fac7-4f1a-8c0d-74f82498921c", + "dscgShared": false, + "dscs": [ + 3, + 1, + 2, + 4 + ], + "lifecycleState": "configured" + } + } + } + ] + }, + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "config": { + "$ref": "#/components/schemas/cm.transport-capacity.config" + }, + "state": { + "$ref": "#/components/schemas/cm.transport-capacity.state" + }, + "endpoints": { + "$ref": "#/components/schemas/cm.transport-capacity.endpoints" + }, + "capacityLinks": { + "$ref": "#/components/schemas/cm.capacity-links" + } + }, + "type": "object" + }, + "cm.transport-capacity.config": { + "additionalProperties": false, + "description": "Definition of transport-capacity configurable parameters", + "properties": { + "name": { + "$ref": "#/components/schemas/cm.parameters.name" + }, + "capacityMode": { + "$ref": "#/components/schemas/cm.transport-capacity.parameters.capacityMode" + }, + "labels": { + "$ref": "#/components/schemas/cm.parameters.labels" + } + }, + "type": "object" + }, + "cm.transport-capacity.state": { + "description": "Definition of transport-capacity state parameters", + "properties": { + "name": { + "$ref": "#/components/schemas/cm.parameters.name" + }, + "createdBy": { + "$ref": "#/components/schemas/cm.transport-capacity.parameters.createdBy" + }, + "capacityMode": { + "$ref": "#/components/schemas/cm.transport-capacity.parameters.capacityMode" + }, + "lifecycleState": { + "$ref": "#/components/schemas/cm.transport-capacity.parameters.lifecycleState" + }, + "lifecycleStateCause": { + "$ref": "#/components/schemas/cm.parameters.lifecycleStateCause" + }, + "labels": { + "$ref": "#/components/schemas/cm.parameters.labels" + } + }, + "type": "object" + }, + "cm.transport-capacity.parameters.createdBy": { + "description": "Indicates whether transport-capacity orchestration should be done through CM interface or through Host interface\nPossible values: 'host', 'cm'\n- 'host': Created through host interface and discovered by CM\n Cannot be edited or deleted through CM interface\n- 'cm': Created through CM interface\n Can be edited or deleted through CM interface\n", + "enum": [ + "host", + "cm" + ], + "readOnly": true, + "title": "Created by", + "type": "string", + "x-enum-varnames": [ + "Host", + "IPM" + ], + "x-oapi-codegen-extra-tags": { + "bson": "createdBy" + } + }, + "cm.transport-capacity.parameters.capacityMode": { + "description": "Defines the traffic characteristics of the transport capacity service.\nPossible values:\n- 'portMode': Provides transparent transport between XR hub and leaf modules\n- 'dedicatedDownlinkSymmetric': VLAN based P2P bidirectional flow between Hub and a Leaf modules with symmetric upstream and downstream bandwidths.\n- 'dedicatedDownlinkAsymmetric': VLAN based P2P bidirectional flow between Hub and a Leaf modules with asymmetric upstream and downstream bandwidths.\n- 'sharedDownlink': VLAN based bidirectional flow between Hub and Leaf modules where downstream traffic (hub to leaf) can be shared by multiple Leaf modules (as in a P2MP).\n", + "enum": [ + "portMode", + "dedicatedDownlinkSymmetric", + "dedicatedDownlinkAsymmetric", + "sharedDownlink" + ], + "readOnly": true, + "title": "Capacity Mode", + "type": "string", + "x-enum-varnames": [ + "Port mode", + "Dedicated downlink Symmetric", + "Dedicated downlink asymmetric", + "Shared downlink" + ], + "x-oapi-codegen-extra-tags": { + "bson": "capacityMode" + } + }, + "cm.transport-capacity.parameters.lifecycleState": { + "description": "Provides the configuration status of a transport capacity connection (i.e., the aggregated status of its endpoints).\nPossible values:\n- 'pendingConfiguration': This state occurs when one of the transport capacity connection modules is pending configuration or pending deletion.\n- 'configured': This state occurs when all transport capacity connection modules are configured.\n- 'configurationFailed': This state may occur when at least a configuration of a module from this transport capacity connection failed or timeout.\n- 'pendingDeletion': This state may occur when a request to delete this transport capacity connection is being processed.\n- 'deletionFailed': This state may occur when at least a removal of a module from this transport capacity connection failed or timeout.\n- 'networkConflict': This state may occur when there is a conflict in a transport capacity connection module configuration.\n- 'deleted': This state occurs when a transport capacity connection is removed.\n", + "enum": [ + "pendingConfiguration", + "configured", + "configurationFailed", + "pendingDeletion", + "deletionFailed", + "networkConflict", + "deleted" + ], + "readOnly": true, + "title": "Lifecycle State", + "type": "string", + "x-enum-varnames": [ + "Pending configuration", + "Configured", + "Configuration failed", + "Pending deletion", + "Deletion failed", + "Network conflict", + "Deleted" + ], + "x-oapi-codegen-extra-tags": { + "bson": "lifecycleState" + } + }, + "cm.transport-capacity.createRequest": { + "additionalProperties": false, + "description": "Object used in the request body of POST requests in /transport-capacities endpoint.\nContains configuration parameters for transport-capacity and its ednpoint.\n", + "properties": { + "config": { + "$ref": "#/components/schemas/cm.transport-capacity.create" + }, + "endpoints": { + "items": { + "$ref": "#/components/schemas/cm.transport-capacity.endpoint.create" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + } + }, + "required": [ + "config", + "endpoints" + ], + "type": "object" + }, + "cm.transport-capacity.create": { + "additionalProperties": false, + "description": "Definition of transport-capacity creation parameters", + "properties": { + "name": { + "$ref": "#/components/schemas/cm.parameters.name" + }, + "capacityMode": { + "$ref": "#/components/schemas/cm.transport-capacity.parameters.capacityMode" + }, + "labels": { + "$ref": "#/components/schemas/cm.parameters.labels" + } + }, + "required": [ + "capacityMode" + ], + "type": "object" + }, + "cm.transport-capacity.update": { + "additionalProperties": false, + "description": "Definition of transport-capacity editable parameters", + "minProperties": 1, + "properties": { + "name": { + "$ref": "#/components/schemas/cm.parameters.name" + }, + "labels": { + "$ref": "#/components/schemas/cm.parameters.labels" + } + }, + "type": "object" + }, + "cm.transport-capacity.endpoint": { + "description": "Definition of transport-capacity endpoint object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "config": { + "$ref": "#/components/schemas/cm.transport-capacity.endpoint.config" + }, + "state": { + "$ref": "#/components/schemas/cm.transport-capacity.endpoint.state" + } + } + }, + "cm.transport-capacity.endpoints": { + "items": { + "$ref": "#/components/schemas/cm.transport-capacity.endpoint" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "endpoints" + } + }, + "cm.transport-capacity.endpoint.config": { + "additionalProperties": false, + "description": "Definition of transport-capacity endpoint configurable parameters", + "properties": { + "capacity": { + "$ref": "#/components/schemas/cm.transport-capacity.endpoint.parameters.capacity" + }, + "selector": { + "$ref": "#/components/schemas/cm.selectors.ifSelector" + } + }, + "type": "object" + }, + "cm.transport-capacity.endpoint.state": { + "description": "Definition of transport-capacity endpoint state parameters", + "properties": { + "capacity": { + "$ref": "#/components/schemas/cm.transport-capacity.endpoint.parameters.capacity" + }, + "hostPort": { + "$ref": "#/components/schemas/cm.interface.hostPort" + }, + "moduleIf": { + "$ref": "#/components/schemas/cm.interface.moduleIf" + }, + "lifecycleState": { + "$ref": "#/components/schemas/cm.transport-capacity.endpoint.parameters.lifecycleState" + }, + "lifecycleStateCause": { + "$ref": "#/components/schemas/cm.parameters.lifecycleStateCause" + } + }, + "type": "object" + }, + "cm.transport-capacity.endpoint.parameters.capacity": { + "description": "Client to network capacity of the infrastructure connection dscg", + "title": "Upstream bandwidth", + "type": "integer", + "x-unit": "Gbps", + "x-oapi-codegen-extra-tags": { + "bson": "capacity" + } + }, + "cm.transport-capacity.endpoint.parameters.lifecycleState": { + "description": "Provides the configuration status of a transport capacity endpoint.\nPossible values: \n- 'pendingConfiguration': This state occurs when the module transport capacity connection configuration is required.\n- 'configured': This state occurs when the module is configured in the network according to its transport capacity connection requirements.\n- 'configurationFailed': This state occurs when the module transport capacity connection configuration failed or timeout.\n- 'pendingDeletion': This state occurs when the module shall be removed from the current transport capacity connection.\n- 'deletionFailed': This state occurs when the configuration to remove the module from the transport capacity connection failed or timeout.\n- 'networkConflict': The current module is configured changed and no longer matches the transport capacity connection requirements.\n- 'deleted': This state occurs when the current module is removed from the xr-network.\n", + "enum": [ + "pendingConfiguration", + "configured", + "configurationFailed", + "pendingDeletion", + "deletionFailed", + "networkConflict", + "deleted" + ], + "readOnly": true, + "title": "Lifecycle State", + "type": "string", + "x-enum-varnames": [ + "Pending configuration", + "Configured", + "Configuration failed", + "Pending deletion", + "Deletion failed", + "Network conflict", + "Deleted" + ], + "x-oapi-codegen-extra-tags": { + "bson": "lifecycleState" + } + }, + "cm.transport-capacity.endpoint.create": { + "additionalProperties": false, + "description": "Definition of transport-capacity endpoint creation parameters", + "properties": { + "capacity": { + "$ref": "#/components/schemas/cm.transport-capacity.endpoint.parameters.capacity" + }, + "selector": { + "$ref": "#/components/schemas/cm.selectors.ifSelector" + } + }, + "required": [ + "selector" + ], + "type": "object" + }, + "cm.transport-capacity.endpoint.update": { + "additionalProperties": false, + "description": "Definition of transport-capacity endpoint editable parameters", + "minProperties": 1, + "properties": { + "capacity": { + "$ref": "#/components/schemas/cm.transport-capacity.endpoint.parameters.capacity" + } + }, + "required": [ + "capacity" + ], + "type": "object" + }, + "cm.capacity-link": { + "description": "Definition of capacity-link object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "config": { + "$ref": "#/components/schemas/cm.capacity-link.config" + }, + "state": { + "$ref": "#/components/schemas/cm.capacity-link.state" + } + }, + "type": "object" + }, + "cm.capacity-links": { + "items": { + "$ref": "#/components/schemas/cm.capacity-link" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "capacityLinks" + } + }, + "cm.capacity-link.config": { + "additionalProperties": false, + "description": "Definition of capacity-link configurable parameters", + "properties": { + "directionality": { + "$ref": "#/components/schemas/cm.capacity-link.parameters.directionality" + }, + "hubModule": { + "$ref": "#/components/schemas/cm.capacity-link.config.node" + }, + "leafModule": { + "$ref": "#/components/schemas/cm.capacity-link.config.node" + } + }, + "type": "object" + }, + "cm.capacity-link.config.node": { + "additionalProperties": false, + "description": "Definition of capacity-link hub module configurable parameters.", + "properties": { + "moduleId": { + "$ref": "#/components/schemas/cm.capacity-link.parameters.moduleId" + }, + "dscgShared": { + "$ref": "#/components/schemas/cm.capacity-link.parameters.dscgShared" + }, + "txDSCs": { + "$ref": "#/components/schemas/cm.capacity-link.parameters.txDSCs" + }, + "rxDSCs": { + "$ref": "#/components/schemas/cm.capacity-link.parameters.rxDSCs" + } + }, + "required": [ + "dscgMode", + "dscs", + "moduleId" + ], + "type": "object" + }, + "cm.capacity-link.state": { + "description": "Definition of capacity-link state parameters", + "properties": { + "directionality": { + "$ref": "#/components/schemas/cm.capacity-link.parameters.directionality" + }, + "hubModule": { + "$ref": "#/components/schemas/cm.capacity-link.state.hubModule" + }, + "leafModule": { + "$ref": "#/components/schemas/cm.capacity-link.state.leafModule" + }, + "lifecycleState": { + "$ref": "#/components/schemas/cm.capacity-link.parameters.lifecycleState" + }, + "lifecycleStateCause": { + "$ref": "#/components/schemas/cm.parameters.lifecycleStateCause" + } + }, + "type": "object" + }, + "cm.capacity-link.state.hubModule": { + "additionalProperties": false, + "description": "Definition of capacity-link hub module state parameters.", + "properties": { + "moduleId": { + "$ref": "#/components/schemas/xr.device.di" + }, + "dscgId": { + "$ref": "#/components/schemas/xr.carrier.dscg.id" + }, + "dscgAid": { + "$ref": "#/components/schemas/xr.carrier.dscg.aid" + }, + "dscgShared": { + "$ref": "#/components/schemas/cm.capacity-link.parameters.dscgShared" + }, + "txDSCs": { + "$ref": "#/components/schemas/cm.capacity-link.parameters.txDSCs" + }, + "rxDSCs": { + "$ref": "#/components/schemas/cm.capacity-link.parameters.rxDSCs" + }, + "lifecycleState": { + "$ref": "#/components/schemas/cm.capacity-link.parameters.lifecycleState" + }, + "lifecycleStateCause": { + "$ref": "#/components/schemas/cm.parameters.lifecycleStateCause" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "hubModule" + } + }, + "cm.capacity-link.state.leafModule": { + "additionalProperties": false, + "description": "Definition of capacity-link leaf module state parameters.", + "properties": { + "moduleId": { + "$ref": "#/components/schemas/xr.device.di" + }, + "dscgId": { + "$ref": "#/components/schemas/xr.carrier.dscg.id" + }, + "dscgAid": { + "$ref": "#/components/schemas/xr.carrier.dscg.aid" + }, + "dscgShared": { + "$ref": "#/components/schemas/cm.capacity-link.parameters.dscgShared" + }, + "txDSCs": { + "$ref": "#/components/schemas/cm.capacity-link.parameters.txDSCs" + }, + "rxDSCs": { + "$ref": "#/components/schemas/cm.capacity-link.parameters.rxDSCs" + }, + "lifecycleState": { + "$ref": "#/components/schemas/cm.capacity-link.parameters.lifecycleState" + }, + "lifecycleStateCause": { + "$ref": "#/components/schemas/cm.parameters.lifecycleStateCause" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "leafModule" + } + }, + "cm.capacity-link.parameters.moduleId": { + "description": "Module identifier", + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "title": "ID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "moduleId" + } + }, + "cm.capacity-link.parameters.directionality": { + "description": "Directionality of the capacity-link. \nuniDirUs: Refers to upstream direction from Leaf to Hub. \nuniDirDs: Refers to downstream traffic direction from Hub to Leaf.\n", + "enum": [ + "biDir", + "uniDirUs", + "uniDirDs" + ], + "title": "Directionality", + "type": "string", + "x-enum-varnames": [ + "Bidirectional", + "Unidirectional upstream", + "Unidirectional downstream" + ], + "x-oapi-codegen-extra-tags": { + "bson": "directionality" + } + }, + "cm.capacity-link.parameters.lifecycleState": { + "description": "Provides the configuration status of a capacity-link.\nPossible values:\n- 'pendingConfiguration': This state occurs when the hub or leaf module of the transport capacity connection is pending its DSCG configuration.\n- 'configured': This state occurs when there are matching DSCG configurations in the hub and leaf modules.\n- 'configurationFailed': This state may occur when the hub or leaf module DSCG configurations failed or timeout.\n- 'pendingDeletion': This state may occur when a request to delete a capacity-link is being processed.\n- 'deletionFailed': This state may occur when the configuration to remove a DSCG from the hub or leaf module failed or timeout.\n- 'networkConflict': This state may occur when there is a conflict in the hub or leaf module DSCG configurations.\n- 'deleted': This state occurs when a capacity-link is removed.\n", + "enum": [ + "pendingConfiguration", + "configured", + "configurationFailed", + "pendingDeletion", + "deletionFailed", + "networkConflict", + "deleted" + ], + "readOnly": true, + "title": "Lifecycle State", + "type": "string", + "x-enum-varnames": [ + "Pending configuration", + "Configured", + "Configuration failed", + "Pending deletion", + "Deletion failed", + "Network conflict", + "Deleted" + ], + "x-oapi-codegen-extra-tags": { + "bson": "lifecycleState" + } + }, + "cm.capacity-link.parameters.dscgShared": { + "description": "Indicates whether the dscg can be shared by multiple transport-capacity connection.\n'True' option is only applicable to hub module unidirectional downstream DSCGs\n", + "title": "Shared", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "dscgShared" + } + }, + "cm.capacity-link.parameters.txDSCs": { + "items": { + "type": "integer" + }, + "maxItems": 16, + "minItems": 0, + "type": "array", + "uniqueItems": true, + "x-oapi-codegen-extra-tags": { + "bson": "txDSCs" + } + }, + "cm.capacity-link.parameters.rxDSCs": { + "items": { + "type": "integer" + }, + "maxItems": 16, + "minItems": 0, + "type": "array", + "uniqueItems": true, + "x-oapi-codegen-extra-tags": { + "bson": "rxDSCs" + } + }, + "xr.controlplane.neighbor.sourceModuleId": { + "description": "Represents the source module device identifier of control-link.", + "readOnly": true, + "title": "Device identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "sourceModuleId" + } + }, + "xr.controlplane.neighbor.destinationModuleId": { + "description": "Represents the destimation module device identifier of control-link.", + "readOnly": true, + "title": "Device identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "destinationModuleId" + } + }, + "cm.selectors.moduleSelector": { + "description": "Definition of the parameters provided upon host creation used as matching criteria for discovered hosts", + "maxProperties": 1, + "minProperties": 1, + "properties": { + "moduleSelectorByModuleId": { + "$ref": "#/components/schemas/cm.selector.moduleSelectorByModuleId" + }, + "moduleSelectorByModuleName": { + "$ref": "#/components/schemas/cm.selector.moduleSelectorByModuleName" + }, + "moduleSelectorByModuleMAC": { + "$ref": "#/components/schemas/cm.selector.moduleSelectorByModuleMAC" + }, + "moduleSelectorByModuleSerialNumber": { + "$ref": "#/components/schemas/cm.selector.moduleSelectorByModuleSerialNumber" + }, + "hostPortSelectorByName": { + "$ref": "#/components/schemas/cm.selector.hostPortSelectorByName" + }, + "hostPortSelectorByPortId": { + "$ref": "#/components/schemas/cm.selector.hostPortSelectorByPortId" + }, + "hostPortSelectorBySysName": { + "$ref": "#/components/schemas/cm.selector.hostPortSelectorBySysName" + }, + "hostPortSelectorByPortSourceMAC": { + "$ref": "#/components/schemas/cm.selector.hostPortSelectorByPortSourceMAC" + } + }, + "title": "Host Selector", + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "selector" + } + }, + "cm.selector.moduleSelectorByModuleId": { + "additionalProperties": false, + "description": "Definition of module selector based on module Id information", + "maxProperties": 1, + "minProperties": 1, + "properties": { + "moduleId": { + "$ref": "#/components/schemas/cm.selector.moduleSelector.parameters.moduleId" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "moduleSelectorByModuleId" + } + }, + "cm.selector.moduleSelectorByModuleName": { + "additionalProperties": false, + "description": "Definition of port selector based on module aid information", + "maxProperties": 1, + "minProperties": 1, + "properties": { + "moduleName": { + "$ref": "#/components/schemas/cm.selector.moduleSelector.parameters.moduleName" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "moduleSelectorByModuleName" + } + }, + "cm.selector.moduleSelectorByModuleMAC": { + "additionalProperties": false, + "description": "Definition of module selector based on mac address information", + "maxProperties": 1, + "minProperties": 1, + "properties": { + "moduleMAC": { + "$ref": "#/components/schemas/cm.selector.moduleSelector.parameters.moduleMAC" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "moduleSelectorByModuleMAC" + } + }, + "cm.selector.moduleSelectorByModuleSerialNumber": { + "additionalProperties": false, + "description": "Definition of module selector based on module serial number information", + "maxProperties": 1, + "minProperties": 1, + "properties": { + "moduleSerialNumber": { + "$ref": "#/components/schemas/cm.selector.moduleSelector.parameters.moduleSerialNumber" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "moduleSelectorByModuleSerialNumber" + } + }, + "xr.carrier.dscg.id": { + "description": "DSCG Object identifier", + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "readOnly": true, + "title": "DSCG ID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "dscgId" + } + }, + "cm.subscription": { + "description": "Subscription data", + "properties": { + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "subscriptionId": { + "$ref": "#/components/schemas/cm.subscription.parameters.subscriptionId" + }, + "subscriptionName": { + "$ref": "#/components/schemas/cm.subscription.parameters.subscriptionName" + }, + "notificationChannel": { + "$ref": "#/components/schemas/cm.subscription.notificationChannel" + }, + "subscriptionFilters": { + "$ref": "#/components/schemas/cm.subscription.subscriptionFilters" + }, + "conState": { + "$ref": "#/components/schemas/cm.subscription.parameters.conState" + }, + "lastConnectionTime": { + "$ref": "#/components/schemas/cm.subscription.parameters.lastConnectionTime" + } + }, + "title": "Subscription", + "type": "object" + }, + "cm.subscription.notificationChannel": { + "description": "Definition of subscription notification-channel", + "properties": { + "streamAddress": { + "$ref": "#/components/schemas/cm.subscription.parameters.notificationChannel.streamAddress" + } + }, + "title": "Notification Channel", + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "notificationChannel" + } + }, + "cm.subscription.subscriptionFilters": { + "description": "List of subscription-filters", + "items": { + "$ref": "#/components/schemas/cm.subscription.subscriptionFilter" + }, + "minItems": 1, + "title": "Subscription Filters", + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "subscriptionFilters" + } + }, + "cm.subscription.subscriptionFilter": { + "description": "Definition of subscription-filters", + "properties": { + "requestedNotificationTypes": { + "$ref": "#/components/schemas/cm.subscription.parameters.subscriptionFilter.requestedNotificationTypes" + }, + "requestedResources": { + "$ref": "#/components/schemas/cm.subscription.subscriptionFilter.requestedResources" + } + }, + "title": "Subscription Filter", + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "subscriptionFilter" + } + }, + "cm.subscription.subscriptionFilter.requestedResources": { + "description": "Required resource types to be available in the notification channel with optional filter by resource ids and/or moduleIds", + "items": { + "$ref": "#/components/schemas/cm_subscription_subscriptionFilter_requestedResources_inner" + }, + "minItems": 1, + "title": "Resource Types", + "type": "array", + "uniqueItems": true + }, + "cm.subscription.parameters.subscriptionId": { + "description": "Universally unique identifier (UUID) of a subscription.", + "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$", + "readOnly": true, + "title": "UUID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "subscriptionId" + } + }, + "cm.subscription.parameters.subscriptionName": { + "description": "User defined subscription name.", + "title": "Name", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "subscriptionName" + } + }, + "cm.subscription.parameters.conState": { + "description": "Shows if the subscription is currently active or not", + "enum": [ + "active", + "inactive" + ], + "readOnly": true, + "title": "Connection Status", + "type": "string", + "x-enum-varnames": [ + "Active", + "Inactive" + ], + "x-oapi-codegen-extra-tags": { + "bson": "conState" + } + }, + "cm.subscription.parameters.lastConnectionTime": { + "description": "Timestamp of last connectivity in date-time format pattern according to IETF RFC 3339.\nIf subscription is inactive, this timestamp shows when connectivity was lost.\nIf subscription is active this timestamp shows when connection was established.\n", + "format": "date-time", + "readOnly": true, + "title": "Connection Time", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "lastConnectionTime" + } + }, + "cm.subscription.parameters.notificationChannel.streamAddress": { + "description": "WebSocket URI made available upon subscription creation", + "readOnly": true, + "title": "WebSocket URI", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "streamAddress" + } + }, + "cm.subscription.parameters.subscriptionFilter.requestedNotificationTypes": { + "description": "Required notification types to be available in the notification channel\n- OC: Object Creation\n- OD: Object Deletion\n- AVC: Attribute Value Change\n- ERROR: Error notifications\n", + "items": { + "enum": [ + "OC", + "OD", + "AVC", + "Error" + ], + "type": "string", + "x-enum-varnames": [ + "OC", + "OD", + "AVC", + "Error" + ] + }, + "minItems": 1, + "title": "Notification Types", + "type": "array", + "uniqueItems": true, + "x-oapi-codegen-extra-tags": { + "bson": "requestedNotificationTypes" + } + }, + "cm.subscription.parameters.subscriptionFilter.requestedResources.resourceType": { + "description": "Required resource types to be available in the notification channel\nResource types are identified by the 'rt' link in the resource object\n", + "enum": [ + "cm.device", + "cm.host", + "cm.host.port", + "cm.module", + "cm.module.linePtp", + "cm.module.linePtp.carrier", + "cm.module.linePtp.carrier.dscg", + "cm.module.linePtp.carrier.dsc", + "cm.module.otu", + "cm.module.odu", + "cm.module.ethernetClient", + "cm.module.localConnection", + "cm.transport-capacity", + "cm.transport-capacity.endpoint", + "cm.capacity-link", + "cm.network-connection", + "cm.network-connection.endpoint", + "cm.network-connection.local-connection", + "cm.xr-network", + "cm.xr-network.hubModule", + "cm.xr-network.leafModule", + "cm.xr-network.reachableModule", + "cm.sw.action", + "cm.sw.moduleAction", + "cm.sw.ctrl", + "cm.sw.bank" + ], + "title": "Resource Type", + "type": "string", + "x-enum-varnames": [ + "cm.device", + "cm.host", + "cm.host.port", + "cm.module", + "cm.module.linePtp", + "cm.module.linePtp.carrier", + "cm.module.linePtp.carrier.dscg", + "cm.module.linePtp.carrier.dsc", + "cm.module.otu", + "cm.module.odu", + "cm.module.ethernetClient", + "cm.module.localConnection", + "cm.transport-capacity", + "cm.transport-capacity.endpoint", + "cm.capacity-link", + "cm.network-connection", + "cm.network-connection.endpoint", + "cm.network-connection.local-connection", + "cm.xr-network", + "cm.xr-network.hubModule", + "cm.xr-network.leafModule", + "cm.xr-network.reachableModule", + "cm.sw.action", + "cm.sw.moduleAction", + "cm.sw.ctrl", + "cm.sw.bank" + ], + "x-oapi-codegen-extra-tags": { + "bson": "resourceType" + } + }, + "cm.subscription.parameters.subscriptionFilter.requestedResources.ids": { + "description": "Required resource ids (with type defined in resourceType) to be available in the notification channel", + "items": { + "type": "string" + }, + "minItems": 1, + "title": "Resource Ids", + "type": "array", + "uniqueItems": true, + "x-oapi-codegen-extra-tags": { + "bson": "ids" + } + }, + "cm.subscription.parameters.subscriptionFilter.requestedResources.moduleIds": { + "description": "Required device ids (di property) within the defined resourceType (i.e. resource type containing the device ids) to be available in the notification channel", + "items": { + "type": "string" + }, + "minItems": 1, + "title": "Device Ids", + "type": "array", + "uniqueItems": true, + "x-oapi-codegen-extra-tags": { + "bson": "moduleIds" + } + }, + "cm.subscription.parameters.subscriptionFilter.requestedResources.hrefs": { + "description": "Required HREFs to be available in the notification channel.\nNote that this filter definition supports regex.\n", + "items": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "minItems": 1, + "title": "HREFs", + "type": "array", + "uniqueItems": true, + "x-oapi-codegen-extra-tags": { + "bson": "hrefs" + } + }, + "cm.subscription.request": { + "additionalProperties": false, + "description": "Subscription creation request body content", + "properties": { + "subscriptionName": { + "$ref": "#/components/schemas/cm.subscription.parameters.subscriptionName" + }, + "subscriptionFilters": { + "items": { + "$ref": "#/components/schemas/cm.subscription.subscriptionFilter" + }, + "minItems": 1, + "type": "array" + } + }, + "title": "Subscription request body content", + "type": "object" + }, + "cm.subscription.response": { + "description": "Subscription creation response body content", + "properties": { + "subscriptionId": { + "$ref": "#/components/schemas/cm.subscription.parameters.subscriptionId" + }, + "notificationChannel": { + "$ref": "#/components/schemas/cm.subscription.notificationChannel" + } + }, + "title": "Subscription response body content", + "type": "object" + }, + "cm_subscription_subscriptionFilter_requestedResources_inner": { + "properties": { + "resourceType": { + "$ref": "#/components/schemas/cm.subscription.parameters.subscriptionFilter.requestedResources.resourceType" + }, + "ids": { + "$ref": "#/components/schemas/cm.subscription.parameters.subscriptionFilter.requestedResources.ids" + }, + "moduleIds": { + "$ref": "#/components/schemas/cm.subscription.parameters.subscriptionFilter.requestedResources.moduleIds" + }, + "hrefs": { + "$ref": "#/components/schemas/cm.subscription.parameters.subscriptionFilter.requestedResources.hrefs" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "requestedResources" + } + }, + "cm.host": { + "description": "Definition of host object", + "example": { + "href": "/hosts/d9672ef1-ddc1-cd6b-3c77-ea86b442545a", + "rt": [ + "cm.host" + ], + "id": "d9672ef1-ddc1-cd6b-3c77-ea86b442545a", + "config": { + "name": "Sunnyvale Router 001", + "managedBy": "CM", + "location": { + "latitude": 20, + "longitude": 134.1 + }, + "selector": { + "hostSelectorByChassisId": { + "chassisIdSubtype": "macAddress", + "chassisId": "28:c0:da:3e:3e:40" + } + }, + "labels": { + "region": "West Coast", + "city": "Sunnyvale" + } + }, + "state": { + "name": "Sunnyvale Router 001", + "chassisIdSubtype": "macAddress", + "chassisId": "28:c0:da:3e:3e:40", + "sysName": "Vendor A Router", + "sysDescr": "", + "lldpState": "Present", + "managedBy": "CM", + "location": { + "latitude": 20, + "longitude": 134.1 + }, + "labels": { + "region": "West Coast", + "city": "Sunnyvale" + } + }, + "ports": [ + { + "href": "/hosts/d9672ef1-ddc1-cd6b-3c77-ea86b442545a/ports/5f8c47b4-c02a-6242-260c-185dd04b8faf", + "rt": [ + "cm.host.port" + ], + "id": "d9672ef1-ddc1-cd6b-3c77-ea86b442545a/ports/5f8c47b4-c02a-6242-260c-185dd04b8faf", + "config": { + "managedBy": "CM", + "selector": { + "ifSelectorByHostPortSourceMAC": { + "portSourceMAC": "28:c0:da:3e:3e:44" + } + }, + "labels": { + "region": "West Coast", + "city": "Sunnyvale" + } + }, + "state": { + "name": "towards San Jose", + "managedBy": "CM", + "lldpState": "Present", + "hostPort": { + "portIdSubtype": "interfaceName", + "portId": "et-1/0/0:0", + "portSourceMAC": "28:c0:da:3e:3e:44" + }, + "moduleIf": { + "moduleId": "aa079e7c-02df-43ed-636e-71f7bfc212ff", + "moduleName": "Sunnyvale-1/0/0", + "macAddress": "00:0B:F8:00:01:01", + "serialNumber": "12345678901", + "clientIfAid": "XR-T1" + }, + "labels": { + "region": "West Coast", + "city": "Sunnyvale" + } + } + }, + { + "href": "/hosts/d9672ef1-ddc1-cd6b-3c77-ea86b442545a/ports/4868c57e-0f4f-11ec-82a8-0242ac130003", + "rt": [ + "cm.host.port" + ], + "id": "4868c57e-0f4f-11ec-82a8-0242ac130003", + "config": { + "name": "towards Santa Clara", + "managedBy": "CM", + "selector": { + "ifSelectorByModuleMAC": { + "moduleMAC": "00:0B:F8:00:01:01", + "clientIfAid": "XR-T1" + } + }, + "labels": { + "region": "West Coast", + "city": "Sunnyvale" + } + }, + "state": { + "name": "towards Santa Clara", + "managedBy": "Host", + "lldpState": "Present", + "hostPort": { + "portIdSubtype": "interfaceName", + "portId": "et-1/0/2:0", + "portSourceMAC": "58:00:BB:00:00:12" + }, + "moduleIf": { + "moduleId": "4e58f211-oa575-41ae-65d6-54fbeba5a2fe", + "moduleName": "Sunnyvale-1/0/2", + "macAddress": "00:0B:F8:00:01:01", + "serialNumber": "12345678901", + "clientIfAid": "XR-T2" + }, + "labels": { + "region": "West Coast", + "city": "Sunnyvale" + } + } + } + ] + }, + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "config": { + "$ref": "#/components/schemas/cm.host.config" + }, + "state": { + "$ref": "#/components/schemas/cm.host.state" + }, + "ports": { + "$ref": "#/components/schemas/cm.host.ports" + } + } + }, + "cm.host.config": { + "additionalProperties": false, + "description": "Configurable host parameters", + "properties": { + "name": { + "$ref": "#/components/schemas/cm.parameters.name" + }, + "managedBy": { + "$ref": "#/components/schemas/cm.host.parameters.managedBy" + }, + "location": { + "$ref": "#/components/schemas/cm.parameters.location" + }, + "selector": { + "$ref": "#/components/schemas/cm.selectors.hostSelector" + }, + "labels": { + "$ref": "#/components/schemas/cm.parameters.labels" + } + }, + "type": "object" + }, + "cm.host.state": { + "description": "Definition of host state parameters", + "properties": { + "name": { + "$ref": "#/components/schemas/cm.parameters.name" + }, + "chassisIdSubtype": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.chassisIdSubtype" + }, + "chassisId": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.chassisId" + }, + "sysName": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.sysName" + }, + "sysDescr": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.sysDescr" + }, + "lldpState": { + "$ref": "#/components/schemas/cm.host.parameters.lldpState" + }, + "managedBy": { + "$ref": "#/components/schemas/cm.host.parameters.managedBy" + }, + "location": { + "$ref": "#/components/schemas/cm.parameters.location" + }, + "labels": { + "$ref": "#/components/schemas/cm.parameters.labels" + } + }, + "type": "object" + }, + "cm.host.parameters.lldpState": { + "description": "Represents the consolidated LLDP state of the XR modules in the host.\nPossible Values:\n- 'Pending': Applicable for pre-planned scenarios when the host port is not yet discovered from an XR module or there is no XR module associated to the host.\n- 'NotPresent': Applicable when the XR module is not reporting host LLDP information.\n- 'Present': Applicable when the XR module is reporting host LLDP information.\n- 'Unknown': Applicable when the XR module is in 'Offline' state\nNote that the information presented for hosts with 'Unknown' state refers to the last known host information.\n", + "enum": [ + "Pending", + "Present", + "Unknown", + "NotPresent" + ], + "readOnly": true, + "title": "State", + "type": "string", + "x-enum-varnames": [ + "Pending", + "Present", + "Unknown", + "Not present" + ], + "x-oapi-codegen-extra-tags": { + "bson": "lldpState" + } + }, + "cm.host.parameters.managedBy": { + "description": "Defines the ownership of the object.\nPossible values: 'Host', 'CM'\n- Host: Applicable to discovered objects that are automaticcaly created / deleted based on Host reported information.\n- CM: Applicable to pre-planned objects or objects with exising depondencies (e.g. host ports used in a service with the respective host selector).\n", + "enum": [ + "Host", + "CM" + ], + "title": "Managed by", + "type": "string", + "x-enum-varnames": [ + "Host", + "CM" + ], + "x-oapi-codegen-extra-tags": { + "bson": "managedBy" + } + }, + "cm.host.create": { + "additionalProperties": false, + "description": "Host creation parameters", + "properties": { + "name": { + "$ref": "#/components/schemas/cm.parameters.name" + }, + "managedBy": { + "$ref": "#/components/schemas/cm.host.parameters.managedBy" + }, + "location": { + "$ref": "#/components/schemas/cm.parameters.location" + }, + "selector": { + "$ref": "#/components/schemas/cm.selectors.hostSelector" + }, + "labels": { + "$ref": "#/components/schemas/cm.parameters.labels" + } + }, + "required": [ + "selector" + ], + "type": "object" + }, + "cm.host.update": { + "additionalProperties": false, + "description": "Editable host parameters", + "minProperties": 1, + "properties": { + "name": { + "$ref": "#/components/schemas/cm.parameters.name" + }, + "managedBy": { + "$ref": "#/components/schemas/cm.host.parameters.managedBy" + }, + "location": { + "$ref": "#/components/schemas/cm.parameters.location" + }, + "labels": { + "$ref": "#/components/schemas/cm.parameters.labels" + } + }, + "type": "object" + }, + "cm.host.port": { + "description": "Definition of host port object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "config": { + "$ref": "#/components/schemas/cm.host.port.config" + }, + "state": { + "$ref": "#/components/schemas/cm.host.port.state" + } + } + }, + "cm.host.ports": { + "description": "List of host ports", + "items": { + "$ref": "#/components/schemas/cm.host.port" + }, + "type": "array" + }, + "cm.host.port.config": { + "additionalProperties": false, + "description": "Definition of host port configurable parameters", + "properties": { + "name": { + "$ref": "#/components/schemas/cm.parameters.name" + }, + "managedBy": { + "$ref": "#/components/schemas/cm.host.parameters.managedBy" + }, + "selector": { + "$ref": "#/components/schemas/cm.selectors.ifSelector" + }, + "labels": { + "$ref": "#/components/schemas/cm.parameters.labels" + } + }, + "type": "object" + }, + "cm.host.port.state": { + "description": "Definition of host port state object", + "properties": { + "name": { + "$ref": "#/components/schemas/cm.parameters.name" + }, + "hostName": { + "$ref": "#/components/schemas/cm.parameters.hostName" + }, + "chassisIdSubtype": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.chassisIdSubtype" + }, + "chassisId": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.chassisId" + }, + "sysName": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.sysName" + }, + "portIdSubtype": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.portIdSubtype" + }, + "portId": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.portId" + }, + "portSourceMAC": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.localPortSourceMAC" + }, + "portDescr": { + "$ref": "#/components/schemas/xr.ethernet.neighbor.portDescr" + }, + "managedBy": { + "$ref": "#/components/schemas/cm.host.parameters.managedBy" + }, + "lldpState": { + "$ref": "#/components/schemas/cm.host.port.parameters.lldpState" + }, + "moduleIf": { + "$ref": "#/components/schemas/cm.interface.moduleIf" + }, + "labels": { + "$ref": "#/components/schemas/cm.parameters.labels" + } + }, + "type": "object" + }, + "cm.host.port.parameters.lldpState": { + "description": "Represents the consolidated LLDP state of the XR modules in the host.\nPossible Values:\n- Pending: Applicable for pre-planned scenarios when the host port is not yet discovered from an XR module\n- NotPresent: Applicable when the XR module is not reporting host LLDP information.\n- Present: Applicable when the XR module is reporting host LLDP information.\n- Unknown: Applicable when the XR module is in 'Offline' state or there is no XR module associated to the host.\nNote that the information presented for hosts with 'Unknown' state refers to the last known host information.\n", + "enum": [ + "Pending", + "Present", + "Unknown", + "NotPresent" + ], + "readOnly": true, + "title": "State", + "type": "string", + "x-enum-varnames": [ + "Pending", + "Present", + "Unknown", + "Not present" + ], + "x-oapi-codegen-extra-tags": { + "bson": "lldpState" + } + }, + "cm.host.port.create": { + "additionalProperties": false, + "description": "Host port creation parameters", + "properties": { + "name": { + "$ref": "#/components/schemas/cm.parameters.name" + }, + "managedBy": { + "$ref": "#/components/schemas/cm.host.parameters.managedBy" + }, + "selector": { + "$ref": "#/components/schemas/cm.selectors.ifSelector" + }, + "labels": { + "$ref": "#/components/schemas/cm.parameters.labels" + } + }, + "required": [ + "selector" + ], + "type": "object" + }, + "cm.host.port.update": { + "additionalProperties": false, + "description": "Definition of host port editable parameters", + "minProperties": 1, + "properties": { + "name": { + "$ref": "#/components/schemas/cm.parameters.name" + }, + "managedBy": { + "$ref": "#/components/schemas/cm.host.parameters.managedBy" + }, + "labels": { + "$ref": "#/components/schemas/cm.parameters.labels" + } + }, + "type": "object" + }, + "cm.parameters.location": { + "description": "Geographic coordinates in decimal degree.\n", + "properties": { + "latitude": { + "format": "double", + "maximum": 90, + "minimum": -90, + "title": "Latitude", + "type": "number", + "x-oapi-codegen-extra-tags": { + "bson": "latitude" + } + }, + "longitude": { + "format": "double", + "maximum": 180, + "minimum": -180, + "title": "Longitude", + "type": "number", + "x-oapi-codegen-extra-tags": { + "bson": "longitude" + } + } + }, + "title": "Location", + "type": "object" + }, + "cm.selectors.hostSelector": { + "description": "Definition of the parameters provided upon host creation used as matching criteria for discovered hosts", + "maxProperties": 1, + "minProperties": 1, + "properties": { + "hostSelectorByHostChassisId": { + "$ref": "#/components/schemas/cm.selector.hostSelectorByChassisId" + }, + "moduleSelectorByModuleId": { + "$ref": "#/components/schemas/cm.selector.moduleSelectorByModuleId" + }, + "moduleSelectorByModuleName": { + "$ref": "#/components/schemas/cm.selector.moduleSelectorByModuleName" + }, + "moduleSelectorByModuleMAC": { + "$ref": "#/components/schemas/cm.selector.moduleSelectorByModuleMAC" + }, + "moduleSelectorByModuleSerialNumber": { + "$ref": "#/components/schemas/cm.selector.moduleSelectorByModuleSerialNumber" + } + }, + "title": "Host Selector", + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "selector" + } + }, + "cm.selector.hostSelectorByChassisId": { + "additionalProperties": false, + "description": "Definition of host selector based on chassisId information", + "maxProperties": 2, + "minProperties": 2, + "properties": { + "chassisIdSubtype": { + "$ref": "#/components/schemas/cm.selector.hostSelector.parameters.chassisIdSubtype" + }, + "chassisId": { + "$ref": "#/components/schemas/cm.selector.hostSelector.parameters.chassisId" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "hostSelectorByChassisId" + } + }, + "cm.ndu": { + "description": "Definition of ndu object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "config": { + "$ref": "#/components/schemas/cm.ndu.config" + }, + "state": { + "$ref": "#/components/schemas/cm.ndu.state" + }, + "ports": { + "$ref": "#/components/schemas/cm.ndu.ports" + }, + "linePtps": { + "$ref": "#/components/schemas/cm.ndu.linePtps" + }, + "tribPtps": { + "$ref": "#/components/schemas/cm.ndu.tribPtps" + }, + "otus": { + "$ref": "#/components/schemas/cm.ndu.otus" + }, + "ethernetClients": { + "$ref": "#/components/schemas/cm.ndu.ethernetClients" + }, + "trails": { + "$ref": "#/components/schemas/cm.ndu.trails" + }, + "fans": { + "$ref": "#/components/schemas/cm.ndu.fans" + }, + "pem": { + "$ref": "#/components/schemas/cm.ndu.pem" + }, + "leds": { + "$ref": "#/components/schemas/cm.ndu.leds" + } + } + }, + "cm.ndu.config": { + "additionalProperties": false, + "description": "Definition of module configurable parameters", + "properties": { + "name": { + "$ref": "#/components/schemas/cm.ndu.parameters.name" + }, + "location": { + "$ref": "#/components/schemas/cm.ndu.config.location" + }, + "contact": { + "$ref": "#/components/schemas/ndu.configuration.contact" + }, + "managedBy": { + "$ref": "#/components/schemas/ndu.configuration.mgmtMode" + }, + "labels": { + "$ref": "#/components/schemas/cm.parameters.labels" + } + }, + "type": "object" + }, + "cm.ndu.config.location": { + "additionalProperties": false, + "description": "Location parameter", + "minProperties": 1, + "properties": { + "description": { + "$ref": "#/components/schemas/ndu.configuration.neLocation" + }, + "clli": { + "$ref": "#/components/schemas/ndu.configuration.clli" + }, + "latitude": { + "$ref": "#/components/schemas/ndu.configuration.latitude" + }, + "longitude": { + "$ref": "#/components/schemas/ndu.configuration.longitude" + }, + "altitude": { + "$ref": "#/components/schemas/ndu.configuration.altitude" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "location" + } + }, + "cm.ndu.state": { + "description": "Definition of module state object", + "properties": { + "name": { + "$ref": "#/components/schemas/ndu.device.n" + }, + "nduAid": { + "$ref": "#/components/schemas/ndu.device.aid" + }, + "location": { + "$ref": "#/components/schemas/cm.ndu.config.location" + }, + "contact": { + "$ref": "#/components/schemas/ndu.configuration.contact" + }, + "managedBy": { + "$ref": "#/components/schemas/ndu.configuration.mgmtMode" + }, + "labels": { + "$ref": "#/components/schemas/cm.parameters.labels" + }, + "connectivityState": { + "$ref": "#/components/schemas/cm.ndu.parameters.connectivityState" + }, + "hwDescription": { + "$ref": "#/components/schemas/cm.ndu.state.hwDescription" + } + } + }, + "cm.ndu.state.hwDescription": { + "description": "Definition of module platform properties", + "properties": { + "pi": { + "$ref": "#/components/schemas/ndu.platform.pi" + }, + "mnfv": { + "$ref": "#/components/schemas/ndu.platform.mnfv" + }, + "mnmn": { + "$ref": "#/components/schemas/ndu.platform.mnmn" + }, + "mnmo": { + "$ref": "#/components/schemas/ndu.platform.mnmo" + }, + "mnhw": { + "$ref": "#/components/schemas/ndu.platform.mnhw" + }, + "mndt": { + "$ref": "#/components/schemas/ndu.platform.mndt" + }, + "serialNumber": { + "$ref": "#/components/schemas/ndu.platform.mnsel" + }, + "clei": { + "$ref": "#/components/schemas/ndu.platform.clei" + }, + "macAddress": { + "$ref": "#/components/schemas/ndu.platform.macAddress" + }, + "piid": { + "$ref": "#/components/schemas/ndu.device.piid" + }, + "dmn": { + "$ref": "#/components/schemas/ndu.device.dmn" + }, + "sv": { + "$ref": "#/components/schemas/ndu.device.sv" + }, + "icv": { + "$ref": "#/components/schemas/ndu.device.icv" + } + }, + "x-oapi-codegen-extra-tags": { + "bson": "hwDescription" + } + }, + "cm.ndu.parameters.name": { + "description": "Property to change the NDU name. \nThis is also reflected in the same property in oic.wk.d\n", + "maxLength": 64, + "title": "NDU name", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "name" + } + }, + "cm.ndu.parameters.connectivityState": { + "description": "The CM connectivity state between the CM and the device.", + "enum": [ + "active", + "inactive" + ], + "title": "Connectivity state", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "connectivityState" + } + }, + "cm.ndu.update": { + "additionalProperties": false, + "description": "Definition of ndu editable parameters", + "minProperties": 1, + "properties": { + "name": { + "$ref": "#/components/schemas/cm.ndu.parameters.name" + }, + "location": { + "$ref": "#/components/schemas/cm.ndu.config.location" + }, + "contact": { + "$ref": "#/components/schemas/ndu.configuration.contact" + }, + "managedBy": { + "$ref": "#/components/schemas/ndu.configuration.mgmtMode" + }, + "labels": { + "$ref": "#/components/schemas/cm.parameters.labels" + } + }, + "type": "object" + }, + "cm.ndu.port": { + "description": "Definition of NDU port object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/ndu.colId" + }, + "config": { + "$ref": "#/components/schemas/cm.ndu.port.config" + }, + "state": { + "$ref": "#/components/schemas/cm.ndu.port.state" + }, + "toms": { + "$ref": "#/components/schemas/cm.ndu.port.toms" + }, + "xrs": { + "$ref": "#/components/schemas/cm.ndu.port.xrs" + }, + "edfas": { + "$ref": "#/components/schemas/cm.ndu.port.edfas" + }, + "voas": { + "$ref": "#/components/schemas/cm.ndu.port.voas" + } + } + }, + "cm.ndu.ports": { + "items": { + "$ref": "#/components/schemas/cm.ndu.port" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "ports" + } + }, + "cm.ndu.port.config": { + "additionalProperties": false, + "description": "Definition of ndu port configurable parameters", + "properties": { + "name": { + "$ref": "#/components/schemas/ndu.port.label" + }, + "connectedTo": { + "$ref": "#/components/schemas/ndu.port.connectedTo" + }, + "externalConnectivity": { + "$ref": "#/components/schemas/ndu.port.externalConnectivity" + } + }, + "type": "object" + }, + "cm.ndu.port.state": { + "description": "Definition of ndu port state object", + "properties": { + "portAid": { + "$ref": "#/components/schemas/ndu.port.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/ndu.port.parentAid" + }, + "name": { + "$ref": "#/components/schemas/ndu.port.label" + }, + "category": { + "$ref": "#/components/schemas/ndu.port.portType" + }, + "supportedTypes": { + "$ref": "#/components/schemas/ndu.port.supportedType" + }, + "installedType": { + "$ref": "#/components/schemas/ndu.port.installedType" + }, + "connectedTo": { + "$ref": "#/components/schemas/ndu.port.connectedTo" + }, + "externalConnectivity": { + "$ref": "#/components/schemas/ndu.port.externalConnectivity" + } + }, + "type": "object" + }, + "cm.ndu.port.update": { + "additionalProperties": false, + "description": "Definition of ndu port editable parameters", + "minProperties": 1, + "properties": { + "name": { + "$ref": "#/components/schemas/ndu.port.label" + }, + "connectedTo": { + "$ref": "#/components/schemas/ndu.port.connectedTo" + }, + "externalConnectivity": { + "$ref": "#/components/schemas/ndu.port.externalConnectivity" + } + }, + "type": "object" + }, + "cm.ndu.port.tom": { + "description": "Definition of NDU TOM object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/ndu.colId" + }, + "config": { + "$ref": "#/components/schemas/cm.ndu.port.tom.config" + }, + "state": { + "$ref": "#/components/schemas/cm.ndu.port.tom.state" + } + } + }, + "cm.ndu.port.toms": { + "items": { + "$ref": "#/components/schemas/cm.ndu.port.tom" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "toms" + } + }, + "cm.ndu.port.tom.config": { + "additionalProperties": false, + "description": "Definition of ndu TOM configurable parameters", + "properties": { + "requiredType": { + "$ref": "#/components/schemas/ndu.tom.requiredType" + }, + "enableSerdes": { + "$ref": "#/components/schemas/ndu.enableSerdes" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "serDes" + } + }, + "cm.ndu.port.tom.state": { + "description": "Definition of ndu TOM state object", + "properties": { + "tomAid": { + "$ref": "#/components/schemas/ndu.tom.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/ndu.tom.parentAid" + }, + "enableSerdes": { + "$ref": "#/components/schemas/ndu.enableSerdes" + }, + "serDes": { + "items": { + "$ref": "#/components/schemas/ndu.serDesData" + }, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "serDes" + } + }, + "inventory": { + "$ref": "#/components/schemas/ndu.inventory" + } + }, + "type": "object" + }, + "cm.ndu.port.tom.update": { + "additionalProperties": false, + "description": "Definition of ndu TOM editable parameters", + "minProperties": 1, + "properties": { + "requiredType": { + "$ref": "#/components/schemas/ndu.tom.requiredType" + }, + "enableSerdes": { + "$ref": "#/components/schemas/ndu.enableSerdes" + } + }, + "type": "object" + }, + "cm.ndu.port.xr": { + "description": "Definition of NDU XR pluggable interface object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/ndu.colId" + }, + "config": { + "$ref": "#/components/schemas/cm.ndu.port.xr.config" + }, + "state": { + "$ref": "#/components/schemas/cm.ndu.port.xr.state" + } + } + }, + "cm.ndu.port.xrs": { + "items": { + "$ref": "#/components/schemas/cm.ndu.port.xr" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "xrs" + } + }, + "cm.ndu.port.xr.config": { + "additionalProperties": false, + "description": "Definition of ndu XR pluggable interface configurable parameters", + "properties": { + "enableSerdes": { + "$ref": "#/components/schemas/ndu.enableSerdes" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "serDes" + } + }, + "cm.ndu.port.xr.state": { + "description": "Definition of ndu XR pluggable interface state object", + "properties": { + "xrAid": { + "$ref": "#/components/schemas/ndu.xr.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/ndu.xr.parentAid" + }, + "enableSerdes": { + "$ref": "#/components/schemas/ndu.enableSerdes" + }, + "serDes": { + "items": { + "$ref": "#/components/schemas/ndu.serDesData" + }, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "serDes" + } + }, + "inventory": { + "$ref": "#/components/schemas/ndu.inventory" + } + }, + "type": "object" + }, + "cm.ndu.port.xr.update": { + "additionalProperties": false, + "description": "Definition of ndu XR pluggable interface editable parameters", + "minProperties": 1, + "properties": { + "enableSerdes": { + "$ref": "#/components/schemas/ndu.enableSerdes" + } + }, + "type": "object" + }, + "cm.ndu.port.edfa": { + "description": "Definition of NDU EDFA object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/ndu.colId" + }, + "config": { + "$ref": "#/components/schemas/cm.ndu.port.edfa.config" + }, + "state": { + "$ref": "#/components/schemas/cm.ndu.port.edfa.state" + } + } + }, + "cm.ndu.port.edfas": { + "items": { + "$ref": "#/components/schemas/cm.ndu.port.edfa" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "edfas" + } + }, + "cm.ndu.port.edfa.config": { + "additionalProperties": false, + "description": "Definition of ndu EDFA configurable parameters", + "properties": { + "name": { + "$ref": "#/components/schemas/ndu.edfa.label" + }, + "enableSerdes": { + "$ref": "#/components/schemas/ndu.enableSerdes" + }, + "function": { + "$ref": "#/components/schemas/ndu.edfa.function" + }, + "amplifierEnable": { + "$ref": "#/components/schemas/ndu.edfa.amplifierEnable" + }, + "controlMode": { + "$ref": "#/components/schemas/ndu.edfa.controlMode" + }, + "amplifierMode": { + "$ref": "#/components/schemas/ndu.edfa.amplifierMode" + }, + "gainTarget": { + "$ref": "#/components/schemas/ndu.edfa.gainTarget" + }, + "optimumEdfaGain": { + "$ref": "#/components/schemas/ndu.edfa.optimumEdfaGain" + }, + "inputPowerMon": { + "$ref": "#/components/schemas/ndu.edfa.inputPowerMon" + }, + "outputPowerMon": { + "$ref": "#/components/schemas/ndu.edfa.outputPowerMon" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "serDes" + } + }, + "cm.ndu.port.edfa.state": { + "description": "Definition of ndu EDFA state object", + "properties": { + "name": { + "$ref": "#/components/schemas/ndu.edfa.label" + }, + "edfaAid": { + "$ref": "#/components/schemas/ndu.edfa.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/ndu.edfa.parentAid" + }, + "enableSerdes": { + "$ref": "#/components/schemas/ndu.enableSerdes" + }, + "serDes": { + "items": { + "$ref": "#/components/schemas/ndu.serDesData" + }, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "serDes" + } + }, + "function": { + "$ref": "#/components/schemas/ndu.edfa.function" + }, + "amplifierEnable": { + "$ref": "#/components/schemas/ndu.edfa.amplifierEnable" + }, + "controlMode": { + "$ref": "#/components/schemas/ndu.edfa.controlMode" + }, + "amplifierMode": { + "$ref": "#/components/schemas/ndu.edfa.amplifierMode" + }, + "gainTarget": { + "$ref": "#/components/schemas/ndu.edfa.gainTarget" + }, + "optimumEdfaGain": { + "$ref": "#/components/schemas/ndu.edfa.optimumEdfaGain" + }, + "inputPowerMon": { + "$ref": "#/components/schemas/ndu.edfa.inputPowerMon" + }, + "outputPowerMon": { + "$ref": "#/components/schemas/ndu.edfa.outputPowerMon" + }, + "inventory": { + "$ref": "#/components/schemas/ndu.inventory" + } + }, + "type": "object" + }, + "cm.ndu.port.edfa.update": { + "additionalProperties": false, + "description": "Definition of ndu EDFA editable parameters", + "minProperties": 1, + "properties": { + "name": { + "$ref": "#/components/schemas/ndu.edfa.label" + }, + "enableSerdes": { + "$ref": "#/components/schemas/ndu.enableSerdes" + }, + "function": { + "$ref": "#/components/schemas/ndu.edfa.function" + }, + "amplifierEnable": { + "$ref": "#/components/schemas/ndu.edfa.amplifierEnable" + }, + "controlMode": { + "$ref": "#/components/schemas/ndu.edfa.controlMode" + }, + "amplifierMode": { + "$ref": "#/components/schemas/ndu.edfa.amplifierMode" + }, + "gainTarget": { + "$ref": "#/components/schemas/ndu.edfa.gainTarget" + }, + "optimumEdfaGain": { + "$ref": "#/components/schemas/ndu.edfa.optimumEdfaGain" + }, + "inputPowerMon": { + "$ref": "#/components/schemas/ndu.edfa.inputPowerMon" + }, + "outputPowerMon": { + "$ref": "#/components/schemas/ndu.edfa.outputPowerMon" + } + }, + "type": "object" + }, + "cm.ndu.port.voa": { + "description": "Definition of NDU VOA object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/ndu.colId" + }, + "config": { + "$ref": "#/components/schemas/cm.ndu.port.voa.config" + }, + "state": { + "$ref": "#/components/schemas/cm.ndu.port.voa.state" + } + } + }, + "cm.ndu.port.voas": { + "items": { + "$ref": "#/components/schemas/cm.ndu.port.voa" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "voas" + } + }, + "cm.ndu.port.voa.config": { + "additionalProperties": false, + "description": "Definition of ndu VOA configurable parameters", + "properties": { + "enableSerdes": { + "$ref": "#/components/schemas/ndu.enableSerdes" + }, + "outputVoaAttenuation": { + "$ref": "#/components/schemas/ndu.voa.outputVoaAttenuation" + } + }, + "type": "object", + "x-oapi-codegen-extra-tags": { + "bson": "serDes" + } + }, + "cm.ndu.port.voa.state": { + "description": "Definition of ndu VOA state object", + "properties": { + "voaAid": { + "$ref": "#/components/schemas/ndu.voa.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/ndu.voa.parentAid" + }, + "enableSerdes": { + "$ref": "#/components/schemas/ndu.enableSerdes" + }, + "serDes": { + "items": { + "$ref": "#/components/schemas/ndu.serDesData" + }, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "serDes" + } + }, + "outputVoaAttenuation": { + "$ref": "#/components/schemas/ndu.voa.outputVoaAttenuation" + }, + "outputVoaActual": { + "$ref": "#/components/schemas/ndu.voa.outputVoaActual" + }, + "inputPowerMon": { + "$ref": "#/components/schemas/ndu.voa.inputPowerMon" + }, + "outputPowerMon": { + "$ref": "#/components/schemas/ndu.voa.outputPowerMon" + }, + "inventory": { + "$ref": "#/components/schemas/ndu.inventory" + } + }, + "type": "object" + }, + "cm.ndu.port.voa.update": { + "additionalProperties": false, + "description": "Definition of ndu VOA editable parameters", + "minProperties": 1, + "properties": { + "enableSerdes": { + "$ref": "#/components/schemas/ndu.enableSerdes" + }, + "outputVoaAttenuation": { + "$ref": "#/components/schemas/ndu.voa.outputVoaAttenuation" + }, + "outputVoaActual": { + "$ref": "#/components/schemas/ndu.voa.outputVoaActual" + } + }, + "type": "object" + }, + "cm.ndu.linePtp": { + "description": "Definition of ndu line port object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/ndu.colId" + }, + "state": { + "$ref": "#/components/schemas/cm.ndu.linePtp.state" + }, + "carriers": { + "$ref": "#/components/schemas/cm.ndu.linePtp.carriers" + } + } + }, + "cm.ndu.linePtps": { + "items": { + "$ref": "#/components/schemas/cm.ndu.linePtp" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "linePtps" + } + }, + "cm.ndu.linePtp.state": { + "description": "Definition of module line port state object", + "properties": { + "linePtpAid": { + "$ref": "#/components/schemas/ndu.lineptp.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/ndu.lineptp.parentAid" + } + }, + "type": "object" + }, + "cm.ndu.linePtp.carrier": { + "description": "Definition of ndu carrier object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/ndu.colId" + }, + "state": { + "$ref": "#/components/schemas/cm.ndu.linePtp.carrier.state" + } + } + }, + "cm.ndu.linePtp.carriers": { + "items": { + "$ref": "#/components/schemas/cm.ndu.linePtp.carrier" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "carriers" + } + }, + "cm.ndu.linePtp.carrier.state": { + "description": "Definition of module carrier state object", + "properties": { + "carrierAid": { + "$ref": "#/components/schemas/xr.carrier.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/xr.carrier.parentAid" + } + }, + "type": "object" + }, + "cm.ndu.tribPtp": { + "description": "Definition of NDU tributary port object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/ndu.colId" + }, + "config": { + "$ref": "#/components/schemas/cm.ndu.tribPtp.config" + }, + "state": { + "$ref": "#/components/schemas/cm.ndu.tribPtp.state" + } + } + }, + "cm.ndu.tribPtps": { + "items": { + "$ref": "#/components/schemas/cm.ndu.tribPtp" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "tribPtps" + } + }, + "cm.ndu.tribPtp.config": { + "additionalProperties": false, + "description": "Definition of ndu tributary port configurable parameters", + "properties": { + "name": { + "$ref": "#/components/schemas/ndu.ptp.label" + }, + "serviceType": { + "$ref": "#/components/schemas/ndu.ptp.serviceType" + }, + "disableAction": { + "$ref": "#/components/schemas/ndu.ptp.tributaryDisableAction" + }, + "disableActionHoldOff": { + "$ref": "#/components/schemas/ndu.ptp.tributaryDisableActionHoldoff" + }, + "powerThresholdLow": { + "$ref": "#/components/schemas/ndu.ptp.powerThresholdLow" + }, + "powerThresholdLowOffset": { + "$ref": "#/components/schemas/ndu.ptp.powerThresholdLowOffset" + }, + "powerThresholdHigh": { + "$ref": "#/components/schemas/ndu.ptp.powerThresholdHigh" + }, + "powerThresholdHighOffset": { + "$ref": "#/components/schemas/ndu.ptp.powerThresholdHighOffset" + } + }, + "type": "object" + }, + "cm.ndu.tribPtp.state": { + "description": "Definition of ndu tributary port state object", + "properties": { + "tribPtpAid": { + "$ref": "#/components/schemas/ndu.ptp.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/ndu.lineptp.parentAid" + }, + "name": { + "$ref": "#/components/schemas/ndu.ptp.label" + }, + "serviceType": { + "$ref": "#/components/schemas/ndu.ptp.serviceType" + }, + "disableAction": { + "$ref": "#/components/schemas/ndu.ptp.tributaryDisableAction" + }, + "disableActionHoldOff": { + "$ref": "#/components/schemas/ndu.ptp.tributaryDisableActionHoldoff" + }, + "powerThresholdLow": { + "$ref": "#/components/schemas/ndu.ptp.powerThresholdLow" + }, + "powerThresholdLowOffset": { + "$ref": "#/components/schemas/ndu.ptp.powerThresholdLowOffset" + }, + "powerThresholdHigh": { + "$ref": "#/components/schemas/ndu.ptp.powerThresholdHigh" + }, + "powerThresholdHighOffset": { + "$ref": "#/components/schemas/ndu.ptp.powerThresholdHighOffset" + } + }, + "type": "object" + }, + "cm.ndu.tribPtp.update": { + "additionalProperties": false, + "description": "Definition of ndu tributary port editable parameters", + "minProperties": 1, + "properties": { + "name": { + "$ref": "#/components/schemas/ndu.ptp.label" + }, + "serviceType": { + "$ref": "#/components/schemas/ndu.ptp.serviceType" + }, + "disableAction": { + "$ref": "#/components/schemas/ndu.ptp.tributaryDisableAction" + }, + "disableActionHoldOff": { + "$ref": "#/components/schemas/ndu.ptp.tributaryDisableActionHoldoff" + }, + "powerThresholdLow": { + "$ref": "#/components/schemas/ndu.ptp.powerThresholdLow" + }, + "powerThresholdLowOffset": { + "$ref": "#/components/schemas/ndu.ptp.powerThresholdLowOffset" + }, + "powerThresholdHigh": { + "$ref": "#/components/schemas/ndu.ptp.powerThresholdHigh" + }, + "powerThresholdHighOffset": { + "$ref": "#/components/schemas/ndu.ptp.powerThresholdHighOffset" + } + }, + "type": "object" + }, + "cm.ndu.otu": { + "description": "Definition of NDU otu object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/ndu.colId" + }, + "config": { + "$ref": "#/components/schemas/cm.ndu.otu.config" + }, + "state": { + "$ref": "#/components/schemas/cm.ndu.otu.state" + }, + "odus": { + "$ref": "#/components/schemas/cm.ndu.otu.odus" + } + } + }, + "cm.ndu.otus": { + "items": { + "$ref": "#/components/schemas/cm.ndu.otu" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "otus" + } + }, + "cm.ndu.otu.config": { + "additionalProperties": false, + "description": "Definition of NDU otu configurable parameters", + "properties": { + "txTTI": { + "$ref": "#/components/schemas/xr.ndu.otu.txTTI" + }, + "expectedTTI": { + "$ref": "#/components/schemas/xr.ndu.otu.expectedTTI" + }, + "facPRBSGen": { + "$ref": "#/components/schemas/xr.ndu.otu.diagnostic.facPRBSGen" + }, + "facPRBSMon": { + "$ref": "#/components/schemas/xr.ndu.otu.diagnostic.facPRBSMon" + } + }, + "type": "object" + }, + "cm.ndu.otu.state": { + "description": "Definition of NDU otu state object", + "properties": { + "otuAid": { + "$ref": "#/components/schemas/xr.ndu.otu.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/xr.ndu.otu.parentAid" + }, + "otuType": { + "$ref": "#/components/schemas/xr.ndu.otu.otuType" + }, + "rate": { + "$ref": "#/components/schemas/xr.ndu.otu.rate" + }, + "txTTI": { + "$ref": "#/components/schemas/xr.ndu.otu.txTTI" + }, + "rxTTI": { + "$ref": "#/components/schemas/xr.ndu.otu.rxTTI" + }, + "expectedTTI": { + "$ref": "#/components/schemas/xr.ndu.otu.expectedTTI" + }, + "facPRBSGen": { + "$ref": "#/components/schemas/xr.ndu.otu.diagnostic.facPRBSGen" + }, + "facPRBSMon": { + "$ref": "#/components/schemas/xr.ndu.otu.diagnostic.facPRBSMon" + } + }, + "type": "object" + }, + "cm.ndu.otu.update": { + "additionalProperties": false, + "description": "Definition of NDU otu editable parameters", + "minProperties": 1, + "properties": { + "txTTI": { + "$ref": "#/components/schemas/xr.ndu.otu.txTTI" + }, + "expectedTTI": { + "$ref": "#/components/schemas/xr.ndu.otu.expectedTTI" + }, + "facPRBSGen": { + "$ref": "#/components/schemas/xr.ndu.otu.diagnostic.facPRBSGen" + }, + "facPRBSMon": { + "$ref": "#/components/schemas/xr.ndu.otu.diagnostic.facPRBSMon" + } + }, + "type": "object" + }, + "cm.ndu.otu.odu": { + "description": "Definition of NTU ODU object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/ndu.colId" + }, + "state": { + "$ref": "#/components/schemas/cm.ndu.otu.odu.state" + } + } + }, + "cm.ndu.otu.odus": { + "items": { + "$ref": "#/components/schemas/cm.ndu.otu.odu" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "odus" + } + }, + "cm.ndu.otu.odu.state": { + "description": "Definition of NDU ODU state object", + "properties": { + "oduAid": { + "$ref": "#/components/schemas/xr.ndu.otu.odu.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/xr.ndu.otu.odu.parentAid" + }, + "oduType": { + "$ref": "#/components/schemas/xr.ndu.otu.odu.oduType" + } + } + }, + "cm.ndu.ethernetClient": { + "description": "Definition of NDU ethernetClient object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/ndu.colId" + }, + "config": { + "$ref": "#/components/schemas/cm.ndu.ethernetClient.config" + }, + "state": { + "$ref": "#/components/schemas/cm.ndu.ethernetClient.state" + } + } + }, + "cm.ndu.ethernetClients": { + "items": { + "$ref": "#/components/schemas/cm.ndu.ethernetClient" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "ethernetClients" + } + }, + "cm.ndu.ethernetClient.config": { + "additionalProperties": false, + "description": "Definition of NDU ethernetClient configuration object", + "properties": { + "fecMode": { + "$ref": "#/components/schemas/xr.ndu.ethernet.fecMode" + }, + "loopbackType": { + "$ref": "#/components/schemas/xr.ndu.ethernet.diagnostic.loopbackType" + }, + "loopbackMode": { + "$ref": "#/components/schemas/xr.ndu.ethernet.diagnostic.loopbackMode" + } + }, + "type": "object" + }, + "cm.ndu.ethernetClient.state": { + "description": "Definition of module ethernetClient state parameters", + "properties": { + "clientIfAid": { + "$ref": "#/components/schemas/xr.ndu.ethernet.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/xr.ndu.ethernet.parentAid" + }, + "clientIfPortSpeed": { + "$ref": "#/components/schemas/xr.ndu.ethernet.portSpeed" + }, + "fecType": { + "$ref": "#/components/schemas/xr.ndu.ethernet.fecType" + }, + "fecMode": { + "$ref": "#/components/schemas/xr.ndu.ethernet.fecMode" + }, + "loopbackType": { + "$ref": "#/components/schemas/xr.ndu.ethernet.diagnostic.loopbackType" + }, + "loopbackMode": { + "$ref": "#/components/schemas/xr.ndu.ethernet.diagnostic.loopbackMode" + } + }, + "type": "object" + }, + "cm.ndu.ethernetClient.update": { + "additionalProperties": false, + "description": "Definition of NDU ethernetClient editable object", + "minProperties": 1, + "properties": { + "fecMode": { + "$ref": "#/components/schemas/xr.ndu.ethernet.fecMode" + }, + "loopbackType": { + "$ref": "#/components/schemas/xr.ndu.ethernet.diagnostic.loopbackType" + }, + "loopbackMode": { + "$ref": "#/components/schemas/xr.ndu.ethernet.diagnostic.loopbackMode" + } + }, + "type": "object" + }, + "cm.ndu.trail": { + "description": "Definition of NTU trail object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/ndu.colId" + }, + "state": { + "$ref": "#/components/schemas/cm.ndu.trail.state" + } + } + }, + "cm.ndu.trails": { + "items": { + "$ref": "#/components/schemas/cm.ndu.trail" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "trails" + } + }, + "cm.ndu.trail.state": { + "description": "Definition of NDU ODU state object", + "properties": { + "trailAid": { + "$ref": "#/components/schemas/ndu.trail.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/ndu.trail.parentAid" + }, + "trailType": { + "$ref": "#/components/schemas/ndu.trail.trailType" + }, + "clientAid": { + "$ref": "#/components/schemas/ndu.trail.Aid_A" + }, + "lineAid": { + "$ref": "#/components/schemas/ndu.trail.Aid_Z" + } + } + }, + "cm.ndu.fan": { + "description": "Definition of NTU fan object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/ndu.colId" + }, + "state": { + "$ref": "#/components/schemas/cm.ndu.fan.state" + } + } + }, + "cm.ndu.fans": { + "items": { + "$ref": "#/components/schemas/cm.ndu.fan" + }, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "fans" + } + }, + "cm.ndu.fan.state": { + "description": "Definition of NDU fan state object", + "properties": { + "fanAid": { + "$ref": "#/components/schemas/ndu.fan.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/ndu.fan.parentAid" + }, + "inventory": { + "$ref": "#/components/schemas/ndu.inventory" + } + } + }, + "cm.ndu.pem": { + "description": "Definition of NDU PEM object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/ndu.colId" + }, + "state": { + "$ref": "#/components/schemas/cm.ndu.pem.state" + } + } + }, + "cm.ndu.pem.state": { + "description": "Definition of NDU PEM state object", + "properties": { + "pemAid": { + "$ref": "#/components/schemas/ndu.fan.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/ndu.fan.parentAid" + }, + "availablePower": { + "$ref": "#/components/schemas/ndu.pem.availablePower" + }, + "pemUnderVoltageThreshold": { + "$ref": "#/components/schemas/ndu.pem.pemUnderVoltageThreshold" + }, + "pemOverVoltageThreshold": { + "$ref": "#/components/schemas/ndu.pem.pemOverVoltageThreshold" + }, + "inventory": { + "$ref": "#/components/schemas/ndu.inventory" + } + }, + "type": "object" + }, + "cm.ndu.pem.update": { + "additionalProperties": false, + "description": "Definition of ndu PEM editable parameters", + "minProperties": 1, + "properties": { + "pemUnderVoltageThreshold": { + "$ref": "#/components/schemas/ndu.pem.pemUnderVoltageThreshold" + }, + "pemOverVoltageThreshold": { + "$ref": "#/components/schemas/ndu.pem.pemOverVoltageThreshold" + } + }, + "type": "object" + }, + "cm.ndu.leds": { + "description": "Definition of NDU LEDs object", + "properties": { + "href": { + "$ref": "#/components/schemas/cm.parameters.href" + }, + "rt": { + "$ref": "#/components/schemas/cm.parameters.rt" + }, + "id": { + "$ref": "#/components/schemas/cm.parameters.uuid" + }, + "parentId": { + "$ref": "#/components/schemas/cm.parameters.parentId" + }, + "colId": { + "$ref": "#/components/schemas/ndu.colId" + }, + "state": { + "$ref": "#/components/schemas/cm.ndu.leds.state" + } + } + }, + "cm.ndu.leds.state": { + "description": "Definition of NDU LEDs state object", + "properties": { + "ledsAid": { + "$ref": "#/components/schemas/ndu.leds.aid" + }, + "parentAid": { + "$ref": "#/components/schemas/ndu.leds.parentAid" + }, + "leds": { + "$ref": "#/components/schemas/ndu.leds.leds" + } + } + }, + "ndu.configuration.contact": { + "description": "Contact info of administrator of NDU", + "title": "Contact", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "contact" + } + }, + "ndu.configuration.mgmtMode": { + "description": "Defines the ownership of the object.", + "enum": [ + "local", + "CM" + ], + "title": "Managed by", + "type": "string", + "x-enum-varnames": [ + "Local", + "IPM" + ], + "x-oapi-codegen-extra-tags": { + "bson": "managedBy" + } + }, + "ndu.configuration.neLocation": { + "description": "NE location, defined by operator.", + "maxLength": 64, + "title": "Description", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "description" + } + }, + "ndu.configuration.clli": { + "description": "Common Location Language Identifier", + "maxLength": 11, + "minLength": 6, + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "clli" + } + }, + "ndu.configuration.latitude": { + "description": "Latitude location info. \nRange: -90 to +90\n", + "format": "double", + "maximum": 90, + "minimum": -90, + "title": "Latitude", + "type": "number", + "x-oapi-codegen-extra-tags": { + "bson": "latitude" + } + }, + "ndu.configuration.longitude": { + "description": "Longitude location info. \nRange: -180 to +180\n", + "format": "double", + "maximum": 180, + "minimum": -180, + "title": "Longitude", + "type": "number", + "x-oapi-codegen-extra-tags": { + "bson": "longitude" + } + }, + "ndu.configuration.altitude": { + "title": "Altitude", + "type": "integer", + "x-unit": "Meters", + "x-oapi-codegen-extra-tags": { + "bson": "altitude" + } + }, + "ndu.device.n": { + "description": "Friendly name of the device", + "maxLength": 64, + "readOnly": true, + "title": "NDU name", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "name" + } + }, + "ndu.device.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "maxLength": 64, + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "nduAid" + } + }, + "ndu.platform.pi": { + "description": "Unique UUID for the hardware platform calculated from the mac address", + "maxLength": 36, + "minLength": 36, + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "readOnly": true, + "title": "Platform UUID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "pi" + } + }, + "ndu.platform.mnfv": { + "description": "Manufacturer's firmware version", + "maxLength": 64, + "readOnly": true, + "title": "Firmware version", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "mnfv" + } + }, + "ndu.platform.mnmn": { + "description": "Manufacturer name", + "maxLength": 64, + "readOnly": true, + "title": "Manufacturer", + "type": "string" + }, + "ndu.platform.mnmo": { + "description": "Manufacturer's Model/Part number", + "maxLength": 64, + "readOnly": true, + "title": "Model number", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "mnmo" + } + }, + "ndu.platform.mnhw": { + "description": "Platform Hardware Version", + "maxLength": 64, + "readOnly": true, + "title": "HW Version", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "mnhw" + } + }, + "ndu.platform.mndt": { + "description": "HW Manufacturing date", + "pattern": "([0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|2[0-9]|1[0-9]|0[1-9])", + "readOnly": true, + "title": "Manufacturing date", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "mndt" + } + }, + "ndu.platform.mnsel": { + "description": "Device Serial number", + "maxLength": 64, + "readOnly": true, + "title": "Serial number", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "serialNumber" + } + }, + "ndu.platform.clei": { + "description": "Globally unique 10-character alphanumeric intelligent code identifying equipment in a structured naming format", + "readOnly": true, + "title": "CLEI Code", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "clei" + } + }, + "ndu.platform.macAddress": { + "description": "Device MAC Address", + "readOnly": true, + "title": "MAC address", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "macAddress" + } + }, + "ndu.device.piid": { + "description": "Protocol independent unique identifier for the Device that is immutable.", + "maxLength": 36, + "minLength": 36, + "pattern": "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", + "readOnly": true, + "title": "PIID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "piid" + } + }, + "ndu.device.dmn": { + "properties": { + "language": { + "$ref": "#/components/schemas/ndu.device.dmn.language" + }, + "value": { + "$ref": "#/components/schemas/ndu.device.dmn.value" + } + }, + "x-oapi-codegen-extra-tags": { + "bson": "dmn" + } + }, + "ndu.device.dmn.language": { + "description": "Format pattern according to IETF RFC 5646 (language tag).", + "pattern": "[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})", + "title": "Language", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "language" + } + }, + "ndu.device.dmn.value": { + "description": "Manufacturer name", + "maxLength": 64, + "readOnly": true, + "title": "Manufacturer", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "value" + } + }, + "ndu.device.sv": { + "description": "Software version.", + "maxLength": 64, + "readOnly": true, + "title": "Software version", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "sv" + } + }, + "ndu.device.icv": { + "description": "Device HW version.", + "maxLength": 64, + "readOnly": true, + "title": "Hardware version", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "icv" + } + }, + "ndu.colId": { + "description": "Object identifier in the supporting collection.", + "readOnly": true, + "title": "Collection Id", + "type": "integer", + "x-oapi-codegen-extra-tags": { + "bson": "colId" + } + }, + "ndu.port.label": { + "description": "User defined port label", + "maxLength": 64, + "title": "Name", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "name" + } + }, + "ndu.port.connectedTo": { + "description": "User configurable neighbor entity information", + "maxLength": 64, + "title": "Neighbor", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "connectedTo" + } + }, + "ndu.port.externalConnectivity": { + "description": "Whether port has NMS external connectivity.", + "title": "External Connectivity", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "externalConnectivity" + } + }, + "ndu.port.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type..", + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "portAid" + } + }, + "ndu.port.parentAid": { + "items": { + "$ref": "#/components/schemas/ndu.device.aid" + }, + "maxItems": 1, + "minItems": 1, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "ndu.port.portType": { + "description": "Describes the port type", + "enum": [ + "line", + "tributary", + "usb", + "dcn", + "uplink", + "optical" + ], + "readOnly": true, + "title": "Type", + "type": "string", + "x-enum-varnames": [ + "Line", + "Tributary", + "USB", + "DCN", + "Uplink", + "Optical" + ], + "x-oapi-codegen-extra-tags": { + "bson": "category" + } + }, + "ndu.port.supportedType": { + "description": "List of supported pluggable interfaces", + "items": { + "type": "string" + }, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "supportedTypes" + } + }, + "ndu.port.installedType": { + "description": "Installed pluggable interface", + "readOnly": true, + "type": "string" + }, + "ndu.tom.requiredType": { + "default": "", + "description": "User defined required type.\nInserted value should match a tom value defined in port supportedTypes.\n", + "maxLength": 64, + "title": "Required Type", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "requiredType" + } + }, + "ndu.enableSerdes": { + "description": "Serdes control parameter", + "title": "Enable Serdes", + "type": "boolean", + "x-oapi-codegen-extra-tags": { + "bson": "enableSerdes" + } + }, + "ndu.tom.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "tomAid" + } + }, + "ndu.tom.parentAid": { + "items": { + "$ref": "#/components/schemas/ndu.port.aid" + }, + "maxItems": 1, + "minItems": 1, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "ndu.serDesData": { + "properties": { + "name": { + "$ref": "#/components/schemas/ndu.serDes.name" + }, + "value": { + "$ref": "#/components/schemas/ndu.serDes.value" + }, + "status": { + "$ref": "#/components/schemas/ndu.serDes.status" + } + } + }, + "ndu.serDes.name": { + "description": "Serdes name", + "readOnly": true, + "title": "Name", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "name" + } + }, + "ndu.serDes.value": { + "description": "Serdes value", + "readOnly": true, + "title": "Value", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "value" + } + }, + "ndu.serDes.status": { + "description": "Serdes status", + "enum": [ + "set", + "unknown", + "inProgress", + "failed", + "notSupported" + ], + "readOnly": true, + "title": "Status", + "type": "string", + "x-enum-varnames": [ + "Set", + "Unknown", + "In progress", + "Failed", + "Not supported" + ], + "x-oapi-codegen-extra-tags": { + "bson": "status" + } + }, + "ndu.inventory": { + "properties": { + "hardwareVersion": { + "$ref": "#/components/schemas/ndu.inventory.hardwareVersion" + }, + "actualType": { + "$ref": "#/components/schemas/ndu.inventory.actualType" + }, + "PON": { + "$ref": "#/components/schemas/ndu.inventory.pon" + }, + "serialNumber": { + "$ref": "#/components/schemas/ndu.inventory.serialNumber" + }, + "clei": { + "$ref": "#/components/schemas/ndu.inventory.clei" + }, + "vendor": { + "$ref": "#/components/schemas/ndu.inventory.vendor" + }, + "partNumber": { + "$ref": "#/components/schemas/ndu.inventory.partNumber" + }, + "manufactureDate": { + "$ref": "#/components/schemas/ndu.inventory.manufactureDate" + }, + "fwName": { + "$ref": "#/components/schemas/ndu.inventory.fwName" + }, + "fwVersion": { + "$ref": "#/components/schemas/ndu.inventory.fwVersion" + }, + "expectedFWVersion": { + "$ref": "#/components/schemas/ndu.inventory.expectedFWVersion" + }, + "fwStatus": { + "$ref": "#/components/schemas/ndu.inventory.fwStatus" + } + }, + "x-oapi-codegen-extra-tags": { + "bson": "hardwareVersion" + } + }, + "ndu.inventory.hardwareVersion": { + "readOnly": true, + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "inventory" + } + }, + "ndu.inventory.actualType": { + "readOnly": true, + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "actualType" + } + }, + "ndu.inventory.pon": { + "readOnly": true, + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "PON" + } + }, + "ndu.inventory.serialNumber": { + "readOnly": true, + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "serialNumber" + } + }, + "ndu.inventory.clei": { + "readOnly": true, + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "clei" + } + }, + "ndu.inventory.vendor": { + "readOnly": true, + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "vendor" + } + }, + "ndu.inventory.partNumber": { + "readOnly": true, + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "partNumber" + } + }, + "ndu.inventory.manufactureDate": { + "readOnly": true, + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "manufactureDate" + } + }, + "ndu.inventory.fwName": { + "readOnly": true, + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "fwName" + } + }, + "ndu.inventory.fwVersion": { + "readOnly": true, + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "fwVersion" + } + }, + "ndu.inventory.expectedFWVersion": { + "readOnly": true, + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "expectedFWVersion" + } + }, + "ndu.inventory.fwStatus": { + "enum": [ + "notApplicable", + "current", + "notCurrent", + "unavailable" + ], + "readOnly": true, + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "fwStatus" + } + }, + "ndu.xr.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "xrAid" + } + }, + "ndu.xr.parentAid": { + "items": { + "$ref": "#/components/schemas/ndu.port.aid" + }, + "maxItems": 1, + "minItems": 1, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "ndu.edfa.label": { + "description": "User defined label", + "maxLength": 64, + "title": "Name", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "name" + } + }, + "ndu.edfa.function": { + "description": "booster amplifier or pre-amplifier", + "enum": [ + "pa", + "ba" + ], + "title": "Function", + "type": "string", + "x-enum-varnames": [ + "Pre-amplifier", + "Booster amplifier" + ], + "x-oapi-codegen-extra-tags": { + "bson": "function" + } + }, + "ndu.edfa.amplifierEnable": { + "description": "The enable switch for the amplifier.", + "enum": [ + "enabled", + "disabled" + ], + "title": "Status", + "type": "string", + "x-enum-varnames": [ + "Enabled", + "Disabled" + ], + "x-oapi-codegen-extra-tags": { + "bson": "amplifierEnable" + } + }, + "ndu.edfa.controlMode": { + "description": "Mode of control of the amplifier (user defined targeting or automatic power targeting)", + "enum": [ + "autoMaxPw", + "manual" + ], + "title": "Power Control", + "type": "string", + "x-enum-varnames": [ + "Automatic", + "Manual" + ], + "x-oapi-codegen-extra-tags": { + "bson": "controlMode" + } + }, + "ndu.edfa.amplifierMode": { + "description": "Mode of operation.", + "enum": [ + "constantPower", + "constantGain" + ], + "title": "Amplifier Mode", + "type": "string", + "x-enum-varnames": [ + "Power control", + "Gain control" + ], + "x-oapi-codegen-extra-tags": { + "bson": "amplifierMode" + } + }, + "ndu.edfa.gainTarget": { + "description": "Target gain to be achieved by the amplifier.", + "format": "double", + "title": "Target Gain", + "type": "number", + "x-oapi-codegen-extra-tags": { + "bson": "gainTarget" + } + }, + "ndu.edfa.optimumEdfaGain": { + "description": "Optimum EDFA gain of the emplifier", + "format": "double", + "readOnly": true, + "type": "number", + "x-oapi-codegen-extra-tags": { + "bson": "optimumEdfaGain" + } + }, + "ndu.edfa.inputPowerMon": { + "description": "Monitored input power.", + "format": "double", + "readOnly": true, + "type": "number", + "x-oapi-codegen-extra-tags": { + "bson": "inputPowerMon" + } + }, + "ndu.edfa.outputPowerMon": { + "description": "Monitored output power", + "format": "double", + "readOnly": true, + "type": "number", + "x-oapi-codegen-extra-tags": { + "bson": "outputPowerMon" + } + }, + "ndu.edfa.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "edfaAid" + } + }, + "ndu.edfa.parentAid": { + "items": { + "$ref": "#/components/schemas/ndu.port.aid" + }, + "maxItems": 1, + "minItems": 1, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "ndu.voa.outputVoaAttenuation": { + "default": 0, + "description": "Attenuation setting on VOA. \nRange 0.. 20, \nUnit: dB, \nDefault: 0\n", + "format": "double", + "maximum": 20, + "minimum": 0, + "title": "VOA Attenuation", + "type": "number", + "x-unit": "dB", + "x-oapi-codegen-extra-tags": { + "bson": "outputVoaAttenuation" + } + }, + "ndu.voa.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "voaAid" + } + }, + "ndu.voa.parentAid": { + "items": { + "$ref": "#/components/schemas/ndu.port.aid" + }, + "maxItems": 1, + "minItems": 1, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "ndu.voa.outputVoaActual": { + "description": "Attenuation setting monitor (actual)", + "readOnly": true, + "title": "Actual VOA Attenuation", + "type": "integer", + "x-oapi-codegen-extra-tags": { + "bson": "outputVoaActual" + } + }, + "ndu.voa.inputPowerMon": { + "description": "Monitored input power", + "format": "double", + "readOnly": true, + "title": "Input power", + "type": "number", + "x-oapi-codegen-extra-tags": { + "bson": "inputPowerMon" + } + }, + "ndu.voa.outputPowerMon": { + "description": "Monitored output power", + "format": "double", + "readOnly": true, + "title": "Output power", + "type": "number", + "x-oapi-codegen-extra-tags": { + "bson": "outputPowerMon" + } + }, + "ndu.lineptp.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "linePtpAid" + } + }, + "ndu.lineptp.parentAid": { + "items": { + "$ref": "#/components/schemas/ndu.device.aid" + }, + "maxItems": 1, + "minItems": 1, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "ndu.ptp.label": { + "description": "User defined label", + "maxLength": 64, + "title": "Description", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "name" + } + }, + "ndu.ptp.serviceType": { + "enum": [ + "100GBE", + "4x25GBE", + "OTU4" + ], + "title": "Service Type", + "type": "string", + "x-enum-varnames": [ + "100GBE", + "4x25GBE", + "OTU4" + ], + "x-oapi-codegen-extra-tags": { + "bson": "serviceType" + } + }, + "ndu.ptp.tributaryDisableAction": { + "description": "Defines the applicable disable action for the tributary port", + "enum": [ + "laserShutoff", + "sendIdles", + "sendLf" + ], + "title": "Disable action", + "type": "string", + "x-enum-varnames": [ + "Laser shutdown", + "Send idle", + "Send loss of frame" + ], + "x-oapi-codegen-extra-tags": { + "bson": "disableAction" + } + }, + "ndu.ptp.tributaryDisableActionHoldoff": { + "description": "Time in ms before TDA kicks in.", + "maximum": 10000, + "minimum": 0, + "title": "Disable action hold-off time", + "type": "integer", + "x-unit": "ms", + "x-oapi-codegen-extra-tags": { + "bson": "disableActionHoldOff" + } + }, + "ndu.ptp.powerThresholdLow": { + "description": "The threshold below which the system raises the OPR-OORL alarm. \nRange: -55.00 to +55.00 \nUnits: dBm\n", + "format": "double", + "maximum": 55, + "minimum": -55, + "title": "Under Power Threshold", + "type": "number", + "x-unit": "dB", + "x-oapi-codegen-extra-tags": { + "bson": "powerThresholdLow" + } + }, + "ndu.ptp.powerThresholdLowOffset": { + "description": "Adjustment factor for low alarm. \nThe effective threshold will be (threshold-low + threshold-low-offset). \nRange: -10.00 to +10.00\nUnits: dB\n", + "format": "double", + "maximum": 10, + "minimum": -10, + "title": "Under Power Threshold Offset", + "type": "number", + "x-unit": "dB", + "x-oapi-codegen-extra-tags": { + "bson": "powerThresholdLowOffset" + } + }, + "ndu.ptp.powerThresholdHigh": { + "description": "The threshold above which the system raises the OPR-OORH alarm. \nRange: -55.00 to +55.00 \nUnits: dB\n", + "format": "double", + "maximum": 55, + "minimum": -55, + "title": "Over Power Threshold", + "type": "number", + "x-unit": "dB", + "x-oapi-codegen-extra-tags": { + "bson": "powerThresholdHigh" + } + }, + "ndu.ptp.powerThresholdHighOffset": { + "description": "Adjustment factor for low alarm.\nThe effective threshold will be (threshold-high+ threshold-high-offset)\nRange: -10.00 to +10.00 \nUnits: dB\n", + "format": "double", + "maximum": 10, + "minimum": -10, + "title": "Over Power Threshold Offset", + "type": "number", + "x-unit": "dB", + "x-oapi-codegen-extra-tags": { + "bson": "powerThresholdHighOffset" + } + }, + "ndu.ptp.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "maxLength": 64, + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "tribPtpAid" + } + }, + "xr.ndu.otu.txTTI": { + "default": "", + "description": "Up to 64 byte string for transmitting as TTI.", + "maxLength": 64, + "title": "Transmit TTI", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "txTTI" + } + }, + "xr.ndu.otu.expectedTTI": { + "default": "", + "description": "Up to 64 byte string of TTI that is expected to be received.", + "maxLength": 64, + "title": "Expected TTI", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "expectedTTI" + } + }, + "xr.ndu.otu.diagnostic.facPRBSGen": { + "default": "disabled", + "description": "Enable/Disable facility PRBS test pattern generation", + "enum": [ + "enabled", + "disabled" + ], + "title": "Facility PRBS generation", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "facPRBSGen" + } + }, + "xr.ndu.otu.diagnostic.facPRBSMon": { + "default": "disabled", + "description": "Enable/Disable facility PRBS test pattern monitoring", + "enum": [ + "enabled", + "disabled" + ], + "title": "Facility PRBS monitoring", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "facPRBSMon" + } + }, + "xr.ndu.otu.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "maxLength": 64, + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "otuAid" + } + }, + "xr.ndu.otu.parentAid": { + "items": { + "$ref": "#/components/schemas/ndu.device.aid" + }, + "maxItems": 1, + "minItems": 1, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "xr.ndu.otu.otuType": { + "description": "OTU Type", + "enum": [ + "OTUCni", + "OTUCn", + "OTUCni-M", + "OTU4" + ], + "readOnly": true, + "title": "OTU type", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "otuType" + } + }, + "xr.ndu.otu.rate": { + "description": "Rate of the OTU.", + "enum": [ + 25, + 50, + 100, + 200, + 400 + ], + "readOnly": true, + "title": "Rate", + "type": "integer", + "x-unit": "Gbps", + "x-oapi-codegen-extra-tags": { + "bson": "rate" + } + }, + "xr.ndu.otu.rxTTI": { + "description": "Up to 64 byte string of received TTI.", + "maxLength": 64, + "readOnly": true, + "title": "Received TTI", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "rxTTI" + } + }, + "xr.ndu.otu.odu.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "maxLength": 64, + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "oduAid" + } + }, + "xr.ndu.otu.odu.parentAid": { + "items": { + "$ref": "#/components/schemas/ndu.carrier.aid" + }, + "maxItems": 1, + "minItems": 1, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "ndu.carrier.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "carrierAid" + } + }, + "xr.ndu.otu.odu.oduType": { + "description": "ODU type", + "enum": [ + "ODUCni", + "ODUflexi", + "ODUCni-M", + "ODU4i" + ], + "readOnly": true, + "title": "ODU type", + "type": "string", + "x-enum-varnames": [ + "ODUCni", + "ODUflexi", + "ODUCni-M", + "ODU4i" + ], + "x-oapi-codegen-extra-tags": { + "bson": "oduType" + } + }, + "xr.ndu.ethernet.fecMode": { + "default": "enabled", + "description": "Forward error correction mode of operation", + "enum": [ + "enabled", + "disabled" + ], + "title": "Forward error correction mode", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "fecMode" + } + }, + "xr.ndu.ethernet.diagnostic.loopbackType": { + "default": "loopbackAndContinue", + "description": "Loopback type. - 'loopbackAndContinue': Signal is looped back and is also forwarded downstream. - 'loopback': Signal is looped back and LF maintenance signal is sent downstream.\n", + "enum": [ + "loopbackAndContinue", + "loopback" + ], + "title": "Loopback type", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "loopbackType" + } + }, + "xr.ndu.ethernet.diagnostic.loopbackMode": { + "default": "disabled", + "description": "Post-FEC Loopback mode for the ethernet client.", + "enum": [ + "disabled", + "facility", + "terminal" + ], + "title": "Loopback mode", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "loopbackMode" + } + }, + "xr.ndu.ethernet.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "maxLength": 64, + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "clientIfAid" + } + }, + "xr.ndu.ethernet.parentAid": { + "items": { + "$ref": "#/components/schemas/ndu.device.aid" + }, + "maxItems": 1, + "minItems": 1, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "xr.ndu.ethernet.portSpeed": { + "description": "Ethernet port speed in Gbps", + "enum": [ + 100, + 400, + 200, + 50, + 25 + ], + "readOnly": true, + "title": "Port speed", + "type": "integer", + "x-unit": "Gbps", + "x-oapi-codegen-extra-tags": { + "bson": "clientIfPortSpeed" + } + }, + "xr.ndu.ethernet.fecType": { + "description": "Automatically set by the module based on SerDes and Port configuration.", + "enum": [ + "KR4", + "KP4" + ], + "readOnly": true, + "title": "Fec type", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "fecType" + } + }, + "ndu.trail.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "maxLength": 64, + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "trailAid" + } + }, + "ndu.trail.parentAid": { + "items": { + "$ref": "#/components/schemas/ndu.device.aid" + }, + "maxItems": 1, + "minItems": 1, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "ndu.trail.trailType": { + "default": "biDir", + "description": "Directionality of the LC", + "enum": [ + "biDir" + ], + "title": "Directionality", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "trailType" + } + }, + "ndu.trail.Aid_A": { + "description": "Points to the AID of the connected resource A of the trail.", + "title": "Client side AID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "clientAid" + } + }, + "ndu.trail.Aid_Z": { + "description": "Points to the AID of the connected resource Z of the trail.", + "readOnly": true, + "title": "Line side AID", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "lineAid" + } + }, + "ndu.fan.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "readOnly": true, + "title": "Access identifier", + "type": "string" + }, + "ndu.fan.parentAid": { + "items": { + "$ref": "#/components/schemas/ndu.device.aid" + }, + "maxItems": 1, + "minItems": 1, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "ndu.pem.availablePower": { + "format": "double", + "readOnly": true, + "title": "Available Power", + "type": "number" + }, + "ndu.pem.pemUnderVoltageThreshold": { + "description": "Ranges:\n- 40.5 to 57.0 for DC PEM,\n- 100 to 260V for AC PEM\n", + "format": "double", + "title": "Under Voltage Threshold", + "type": "number" + }, + "ndu.pem.pemOverVoltageThreshold": { + "description": "Ranges:\n- 40.5 to -57.0 for DC PEM,\n- 100 to 260V for AC PEM\n", + "format": "double", + "title": "Over Voltage Threshold", + "type": "number" + }, + "ndu.leds.aid": { + "description": "Access Identifier (AID) - unique instance within a device and specific resource type.", + "readOnly": true, + "title": "Access identifier", + "type": "string", + "x-oapi-codegen-extra-tags": { + "bson": "ledsAid" + } + }, + "ndu.leds.parentAid": { + "items": { + "$ref": "#/components/schemas/ndu.device.aid" + }, + "maxItems": 1, + "minItems": 1, + "readOnly": true, + "type": "array", + "x-oapi-codegen-extra-tags": { + "bson": "parentAid" + } + }, + "ndu.leds.leds": { + "items": { + "$ref": "#/components/schemas/ndu.ledState" + }, + "readOnly": true, + "type": "array", + "uniqueItems": true, + "x-oapi-codegen-extra-tags": { + "bson": "leds" + } + }, + "ndu.ledState": { + "properties": { + "ledId": { + "$ref": "#/components/schemas/ndu.ledState.ledId" + }, + "state": { + "$ref": "#/components/schemas/ndu.ledState.state" + } + }, + "type": "object" + }, + "ndu.ledState.ledId": { + "enum": [ + "CFP_RX", + "CFP_TX", + "POL_Upper", + "POL_Lower", + "QSFP28_1_RX", + "QSFP28_2_RX", + "QSFP28_1_TX", + "QSFP28_2_TX", + "QSFP28_1_Service", + "QSFP28_2_Service", + "Maintenance", + "IpAuth", + "Power", + "Status", + "Fips" + ], + "readOnly": true, + "type": "string", + "x-enum-varnames": [ + "CFP_RX", + "CFP_TX", + "POL_Upper", + "POL_Lower", + "QSFP28 Port #1 RX", + "QSFP28 Port #2 RX", + "QSFP28 Port #1 TX", + "QSFP28 Port #2 TX", + "QSFP28 Port #1 Service", + "QSFP28 Port #2 Service", + "Maintenance", + "IP Authentication", + "Power", + "Status", + "Fips" + ], + "x-oapi-codegen-extra-tags": { + "bson": "ledId" + } + }, + "ndu.ledState.state": { + "enum": [ + "Unknown", + "Off", + "Green", + "GreenSlowSingleFlash", + "GreenSlowDoubleFlash", + "GreenSlowIsoPhase", + "GreenQuickIsoPhase", + "GreenFastIsoPhase", + "GreenOneSecondFlicker", + "GreenTwoSecondFlicker", + "GreenInvertedSingleFlash", + "GreenInvertedDoubleFlash", + "Red", + "RedSlowSingleFlash", + "RedSlowDoubleFlash", + "RedSlowIsoPhase", + "RedQuickIsoPhase", + "RedInvertedSingleFlash", + "RedInvertedDoubleFlash", + "Yellow", + "YellowSlowIsoPhase", + "GreenRedSlowIsoPhase" + ], + "readOnly": true, + "type": "string", + "x-enum-varnames": [ + "Unknown", + "Off", + "Green", + "GreenSlowSingleFlash", + "GreenSlowDoubleFlash", + "GreenSlowIsoPhase", + "GreenQuickIsoPhase", + "GreenFastIsoPhase", + "GreenOneSecondFlicker", + "GreenTwoSecondFlicker", + "GreenInvertedSingleFlash", + "GreenInvertedDoubleFlash", + "Red", + "RedSlowSingleFlash", + "RedSlowDoubleFlash", + "RedSlowIsoPhase", + "RedQuickIsoPhase", + "RedInvertedSingleFlash", + "RedInvertedDoubleFlash", + "Yellow", + "YellowSlowIsoPhase", + "GreenRedSlowIsoPhase" + ], + "x-oapi-codegen-extra-tags": { + "bson": "state" + } + } + } + } +} diff --git a/src/device/service/drivers/xr/setup_test_env.sh b/src/device/service/drivers/xr/setup_test_env.sh new file mode 100755 index 0000000000000000000000000000000000000000..92ff4a0312fb8f963f934f4cfd8d18603675aed0 --- /dev/null +++ b/src/device/service/drivers/xr/setup_test_env.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# 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. + +export CONTEXTSERVICE_SERVICE_HOST=$(kubectl get service/contextservice --namespace tfs --template '{{.spec.clusterIP}}') +export CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service/contextservice --namespace tfs -o jsonpath='{.spec.ports[?(@.name=="grpc")].port}') +export COMPUTESERVICE_SERVICE_HOST=$(kubectl get service/computeservice --namespace tfs --template '{{.spec.clusterIP}}') +export COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service/computeservice --namespace tfs -o jsonpath='{.spec.ports[?(@.name=="http")].port}') +echo "CONTEXTSERVICE_SERVICE_HOST=$CONTEXTSERVICE_SERVICE_HOST" +echo "CONTEXTSERVICE_SERVICE_PORT_GRPC=$CONTEXTSERVICE_SERVICE_PORT_GRPC" +echo "COMPUTESERVICE_SERVICE_HOST=$COMPUTESERVICE_SERVICE_HOST" +echo "COMPUTESERVICE_SERVICE_PORT_HTTP=$COMPUTESERVICE_SERVICE_PORT_HTTP" diff --git a/src/device/service/monitoring/MonitoringLoop.py b/src/device/service/monitoring/MonitoringLoop.py new file mode 100644 index 0000000000000000000000000000000000000000..296ff8f7e51d9a98ca3ec9f0b885228087cf88de --- /dev/null +++ b/src/device/service/monitoring/MonitoringLoop.py @@ -0,0 +1,43 @@ +# 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 queue, threading +from device.service.driver_api._Driver import _Driver + +class MonitoringLoop: + def __init__(self, device_uuid : str, driver : _Driver, samples_queue : queue.Queue) -> None: + self._device_uuid = device_uuid + self._driver = driver + self._samples_queue = samples_queue + self._running = threading.Event() + self._terminate = threading.Event() + self._samples_stream = self._driver.GetState(blocking=True, terminate=self._terminate) + self._collector_thread = threading.Thread(target=self._collect, daemon=True) + + def _collect(self) -> None: + for sample in self._samples_stream: + if self._terminate.is_set(): break + sample = (self._device_uuid, *sample) + self._samples_queue.put_nowait(sample) + + def start(self): + self._collector_thread.start() + self._running.set() + + @property + def is_running(self): return self._running.is_set() + + def stop(self): + self._terminate.set() + self._collector_thread.join() diff --git a/src/device/service/monitoring/MonitoringLoops.py b/src/device/service/monitoring/MonitoringLoops.py new file mode 100644 index 0000000000000000000000000000000000000000..2acbfdf53293373c03a6470301547ff0b5c7b34b --- /dev/null +++ b/src/device/service/monitoring/MonitoringLoops.py @@ -0,0 +1,174 @@ +# 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, queue, threading +from typing import Dict, Optional, Tuple, Union +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.proto.monitoring_pb2 import Kpi +from monitoring.client.MonitoringClient import MonitoringClient +from ..driver_api._Driver import _Driver +from .MonitoringLoop import MonitoringLoop + +LOGGER = logging.getLogger(__name__) + +QUEUE_GET_WAIT_TIMEOUT = 0.5 + +def value_to_grpc(value : Union[bool, float, int, str]) -> Dict: + if isinstance(value, int): + kpi_value_field_name = 'int64Val' + kpi_value_field_cast = int + elif isinstance(value, float): + kpi_value_field_name = 'floatVal' + kpi_value_field_cast = float + elif isinstance(value, bool): + kpi_value_field_name = 'boolVal' + kpi_value_field_cast = bool + else: + kpi_value_field_name = 'stringVal' + kpi_value_field_cast = str + + return {kpi_value_field_name: kpi_value_field_cast(value)} + +TYPE_TARGET_KEY = Tuple[str, str] # (device_uuid, monitoring_resource_key) +TYPE_TARGET_KPI = Tuple[str, float, float] # (kpi_uuid, sampling_duration, sampling_interval) +TYPE_KPI_DETAIL = Tuple[str, str, float, float] # (device_uuid, monitoring_resource_key, + # sampling_duration, sampling_interval) + +class MonitoringLoops: + def __init__(self) -> None: + self._monitoring_client = MonitoringClient() + self._samples_queue = queue.Queue() + self._running = threading.Event() + self._terminate = threading.Event() + + self._lock_device_endpoint = threading.Lock() + self._device_endpoint_sampletype__to__resource_key : Dict[Tuple[str, str, int], str] = dict() + + self._lock_monitoring_loop = threading.Lock() + self._device_uuid__to__monitoring_loop : Dict[str, MonitoringLoop] = dict() + + self._lock_kpis = threading.Lock() + self._target_to_kpi : Dict[TYPE_TARGET_KEY, TYPE_TARGET_KPI] = dict() + self._kpi_to_detail : Dict[str, TYPE_KPI_DETAIL] = dict() + + self._exporter_thread = threading.Thread(target=self._export, daemon=True) + + def add_device(self, device_uuid : str, driver : _Driver) -> None: + with self._lock_monitoring_loop: + monitoring_loop = self._device_uuid__to__monitoring_loop.get(device_uuid) + if (monitoring_loop is not None) and monitoring_loop.is_running: return + monitoring_loop = MonitoringLoop(device_uuid, driver, self._samples_queue) + self._device_uuid__to__monitoring_loop[device_uuid] = monitoring_loop + monitoring_loop.start() + + def remove_device(self, device_uuid : str) -> None: + with self._lock_monitoring_loop: + monitoring_loop = self._device_uuid__to__monitoring_loop.get(device_uuid) + if monitoring_loop is None: return + if monitoring_loop.is_running: monitoring_loop.stop() + self._device_uuid__to__monitoring_loop.pop(device_uuid, None) + + def add_resource_key( + self, device_uuid : str, endpoint_uuid : str, kpi_sample_type : KpiSampleType, resource_key : str + ) -> None: + with self._lock_device_endpoint: + key = (device_uuid, endpoint_uuid, kpi_sample_type) + self._device_endpoint_sampletype__to__resource_key[key] = resource_key + + def get_resource_key( + self, device_uuid : str, endpoint_uuid : str, kpi_sample_type : KpiSampleType + ) -> Optional[str]: + with self._lock_device_endpoint: + key = (device_uuid, endpoint_uuid, kpi_sample_type) + return self._device_endpoint_sampletype__to__resource_key.get(key) + + def get_all_resource_keys(self) -> Dict[Tuple[str, str, int], str]: + with self._lock_device_endpoint: + return copy.deepcopy(self._device_endpoint_sampletype__to__resource_key) + + def remove_resource_key( + self, device_uuid : str, endpoint_uuid : str, kpi_sample_type : KpiSampleType + ) -> None: + with self._lock_device_endpoint: + key = (device_uuid, endpoint_uuid, kpi_sample_type) + self._device_endpoint_sampletype__to__resource_key.pop(key, None) + + def add_kpi( + self, device_uuid : str, monitoring_resource_key : str, kpi_uuid : str, sampling_duration : float, + sampling_interval : float + ) -> None: + with self._lock_kpis: + kpi_key = (device_uuid, monitoring_resource_key) + kpi_values = (kpi_uuid, sampling_duration, sampling_interval) + self._target_to_kpi[kpi_key] = kpi_values + + kpi_details = (device_uuid, monitoring_resource_key, sampling_duration, sampling_interval) + self._kpi_to_detail[kpi_uuid] = kpi_details + + def get_kpi_by_uuid(self, kpi_uuid : str) -> Optional[TYPE_KPI_DETAIL]: + with self._lock_kpis: + return self._kpi_to_detail.get(kpi_uuid) + + def get_kpi_by_metric( + self, device_uuid : str, monitoring_resource_key : str + ) -> Optional[TYPE_TARGET_KPI]: + with self._lock_kpis: + kpi_key = (device_uuid, monitoring_resource_key) + return self._target_to_kpi.get(kpi_key) + + def remove_kpi(self, kpi_uuid : str) -> None: + with self._lock_kpis: + kpi_details = self._kpi_to_detail.pop(kpi_uuid, None) + if kpi_details is None: return + kpi_key = kpi_details[0:2] # (device_uuid, monitoring_resource_key, _, _) + self._target_to_kpi.pop(kpi_key, None) + + def start(self): + self._exporter_thread.start() + + @property + def is_running(self): return self._running.is_set() + + def stop(self): + self._terminate.set() + self._exporter_thread.join() + + def _export(self) -> None: + self._running.set() + while not self._terminate.is_set(): + try: + sample = self._samples_queue.get(block=True, timeout=QUEUE_GET_WAIT_TIMEOUT) + #LOGGER.debug('[MonitoringLoops:_export] sample={:s}'.format(str(sample))) + except queue.Empty: + continue + + device_uuid, timestamp, monitoring_resource_key, value = sample + + kpi_details = self.get_kpi_by_metric(device_uuid, monitoring_resource_key) + if kpi_details is None: + MSG = 'Kpi for Device({:s})/MonitoringResourceKey({:s}) not found' + LOGGER.warning(MSG.format(str(device_uuid), str(monitoring_resource_key))) + continue + kpi_uuid,_,_ = kpi_details + + try: + self._monitoring_client.IncludeKpi(Kpi(**{ + 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, + 'timestamp': {'timestamp': timestamp}, + 'kpi_value': value_to_grpc(value), + })) + except: # pylint: disable=bare-except + LOGGER.exception('Unable to format/send Kpi') + + self._running.clear() diff --git a/src/device/service/monitoring/__init__.py b/src/device/service/monitoring/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/device/service/monitoring/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/device/tests/.gitignore b/src/device/tests/.gitignore index b5f6bc13b7b17daa79d9e67c5fc0c50338d089a1..4cbf5059c2f905c16aac6234e2b9ca0ac7584c09 100644 --- a/src/device/tests/.gitignore +++ b/src/device/tests/.gitignore @@ -1,3 +1,5 @@ # Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. +Device_OpenConfig_Adva* +Device_OpenConfig_Cisco* Device_OpenConfig_Infinera* Device_Transport_Api* diff --git a/src/device/tests/CommonObjects.py b/src/device/tests/CommonObjects.py index de82cfcc01164ee95bf3d77a0946f4a4b85598fc..ce41c4a2ab585284c7646038b3c223fa8a8531a7 100644 --- a/src/device/tests/CommonObjects.py +++ b/src/device/tests/CommonObjects.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,19 +12,19 @@ # See the License for the specific language governing permissions and # limitations under the License. -from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.proto.kpi_sample_types_pb2 import KpiSampleType from common.tools.object_factory.Context import json_context, json_context_id from common.tools.object_factory.Topology import json_topology, json_topology_id -from context.proto.kpi_sample_types_pb2 import KpiSampleType # ----- Context -------------------------------------------------------------------------------------------------------- -CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_UUID) -CONTEXT = json_context(DEFAULT_CONTEXT_UUID) +CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) +CONTEXT = json_context(DEFAULT_CONTEXT_NAME) # ----- Topology ------------------------------------------------------------------------------------------------------- -TOPOLOGY_ID = json_topology_id(DEFAULT_TOPOLOGY_UUID, context_id=CONTEXT_ID) -TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_UUID, context_id=CONTEXT_ID) +TOPOLOGY_ID = json_topology_id(DEFAULT_TOPOLOGY_NAME, context_id=CONTEXT_ID) +TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_NAME, context_id=CONTEXT_ID) # ----- KPI Sample Types ----------------------------------------------------------------------------------------------- diff --git a/src/device/tests/Device_Emulated.py b/src/device/tests/Device_Emulated.py index 467017d6e61c2949a36319a8b84e1725ecdd6b7f..bb5dfa5f39e2e3ec3c07f9f49dc55e03c8e3c88d 100644 --- a/src/device/tests/Device_Emulated.py +++ b/src/device/tests/Device_Emulated.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +from common.proto.kpi_sample_types_pb2 import KpiSampleType from common.tools.object_factory.ConfigRule import json_config_rule_delete, json_config_rule_set from common.tools.object_factory.Device import ( json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, json_device_id) -from context.proto.kpi_sample_types_pb2 import KpiSampleType from device.tests.CommonObjects import PACKET_PORT_SAMPLE_TYPES -DEVICE_EMU_UUID = 'EMULATED' +DEVICE_EMU_UUID = 'R1-EMU' DEVICE_EMU_ID = json_device_id(DEVICE_EMU_UUID) DEVICE_EMU = json_device_emulated_packet_router_disabled(DEVICE_EMU_UUID) DEVICE_EMU_EP_UUIDS = ['EP1', 'EP2', 'EP3', 'EP4'] diff --git a/src/device/tests/Device_Microwave_Template.py b/src/device/tests/Device_Microwave_Template.py new file mode 100644 index 0000000000000000000000000000000000000000..38e96e2b0fcf30282068334157d634d98164e2e5 --- /dev/null +++ b/src/device/tests/Device_Microwave_Template.py @@ -0,0 +1,46 @@ +# 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 common.tools.object_factory.ConfigRule import json_config_rule_delete, json_config_rule_set +from common.tools.object_factory.Device import ( + json_device_connect_rules, json_device_id, json_device_microwave_disabled) + +DEVICE_MICROWAVE_UUID = 'DEVICE-MICROWAVE' # populate 'device-uuid' of the MICROWAVE SMDC server +DEVICE_MICROWAVE_ADDRESS = '127.0.0.1' # populate 'address' of the MICROWAVE SMDC server +DEVICE_MICROWAVE_PORT = 8443 # populate 'port' of the MICROWAVE SMDC server +DEVICE_MICROWAVE_TIMEOUT = 120 # populate 'timeout' of the MICROWAVE SMDC server + +DEVICE_MICROWAVE_ID = json_device_id(DEVICE_MICROWAVE_UUID) +DEVICE_MICROWAVE = json_device_microwave_disabled(DEVICE_MICROWAVE_UUID) + +DEVICE_MICROWAVE_CONNECT_RULES = json_device_connect_rules(DEVICE_MICROWAVE_ADDRESS, DEVICE_MICROWAVE_PORT, { + 'timeout' : DEVICE_MICROWAVE_TIMEOUT, +}) + +DEVICE_MICROWAVE_CONFIG_RULES = [ + json_config_rule_set('/services/service[service_uuid]', { + 'uuid' : 'service-uuid', # populate 'service_name of the service to test + 'node_id_src': '172.26.60.243', # populate 'node_id_src' of the service to test + 'tp_id_src' : 9, # populate 'tp_id_src' of the service to test + 'node_id_dst': '172.26.60.244', # populate 'node_id_dst' of the service to test + 'tp_id_dst' : 9, # populate 'tp_id_dst' of the service to test + 'vlan_id' : 121, # populate 'vlan_id' of the service to test + }) +] + +DEVICE_MICROWAVE_DECONFIG_RULES = [ + json_config_rule_delete('/services/service[service-uuid]', { + 'uuid': 'service-uuid' # populate 'service_name' of the service to test + }) +] diff --git a/src/device/tests/Device_OpenConfig_Template.py b/src/device/tests/Device_OpenConfig_Template.py index df588b3d8a65883e0ebbfeacb222648bda0455ed..8ab45337514bf354d8b338c8bb97721d099355f4 100644 --- a/src/device/tests/Device_OpenConfig_Template.py +++ b/src/device/tests/Device_OpenConfig_Template.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,16 +20,23 @@ DEVICE_OC_ADDRESS = '127.0.0.1' # populate the Netconf Server IP address of th DEVICE_OC_PORT = 830 # populate the Netconf Server port of the device to test DEVICE_OC_USERNAME = 'username' # populate the Netconf Server username of the device to test DEVICE_OC_PASSWORD = 'password' # populate the Netconf Server password of the device to test -DEVICE_OC_TIMEOUT = 120 +DEVICE_OC_TIMEOUT = 15 DEVICE_OC_ID = json_device_id(DEVICE_OC_UUID) DEVICE_OC = json_device_packetrouter_disabled(DEVICE_OC_UUID) DEVICE_OC_CONNECT_RULES = json_device_connect_rules(DEVICE_OC_ADDRESS, DEVICE_OC_PORT, { - 'username': DEVICE_OC_USERNAME, - 'password': DEVICE_OC_PASSWORD, - 'timeout' : DEVICE_OC_TIMEOUT, + 'username' : DEVICE_OC_USERNAME, + 'password' : DEVICE_OC_PASSWORD, + 'force_running' : False, + 'hostkey_verify' : True, + 'look_for_keys' : True, + 'allow_agent' : True, + 'delete_rule' : False, + 'device_params' : {'name': 'default'}, + 'manager_params' : {'timeout' : DEVICE_OC_TIMEOUT}, }) + DEVICE_OC_CONFIG_RULES = [] # populate your configuration rules to test DEVICE_OC_DECONFIG_RULES = [] # populate your deconfiguration rules to test diff --git a/src/device/tests/Device_Transport_Api_Template.py b/src/device/tests/Device_Transport_Api_Template.py index ef4fa4d57700637121f7d64113c57120ffbc49a4..73408ebc070b8df3e07ddfaed19785b825a92975 100644 --- a/src/device/tests/Device_Transport_Api_Template.py +++ b/src/device/tests/Device_Transport_Api_Template.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/device/tests/MockMonitoringService.py b/src/device/tests/MockMonitoringService.py deleted file mode 100644 index 3e8550058daa905517f26a659a08c66db1172d74..0000000000000000000000000000000000000000 --- a/src/device/tests/MockMonitoringService.py +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import grpc, logging -from concurrent import futures -from queue import Queue -from monitoring.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD -from monitoring.proto.monitoring_pb2_grpc import add_MonitoringServiceServicer_to_server -from .MockMonitoringServiceServicerImpl import MockMonitoringServiceServicerImpl - -BIND_ADDRESS = '0.0.0.0' -LOGGER = logging.getLogger(__name__) - -class MockMonitoringService: - def __init__( - self, address=BIND_ADDRESS, port=GRPC_SERVICE_PORT, max_workers=GRPC_MAX_WORKERS, - grace_period=GRPC_GRACE_PERIOD): - - self.queue_samples = Queue() - self.address = address - self.port = port - self.endpoint = None - self.max_workers = max_workers - self.grace_period = grace_period - self.monitoring_servicer = None - self.pool = None - self.server = None - - def start(self): - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(self.port)) - LOGGER.info('Starting Service (tentative endpoint: {:s}, max_workers: {:s})...'.format( - str(self.endpoint), str(self.max_workers))) - - self.pool = futures.ThreadPoolExecutor(max_workers=self.max_workers) - self.server = grpc.server(self.pool) # , interceptors=(tracer_interceptor,)) - - self.monitoring_servicer = MockMonitoringServiceServicerImpl(self.queue_samples) - add_MonitoringServiceServicer_to_server(self.monitoring_servicer, self.server) - - port = self.server.add_insecure_port(self.endpoint) - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(port)) - LOGGER.info('Listening on {:s}...'.format(str(self.endpoint))) - self.server.start() - - LOGGER.debug('Service started') - - def stop(self): - LOGGER.debug('Stopping service (grace period {:s} seconds)...'.format(str(self.grace_period))) - self.server.stop(self.grace_period) - LOGGER.debug('Service stopped') diff --git a/src/device/tests/MockService_Dependencies.py b/src/device/tests/MockService_Dependencies.py new file mode 100644 index 0000000000000000000000000000000000000000..8216b0f8e07b1d76dbfd7b2a9d39909486636431 --- /dev/null +++ b/src/device/tests/MockService_Dependencies.py @@ -0,0 +1,50 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os, queue +from typing import Union +from common.Constants import ServiceNameEnum +from common.Settings import ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name +from common.proto.context_pb2_grpc import add_ContextServiceServicer_to_server +from common.proto.monitoring_pb2_grpc import add_MonitoringServiceServicer_to_server +from common.tests.MockServicerImpl_Context import MockServicerImpl_Context +from common.tests.MockServicerImpl_Monitoring import MockServicerImpl_Monitoring +from common.tools.service.GenericGrpcService import GenericGrpcService + +LOCAL_HOST = '127.0.0.1' + +SERVICE_CONTEXT = ServiceNameEnum.CONTEXT +SERVICE_MONITORING = ServiceNameEnum.MONITORING + +class MockService_Dependencies(GenericGrpcService): + # Mock Service implementing Context and Monitoring to simplify unitary tests of Device + + def __init__(self, bind_port: Union[str, int]) -> None: + super().__init__(bind_port, LOCAL_HOST, enable_health_servicer=False, cls_name='MockService') + + # pylint: disable=attribute-defined-outside-init + def install_servicers(self): + self.context_servicer = MockServicerImpl_Context() + add_ContextServiceServicer_to_server(self.context_servicer, self.server) + + self.queue_samples = queue.Queue() + self.monitoring_servicer = MockServicerImpl_Monitoring(queue_samples=self.queue_samples) + add_MonitoringServiceServicer_to_server(self.monitoring_servicer, self.server) + + def configure_env_vars(self): + os.environ[get_env_var_name(SERVICE_CONTEXT, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) + + os.environ[get_env_var_name(SERVICE_MONITORING, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_MONITORING, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) diff --git a/src/device/tests/PrepareTestScenario.py b/src/device/tests/PrepareTestScenario.py new file mode 100644 index 0000000000000000000000000000000000000000..c8e72dd77ff8b9d96290b996d346b4f2f2ac7c4b --- /dev/null +++ b/src/device/tests/PrepareTestScenario.py @@ -0,0 +1,80 @@ +# 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 pytest, os +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_service_port_grpc) +from common.proto.context_pb2 import Context, Topology +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from device.service.DeviceService import DeviceService +from device.service.driver_api.DriverFactory import DriverFactory +from device.service.driver_api.DriverInstanceCache import DriverInstanceCache +from device.service.drivers import DRIVERS +from device.tests.CommonObjects import CONTEXT, TOPOLOGY +from device.tests.MockService_Dependencies import MockService_Dependencies +from monitoring.client.MonitoringClient import MonitoringClient + +LOCAL_HOST = '127.0.0.1' +MOCKSERVICE_PORT = 10000 +DEVICE_SERVICE_PORT = MOCKSERVICE_PORT + get_service_port_grpc(ServiceNameEnum.DEVICE) # avoid privileged ports +os.environ[get_env_var_name(ServiceNameEnum.DEVICE, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.DEVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(DEVICE_SERVICE_PORT) + +@pytest.fixture(scope='session') +def mock_service(): + _service = MockService_Dependencies(MOCKSERVICE_PORT) + _service.configure_env_vars() + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def context_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name + _client = ContextClient() + yield _client + _client.close() + +@pytest.fixture(scope='session') +def monitoring_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name + _client = MonitoringClient() + yield _client + _client.close() + +@pytest.fixture(scope='session') +def device_service( + context_client : ContextClient, # pylint: disable=redefined-outer-name + monitoring_client : MonitoringClient): # pylint: disable=redefined-outer-name + + _driver_factory = DriverFactory(DRIVERS) + _driver_instance_cache = DriverInstanceCache(_driver_factory) + _service = DeviceService(_driver_instance_cache) + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def device_client(device_service : DeviceService): # pylint: disable=redefined-outer-name + _client = DeviceClient() + yield _client + _client.close() + +def test_prepare_environment( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + context_client.SetContext(Context(**CONTEXT)) + context_client.SetTopology(Topology(**TOPOLOGY)) diff --git a/src/device/tests/__init__.py b/src/device/tests/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/device/tests/__init__.py +++ b/src/device/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/device/tests/device_p4.py b/src/device/tests/device_p4.py index 577855dd449b1aa67b8b36e78bd57abb47b03b23..de796c2f7c6e1d4d97a48999cece483b2156a43f 100644 --- a/src/device/tests/device_p4.py +++ b/src/device/tests/device_p4.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,35 +16,78 @@ P4 device example configuration. """ -from common.tools.object_factory.ConfigRule import json_config_rule_set -from common.tools.object_factory.Device import json_device_p4_disabled +import os +from common.tools.object_factory.ConfigRule import ( + json_config_rule_set, json_config_rule_delete) +from common.tools.object_factory.Device import ( + json_device_connect_rules, json_device_id, json_device_p4_disabled) -DEVICE_P4_ID = 0 +CUR_PATH = os.path.dirname(os.path.abspath(__file__)) + +DEVICE_P4_DPID = 1 DEVICE_P4_NAME = 'device:leaf1' -DEVICE_P4_ADDRESS = '127.0.0.1' +DEVICE_P4_IP_ADDR = '127.0.0.1' DEVICE_P4_PORT = '50101' DEVICE_P4_VENDOR = 'Open Networking Foundation' DEVICE_P4_HW_VER = 'BMv2 simple_switch' DEVICE_P4_SW_VER = 'Stratum' -DEVICE_P4_PIPECONF = 'org.onosproject.pipelines.fabric' +DEVICE_P4_BIN_PATH = os.path.join(CUR_PATH, 'p4/test-bmv2.json') +DEVICE_P4_INFO_PATH = os.path.join(CUR_PATH, 'p4/test-p4info.txt') DEVICE_P4_WORKERS = 2 DEVICE_P4_GRACE_PERIOD = 60 +DEVICE_P4_TIMEOUT = 60 -DEVICE_P4_UUID = {'device_uuid': {'uuid': DEVICE_P4_NAME}} +DEVICE_P4_UUID = DEVICE_P4_NAME +DEVICE_P4_ID = json_device_id(DEVICE_P4_UUID) DEVICE_P4 = json_device_p4_disabled(DEVICE_P4_UUID) -DEVICE_P4_CONNECT_RULES = [ - json_config_rule_set('_connect/address', DEVICE_P4_ADDRESS), - json_config_rule_set('_connect/port', DEVICE_P4_PORT), - json_config_rule_set('_connect/settings', { - 'id' : int(DEVICE_P4_ID), - 'name' : DEVICE_P4_NAME, - 'hw-ver' : DEVICE_P4_HW_VER, - 'sw-ver' : DEVICE_P4_SW_VER, - 'pipeconf': DEVICE_P4_PIPECONF - }), +DEVICE_P4_CONNECT_RULES = json_device_connect_rules( + DEVICE_P4_IP_ADDR, + DEVICE_P4_PORT, + { + 'id': DEVICE_P4_DPID, + 'name': DEVICE_P4_NAME, + 'vendor': DEVICE_P4_VENDOR, + 'hw_ver': DEVICE_P4_HW_VER, + 'sw_ver': DEVICE_P4_SW_VER, + 'timeout': DEVICE_P4_TIMEOUT, + 'p4bin': DEVICE_P4_BIN_PATH, + 'p4info': DEVICE_P4_INFO_PATH + } +) + +DEVICE_P4_CONFIG_TABLE_ENTRY = [ + json_config_rule_set( + 'table', + { + 'table-name': 'IngressPipeImpl.acl_table', + 'match-fields': [ + { + 'match-field': 'hdr.ethernet.dst_addr', + 'match-value': 'aa:bb:cc:dd:ee:22 &&& ff:ff:ff:ff:ff:ff' + } + ], + 'action-name': 'IngressPipeImpl.clone_to_cpu', + 'action-params': [], + 'priority': 1 + } + ) ] -DEVICE_P4_CONFIG_RULES = [ - json_config_rule_set('key1', 'value1'), +DEVICE_P4_DECONFIG_TABLE_ENTRY = [ + json_config_rule_delete( + 'table', + { + 'table-name': 'IngressPipeImpl.acl_table', + 'match-fields': [ + { + 'match-field': 'hdr.ethernet.dst_addr', + 'match-value': 'aa:bb:cc:dd:ee:22 &&& ff:ff:ff:ff:ff:ff' + } + ], + 'action-name': 'IngressPipeImpl.clone_to_cpu', + 'action-params': [], + 'priority': 1 + } + ) ] diff --git a/src/device/tests/mock_p4runtime_service.py b/src/device/tests/mock_p4runtime_service.py index 77da0113676dc6f820d995b34915df6d0ba30f01..f06a43bb84282fc7b87cb03df0c5d0fab1c98043 100644 --- a/src/device/tests/mock_p4runtime_service.py +++ b/src/device/tests/mock_p4runtime_service.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import grpc from p4.v1 import p4runtime_pb2_grpc from .device_p4 import( - DEVICE_P4_ADDRESS, DEVICE_P4_PORT, + DEVICE_P4_IP_ADDR, DEVICE_P4_PORT, DEVICE_P4_WORKERS, DEVICE_P4_GRACE_PERIOD) from .mock_p4runtime_servicer_impl import MockP4RuntimeServicerImpl @@ -35,7 +35,7 @@ class MockP4RuntimeService: """ def __init__( - self, address=DEVICE_P4_ADDRESS, port=DEVICE_P4_PORT, + self, address=DEVICE_P4_IP_ADDR, port=DEVICE_P4_PORT, max_workers=DEVICE_P4_WORKERS, grace_period=DEVICE_P4_GRACE_PERIOD): self.address = address diff --git a/src/device/tests/mock_p4runtime_servicer_impl.py b/src/device/tests/mock_p4runtime_servicer_impl.py index d29445da43afb58ef062f62c496b0780f92a4648..65bcfab502105c826bd48d4dc6de928245cda4bd 100644 --- a/src/device/tests/mock_p4runtime_servicer_impl.py +++ b/src/device/tests/mock_p4runtime_servicer_impl.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,11 +22,12 @@ from p4.v1 import p4runtime_pb2, p4runtime_pb2_grpc from p4.config.v1 import p4info_pb2 try: - from p4_util import STREAM_ATTR_ARBITRATION, STREAM_ATTR_PACKET + from p4_client import STREAM_ATTR_ARBITRATION, STREAM_ATTR_PACKET except ImportError: - from device.service.drivers.p4.p4_util import STREAM_ATTR_ARBITRATION,\ + from device.service.drivers.p4.p4_client import STREAM_ATTR_ARBITRATION,\ STREAM_ATTR_PACKET + class MockP4RuntimeServicerImpl(p4runtime_pb2_grpc.P4RuntimeServicer): """ A P4Runtime service implementation for testing purposes. diff --git a/src/device/tests/p4/test-bmv2.json b/src/device/tests/p4/test-bmv2.json new file mode 100644 index 0000000000000000000000000000000000000000..f6ef6af34907ae00bcfa1034bb317a8f270b8995 --- /dev/null +++ b/src/device/tests/p4/test-bmv2.json @@ -0,0 +1,1910 @@ +{ + "header_types" : [ + { + "name" : "scalars_0", + "id" : 0, + "fields" : [ + ["tmp_0", 1, false], + ["tmp_1", 1, false], + ["tmp", 1, false], + ["local_metadata_t.l4_src_port", 16, false], + ["local_metadata_t.l4_dst_port", 16, false], + ["local_metadata_t.is_multicast", 1, false], + ["local_metadata_t.next_srv6_sid", 128, false], + ["local_metadata_t.ip_proto", 8, false], + ["local_metadata_t.icmp_type", 8, false], + ["_padding_0", 4, 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" : "cpu_out_header_t", + "id" : 2, + "fields" : [ + ["egress_port", 9, false], + ["_pad", 7, false] + ] + }, + { + "name" : "cpu_in_header_t", + "id" : 3, + "fields" : [ + ["ingress_port", 9, false], + ["_pad", 7, false] + ] + }, + { + "name" : "ethernet_t", + "id" : 4, + "fields" : [ + ["dst_addr", 48, false], + ["src_addr", 48, false], + ["ether_type", 16, false] + ] + }, + { + "name" : "ipv4_t", + "id" : 5, + "fields" : [ + ["version", 4, false], + ["ihl", 4, false], + ["dscp", 6, false], + ["ecn", 2, false], + ["total_len", 16, false], + ["identification", 16, false], + ["flags", 3, false], + ["frag_offset", 13, false], + ["ttl", 8, false], + ["protocol", 8, false], + ["hdr_checksum", 16, false], + ["src_addr", 32, false], + ["dst_addr", 32, false] + ] + }, + { + "name" : "ipv6_t", + "id" : 6, + "fields" : [ + ["version", 4, false], + ["traffic_class", 8, false], + ["flow_label", 20, false], + ["payload_len", 16, false], + ["next_hdr", 8, false], + ["hop_limit", 8, false], + ["src_addr", 128, false], + ["dst_addr", 128, false] + ] + }, + { + "name" : "srv6h_t", + "id" : 7, + "fields" : [ + ["next_hdr", 8, false], + ["hdr_ext_len", 8, false], + ["routing_type", 8, false], + ["segment_left", 8, false], + ["last_entry", 8, false], + ["flags", 8, false], + ["tag", 16, false] + ] + }, + { + "name" : "tcp_t", + "id" : 8, + "fields" : [ + ["src_port", 16, false], + ["dst_port", 16, false], + ["seq_no", 32, false], + ["ack_no", 32, false], + ["data_offset", 4, false], + ["res", 3, false], + ["ecn", 3, false], + ["ctrl", 6, false], + ["window", 16, false], + ["checksum", 16, false], + ["urgent_ptr", 16, false] + ] + }, + { + "name" : "udp_t", + "id" : 9, + "fields" : [ + ["src_port", 16, false], + ["dst_port", 16, false], + ["len", 16, false], + ["checksum", 16, false] + ] + }, + { + "name" : "icmp_t", + "id" : 10, + "fields" : [ + ["type", 8, false], + ["icmp_code", 8, false], + ["checksum", 16, false], + ["identifier", 16, false], + ["sequence_number", 16, false], + ["timestamp", 64, false] + ] + }, + { + "name" : "icmpv6_t", + "id" : 11, + "fields" : [ + ["type", 8, false], + ["code", 8, false], + ["checksum", 16, false] + ] + }, + { + "name" : "ndp_t", + "id" : 12, + "fields" : [ + ["flags", 32, false], + ["target_ipv6_addr", 128, false], + ["type", 8, false], + ["length", 8, false], + ["target_mac_addr", 48, false] + ] + }, + { + "name" : "srv6_list_t", + "id" : 13, + "fields" : [ + ["segment_id", 128, 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" : "cpu_out", + "id" : 2, + "header_type" : "cpu_out_header_t", + "metadata" : false, + "pi_omit" : true + }, + { + "name" : "cpu_in", + "id" : 3, + "header_type" : "cpu_in_header_t", + "metadata" : false, + "pi_omit" : true + }, + { + "name" : "ethernet", + "id" : 4, + "header_type" : "ethernet_t", + "metadata" : false, + "pi_omit" : true + }, + { + "name" : "ipv4", + "id" : 5, + "header_type" : "ipv4_t", + "metadata" : false, + "pi_omit" : true + }, + { + "name" : "ipv6", + "id" : 6, + "header_type" : "ipv6_t", + "metadata" : false, + "pi_omit" : true + }, + { + "name" : "srv6h", + "id" : 7, + "header_type" : "srv6h_t", + "metadata" : false, + "pi_omit" : true + }, + { + "name" : "tcp", + "id" : 8, + "header_type" : "tcp_t", + "metadata" : false, + "pi_omit" : true + }, + { + "name" : "udp", + "id" : 9, + "header_type" : "udp_t", + "metadata" : false, + "pi_omit" : true + }, + { + "name" : "icmp", + "id" : 10, + "header_type" : "icmp_t", + "metadata" : false, + "pi_omit" : true + }, + { + "name" : "icmpv6", + "id" : 11, + "header_type" : "icmpv6_t", + "metadata" : false, + "pi_omit" : true + }, + { + "name" : "ndp", + "id" : 12, + "header_type" : "ndp_t", + "metadata" : false, + "pi_omit" : true + }, + { + "name" : "srv6_list[0]", + "id" : 13, + "header_type" : "srv6_list_t", + "metadata" : false, + "pi_omit" : true + }, + { + "name" : "srv6_list[1]", + "id" : 14, + "header_type" : "srv6_list_t", + "metadata" : false, + "pi_omit" : true + }, + { + "name" : "srv6_list[2]", + "id" : 15, + "header_type" : "srv6_list_t", + "metadata" : false, + "pi_omit" : true + }, + { + "name" : "srv6_list[3]", + "id" : 16, + "header_type" : "srv6_list_t", + "metadata" : false, + "pi_omit" : true + } + ], + "header_stacks" : [ + { + "name" : "srv6_list", + "id" : 0, + "header_type" : "srv6_list_t", + "size" : 4, + "header_ids" : [13, 14, 15, 16] + } + ], + "header_union_types" : [], + "header_unions" : [], + "header_union_stacks" : [], + "field_lists" : [ + { + "id" : 1, + "name" : "fl", + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 474, + "column" : 34, + "source_fragment" : "{ standard_metadata.ingress_port }" + }, + "elements" : [ + { + "type" : "field", + "value" : ["standard_metadata", "ingress_port"] + } + ] + } + ], + "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" : [], + "transitions" : [ + { + "type" : "hexstr", + "value" : "0x00ff", + "mask" : null, + "next_state" : "parse_packet_out" + }, + { + "value" : "default", + "mask" : null, + "next_state" : "parse_ethernet" + } + ], + "transition_key" : [ + { + "type" : "field", + "value" : ["standard_metadata", "ingress_port"] + } + ] + }, + { + "name" : "parse_packet_out", + "id" : 1, + "parser_ops" : [ + { + "parameters" : [ + { + "type" : "regular", + "value" : "cpu_out" + } + ], + "op" : "extract" + } + ], + "transitions" : [ + { + "value" : "default", + "mask" : null, + "next_state" : "parse_ethernet" + } + ], + "transition_key" : [] + }, + { + "name" : "parse_ethernet", + "id" : 2, + "parser_ops" : [ + { + "parameters" : [ + { + "type" : "regular", + "value" : "ethernet" + } + ], + "op" : "extract" + } + ], + "transitions" : [ + { + "type" : "hexstr", + "value" : "0x0800", + "mask" : null, + "next_state" : "parse_ipv4" + }, + { + "type" : "hexstr", + "value" : "0x86dd", + "mask" : null, + "next_state" : "parse_ipv6" + }, + { + "value" : "default", + "mask" : null, + "next_state" : null + } + ], + "transition_key" : [ + { + "type" : "field", + "value" : ["ethernet", "ether_type"] + } + ] + }, + { + "name" : "parse_ipv4", + "id" : 3, + "parser_ops" : [ + { + "parameters" : [ + { + "type" : "regular", + "value" : "ipv4" + } + ], + "op" : "extract" + }, + { + "parameters" : [ + { + "type" : "field", + "value" : ["scalars", "local_metadata_t.ip_proto"] + }, + { + "type" : "field", + "value" : ["ipv4", "protocol"] + } + ], + "op" : "set" + } + ], + "transitions" : [ + { + "type" : "hexstr", + "value" : "0x06", + "mask" : null, + "next_state" : "parse_tcp" + }, + { + "type" : "hexstr", + "value" : "0x11", + "mask" : null, + "next_state" : "parse_udp" + }, + { + "type" : "hexstr", + "value" : "0x01", + "mask" : null, + "next_state" : "parse_icmp" + }, + { + "value" : "default", + "mask" : null, + "next_state" : null + } + ], + "transition_key" : [ + { + "type" : "field", + "value" : ["ipv4", "protocol"] + } + ] + }, + { + "name" : "parse_ipv6", + "id" : 4, + "parser_ops" : [ + { + "parameters" : [ + { + "type" : "regular", + "value" : "ipv6" + } + ], + "op" : "extract" + }, + { + "parameters" : [ + { + "type" : "field", + "value" : ["scalars", "local_metadata_t.ip_proto"] + }, + { + "type" : "field", + "value" : ["ipv6", "next_hdr"] + } + ], + "op" : "set" + } + ], + "transitions" : [ + { + "type" : "hexstr", + "value" : "0x06", + "mask" : null, + "next_state" : "parse_tcp" + }, + { + "type" : "hexstr", + "value" : "0x11", + "mask" : null, + "next_state" : "parse_udp" + }, + { + "type" : "hexstr", + "value" : "0x3a", + "mask" : null, + "next_state" : "parse_icmpv6" + }, + { + "type" : "hexstr", + "value" : "0x2b", + "mask" : null, + "next_state" : "parse_srv6" + }, + { + "value" : "default", + "mask" : null, + "next_state" : null + } + ], + "transition_key" : [ + { + "type" : "field", + "value" : ["ipv6", "next_hdr"] + } + ] + }, + { + "name" : "parse_tcp", + "id" : 5, + "parser_ops" : [ + { + "parameters" : [ + { + "type" : "regular", + "value" : "tcp" + } + ], + "op" : "extract" + }, + { + "parameters" : [ + { + "type" : "field", + "value" : ["scalars", "local_metadata_t.l4_src_port"] + }, + { + "type" : "field", + "value" : ["tcp", "src_port"] + } + ], + "op" : "set" + }, + { + "parameters" : [ + { + "type" : "field", + "value" : ["scalars", "local_metadata_t.l4_dst_port"] + }, + { + "type" : "field", + "value" : ["tcp", "dst_port"] + } + ], + "op" : "set" + } + ], + "transitions" : [ + { + "value" : "default", + "mask" : null, + "next_state" : null + } + ], + "transition_key" : [] + }, + { + "name" : "parse_udp", + "id" : 6, + "parser_ops" : [ + { + "parameters" : [ + { + "type" : "regular", + "value" : "udp" + } + ], + "op" : "extract" + }, + { + "parameters" : [ + { + "type" : "field", + "value" : ["scalars", "local_metadata_t.l4_src_port"] + }, + { + "type" : "field", + "value" : ["udp", "src_port"] + } + ], + "op" : "set" + }, + { + "parameters" : [ + { + "type" : "field", + "value" : ["scalars", "local_metadata_t.l4_dst_port"] + }, + { + "type" : "field", + "value" : ["udp", "dst_port"] + } + ], + "op" : "set" + } + ], + "transitions" : [ + { + "value" : "default", + "mask" : null, + "next_state" : null + } + ], + "transition_key" : [] + }, + { + "name" : "parse_icmp", + "id" : 7, + "parser_ops" : [ + { + "parameters" : [ + { + "type" : "regular", + "value" : "icmp" + } + ], + "op" : "extract" + }, + { + "parameters" : [ + { + "type" : "field", + "value" : ["scalars", "local_metadata_t.icmp_type"] + }, + { + "type" : "field", + "value" : ["icmp", "type"] + } + ], + "op" : "set" + } + ], + "transitions" : [ + { + "value" : "default", + "mask" : null, + "next_state" : null + } + ], + "transition_key" : [] + }, + { + "name" : "parse_icmpv6", + "id" : 8, + "parser_ops" : [ + { + "parameters" : [ + { + "type" : "regular", + "value" : "icmpv6" + } + ], + "op" : "extract" + }, + { + "parameters" : [ + { + "type" : "field", + "value" : ["scalars", "local_metadata_t.icmp_type"] + }, + { + "type" : "field", + "value" : ["icmpv6", "type"] + } + ], + "op" : "set" + } + ], + "transitions" : [ + { + "type" : "hexstr", + "value" : "0x87", + "mask" : null, + "next_state" : "parse_ndp" + }, + { + "type" : "hexstr", + "value" : "0x88", + "mask" : null, + "next_state" : "parse_ndp" + }, + { + "value" : "default", + "mask" : null, + "next_state" : null + } + ], + "transition_key" : [ + { + "type" : "field", + "value" : ["icmpv6", "type"] + } + ] + }, + { + "name" : "parse_ndp", + "id" : 9, + "parser_ops" : [ + { + "parameters" : [ + { + "type" : "regular", + "value" : "ndp" + } + ], + "op" : "extract" + } + ], + "transitions" : [ + { + "value" : "default", + "mask" : null, + "next_state" : null + } + ], + "transition_key" : [] + }, + { + "name" : "parse_srv6", + "id" : 10, + "parser_ops" : [ + { + "parameters" : [ + { + "type" : "regular", + "value" : "srv6h" + } + ], + "op" : "extract" + } + ], + "transitions" : [ + { + "value" : "default", + "mask" : null, + "next_state" : "parse_srv6_list" + } + ], + "transition_key" : [] + }, + { + "name" : "parse_srv6_list", + "id" : 11, + "parser_ops" : [ + { + "parameters" : [ + { + "type" : "stack", + "value" : "srv6_list" + } + ], + "op" : "extract" + }, + { + "parameters" : [ + { + "type" : "field", + "value" : ["scalars", "tmp_0"] + }, + { + "type" : "expression", + "value" : { + "type" : "expression", + "value" : { + "op" : "?", + "left" : { + "type" : "hexstr", + "value" : "0x01" + }, + "right" : { + "type" : "hexstr", + "value" : "0x00" + }, + "cond" : { + "type" : "expression", + "value" : { + "op" : "==", + "left" : { + "type" : "expression", + "value" : { + "op" : "&", + "left" : { + "type" : "expression", + "value" : { + "op" : "+", + "left" : { + "type" : "expression", + "value" : { + "op" : "&", + "left" : { + "type" : "field", + "value" : ["srv6h", "segment_left"] + }, + "right" : { + "type" : "hexstr", + "value" : "0xffffffff" + } + } + }, + "right" : { + "type" : "hexstr", + "value" : "0xffffffff" + } + } + }, + "right" : { + "type" : "hexstr", + "value" : "0xffffffff" + } + } + }, + "right" : { + "type" : "expression", + "value" : { + "op" : "last_stack_index", + "left" : null, + "right" : { + "type" : "header_stack", + "value" : "srv6_list" + } + } + } + } + } + } + } + } + ], + "op" : "set" + } + ], + "transitions" : [ + { + "type" : "hexstr", + "value" : "0x01", + "mask" : null, + "next_state" : "mark_current_srv6" + }, + { + "value" : "default", + "mask" : null, + "next_state" : "check_last_srv6" + } + ], + "transition_key" : [ + { + "type" : "field", + "value" : ["scalars", "tmp_0"] + } + ] + }, + { + "name" : "mark_current_srv6", + "id" : 12, + "parser_ops" : [ + { + "parameters" : [ + { + "type" : "field", + "value" : ["scalars", "local_metadata_t.next_srv6_sid"] + }, + { + "type" : "expression", + "value" : { + "type" : "stack_field", + "value" : ["srv6_list", "segment_id"] + } + } + ], + "op" : "set" + } + ], + "transitions" : [ + { + "value" : "default", + "mask" : null, + "next_state" : "check_last_srv6" + } + ], + "transition_key" : [] + }, + { + "name" : "check_last_srv6", + "id" : 13, + "parser_ops" : [ + { + "parameters" : [ + { + "type" : "field", + "value" : ["scalars", "tmp_1"] + }, + { + "type" : "expression", + "value" : { + "type" : "expression", + "value" : { + "op" : "?", + "left" : { + "type" : "hexstr", + "value" : "0x01" + }, + "right" : { + "type" : "hexstr", + "value" : "0x00" + }, + "cond" : { + "type" : "expression", + "value" : { + "op" : "==", + "left" : { + "type" : "expression", + "value" : { + "op" : "&", + "left" : { + "type" : "field", + "value" : ["srv6h", "last_entry"] + }, + "right" : { + "type" : "hexstr", + "value" : "0xffffffff" + } + } + }, + "right" : { + "type" : "expression", + "value" : { + "op" : "last_stack_index", + "left" : null, + "right" : { + "type" : "header_stack", + "value" : "srv6_list" + } + } + } + } + } + } + } + } + ], + "op" : "set" + } + ], + "transitions" : [ + { + "type" : "hexstr", + "value" : "0x01", + "mask" : null, + "next_state" : "parse_srv6_next_hdr" + }, + { + "type" : "hexstr", + "value" : "0x00", + "mask" : null, + "next_state" : "parse_srv6_list" + } + ], + "transition_key" : [ + { + "type" : "field", + "value" : ["scalars", "tmp_1"] + } + ] + }, + { + "name" : "parse_srv6_next_hdr", + "id" : 14, + "parser_ops" : [], + "transitions" : [ + { + "type" : "hexstr", + "value" : "0x06", + "mask" : null, + "next_state" : "parse_tcp" + }, + { + "type" : "hexstr", + "value" : "0x11", + "mask" : null, + "next_state" : "parse_udp" + }, + { + "type" : "hexstr", + "value" : "0x3a", + "mask" : null, + "next_state" : "parse_icmpv6" + }, + { + "value" : "default", + "mask" : null, + "next_state" : null + } + ], + "transition_key" : [ + { + "type" : "field", + "value" : ["srv6h", "next_hdr"] + } + ] + } + ] + } + ], + "parse_vsets" : [], + "deparsers" : [ + { + "name" : "deparser", + "id" : 0, + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 602, + "column" : 8, + "source_fragment" : "DeparserImpl" + }, + "order" : ["cpu_in", "ethernet", "ipv4", "ipv6", "srv6h", "srv6_list[0]", "srv6_list[1]", "srv6_list[2]", "srv6_list[3]", "tcp", "udp", "icmp", "icmpv6", "ndp"] + } + ], + "meter_arrays" : [], + "counter_arrays" : [ + { + "name" : "l2_exact_table_counter", + "id" : 0, + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 399, + "column" : 8, + "source_fragment" : "counters" + }, + "is_direct" : true, + "binding" : "IngressPipeImpl.l2_exact_table" + }, + { + "name" : "l2_ternary_table_counter", + "id" : 1, + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 423, + "column" : 8, + "source_fragment" : "counters" + }, + "is_direct" : true, + "binding" : "IngressPipeImpl.l2_ternary_table" + }, + { + "name" : "acl_table_counter", + "id" : 2, + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 494, + "column" : 8, + "source_fragment" : "counters" + }, + "is_direct" : true, + "binding" : "IngressPipeImpl.acl_table" + } + ], + "register_arrays" : [], + "calculations" : [ + { + "name" : "calc", + "id" : 0, + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 580, + "column" : 8, + "source_fragment" : "update_checksum(hdr.ndp.isValid(), ..." + }, + "algo" : "csum16", + "input" : [ + { + "type" : "field", + "value" : ["ipv6", "src_addr"] + }, + { + "type" : "field", + "value" : ["ipv6", "dst_addr"] + }, + { + "type" : "field", + "value" : ["ipv6", "payload_len"] + }, + { + "type" : "hexstr", + "value" : "0x00", + "bitwidth" : 8 + }, + { + "type" : "field", + "value" : ["ipv6", "next_hdr"] + }, + { + "type" : "field", + "value" : ["icmpv6", "type"] + }, + { + "type" : "field", + "value" : ["icmpv6", "code"] + }, + { + "type" : "field", + "value" : ["ndp", "flags"] + }, + { + "type" : "field", + "value" : ["ndp", "target_ipv6_addr"] + }, + { + "type" : "field", + "value" : ["ndp", "type"] + }, + { + "type" : "field", + "value" : ["ndp", "length"] + }, + { + "type" : "field", + "value" : ["ndp", "target_mac_addr"] + } + ] + } + ], + "learn_lists" : [], + "actions" : [ + { + "name" : "NoAction", + "id" : 0, + "runtime_data" : [], + "primitives" : [] + }, + { + "name" : "IngressPipeImpl.drop", + "id" : 1, + "runtime_data" : [], + "primitives" : [ + { + "op" : "mark_to_drop", + "parameters" : [ + { + "type" : "header", + "value" : "standard_metadata" + } + ], + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 351, + "column" : 8, + "source_fragment" : "mark_to_drop(standard_metadata)" + } + } + ] + }, + { + "name" : "IngressPipeImpl.drop", + "id" : 2, + "runtime_data" : [], + "primitives" : [ + { + "op" : "mark_to_drop", + "parameters" : [ + { + "type" : "header", + "value" : "standard_metadata" + } + ], + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 351, + "column" : 8, + "source_fragment" : "mark_to_drop(standard_metadata)" + } + } + ] + }, + { + "name" : "IngressPipeImpl.drop", + "id" : 3, + "runtime_data" : [], + "primitives" : [ + { + "op" : "mark_to_drop", + "parameters" : [ + { + "type" : "header", + "value" : "standard_metadata" + } + ], + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 351, + "column" : 8, + "source_fragment" : "mark_to_drop(standard_metadata)" + } + } + ] + }, + { + "name" : "IngressPipeImpl.set_egress_port", + "id" : 4, + "runtime_data" : [ + { + "name" : "port_num", + "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" : 383, + "column" : 8, + "source_fragment" : "standard_metadata.egress_spec = port_num" + } + } + ] + }, + { + "name" : "IngressPipeImpl.set_multicast_group", + "id" : 5, + "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" : 409, + "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" : 410, + "column" : 8, + "source_fragment" : "local_metadata.is_multicast = true" + } + } + ] + }, + { + "name" : "IngressPipeImpl.send_to_cpu", + "id" : 6, + "runtime_data" : [], + "primitives" : [ + { + "op" : "assign", + "parameters" : [ + { + "type" : "field", + "value" : ["standard_metadata", "egress_spec"] + }, + { + "type" : "hexstr", + "value" : "0x00ff" + } + ], + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 466, + "column" : 8, + "source_fragment" : "standard_metadata.egress_spec = 255" + } + } + ] + }, + { + "name" : "IngressPipeImpl.clone_to_cpu", + "id" : 7, + "runtime_data" : [], + "primitives" : [ + { + "op" : "clone_ingress_pkt_to_egress", + "parameters" : [ + { + "type" : "hexstr", + "value" : "0x00000063" + }, + { + "type" : "hexstr", + "value" : "0x1" + } + ], + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 474, + "column" : 8, + "source_fragment" : "clone3(CloneType.I2E, 99, { standard_metadata.ingress_port })" + } + } + ] + }, + { + "name" : "act", + "id" : 8, + "runtime_data" : [], + "primitives" : [ + { + "op" : "assign", + "parameters" : [ + { + "type" : "field", + "value" : ["scalars", "tmp"] + }, + { + "type" : "expression", + "value" : { + "type" : "expression", + "value" : { + "op" : "b2d", + "left" : null, + "right" : { + "type" : "bool", + "value" : true + } + } + } + } + ] + } + ] + }, + { + "name" : "act_0", + "id" : 9, + "runtime_data" : [], + "primitives" : [ + { + "op" : "assign", + "parameters" : [ + { + "type" : "field", + "value" : ["scalars", "tmp"] + }, + { + "type" : "expression", + "value" : { + "type" : "expression", + "value" : { + "op" : "b2d", + "left" : null, + "right" : { + "type" : "bool", + "value" : false + } + } + } + } + ] + } + ] + }, + { + "name" : "act_1", + "id" : 10, + "runtime_data" : [], + "primitives" : [ + { + "op" : "mark_to_drop", + "parameters" : [ + { + "type" : "header", + "value" : "standard_metadata" + } + ], + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 567, + "column" : 12, + "source_fragment" : "mark_to_drop(standard_metadata)" + } + } + ] + } + ], + "pipelines" : [ + { + "name" : "ingress", + "id" : 0, + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 345, + "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" : 386, + "column" : 10, + "source_fragment" : "l2_exact_table" + }, + "key" : [ + { + "match_type" : "exact", + "name" : "hdr.ethernet.dst_addr", + "target" : ["ethernet", "dst_addr"], + "mask" : null + } + ], + "match_type" : "exact", + "type" : "simple", + "max_size" : 1024, + "with_counters" : true, + "support_timeout" : false, + "direct_meters" : null, + "action_ids" : [4, 1], + "actions" : ["IngressPipeImpl.set_egress_port", "IngressPipeImpl.drop"], + "base_default_next" : null, + "next_tables" : { + "__HIT__" : "tbl_act", + "__MISS__" : "tbl_act_0" + }, + "default_entry" : { + "action_id" : 1, + "action_const" : true, + "action_data" : [], + "action_entry_const" : true + } + }, + { + "name" : "tbl_act", + "id" : 1, + "key" : [], + "match_type" : "exact", + "type" : "simple", + "max_size" : 1024, + "with_counters" : false, + "support_timeout" : false, + "direct_meters" : null, + "action_ids" : [8], + "actions" : ["act"], + "base_default_next" : "node_5", + "next_tables" : { + "act" : "node_5" + }, + "default_entry" : { + "action_id" : 8, + "action_const" : true, + "action_data" : [], + "action_entry_const" : true + } + }, + { + "name" : "tbl_act_0", + "id" : 2, + "key" : [], + "match_type" : "exact", + "type" : "simple", + "max_size" : 1024, + "with_counters" : false, + "support_timeout" : false, + "direct_meters" : null, + "action_ids" : [9], + "actions" : ["act_0"], + "base_default_next" : "node_5", + "next_tables" : { + "act_0" : "node_5" + }, + "default_entry" : { + "action_id" : 9, + "action_const" : true, + "action_data" : [], + "action_entry_const" : true + } + }, + { + "name" : "IngressPipeImpl.l2_ternary_table", + "id" : 3, + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 413, + "column" : 10, + "source_fragment" : "l2_ternary_table" + }, + "key" : [ + { + "match_type" : "ternary", + "name" : "hdr.ethernet.dst_addr", + "target" : ["ethernet", "dst_addr"], + "mask" : null + } + ], + "match_type" : "ternary", + "type" : "simple", + "max_size" : 1024, + "with_counters" : true, + "support_timeout" : false, + "direct_meters" : null, + "action_ids" : [5, 2], + "actions" : ["IngressPipeImpl.set_multicast_group", "IngressPipeImpl.drop"], + "base_default_next" : "IngressPipeImpl.acl_table", + "next_tables" : { + "IngressPipeImpl.set_multicast_group" : "IngressPipeImpl.acl_table", + "IngressPipeImpl.drop" : "IngressPipeImpl.acl_table" + }, + "default_entry" : { + "action_id" : 2, + "action_const" : true, + "action_data" : [], + "action_entry_const" : true + } + }, + { + "name" : "IngressPipeImpl.acl_table", + "id" : 4, + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 477, + "column" : 10, + "source_fragment" : "acl_table" + }, + "key" : [ + { + "match_type" : "ternary", + "name" : "standard_metadata.ingress_port", + "target" : ["standard_metadata", "ingress_port"], + "mask" : null + }, + { + "match_type" : "ternary", + "name" : "hdr.ethernet.dst_addr", + "target" : ["ethernet", "dst_addr"], + "mask" : null + }, + { + "match_type" : "ternary", + "name" : "hdr.ethernet.src_addr", + "target" : ["ethernet", "src_addr"], + "mask" : null + }, + { + "match_type" : "ternary", + "name" : "hdr.ethernet.ether_type", + "target" : ["ethernet", "ether_type"], + "mask" : null + }, + { + "match_type" : "ternary", + "name" : "local_metadata.ip_proto", + "target" : ["scalars", "local_metadata_t.ip_proto"], + "mask" : null + }, + { + "match_type" : "ternary", + "name" : "local_metadata.icmp_type", + "target" : ["scalars", "local_metadata_t.icmp_type"], + "mask" : null + }, + { + "match_type" : "ternary", + "name" : "local_metadata.l4_src_port", + "target" : ["scalars", "local_metadata_t.l4_src_port"], + "mask" : null + }, + { + "match_type" : "ternary", + "name" : "local_metadata.l4_dst_port", + "target" : ["scalars", "local_metadata_t.l4_dst_port"], + "mask" : null + } + ], + "match_type" : "ternary", + "type" : "simple", + "max_size" : 1024, + "with_counters" : true, + "support_timeout" : false, + "direct_meters" : null, + "action_ids" : [6, 7, 3, 0], + "actions" : ["IngressPipeImpl.send_to_cpu", "IngressPipeImpl.clone_to_cpu", "IngressPipeImpl.drop", "NoAction"], + "base_default_next" : null, + "next_tables" : { + "IngressPipeImpl.send_to_cpu" : null, + "IngressPipeImpl.clone_to_cpu" : null, + "IngressPipeImpl.drop" : null, + "NoAction" : null + }, + "default_entry" : { + "action_id" : 0, + "action_const" : false, + "action_data" : [], + "action_entry_const" : false + } + } + ], + "action_profiles" : [], + "conditionals" : [ + { + "name" : "node_5", + "id" : 0, + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 533, + "column" : 16, + "source_fragment" : "!l2_exact_table.apply().hit" + }, + "expression" : { + "type" : "expression", + "value" : { + "op" : "not", + "left" : null, + "right" : { + "type" : "expression", + "value" : { + "op" : "d2b", + "left" : null, + "right" : { + "type" : "field", + "value" : ["scalars", "tmp"] + } + } + } + } + }, + "true_next" : "IngressPipeImpl.l2_ternary_table", + "false_next" : "IngressPipeImpl.acl_table" + } + ] + }, + { + "name" : "egress", + "id" : 1, + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 546, + "column" : 8, + "source_fragment" : "EgressPipeImpl" + }, + "init_table" : "node_10", + "tables" : [ + { + "name" : "tbl_act_1", + "id" : 5, + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 567, + "column" : 12, + "source_fragment" : "mark_to_drop(standard_metadata)" + }, + "key" : [], + "match_type" : "exact", + "type" : "simple", + "max_size" : 1024, + "with_counters" : false, + "support_timeout" : false, + "direct_meters" : null, + "action_ids" : [10], + "actions" : ["act_1"], + "base_default_next" : null, + "next_tables" : { + "act_1" : null + }, + "default_entry" : { + "action_id" : 10, + "action_const" : true, + "action_data" : [], + "action_entry_const" : true + } + } + ], + "action_profiles" : [], + "conditionals" : [ + { + "name" : "node_10", + "id" : 1, + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 565, + "column" : 12, + "source_fragment" : "local_metadata.is_multicast == true && ..." + }, + "expression" : { + "type" : "expression", + "value" : { + "op" : "and", + "left" : { + "type" : "expression", + "value" : { + "op" : "==", + "left" : { + "type" : "expression", + "value" : { + "op" : "d2b", + "left" : null, + "right" : { + "type" : "field", + "value" : ["scalars", "local_metadata_t.is_multicast"] + } + } + }, + "right" : { + "type" : "bool", + "value" : true + } + } + }, + "right" : { + "type" : "expression", + "value" : { + "op" : "==", + "left" : { + "type" : "field", + "value" : ["standard_metadata", "ingress_port"] + }, + "right" : { + "type" : "field", + "value" : ["standard_metadata", "egress_port"] + } + } + } + } + }, + "false_next" : null, + "true_next" : "tbl_act_1" + } + ] + } + ], + "checksums" : [ + { + "name" : "cksum", + "id" : 0, + "source_info" : { + "filename" : "p4src/main.p4", + "line" : 580, + "column" : 8, + "source_fragment" : "update_checksum(hdr.ndp.isValid(), ..." + }, + "target" : ["icmpv6", "checksum"], + "type" : "generic", + "calculation" : "calc", + "verify" : false, + "update" : true, + "if_cond" : { + "type" : "expression", + "value" : { + "op" : "d2b", + "left" : null, + "right" : { + "type" : "field", + "value" : ["ndp", "$valid$"] + } + } + } + } + ], + "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/device/tests/p4/test-p4info.txt b/src/device/tests/p4/test-p4info.txt new file mode 100644 index 0000000000000000000000000000000000000000..6382852ad8f597786003252184153b526c66fb9e --- /dev/null +++ b/src/device/tests/p4/test-p4info.txt @@ -0,0 +1,245 @@ +pkg_info { + arch: "v1model" +} +tables { + preamble { + id: 33605373 + name: "IngressPipeImpl.l2_exact_table" + alias: "l2_exact_table" + } + match_fields { + id: 1 + name: "hdr.ethernet.dst_addr" + bitwidth: 48 + match_type: EXACT + } + action_refs { + id: 16812802 + } + action_refs { + id: 16796182 + annotations: "@defaultonly" + scope: DEFAULT_ONLY + } + const_default_action_id: 16796182 + direct_resource_ids: 318813612 + size: 1024 +} +tables { + preamble { + id: 33573501 + name: "IngressPipeImpl.l2_ternary_table" + alias: "l2_ternary_table" + } + match_fields { + id: 1 + name: "hdr.ethernet.dst_addr" + bitwidth: 48 + match_type: TERNARY + } + action_refs { + id: 16841371 + } + action_refs { + id: 16796182 + annotations: "@defaultonly" + scope: DEFAULT_ONLY + } + const_default_action_id: 16796182 + direct_resource_ids: 318768597 + size: 1024 +} +tables { + preamble { + id: 33557865 + name: "IngressPipeImpl.acl_table" + alias: "acl_table" + } + match_fields { + id: 1 + name: "standard_metadata.ingress_port" + bitwidth: 9 + match_type: TERNARY + } + match_fields { + id: 2 + name: "hdr.ethernet.dst_addr" + bitwidth: 48 + match_type: TERNARY + } + match_fields { + id: 3 + name: "hdr.ethernet.src_addr" + bitwidth: 48 + match_type: TERNARY + } + match_fields { + id: 4 + name: "hdr.ethernet.ether_type" + bitwidth: 16 + match_type: TERNARY + } + match_fields { + id: 5 + name: "local_metadata.ip_proto" + bitwidth: 8 + match_type: TERNARY + } + match_fields { + id: 6 + name: "local_metadata.icmp_type" + bitwidth: 8 + match_type: TERNARY + } + match_fields { + id: 7 + name: "local_metadata.l4_src_port" + bitwidth: 16 + match_type: TERNARY + } + match_fields { + id: 8 + name: "local_metadata.l4_dst_port" + bitwidth: 16 + match_type: TERNARY + } + action_refs { + id: 16833331 + } + action_refs { + id: 16782152 + } + action_refs { + id: 16796182 + } + action_refs { + id: 16800567 + annotations: "@defaultonly" + scope: DEFAULT_ONLY + } + direct_resource_ids: 318773822 + size: 1024 +} +actions { + preamble { + id: 16800567 + name: "NoAction" + alias: "NoAction" + } +} +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_num" + bitwidth: 9 + } +} +actions { + preamble { + id: 16841371 + name: "IngressPipeImpl.set_multicast_group" + alias: "set_multicast_group" + } + params { + id: 1 + name: "gid" + bitwidth: 16 + } +} +actions { + preamble { + id: 16833331 + name: "IngressPipeImpl.send_to_cpu" + alias: "send_to_cpu" + } +} +actions { + preamble { + id: 16782152 + name: "IngressPipeImpl.clone_to_cpu" + alias: "clone_to_cpu" + } +} +direct_counters { + preamble { + id: 318813612 + name: "l2_exact_table_counter" + alias: "l2_exact_table_counter" + } + spec { + unit: BOTH + } + direct_table_id: 33605373 +} +direct_counters { + preamble { + id: 318768597 + name: "l2_ternary_table_counter" + alias: "l2_ternary_table_counter" + } + spec { + unit: BOTH + } + direct_table_id: 33573501 +} +direct_counters { + preamble { + id: 318773822 + name: "acl_table_counter" + alias: "acl_table_counter" + } + spec { + unit: BOTH + } + direct_table_id: 33557865 +} +controller_packet_metadata { + preamble { + id: 67132047 + name: "packet_in" + alias: "packet_in" + annotations: "@controller_header(\"packet_in\")" + } + metadata { + id: 1 + name: "ingress_port" + bitwidth: 9 + } + metadata { + id: 2 + name: "_pad" + bitwidth: 7 + } +} +controller_packet_metadata { + preamble { + id: 67111875 + name: "packet_out" + alias: "packet_out" + annotations: "@controller_header(\"packet_out\")" + } + metadata { + id: 1 + name: "egress_port" + bitwidth: 9 + } + metadata { + id: 2 + name: "_pad" + bitwidth: 7 + } +} +type_info { +} diff --git a/src/device/tests/test_internal_p4.py b/src/device/tests/test_internal_p4.py new file mode 100644 index 0000000000000000000000000000000000000000..a09ec79ef97e7b83f366f1b60966d3cc68134a37 --- /dev/null +++ b/src/device/tests/test_internal_p4.py @@ -0,0 +1,252 @@ +# 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. + +""" +Internal P4 driver tests. +""" + +import pytest +from device.service.drivers.p4.p4_driver import P4Driver +from device.service.drivers.p4.p4_common import ( + matches_mac, encode_mac, decode_mac, encode, + matches_ipv4, encode_ipv4, decode_ipv4, + matches_ipv6, encode_ipv6, decode_ipv6, + encode_num, decode_num +) +from .device_p4 import( + DEVICE_P4_IP_ADDR, DEVICE_P4_PORT, DEVICE_P4_DPID, DEVICE_P4_NAME, + DEVICE_P4_VENDOR, DEVICE_P4_HW_VER, DEVICE_P4_SW_VER, + DEVICE_P4_WORKERS, DEVICE_P4_GRACE_PERIOD, + DEVICE_P4_CONFIG_TABLE_ENTRY, DEVICE_P4_DECONFIG_TABLE_ENTRY) +from .mock_p4runtime_service import MockP4RuntimeService + + +@pytest.fixture(scope='session') +def p4runtime_service(): + """ + Spawn a mock P4Runtime server. + + :return: void + """ + _service = MockP4RuntimeService( + address=DEVICE_P4_IP_ADDR, port=DEVICE_P4_PORT, + max_workers=DEVICE_P4_WORKERS, + grace_period=DEVICE_P4_GRACE_PERIOD) + _service.start() + yield _service + _service.stop() + + +@pytest.fixture(scope='session') +def device_driverapi_p4(): + """ + Invoke an instance of the P4 driver. + + :return: void + """ + _driver = P4Driver( + address=DEVICE_P4_IP_ADDR, + port=DEVICE_P4_PORT, + id=DEVICE_P4_DPID, + name=DEVICE_P4_NAME, + vendor=DEVICE_P4_VENDOR, + hw_ver=DEVICE_P4_HW_VER, + sw_ver=DEVICE_P4_SW_VER) + _driver.Connect() + yield _driver + _driver.Disconnect() + + +def test_device_driverapi_p4_setconfig( + p4runtime_service: MockP4RuntimeService, + device_driverapi_p4: P4Driver): + """ + Test the SetConfig RPC of the P4 driver API. + + :param p4runtime_service: Mock P4Runtime service + :param device_driverapi_p4: instance of the P4 device driver + :return: void + """ + result = device_driverapi_p4.SetConfig( + DEVICE_P4_CONFIG_TABLE_ENTRY + ) + assert list(result) + + +def test_device_driverapi_p4_getconfig( + p4runtime_service: MockP4RuntimeService, + device_driverapi_p4: P4Driver): + """ + Test the GetConfig RPC of the P4 driver API. + + :param p4runtime_service: Mock P4Runtime service + :param device_driverapi_p4: instance of the P4 device driver + :return: void + """ + pytest.skip('Skipping test: GetConfig') + + +def test_device_driverapi_p4_getresource( + p4runtime_service: MockP4RuntimeService, + device_driverapi_p4: P4Driver): + """ + Test the GetResource RPC of the P4 driver API. + + :param p4runtime_service: Mock P4Runtime service + :param device_driverapi_p4: instance of the P4 device driver + :return: void + """ + pytest.skip('Skipping test: GetResource') + + +def test_device_driverapi_p4_deleteconfig( + p4runtime_service: MockP4RuntimeService, + device_driverapi_p4: P4Driver): + """ + Test the DeleteConfig RPC of the P4 driver API. + + :param p4runtime_service: Mock P4Runtime service + :param device_driverapi_p4: instance of the P4 device driver + :return: void + """ + result = device_driverapi_p4.DeleteConfig( + DEVICE_P4_DECONFIG_TABLE_ENTRY + ) + assert list(result) + + +def test_device_driverapi_p4_subscribe_state( + p4runtime_service: MockP4RuntimeService, + device_driverapi_p4: P4Driver): + """ + Test the SubscribeState RPC of the P4 driver API. + + :param p4runtime_service: Mock P4Runtime service + :param device_driverapi_p4: instance of the P4 device driver + :return: void + """ + pytest.skip('Skipping test: SubscribeState') + + +def test_device_driverapi_p4_getstate( + p4runtime_service: MockP4RuntimeService, + device_driverapi_p4: P4Driver): + """ + Test the GetState RPC of the P4 driver API. + + :param p4runtime_service: Mock P4Runtime service + :param device_driverapi_p4: instance of the P4 device driver + :return: void + """ + pytest.skip('Skipping test: GetState') + + +def test_device_driverapi_p4_unsubscribe_state( + p4runtime_service: MockP4RuntimeService, + device_driverapi_p4: P4Driver): + """ + Test the UnsubscribeState RPC of the P4 driver API. + + :param p4runtime_service: Mock P4Runtime service + :param device_driverapi_p4: instance of the P4 device driver + :return: void + """ + pytest.skip('Skipping test: UnsubscribeState') + + +def test_p4_common_mac(): + """ + Test MAC converters. + + :return: void + """ + wrong_mac = "aa:bb:cc:dd:ee" + assert not matches_mac(wrong_mac) + + mac = "aa:bb:cc:dd:ee:fe" + assert matches_mac(mac) + enc_mac = encode_mac(mac) + assert enc_mac == b'\xaa\xbb\xcc\xdd\xee\xfe',\ + "String-based MAC address to bytes failed" + enc_mac = encode(mac, 6*8) + assert enc_mac == b'\xaa\xbb\xcc\xdd\xee\xfe',\ + "String-based MAC address to bytes failed" + dec_mac = decode_mac(enc_mac) + assert mac == dec_mac,\ + "MAC address bytes to string failed" + + +def test_p4_common_ipv4(): + """ + Test IPv4 converters. + + :return: void + """ + assert not matches_ipv4("10.0.0.1.5") + assert not matches_ipv4("256.0.0.1") + assert not matches_ipv4("256.0.1") + assert not matches_ipv4("10001") + + ipv4 = "10.0.0.1" + assert matches_ipv4(ipv4) + enc_ipv4 = encode_ipv4(ipv4) + assert enc_ipv4 == b'\x0a\x00\x00\x01',\ + "String-based IPv4 address to bytes failed" + dec_ipv4 = decode_ipv4(enc_ipv4) + assert ipv4 == dec_ipv4,\ + "IPv4 address bytes to string failed" + + +def test_p4_common_ipv6(): + """ + Test IPv6 converters. + + :return: void + """ + assert not matches_ipv6('10.0.0.1') + assert matches_ipv6('2001:0000:85a3::8a2e:370:1111') + + ipv6 = "1:2:3:4:5:6:7:8" + assert matches_ipv6(ipv6) + enc_ipv6 = encode_ipv6(ipv6) + assert enc_ipv6 == \ + b'\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08',\ + "String-based IPv6 address to bytes failed" + dec_ipv6 = decode_ipv6(enc_ipv6) + assert ipv6 == dec_ipv6,\ + "IPv6 address bytes to string failed" + + +def test_p4_common_numbers(): + """ + Test numerical converters. + + :return: void + """ + num = 1337 + byte_len = 5 + enc_num = encode_num(num, byte_len * 8) + assert enc_num == b'\x00\x00\x00\x05\x39',\ + "Number to bytes conversion failed" + dec_num = decode_num(enc_num) + assert num == dec_num,\ + "Bytes to number conversion failed" + assert encode((num,), byte_len * 8) == enc_num + assert encode([num], byte_len * 8) == enc_num + + num = 256 + try: + encode_num(num, 8) + except OverflowError: + pass diff --git a/src/device/tests/test_unit_p4.py b/src/device/tests/test_unit_p4.py deleted file mode 100644 index 853d9d8a5fa4795fbec1445bd0f9d518402023c7..0000000000000000000000000000000000000000 --- a/src/device/tests/test_unit_p4.py +++ /dev/null @@ -1,97 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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 pytest -from device.service.drivers.p4.p4_driver import P4Driver -from .device_p4 import( - DEVICE_P4_ADDRESS, DEVICE_P4_PORT, DEVICE_P4_ID, DEVICE_P4_NAME, - DEVICE_P4_VENDOR, DEVICE_P4_HW_VER, DEVICE_P4_SW_VER, - DEVICE_P4_PIPECONF, DEVICE_P4_WORKERS, DEVICE_P4_GRACE_PERIOD) -from .mock_p4runtime_service import MockP4RuntimeService - - -@pytest.fixture(scope='session') -def p4runtime_service(): - _service = MockP4RuntimeService( - address=DEVICE_P4_ADDRESS, port=DEVICE_P4_PORT, - max_workers=DEVICE_P4_WORKERS, - grace_period=DEVICE_P4_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() - - -@pytest.fixture(scope='session') -def device_driverapi_p4(): - _driver = P4Driver( - address=DEVICE_P4_ADDRESS, - port=DEVICE_P4_PORT, - id=DEVICE_P4_ID, - name=DEVICE_P4_NAME, - vendor=DEVICE_P4_VENDOR, - hw_ver=DEVICE_P4_HW_VER, - sw_ver=DEVICE_P4_SW_VER, - pipeconf=DEVICE_P4_PIPECONF) - _driver.Connect() - yield _driver - _driver.Disconnect() - - -def test_device_driverapi_p4_setconfig( - p4runtime_service: MockP4RuntimeService, - device_driverapi_p4: P4Driver): # pylint: disable=redefined-outer-name - device_driverapi_p4.SetConfig([]) - return - - -def test_device_driverapi_p4_getconfig( - p4runtime_service: MockP4RuntimeService, - device_driverapi_p4: P4Driver): # pylint: disable=redefined-outer-name - device_driverapi_p4.GetConfig() - return - - -def test_device_driverapi_p4_getresource( - p4runtime_service: MockP4RuntimeService, - device_driverapi_p4: P4Driver): # pylint: disable=redefined-outer-name - device_driverapi_p4.GetResource("") - return - - -def test_device_driverapi_p4_getstate( - p4runtime_service: MockP4RuntimeService, - device_driverapi_p4: P4Driver): # pylint: disable=redefined-outer-name - device_driverapi_p4.GetState() - return - - -def test_device_driverapi_p4_deleteconfig( - p4runtime_service: MockP4RuntimeService, - device_driverapi_p4: P4Driver): # pylint: disable=redefined-outer-name - device_driverapi_p4.DeleteConfig([]) - return - - -def test_device_driverapi_p4_subscribe_state( - p4runtime_service: MockP4RuntimeService, - device_driverapi_p4: P4Driver): # pylint: disable=redefined-outer-name - device_driverapi_p4.SubscribeState([]) - return - - -def test_device_driverapi_p4_unsubscribe_state( - p4runtime_service: MockP4RuntimeService, - device_driverapi_p4: P4Driver): # pylint: disable=redefined-outer-name - device_driverapi_p4.UnsubscribeState([]) - return diff --git a/src/device/tests/test_unitary.py b/src/device/tests/test_unitary.py deleted file mode 100644 index d5b779ec2ea4642cab8e1bfa1306835d4e8e7015..0000000000000000000000000000000000000000 --- a/src/device/tests/test_unitary.py +++ /dev/null @@ -1,980 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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 calendar, copy, dateutil.parser, grpc, json, logging, operator, os, pytest, queue, time -from datetime import datetime, timezone -from typing import Tuple -from common.orm.Database import Database -from common.orm.Factory import get_database_backend, BackendEnum as DatabaseBackendEnum -from common.message_broker.Factory import get_messagebroker_backend, BackendEnum as MessageBrokerBackendEnum -from common.message_broker.MessageBroker import MessageBroker -from common.tools.grpc.Tools import grpc_message_to_json_string -from common.tools.object_factory.EndPoint import json_endpoint, json_endpoint_id -from context.Config import ( - GRPC_SERVICE_PORT as CONTEXT_GRPC_SERVICE_PORT, GRPC_MAX_WORKERS as CONTEXT_GRPC_MAX_WORKERS, - GRPC_GRACE_PERIOD as CONTEXT_GRPC_GRACE_PERIOD) -from context.client.ContextClient import ContextClient -from context.proto.context_pb2 import DeviceId, DeviceOperationalStatusEnum -from context.service.grpc_server.ContextService import ContextService -from device.Config import ( - GRPC_SERVICE_PORT as DEVICE_GRPC_SERVICE_PORT, GRPC_MAX_WORKERS as DEVICE_GRPC_MAX_WORKERS, - GRPC_GRACE_PERIOD as DEVICE_GRPC_GRACE_PERIOD) -from device.client.DeviceClient import DeviceClient -from device.proto.context_pb2 import ConfigActionEnum, Context, Device, Topology -from device.proto.device_pb2 import MonitoringSettings -from device.proto.kpi_sample_types_pb2 import KpiSampleType -from device.service.DeviceService import DeviceService -from device.service.driver_api._Driver import _Driver -from device.service.driver_api.DriverFactory import DriverFactory -from device.service.driver_api.DriverInstanceCache import DriverInstanceCache -from device.service.drivers import DRIVERS -from device.tests.MockMonitoringService import MockMonitoringService -from monitoring.Config import ( - GRPC_SERVICE_PORT as MONITORING_GRPC_SERVICE_PORT, GRPC_MAX_WORKERS as MONITORING_GRPC_MAX_WORKERS, - GRPC_GRACE_PERIOD as MONITORING_GRPC_GRACE_PERIOD) -from monitoring.client.monitoring_client import MonitoringClient -from .CommonObjects import CONTEXT, TOPOLOGY - -from .Device_Emulated import ( - DEVICE_EMU, DEVICE_EMU_CONFIG_ADDRESSES, DEVICE_EMU_CONFIG_ENDPOINTS, DEVICE_EMU_CONNECT_RULES, - DEVICE_EMU_DECONFIG_ADDRESSES, DEVICE_EMU_DECONFIG_ENDPOINTS, DEVICE_EMU_EP_DESCS, DEVICE_EMU_ENDPOINTS_COOKED, - DEVICE_EMU_ID, DEVICE_EMU_RECONFIG_ADDRESSES, DEVICE_EMU_UUID) -ENABLE_EMULATED = True - -try: - from .Device_OpenConfig_Infinera1 import( - #from .Device_OpenConfig_Infinera2 import( - DEVICE_OC, DEVICE_OC_CONFIG_RULES, DEVICE_OC_DECONFIG_RULES, DEVICE_OC_CONNECT_RULES, DEVICE_OC_ID, - DEVICE_OC_UUID) - ENABLE_OPENCONFIG = True -except ImportError: - ENABLE_OPENCONFIG = False - -try: - from .Device_Transport_Api_CTTC import ( - DEVICE_TAPI, DEVICE_TAPI_CONNECT_RULES, DEVICE_TAPI_UUID, DEVICE_TAPI_ID, DEVICE_TAPI_CONFIG_RULES, - DEVICE_TAPI_DECONFIG_RULES) - ENABLE_TAPI = True -except ImportError: - ENABLE_TAPI = False - -from .mock_p4runtime_service import MockP4RuntimeService -try: - from .device_p4 import( - DEVICE_P4, DEVICE_P4_ID, DEVICE_P4_UUID, DEVICE_P4_NAME, DEVICE_P4_ADDRESS, DEVICE_P4_PORT, DEVICE_P4_WORKERS, - DEVICE_P4_GRACE_PERIOD, DEVICE_P4_CONNECT_RULES, DEVICE_P4_CONFIG_RULES) - ENABLE_P4 = True -except ImportError: - ENABLE_P4 = False - -#ENABLE_EMULATED = False # set to False to disable tests of Emulated devices -#ENABLE_OPENCONFIG = False # set to False to disable tests of OpenConfig devices -#ENABLE_TAPI = False # set to False to disable tests of TAPI devices -ENABLE_P4 = False # set to False to disable tests of P4 devices (P4 device not available in GitLab) - -logging.getLogger('apscheduler.executors.default').setLevel(logging.WARNING) -logging.getLogger('apscheduler.scheduler').setLevel(logging.WARNING) -logging.getLogger('monitoring-client').setLevel(logging.WARNING) - -LOGGER = logging.getLogger(__name__) -LOGGER.setLevel(logging.DEBUG) - -CONTEXT_GRPC_SERVICE_PORT = 10000 + CONTEXT_GRPC_SERVICE_PORT # avoid privileged ports -DEVICE_GRPC_SERVICE_PORT = 10000 + DEVICE_GRPC_SERVICE_PORT # avoid privileged ports -MONITORING_GRPC_SERVICE_PORT = 10000 + MONITORING_GRPC_SERVICE_PORT # avoid privileged ports - -DEFAULT_REDIS_SERVICE_HOST = '127.0.0.1' -DEFAULT_REDIS_SERVICE_PORT = 6379 -DEFAULT_REDIS_DATABASE_ID = 0 - -REDIS_CONFIG = { - 'REDIS_SERVICE_HOST': os.environ.get('REDIS_SERVICE_HOST', DEFAULT_REDIS_SERVICE_HOST), - 'REDIS_SERVICE_PORT': os.environ.get('REDIS_SERVICE_PORT', DEFAULT_REDIS_SERVICE_PORT), - 'REDIS_DATABASE_ID' : os.environ.get('REDIS_DATABASE_ID', DEFAULT_REDIS_DATABASE_ID ), -} - -SCENARIOS = [ - ('all_inmemory', DatabaseBackendEnum.INMEMORY, {}, MessageBrokerBackendEnum.INMEMORY, {} ), - #('all_redis', DatabaseBackendEnum.REDIS, REDIS_CONFIG, MessageBrokerBackendEnum.REDIS, REDIS_CONFIG), -] - -@pytest.fixture(scope='session', ids=[str(scenario[0]) for scenario in SCENARIOS], params=SCENARIOS) -def context_db_mb(request) -> Tuple[Database, MessageBroker]: - name,db_backend,db_settings,mb_backend,mb_settings = request.param - msg = 'Running scenario {:s} db_backend={:s}, db_settings={:s}, mb_backend={:s}, mb_settings={:s}...' - LOGGER.info(msg.format(str(name), str(db_backend.value), str(db_settings), str(mb_backend.value), str(mb_settings))) - _database = Database(get_database_backend(backend=db_backend, **db_settings)) - _message_broker = MessageBroker(get_messagebroker_backend(backend=mb_backend, **mb_settings)) - yield _database, _message_broker - _message_broker.terminate() - -@pytest.fixture(scope='session') -def context_service(context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name - _service = ContextService( - context_db_mb[0], context_db_mb[1], port=CONTEXT_GRPC_SERVICE_PORT, max_workers=CONTEXT_GRPC_MAX_WORKERS, - grace_period=CONTEXT_GRPC_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def context_client(context_service : ContextService): # pylint: disable=redefined-outer-name - _client = ContextClient(address='127.0.0.1', port=CONTEXT_GRPC_SERVICE_PORT) - yield _client - _client.close() - -@pytest.fixture(scope='session') -def monitoring_service(): - _service = MockMonitoringService(port=MONITORING_GRPC_SERVICE_PORT, max_workers=MONITORING_GRPC_MAX_WORKERS, - grace_period=MONITORING_GRPC_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def monitoring_client(monitoring_service : MockMonitoringService): # pylint: disable=redefined-outer-name - _client = MonitoringClient(server='127.0.0.1', port=MONITORING_GRPC_SERVICE_PORT) - #yield _client - #_client.close() - return _client - -@pytest.fixture(scope='session') -def device_service( - context_client : ContextClient, # pylint: disable=redefined-outer-name - monitoring_client : MonitoringClient): # pylint: disable=redefined-outer-name - - _driver_factory = DriverFactory(DRIVERS) - _driver_instance_cache = DriverInstanceCache(_driver_factory) - _service = DeviceService( - context_client, monitoring_client, _driver_instance_cache, port=DEVICE_GRPC_SERVICE_PORT, - max_workers=DEVICE_GRPC_MAX_WORKERS, grace_period=DEVICE_GRPC_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def device_client(device_service : DeviceService): # pylint: disable=redefined-outer-name - _client = DeviceClient(address='127.0.0.1', port=DEVICE_GRPC_SERVICE_PORT) - yield _client - _client.close() - -@pytest.fixture(scope='session') -def p4runtime_service(): - _service = MockP4RuntimeService( - address=DEVICE_P4_ADDRESS, port=DEVICE_P4_PORT, - max_workers=DEVICE_P4_WORKERS, - grace_period=DEVICE_P4_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() - - -def test_prepare_environment( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - context_client.SetContext(Context(**CONTEXT)) - context_client.SetTopology(Topology(**TOPOLOGY)) - - -# ----- Test Device Driver Emulated -------------------------------------------- -# Device Driver Emulated tests are used to validate Driver API as well as Emulated Device Driver. Note that other -# Drivers might support a different set of resource paths, and attributes/values per resource; however, they must -# implement the Driver API. - -def test_device_emulated_add_error_cases( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_EMULATED: pytest.skip('Skipping test: No Emulated device has been configured') - - with pytest.raises(grpc.RpcError) as e: - DEVICE_EMU_WITH_ENDPOINTS = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_ENDPOINTS['device_endpoints'].append(json_endpoint(DEVICE_EMU_ID, 'ep-id', 'ep-type')) - device_client.AddDevice(Device(**DEVICE_EMU_WITH_ENDPOINTS)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg_head = 'device.device_endpoints([' - msg_tail = ']) is invalid; RPC method AddDevice does not accept Endpoints. '\ - 'Endpoints are discovered through interrogation of the physical device.' - except_msg = str(e.value.details()) - assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) - - with pytest.raises(grpc.RpcError) as e: - DEVICE_EMU_WITH_EXTRA_RULES = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONNECT_RULES) - DEVICE_EMU_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONFIG_ENDPOINTS) - device_client.AddDevice(Device(**DEVICE_EMU_WITH_EXTRA_RULES)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg_head = 'device.device_config.config_rules([' - msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ - 'with "_connect/" tag. Others should be configured after adding the device.' - except_msg = str(e.value.details()) - assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) - - -def test_device_emulated_add_correct( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_EMULATED: pytest.skip('Skipping test: No Emulated device has been configured') - - DEVICE_EMU_WITH_CONNECT_RULES = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_CONNECT_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONNECT_RULES) - device_client.AddDevice(Device(**DEVICE_EMU_WITH_CONNECT_RULES)) - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_EMU_UUID) # we know the driver exists now - assert driver is not None - - -def test_device_emulated_get( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_EMULATED: pytest.skip('Skipping test: No Emulated device has been configured') - - initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_EMU_ID)) - LOGGER.info('initial_config = {:s}'.format(grpc_message_to_json_string(initial_config))) - - device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) - LOGGER.info('device_data = {:s}'.format(grpc_message_to_json_string(device_data))) - - -def test_device_emulated_configure( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_EMULATED: pytest.skip('Skipping test: No Emulated device has been configured') - - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_EMU_UUID) # we know the driver exists now - assert driver is not None - - driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - assert len(driver_config) == len(DEVICE_EMU_ENDPOINTS_COOKED) - for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: - assert endpoint_cooked in driver_config - - DEVICE_EMU_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONFIG_ENDPOINTS) - device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_CONFIG_RULES)) - - DEVICE_EMU_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONFIG_ADDRESSES) - device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_CONFIG_RULES)) - - DEVICE_EMU_WITH_OPERATIONAL_STATUS = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_OPERATIONAL_STATUS['device_operational_status'] = \ - DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED - device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_OPERATIONAL_STATUS)) - - driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - assert len(driver_config) == len(DEVICE_EMU_ENDPOINTS_COOKED) + len(DEVICE_EMU_CONFIG_ADDRESSES) - for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: - endpoint_cooked = copy.deepcopy(endpoint_cooked) - endpoint_cooked[1]['enabled'] = True - assert endpoint_cooked in driver_config - for config_rule in DEVICE_EMU_CONFIG_ADDRESSES: - assert (config_rule['resource_key'], json.loads(config_rule['resource_value'])) in driver_config - - device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) - assert device_data.device_operational_status == DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED - - config_rules = [ - (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) - for config_rule in device_data.device_config.config_rules - ] - #LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( - # '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) - RESULTING_CONFIG_ENDPOINTS = {cr['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ENDPOINTS)} - for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: - values = json.loads(RESULTING_CONFIG_ENDPOINTS[endpoint_cooked[0]]['resource_value']) - values.update(endpoint_cooked[1]) - RESULTING_CONFIG_ENDPOINTS[endpoint_cooked[0]]['resource_value'] = json.dumps(values, sort_keys=True) - for config_rule in RESULTING_CONFIG_ENDPOINTS.values(): - config_rule = ( - ConfigActionEnum.Name(config_rule['action']), config_rule['resource_key'], - json.loads(json.dumps(config_rule['resource_value']))) - assert config_rule in config_rules - for config_rule in DEVICE_EMU_CONFIG_ADDRESSES: - config_rule = ( - ConfigActionEnum.Name(config_rule['action']), config_rule['resource_key'], - json.loads(json.dumps(config_rule['resource_value']))) - assert config_rule in config_rules - - # Try to reconfigure... - - DEVICE_EMU_WITH_RECONFIG_RULES = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_RECONFIG_RULES['device_operational_status'] = \ - DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED - DEVICE_EMU_WITH_RECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_RECONFIG_ADDRESSES) - device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_RECONFIG_RULES)) - - RESULTING_CONFIG_RULES = {cr['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ENDPOINTS)} - for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: - values = json.loads(RESULTING_CONFIG_RULES[endpoint_cooked[0]]['resource_value']) - values.update(endpoint_cooked[1]) - RESULTING_CONFIG_RULES[endpoint_cooked[0]]['resource_value'] = json.dumps(values, sort_keys=True) - RESULTING_CONFIG_RULES.update({cr['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ADDRESSES)}) - for reconfig_rule in DEVICE_EMU_RECONFIG_ADDRESSES: - if reconfig_rule['action'] == ConfigActionEnum.CONFIGACTION_DELETE: - RESULTING_CONFIG_RULES.pop(reconfig_rule['resource_key'], None) - else: - RESULTING_CONFIG_RULES[reconfig_rule['resource_key']] = reconfig_rule - RESULTING_CONFIG_RULES = RESULTING_CONFIG_RULES.values() - #LOGGER.info('RESULTING_CONFIG_RULES = {:s}'.format(str(RESULTING_CONFIG_RULES))) - - driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - driver_config = json.loads(json.dumps(driver_config)) # prevent integer keys to fail matching with string keys - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - assert len(driver_config) == len(RESULTING_CONFIG_RULES) - for config_rule in RESULTING_CONFIG_RULES: - resource = [config_rule['resource_key'], json.loads(config_rule['resource_value'])] - assert resource in driver_config - - device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) - config_rules = [ - (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) - for config_rule in device_data.device_config.config_rules - ] - #LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( - # '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) - for config_rule in RESULTING_CONFIG_RULES: - config_rule = ( - ConfigActionEnum.Name(config_rule['action']), config_rule['resource_key'], config_rule['resource_value']) - assert config_rule in config_rules - - -def test_device_emulated_monitor( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService, # pylint: disable=redefined-outer-name - monitoring_service : MockMonitoringService): # pylint: disable=redefined-outer-name - - if not ENABLE_EMULATED: pytest.skip('Skipping test: No Emulated device has been configured') - - device_uuid = DEVICE_EMU_UUID - json_device_id = DEVICE_EMU_ID - device_id = DeviceId(**json_device_id) - device_data = context_client.GetDevice(device_id) - #LOGGER.info('device_data = \n{:s}'.format(str(device_data))) - - driver : _Driver = device_service.driver_instance_cache.get(device_uuid) # we know the driver exists now - assert driver is not None - #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - #assert len(driver_config) == len(DEVICE_EMU_ENDPOINTS_COOKED) + len(DEVICE_EMU_CONFIG_ADDRESSES) - - SAMPLING_DURATION_SEC = 10.0 - SAMPLING_INTERVAL_SEC = 2.0 - - MONITORING_SETTINGS_LIST = [] - KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED = {} - for endpoint in device_data.device_endpoints: - endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid - for sample_type_id in endpoint.kpi_sample_types: - sample_type_name = str(KpiSampleType.Name(sample_type_id)).upper().replace('KPISAMPLETYPE_', '') - kpi_uuid = '{:s}-{:s}-{:s}-kpi_uuid'.format(device_uuid, endpoint_uuid, str(sample_type_id)) - monitoring_settings = { - 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, - 'kpi_descriptor': { - 'kpi_description': 'Metric {:s} for Endpoint {:s} in Device {:s}'.format( - sample_type_name, endpoint_uuid, device_uuid), - 'kpi_sample_type': sample_type_id, - 'device_id': json_device_id, - 'endpoint_id': json_endpoint_id(json_device_id, endpoint_uuid), - }, - 'sampling_duration_s': SAMPLING_DURATION_SEC, - 'sampling_interval_s': SAMPLING_INTERVAL_SEC, - } - MONITORING_SETTINGS_LIST.append(monitoring_settings) - KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED[kpi_uuid] = 0 - - NUM_SAMPLES_EXPECTED_PER_KPI = SAMPLING_DURATION_SEC / SAMPLING_INTERVAL_SEC - NUM_SAMPLES_EXPECTED = len(MONITORING_SETTINGS_LIST) * NUM_SAMPLES_EXPECTED_PER_KPI - - # Start monitoring the device - t_start_monitoring = datetime.timestamp(datetime.utcnow()) - for monitoring_settings in MONITORING_SETTINGS_LIST: - device_client.MonitorDeviceKpi(MonitoringSettings(**monitoring_settings)) - - # wait to receive the expected number of samples - # if takes more than 1.5 times the sampling duration, assume there is an error - time_ini = time.time() - queue_samples : queue.Queue = monitoring_service.queue_samples - received_samples = [] - while (len(received_samples) < NUM_SAMPLES_EXPECTED) and (time.time() - time_ini < SAMPLING_DURATION_SEC * 1.5): - try: - received_sample = queue_samples.get(block=True, timeout=SAMPLING_INTERVAL_SEC / NUM_SAMPLES_EXPECTED) - #LOGGER.info('received_sample = {:s}'.format(str(received_sample))) - received_samples.append(received_sample) - except queue.Empty: - continue - - t_end_monitoring = datetime.timestamp(datetime.utcnow()) - - #LOGGER.info('received_samples = {:s}'.format(str(received_samples))) - LOGGER.info('len(received_samples) = {:s}'.format(str(len(received_samples)))) - LOGGER.info('NUM_SAMPLES_EXPECTED = {:s}'.format(str(NUM_SAMPLES_EXPECTED))) - assert len(received_samples) == NUM_SAMPLES_EXPECTED - for received_sample in received_samples: - kpi_uuid = received_sample.kpi_id.kpi_id.uuid - assert kpi_uuid in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED - assert isinstance(received_sample.timestamp, str) - try: - timestamp = float(received_sample.timestamp) - except ValueError: - dt_time = dateutil.parser.isoparse(received_sample.timestamp).replace(tzinfo=timezone.utc) - timestamp = float(calendar.timegm(dt_time.timetuple())) + (dt_time.microsecond / 1.e6) - assert timestamp > t_start_monitoring - assert timestamp < t_end_monitoring - assert received_sample.kpi_value.HasField('floatVal') or received_sample.kpi_value.HasField('intVal') - kpi_value = getattr(received_sample.kpi_value, received_sample.kpi_value.WhichOneof('value')) - assert isinstance(kpi_value, (float, int)) - KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED[kpi_uuid] += 1 - - LOGGER.info('KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED = {:s}'.format(str(KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED))) - for kpi_uuid, num_samples_received in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED.items(): - assert num_samples_received == NUM_SAMPLES_EXPECTED_PER_KPI - - # Unsubscribe monitoring - for kpi_uuid in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED.keys(): - MONITORING_SETTINGS_UNSUBSCRIBE = { - 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, - 'sampling_duration_s': -1, # negative value in sampling_duration_s or sampling_interval_s means unsibscribe - 'sampling_interval_s': -1, # kpi_id is mandatory to unsibscribe - } - device_client.MonitorDeviceKpi(MonitoringSettings(**MONITORING_SETTINGS_UNSUBSCRIBE)) - - -def test_device_emulated_deconfigure( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_EMULATED: pytest.skip('Skipping test: No Emulated device has been configured') - - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_EMU_UUID) # we know the driver exists now - assert driver is not None - - driver_config = driver.GetConfig() - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - DEVICE_EMU_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_DECONFIG_RULES['device_operational_status'] = \ - DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED - DEVICE_EMU_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_DECONFIG_ADDRESSES) - device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_DECONFIG_RULES)) - - RESULTING_CONFIG_RULES = {cr['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ENDPOINTS)} - for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: - values = json.loads(RESULTING_CONFIG_RULES[endpoint_cooked[0]]['resource_value']) - values.update(endpoint_cooked[1]) - RESULTING_CONFIG_RULES[endpoint_cooked[0]]['resource_value'] = json.dumps(values, sort_keys=True) - RESULTING_CONFIG_RULES = RESULTING_CONFIG_RULES.values() - driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - driver_config = json.loads(json.dumps(driver_config)) # prevent integer keys to fail matching with string keys - driver_config = list(filter( - lambda config_rule: ( - not isinstance(config_rule[1], str) or not config_rule[1].startswith('do_sampling (trigger:')), - driver_config)) - LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - LOGGER.info('RESULTING_CONFIG_RULES = {:s}'.format(str(RESULTING_CONFIG_RULES))) - assert len(driver_config) == len(RESULTING_CONFIG_RULES) - for config_rule in RESULTING_CONFIG_RULES: - config_rule = [config_rule['resource_key'], json.loads(config_rule['resource_value'])] - #LOGGER.info('config_rule = {:s}'.format(str(config_rule))) - assert config_rule in driver_config - - DEVICE_EMU_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_EMU) - DEVICE_EMU_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_DECONFIG_ENDPOINTS) - device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_DECONFIG_RULES)) - - driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - driver_config = json.loads(json.dumps(driver_config)) # prevent integer keys to fail matching with string keys - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - assert len(driver_config) == 0 - - device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) - config_rules = device_data.device_config.config_rules - LOGGER.info('config_rules = {:s}'.format(str(config_rules))) - clean_config_rules = [] - for config_rule in config_rules: - config_rule_value = json.loads(config_rule.resource_value) - if not isinstance(config_rule_value, str): clean_config_rules.append(config_rule) - if config_rule_value.startswith('do_sampling (trigger:'): continue - clean_config_rules.append(config_rule) - LOGGER.info('clean_config_rules = {:s}'.format(str(clean_config_rules))) - assert len(clean_config_rules) == 0 - - -def test_device_emulated_delete( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_EMULATED: pytest.skip('Skipping test: No Emulated device has been configured') - - device_client.DeleteDevice(DeviceId(**DEVICE_EMU_ID)) - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_EMU_UUID, {}) - assert driver is None - - -# ----- Test Device Driver OpenConfig ------------------------------------------ - -def test_device_openconfig_add_error_cases( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') - - with pytest.raises(grpc.RpcError) as e: - DEVICE_OC_WITH_EXTRA_RULES = copy.deepcopy(DEVICE_OC) - DEVICE_OC_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONNECT_RULES) - DEVICE_OC_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONFIG_RULES) - device_client.AddDevice(Device(**DEVICE_OC_WITH_EXTRA_RULES)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg_head = 'device.device_config.config_rules([' - msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ - 'with "_connect/" tag. Others should be configured after adding the device.' - except_msg = str(e.value.details()) - assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) - - -def test_device_openconfig_add_correct( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') - - DEVICE_OC_WITH_CONNECT_RULES = copy.deepcopy(DEVICE_OC) - DEVICE_OC_WITH_CONNECT_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONNECT_RULES) - device_client.AddDevice(Device(**DEVICE_OC_WITH_CONNECT_RULES)) - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_OC_UUID) # we know the driver exists now - assert driver is not None - - -def test_device_openconfig_get( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') - - initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_OC_ID)) - LOGGER.info('initial_config = {:s}'.format(grpc_message_to_json_string(initial_config))) - - device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) - LOGGER.info('device_data = {:s}'.format(grpc_message_to_json_string(device_data))) - - -def test_device_openconfig_configure( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') - - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_OC_UUID) # we know the driver exists now - assert driver is not None - - # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. - #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - DEVICE_OC_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_OC) - DEVICE_OC_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONFIG_RULES) - device_client.ConfigureDevice(Device(**DEVICE_OC_WITH_CONFIG_RULES)) - - # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. - #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) - config_rules = [ - (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) - for config_rule in device_data.device_config.config_rules - ] - LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( - '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) - for config_rule in DEVICE_OC_CONFIG_RULES: - config_rule = ( - ConfigActionEnum.Name(config_rule['action']), config_rule['resource_key'], config_rule['resource_value']) - assert config_rule in config_rules - - -def test_device_openconfig_monitor( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService, # pylint: disable=redefined-outer-name - monitoring_service : MockMonitoringService): # pylint: disable=redefined-outer-name - - if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') - - device_uuid = DEVICE_OC_UUID - json_device_id = DEVICE_OC_ID - device_id = DeviceId(**json_device_id) - device_data = context_client.GetDevice(device_id) - #LOGGER.info('device_data = \n{:s}'.format(str(device_data))) - - driver : _Driver = device_service.driver_instance_cache.get(device_uuid) # we know the driver exists now - assert driver is not None - - SAMPLING_DURATION_SEC = 30.0 - SAMPLING_INTERVAL_SEC = 10.0 - - MONITORING_SETTINGS_LIST = [] - KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED = {} - for endpoint in device_data.device_endpoints: - endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid - for sample_type_id in endpoint.kpi_sample_types: - sample_type_name = str(KpiSampleType.Name(sample_type_id)).upper().replace('KPISAMPLETYPE_', '') - kpi_uuid = '{:s}-{:s}-{:s}-kpi_uuid'.format(device_uuid, endpoint_uuid, str(sample_type_id)) - monitoring_settings = { - 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, - 'kpi_descriptor': { - 'kpi_description': 'Metric {:s} for Endpoint {:s} in Device {:s}'.format( - sample_type_name, endpoint_uuid, device_uuid), - 'kpi_sample_type': sample_type_id, - 'device_id': json_device_id, - 'endpoint_id': json_endpoint_id(json_device_id, endpoint_uuid), - }, - 'sampling_duration_s': SAMPLING_DURATION_SEC, - 'sampling_interval_s': SAMPLING_INTERVAL_SEC, - } - MONITORING_SETTINGS_LIST.append(monitoring_settings) - KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED[kpi_uuid] = 0 - - NUM_SAMPLES_EXPECTED_PER_KPI = SAMPLING_DURATION_SEC / SAMPLING_INTERVAL_SEC - NUM_SAMPLES_EXPECTED = len(MONITORING_SETTINGS_LIST) * NUM_SAMPLES_EXPECTED_PER_KPI - - # Start monitoring the device - t_start_monitoring = datetime.timestamp(datetime.utcnow()) - for monitoring_settings in MONITORING_SETTINGS_LIST: - device_client.MonitorDeviceKpi(MonitoringSettings(**monitoring_settings)) - - # wait to receive the expected number of samples - # if takes more than 1.5 times the sampling duration, assume there is an error - time_ini = time.time() - queue_samples : queue.Queue = monitoring_service.queue_samples - received_samples = [] - while (len(received_samples) < NUM_SAMPLES_EXPECTED) and (time.time() - time_ini < SAMPLING_DURATION_SEC * 1.5): - try: - received_sample = queue_samples.get(block=True, timeout=SAMPLING_INTERVAL_SEC / NUM_SAMPLES_EXPECTED) - #LOGGER.info('received_sample = {:s}'.format(str(received_sample))) - received_samples.append(received_sample) - except queue.Empty: - continue - - t_end_monitoring = datetime.timestamp(datetime.utcnow()) - - #LOGGER.info('received_samples = {:s}'.format(str(received_samples))) - LOGGER.info('len(received_samples) = {:s}'.format(str(len(received_samples)))) - LOGGER.info('NUM_SAMPLES_EXPECTED = {:s}'.format(str(NUM_SAMPLES_EXPECTED))) - assert len(received_samples) == NUM_SAMPLES_EXPECTED - for received_sample in received_samples: - kpi_uuid = received_sample.kpi_id.kpi_id.uuid - assert kpi_uuid in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED - assert isinstance(received_sample.timestamp, str) - try: - timestamp = float(received_sample.timestamp) - except ValueError: - dt_time = dateutil.parser.isoparse(received_sample.timestamp).replace(tzinfo=timezone.utc) - timestamp = float(calendar.timegm(dt_time.timetuple())) + (dt_time.microsecond / 1.e6) - assert timestamp > t_start_monitoring - assert timestamp < t_end_monitoring - assert received_sample.kpi_value.HasField('floatVal') or received_sample.kpi_value.HasField('intVal') - kpi_value = getattr(received_sample.kpi_value, received_sample.kpi_value.WhichOneof('value')) - assert isinstance(kpi_value, (float, int)) - KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED[kpi_uuid] += 1 - - LOGGER.info('KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED = {:s}'.format(str(KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED))) - # TODO: review why num_samples_received per KPI != NUM_SAMPLES_EXPECTED_PER_KPI - #for kpi_uuid, num_samples_received in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED.items(): - # assert num_samples_received == NUM_SAMPLES_EXPECTED_PER_KPI - - # Unsubscribe monitoring - for kpi_uuid in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED.keys(): - MONITORING_SETTINGS_UNSUBSCRIBE = { - 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, - 'sampling_duration_s': -1, # negative value in sampling_duration_s or sampling_interval_s means unsibscribe - 'sampling_interval_s': -1, # kpi_id is mandatory to unsibscribe - } - device_client.MonitorDeviceKpi(MonitoringSettings(**MONITORING_SETTINGS_UNSUBSCRIBE)) - - -def test_device_openconfig_deconfigure( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') - - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_OC_UUID) # we know the driver exists now - assert driver is not None - - # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. - #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - DEVICE_OC_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_OC) - DEVICE_OC_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_OC_DECONFIG_RULES) - device_client.ConfigureDevice(Device(**DEVICE_OC_WITH_DECONFIG_RULES)) - - # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. - #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) - config_rules = [ - (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) - for config_rule in device_data.device_config.config_rules - ] - LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( - '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) - for config_rule in DEVICE_OC_DECONFIG_RULES: - action_set = ConfigActionEnum.Name(ConfigActionEnum.CONFIGACTION_SET) - config_rule = (action_set, config_rule['resource_key'], config_rule['resource_value']) - assert config_rule not in config_rules - - -def test_device_openconfig_delete( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') - - device_client.DeleteDevice(DeviceId(**DEVICE_OC_ID)) - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_OC_UUID, {}) - assert driver is None - - -# ----- Test Device Driver TAPI ------------------------------------------------ - -def test_device_tapi_add_error_cases( - device_client : DeviceClient): # pylint: disable=redefined-outer-name - - if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') - - with pytest.raises(grpc.RpcError) as e: - DEVICE_TAPI_WITH_EXTRA_RULES = copy.deepcopy(DEVICE_TAPI) - DEVICE_TAPI_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_CONNECT_RULES) - DEVICE_TAPI_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_CONFIG_RULES) - device_client.AddDevice(Device(**DEVICE_TAPI_WITH_EXTRA_RULES)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg_head = 'device.device_config.config_rules([' - msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ - 'with "_connect/" tag. Others should be configured after adding the device.' - except_msg = str(e.value.details()) - assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) - - -def test_device_tapi_add_correct( - device_client: DeviceClient, # pylint: disable=redefined-outer-name - device_service: DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') - - DEVICE_TAPI_WITH_CONNECT_RULES = copy.deepcopy(DEVICE_TAPI) - DEVICE_TAPI_WITH_CONNECT_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_CONNECT_RULES) - device_client.AddDevice(Device(**DEVICE_TAPI_WITH_CONNECT_RULES)) - driver: _Driver = device_service.driver_instance_cache.get(DEVICE_TAPI_UUID) - assert driver is not None - - -def test_device_tapi_get( - context_client: ContextClient, # pylint: disable=redefined-outer-name - device_client: DeviceClient): # pylint: disable=redefined-outer-name - - if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') - - initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_TAPI_ID)) - LOGGER.info('initial_config = {:s}'.format(grpc_message_to_json_string(initial_config))) - - device_data = context_client.GetDevice(DeviceId(**DEVICE_TAPI_ID)) - LOGGER.info('device_data = {:s}'.format(grpc_message_to_json_string(device_data))) - - -def test_device_tapi_configure( - context_client: ContextClient, # pylint: disable=redefined-outer-name - device_client: DeviceClient, # pylint: disable=redefined-outer-name - device_service: DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') - - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_TAPI_UUID) - assert driver is not None - - # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. - #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - DEVICE_TAPI_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_TAPI) - DEVICE_TAPI_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_CONFIG_RULES) - device_client.ConfigureDevice(Device(**DEVICE_TAPI_WITH_CONFIG_RULES)) - - # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. - #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - device_data = context_client.GetDevice(DeviceId(**DEVICE_TAPI_ID)) - config_rules = [ - (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) - for config_rule in device_data.device_config.config_rules - ] - LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( - '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) - for config_rule in DEVICE_TAPI_CONFIG_RULES: - config_rule = ( - ConfigActionEnum.Name(config_rule['action']), config_rule['resource_key'], config_rule['resource_value']) - assert config_rule in config_rules - - -def test_device_tapi_deconfigure( - context_client: ContextClient, # pylint: disable=redefined-outer-name - device_client: DeviceClient, # pylint: disable=redefined-outer-name - device_service: DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') - - driver: _Driver = device_service.driver_instance_cache.get(DEVICE_TAPI_UUID) - assert driver is not None - - # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. - #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - DEVICE_TAPI_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_TAPI) - DEVICE_TAPI_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_DECONFIG_RULES) - device_client.ConfigureDevice(Device(**DEVICE_TAPI_WITH_DECONFIG_RULES)) - - # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. - #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) - #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) - - device_data = context_client.GetDevice(DeviceId(**DEVICE_TAPI_ID)) - config_rules = [ - (ConfigActionEnum.Name(config_rule.action), config_rule.resource_key, config_rule.resource_value) - for config_rule in device_data.device_config.config_rules - ] - LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( - '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) - for config_rule in DEVICE_TAPI_DECONFIG_RULES: - action_set = ConfigActionEnum.Name(ConfigActionEnum.CONFIGACTION_SET) - config_rule = (action_set, config_rule['resource_key'], config_rule['resource_value']) - assert config_rule not in config_rules - - -def test_device_tapi_delete( - device_client : DeviceClient, # pylint: disable=redefined-outer-name - device_service : DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') - - device_client.DeleteDevice(DeviceId(**DEVICE_TAPI_ID)) - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_TAPI_UUID, {}) - assert driver is None - - -# ----- Test Device Driver P4 -------------------------------------------------- - -def test_device_p4_add_error_cases( - context_client: ContextClient, # pylint: disable=redefined-outer-name - device_client: DeviceClient, # pylint: disable=redefined-outer-name - device_service: DeviceService): # pylint: disable=redefined-outer-name - - if not ENABLE_P4: pytest.skip('Skipping test: No P4 device has been configured') - - with pytest.raises(grpc.RpcError) as e: - device_p4_with_extra_rules = copy.deepcopy(DEVICE_P4) - device_p4_with_extra_rules['device_config']['config_rules'].extend( - DEVICE_P4_CONNECT_RULES) - device_p4_with_extra_rules['device_config']['config_rules'].extend( - DEVICE_P4_CONFIG_RULES) - device_client.AddDevice(Device(**device_p4_with_extra_rules)) - assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT - msg_head = 'device.device_config.config_rules([' - msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ - 'with "_connect/" tag. Others should be configured after adding the device.' - except_msg = str(e.value.details()) - assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) - - -def test_device_p4_add_correct( - context_client: ContextClient, # pylint: disable=redefined-outer-name - device_client: DeviceClient, # pylint: disable=redefined-outer-name - device_service: DeviceService, # pylint: disable=redefined-outer-name - p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name - - if not ENABLE_P4: pytest.skip('Skipping test: No P4 device has been configured') - - device_p4_with_connect_rules = copy.deepcopy(DEVICE_P4) - device_p4_with_connect_rules['device_config']['config_rules'].extend( - DEVICE_P4_CONNECT_RULES) - device_client.AddDevice(Device(**device_p4_with_connect_rules)) - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_P4_NAME) - assert driver is not None - - -def test_device_p4_get( - context_client: ContextClient, # pylint: disable=redefined-outer-name - device_client: DeviceClient, # pylint: disable=redefined-outer-name - device_service: DeviceService, # pylint: disable=redefined-outer-name - p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name - - if not ENABLE_P4: pytest.skip('Skipping test: No P4 device has been configured') - - initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_P4_UUID)) - LOGGER.info('initial_config = {:s}'.format( - grpc_message_to_json_string(initial_config))) - - device_data = context_client.GetDevice(DeviceId(**DEVICE_P4_UUID)) - LOGGER.info('device_data = {:s}'.format( - grpc_message_to_json_string(device_data))) - - -def test_device_p4_configure( - context_client: ContextClient, # pylint: disable=redefined-outer-name - device_client: DeviceClient, # pylint: disable=redefined-outer-name - device_service: DeviceService, # pylint: disable=redefined-outer-name - p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name - pytest.skip('Skipping test for unimplemented method') - - -def test_device_p4_deconfigure( - context_client: ContextClient, # pylint: disable=redefined-outer-name - device_client: DeviceClient, # pylint: disable=redefined-outer-name - device_service: DeviceService, # pylint: disable=redefined-outer-name - p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name - pytest.skip('Skipping test for unimplemented method') - - -def test_device_p4_delete( - context_client: ContextClient, # pylint: disable=redefined-outer-name - device_client: DeviceClient, # pylint: disable=redefined-outer-name - device_service: DeviceService, # pylint: disable=redefined-outer-name - p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name - - if not ENABLE_P4: pytest.skip('Skipping test: No P4 device has been configured') - - device_client.DeleteDevice(DeviceId(**DEVICE_P4_UUID)) - driver : _Driver = device_service.driver_instance_cache.get(DEVICE_P4_NAME) - assert driver is None diff --git a/src/device/tests/test_unitary_emulated.py b/src/device/tests/test_unitary_emulated.py new file mode 100644 index 0000000000000000000000000000000000000000..cbad108a848a6b0106330f7d22143910542997c3 --- /dev/null +++ b/src/device/tests/test_unitary_emulated.py @@ -0,0 +1,401 @@ +# 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 calendar, copy, dateutil.parser, grpc, json, logging, operator, pytest, queue, time +from datetime import datetime, timezone +from common.proto.context_pb2 import ConfigActionEnum, Device, DeviceId, DeviceOperationalStatusEnum +from common.proto.device_pb2 import MonitoringSettings +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.tools.grpc.Tools import grpc_message_to_json_string +from common.tools.object_factory.EndPoint import json_endpoint, json_endpoint_id +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from device.service.DeviceService import DeviceService +from device.service.driver_api._Driver import _Driver +from .MockService_Dependencies import MockService_Dependencies +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, device_service, context_client, device_client, monitoring_client, test_prepare_environment) + +from .Device_Emulated import ( + DEVICE_EMU, DEVICE_EMU_CONFIG_ADDRESSES, DEVICE_EMU_CONFIG_ENDPOINTS, DEVICE_EMU_CONNECT_RULES, + DEVICE_EMU_DECONFIG_ADDRESSES, DEVICE_EMU_DECONFIG_ENDPOINTS, DEVICE_EMU_ENDPOINTS_COOKED, DEVICE_EMU_ID, + DEVICE_EMU_RECONFIG_ADDRESSES, DEVICE_EMU_UUID) + +logging.getLogger('apscheduler.executors.default').setLevel(logging.WARNING) +logging.getLogger('apscheduler.scheduler').setLevel(logging.WARNING) +logging.getLogger('monitoring-client').setLevel(logging.WARNING) + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +# ----- Test Device Driver Emulated -------------------------------------------- +# Device Driver Emulated tests are used to validate Driver API as well as Emulated Device Driver. Note that other +# Drivers might support a different set of resource paths, and attributes/values per resource; however, they must +# implement the Driver API. + +def test_device_emulated_add_error_cases( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + with pytest.raises(grpc.RpcError) as e: + DEVICE_EMU_WITH_ENDPOINTS = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_ENDPOINTS['device_endpoints'].append(json_endpoint(DEVICE_EMU_ID, 'ep-id', 'ep-type')) + device_client.AddDevice(Device(**DEVICE_EMU_WITH_ENDPOINTS)) + assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT + msg_head = 'device.device_endpoints([' + msg_tail = ']) is invalid; RPC method AddDevice does not accept Endpoints. '\ + 'Endpoints are discovered through interrogation of the physical device.' + except_msg = str(e.value.details()) + assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) + + with pytest.raises(grpc.RpcError) as e: + DEVICE_EMU_WITH_EXTRA_RULES = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONNECT_RULES) + DEVICE_EMU_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONFIG_ENDPOINTS) + device_client.AddDevice(Device(**DEVICE_EMU_WITH_EXTRA_RULES)) + assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT + msg_head = 'device.device_config.config_rules([' + msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ + 'with "_connect/" tag. Others should be configured after adding the device.' + except_msg = str(e.value.details()) + assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) + + +def test_device_emulated_add_correct( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + DEVICE_EMU_WITH_CONNECT_RULES = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_CONNECT_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONNECT_RULES) + device_client.AddDevice(Device(**DEVICE_EMU_WITH_CONNECT_RULES)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_EMU_UUID) # we know the driver exists now + assert driver is not None + + device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) + for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + + +def test_device_emulated_get( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_EMU_ID)) + LOGGER.info('initial_config = {:s}'.format(grpc_message_to_json_string(initial_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) + LOGGER.info('device_data = {:s}'.format(grpc_message_to_json_string(device_data))) + + +def test_device_emulated_configure( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_EMU_UUID) # we know the driver exists now + assert driver is not None + + driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + assert len(driver_config) == len(DEVICE_EMU_ENDPOINTS_COOKED) + for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: + assert endpoint_cooked in driver_config + + DEVICE_EMU_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONFIG_ENDPOINTS) + device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_CONFIG_RULES)) + + DEVICE_EMU_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_CONFIG_ADDRESSES) + device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_CONFIG_RULES)) + + DEVICE_EMU_WITH_OPERATIONAL_STATUS = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_OPERATIONAL_STATUS['device_operational_status'] = \ + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED + device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_OPERATIONAL_STATUS)) + + driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + assert len(driver_config) == len(DEVICE_EMU_ENDPOINTS_COOKED) + len(DEVICE_EMU_CONFIG_ADDRESSES) + for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: + endpoint_cooked = copy.deepcopy(endpoint_cooked) + endpoint_cooked[1]['enabled'] = True + assert endpoint_cooked in driver_config + for config_rule in DEVICE_EMU_CONFIG_ADDRESSES: + assert 'custom' in config_rule + rule = (config_rule['custom']['resource_key'], json.loads(config_rule['custom']['resource_value'])) + assert rule in driver_config + + device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) + assert device_data.device_operational_status == DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED + + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) + for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + RESULTING_CONFIG_ENDPOINTS = {cr['custom']['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ENDPOINTS)} + for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: + values = json.loads(RESULTING_CONFIG_ENDPOINTS[endpoint_cooked[0]]['custom']['resource_value']) + values.update(endpoint_cooked[1]) + RESULTING_CONFIG_ENDPOINTS[endpoint_cooked[0]]['custom']['resource_value'] = json.dumps(values, sort_keys=True) + for config_rule in RESULTING_CONFIG_ENDPOINTS.values(): + assert 'custom' in config_rule + config_rule = ( + ConfigActionEnum.Name(config_rule['action']), config_rule['custom']['resource_key'], + json.loads(json.dumps(config_rule['custom']['resource_value']))) + LOGGER.info('A config_rule: {:s} {:s} = {:s}'.format(*config_rule)) + assert config_rule in config_rules + for config_rule in DEVICE_EMU_CONFIG_ADDRESSES: + assert 'custom' in config_rule + config_rule = ( + ConfigActionEnum.Name(config_rule['action']), config_rule['custom']['resource_key'], + json.loads(json.dumps(config_rule['custom']['resource_value']))) + LOGGER.info('B config_rule: {:s} {:s} = {:s}'.format(*config_rule)) + assert config_rule in config_rules + + # Try to reconfigure... + + DEVICE_EMU_WITH_RECONFIG_RULES = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_RECONFIG_RULES['device_operational_status'] = \ + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED + DEVICE_EMU_WITH_RECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_RECONFIG_ADDRESSES) + device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_RECONFIG_RULES)) + + RESULTING_CONFIG_RULES = {cr['custom']['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ENDPOINTS)} + for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: + values = json.loads(RESULTING_CONFIG_RULES[endpoint_cooked[0]]['custom']['resource_value']) + values.update(endpoint_cooked[1]) + RESULTING_CONFIG_RULES[endpoint_cooked[0]]['custom']['resource_value'] = json.dumps(values, sort_keys=True) + RESULTING_CONFIG_RULES.update({ + cr['custom']['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ADDRESSES) + }) + for reconfig_rule in DEVICE_EMU_RECONFIG_ADDRESSES: + assert 'custom' in reconfig_rule + if reconfig_rule['action'] == ConfigActionEnum.CONFIGACTION_DELETE: + RESULTING_CONFIG_RULES.pop(reconfig_rule['custom']['resource_key'], None) + else: + RESULTING_CONFIG_RULES[reconfig_rule['custom']['resource_key']] = reconfig_rule + RESULTING_CONFIG_RULES = RESULTING_CONFIG_RULES.values() + #LOGGER.info('RESULTING_CONFIG_RULES = {:s}'.format(str(RESULTING_CONFIG_RULES))) + + driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + driver_config = json.loads(json.dumps(driver_config)) # prevent integer keys to fail matching with string keys + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + assert len(driver_config) == len(RESULTING_CONFIG_RULES) + for config_rule in RESULTING_CONFIG_RULES: + assert 'custom' in config_rule + resource = [config_rule['custom']['resource_key'], json.loads(config_rule['custom']['resource_value'])] + assert resource in driver_config + + device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) + for config_rule in device_data.device_config.config_rules + ] + #LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + # '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + for config_rule in RESULTING_CONFIG_RULES: + assert 'custom' in config_rule + config_rule = ( + ConfigActionEnum.Name(config_rule['action']), config_rule['custom']['resource_key'], + config_rule['custom']['resource_value']) + #LOGGER.info('config_rule: {:s} {:s} = {:s}'.format(*config_rule)) + assert config_rule in config_rules + + +def test_device_emulated_monitor( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService, # pylint: disable=redefined-outer-name + mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name + + device_uuid = DEVICE_EMU_UUID + json_device_id = DEVICE_EMU_ID + device_id = DeviceId(**json_device_id) + device_data = context_client.GetDevice(device_id) + LOGGER.info('device_data = \n{:s}'.format(str(device_data))) + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(device_uuid) # we know the driver exists now + assert driver is not None + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + #assert len(driver_config) == len(DEVICE_EMU_ENDPOINTS_COOKED) + len(DEVICE_EMU_CONFIG_ADDRESSES) + + SAMPLING_DURATION_SEC = 10.0 + SAMPLING_INTERVAL_SEC = 2.0 + + MONITORING_SETTINGS_LIST = [] + KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED = {} + for endpoint in device_data.device_endpoints: + endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid + for sample_type_id in endpoint.kpi_sample_types: + sample_type_name = str(KpiSampleType.Name(sample_type_id)).upper().replace('KPISAMPLETYPE_', '') + kpi_uuid = '{:s}-{:s}-{:s}-kpi_uuid'.format(device_uuid, endpoint_uuid, str(sample_type_id)) + monitoring_settings = { + 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, + 'kpi_descriptor': { + 'kpi_description': 'Metric {:s} for Endpoint {:s} in Device {:s}'.format( + sample_type_name, endpoint_uuid, device_uuid), + 'kpi_sample_type': sample_type_id, + 'device_id': json_device_id, + 'endpoint_id': json_endpoint_id(json_device_id, endpoint_uuid), + }, + 'sampling_duration_s': SAMPLING_DURATION_SEC, + 'sampling_interval_s': SAMPLING_INTERVAL_SEC, + } + MONITORING_SETTINGS_LIST.append(monitoring_settings) + KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED[kpi_uuid] = 0 + + NUM_SAMPLES_EXPECTED_PER_KPI = SAMPLING_DURATION_SEC / SAMPLING_INTERVAL_SEC + NUM_SAMPLES_EXPECTED = len(MONITORING_SETTINGS_LIST) * NUM_SAMPLES_EXPECTED_PER_KPI + + # Start monitoring the device + t_start_monitoring = datetime.timestamp(datetime.utcnow()) + for monitoring_settings in MONITORING_SETTINGS_LIST: + device_client.MonitorDeviceKpi(MonitoringSettings(**monitoring_settings)) + + # wait to receive the expected number of samples + # if takes more than 1.5 times the sampling duration, assume there is an error + time_ini = time.time() + queue_samples : queue.Queue = mock_service.queue_samples + received_samples = [] + while (len(received_samples) < NUM_SAMPLES_EXPECTED) and (time.time() - time_ini < SAMPLING_DURATION_SEC * 1.5): + try: + received_sample = queue_samples.get(block=True, timeout=SAMPLING_INTERVAL_SEC / NUM_SAMPLES_EXPECTED) + #LOGGER.info('received_sample = {:s}'.format(str(received_sample))) + received_samples.append(received_sample) + except queue.Empty: + continue + + t_end_monitoring = datetime.timestamp(datetime.utcnow()) + + #LOGGER.info('received_samples = {:s}'.format(str(received_samples))) + LOGGER.info('len(received_samples) = {:s}'.format(str(len(received_samples)))) + LOGGER.info('NUM_SAMPLES_EXPECTED = {:s}'.format(str(NUM_SAMPLES_EXPECTED))) + assert len(received_samples) == NUM_SAMPLES_EXPECTED + for received_sample in received_samples: + kpi_uuid = received_sample.kpi_id.kpi_id.uuid + assert kpi_uuid in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED + timestamp = float(received_sample.timestamp.timestamp) + assert timestamp > t_start_monitoring + assert timestamp < t_end_monitoring + assert received_sample.kpi_value.HasField('floatVal') or received_sample.kpi_value.HasField('intVal') + kpi_value = getattr(received_sample.kpi_value, received_sample.kpi_value.WhichOneof('value')) + assert isinstance(kpi_value, (float, int)) + KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED[kpi_uuid] += 1 + + LOGGER.info('KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED = {:s}'.format(str(KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED))) + for kpi_uuid, num_samples_received in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED.items(): + assert num_samples_received == NUM_SAMPLES_EXPECTED_PER_KPI + + # Unsubscribe monitoring + for kpi_uuid in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED.keys(): + MONITORING_SETTINGS_UNSUBSCRIBE = { + 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, + 'sampling_duration_s': -1, # negative value in sampling_duration_s or sampling_interval_s means unsibscribe + 'sampling_interval_s': -1, # kpi_id is mandatory to unsibscribe + } + device_client.MonitorDeviceKpi(MonitoringSettings(**MONITORING_SETTINGS_UNSUBSCRIBE)) + + +def test_device_emulated_deconfigure( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_EMU_UUID) # we know the driver exists now + assert driver is not None + + driver_config = driver.GetConfig() + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + DEVICE_EMU_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_DECONFIG_RULES['device_operational_status'] = \ + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED + DEVICE_EMU_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_DECONFIG_ADDRESSES) + device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_DECONFIG_RULES)) + + RESULTING_CONFIG_RULES = {cr['custom']['resource_key']:cr for cr in copy.deepcopy(DEVICE_EMU_CONFIG_ENDPOINTS)} + for endpoint_cooked in DEVICE_EMU_ENDPOINTS_COOKED: + values = json.loads(RESULTING_CONFIG_RULES[endpoint_cooked[0]]['custom']['resource_value']) + values.update(endpoint_cooked[1]) + RESULTING_CONFIG_RULES[endpoint_cooked[0]]['custom']['resource_value'] = json.dumps(values, sort_keys=True) + RESULTING_CONFIG_RULES = RESULTING_CONFIG_RULES.values() + driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + driver_config = json.loads(json.dumps(driver_config)) # prevent integer keys to fail matching with string keys + driver_config = list(filter( + lambda config_rule: ( + not isinstance(config_rule[1], str) or not config_rule[1].startswith('do_sampling (trigger:')), + driver_config)) + LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + LOGGER.info('RESULTING_CONFIG_RULES = {:s}'.format(str(RESULTING_CONFIG_RULES))) + assert len(driver_config) == len(RESULTING_CONFIG_RULES) + for config_rule in RESULTING_CONFIG_RULES: + assert 'custom' in config_rule + config_rule = [config_rule['custom']['resource_key'], json.loads(config_rule['custom']['resource_value'])] + #LOGGER.info('config_rule = {:s}'.format(str(config_rule))) + assert config_rule in driver_config + + DEVICE_EMU_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_EMU) + DEVICE_EMU_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_EMU_DECONFIG_ENDPOINTS) + device_client.ConfigureDevice(Device(**DEVICE_EMU_WITH_DECONFIG_RULES)) + + driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + driver_config = json.loads(json.dumps(driver_config)) # prevent integer keys to fail matching with string keys + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + assert len(driver_config) == 0 + + device_data = context_client.GetDevice(DeviceId(**DEVICE_EMU_ID)) + config_rules = device_data.device_config.config_rules + LOGGER.info('config_rules = {:s}'.format(str(config_rules))) + clean_config_rules = [] + for config_rule in config_rules: + assert config_rule.WhichOneof('config_rule') == 'custom' + if config_rule.custom.resource_key.startswith('/endpoints/endpoint'): continue + if config_rule.custom.resource_key.startswith('_connect/'): continue + try: + config_rule_value = json.loads(config_rule.custom.resource_value) + except: # pylint: disable=bare-except + config_rule_value = config_rule.custom.resource_value + if isinstance(config_rule_value, str) and config_rule_value.startswith('do_sampling (trigger:'): continue + clean_config_rules.append(config_rule) + LOGGER.info('clean_config_rules = {:s}'.format(str(clean_config_rules))) + assert len(clean_config_rules) == 0 + + +def test_device_emulated_delete( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + device_client.DeleteDevice(DeviceId(**DEVICE_EMU_ID)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_EMU_UUID, {}) + assert driver is None diff --git a/src/device/tests/test_unitary_microwave.py b/src/device/tests/test_unitary_microwave.py new file mode 100644 index 0000000000000000000000000000000000000000..0d1ff61cf965ff20736a0a433ac0ac57eb1d541c --- /dev/null +++ b/src/device/tests/test_unitary_microwave.py @@ -0,0 +1,171 @@ +# 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, grpc, logging, pytest +from common.proto.context_pb2 import ConfigActionEnum, Device, DeviceId +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from device.service.DeviceService import DeviceService +from device.service.driver_api._Driver import _Driver +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, device_service, context_client, device_client, monitoring_client, test_prepare_environment) + +try: + from .Device_Microwave_Template import ( + DEVICE_MICROWAVE, DEVICE_MICROWAVE_CONNECT_RULES, DEVICE_MICROWAVE_UUID, DEVICE_MICROWAVE_ID, + DEVICE_MICROWAVE_CONFIG_RULES, DEVICE_MICROWAVE_DECONFIG_RULES) + ENABLE_MICROWAVE = True +except ImportError: + ENABLE_MICROWAVE = False + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + + +# ----- Test Device Driver Microwave ------------------------------------------------ + +def test_device_microwave_add_error_cases( + device_client : DeviceClient): # pylint: disable=redefined-outer-name + + if not ENABLE_MICROWAVE: pytest.skip('Skipping test: No TAPI device has been configured') + + with pytest.raises(grpc.RpcError) as e: + DEVICE_MICROWAVE_WITH_EXTRA_RULES = copy.deepcopy(DEVICE_MICROWAVE) + DEVICE_MICROWAVE_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_MICROWAVE_CONNECT_RULES) + DEVICE_MICROWAVE_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_MICROWAVE_CONFIG_RULES) + device_client.AddDevice(Device(**DEVICE_MICROWAVE_WITH_EXTRA_RULES)) + assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT + msg_head = 'device.device_config.config_rules([' + msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ + 'with "_connect/" tag. Others should be configured after adding the device.' + except_msg = str(e.value.details()) + assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) + + +def test_device_microwave_add_correct( + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_MICROWAVE: pytest.skip('Skipping test: No MICROWAVE device has been configured') + + DEVICE_MICROWAVE_WITH_CONNECT_RULES = copy.deepcopy(DEVICE_MICROWAVE) + DEVICE_MICROWAVE_WITH_CONNECT_RULES['device_config']['config_rules'].extend(DEVICE_MICROWAVE_CONNECT_RULES) + device_client.AddDevice(Device(**DEVICE_MICROWAVE_WITH_CONNECT_RULES)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver: _Driver = driver_instance_cache.get(DEVICE_MICROWAVE_UUID) + assert driver is not None + + +def test_device_microwave_get( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient): # pylint: disable=redefined-outer-name + + if not ENABLE_MICROWAVE: pytest.skip('Skipping test: No MICROWAVE device has been configured') + + initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_MICROWAVE_ID)) + LOGGER.info('initial_config = {:s}'.format(grpc_message_to_json_string(initial_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_MICROWAVE_ID)) + LOGGER.info('device_data = {:s}'.format(grpc_message_to_json_string(device_data))) + + +def test_device_microwave_configure( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_MICROWAVE: pytest.skip('Skipping test: No MICROWAVE device has been configured') + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_MICROWAVE_UUID) + assert driver is not None + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + DEVICE_MICROWAVE_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_MICROWAVE) + DEVICE_MICROWAVE_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_MICROWAVE_CONFIG_RULES) + device_client.ConfigureDevice(Device(**DEVICE_MICROWAVE_WITH_CONFIG_RULES)) + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_MICROWAVE_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) + for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + for config_rule in DEVICE_MICROWAVE_CONFIG_RULES: + assert 'custom' in config_rule + config_rule = ( + ConfigActionEnum.Name(config_rule['action']), config_rule['custom']['resource_key'], + config_rule['custom']['resource_value']) + assert config_rule in config_rules + + +def test_device_microwave_deconfigure( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_MICROWAVE: pytest.skip('Skipping test: No MICROWAVE device has been configured') + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver: _Driver = driver_instance_cache.get(DEVICE_MICROWAVE_UUID) + assert driver is not None + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + DEVICE_MICROWAVE_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_MICROWAVE) + DEVICE_MICROWAVE_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_MICROWAVE_DECONFIG_RULES) + device_client.ConfigureDevice(Device(**DEVICE_MICROWAVE_WITH_DECONFIG_RULES)) + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_MICROWAVE_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) + for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + for config_rule in DEVICE_MICROWAVE_DECONFIG_RULES: + assert 'custom' in config_rule + action_set = ConfigActionEnum.Name(ConfigActionEnum.CONFIGACTION_SET) + config_rule = (action_set, config_rule['custom']['resource_key'], config_rule['custom']['resource_value']) + assert config_rule not in config_rules + + +def test_device_microwave_delete( + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_MICROWAVE: pytest.skip('Skipping test: No MICROWAVE device has been configured') + + device_client.DeleteDevice(DeviceId(**DEVICE_MICROWAVE_ID)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_MICROWAVE_UUID, {}) + assert driver is None diff --git a/src/device/tests/test_unitary_openconfig.py b/src/device/tests/test_unitary_openconfig.py new file mode 100644 index 0000000000000000000000000000000000000000..e61442a4a6b41108d49b52c4ca58d4a2826c786a --- /dev/null +++ b/src/device/tests/test_unitary_openconfig.py @@ -0,0 +1,307 @@ +# 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 calendar, copy, dateutil.parser, grpc, logging, pytest, queue, time +from datetime import datetime, timezone +from common.proto.context_pb2 import ConfigActionEnum, Device, DeviceId +from common.proto.device_pb2 import MonitoringSettings +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.tools.grpc.Tools import grpc_message_to_json_string +from common.tools.object_factory.EndPoint import json_endpoint_id +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from device.service.DeviceService import DeviceService +from device.service.driver_api._Driver import _Driver +from .MockService_Dependencies import MockService_Dependencies +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, device_service, context_client, device_client, monitoring_client, test_prepare_environment) + +try: + #from .Device_OpenConfig_Infinera1 import( + #from .Device_OpenConfig_Infinera2 import( + #from .Device_OpenConfig_Adva import( + #from .Device_OpenConfig_Adva_149 import( + from .Device_OpenConfig_Adva_155 import( + #from .Device_OpenConfig_Cisco import( + DEVICE_OC, DEVICE_OC_CONFIG_RULES, DEVICE_OC_DECONFIG_RULES, DEVICE_OC_CONNECT_RULES, DEVICE_OC_ID, + DEVICE_OC_UUID) + ENABLE_OPENCONFIG = True +except ImportError: + ENABLE_OPENCONFIG = False + +ENABLE_OPENCONFIG_CONFIGURE = True +ENABLE_OPENCONFIG_MONITOR = False +ENABLE_OPENCONFIG_DECONFIGURE = True + +logging.getLogger('apscheduler.executors.default').setLevel(logging.WARNING) +logging.getLogger('apscheduler.scheduler').setLevel(logging.WARNING) +logging.getLogger('monitoring-client').setLevel(logging.WARNING) + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + + +# ----- Test Device Driver OpenConfig ------------------------------------------ + +def test_device_openconfig_add_error_cases( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') + + with pytest.raises(grpc.RpcError) as e: + DEVICE_OC_WITH_EXTRA_RULES = copy.deepcopy(DEVICE_OC) + DEVICE_OC_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONNECT_RULES) + DEVICE_OC_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONFIG_RULES) + device_client.AddDevice(Device(**DEVICE_OC_WITH_EXTRA_RULES)) + assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT + msg_head = 'device.device_config.config_rules([' + msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ + 'with "_connect/" tag. Others should be configured after adding the device.' + except_msg = str(e.value.details()) + assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) + + +def test_device_openconfig_add_correct( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') + + DEVICE_OC_WITH_CONNECT_RULES = copy.deepcopy(DEVICE_OC) + DEVICE_OC_WITH_CONNECT_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONNECT_RULES) + device_client.AddDevice(Device(**DEVICE_OC_WITH_CONNECT_RULES)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_OC_UUID) # we know the driver exists now + assert driver is not None + + device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) + for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + + +def test_device_openconfig_get( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') + + initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_OC_ID)) + LOGGER.info('initial_config = {:s}'.format(grpc_message_to_json_string(initial_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) + LOGGER.info('device_data = {:s}'.format(grpc_message_to_json_string(device_data))) + + +def test_device_openconfig_configure( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') + if not ENABLE_OPENCONFIG_CONFIGURE: pytest.skip('Skipping test OpenConfig configure') + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_OC_UUID) # we know the driver exists now + assert driver is not None + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + DEVICE_OC_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_OC) + DEVICE_OC_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_OC_CONFIG_RULES) + device_client.ConfigureDevice(Device(**DEVICE_OC_WITH_CONFIG_RULES)) + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) + for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + for config_rule in DEVICE_OC_CONFIG_RULES: + assert 'custom' in config_rule + config_rule = ( + ConfigActionEnum.Name(config_rule['action']), config_rule['custom']['resource_key'], + config_rule['custom']['resource_value']) + assert config_rule in config_rules + + +def test_device_openconfig_monitor( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService, # pylint: disable=redefined-outer-name + mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name + + if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') + if not ENABLE_OPENCONFIG_MONITOR: pytest.skip('Skipping test OpenConfig monitor') + + device_uuid = DEVICE_OC_UUID + json_device_id = DEVICE_OC_ID + device_id = DeviceId(**json_device_id) + device_data = context_client.GetDevice(device_id) + #LOGGER.info('device_data = \n{:s}'.format(str(device_data))) + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(device_uuid) # we know the driver exists now + assert driver is not None + + SAMPLING_DURATION_SEC = 60.0 + SAMPLING_INTERVAL_SEC = 15.0 + + MONITORING_SETTINGS_LIST = [] + KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED = {} + for endpoint in device_data.device_endpoints: + endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid + for sample_type_id in endpoint.kpi_sample_types: + sample_type_name = str(KpiSampleType.Name(sample_type_id)).upper().replace('KPISAMPLETYPE_', '') + kpi_uuid = '{:s}-{:s}-{:s}-kpi_uuid'.format(device_uuid, endpoint_uuid, str(sample_type_id)) + monitoring_settings = { + 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, + 'kpi_descriptor': { + 'kpi_description': 'Metric {:s} for Endpoint {:s} in Device {:s}'.format( + sample_type_name, endpoint_uuid, device_uuid), + 'kpi_sample_type': sample_type_id, + 'device_id': json_device_id, + 'endpoint_id': json_endpoint_id(json_device_id, endpoint_uuid), + }, + 'sampling_duration_s': SAMPLING_DURATION_SEC, + 'sampling_interval_s': SAMPLING_INTERVAL_SEC, + } + MONITORING_SETTINGS_LIST.append(monitoring_settings) + KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED[kpi_uuid] = 0 + + NUM_SAMPLES_EXPECTED_PER_KPI = SAMPLING_DURATION_SEC / SAMPLING_INTERVAL_SEC + NUM_SAMPLES_EXPECTED = len(MONITORING_SETTINGS_LIST) * NUM_SAMPLES_EXPECTED_PER_KPI + + # Start monitoring the device + t_start_monitoring = datetime.timestamp(datetime.utcnow()) + for monitoring_settings in MONITORING_SETTINGS_LIST: + device_client.MonitorDeviceKpi(MonitoringSettings(**monitoring_settings)) + + # wait to receive the expected number of samples + # if takes more than 1.5 times the sampling duration, assume there is an error + time_ini = time.time() + queue_samples : queue.Queue = mock_service.queue_samples + received_samples = [] + while (len(received_samples) < NUM_SAMPLES_EXPECTED) and (time.time() - time_ini < SAMPLING_DURATION_SEC * 1.5): + try: + received_sample = queue_samples.get(block=True, timeout=SAMPLING_INTERVAL_SEC / NUM_SAMPLES_EXPECTED) + #LOGGER.info('received_sample = {:s}'.format(str(received_sample))) + received_samples.append(received_sample) + except queue.Empty: + continue + + t_end_monitoring = datetime.timestamp(datetime.utcnow()) + + #LOGGER.info('received_samples = {:s}'.format(str(received_samples))) + LOGGER.info('len(received_samples) = {:s}'.format(str(len(received_samples)))) + LOGGER.info('NUM_SAMPLES_EXPECTED = {:s}'.format(str(NUM_SAMPLES_EXPECTED))) + #assert len(received_samples) == NUM_SAMPLES_EXPECTED + for received_sample in received_samples: + kpi_uuid = received_sample.kpi_id.kpi_id.uuid + assert kpi_uuid in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED + assert isinstance(received_sample.timestamp, str) + try: + timestamp = float(received_sample.timestamp) + except ValueError: + dt_time = dateutil.parser.isoparse(received_sample.timestamp).replace(tzinfo=timezone.utc) + timestamp = float(calendar.timegm(dt_time.timetuple())) + (dt_time.microsecond / 1.e6) + assert timestamp > t_start_monitoring + assert timestamp < t_end_monitoring + assert received_sample.kpi_value.HasField('floatVal') or received_sample.kpi_value.HasField('intVal') + kpi_value = getattr(received_sample.kpi_value, received_sample.kpi_value.WhichOneof('value')) + assert isinstance(kpi_value, (float, int)) + KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED[kpi_uuid] += 1 + + LOGGER.info('KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED = {:s}'.format(str(KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED))) + # TODO: review why num_samples_received per KPI != NUM_SAMPLES_EXPECTED_PER_KPI + #for kpi_uuid, num_samples_received in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED.items(): + # assert num_samples_received == NUM_SAMPLES_EXPECTED_PER_KPI + + # Unsubscribe monitoring + for kpi_uuid in KPI_UUIDS__TO__NUM_SAMPLES_RECEIVED: + MONITORING_SETTINGS_UNSUBSCRIBE = { + 'kpi_id' : {'kpi_id': {'uuid': kpi_uuid}}, + 'sampling_duration_s': -1, # negative value in sampling_duration_s or sampling_interval_s means unsibscribe + 'sampling_interval_s': -1, # kpi_id is mandatory to unsibscribe + } + device_client.MonitorDeviceKpi(MonitoringSettings(**MONITORING_SETTINGS_UNSUBSCRIBE)) + + +def test_device_openconfig_deconfigure( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') + if not ENABLE_OPENCONFIG_DECONFIGURE: pytest.skip('Skipping test OpenConfig deconfigure') + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_OC_UUID) # we know the driver exists now + assert driver is not None + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + DEVICE_OC_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_OC) + DEVICE_OC_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_OC_DECONFIG_RULES) + device_client.ConfigureDevice(Device(**DEVICE_OC_WITH_DECONFIG_RULES)) + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_OC_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) + for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + for config_rule in DEVICE_OC_DECONFIG_RULES: + assert 'custom' in config_rule + action_set = ConfigActionEnum.Name(ConfigActionEnum.CONFIGACTION_SET) + config_rule = (action_set, config_rule['custom']['resource_key'], config_rule['custom']['resource_value']) + assert config_rule not in config_rules + + +def test_device_openconfig_delete( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_OPENCONFIG: pytest.skip('Skipping test: No OpenConfig device has been configured') + + device_client.DeleteDevice(DeviceId(**DEVICE_OC_ID)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_OC_UUID, {}) + assert driver is None diff --git a/src/device/tests/test_unitary_p4.py b/src/device/tests/test_unitary_p4.py new file mode 100644 index 0000000000000000000000000000000000000000..9370824cf39d53dbf9aec4a65e6d50ad7a253d09 --- /dev/null +++ b/src/device/tests/test_unitary_p4.py @@ -0,0 +1,303 @@ +# 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 unit tests. +""" + +import copy +import logging +import operator +import grpc +import pytest +from common.proto.context_pb2 import ConfigActionEnum, Device, DeviceId,\ + DeviceOperationalStatusEnum +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from device.service.DeviceService import DeviceService +from device.service.driver_api._Driver import _Driver +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, device_service, context_client, device_client, + monitoring_client, test_prepare_environment) + +from .mock_p4runtime_service import MockP4RuntimeService +try: + from .device_p4 import( + DEVICE_P4, DEVICE_P4_ID, DEVICE_P4_UUID, + DEVICE_P4_IP_ADDR, DEVICE_P4_PORT, DEVICE_P4_WORKERS, + DEVICE_P4_GRACE_PERIOD, DEVICE_P4_CONNECT_RULES, + DEVICE_P4_CONFIG_TABLE_ENTRY, DEVICE_P4_DECONFIG_TABLE_ENTRY) + ENABLE_P4 = True +except ImportError: + ENABLE_P4 = False + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + + +@pytest.fixture(scope='session') +def p4runtime_service(): + """ + Spawn a mock P4Runtime server. + + :return: void + """ + _service = MockP4RuntimeService( + address=DEVICE_P4_IP_ADDR, + port=DEVICE_P4_PORT, + max_workers=DEVICE_P4_WORKERS, + grace_period=DEVICE_P4_GRACE_PERIOD) + _service.start() + yield _service + _service.stop() + + +# ----- Test Device Driver P4 -------------------------------------------------- +def test_device_p4_add_error_cases( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService): # pylint: disable=redefined-outer-name + """ + Test AddDevice RPC with wrong inputs. + + :param context_client: context component client + :param device_client: device component client + :param device_service: device component service + :return: + """ + + if not ENABLE_P4: + pytest.skip('Skipping test: No P4 device has been configured') + + with pytest.raises(grpc.RpcError) as ex: + device_p4_with_extra_rules = copy.deepcopy(DEVICE_P4) + device_p4_with_extra_rules['device_config']['config_rules'].extend( + DEVICE_P4_CONNECT_RULES) + device_p4_with_extra_rules['device_config']['config_rules'].extend( + DEVICE_P4_CONFIG_TABLE_ENTRY) + device_client.AddDevice(Device(**device_p4_with_extra_rules)) + assert ex.value.code() == grpc.StatusCode.INVALID_ARGUMENT + msg_head = 'device.device_config.config_rules([' + msg_tail = ']) is invalid; RPC method AddDevice only accepts connection '\ + 'Config Rules that should start with "_connect/" tag. '\ + 'Others should be configured after adding the device.' + except_msg = str(ex.value.details()) + assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) + + +def test_device_p4_add_correct( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService, # pylint: disable=redefined-outer-name + p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name + """ + Test AddDevice RPC with correct inputs. + + :param context_client: context component client + :param device_client: device component client + :param device_service: device component service + :param p4runtime_service: Mock P4Runtime service + :return: + """ + + if not ENABLE_P4: + pytest.skip('Skipping test: No P4 device has been configured') + + device_p4_with_connect_rules = copy.deepcopy(DEVICE_P4) + device_p4_with_connect_rules['device_config']['config_rules'].extend( + DEVICE_P4_CONNECT_RULES) + device_client.AddDevice(Device(**device_p4_with_connect_rules)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver: _Driver = driver_instance_cache.get(DEVICE_P4_UUID) + assert driver is not None + + device_data = context_client.GetDevice(DeviceId(**DEVICE_P4_ID)) + config_rules = [ + ( + ConfigActionEnum.Name(config_rule.action), + config_rule.custom.resource_key, + config_rule.custom.resource_value + ) + for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) + for config_rule in config_rules]))) + + +def test_device_p4_get( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService, # pylint: disable=redefined-outer-name + p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name + """ + Test GetDevice RPC. + + :param context_client: context component client + :param device_client: device component client + :param device_service: device component service + :param p4runtime_service: Mock P4Runtime service + :return: + """ + + if not ENABLE_P4: + pytest.skip('Skipping test: No P4 device has been configured') + + initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_P4_ID)) + assert len(initial_config.config_rules) == 0 + LOGGER.info('initial_config = %s', + grpc_message_to_json_string(initial_config)) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_P4_ID)) + LOGGER.info('device_data = %s', grpc_message_to_json_string(device_data)) + + +def test_device_p4_configure( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService, # pylint: disable=redefined-outer-name + p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name + """ + Test ConfigureDevice RPC. + + :param context_client: context component client + :param device_client: device component client + :param device_service: device component service + :param p4runtime_service: Mock P4Runtime service + :return: + """ + + if not ENABLE_P4: + pytest.skip('Skipping test: No P4 device has been configured') + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver: _Driver = driver_instance_cache.get(DEVICE_P4_UUID) + assert driver is not None + + # No entries should exist at this point in time + driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + assert len(driver_config) == len(driver.get_manager().get_resource_keys()) + assert driver.get_manager().count_active_entries() == 0 + + # Flip the operational status and check it is correctly flipped in Context + device_p4_with_operational_status = copy.deepcopy(DEVICE_P4) + device_p4_with_operational_status['device_operational_status'] = \ + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED + device_client.ConfigureDevice(Device(**device_p4_with_operational_status)) + device_data = context_client.GetDevice(DeviceId(**DEVICE_P4_ID)) + assert device_data.device_operational_status == \ + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED + + # Insert a new table entry + device_p4_with_config_rules = copy.deepcopy(DEVICE_P4) + device_p4_with_config_rules['device_config']['config_rules'].extend( + DEVICE_P4_CONFIG_TABLE_ENTRY) + device_client.ConfigureDevice(Device(**device_p4_with_config_rules)) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_P4_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), + config_rule.custom.resource_key, + config_rule.custom.resource_value) + for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join( + ['{:s} {:s} = {:s}'.format(*config_rule) + for config_rule in config_rules])) + ) + for config_rule in DEVICE_P4_CONFIG_TABLE_ENTRY: + assert 'custom' in config_rule + + +def test_device_p4_deconfigure( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService, # pylint: disable=redefined-outer-name + p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name + """ + Test DeconfigureDevice RPC. + + :param context_client: context component client + :param device_client: device component client + :param device_service: device component service + :param p4runtime_service: Mock P4Runtime service + :return: + """ + + if not ENABLE_P4: + pytest.skip('Skipping test: No P4 device has been configured') + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver: _Driver = driver_instance_cache.get(DEVICE_P4_UUID) + assert driver is not None + + # Delete a table entry + device_p4_with_config_rules = copy.deepcopy(DEVICE_P4) + device_p4_with_config_rules['device_config']['config_rules'].extend( + DEVICE_P4_DECONFIG_TABLE_ENTRY) + device_client.ConfigureDevice(Device(**device_p4_with_config_rules)) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_P4_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), + config_rule.custom.resource_key, + config_rule.custom.resource_value) + for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join( + ['{:s} {:s} = {:s}'.format(*config_rule) + for config_rule in config_rules])) + ) + for config_rule in DEVICE_P4_CONFIG_TABLE_ENTRY: + assert 'custom' in config_rule + + # Flip the operational status and check it is correctly flipped in Context + device_p4_with_operational_status = copy.deepcopy(DEVICE_P4) + device_p4_with_operational_status['device_operational_status'] = \ + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED + device_client.ConfigureDevice(Device(**device_p4_with_operational_status)) + device_data = context_client.GetDevice(DeviceId(**DEVICE_P4_ID)) + assert device_data.device_operational_status == \ + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED + + +def test_device_p4_delete( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService, # pylint: disable=redefined-outer-name + p4runtime_service: MockP4RuntimeService): # pylint: disable=redefined-outer-name + """ + Test DeleteDevice RPC. + + :param context_client: context component client + :param device_client: device component client + :param device_service: device component service + :param p4runtime_service: Mock P4Runtime service + :return: + """ + + if not ENABLE_P4: + pytest.skip('Skipping test: No P4 device has been configured') + + device_client.DeleteDevice(DeviceId(**DEVICE_P4_ID)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver: _Driver = driver_instance_cache.get(DEVICE_P4_UUID) + assert driver is None diff --git a/src/device/tests/test_unitary_tapi.py b/src/device/tests/test_unitary_tapi.py new file mode 100644 index 0000000000000000000000000000000000000000..46962b2d9c48d1e27256a9dbb3f5c429208ac4ea --- /dev/null +++ b/src/device/tests/test_unitary_tapi.py @@ -0,0 +1,171 @@ +# 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, grpc, logging, pytest +from common.proto.context_pb2 import ConfigActionEnum, Device, DeviceId +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from device.service.DeviceService import DeviceService +from device.service.driver_api._Driver import _Driver +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, device_service, context_client, device_client, monitoring_client, test_prepare_environment) + +try: + from .Device_Transport_Api_CTTC import ( + DEVICE_TAPI, DEVICE_TAPI_CONNECT_RULES, DEVICE_TAPI_UUID, DEVICE_TAPI_ID, DEVICE_TAPI_CONFIG_RULES, + DEVICE_TAPI_DECONFIG_RULES) + ENABLE_TAPI = True +except ImportError: + ENABLE_TAPI = False + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + + +# ----- Test Device Driver TAPI ------------------------------------------------ + +def test_device_tapi_add_error_cases( + device_client : DeviceClient): # pylint: disable=redefined-outer-name + + if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') + + with pytest.raises(grpc.RpcError) as e: + DEVICE_TAPI_WITH_EXTRA_RULES = copy.deepcopy(DEVICE_TAPI) + DEVICE_TAPI_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_CONNECT_RULES) + DEVICE_TAPI_WITH_EXTRA_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_CONFIG_RULES) + device_client.AddDevice(Device(**DEVICE_TAPI_WITH_EXTRA_RULES)) + assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT + msg_head = 'device.device_config.config_rules([' + msg_tail = ']) is invalid; RPC method AddDevice only accepts connection Config Rules that should start '\ + 'with "_connect/" tag. Others should be configured after adding the device.' + except_msg = str(e.value.details()) + assert except_msg.startswith(msg_head) and except_msg.endswith(msg_tail) + + +def test_device_tapi_add_correct( + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') + + DEVICE_TAPI_WITH_CONNECT_RULES = copy.deepcopy(DEVICE_TAPI) + DEVICE_TAPI_WITH_CONNECT_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_CONNECT_RULES) + device_client.AddDevice(Device(**DEVICE_TAPI_WITH_CONNECT_RULES)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver: _Driver = driver_instance_cache.get(DEVICE_TAPI_UUID) + assert driver is not None + + +def test_device_tapi_get( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient): # pylint: disable=redefined-outer-name + + if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') + + initial_config = device_client.GetInitialConfig(DeviceId(**DEVICE_TAPI_ID)) + LOGGER.info('initial_config = {:s}'.format(grpc_message_to_json_string(initial_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_TAPI_ID)) + LOGGER.info('device_data = {:s}'.format(grpc_message_to_json_string(device_data))) + + +def test_device_tapi_configure( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_TAPI_UUID) + assert driver is not None + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + DEVICE_TAPI_WITH_CONFIG_RULES = copy.deepcopy(DEVICE_TAPI) + DEVICE_TAPI_WITH_CONFIG_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_CONFIG_RULES) + device_client.ConfigureDevice(Device(**DEVICE_TAPI_WITH_CONFIG_RULES)) + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_TAPI_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) + for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + for config_rule in DEVICE_TAPI_CONFIG_RULES: + assert 'custom' in config_rule + config_rule = ( + ConfigActionEnum.Name(config_rule['action']), config_rule['custom']['resource_key'], + config_rule['custom']['resource_value']) + assert config_rule in config_rules + + +def test_device_tapi_deconfigure( + context_client: ContextClient, # pylint: disable=redefined-outer-name + device_client: DeviceClient, # pylint: disable=redefined-outer-name + device_service: DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') + + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver: _Driver = driver_instance_cache.get(DEVICE_TAPI_UUID) + assert driver is not None + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + DEVICE_TAPI_WITH_DECONFIG_RULES = copy.deepcopy(DEVICE_TAPI) + DEVICE_TAPI_WITH_DECONFIG_RULES['device_config']['config_rules'].extend(DEVICE_TAPI_DECONFIG_RULES) + device_client.ConfigureDevice(Device(**DEVICE_TAPI_WITH_DECONFIG_RULES)) + + # Requires to retrieve data from device; might be slow. Uncomment only when needed and test does not pass directly. + #driver_config = sorted(driver.GetConfig(), key=operator.itemgetter(0)) + #LOGGER.info('driver_config = {:s}'.format(str(driver_config))) + + device_data = context_client.GetDevice(DeviceId(**DEVICE_TAPI_ID)) + config_rules = [ + (ConfigActionEnum.Name(config_rule.action), config_rule.custom.resource_key, config_rule.custom.resource_value) + for config_rule in device_data.device_config.config_rules + if config_rule.WhichOneof('config_rule') == 'custom' + ] + LOGGER.info('device_data.device_config.config_rules = \n{:s}'.format( + '\n'.join(['{:s} {:s} = {:s}'.format(*config_rule) for config_rule in config_rules]))) + for config_rule in DEVICE_TAPI_DECONFIG_RULES: + assert 'custom' in config_rule + action_set = ConfigActionEnum.Name(ConfigActionEnum.CONFIGACTION_SET) + config_rule = (action_set, config_rule['custom']['resource_key'], config_rule['custom']['resource_value']) + assert config_rule not in config_rules + + +def test_device_tapi_delete( + device_client : DeviceClient, # pylint: disable=redefined-outer-name + device_service : DeviceService): # pylint: disable=redefined-outer-name + + if not ENABLE_TAPI: pytest.skip('Skipping test: No TAPI device has been configured') + + device_client.DeleteDevice(DeviceId(**DEVICE_TAPI_ID)) + driver_instance_cache = device_service.device_servicer.driver_instance_cache + driver : _Driver = driver_instance_cache.get(DEVICE_TAPI_UUID, {}) + assert driver is None diff --git a/src/dlt/.gitlab-ci.yml b/src/dlt/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..df30a7b1deb3360fbf8b578796fa39f3b7e736ba --- /dev/null +++ b/src/dlt/.gitlab-ci.yml @@ -0,0 +1,196 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Build, tag, and push the Docker image to the GitLab Docker registry +build dlt: + variables: + IMAGE_NAME: 'dlt' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: build + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + script: + # This first build tags the builder resulting image to prevent being removed by dangling image removal command + - docker build -t "${IMAGE_NAME}-gateway:$IMAGE_TAG" -f ./src/$IMAGE_NAME/gateway/Dockerfile . + - docker build -t "${IMAGE_NAME}-connector:$IMAGE_TAG" -f ./src/$IMAGE_NAME/connector/Dockerfile . + - docker tag "${IMAGE_NAME}-gateway:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-gateway:$IMAGE_TAG" + - docker tag "${IMAGE_NAME}-connector:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-connector:$IMAGE_TAG" + - docker push "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-gateway:$IMAGE_TAG" + - docker push "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-connector:$IMAGE_TAG" + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/.gitlab-ci.yml + - src/$IMAGE_NAME/gateway/**/*.{kt,kts,proto,pem,json} + - src/$IMAGE_NAME/gateway/build.gradle.kts + - src/$IMAGE_NAME/gateway/Dockerfile + - src/$IMAGE_NAME/gateway/gradle.properties + - src/$IMAGE_NAME/gateway/gradlew + - src/$IMAGE_NAME/gateway/gradlew.bat + - src/$IMAGE_NAME/gateway/settings.gradle.kts + - src/$IMAGE_NAME/connector/**/*.{py,in,yml} + - src/$IMAGE_NAME/connector/Dockerfile + - src/$IMAGE_NAME/connector/tests/*.py + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml + +# Apply unit test to the component +unit test dlt-gateway: + variables: + IMAGE_NAME: 'dlt' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: unit_test + needs: + - build dlt + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi + - if docker container ls | grep ${IMAGE_NAME}-connector; then docker rm -f ${IMAGE_NAME}-connector; else echo "${IMAGE_NAME}-connector image is not in the system"; fi + - if docker container ls | grep ${IMAGE_NAME}-gateway; then docker rm -f ${IMAGE_NAME}-gateway; else echo "${IMAGE_NAME}-gateway image is not in the system"; fi + script: + - docker pull "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-gateway:$IMAGE_TAG" + #- docker run --name ${IMAGE_NAME}-gateway -d -p 50051:50051 -v "$PWD/src/${IMAGE_NAME}/gateway/tests:/opt/results" --network=teraflowbridge ${IMAGE_NAME}-gateway:${IMAGE_TAG} + - docker run --name ${IMAGE_NAME}-gateway -d -p 50051:50051 --network=teraflowbridge ${IMAGE_NAME}-gateway:${IMAGE_TAG} + - sleep 5 + - docker ps -a + - docker logs ${IMAGE_NAME}-gateway + #- docker exec -i ${IMAGE_NAME}-gateway bash -c "curl -0 -v -X POST -H 'Expect:' -H 'Content-Type:\ application/json' http://127.0.0.1:8081/dlt/api/v1/compRoute -d @/var/teraflow/tests/pc-req.json" + #- docker kill --signal=SIGUSR1 dlt-gateway + #- docker exec -i ${IMAGE_NAME}-gateway bash -c "gcovr" + #coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' + after_script: + - docker logs ${IMAGE_NAME}-gateway + - docker rm -f ${IMAGE_NAME}-gateway + - docker network rm teraflowbridge + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/.gitlab-ci.yml + - src/$IMAGE_NAME/gateway/**/*.{kt,kts,proto,pem,json} + - src/$IMAGE_NAME/gateway/build.gradle.kts + - src/$IMAGE_NAME/gateway/Dockerfile + - src/$IMAGE_NAME/gateway/gradle.properties + - src/$IMAGE_NAME/gateway/gradlew + - src/$IMAGE_NAME/gateway/gradlew.bat + - src/$IMAGE_NAME/gateway/settings.gradle.kts + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml + #artifacts: + # when: always + # reports: + # junit: src/$IMAGE_NAME/gateway/tests/${IMAGE_NAME}-gateway_report.xml + +# Apply unit test to the component +unit test dlt-connector: + variables: + IMAGE_NAME: 'dlt' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: unit_test + needs: + - build dlt + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create --driver=bridge teraflowbridge; fi + - if docker container ls | grep ${IMAGE_NAME}-connector; then docker rm -f ${IMAGE_NAME}-connector; else echo "${IMAGE_NAME}-connector image is not in the system"; fi + - if docker container ls | grep ${IMAGE_NAME}-gateway; then docker rm -f ${IMAGE_NAME}-gateway; else echo "${IMAGE_NAME}-gateway image is not in the system"; fi + script: + - docker pull "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-connector:$IMAGE_TAG" + - docker pull "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-gateway:$IMAGE_TAG" + - > + docker run --name ${IMAGE_NAME}-gateway -d -p 50051:50051 --network=teraflowbridge + --volume "$PWD/src/${IMAGE_NAME}/gateway/tests:/opt/results" + $CI_REGISTRY_IMAGE/${IMAGE_NAME}-gateway:$IMAGE_TAG + - DLT_GATEWAY_HOST=$(docker inspect ${IMAGE_NAME}-gateway --format "{{.NetworkSettings.Networks.teraflowbridge.IPAddress}}") + - echo $DLT_GATEWAY_HOST + - sleep 1 + - > + docker run --name ${IMAGE_NAME}-connector -d -p 8080:8080 --network=teraflowbridge + --volume "$PWD/src/${IMAGE_NAME}/connector/tests:/opt/results" + --env "DLT_GATEWAY_HOST=${DLT_GATEWAY_HOST}" + --env "DLT_GATEWAY_PORT=50051" + $CI_REGISTRY_IMAGE/${IMAGE_NAME}-connector:$IMAGE_TAG + - sleep 5 + - docker ps -a + - docker logs ${IMAGE_NAME}-connector + - docker logs ${IMAGE_NAME}-gateway + - > + docker exec -i ${IMAGE_NAME}-connector bash -c + "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/connector/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}-connector_report.xml" + - docker exec -i ${IMAGE_NAME}-connector bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' + after_script: + - docker ps -a + - docker logs ${IMAGE_NAME}-connector + - docker logs ${IMAGE_NAME}-gateway + - docker rm -f ${IMAGE_NAME}-connector + - docker rm -f ${IMAGE_NAME}-gateway + - docker network rm teraflowbridge + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/.gitlab-ci.yml + - src/$IMAGE_NAME/gateway/**/*.{kt,kts,proto,pem,json} + - src/$IMAGE_NAME/gateway/build.gradle.kts + - src/$IMAGE_NAME/gateway/Dockerfile + - src/$IMAGE_NAME/gateway/gradle.properties + - src/$IMAGE_NAME/gateway/gradlew + - src/$IMAGE_NAME/gateway/gradlew.bat + - src/$IMAGE_NAME/gateway/settings.gradle.kts + - src/$IMAGE_NAME/connector/**/*.{py,in,yml} + - src/$IMAGE_NAME/connector/Dockerfile + - src/$IMAGE_NAME/connector/tests/*.py + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml + artifacts: + when: always + reports: + junit: src/$IMAGE_NAME/connector/tests/${IMAGE_NAME}-connector_report.xml + +# Deployment of the service in Kubernetes Cluster +deploy dlt: + variables: + IMAGE_NAME: 'dlt' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: deploy + needs: + - unit test dlt-gateway + - unit test dlt-connector + # - integ_test execute + script: + - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' + - kubectl version + - kubectl get all + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" + - kubectl get all + # environment: + # name: test + # url: https://example.com + # kubernetes: + # namespace: test + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + when: manual + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + when: manual diff --git a/src/dlt/README.md b/src/dlt/README.md deleted file mode 100644 index 361de07c6a35fb7951f063a9aa6fc3fb28d3ba0d..0000000000000000000000000000000000000000 --- a/src/dlt/README.md +++ /dev/null @@ -1,84 +0,0 @@ -``` - NEC Laboratories Europe GmbH - - PROPRIETARY INFORMATION - - The software and its source code contain valuable trade secrets and - shall be maintained in confidence and treated as confidential - information. The software may only be used for evaluation and/or - testing purposes, unless otherwise explicitly stated in a written - agreement with NEC Laboratories Europe GmbH. - - Any unauthorized publication, transfer to third parties or - duplication of the object or source code - either totally or in - part - is strictly prohibited. - - Copyright (c) 2021 NEC Laboratories Europe GmbH - All Rights Reserved. - - Authors: Konstantin Munichev - - - NEC Laboratories Europe GmbH DISCLAIMS ALL WARRANTIES, EITHER - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND THE - WARRANTY AGAINST LATENT DEFECTS, WITH RESPECT TO THE PROGRAM AND - THE ACCOMPANYING DOCUMENTATION. - - NO LIABILITIES FOR CONSEQUENTIAL DAMAGES: IN NO EVENT SHALL NEC - Laboratories Europe GmbH or ANY OF ITS SUBSIDIARIES BE LIABLE FOR - ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR - LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF - INFORMATION, OR OTHER PECUNIARY LOSS AND INDIRECT, CONSEQUENTIAL, - INCIDENTAL, ECONOMIC OR PUNITIVE DAMAGES) ARISING OUT OF THE USE OF - OR INABILITY TO USE THIS PROGRAM, EVEN IF NEC Laboratories Europe - GmbH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - - THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY. - ``` - -# DLT module guide - -## General information -The DLT module is used to provide access to the underlying Fabric deployment. It allows clients -to add, retrieve, modify and delete blockchain-backed data, essentially working as a key-value -database. External clients should use REST API to communicate with this service, its detailed -description available below. - -## Code structure -The whole DLT module consists of several packages: -- fabric package -- http package -- proto package -- client example - -### Fabric package -The most important class in this package is `FabricConnector`. First, it establishes connection -with the underlying Fabric network using Java Gateway SDK. After that, it could be used as a -CRUD interface. -Other files contain auxiliary code for `FabricConnector` which allows it to register/enroll -users and to obtain smart contract instances. - -### HTTP package -Contains server side HTTP handler. It accepts requests from the outside and performs the -requested operation. For the detailed description see API description section. - -### Proto package -The proto package contains `Config.proto` file which contains messages for REST API. The most -important ones are `DltConfig` (it defines the whole DLT configuration) and `DltRecord` which -represents data to store in the blockchain. - -### Client example -This code is not necessary to the service, but it could be used to test the service. It contains -a sample REST client which connects the service and perform all the CRUD operations. - -## REST API description -| Method | URL | Input | Response code | Output | -| --- | ----------- | --- | --- | --- | -| POST | /dlt/configure | Configuration object | 201 or 400 | Status value | -| GET | /dlt/configure | - | 200 or 404 | Configuration object | -| POST | /dlt/record | Record object | 200, 201, 400 or 404 | Status value | -| GET | /dlt/record | Record id | 200 or 404 | Record object | - -Record and configuration object are defined in `proto` package. - diff --git a/src/dlt/__init__.py b/src/dlt/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/dlt/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/dlt/config/ca.org1.example.com-cert.pem b/src/dlt/config/ca.org1.example.com-cert.pem deleted file mode 100644 index 9c10b97908d70ae16b542f922563dbcba21056c6..0000000000000000000000000000000000000000 --- a/src/dlt/config/ca.org1.example.com-cert.pem +++ /dev/null @@ -1,14 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICJjCCAc2gAwIBAgIULDVQiqifWHypuW50LhHXSJeeFG0wCgYIKoZIzj0EAwIw -cDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMQ8wDQYDVQQH -EwZEdXJoYW0xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh -Lm9yZzEuZXhhbXBsZS5jb20wHhcNMjExMTIzMTIzNzAwWhcNMzYxMTE5MTIzNzAw -WjBwMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xpbmExDzANBgNV -BAcTBkR1cmhhbTEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMT -Y2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABFNi -ggnkzv5qQSkIAQ05Y9DUq4teNjbMTdqD0IwdQe+lcYI0wgkR9wpBn5fj2pN093+P -l2crhgyNqZyAuqaylvCjRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAG -AQH/AgEBMB0GA1UdDgQWBBS44tGlbJ5GIBwATL383Hw0vz8jHDAKBggqhkjOPQQD -AgNHADBEAiAlkKikh7eG8lf0uI7NwBi0QrbnnY4vHf9ErceKwUhZWgIgS9Z9AzBc -n9RAK3v/freT3Exs7b+MK13UeDdejRWS+RE= ------END CERTIFICATE----- diff --git a/open_webui.sh b/src/dlt/connector/Config.py old mode 100755 new mode 100644 similarity index 51% rename from open_webui.sh rename to src/dlt/connector/Config.py index bcb45ac1747efec037ff6422f56ded13e6e6e546..d89eda5d8dd956fe39d6a3e55fa10cf9f69a0715 --- a/open_webui.sh +++ b/src/dlt/connector/Config.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,15 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -# this script opens the webui +import os -WEBUI_PROTO=`kubectl get service/webuiservice -n tf-dev -o jsonpath='{.spec.ports[0].name}'` -WEBUI_IP=`kubectl get service/webuiservice -n tf-dev -o jsonpath='{.spec.clusterIP}'` -WEBUI_PORT=`kubectl get service/webuiservice -n tf-dev -o jsonpath='{.spec.ports[0].port}'` -URL=${WEBUI_PROTO}://${WEBUI_IP}:${WEBUI_PORT} +DEFAULT_DLT_GATEWAY_HOST = '127.0.0.1' +DEFAULT_DLT_GATEWAY_PORT = '50051' -echo Opening web UI on URL ${URL} - -# curl -kL ${URL} - -python3 -m webbrowser ${URL} \ No newline at end of file +# Find IP:port of gateway container as follows: +# - first check env vars DLT_GATEWAY_HOST & DLT_GATEWAY_PORT +# - if not set, use DEFAULT_DLT_GATEWAY_HOST & DEFAULT_DLT_GATEWAY_PORT +DLT_GATEWAY_HOST = str(os.environ.get('DLT_GATEWAY_HOST', DEFAULT_DLT_GATEWAY_HOST)) +DLT_GATEWAY_PORT = int(os.environ.get('DLT_GATEWAY_PORT', DEFAULT_DLT_GATEWAY_PORT)) diff --git a/src/dlt/connector/Dockerfile b/src/dlt/connector/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..f4d85ec8c591041e920c7404acc862c3d5a4a560 --- /dev/null +++ b/src/dlt/connector/Dockerfile @@ -0,0 +1,71 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM python:3.9-slim + +# Install dependencies +RUN apt-get --yes --quiet --quiet update && \ + apt-get --yes --quiet --quiet install wget g++ && \ + rm -rf /var/lib/apt/lists/* + +# Set Python to show logs as they occur +ENV PYTHONUNBUFFERED=0 + +# Download the gRPC health probe +RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ + wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ + chmod +x /bin/grpc_health_probe + +# Get generic Python packages +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools + +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components +WORKDIR /var/teraflow +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt + +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto + +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; + +# Create component sub-folders, get specific Python packages +RUN mkdir -p /var/teraflow/dlt/connector +WORKDIR /var/teraflow/dlt/connector +COPY src/dlt/connector/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN python3 -m pip install -r requirements.txt + +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/context/. context/ +COPY src/dlt/connector/. dlt/connector +COPY src/interdomain/. interdomain/ +COPY src/slice/. slice/ + +# Start the service +ENTRYPOINT ["python", "-m", "dlt.connector.service"] diff --git a/src/dlt/connector/__init__.py b/src/dlt/connector/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/dlt/connector/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/dlt/connector/client/DltConnectorClient.py b/src/dlt/connector/client/DltConnectorClient.py new file mode 100644 index 0000000000000000000000000000000000000000..55322ab58cf91735dbadea237c1a9c0b1461018d --- /dev/null +++ b/src/dlt/connector/client/DltConnectorClient.py @@ -0,0 +1,110 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import grpc, logging +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc +from common.proto.context_pb2 import Empty, TopologyId +from common.proto.dlt_connector_pb2 import DltDeviceId, DltLinkId, DltServiceId, DltSliceId +from common.proto.dlt_connector_pb2_grpc import DltConnectorServiceStub +from common.tools.client.RetryDecorator import retry, delay_exponential +from common.tools.grpc.Tools import grpc_message_to_json_string + +LOGGER = logging.getLogger(__name__) +MAX_RETRIES = 15 +DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + +class DltConnectorClient: + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.DLT) + if not port: port = get_service_port_grpc(ServiceNameEnum.DLT) + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) + LOGGER.debug('Creating channel to {:s}...'.format(self.endpoint)) + self.channel = None + self.stub = None + self.connect() + LOGGER.debug('Channel created') + + def connect(self): + self.channel = grpc.insecure_channel(self.endpoint) + self.stub = DltConnectorServiceStub(self.channel) + + def close(self): + if self.channel is not None: self.channel.close() + self.channel = None + self.stub = None + + @RETRY_DECORATOR + def RecordAll(self, request : TopologyId) -> Empty: + LOGGER.debug('RecordAll request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.RecordAll(request) + LOGGER.debug('RecordAll result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def RecordAllDevices(self, request : TopologyId) -> Empty: + LOGGER.debug('RecordAllDevices request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.RecordAllDevices(request) + LOGGER.debug('RecordAllDevices result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def RecordDevice(self, request : DltDeviceId) -> Empty: + LOGGER.debug('RecordDevice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.RecordDevice(request) + LOGGER.debug('RecordDevice result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def RecordAllLinks(self, request : TopologyId) -> Empty: + LOGGER.debug('RecordAllLinks request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.RecordAllLinks(request) + LOGGER.debug('RecordAllLinks result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def RecordLink(self, request : DltLinkId) -> Empty: + LOGGER.debug('RecordLink request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.RecordLink(request) + LOGGER.debug('RecordLink result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def RecordAllServices(self, request : TopologyId) -> Empty: + LOGGER.debug('RecordAllServices request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.RecordAllServices(request) + LOGGER.debug('RecordAllServices result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def RecordService(self, request : DltServiceId) -> Empty: + LOGGER.debug('RecordService request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.RecordService(request) + LOGGER.debug('RecordService result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def RecordAllSlices(self, request : TopologyId) -> Empty: + LOGGER.debug('RecordAllSlices request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.RecordAllSlices(request) + LOGGER.debug('RecordAllSlices result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def RecordSlice(self, request : DltSliceId) -> Empty: + LOGGER.debug('RecordSlice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.RecordSlice(request) + LOGGER.debug('RecordSlice result: {:s}'.format(grpc_message_to_json_string(response))) + return response diff --git a/src/dlt/connector/client/DltEventsCollector.py b/src/dlt/connector/client/DltEventsCollector.py new file mode 100644 index 0000000000000000000000000000000000000000..9f929d7ccf4a8f54c6f87304ec05bb9086f8522c --- /dev/null +++ b/src/dlt/connector/client/DltEventsCollector.py @@ -0,0 +1,76 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import grpc, logging, queue, threading, time +from common.proto.dlt_gateway_pb2 import DltRecordSubscription +from common.tools.grpc.Tools import grpc_message_to_json_string +from dlt.connector.client.DltGatewayClient import DltGatewayClient + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +class DltEventsCollector(threading.Thread): + def __init__( + self, dltgateway_client : DltGatewayClient, + log_events_received : bool = False, + ) -> None: + super().__init__(name='DltEventsCollector', daemon=True) + self._dltgateway_client = dltgateway_client + self._log_events_received = log_events_received + self._events_queue = queue.Queue() + self._terminate = threading.Event() + self._dltgateway_stream = None + + def run(self) -> None: + self._terminate.clear() + while not self._terminate.is_set(): + try: + subscription = DltRecordSubscription() # bu default subscribe to all + self._dltgateway_stream = self._dltgateway_client.SubscribeToDlt(subscription) + for event in self._dltgateway_stream: + if self._log_events_received: + LOGGER.info('[_collect] event: {:s}'.format(grpc_message_to_json_string(event))) + self._events_queue.put_nowait(event) + except grpc.RpcError as e: + if e.code() == grpc.StatusCode.UNAVAILABLE: # pylint: disable=no-member + time.sleep(0.5) + continue + elif e.code() == grpc.StatusCode.CANCELLED: # pylint: disable=no-member + break + else: + raise # pragma: no cover + + def get_event(self, block : bool = True, timeout : float = 0.1): + try: + return self._events_queue.get(block=block, timeout=timeout) + except queue.Empty: # pylint: disable=catching-non-exception + return None + + def get_events(self, block : bool = True, timeout : float = 0.1, count : int = None): + events = [] + if count is None: + while True: + event = self.get_event(block=block, timeout=timeout) + if event is None: break + events.append(event) + else: + for _ in range(count): + event = self.get_event(block=block, timeout=timeout) + if event is None: continue + events.append(event) + return sorted(events, key=lambda e: e.event.timestamp.timestamp) + + def stop(self): + self._terminate.set() + if self._dltgateway_stream is not None: self._dltgateway_stream.cancel() diff --git a/src/dlt/connector/client/DltGatewayClient.py b/src/dlt/connector/client/DltGatewayClient.py new file mode 100644 index 0000000000000000000000000000000000000000..4654f470e307fa23d5e10c1db59c9ccb04f19fdc --- /dev/null +++ b/src/dlt/connector/client/DltGatewayClient.py @@ -0,0 +1,83 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from typing import Iterator +import grpc, logging +from common.proto.context_pb2 import Empty, TeraFlowController +from common.proto.dlt_gateway_pb2 import ( + DltPeerStatus, DltPeerStatusList, DltRecord, DltRecordEvent, DltRecordId, DltRecordStatus, DltRecordSubscription) +from common.proto.dlt_gateway_pb2_grpc import DltGatewayServiceStub +from common.tools.client.RetryDecorator import retry, delay_exponential +from common.tools.grpc.Tools import grpc_message_to_json_string +from dlt.connector.Config import DLT_GATEWAY_HOST, DLT_GATEWAY_PORT + +LOGGER = logging.getLogger(__name__) +MAX_RETRIES = 15 +DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + +class DltGatewayClient: + def __init__(self, host=None, port=None): + if not host: host = DLT_GATEWAY_HOST + if not port: port = DLT_GATEWAY_PORT + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) + LOGGER.debug('Creating channel to {:s}...'.format(self.endpoint)) + self.channel = None + self.stub = None + self.connect() + LOGGER.debug('Channel created') + + def connect(self): + self.channel = grpc.insecure_channel(self.endpoint) + self.stub = DltGatewayServiceStub(self.channel) + + def close(self): + if self.channel is not None: self.channel.close() + self.channel = None + self.stub = None + + @RETRY_DECORATOR + def RecordToDlt(self, request : DltRecord) -> DltRecordStatus: + LOGGER.debug('RecordToDlt request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.RecordToDlt(request) + LOGGER.debug('RecordToDlt result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetFromDlt(self, request : DltRecordId) -> DltRecord: + LOGGER.debug('GetFromDlt request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetFromDlt(request) + LOGGER.debug('GetFromDlt result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def SubscribeToDlt(self, request : DltRecordSubscription) -> Iterator[DltRecordEvent]: + LOGGER.debug('SubscribeToDlt request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.SubscribeToDlt(request) + LOGGER.debug('SubscribeToDlt result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetDltStatus(self, request : TeraFlowController) -> DltPeerStatus: + LOGGER.debug('GetDltStatus request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetDltStatus(request) + LOGGER.debug('GetDltStatus result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetDltPeers(self, request : Empty) -> DltPeerStatusList: + LOGGER.debug('GetDltPeers request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetDltPeers(request) + LOGGER.debug('GetDltPeers result: {:s}'.format(grpc_message_to_json_string(response))) + return response diff --git a/src/dlt/connector/client/__init__.py b/src/dlt/connector/client/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf --- /dev/null +++ b/src/dlt/connector/client/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/src/dlt/connector/main_test.py b/src/dlt/connector/main_test.py new file mode 100644 index 0000000000000000000000000000000000000000..679be72870cf84b790553e2d43ed9961a1d66379 --- /dev/null +++ b/src/dlt/connector/main_test.py @@ -0,0 +1,80 @@ +# 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. + +# pip install grpcio==1.47.0 grpcio-tools==1.47.0 protobuf==3.20.1 +# PYTHONPATH=./src python +# PYTHONPATH=/home/cttc/teraflow/src python -m dlt.connector.main_test + +import logging, sys, time +from common.proto.dlt_gateway_pb2 import ( + DLTRECORDOPERATION_ADD, DLTRECORDOPERATION_UNDEFINED, DLTRECORDOPERATION_UPDATE, DLTRECORDTYPE_DEVICE, + DLTRECORDTYPE_UNDEFINED, DltRecord, DltRecordId) +from common.tools.object_factory.Device import json_device +from common.tools.grpc.Tools import grpc_message_to_json_string +from src.common.proto.context_pb2 import DEVICEOPERATIONALSTATUS_ENABLED, Device +from .client.DltGatewayClient import DltGatewayClient +from .client.DltEventsCollector import DltEventsCollector + +logging.basicConfig(level=logging.INFO) +LOGGER = logging.getLogger(__name__) + +DLT_GATEWAY_HOST = '127.0.0.1' +DLT_GATEWAY_PORT = 30551 #50051 + +def record_found(record : DltRecord) -> bool: + found = True + found = found and (len(record.record_id.domain_uuid.uuid) > 0) + found = found and (record.record_id.type != DLTRECORDTYPE_UNDEFINED) + found = found and (len(record.record_id.record_uuid.uuid) > 0) + #found = found and (record.operation != DLTRECORDOPERATION_UNDEFINED) + found = found and (len(record.data_json) > 0) + return found + +def main(): + dltgateway_client = DltGatewayClient(host=DLT_GATEWAY_HOST, port=DLT_GATEWAY_PORT) + dltgateway_collector = DltEventsCollector(dltgateway_client, log_events_received=True) + dltgateway_collector.start() + + time.sleep(3) + + # Check record exists + dri = DltRecordId() + dri.domain_uuid.uuid = 'non-existing-domain' + dri.record_uuid.uuid = 'non-existing-record' + dri.type = DLTRECORDTYPE_DEVICE + reply = dltgateway_client.GetFromDlt(dri) + assert not record_found(reply), 'Record should not exist' + + device = Device(**json_device('dev-1', 'packet-router', DEVICEOPERATIONALSTATUS_ENABLED)) + + r2dlt_req = DltRecord() + r2dlt_req.record_id.domain_uuid.uuid = 'tfs-a' + r2dlt_req.record_id.type = DLTRECORDTYPE_DEVICE + r2dlt_req.record_id.record_uuid.uuid = device.device_id.device_uuid.uuid + r2dlt_req.operation = DLTRECORDOPERATION_ADD + r2dlt_req.data_json = grpc_message_to_json_string(device) + LOGGER.info('r2dlt_req = {:s}'.format(grpc_message_to_json_string(r2dlt_req))) + r2dlt_rep = dltgateway_client.RecordToDlt(r2dlt_req) + LOGGER.info('r2dlt_rep = {:s}'.format(grpc_message_to_json_string(r2dlt_rep))) + + dlt2r_req = r2dlt_req.record_id + LOGGER.info('dlt2r_req = {:s}'.format(grpc_message_to_json_string(dlt2r_req))) + dlt2r_rep = dltgateway_client.GetFromDlt(dlt2r_req) + LOGGER.info('dlt2r_rep = {:s}'.format(grpc_message_to_json_string(dlt2r_rep))) + + dltgateway_collector.stop() + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/dlt/connector/requirements.in b/src/dlt/connector/requirements.in new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/dlt/connector/requirements.in @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/dlt/connector/service/DltConnectorService.py b/src/dlt/connector/service/DltConnectorService.py new file mode 100644 index 0000000000000000000000000000000000000000..b3e82253064e2758200fb3a6b4d34d5ccd71487f --- /dev/null +++ b/src/dlt/connector/service/DltConnectorService.py @@ -0,0 +1,28 @@ +# 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 common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc +from common.tools.service.GenericGrpcService import GenericGrpcService +from common.proto.dlt_connector_pb2_grpc import add_DltConnectorServiceServicer_to_server +from .DltConnectorServiceServicerImpl import DltConnectorServiceServicerImpl + +class DltConnectorService(GenericGrpcService): + def __init__(self, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.DLT) + super().__init__(port, cls_name=cls_name) + self.dltconnector_servicer = DltConnectorServiceServicerImpl() + + def install_servicers(self): + add_DltConnectorServiceServicer_to_server(self.dltconnector_servicer, self.server) diff --git a/src/dlt/connector/service/DltConnectorServiceServicerImpl.py b/src/dlt/connector/service/DltConnectorServiceServicerImpl.py new file mode 100644 index 0000000000000000000000000000000000000000..4e628a2ae1c2d3d12b8a8dc4bcca5ba85faa4308 --- /dev/null +++ b/src/dlt/connector/service/DltConnectorServiceServicerImpl.py @@ -0,0 +1,147 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import grpc, logging +from typing import Optional +from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method +from common.proto.context_pb2 import Empty, TopologyId +from common.proto.dlt_connector_pb2 import DltDeviceId, DltLinkId, DltServiceId, DltSliceId +from common.proto.dlt_connector_pb2_grpc import DltConnectorServiceServicer +from common.proto.dlt_gateway_pb2 import DltRecord, DltRecordId, DltRecordOperationEnum, DltRecordTypeEnum +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from dlt.connector.client.DltGatewayClient import DltGatewayClient +from .tools.Checkers import record_exists + +LOGGER = logging.getLogger(__name__) + +METRICS_POOL = MetricsPool('DltConnector', 'RPC') + +class DltConnectorServiceServicerImpl(DltConnectorServiceServicer): + def __init__(self): + LOGGER.debug('Creating Servicer...') + LOGGER.debug('Servicer Created') + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def RecordAll(self, request : TopologyId, context : grpc.ServicerContext) -> Empty: + return Empty() + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def RecordAllDevices(self, request : TopologyId, context : grpc.ServicerContext) -> Empty: + return Empty() + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def RecordDevice(self, request : DltDeviceId, context : grpc.ServicerContext) -> Empty: + data_json = None + if not request.delete: + context_client = ContextClient() + device = context_client.GetDevice(request.device_id) + data_json = grpc_message_to_json_string(device) + + self._record_entity( + request.topology_id.topology_uuid.uuid, DltRecordTypeEnum.DLTRECORDTYPE_DEVICE, + request.device_id.device_uuid.uuid, request.delete, data_json) + return Empty() + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def RecordAllLinks(self, request : TopologyId, context : grpc.ServicerContext) -> Empty: + return Empty() + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def RecordLink(self, request : DltLinkId, context : grpc.ServicerContext) -> Empty: + data_json = None + if not request.delete: + context_client = ContextClient() + link = context_client.GetLink(request.link_id) + data_json = grpc_message_to_json_string(link) + + self._record_entity( + request.topology_id.topology_uuid.uuid, DltRecordTypeEnum.DLTRECORDTYPE_LINK, + request.link_id.link_uuid.uuid, request.delete, data_json) + return Empty() + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def RecordAllServices(self, request : TopologyId, context : grpc.ServicerContext) -> Empty: + return Empty() + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def RecordService(self, request : DltServiceId, context : grpc.ServicerContext) -> Empty: + data_json = None + if not request.delete: + context_client = ContextClient() + service = context_client.GetService(request.service_id) + data_json = grpc_message_to_json_string(service) + + self._record_entity( + request.topology_id.topology_uuid.uuid, DltRecordTypeEnum.DLTRECORDTYPE_SERVICE, + request.service_id.service_uuid.uuid, request.delete, data_json) + return Empty() + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def RecordAllSlices(self, request : TopologyId, context : grpc.ServicerContext) -> Empty: + return Empty() + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def RecordSlice(self, request : DltSliceId, context : grpc.ServicerContext) -> Empty: + data_json = None + if not request.delete: + context_client = ContextClient() + slice_ = context_client.GetSlice(request.slice_id) + data_json = grpc_message_to_json_string(slice_) + + self._record_entity( + request.topology_id.topology_uuid.uuid, DltRecordTypeEnum.DLTRECORDTYPE_SLICE, + request.slice_id.slice_uuid.uuid, request.delete, data_json) + return Empty() + + def _record_entity( + self, dlt_domain_uuid : str, dlt_record_type : DltRecordTypeEnum, dlt_record_uuid : str, delete : bool, + data_json : Optional[str] = None + ) -> None: + dltgateway_client = DltGatewayClient() + + dlt_record_id = DltRecordId() + dlt_record_id.domain_uuid.uuid = dlt_domain_uuid # pylint: disable=no-member + dlt_record_id.type = dlt_record_type + dlt_record_id.record_uuid.uuid = dlt_record_uuid # pylint: disable=no-member + + str_dlt_record_id = grpc_message_to_json_string(dlt_record_id) + LOGGER.debug('[_record_entity] sent dlt_record_id = {:s}'.format(str_dlt_record_id)) + dlt_record = dltgateway_client.GetFromDlt(dlt_record_id) + str_dlt_record = grpc_message_to_json_string(dlt_record) + LOGGER.debug('[_record_entity] recv dlt_record = {:s}'.format(str_dlt_record)) + + exists = record_exists(dlt_record) + LOGGER.debug('[_record_entity] exists = {:s}'.format(str(exists))) + + dlt_record = DltRecord() + dlt_record.record_id.CopyFrom(dlt_record_id) # pylint: disable=no-member + if delete and exists: + dlt_record.operation = DltRecordOperationEnum.DLTRECORDOPERATION_DELETE + elif not delete and exists: + dlt_record.operation = DltRecordOperationEnum.DLTRECORDOPERATION_UPDATE + if data_json is None: raise Exception('data_json must be provided when updating') + dlt_record.data_json = data_json + elif not delete and not exists: + dlt_record.operation = DltRecordOperationEnum.DLTRECORDOPERATION_ADD + if data_json is None: raise Exception('data_json must be provided when adding') + dlt_record.data_json = data_json + else: + return + + str_dlt_record = grpc_message_to_json_string(dlt_record) + LOGGER.debug('[_record_entity] sent dlt_record = {:s}'.format(str_dlt_record)) + dlt_record_status = dltgateway_client.RecordToDlt(dlt_record) + str_dlt_record_status = grpc_message_to_json_string(dlt_record_status) + LOGGER.debug('[_record_entity] recv dlt_record_status = {:s}'.format(str_dlt_record_status)) diff --git a/src/dlt/connector/service/__init__.py b/src/dlt/connector/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf --- /dev/null +++ b/src/dlt/connector/service/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/src/dlt/connector/service/__main__.py b/src/dlt/connector/service/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..c9812f90a76ebb06e35bde23033758e5740b877a --- /dev/null +++ b/src/dlt/connector/service/__main__.py @@ -0,0 +1,72 @@ +# 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, signal, sys, threading +from prometheus_client import start_http_server +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, + wait_for_environment_variables) +from .event_dispatcher.DltEventDispatcher import DltEventDispatcher +from .DltConnectorService import DltConnectorService + +terminate = threading.Event() +LOGGER : logging.Logger = None + +def signal_handler(signal, frame): # pylint: disable=redefined-outer-name + LOGGER.warning('Terminate signal received') + terminate.set() + +def main(): + global LOGGER # pylint: disable=global-statement + + log_level = get_log_level() + logging.basicConfig(level=log_level, format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s") + LOGGER = logging.getLogger(__name__) + + wait_for_environment_variables([ + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + ]) + + signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGTERM, signal_handler) + + LOGGER.info('Starting...') + + # Start metrics server + metrics_port = get_metrics_port() + start_http_server(metrics_port) + + # Starting DLT event dispatcher + event_dispatcher = DltEventDispatcher() + event_dispatcher.start() + + # Starting DLT connector service + grpc_service = DltConnectorService() + grpc_service.start() + + # Wait for Ctrl+C or termination signal + while not terminate.wait(timeout=0.1): pass + + LOGGER.info('Terminating...') + grpc_service.stop() + event_dispatcher.stop() + event_dispatcher.join() + + LOGGER.info('Bye') + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/dlt/connector/service/event_dispatcher/DltEventDispatcher.py b/src/dlt/connector/service/event_dispatcher/DltEventDispatcher.py new file mode 100644 index 0000000000000000000000000000000000000000..78d375efafc0329048654d34033bb46b00cb3bdf --- /dev/null +++ b/src/dlt/connector/service/event_dispatcher/DltEventDispatcher.py @@ -0,0 +1,209 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import grpc, json, logging, threading +from typing import Any, Dict, Set +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME, INTERDOMAIN_TOPOLOGY_NAME +from common.proto.context_pb2 import ContextId, Device, EventTypeEnum, Link, Slice, TopologyId +from common.proto.dlt_connector_pb2 import DltSliceId +from common.proto.dlt_gateway_pb2 import DltRecordEvent, DltRecordOperationEnum, DltRecordTypeEnum +from common.tools.context_queries.Context import create_context +from common.tools.context_queries.Device import add_device_to_topology +from common.tools.context_queries.Link import add_link_to_topology +from common.tools.context_queries.Topology import create_topology +from common.tools.grpc.Tools import grpc_message_to_json_string +from common.tools.object_factory.Context import json_context_id +from common.tools.object_factory.Topology import json_topology_id +from context.client.ContextClient import ContextClient +from dlt.connector.client.DltConnectorClient import DltConnectorClient +from dlt.connector.client.DltEventsCollector import DltEventsCollector +from dlt.connector.client.DltGatewayClient import DltGatewayClient +from interdomain.client.InterdomainClient import InterdomainClient + +LOGGER = logging.getLogger(__name__) + +GET_EVENT_TIMEOUT = 0.5 + +ADMIN_CONTEXT_ID = ContextId(**json_context_id(DEFAULT_CONTEXT_NAME)) + +class Clients: + def __init__(self) -> None: + self.context_client = ContextClient() + self.dlt_connector_client = DltConnectorClient() + self.dlt_gateway_client = DltGatewayClient() + self.interdomain_client = InterdomainClient() + + def close(self) -> None: + self.interdomain_client.close() + self.dlt_gateway_client.close() + self.dlt_connector_client.close() + self.context_client.close() + +class DltEventDispatcher(threading.Thread): + def __init__(self) -> None: + LOGGER.debug('Creating connector...') + super().__init__(name='DltEventDispatcher', daemon=True) + self._terminate = threading.Event() + LOGGER.debug('Connector created') + + def start(self) -> None: + self._terminate.clear() + return super().start() + + def stop(self): + self._terminate.set() + + def run(self) -> None: + clients = Clients() + create_context(clients.context_client, DEFAULT_CONTEXT_NAME) + create_topology(clients.context_client, DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME) + create_topology(clients.context_client, DEFAULT_CONTEXT_NAME, INTERDOMAIN_TOPOLOGY_NAME) + + dlt_events_collector = DltEventsCollector(clients.dlt_gateway_client, log_events_received=True) + dlt_events_collector.start() + + while not self._terminate.is_set(): + event = dlt_events_collector.get_event(block=True, timeout=GET_EVENT_TIMEOUT) + if event is None: continue + + existing_topology_ids = clients.context_client.ListTopologyIds(ADMIN_CONTEXT_ID) + local_domain_uuids = { + topology_id.topology_uuid.uuid for topology_id in existing_topology_ids.topology_ids + } + local_domain_uuids.discard(DEFAULT_TOPOLOGY_NAME) + local_domain_uuids.discard(INTERDOMAIN_TOPOLOGY_NAME) + + self.dispatch_event(clients, local_domain_uuids, event) + + dlt_events_collector.stop() + clients.close() + + def dispatch_event(self, clients : Clients, local_domain_uuids : Set[str], event : DltRecordEvent) -> None: + record_type : DltRecordTypeEnum = event.record_id.type # {UNDEFINED/CONTEXT/TOPOLOGY/DEVICE/LINK/SERVICE/SLICE} + if record_type == DltRecordTypeEnum.DLTRECORDTYPE_DEVICE: + self._dispatch_device(clients, local_domain_uuids, event) + elif record_type == DltRecordTypeEnum.DLTRECORDTYPE_LINK: + self._dispatch_link(clients, local_domain_uuids, event) + elif record_type == DltRecordTypeEnum.DLTRECORDTYPE_SLICE: + self._dispatch_slice(clients, local_domain_uuids, event) + else: + raise NotImplementedError('EventType: {:s}'.format(grpc_message_to_json_string(event))) + + def _dispatch_device(self, clients : Clients, local_domain_uuids : Set[str], event : DltRecordEvent) -> None: + domain_uuid : str = event.record_id.domain_uuid.uuid + + if domain_uuid in local_domain_uuids: + MSG = '[_dispatch_device] Ignoring DLT event received (local): {:s}' + LOGGER.info(MSG.format(grpc_message_to_json_string(event))) + return + + MSG = '[_dispatch_device] DLT event received (remote): {:s}' + LOGGER.info(MSG.format(grpc_message_to_json_string(event))) + + event_type : EventTypeEnum = event.event.event_type # {UNDEFINED/CREATE/UPDATE/REMOVE} + if event_type in {EventTypeEnum.EVENTTYPE_CREATE, EventTypeEnum.EVENTTYPE_UPDATE}: + LOGGER.info('[_dispatch_device] event.record_id={:s}'.format(grpc_message_to_json_string(event.record_id))) + record = clients.dlt_gateway_client.GetFromDlt(event.record_id) + LOGGER.info('[_dispatch_device] record={:s}'.format(grpc_message_to_json_string(record))) + + create_context(clients.context_client, domain_uuid) + create_topology(clients.context_client, domain_uuid, DEFAULT_TOPOLOGY_NAME) + device = Device(**json.loads(record.data_json)) + clients.context_client.SetDevice(device) + device_uuid = device.device_id.device_uuid.uuid # pylint: disable=no-member + add_device_to_topology(clients.context_client, ADMIN_CONTEXT_ID, INTERDOMAIN_TOPOLOGY_NAME, device_uuid) + domain_context_id = ContextId(**json_context_id(domain_uuid)) + add_device_to_topology(clients.context_client, domain_context_id, DEFAULT_TOPOLOGY_NAME, device_uuid) + elif event_type in {EventTypeEnum.EVENTTYPE_DELETE}: + raise NotImplementedError('Delete Device') + + def _dispatch_link(self, clients : Clients, local_domain_uuids : Set[str], event : DltRecordEvent) -> None: + domain_uuid : str = event.record_id.domain_uuid.uuid + + if domain_uuid in local_domain_uuids: + MSG = '[_dispatch_link] Ignoring DLT event received (local): {:s}' + LOGGER.info(MSG.format(grpc_message_to_json_string(event))) + return + + MSG = '[_dispatch_link] DLT event received (remote): {:s}' + LOGGER.info(MSG.format(grpc_message_to_json_string(event))) + + event_type : EventTypeEnum = event.event.event_type # {UNDEFINED/CREATE/UPDATE/REMOVE} + if event_type in {EventTypeEnum.EVENTTYPE_CREATE, EventTypeEnum.EVENTTYPE_UPDATE}: + LOGGER.info('[_dispatch_link] event.record_id={:s}'.format(grpc_message_to_json_string(event.record_id))) + record = clients.dlt_gateway_client.GetFromDlt(event.record_id) + LOGGER.info('[_dispatch_link] record={:s}'.format(grpc_message_to_json_string(record))) + + link = Link(**json.loads(record.data_json)) + clients.context_client.SetLink(link) + link_uuid = link.link_id.link_uuid.uuid # pylint: disable=no-member + add_link_to_topology(clients.context_client, ADMIN_CONTEXT_ID, INTERDOMAIN_TOPOLOGY_NAME, link_uuid) + elif event_type in {EventTypeEnum.EVENTTYPE_DELETE}: + raise NotImplementedError('Delete Link') + + def _dispatch_slice(self, clients : Clients, local_domain_uuids : Set[str], event : DltRecordEvent) -> None: + event_type : EventTypeEnum = event.event.event_type # {UNDEFINED/CREATE/UPDATE/REMOVE} + domain_uuid : str = event.record_id.domain_uuid.uuid + + LOGGER.info('[_dispatch_slice] event.record_id={:s}'.format(grpc_message_to_json_string(event.record_id))) + record = clients.dlt_gateway_client.GetFromDlt(event.record_id) + LOGGER.info('[_dispatch_slice] record={:s}'.format(grpc_message_to_json_string(record))) + + slice_ = Slice(**json.loads(record.data_json)) + + context_uuid = slice_.slice_id.context_id.context_uuid.uuid + owner_uuid = slice_.slice_owner.owner_uuid.uuid + create_context(clients.context_client, context_uuid) + create_topology(clients.context_client, context_uuid, DEFAULT_TOPOLOGY_NAME) + + if domain_uuid in local_domain_uuids: + # it is for "me" + if event_type in {EventTypeEnum.EVENTTYPE_CREATE, EventTypeEnum.EVENTTYPE_UPDATE}: + try: + db_slice = clients.context_client.GetSlice(slice_.slice_id) + # exists + db_json_slice = grpc_message_to_json_string(db_slice) + except grpc.RpcError: + # not exists + db_json_slice = None + + _json_slice = grpc_message_to_json_string(slice_) + if db_json_slice != _json_slice: + # not exists or is different... + slice_id = clients.interdomain_client.RequestSlice(slice_) + topology_id = TopologyId(**json_topology_id(domain_uuid)) + dlt_slice_id = DltSliceId() + dlt_slice_id.topology_id.CopyFrom(topology_id) # pylint: disable=no-member + dlt_slice_id.slice_id.CopyFrom(slice_id) # pylint: disable=no-member + clients.dlt_connector_client.RecordSlice(dlt_slice_id) + + elif event_type in {EventTypeEnum.EVENTTYPE_DELETE}: + raise NotImplementedError('Delete Slice') + elif owner_uuid in local_domain_uuids: + # it is owned by me + # just update it locally + LOGGER.info('[_dispatch_slice] updating locally') + + local_slice = Slice() + local_slice.CopyFrom(slice_) + + # pylint: disable=no-member + del local_slice.slice_service_ids[:] # they are from remote domains so will not be present locally + del local_slice.slice_subslice_ids[:] # they are from remote domains so will not be present locally + + clients.context_client.SetSlice(local_slice) + else: + MSG = '[_dispatch_slice] Ignoring DLT event received (remote): {:s}' + LOGGER.info(MSG.format(grpc_message_to_json_string(event))) + diff --git a/src/dlt/connector/service/event_dispatcher/__init__.py b/src/dlt/connector/service/event_dispatcher/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf --- /dev/null +++ b/src/dlt/connector/service/event_dispatcher/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/src/dlt/connector/service/tools/Checkers.py b/src/dlt/connector/service/tools/Checkers.py new file mode 100644 index 0000000000000000000000000000000000000000..17a44c2fa2cc2a30216278bb4d84ff6469b099ff --- /dev/null +++ b/src/dlt/connector/service/tools/Checkers.py @@ -0,0 +1,24 @@ +# 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 common.proto.dlt_gateway_pb2 import DLTRECORDOPERATION_UNDEFINED, DLTRECORDTYPE_UNDEFINED, DltRecord + +def record_exists(record : DltRecord) -> bool: + exists = True + exists = exists and (len(record.record_id.domain_uuid.uuid) > 0) + exists = exists and (record.record_id.type != DLTRECORDTYPE_UNDEFINED) + exists = exists and (len(record.record_id.record_uuid.uuid) > 0) + #exists = exists and (record.operation != DLTRECORDOPERATION_UNDEFINED) + exists = exists and (len(record.data_json) > 0) + return exists diff --git a/src/dlt/connector/service/tools/__init__.py b/src/dlt/connector/service/tools/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf --- /dev/null +++ b/src/dlt/connector/service/tools/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/src/dlt/connector/tests/MockService_Dependencies.py b/src/dlt/connector/tests/MockService_Dependencies.py new file mode 100644 index 0000000000000000000000000000000000000000..36e1ca5519a55fdfc864b266ed1f6f225c00af71 --- /dev/null +++ b/src/dlt/connector/tests/MockService_Dependencies.py @@ -0,0 +1,38 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +from typing import Union +from common.Constants import ServiceNameEnum +from common.Settings import ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name +from common.proto.dlt_gateway_pb2_grpc import add_DltGatewayServiceServicer_to_server +from common.tests.MockServicerImpl_DltGateway import MockServicerImpl_DltGateway +from common.tools.service.GenericGrpcService import GenericGrpcService + +LOCAL_HOST = '127.0.0.1' + +SERVICE_DLT = ServiceNameEnum.DLT + +class MockService_Dependencies(GenericGrpcService): + def __init__(self, bind_port: Union[str, int]) -> None: + super().__init__(bind_port, LOCAL_HOST, enable_health_servicer=False, cls_name='MockService') + + # pylint: disable=attribute-defined-outside-init + def install_servicers(self): + self.dltgateway_servicer = MockServicerImpl_DltGateway() + add_DltGatewayServiceServicer_to_server(self.dltgateway_servicer, self.server) + + def configure_env_vars(self): + os.environ[get_env_var_name(SERVICE_DLT, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_DLT, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) diff --git a/src/dlt/connector/tests/Objects.py b/src/dlt/connector/tests/Objects.py new file mode 100644 index 0000000000000000000000000000000000000000..2ff850000a2d20b0556dc6e65a21b7151db849d6 --- /dev/null +++ b/src/dlt/connector/tests/Objects.py @@ -0,0 +1,81 @@ +# 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 common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Device import json_device_emulated_packet_router_disabled, json_device_id +from common.tools.object_factory.EndPoint import json_endpoints +from common.tools.object_factory.Link import compose_link +from common.tools.object_factory.Topology import json_topology, json_topology_id + +def compose_device( + device_uuid, endpoint_uuids, endpoint_type='copper', endpoint_topology_id=None, endpoint_sample_types=[] +): + device_id = json_device_id(device_uuid) + endpoints = [(endpoint_uuid, endpoint_type, endpoint_sample_types) for endpoint_uuid in endpoint_uuids] + endpoints = json_endpoints(device_id, endpoints, topology_id=endpoint_topology_id) + device = json_device_emulated_packet_router_disabled(device_uuid, endpoints=endpoints) + return device_id, endpoints, device + +# ===== Domain A ======================================================================================================= + +# ----- Context -------------------------------------------------------------------------------------------------------- +DA_CONTEXT_ADMIN_ID = json_context_id('A') +DA_CONTEXT_ADMIN = json_context('A') + +# ----- Topology ------------------------------------------------------------------------------------------------------- +DA_TOPOLOGY_ADMIN_ID = json_topology_id('A', context_id=DA_CONTEXT_ADMIN_ID) +DA_TOPOLOGY_ADMIN = json_topology('A', context_id=DA_CONTEXT_ADMIN_ID) + +# ----- Devices -------------------------------------------------------------------------------------------------------- +DA_DEVICE_DEV1_ID, DA_DEVICE_DEV1_ENDPOINTS, DA_DEVICE_DEV1 = compose_device('DEV1@A', ['1', '2']) +DA_DEVICE_DEV2_ID, DA_DEVICE_DEV2_ENDPOINTS, DA_DEVICE_DEV2 = compose_device('DEV2@A', ['1', '2']) +DA_DEVICE_DEV3_ID, DA_DEVICE_DEV3_ENDPOINTS, DA_DEVICE_DEV3 = compose_device('DEV3@A', ['1', '2']) + +# ----- Links ---------------------------------------------------------------------------------------------------------- +DA_LINK_DEV1_DEV2_ID, DA_LINK_DEV1_DEV2 = compose_link(DA_DEVICE_DEV1_ENDPOINTS[0], DA_DEVICE_DEV2_ENDPOINTS[0]) +DA_LINK_DEV1_DEV3_ID, DA_LINK_DEV1_DEV3 = compose_link(DA_DEVICE_DEV1_ENDPOINTS[1], DA_DEVICE_DEV3_ENDPOINTS[0]) +DA_LINK_DEV2_DEV3_ID, DA_LINK_DEV2_DEV3 = compose_link(DA_DEVICE_DEV2_ENDPOINTS[1], DA_DEVICE_DEV3_ENDPOINTS[1]) + +# ----- Containers ----------------------------------------------------------------------------------------------------- +DA_CONTEXTS = [DA_CONTEXT_ADMIN] +DA_TOPOLOGIES = [DA_TOPOLOGY_ADMIN] +DA_DEVICES = [DA_DEVICE_DEV1, DA_DEVICE_DEV2, DA_DEVICE_DEV3] +DA_LINKS = [DA_LINK_DEV1_DEV2, DA_LINK_DEV1_DEV3, DA_LINK_DEV2_DEV3] + + +# ===== Domain B ======================================================================================================= + +# ----- Context -------------------------------------------------------------------------------------------------------- +DB_CONTEXT_ADMIN_ID = json_context_id('B') +DB_CONTEXT_ADMIN = json_context('B') + +# ----- Topology ------------------------------------------------------------------------------------------------------- +DB_TOPOLOGY_ADMIN_ID = json_topology_id('B', context_id=DB_CONTEXT_ADMIN_ID) +DB_TOPOLOGY_ADMIN = json_topology('B', context_id=DB_CONTEXT_ADMIN_ID) + +# ----- Devices -------------------------------------------------------------------------------------------------------- +DB_DEVICE_DEV1_ID, DB_DEVICE_DEV1_ENDPOINTS, DB_DEVICE_DEV1 = compose_device('DEV1@B', ['1', '2']) +DB_DEVICE_DEV2_ID, DB_DEVICE_DEV2_ENDPOINTS, DB_DEVICE_DEV2 = compose_device('DEV2@B', ['1', '2']) +DB_DEVICE_DEV3_ID, DB_DEVICE_DEV3_ENDPOINTS, DB_DEVICE_DEV3 = compose_device('DEV3@B', ['1', '2']) + +# ----- Links ---------------------------------------------------------------------------------------------------------- +DB_LINK_DEV1_DEV2_ID, DB_LINK_DEV1_DEV2 = compose_link(DB_DEVICE_DEV1_ENDPOINTS[0], DB_DEVICE_DEV2_ENDPOINTS[0]) +DB_LINK_DEV1_DEV3_ID, DB_LINK_DEV1_DEV3 = compose_link(DB_DEVICE_DEV1_ENDPOINTS[1], DB_DEVICE_DEV3_ENDPOINTS[0]) +DB_LINK_DEV2_DEV3_ID, DB_LINK_DEV2_DEV3 = compose_link(DB_DEVICE_DEV2_ENDPOINTS[1], DB_DEVICE_DEV3_ENDPOINTS[1]) + +# ----- Containers ----------------------------------------------------------------------------------------------------- +DB_CONTEXTS = [DB_CONTEXT_ADMIN] +DB_TOPOLOGIES = [DB_TOPOLOGY_ADMIN] +DB_DEVICES = [DB_DEVICE_DEV1, DB_DEVICE_DEV2, DB_DEVICE_DEV3] +DB_LINKS = [DB_LINK_DEV1_DEV2, DB_LINK_DEV1_DEV3, DB_LINK_DEV2_DEV3] diff --git a/src/dlt/connector/tests/PrepareTestScenario.py b/src/dlt/connector/tests/PrepareTestScenario.py new file mode 100644 index 0000000000000000000000000000000000000000..755d2f1ff615e23396dd33d02c6f8a3719be6065 --- /dev/null +++ b/src/dlt/connector/tests/PrepareTestScenario.py @@ -0,0 +1,109 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#import os, pytest +#from typing import Tuple +#from common.Constants import ServiceNameEnum +#from common.Settings import ( +# ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_service_port_grpc) +#from common.orm.Database import Database +#from common.orm.Factory import get_database_backend, BackendEnum as DatabaseBackendEnum +#from common.message_broker.Factory import get_messagebroker_backend, BackendEnum as MessageBrokerBackendEnum +#from common.message_broker.MessageBroker import MessageBroker +#from context.client.ContextClient import ContextClient +#from context.service.grpc_server.ContextService import ContextService +#from dlt.connector.client.DltConnectorClient import DltConnectorClient +#from dlt.connector.service.DltConnectorService import DltConnectorService +#from .MockService_Dependencies import MockService_Dependencies +# +#LOCAL_HOST = '127.0.0.1' +#MOCKSERVICE_PORT = 10000 +##GRPC_PORT = 10000 + get_service_port_grpc(ServiceNameEnum.CONTEXT) # avoid privileged ports +##os.environ[get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +##os.environ[get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(GRPC_PORT) +# +## ===== BlockChain Emulator (Mock DLT Gateway) ========================================================================= +## A single gateway is used for all the domains +# +#@pytest.fixture(scope='session') +#def dltgateway_service(): +# _service = MockService_Dependencies(MOCKSERVICE_PORT) +# _service.configure_env_vars() +# _service.start() +# yield _service +# _service.stop() +# +## ===== Domain A (Real Context + Real DLT Connector) =================================================================== +# +#@pytest.fixture(scope='session') +#def context_service_a(): # pylint: disable=redefined-outer-name +# _database = Database(get_database_backend(backend=DatabaseBackendEnum.INMEMORY)) +# _message_broker = MessageBroker(get_messagebroker_backend(backend=MessageBrokerBackendEnum.INMEMORY)) +# _service = ContextService(_database, _message_broker) +# _service.start() +# yield _service +# _service.stop() +# _message_broker.terminate() +# +#@pytest.fixture(scope='session') +#def context_client_a(context_service_a : ContextService): # pylint: disable=redefined-outer-name +# _client = ContextClient(host=context_service_a.bind_address, port=context_service_a.bind_port) +# yield _client +# _client.close() +# +#@pytest.fixture(scope='session') +#def dltconnector_service_a(): +# _service = DltConnectorService() +# _service.bind_port += 1 +# _service.start() +# yield _service +# _service.stop() +# +#@pytest.fixture(scope='session') +#def dltconnector_client_a(dltconnector_service_a : DltConnectorService): # pylint: disable=redefined-outer-name +# _client = DltConnectorClient(host=dltconnector_service_a.bind_address, port=dltconnector_service_a.bind_port) +# yield _client +# _client.close() +# +## ===== Domain B (Real Context + Real DLT Connector) =================================================================== +# +#@pytest.fixture(scope='session') +#def context_service_b(): # pylint: disable=redefined-outer-name +# _database = Database(get_database_backend(backend=DatabaseBackendEnum.INMEMORY)) +# _message_broker = MessageBroker(get_messagebroker_backend(backend=MessageBrokerBackendEnum.INMEMORY)) +# _service = ContextService(_database, _message_broker) +# _service.start() +# yield _service +# _service.stop() +# _message_broker.terminate() +# +#@pytest.fixture(scope='session') +#def context_client_b(context_service_b : ContextService): # pylint: disable=redefined-outer-name +# _client = ContextClient(host=context_service_b.bind_address, port=context_service_b.bind_port) +# yield _client +# _client.close() +# +#@pytest.fixture(scope='session') +#def dltconnector_service_b(): +# _service = DltConnectorService() +# _service.bind_port += 2 +# _service.start() +# yield _service +# _service.stop() +# +#@pytest.fixture(scope='session') +#def dltconnector_client_b(dltconnector_service_b : DltConnectorService): # pylint: disable=redefined-outer-name +# _client = DltConnectorClient(host=dltconnector_service_b.bind_address, port=dltconnector_service_b.bind_port) +# yield _client +# _client.close() diff --git a/src/dlt/connector/tests/__init__.py b/src/dlt/connector/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf --- /dev/null +++ b/src/dlt/connector/tests/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/src/dlt/connector/tests/test_unitary.py b/src/dlt/connector/tests/test_unitary.py new file mode 100644 index 0000000000000000000000000000000000000000..edd96b4ec0d87dd2ddd79d3574ec45973ac1827e --- /dev/null +++ b/src/dlt/connector/tests/test_unitary.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 logging +#from typing import Tuple +#from common.orm.Database import Database +#from common.message_broker.MessageBroker import MessageBroker +#from common.proto.context_pb2 import Context, ContextId, Device, DeviceId, Link, LinkId, Topology, TopologyId +#from context.client.ContextClient import ContextClient +#from .PrepareTestScenario import ( +# # pylint: disable=unused-import +# dltgateway_service, +# context_service_a, context_client_a, dltconnector_service_a, dltconnector_client_a, +# context_service_b, context_client_b, dltconnector_service_b, dltconnector_client_b) +#from .Objects import ( +# DA_CONTEXTS, DA_TOPOLOGIES, DA_DEVICES, DA_LINKS, +# DB_CONTEXTS, DB_TOPOLOGIES, DB_DEVICES, DB_LINKS) +# +#LOGGER = logging.getLogger(__name__) +#LOGGER.setLevel(logging.DEBUG) +# +#def test_create_events( +# context_client : ContextClient, # pylint: disable=redefined-outer-name +# context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name +# +# for context in CONTEXTS : context_client.SetContext (Context (**context )) +# for topology in TOPOLOGIES: context_client.SetTopology(Topology(**topology)) +# for device in DEVICES : context_client.SetDevice (Device (**device )) +# for link in LINKS : context_client.SetLink (Link (**link )) +# +# +# for link in LINKS : context_client.RemoveLink (LinkId (**link ['link_id' ])) +# for device in DEVICES : context_client.RemoveDevice (DeviceId (**device ['device_id' ])) +# for topology in TOPOLOGIES: context_client.RemoveTopology(TopologyId(**topology['topology_id'])) +# for context in CONTEXTS : context_client.RemoveContext (ContextId (**context ['context_id' ])) +# +# +# +# dltgateway_client = DltGatewayClient(host='127.0.0.1', port=50051) +# dltgateway_collector = DltEventsCollector(dltgateway_client, log_events_received=True) +# dltgateway_collector.start() +# +# dltgateway_collector.stop() +# \ No newline at end of file diff --git a/src/dlt/.gitignore b/src/dlt/gateway/.gitignore similarity index 99% rename from src/dlt/.gitignore rename to src/dlt/gateway/.gitignore index 1de6c650e4e3891fba0a81d585634f635e03a5c4..9ecdb254cd217f06171ac30934a34f898a7d77dc 100644 --- a/src/dlt/.gitignore +++ b/src/dlt/gateway/.gitignore @@ -87,4 +87,4 @@ gradle-app.setting .gradletasknamecache local.properties -wallet/ \ No newline at end of file +wallet*/ \ No newline at end of file diff --git a/src/dlt/gateway/Dockerfile b/src/dlt/gateway/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..92ef8e425f40eaf718c4562c836517128dbb2d6f --- /dev/null +++ b/src/dlt/gateway/Dockerfile @@ -0,0 +1,41 @@ +# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# +# 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 zenika/kotlin:1.4-jdk12 + +# Make working directory move to it and copy DLT Gateway code +RUN mkdir -p /var/teraflow/dlt/gateway +WORKDIR /var/teraflow/dlt/gateway +COPY src/dlt/gateway/. ./ + +# Make directory for proto files and copy them +RUN mkdir proto +COPY proto/*.proto ./proto/ + +# Build DLT Gateway +RUN ./gradlew build + +EXPOSE 50051 + +# Create entrypoint.sh script +RUN echo "#!/bin/sh" > /entrypoint.sh +RUN echo "echo 195.37.154.24 peer0.org1.example.com >> /etc/hosts" >> /entrypoint.sh +RUN echo "echo 195.37.154.24 peer0.org2.example.com >> /etc/hosts" >> /entrypoint.sh +RUN echo "echo 195.37.154.24 orderer0.example.com >> /etc/hosts" >> /entrypoint.sh +RUN echo "cd /var/teraflow/dlt/gateway" >> /entrypoint.sh +RUN echo "./gradlew runServer" >> /entrypoint.sh +RUN chmod +x /entrypoint.sh + +# Gateway entry point +ENTRYPOINT ["sh", "/entrypoint.sh"] diff --git a/src/dlt/gateway/README.md b/src/dlt/gateway/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2cf6cfeb1682ade5a77f53fe13c96daed6dc33fd --- /dev/null +++ b/src/dlt/gateway/README.md @@ -0,0 +1,134 @@ +``` + NEC Laboratories Europe GmbH + + PROPRIETARY INFORMATION + + The software and its source code contain valuable trade secrets and + shall be maintained in confidence and treated as confidential + information. The software may only be used for evaluation and/or + testing purposes, unless otherwise explicitly stated in a written + agreement with NEC Laboratories Europe GmbH. + + Any unauthorized publication, transfer to third parties or + duplication of the object or source code - either totally or in + part - is strictly prohibited. + + Copyright (c) 2022 NEC Laboratories Europe GmbH + All Rights Reserved. + + Authors: Konstantin Munichev + + + NEC Laboratories Europe GmbH DISCLAIMS ALL WARRANTIES, EITHER + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND THE + WARRANTY AGAINST LATENT DEFECTS, WITH RESPECT TO THE PROGRAM AND + THE ACCOMPANYING DOCUMENTATION. + + NO LIABILITIES FOR CONSEQUENTIAL DAMAGES: IN NO EVENT SHALL NEC + Laboratories Europe GmbH or ANY OF ITS SUBSIDIARIES BE LIABLE FOR + ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR + LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF + INFORMATION, OR OTHER PECUNIARY LOSS AND INDIRECT, CONSEQUENTIAL, + INCIDENTAL, ECONOMIC OR PUNITIVE DAMAGES) ARISING OUT OF THE USE OF + OR INABILITY TO USE THIS PROGRAM, EVEN IF NEC Laboratories Europe + GmbH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY. + ``` + +# DLT module guide + +## General information +The DLT module is used to provide access to the underlying Fabric deployment. It allows clients +to add, retrieve, modify and delete blockchain-backed data, essentially working as a key-value +database. External clients should use gRPC API to communicate with this service, its detailed +description available below. + +## Code structure +The whole DLT module consists of several packages: +- fabric package +- http package +- proto package +- client example + +### Fabric package +The most important class in this package is `FabricConnector`. First, it establishes connection +with the underlying Fabric network using Java Gateway SDK. After that, it could be used as a +CRUD interface. +Other files contain auxiliary code for `FabricConnector` which allows it to register/enroll +users and to obtain smart contract instances. + +### Grpc package +Contains server side gRPC handler. It accepts requests from the outside and performs the +requested operation. For the more detailed description see Proto package description right below. + +### Proto package +The proto package contains `dlt.proto` file which defines gRPC service `DltService` API and messages +it uses. There are 3 main functions: `RecordToDlt` which allows to create/modify/delete data, +`GetFromDlt` which returns already written data and `SubscribeToDlt` which allows clients subscribe +for future create/modify/delete events with provided filters. +Other proto files don't play any significant role and could be safely ignored by end users. + +### Client example +This code is not necessary to the service, but it could be used to test the service. It contains +a sample gRPC client which connects the service and perform all the CRUD operations. + +# Fabric deployment notes + +## General notes +Current Fabric deployment uses Fabric test network with some additional helping scripts on top of it. +To start the network just run the `raft.sh` from `blockchain/scripts` directory. Use `stop.sh` +when you need to stop the network. + +## Server start preparations +To run the server it's necessary to copy certificate file +`fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/ca/ca.org1.example.com-cert.pem` +to the config folder (replacing the existing one). Also, it's necessary to copy `scripts/connection-org1.json` +file (again, replacing the old one). After copying, it must be edited. First, all `localhost` entrances +should be replaced with `teraflow.nlehd.de`. Second, `channel` section at the end of the file should be removed. +This should be done after every restart of the Fabric network. + +## Fabric configuration +Even though a test network is easy to deploy and use it's better to perform a custom configuration +for a production deployment. In practice every participating organization will likely prefer to have +its own Peer/Orderer/CA instances to prevent possible dependency on any other participants. This leads +not only to a better privacy/availability/security in general but also to the more complicated +deployment process as a side effect. Here we provide a very brief description of the most important points. + +### Organizations +Organization represents a network participant, which can be an individual, a large corporation or any other +entity. Each organization has its own CAs, orderers and peers. The recommendation here is to create an +organization entity for every independent participant and then decide how many CAs/peers/orderers does +every organization need and which channels should it has access to based on the exact project's goals. + +### Channels +Each channel represents an independent ledger with its own genesis block. Each transaction is executed +on a specific channel, and it's possible to define which organization has access to a given channel. +As a result channels are a pretty powerful privacy mechanism which allows to limit access to the private +data between organization. + +### Certificate authorities, peers and orderers +Certificate authorities (CA) are used to generate crypto materials for each organization. Two types of CA +exist: one is used to generate the certificates of the admin, the MSP and certificates of non-admin users. +Another type of CA is used to generate TLS certificates. As a result it's preferable to have at least two +CAs for every organization. + +Peers are entities which host ledgers and smart contracts. They communicate with applications and orderers, +receiving chaincode invocations (proposals), invoking chaincode, updating ledger when necessary and +returning result of execution. Peers can handle one or many ledgers, depending on the configuration. It's +very use case specific how many peers are necessary to the exact deployment. + +Orderers are used to execute a consensus in a distributing network making sure that every channel participant +has the same blocks with the same data. The default consensus algorithm is Raft which provides only a crash +fault tolerance. + +### Conclusion +As you can see, configuration procedure for Fabric is pretty tricky and includes quite a lot of entities. +In real world it will very likely involve participants from multiple organizations each of them performing +its own part of configuration. + +As a further reading it's recommended to start with the +[official deployment guide](https://hyperledger-fabric.readthedocs.io/en/release-2.2/deployment_guide_overview.html). +It contains a high level overview of a deployment process as well as links to the detailed descriptions to +CA/Peer/Orderer configuration descriptions. \ No newline at end of file diff --git a/src/dlt/build.gradle.kts b/src/dlt/gateway/build.gradle.kts similarity index 63% rename from src/dlt/build.gradle.kts rename to src/dlt/gateway/build.gradle.kts index 8eb0d53fa99ec972edd6ee03aafeb0d676f3d3c0..b65aff89e18077ffaff37ea732293f585ca7920d 100644 --- a/src/dlt/build.gradle.kts +++ b/src/dlt/gateway/build.gradle.kts @@ -39,16 +39,19 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import com.google.protobuf.gradle.generateProtoTasks import com.google.protobuf.gradle.id +import com.google.protobuf.gradle.plugins import com.google.protobuf.gradle.protobuf import com.google.protobuf.gradle.protoc -ext["protobufVersion"] = "3.19.1" +ext["grpcVersion"] = "1.47.0" +ext["grpcKotlinVersion"] = "1.3.0" // CURRENT_GRPC_KOTLIN_VERSION +ext["protobufVersion"] = "3.20.1" ext["ktorVersion"] = "1.6.5" plugins { - kotlin("jvm") version "1.5.31" + kotlin("jvm") version "1.6.21" kotlin("plugin.serialization") version "1.4.21" - id("com.google.protobuf") version "0.8.17" + id("com.google.protobuf") version "0.8.18" application } @@ -56,22 +59,24 @@ group = "eu.neclab" version = "1.0-SNAPSHOT" repositories { + mavenLocal() + google() mavenCentral() } dependencies { - testImplementation("org.jetbrains.kotlin:kotlin-test:1.5.31") - implementation("org.hyperledger.fabric:fabric-gateway-java:2.2.2") - api("com.google.protobuf:protobuf-kotlin:${rootProject.ext["protobufVersion"]}") - implementation("io.ktor:ktor-server-core:${rootProject.ext["ktorVersion"]}") - implementation("io.ktor:ktor-server-netty:${rootProject.ext["ktorVersion"]}") - implementation("io.ktor:ktor-serialization:${rootProject.ext["ktorVersion"]}") - implementation("io.ktor:ktor-client-serialization:${rootProject.ext["ktorVersion"]}") - implementation("io.ktor:ktor-client-core:${rootProject.ext["ktorVersion"]}") - implementation("io.ktor:ktor-client-cio:${rootProject.ext["ktorVersion"]}") - implementation("ch.qos.logback:logback-classic:1.2.5") + implementation(kotlin("stdlib-jdk8")) + testImplementation("org.jetbrains.kotlin:kotlin-test:1.6.21") + implementation("javax.annotation:javax.annotation-api:1.3.2") + implementation("io.grpc:grpc-kotlin-stub:1.3.0") + implementation("io.grpc:grpc-protobuf:1.47.0") + implementation("com.google.protobuf:protobuf-kotlin:3.21.1") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.3") + implementation("org.hyperledger.fabric:fabric-gateway-java:2.2.5") + implementation("ch.qos.logback:logback-classic:1.2.11") implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.1") implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:1.3.1") + runtimeOnly("io.grpc:grpc-netty:${rootProject.ext["grpcVersion"]}") } tasks.test { @@ -93,23 +98,50 @@ application { mainClass.set("MainKt") } +task("runServer", JavaExec::class) { + main = "grpc.FabricServerKt" + classpath = sourceSets["main"].runtimeClasspath +} + + sourceSets { main { proto { + srcDir("proto") srcDir("src/main/kotlin/proto") } } } +sourceSets { + val main by getting { } + main.java.srcDirs("build/generated/source/proto/main/grpc") + main.java.srcDirs("build/generated/source/proto/main/grpckt") + main.java.srcDirs("build/generated/source/proto/main/java") + main.java.srcDirs("build/generated/source/proto/main/kotlin") +} + protobuf { protoc { artifact = "com.google.protobuf:protoc:${rootProject.ext["protobufVersion"]}" } + plugins { + id("grpc") { + artifact = "io.grpc:protoc-gen-grpc-java:${rootProject.ext["grpcVersion"]}" + } + id("grpckt") { + artifact = "io.grpc:protoc-gen-grpc-kotlin:${rootProject.ext["grpcKotlinVersion"]}:jdk8@jar" + } + } generateProtoTasks { all().forEach { + it.plugins { + id("grpc") + id("grpckt") + } it.builtins { id("kotlin") } } } -} \ No newline at end of file +} diff --git a/src/dlt/gateway/config/ca.org1.example.com-cert.pem b/src/dlt/gateway/config/ca.org1.example.com-cert.pem new file mode 100644 index 0000000000000000000000000000000000000000..d7fdf63cc3f745d13edc8394bca67a1b41011ed2 --- /dev/null +++ b/src/dlt/gateway/config/ca.org1.example.com-cert.pem @@ -0,0 +1,14 @@ +-----BEGIN CERTIFICATE----- +MIICJzCCAc2gAwIBAgIUb5gDMfVeVdQjFkK3uC8LtlogN+gwCgYIKoZIzj0EAwIw +cDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMQ8wDQYDVQQH +EwZEdXJoYW0xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh +Lm9yZzEuZXhhbXBsZS5jb20wHhcNMjIwOTI3MDgzMDAwWhcNMzcwOTIzMDgzMDAw +WjBwMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xpbmExDzANBgNV +BAcTBkR1cmhhbTEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMT +Y2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABDC3 +spCTT3pjfFXxkX/SFuBgWRiceR8rSoCNQOnIPeNGZK8xl2Zr7VuY06gqy9c+ecSU +PUWaXiCQxiLgZuS6TOWjRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAG +AQH/AgEBMB0GA1UdDgQWBBRFWSc7GZqcJJyJjXSEspzgAYInGzAKBggqhkjOPQQD +AgNIADBFAiEAodqc+adkiMuU6iv1IF8uJ/nMQbvMGoP3pb2827QzDosCICOw6W+y +uH03H3RO6KhOcS1ZzPjspyjrcC+dwzYX4DpW +-----END CERTIFICATE----- diff --git a/src/dlt/config/connection-org1.json b/src/dlt/gateway/config/connection-org1.json similarity index 53% rename from src/dlt/config/connection-org1.json rename to src/dlt/gateway/config/connection-org1.json index c28ac57118e8695375187eaf103f1f499f2cf301..6f6f3f08d65c495bb57551f6d0bfac38c9a2f8cc 100644 --- a/src/dlt/config/connection-org1.json +++ b/src/dlt/gateway/config/connection-org1.json @@ -24,9 +24,9 @@ }, "peers": { "peer0.org1.example.com": { - "url": "grpcs://s2:7051", + "url": "grpcs://teraflow.nlehd.de:7051", "tlsCACerts": { - "pem": "-----BEGIN CERTIFICATE-----\nMIICJjCCAc2gAwIBAgIULDVQiqifWHypuW50LhHXSJeeFG0wCgYIKoZIzj0EAwIw\ncDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMQ8wDQYDVQQH\nEwZEdXJoYW0xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh\nLm9yZzEuZXhhbXBsZS5jb20wHhcNMjExMTIzMTIzNzAwWhcNMzYxMTE5MTIzNzAw\nWjBwMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xpbmExDzANBgNV\nBAcTBkR1cmhhbTEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMT\nY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABFNi\nggnkzv5qQSkIAQ05Y9DUq4teNjbMTdqD0IwdQe+lcYI0wgkR9wpBn5fj2pN093+P\nl2crhgyNqZyAuqaylvCjRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAG\nAQH/AgEBMB0GA1UdDgQWBBS44tGlbJ5GIBwATL383Hw0vz8jHDAKBggqhkjOPQQD\nAgNHADBEAiAlkKikh7eG8lf0uI7NwBi0QrbnnY4vHf9ErceKwUhZWgIgS9Z9AzBc\nn9RAK3v/freT3Exs7b+MK13UeDdejRWS+RE=\n-----END CERTIFICATE-----\n" + "pem": "-----BEGIN CERTIFICATE-----\nMIICJzCCAc2gAwIBAgIUb5gDMfVeVdQjFkK3uC8LtlogN+gwCgYIKoZIzj0EAwIw\ncDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMQ8wDQYDVQQH\nEwZEdXJoYW0xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh\nLm9yZzEuZXhhbXBsZS5jb20wHhcNMjIwOTI3MDgzMDAwWhcNMzcwOTIzMDgzMDAw\nWjBwMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xpbmExDzANBgNV\nBAcTBkR1cmhhbTEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMT\nY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABDC3\nspCTT3pjfFXxkX/SFuBgWRiceR8rSoCNQOnIPeNGZK8xl2Zr7VuY06gqy9c+ecSU\nPUWaXiCQxiLgZuS6TOWjRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAG\nAQH/AgEBMB0GA1UdDgQWBBRFWSc7GZqcJJyJjXSEspzgAYInGzAKBggqhkjOPQQD\nAgNIADBFAiEAodqc+adkiMuU6iv1IF8uJ/nMQbvMGoP3pb2827QzDosCICOw6W+y\nuH03H3RO6KhOcS1ZzPjspyjrcC+dwzYX4DpW\n-----END CERTIFICATE-----\n" }, "grpcOptions": { "ssl-target-name-override": "peer0.org1.example.com", @@ -34,9 +34,9 @@ } }, "peer0.org2.example.com": { - "url": "grpcs://s2:9051", + "url": "grpcs://teraflow.nlehd.de:9051", "tlsCACerts": { - "pem": "-----BEGIN CERTIFICATE-----\nMIICHzCCAcWgAwIBAgIUJiJ5815YVes2sG95oFzj0QWWBKswCgYIKoZIzj0EAwIw\nbDELMAkGA1UEBhMCVUsxEjAQBgNVBAgTCUhhbXBzaGlyZTEQMA4GA1UEBxMHSHVy\nc2xleTEZMBcGA1UEChMQb3JnMi5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eub3Jn\nMi5leGFtcGxlLmNvbTAeFw0yMTExMjMxMjM3MDBaFw0zNjExMTkxMjM3MDBaMGwx\nCzAJBgNVBAYTAlVLMRIwEAYDVQQIEwlIYW1wc2hpcmUxEDAOBgNVBAcTB0h1cnNs\nZXkxGTAXBgNVBAoTEG9yZzIuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2NhLm9yZzIu\nZXhhbXBsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATdQw+PQyT3Ql5M\nv/xvafYFhU5Jtl0CwYyrXTtRajpPnlPnNvXUqVMxmdSR+4m2WBYyBdZ8IhGaayb/\nrOro8Mpko0UwQzAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBATAd\nBgNVHQ4EFgQUrsPP1HIS6O+JeWL2ct/ujkfP7dEwCgYIKoZIzj0EAwIDSAAwRQIh\nAMynA2Q/cbMXEHihnQdpdEz/83jGAokp7dKMHst02b3gAiA0XReJWdc0AUXZtbSq\nZG8mXOJeZu0Zro9DuQUEDPBfDQ==\n-----END CERTIFICATE-----\n" + "pem": "-----BEGIN CERTIFICATE-----\nMIICHjCCAcWgAwIBAgIUL48scgv9ItATkBjSNhzYDjLUDsAwCgYIKoZIzj0EAwIw\nbDELMAkGA1UEBhMCVUsxEjAQBgNVBAgTCUhhbXBzaGlyZTEQMA4GA1UEBxMHSHVy\nc2xleTEZMBcGA1UEChMQb3JnMi5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eub3Jn\nMi5leGFtcGxlLmNvbTAeFw0yMjA5MjcwODMwMDBaFw0zNzA5MjMwODMwMDBaMGwx\nCzAJBgNVBAYTAlVLMRIwEAYDVQQIEwlIYW1wc2hpcmUxEDAOBgNVBAcTB0h1cnNs\nZXkxGTAXBgNVBAoTEG9yZzIuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2NhLm9yZzIu\nZXhhbXBsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQ5qz8FfrEQ5S08\nr/avPyTrF2grXj5L4DnbvF4YEZ5Usnbm8Svovu7PO8uiVcwT5vrt6ssOdpBFZYu3\nNndpojnYo0UwQzAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBATAd\nBgNVHQ4EFgQUYcp7axYV9AaIptYQqhiCL0VDmXQwCgYIKoZIzj0EAwIDRwAwRAIg\nWT1V8/6flUPNcBkmbtEEKf83k7+6sR9k1a2wtVeJFnQCIE0ZSIL3k0dKQydQBpiz\nPcZZUULvQivcMlIsw5+mjIGc\n-----END CERTIFICATE-----\n" }, "grpcOptions": { "ssl-target-name-override": "peer0.org2.example.com", @@ -46,11 +46,11 @@ }, "certificateAuthorities": { "ca.org1.example.com": { - "url": "https://s2:7054", + "url": "https://teraflow.nlehd.de:7054", "caName": "ca-org1", "tlsCACerts": { "pem": [ - "-----BEGIN CERTIFICATE-----\nMIICJjCCAc2gAwIBAgIULDVQiqifWHypuW50LhHXSJeeFG0wCgYIKoZIzj0EAwIw\ncDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMQ8wDQYDVQQH\nEwZEdXJoYW0xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh\nLm9yZzEuZXhhbXBsZS5jb20wHhcNMjExMTIzMTIzNzAwWhcNMzYxMTE5MTIzNzAw\nWjBwMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xpbmExDzANBgNV\nBAcTBkR1cmhhbTEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMT\nY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABFNi\nggnkzv5qQSkIAQ05Y9DUq4teNjbMTdqD0IwdQe+lcYI0wgkR9wpBn5fj2pN093+P\nl2crhgyNqZyAuqaylvCjRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAG\nAQH/AgEBMB0GA1UdDgQWBBS44tGlbJ5GIBwATL383Hw0vz8jHDAKBggqhkjOPQQD\nAgNHADBEAiAlkKikh7eG8lf0uI7NwBi0QrbnnY4vHf9ErceKwUhZWgIgS9Z9AzBc\nn9RAK3v/freT3Exs7b+MK13UeDdejRWS+RE=\n-----END CERTIFICATE-----\n" + "-----BEGIN CERTIFICATE-----\nMIICJzCCAc2gAwIBAgIUb5gDMfVeVdQjFkK3uC8LtlogN+gwCgYIKoZIzj0EAwIw\ncDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMQ8wDQYDVQQH\nEwZEdXJoYW0xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh\nLm9yZzEuZXhhbXBsZS5jb20wHhcNMjIwOTI3MDgzMDAwWhcNMzcwOTIzMDgzMDAw\nWjBwMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xpbmExDzANBgNV\nBAcTBkR1cmhhbTEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMT\nY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABDC3\nspCTT3pjfFXxkX/SFuBgWRiceR8rSoCNQOnIPeNGZK8xl2Zr7VuY06gqy9c+ecSU\nPUWaXiCQxiLgZuS6TOWjRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAG\nAQH/AgEBMB0GA1UdDgQWBBRFWSc7GZqcJJyJjXSEspzgAYInGzAKBggqhkjOPQQD\nAgNIADBFAiEAodqc+adkiMuU6iv1IF8uJ/nMQbvMGoP3pb2827QzDosCICOw6W+y\nuH03H3RO6KhOcS1ZzPjspyjrcC+dwzYX4DpW\n-----END CERTIFICATE-----\n" ] }, "httpOptions": { @@ -60,9 +60,9 @@ }, "orderers": { "orderer0.example.com": { - "url": "grpcs://s2:7050", + "url": "grpcs://teraflow.nlehd.de:7050", "tlsCACerts": { - "pem": "-----BEGIN CERTIFICATE-----\nMIICCzCCAbGgAwIBAgIUDr4RiMRC/q95iWAfWiZTLTdDoDUwCgYIKoZIzj0EAwIw\nYjELMAkGA1UEBhMCVVMxETAPBgNVBAgTCE5ldyBZb3JrMREwDwYDVQQHEwhOZXcg\nWW9yazEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1wbGUu\nY29tMB4XDTIxMTEyMzEyMzcwMFoXDTM2MTExOTEyMzcwMFowYjELMAkGA1UEBhMC\nVVMxETAPBgNVBAgTCE5ldyBZb3JrMREwDwYDVQQHEwhOZXcgWW9yazEUMBIGA1UE\nChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1wbGUuY29tMFkwEwYHKoZI\nzj0CAQYIKoZIzj0DAQcDQgAE4ErISW/k5iZv0n7n1qpbOZcRMNmn8VqAOX4UIELm\nQ51neULt9T3pxdGEsq7B5O1ncB/RdZwf+3dihBHjngXerKNFMEMwDgYDVR0PAQH/\nBAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQEwHQYDVR0OBBYEFP2/1CHK9OdPjs/9\np1mh3t+pyujsMAoGCCqGSM49BAMCA0gAMEUCIQDETOC8hB9EaEvdc2sdEtcNeyXu\nYryyf6I5tJC13E2hOQIgef+ymHy6eXf0jNkY6DXz041THa/67dSrXaZGgaTh4LI=\n-----END CERTIFICATE-----\n" + "pem": "-----BEGIN CERTIFICATE-----\nMIICCzCCAbGgAwIBAgIUdZQo3q4OqyxIkidmAV4QkewCylIwCgYIKoZIzj0EAwIw\nYjELMAkGA1UEBhMCVVMxETAPBgNVBAgTCE5ldyBZb3JrMREwDwYDVQQHEwhOZXcg\nWW9yazEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1wbGUu\nY29tMB4XDTIyMDkyNzA4MzAwMFoXDTM3MDkyMzA4MzAwMFowYjELMAkGA1UEBhMC\nVVMxETAPBgNVBAgTCE5ldyBZb3JrMREwDwYDVQQHEwhOZXcgWW9yazEUMBIGA1UE\nChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1wbGUuY29tMFkwEwYHKoZI\nzj0CAQYIKoZIzj0DAQcDQgAERR0UzsHSFoyON+9Noxmk1IhnTvSdLWGgEpEwrqVr\n5DwitkeJwRWq134JBTmXuZzsUG87oN6Hr94XAEe4j9Zq8qNFMEMwDgYDVR0PAQH/\nBAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQEwHQYDVR0OBBYEFN8XsELp/X0akrlJ\nY3/BWo2jZS3cMAoGCCqGSM49BAMCA0gAMEUCIQCZYYXW/0h3Kq4BmROpOHfrondg\nopf5LndeujYlH3i8tQIgCtpTQiDXZd+IAUduRmn7a46CwJSbjYbXFVX5vumIbE4=\n-----END CERTIFICATE-----\n" }, "grpcOptions": { "ssl-target-name-override": "orderer0.example.com", diff --git a/src/dlt/gradle.properties b/src/dlt/gateway/gradle.properties similarity index 100% rename from src/dlt/gradle.properties rename to src/dlt/gateway/gradle.properties diff --git a/src/dlt/gradle/wrapper/gradle-wrapper.jar b/src/dlt/gateway/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from src/dlt/gradle/wrapper/gradle-wrapper.jar rename to src/dlt/gateway/gradle/wrapper/gradle-wrapper.jar diff --git a/src/dlt/gradle/wrapper/gradle-wrapper.properties b/src/dlt/gateway/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from src/dlt/gradle/wrapper/gradle-wrapper.properties rename to src/dlt/gateway/gradle/wrapper/gradle-wrapper.properties diff --git a/src/dlt/gradlew b/src/dlt/gateway/gradlew similarity index 100% rename from src/dlt/gradlew rename to src/dlt/gateway/gradlew diff --git a/src/dlt/gradlew.bat b/src/dlt/gateway/gradlew.bat similarity index 100% rename from src/dlt/gradlew.bat rename to src/dlt/gateway/gradlew.bat diff --git a/src/automation/src/main/java/eu/teraflow/automation/device/model/ConfigActionEnum.java b/src/dlt/gateway/settings.gradle.kts similarity index 78% rename from src/automation/src/main/java/eu/teraflow/automation/device/model/ConfigActionEnum.java rename to src/dlt/gateway/settings.gradle.kts index 103703c22a522035710c4aa214074229d7edb56c..9c09bb933a23509312b8dfac226caed41f55b053 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/device/model/ConfigActionEnum.java +++ b/src/dlt/gateway/settings.gradle.kts @@ -5,7 +5,7 @@ * 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 + * 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, @@ -14,10 +14,6 @@ * limitations under the License. */ -package eu.teraflow.automation.device.model; -public enum ConfigActionEnum { - UNDEFINED, - SET, - DELETE -} +rootProject.name = "gateway" + diff --git a/src/dlt/gateway/src/main/kotlin/Main.kt b/src/dlt/gateway/src/main/kotlin/Main.kt new file mode 100644 index 0000000000000000000000000000000000000000..c57c9e980853e84d3c10551588dc8d94c14ad40e --- /dev/null +++ b/src/dlt/gateway/src/main/kotlin/Main.kt @@ -0,0 +1,161 @@ +// NEC Laboratories Europe GmbH +// +// PROPRIETARY INFORMATION +// +// The software and its source code contain valuable trade secrets and +// shall be maintained in confidence and treated as confidential +// information. The software may only be used for evaluation and/or +// testing purposes, unless otherwise explicitly stated in a written +// agreement with NEC Laboratories Europe GmbH. +// +// Any unauthorized publication, transfer to third parties or +// duplication of the object or source code - either totally or in +// part - is strictly prohibited. +// +// Copyright (c) 2022 NEC Laboratories Europe GmbH +// All Rights Reserved. +// +// Authors: Konstantin Munichev +// +// +// NEC Laboratories Europe GmbH DISCLAIMS ALL WARRANTIES, EITHER +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND THE +// WARRANTY AGAINST LATENT DEFECTS, WITH RESPECT TO THE PROGRAM AND +// THE ACCOMPANYING DOCUMENTATION. +// +// NO LIABILITIES FOR CONSEQUENTIAL DAMAGES: IN NO EVENT SHALL NEC +// Laboratories Europe GmbH or ANY OF ITS SUBSIDIARIES BE LIABLE FOR +// ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR +// LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF +// INFORMATION, OR OTHER PECUNIARY LOSS AND INDIRECT, CONSEQUENTIAL, +// INCIDENTAL, ECONOMIC OR PUNITIVE DAMAGES) ARISING OUT OF THE USE OF +// OR INABILITY TO USE THIS PROGRAM, EVEN IF NEC Laboratories Europe +// GmbH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +// +// THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY. + +import context.ContextOuterClass +import io.grpc.ManagedChannel +import io.grpc.ManagedChannelBuilder +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch +import kotlinx.coroutines.runBlocking +import dlt.DltGateway +import dlt.DltGatewayServiceGrpcKt +import java.io.Closeable +import java.util.* +import java.util.concurrent.TimeUnit + +class DltServiceClient(private val channel: ManagedChannel) : Closeable { + private val stub: DltGatewayServiceGrpcKt.DltGatewayServiceCoroutineStub = + DltGatewayServiceGrpcKt.DltGatewayServiceCoroutineStub(channel) + + suspend fun putData(data: DltGateway.DltRecord) { + println("Sending record ${data.recordId}...") + val response = stub.recordToDlt(data) + println("Response: ${response.recordId}") + } + + suspend fun getData(id: DltGateway.DltRecordId) { + println("Requesting record $id...") + val response = stub.getFromDlt(id) + println("Got data: $response") + } + + fun subscribe(filter: DltGateway.DltRecordSubscription) { + val subscription = stub.subscribeToDlt(filter) + GlobalScope.launch { + subscription.collect { + println("Got subscription event") + println(it) + } + } + } + + override fun close() { + channel.shutdown().awaitTermination(5, TimeUnit.SECONDS) + } +} + + +fun main() = runBlocking { + val port = 50051 + val channel = ManagedChannelBuilder.forAddress("localhost", port).usePlaintext().build() + + val client = DltServiceClient(channel) + + val domainUuid = UUID.randomUUID().toString() + val recordUuid = UUID.randomUUID().toString() + println("New domain uuid $domainUuid") + println("New record uuid $recordUuid") + + val id = DltGateway.DltRecordId.newBuilder() + .setDomainUuid( + ContextOuterClass.Uuid.newBuilder() + .setUuid(domainUuid) + ) + .setRecordUuid( + ContextOuterClass.Uuid.newBuilder() + .setUuid(recordUuid) + ) + .setType(DltGateway.DltRecordTypeEnum.DLTRECORDTYPE_SERVICE) + .build() + + val subscription = DltGateway.DltRecordSubscription.newBuilder() + .addType(DltGateway.DltRecordTypeEnum.DLTRECORDTYPE_CONTEXT) + .addType(DltGateway.DltRecordTypeEnum.DLTRECORDTYPE_LINK) + .addType(DltGateway.DltRecordTypeEnum.DLTRECORDTYPE_SERVICE) + .addOperation(DltGateway.DltRecordOperationEnum.DLTRECORDOPERATION_ADD) + .addOperation(DltGateway.DltRecordOperationEnum.DLTRECORDOPERATION_UPDATE) + .addOperation(DltGateway.DltRecordOperationEnum.DLTRECORDOPERATION_DELETE) + .build() + + client.subscribe(subscription) + + Thread.sleep(5000) + + val data = DltGateway.DltRecord.newBuilder() + .setRecordId(id) + .setOperation(DltGateway.DltRecordOperationEnum.DLTRECORDOPERATION_ADD) + .setDataJson("\"{\"device_config\": {\"config_rules\": []}, \"device_drivers\": []," + + "\"device_endpoints\": [], \"device_id\": {\"device_uuid\": {\"uuid\": \"dev-12345\"}}," + + "\"device_operational_status\": \"DEVICEOPERATIONALSTATUS_ENABLED\"," + + "\"device_type\": \"packet-router\"}\", \"operation\": \"DLTRECORDOPERATION_ADD\"," + + "\"record_id\": {\"domain_uuid\": {\"uuid\": \"tfs-a\"}, \"record_uuid\": {\"uuid\": \"dev-12345\"}," + + "\"type\": \"DLTRECORDTYPE_DEVICE\"}") + .build() + + println("sending new record") + client.putData(data) + client.getData(id) + + Thread.sleep(5000) + + val updateData = DltGateway.DltRecord.newBuilder() + .setRecordId(id) + .setOperation(DltGateway.DltRecordOperationEnum.DLTRECORDOPERATION_UPDATE) + .setDataJson("{\"name\": \"test\"}") + .build() + + println("updating record") + client.putData(updateData) + client.getData(id) + + Thread.sleep(5000) + + val removeData = DltGateway.DltRecord.newBuilder() + .setRecordId(id) + .setOperation(DltGateway.DltRecordOperationEnum.DLTRECORDOPERATION_DELETE) + .setDataJson("{\"name\": \"test\"}") + .build() + + println("removing record") + client.putData(removeData) + try { + client.getData(id) + } catch (e: Exception) { + println(e.toString()) + } + Thread.sleep(5000) +} diff --git a/src/dlt/src/main/kotlin/fabric/ConnectGateway.kt b/src/dlt/gateway/src/main/kotlin/fabric/ConnectGateway.kt similarity index 97% rename from src/dlt/src/main/kotlin/fabric/ConnectGateway.kt rename to src/dlt/gateway/src/main/kotlin/fabric/ConnectGateway.kt index 245bd4828776837802a1303787d5cfc34a5bffbc..00ec40d57dcd8bc4da18f30a6bed6f1d2a032b48 100644 --- a/src/dlt/src/main/kotlin/fabric/ConnectGateway.kt +++ b/src/dlt/gateway/src/main/kotlin/fabric/ConnectGateway.kt @@ -12,7 +12,7 @@ // duplication of the object or source code - either totally or in // part - is strictly prohibited. // -// Copyright (c) 2021 NEC Laboratories Europe GmbH +// Copyright (c) 2022 NEC Laboratories Europe GmbH // All Rights Reserved. // // Authors: Konstantin Munichev diff --git a/src/dlt/src/main/kotlin/fabric/EnrollAdmin.kt b/src/dlt/gateway/src/main/kotlin/fabric/EnrollAdmin.kt similarity index 100% rename from src/dlt/src/main/kotlin/fabric/EnrollAdmin.kt rename to src/dlt/gateway/src/main/kotlin/fabric/EnrollAdmin.kt diff --git a/src/dlt/gateway/src/main/kotlin/fabric/FabricConnector.kt b/src/dlt/gateway/src/main/kotlin/fabric/FabricConnector.kt new file mode 100644 index 0000000000000000000000000000000000000000..af6592be93c86e316a64cd23edd46bbbdc240cfd --- /dev/null +++ b/src/dlt/gateway/src/main/kotlin/fabric/FabricConnector.kt @@ -0,0 +1,178 @@ +// NEC Laboratories Europe GmbH +// +// PROPRIETARY INFORMATION +// +// The software and its source code contain valuable trade secrets and +// shall be maintained in confidence and treated as confidential +// information. The software may only be used for evaluation and/or +// testing purposes, unless otherwise explicitly stated in a written +// agreement with NEC Laboratories Europe GmbH. +// +// Any unauthorized publication, transfer to third parties or +// duplication of the object or source code - either totally or in +// part - is strictly prohibited. +// +// Copyright (c) 2022 NEC Laboratories Europe GmbH +// All Rights Reserved. +// +// Authors: Konstantin Munichev +// +// +// NEC Laboratories Europe GmbH DISCLAIMS ALL WARRANTIES, EITHER +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND THE +// WARRANTY AGAINST LATENT DEFECTS, WITH RESPECT TO THE PROGRAM AND +// THE ACCOMPANYING DOCUMENTATION. +// +// NO LIABILITIES FOR CONSEQUENTIAL DAMAGES: IN NO EVENT SHALL NEC +// Laboratories Europe GmbH or ANY OF ITS SUBSIDIARIES BE LIABLE FOR +// ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR +// LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF +// INFORMATION, OR OTHER PECUNIARY LOSS AND INDIRECT, CONSEQUENTIAL, +// INCIDENTAL, ECONOMIC OR PUNITIVE DAMAGES) ARISING OUT OF THE USE OF +// OR INABILITY TO USE THIS PROGRAM, EVEN IF NEC Laboratories Europe +// GmbH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +// +// THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY. + +package fabric + +import context.ContextOuterClass +import dlt.DltGateway.DltRecord +import dlt.DltGateway.DltRecordEvent +import kotlinx.coroutines.channels.Channel +import kotlinx.coroutines.runBlocking +import org.hyperledger.fabric.gateway.Contract +import org.hyperledger.fabric.gateway.ContractEvent +import org.hyperledger.fabric.gateway.Wallet +import org.hyperledger.fabric.gateway.Wallets +import org.hyperledger.fabric.sdk.security.CryptoSuiteFactory +import org.hyperledger.fabric_ca.sdk.HFCAClient +import proto.Config +import java.nio.file.Paths +import java.util.* +import java.util.function.Consumer + +class FabricConnector(val config: Config.DltConfig) { + private val caClient: HFCAClient + private val wallet: Wallet + private val contract: Contract + + private val channels: MutableList> = mutableListOf() + + private val encoder: Base64.Encoder = Base64.getEncoder() + private val decoder: Base64.Decoder = Base64.getDecoder() + + init { + // Create a CA client for interacting with the CA. + val props = Properties() + props["pemFile"] = config.caCertFile + props["allowAllHostNames"] = "true" + caClient = HFCAClient.createNewInstance(config.caUrl, props) + val cryptoSuite = CryptoSuiteFactory.getDefault().cryptoSuite + caClient.cryptoSuite = cryptoSuite + + // Create a wallet for managing identities + wallet = Wallets.newFileSystemWallet(Paths.get(config.wallet)) + contract = connect() + + fabricSubscribe() + } + + private fun fabricSubscribe() { + val consumer = Consumer { event: ContractEvent? -> + run { + println("new event detected") + val record = DltRecord.parseFrom(decoder.decode(event?.payload?.get())) + println(record.recordId.recordUuid) + val eventType: ContextOuterClass.EventTypeEnum = when (event?.name) { + "Add" -> ContextOuterClass.EventTypeEnum.EVENTTYPE_CREATE + "Update" -> ContextOuterClass.EventTypeEnum.EVENTTYPE_UPDATE + "Remove" -> ContextOuterClass.EventTypeEnum.EVENTTYPE_REMOVE + else -> ContextOuterClass.EventTypeEnum.EVENTTYPE_UNDEFINED + } + val pbEvent = DltRecordEvent.newBuilder() + .setEvent( + ContextOuterClass.Event.newBuilder() + .setTimestamp( + ContextOuterClass.Timestamp.newBuilder() + .setTimestamp(System.currentTimeMillis().toDouble()) + ) + .setEventType(eventType) + ) + .setRecordId(record.recordId) + .build() + + runBlocking { + channels.forEach { + it.trySend(pbEvent) + } + } + } + } + contract.addContractListener(consumer) + } + + fun connect(): Contract { + enrollAdmin(config, caClient, wallet) + registerUser(config, caClient, wallet) + return getContract(config, wallet) + } + + fun putData(record: DltRecord): String { + println(record.toString()) + + try { + contract.submitTransaction( + "AddRecord", + record.recordId.recordUuid.uuid, + encoder.encodeToString(record.toByteArray()) + ) + } catch (e: Exception) { + println(e.toString()) + return e.toString() + } + return "" + } + + fun getData(uuid: String): DltRecord { + return try { + val result = contract.evaluateTransaction("GetRecord", uuid) + DltRecord.parseFrom(decoder.decode(result)) + } catch (e: Exception) { + println(e.toString()) + DltRecord.getDefaultInstance() + } + } + + fun updateData(record: DltRecord): String { + try { + contract.submitTransaction( + "UpdateRecord", + record.recordId.recordUuid.uuid, + encoder.encodeToString(record.toByteArray()) + ) + } catch (e: Exception) { + return e.toString() + } + return "" + } + + fun deleteData(record: DltRecord): String { + try { + contract.submitTransaction( + "DeleteRecord", + record.recordId.recordUuid.uuid, + ) + } catch (e: Exception) { + return e.toString() + } + return "" + } + + fun subscribeForEvents(): Channel { + val produceCh = Channel() + channels.add(produceCh) + return produceCh + } +} \ No newline at end of file diff --git a/src/dlt/src/main/kotlin/fabric/RegisterUser.kt b/src/dlt/gateway/src/main/kotlin/fabric/RegisterUser.kt similarity index 100% rename from src/dlt/src/main/kotlin/fabric/RegisterUser.kt rename to src/dlt/gateway/src/main/kotlin/fabric/RegisterUser.kt diff --git a/src/dlt/gateway/src/main/kotlin/grpc/FabricServer.kt b/src/dlt/gateway/src/main/kotlin/grpc/FabricServer.kt new file mode 100644 index 0000000000000000000000000000000000000000..9b4e1f4dc38d80c22847ae213053119b301bdf3d --- /dev/null +++ b/src/dlt/gateway/src/main/kotlin/grpc/FabricServer.kt @@ -0,0 +1,94 @@ +// NEC Laboratories Europe GmbH +// +// PROPRIETARY INFORMATION +// +// The software and its source code contain valuable trade secrets and +// shall be maintained in confidence and treated as confidential +// information. The software may only be used for evaluation and/or +// testing purposes, unless otherwise explicitly stated in a written +// agreement with NEC Laboratories Europe GmbH. +// +// Any unauthorized publication, transfer to third parties or +// duplication of the object or source code - either totally or in +// part - is strictly prohibited. +// +// Copyright (c) 2022 NEC Laboratories Europe GmbH +// All Rights Reserved. +// +// Authors: Konstantin Munichev +// +// +// NEC Laboratories Europe GmbH DISCLAIMS ALL WARRANTIES, EITHER +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND THE +// WARRANTY AGAINST LATENT DEFECTS, WITH RESPECT TO THE PROGRAM AND +// THE ACCOMPANYING DOCUMENTATION. +// +// NO LIABILITIES FOR CONSEQUENTIAL DAMAGES: IN NO EVENT SHALL NEC +// Laboratories Europe GmbH or ANY OF ITS SUBSIDIARIES BE LIABLE FOR +// ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR +// LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF +// INFORMATION, OR OTHER PECUNIARY LOSS AND INDIRECT, CONSEQUENTIAL, +// INCIDENTAL, ECONOMIC OR PUNITIVE DAMAGES) ARISING OUT OF THE USE OF +// OR INABILITY TO USE THIS PROGRAM, EVEN IF NEC Laboratories Europe +// GmbH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +// +// THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY. + +package grpc + +import fabric.FabricConnector +import io.grpc.Server +import io.grpc.ServerBuilder +import proto.Config +import kotlin.random.Random +import kotlin.random.nextUInt + +class FabricServer(val port: Int) { + private val server: Server + + init { + val id = Random.nextUInt() + val cfg = Config.DltConfig.newBuilder().setWallet("wallet$id").setConnectionFile("config/connection-org1.json") + .setUser("appUser$id") + .setChannel("dlt") + .setContract("basic").setCaCertFile("config/ca.org1.example.com-cert.pem").setCaUrl("https://teraflow.nlehd.de:7054") + .setCaAdmin("admin").setCaAdminSecret("adminpw").setMsp("Org1MSP").setAffiliation("org1.department1") + .build() + val connector = FabricConnector(cfg) + + val dltService = DLTService(connector) + server = ServerBuilder + .forPort(port) + .addService(dltService) + .build() + + } + + fun start() { + server.start() + println("Server started, listening on $port") + Runtime.getRuntime().addShutdownHook( + Thread { + println("Shutting down...") + this@FabricServer.stop() + println("Server shut down") + } + ) + } + + private fun stop() { + server.shutdown() + } + + fun blockUntilShutdown() { + server.awaitTermination() + } +} + +fun main() { + val port = 50051 + val server = FabricServer(port) + server.start() + server.blockUntilShutdown() +} diff --git a/src/dlt/gateway/src/main/kotlin/grpc/GrpcHandler.kt b/src/dlt/gateway/src/main/kotlin/grpc/GrpcHandler.kt new file mode 100644 index 0000000000000000000000000000000000000000..d39c24a1a87aacb32d828dcba8208b34312d7409 --- /dev/null +++ b/src/dlt/gateway/src/main/kotlin/grpc/GrpcHandler.kt @@ -0,0 +1,95 @@ +// NEC Laboratories Europe GmbH +// +// PROPRIETARY INFORMATION +// +// The software and its source code contain valuable trade secrets and +// shall be maintained in confidence and treated as confidential +// information. The software may only be used for evaluation and/or +// testing purposes, unless otherwise explicitly stated in a written +// agreement with NEC Laboratories Europe GmbH. +// +// Any unauthorized publication, transfer to third parties or +// duplication of the object or source code - either totally or in +// part - is strictly prohibited. +// +// Copyright (c) 2022 NEC Laboratories Europe GmbH +// All Rights Reserved. +// +// Authors: Konstantin Munichev +// +// +// NEC Laboratories Europe GmbH DISCLAIMS ALL WARRANTIES, EITHER +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND THE +// WARRANTY AGAINST LATENT DEFECTS, WITH RESPECT TO THE PROGRAM AND +// THE ACCOMPANYING DOCUMENTATION. +// +// NO LIABILITIES FOR CONSEQUENTIAL DAMAGES: IN NO EVENT SHALL NEC +// Laboratories Europe GmbH or ANY OF ITS SUBSIDIARIES BE LIABLE FOR +// ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR +// LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF +// INFORMATION, OR OTHER PECUNIARY LOSS AND INDIRECT, CONSEQUENTIAL, +// INCIDENTAL, ECONOMIC OR PUNITIVE DAMAGES) ARISING OUT OF THE USE OF +// OR INABILITY TO USE THIS PROGRAM, EVEN IF NEC Laboratories Europe +// GmbH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +// +// THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY. + +package grpc + +import fabric.FabricConnector +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.consumeAsFlow +import context.ContextOuterClass +import dlt.DltGateway +import dlt.DltGatewayServiceGrpcKt + +class DLTService(private val connector: FabricConnector) : + DltGatewayServiceGrpcKt.DltGatewayServiceCoroutineImplBase() { + override suspend fun recordToDlt(request: DltGateway.DltRecord): DltGateway.DltRecordStatus { + println("Incoming request ${request.recordId.recordUuid}") + val error = when (request.operation) { + DltGateway.DltRecordOperationEnum.DLTRECORDOPERATION_ADD -> { + println("Adding new record") + connector.putData(request) + } + DltGateway.DltRecordOperationEnum.DLTRECORDOPERATION_UPDATE -> { + println("Updating record") + connector.updateData(request) + } + DltGateway.DltRecordOperationEnum.DLTRECORDOPERATION_DELETE -> { + println("Deleting record") + connector.deleteData(request) + } + else -> "Undefined or unknown operation" + } + + val dltStatusEnum: DltGateway.DltRecordStatusEnum = if (error == "") { + DltGateway.DltRecordStatusEnum.DLTRECORDSTATUS_SUCCEEDED + } else { + DltGateway.DltRecordStatusEnum.DLTRECORDSTATUS_FAILED + } + return DltGateway.DltRecordStatus.newBuilder() + .setRecordId(request.recordId) + .setStatus(dltStatusEnum) + .setErrorMessage(error) + .build() + } + + override suspend fun getFromDlt(request: DltGateway.DltRecordId): DltGateway.DltRecord { + return connector.getData(request.recordUuid.uuid) + } + + override fun subscribeToDlt(request: DltGateway.DltRecordSubscription): Flow { + println("Subscription request: $request") + return connector.subscribeForEvents().consumeAsFlow() + } + + override suspend fun getDltStatus(request: ContextOuterClass.TeraFlowController): DltGateway.DltPeerStatus { + return super.getDltStatus(request) + } + + override suspend fun getDltPeers(request: ContextOuterClass.Empty): DltGateway.DltPeerStatusList { + return super.getDltPeers(request) + } +} \ No newline at end of file diff --git a/src/dlt/src/main/kotlin/proto/Config.proto b/src/dlt/gateway/src/main/kotlin/proto/Config.proto similarity index 82% rename from src/dlt/src/main/kotlin/proto/Config.proto rename to src/dlt/gateway/src/main/kotlin/proto/Config.proto index f492e63ce65924a98b38ea4925d43336f84d211c..b6d4c5614dca4b7784b96ebdb1d002f85c4fd0e2 100644 --- a/src/dlt/src/main/kotlin/proto/Config.proto +++ b/src/dlt/gateway/src/main/kotlin/proto/Config.proto @@ -12,7 +12,7 @@ // duplication of the object or source code - either totally or in // part - is strictly prohibited. // -// Copyright (c) 2021 NEC Laboratories Europe GmbH +// Copyright (c) 2022 NEC Laboratories Europe GmbH // All Rights Reserved. // // Authors: Konstantin Munichev @@ -52,29 +52,3 @@ message DltConfig { string msp = 10; string affiliation = 11; } - -message DltRecordId { - string uuid = 1; -} - -enum DltRecordOperation { - OP_UNSET = 0; - ADD = 1; - UPDATE = 2; - DISABLE = 3; -} - -enum DltRecordType { - RECORD_UNSET = 0; - UNKNOWN = 1; - SERVICE = 2; - DEVICE = 3; - SLICE = 4; -} - -message DltRecord { - DltRecordId id = 1; - DltRecordOperation operation = 2; - DltRecordType type = 3; - string json = 4; -} \ No newline at end of file diff --git a/src/dlt/mock_blockchain/Dockerfile b/src/dlt/mock_blockchain/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..09fe5d399c8455f8fd898d6b4c9eb992c8c9d469 --- /dev/null +++ b/src/dlt/mock_blockchain/Dockerfile @@ -0,0 +1,68 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM python:3.9-slim + +# Install dependencies +RUN apt-get --yes --quiet --quiet update && \ + apt-get --yes --quiet --quiet install wget g++ && \ + rm -rf /var/lib/apt/lists/* + +# Set Python to show logs as they occur +ENV PYTHONUNBUFFERED=0 + +# Download the gRPC health probe +RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ + wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ + chmod +x /bin/grpc_health_probe + +# Get generic Python packages +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools + +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components +WORKDIR /var/teraflow +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt + +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto + +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; + +# Create component sub-folders, get specific Python packages +RUN mkdir -p /var/teraflow/mock_blockchain +WORKDIR /var/teraflow/mock_blockchain +COPY src/dlt/mock_blockchain/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN python3 -m pip install -r requirements.txt + +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/dlt/mock_blockchain/. mock_blockchain + +# Start the service +ENTRYPOINT ["python", "-m", "mock_blockchain.service"] diff --git a/src/dlt/mock_blockchain/__init__.py b/src/dlt/mock_blockchain/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf --- /dev/null +++ b/src/dlt/mock_blockchain/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/src/dlt/mock_blockchain/requirements.in b/src/dlt/mock_blockchain/requirements.in new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/dlt/mock_blockchain/requirements.in @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/dlt/mock_blockchain/service/__init__.py b/src/dlt/mock_blockchain/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf --- /dev/null +++ b/src/dlt/mock_blockchain/service/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/src/dlt/mock_blockchain/service/__main__.py b/src/dlt/mock_blockchain/service/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..e4cffac51064b68c2acc494410e51785c45cd437 --- /dev/null +++ b/src/dlt/mock_blockchain/service/__main__.py @@ -0,0 +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. + +import logging, signal, sys, threading +from common.Constants import ServiceNameEnum +from common.Settings import get_log_level, get_service_port_grpc +from common.proto.dlt_gateway_pb2_grpc import add_DltGatewayServiceServicer_to_server +from common.tests.MockServicerImpl_DltGateway import MockServicerImpl_DltGateway +from common.tools.service.GenericGrpcService import GenericGrpcService + +terminate = threading.Event() + +logging.basicConfig(level=get_log_level()) +LOGGER = logging.getLogger(__name__) + +class MockDltGatewayService(GenericGrpcService): + def __init__(self, cls_name: str = 'MockDltGatewayService') -> None: + port = get_service_port_grpc(ServiceNameEnum.DLT_GATEWAY) + super().__init__(port, cls_name=cls_name) + self.dltgateway_servicer = MockServicerImpl_DltGateway() + + # pylint: disable=attribute-defined-outside-init + def install_servicers(self): + add_DltGatewayServiceServicer_to_server(self.dltgateway_servicer, self.server) + +def signal_handler(signal, frame): # pylint: disable=redefined-outer-name + LOGGER.warning('Terminate signal received') + terminate.set() + +def main(): + signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGTERM, signal_handler) + + LOGGER.info('Starting...') + + # Starting Mock DLT gateway service + grpc_service = MockDltGatewayService() + grpc_service.start() + + # Wait for Ctrl+C or termination signal + while not terminate.wait(timeout=0.1): pass + + LOGGER.info('Terminating...') + grpc_service.stop() + + LOGGER.info('Bye') + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/dlt/settings.gradle.kts b/src/dlt/settings.gradle.kts deleted file mode 100644 index 0ebdd07b29682c72c65695e4f5655437ed11d74d..0000000000000000000000000000000000000000 --- a/src/dlt/settings.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ - -rootProject.name = "dlt" - diff --git a/src/dlt/src/main/kotlin/Main.kt b/src/dlt/src/main/kotlin/Main.kt deleted file mode 100644 index d6298cc2890a8cec8ea9af4a05bbabb5ab8f3b4d..0000000000000000000000000000000000000000 --- a/src/dlt/src/main/kotlin/Main.kt +++ /dev/null @@ -1,142 +0,0 @@ -// NEC Laboratories Europe GmbH -// -// PROPRIETARY INFORMATION -// -// The software and its source code contain valuable trade secrets and -// shall be maintained in confidence and treated as confidential -// information. The software may only be used for evaluation and/or -// testing purposes, unless otherwise explicitly stated in a written -// agreement with NEC Laboratories Europe GmbH. -// -// Any unauthorized publication, transfer to third parties or -// duplication of the object or source code - either totally or in -// part - is strictly prohibited. -// -// Copyright (c) 2021 NEC Laboratories Europe GmbH -// All Rights Reserved. -// -// Authors: Konstantin Munichev -// -// -// NEC Laboratories Europe GmbH DISCLAIMS ALL WARRANTIES, EITHER -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND THE -// WARRANTY AGAINST LATENT DEFECTS, WITH RESPECT TO THE PROGRAM AND -// THE ACCOMPANYING DOCUMENTATION. -// -// NO LIABILITIES FOR CONSEQUENTIAL DAMAGES: IN NO EVENT SHALL NEC -// Laboratories Europe GmbH or ANY OF ITS SUBSIDIARIES BE LIABLE FOR -// ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR -// LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF -// INFORMATION, OR OTHER PECUNIARY LOSS AND INDIRECT, CONSEQUENTIAL, -// INCIDENTAL, ECONOMIC OR PUNITIVE DAMAGES) ARISING OUT OF THE USE OF -// OR INABILITY TO USE THIS PROGRAM, EVEN IF NEC Laboratories Europe -// GmbH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -// -// THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY. - -import io.ktor.client.* -import io.ktor.client.engine.cio.* -import io.ktor.client.features.* -import io.ktor.client.request.* -import io.ktor.utils.io.jvm.javaio.* -import kotlinx.serialization.ExperimentalSerializationApi -import proto.Config -import proto.Config.DltConfig - -@OptIn(ExperimentalSerializationApi::class) -suspend fun main(args: Array) { - // TODO: default configuration file - val cfg = DltConfig.newBuilder().setWallet("wallet").setConnectionFile("config/connection-org1.json") - .setUser("appUser") - .setChannel("dlt") - .setContract("basic").setCaCertFile("config/ca.org1.example.com-cert.pem").setCaUrl("https://s2:7054") - .setCaAdmin("admin").setCaAdminSecret("adminpw").setMsp("Org1MSP").setAffiliation("org1.department1") - .build() - val cfgBytes = cfg.toByteArray() - - val client = HttpClient(CIO) { - HttpResponseValidator { - validateResponse { response -> - println(response.status) - } - } - } - - try { - client.post("http://localhost:8080/dlt/configure") { - body = cfgBytes - } - } catch (e: ClientRequestException) { - println(e.response.status) - println(String(e.response.content.toInputStream().readAllBytes())) - } - - try { - val config = client.get("http://localhost:8080/dlt/configure") - println(DltConfig.parseFrom(config)) - } catch (e: ClientRequestException) { - println(e.response.status) - println(String(e.response.content.toInputStream().readAllBytes())) - } - - val uuid = "41f4d2e2-f4ef-4c81-872a-c32f2d26b2ca" - try { - val record = client.get("http://localhost:8080/dlt/record") { - body = uuid - } - println(Config.DltRecord.parseFrom(record)) - } catch (e: ClientRequestException) { - println(e.response.status) - println(String(e.response.content.toInputStream().readAllBytes())) - } - - val id = Config.DltRecordId.newBuilder().setUuid(uuid).build() - val record = Config.DltRecord.newBuilder().setId(id).setOperation(Config.DltRecordOperation.ADD) - .setType(Config.DltRecordType.DEVICE).setJson("{}").build() - try { - val result = client.post("http://localhost:8080/dlt/record") { - body = record.toByteArray() - } - println(String(result)) - val requestedRecord = client.get("http://localhost:8080/dlt/record") { - body = uuid - } - println(Config.DltRecord.parseFrom(requestedRecord)) - } catch (e: ClientRequestException) { - println(e.response.status) - println(String(e.response.content.toInputStream().readAllBytes())) - } - - try { - val newRecord = Config.DltRecord.newBuilder().setId(id).setOperation(Config.DltRecordOperation.UPDATE) - .setType(Config.DltRecordType.UNKNOWN).setJson("{}").build() - val result = client.post("http://localhost:8080/dlt/record") { - body = newRecord.toByteArray() - } - println(String(result)) - val requestedRecord = client.get("http://localhost:8080/dlt/record") { - body = uuid - } - println(Config.DltRecord.parseFrom(requestedRecord)) - } catch (e: ClientRequestException) { - println(e.response.status) - println(String(e.response.content.toInputStream().readAllBytes())) - } - - try { - val newRecord = Config.DltRecord.newBuilder().setId(id).setOperation(Config.DltRecordOperation.DISABLE) - .setType(Config.DltRecordType.SLICE).setJson("{}").build() - val result = client.post("http://localhost:8080/dlt/record") { - body = newRecord.toByteArray() - } - println(String(result)) - val requestedRecord = client.get("http://localhost:8080/dlt/record") { - body = uuid - } - println(Config.DltRecord.parseFrom(requestedRecord)) - } catch (e: ClientRequestException) { - println(e.response.status) - println(String(e.response.content.toInputStream().readAllBytes())) - } -} \ No newline at end of file diff --git a/src/dlt/src/main/kotlin/fabric/FabricConnector.kt b/src/dlt/src/main/kotlin/fabric/FabricConnector.kt deleted file mode 100644 index 0918f59e1f616af4deae3835cc2f48ae6c932902..0000000000000000000000000000000000000000 --- a/src/dlt/src/main/kotlin/fabric/FabricConnector.kt +++ /dev/null @@ -1,105 +0,0 @@ -// NEC Laboratories Europe GmbH -// -// PROPRIETARY INFORMATION -// -// The software and its source code contain valuable trade secrets and -// shall be maintained in confidence and treated as confidential -// information. The software may only be used for evaluation and/or -// testing purposes, unless otherwise explicitly stated in a written -// agreement with NEC Laboratories Europe GmbH. -// -// Any unauthorized publication, transfer to third parties or -// duplication of the object or source code - either totally or in -// part - is strictly prohibited. -// -// Copyright (c) 2021 NEC Laboratories Europe GmbH -// All Rights Reserved. -// -// Authors: Konstantin Munichev -// -// -// NEC Laboratories Europe GmbH DISCLAIMS ALL WARRANTIES, EITHER -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND THE -// WARRANTY AGAINST LATENT DEFECTS, WITH RESPECT TO THE PROGRAM AND -// THE ACCOMPANYING DOCUMENTATION. -// -// NO LIABILITIES FOR CONSEQUENTIAL DAMAGES: IN NO EVENT SHALL NEC -// Laboratories Europe GmbH or ANY OF ITS SUBSIDIARIES BE LIABLE FOR -// ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR -// LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF -// INFORMATION, OR OTHER PECUNIARY LOSS AND INDIRECT, CONSEQUENTIAL, -// INCIDENTAL, ECONOMIC OR PUNITIVE DAMAGES) ARISING OUT OF THE USE OF -// OR INABILITY TO USE THIS PROGRAM, EVEN IF NEC Laboratories Europe -// GmbH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -// -// THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY. - -package fabric - -import org.hyperledger.fabric.gateway.Contract -import org.hyperledger.fabric.gateway.Wallet -import org.hyperledger.fabric.gateway.Wallets -import org.hyperledger.fabric.sdk.security.CryptoSuiteFactory -import org.hyperledger.fabric_ca.sdk.HFCAClient -import proto.Config -import java.nio.file.Paths -import java.util.* - -class FabricConnector(val config: Config.DltConfig) { - private val caClient: HFCAClient - private val wallet: Wallet - private val contract: Contract - - init { - // Create a CA client for interacting with the CA. - val props = Properties() - props["pemFile"] = config.caCertFile - props["allowAllHostNames"] = "true" - caClient = HFCAClient.createNewInstance(config.caUrl, props) - val cryptoSuite = CryptoSuiteFactory.getDefault().cryptoSuite - caClient.cryptoSuite = cryptoSuite - - // Create a wallet for managing identities - wallet = Wallets.newFileSystemWallet(Paths.get(config.wallet)) - contract = connect() - } - - fun connect(): Contract { - enrollAdmin(config, caClient, wallet) - registerUser(config, caClient, wallet) - return getContract(config, wallet) - } - - fun putData(record: Config.DltRecord): String { - println(record.type.toString()) - return String( - contract.submitTransaction( - "AddRecord", - record.id.uuid, - record.type.number.toString(), - record.json - ) - ) - } - - fun getData(uuid: String): Config.DltRecord { - val result = contract.evaluateTransaction("GetRecord", uuid) - return Config.DltRecord.parseFrom(result) - } - - fun updateData(record: Config.DltRecord): String { - return String( - contract.submitTransaction( - "UpdateRecord", - record.id.uuid, - record.type.number.toString(), - record.json - ) - ) - } - - fun deleteData(uuid: String): String { - return String(contract.submitTransaction("DeactivateRecord", uuid)) - } -} \ No newline at end of file diff --git a/src/dlt/src/main/kotlin/http/Server.kt b/src/dlt/src/main/kotlin/http/Server.kt deleted file mode 100644 index 4e3400af36b32726096b177da230c8baa4bb3dab..0000000000000000000000000000000000000000 --- a/src/dlt/src/main/kotlin/http/Server.kt +++ /dev/null @@ -1,162 +0,0 @@ -// NEC Laboratories Europe GmbH -// -// PROPRIETARY INFORMATION -// -// The software and its source code contain valuable trade secrets and -// shall be maintained in confidence and treated as confidential -// information. The software may only be used for evaluation and/or -// testing purposes, unless otherwise explicitly stated in a written -// agreement with NEC Laboratories Europe GmbH. -// -// Any unauthorized publication, transfer to third parties or -// duplication of the object or source code - either totally or in -// part - is strictly prohibited. -// -// Copyright (c) 2021 NEC Laboratories Europe GmbH -// All Rights Reserved. -// -// Authors: Konstantin Munichev -// -// -// NEC Laboratories Europe GmbH DISCLAIMS ALL WARRANTIES, EITHER -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND THE -// WARRANTY AGAINST LATENT DEFECTS, WITH RESPECT TO THE PROGRAM AND -// THE ACCOMPANYING DOCUMENTATION. -// -// NO LIABILITIES FOR CONSEQUENTIAL DAMAGES: IN NO EVENT SHALL NEC -// Laboratories Europe GmbH or ANY OF ITS SUBSIDIARIES BE LIABLE FOR -// ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR -// LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF -// INFORMATION, OR OTHER PECUNIARY LOSS AND INDIRECT, CONSEQUENTIAL, -// INCIDENTAL, ECONOMIC OR PUNITIVE DAMAGES) ARISING OUT OF THE USE OF -// OR INABILITY TO USE THIS PROGRAM, EVEN IF NEC Laboratories Europe -// GmbH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -// -// THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY. - -package http - -import fabric.FabricConnector -import io.ktor.application.* -import io.ktor.features.* -import io.ktor.http.* -import io.ktor.request.* -import io.ktor.response.* -import io.ktor.routing.* -import io.ktor.server.engine.* -import io.ktor.server.netty.* -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.sync.Mutex -import kotlinx.coroutines.withContext -import proto.Config -import proto.Config.DltConfig -import proto.Config.DltRecord - -class Server { - var connector: FabricConnector? = null - val port = 8080 - val mutex = Mutex() -} - -fun checkException(e: Exception): String { - if (e.message == null) return "" - return e.message!! -} - -fun main() { - val server = Server() - embeddedServer(Netty, port = server.port) { - install(ContentNegotiation) - routing { - post("/dlt/configure") { - withContext(Dispatchers.IO) { - try { - val data = call.receiveStream() - val config = DltConfig.parseFrom(data) - println(config) - server.mutex.lock() - server.connector = FabricConnector(config) - server.mutex.unlock() - call.response.status(HttpStatusCode.Created) - } - // TODO: catch exceptions one by one - catch (e: Exception) { - call.respond(HttpStatusCode.BadRequest, checkException(e)) - e.printStackTrace() - } - } - } - get("/dlt/configure") { - withContext(Dispatchers.IO) { - server.mutex.lock() - if (server.connector == null) { - server.mutex.unlock() - call.respond(HttpStatusCode.NotFound, "Not initialized") - } else { - val configBytes = server.connector!!.config.toByteArray() - server.mutex.unlock() - call.respond(HttpStatusCode.OK, configBytes) - } - } - } - post("/dlt/record") { - withContext(Dispatchers.IO) { - server.mutex.lock() - try { - if (server.connector == null) { - call.respond(HttpStatusCode.NotFound, "Not initialized") - } else { - val record = DltRecord.parseFrom(call.receiveStream()) - when (record.operation) { - Config.DltRecordOperation.ADD -> { - val result = server.connector!!.putData(record) - call.respond(HttpStatusCode.Created, result) - } - Config.DltRecordOperation.UPDATE -> { - val result = server.connector!!.updateData(record) - call.respond(HttpStatusCode.OK, result) - } - // TODO: Disable should require only uuid - Config.DltRecordOperation.DISABLE -> { - val result = server.connector!!.deleteData(record.id.uuid) - call.respond(HttpStatusCode.OK, result) - } - else -> { - call.respond(HttpStatusCode.BadRequest, "Invalid operation") - } - } - } - } - // TODO: catch exceptions one by one - catch (e: Exception) { - call.respond(HttpStatusCode.BadRequest, checkException(e)) - e.printStackTrace() - } - server.mutex.unlock() - } - } - get("/dlt/record") { - withContext(Dispatchers.IO) { - server.mutex.lock() - try { - if (server.connector == null) { - call.respond(HttpStatusCode.NotFound) - } else { - val uuid = call.receiveText() - println("Uuid request: $uuid") - val result = server.connector!!.getData(uuid) - call.respond(HttpStatusCode.OK, result.toByteArray()) - } - } - // TODO: catch exceptions one by one - catch (e: Exception) { - call.respond(HttpStatusCode.NotFound, checkException(e)) - e.printStackTrace() - } - server.mutex.unlock() - } - } - } - }.start(wait = true) -} diff --git a/src/gitlab-ci.yml_generator.py b/src/gitlab-ci.yml_generator.py old mode 100755 new mode 100644 index 8e367eb02b85b74a38932a2bb57004712d7fb883..4a4ac389e1e4ec0bfa67270fc8665dfbc830b111 --- a/src/gitlab-ci.yml_generator.py +++ b/src/gitlab-ci.yml_generator.py @@ -1,5 +1,5 @@ #!/usr/bin/python -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/interdomain/.gitlab-ci.yml b/src/interdomain/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..486c6d0a931ff18be59ddaaa0268fcb1adfbaa2c --- /dev/null +++ b/src/interdomain/.gitlab-ci.yml @@ -0,0 +1,106 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Build, tag, and push the Docker image to the GitLab Docker registry +build interdomain: + variables: + IMAGE_NAME: 'interdomain' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: build + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + script: + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile . + - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml + +# Apply unit test to the component +unit test interdomain: + variables: + IMAGE_NAME: 'interdomain' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: unit_test + needs: + - build interdomain + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi + - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi + script: + - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + - docker run --name $IMAGE_NAME -d -p 3030:3030 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG + - sleep 5 + - docker ps -a + - docker logs $IMAGE_NAME + - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' + after_script: + - docker rm -f $IMAGE_NAME + - docker network rm teraflowbridge + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - src/$IMAGE_NAME/tests/Dockerfile + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml + artifacts: + when: always + reports: + junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml + +# Deployment of the service in Kubernetes Cluster +deploy interdomain: + variables: + IMAGE_NAME: 'interdomain' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: deploy + needs: + - unit test interdomain + # - integ_test execute + script: + - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' + - kubectl version + - kubectl get all + - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" + - kubectl get all + # environment: + # name: test + # url: https://example.com + # kubernetes: + # namespace: test + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + when: manual + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + when: manual diff --git a/src/interdomain/Config.py b/src/interdomain/Config.py new file mode 100644 index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf --- /dev/null +++ b/src/interdomain/Config.py @@ -0,0 +1,13 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/src/interdomain/Dockerfile b/src/interdomain/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..69fcf3d9c52b9dc6232a2a8f3051acba88987408 --- /dev/null +++ b/src/interdomain/Dockerfile @@ -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. + +FROM python:3.9-slim + +# Install dependencies +RUN apt-get --yes --quiet --quiet update && \ + apt-get --yes --quiet --quiet install wget g++ && \ + rm -rf /var/lib/apt/lists/* + +# Set Python to show logs as they occur +ENV PYTHONUNBUFFERED=0 + +# Download the gRPC health probe +RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ + wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ + chmod +x /bin/grpc_health_probe + +# Get generic Python packages +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools + +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components +WORKDIR /var/teraflow +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt + +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto + +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; + +# Create component sub-folders, get specific Python packages +RUN mkdir -p /var/teraflow/interdomain +WORKDIR /var/teraflow/interdomain +COPY src/interdomain/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN python3 -m pip install -r requirements.txt + +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/context/. context/ +#COPY src/device/. device/ +COPY src/dlt/. dlt/ +COPY src/interdomain/. interdomain/ +#COPY src/monitoring/. monitoring/ +COPY src/pathcomp/. pathcomp/ +#COPY src/service/. service/ +COPY src/slice/. slice/ + +# Start the service +ENTRYPOINT ["python", "-m", "interdomain.service"] diff --git a/src/interdomain/__init__.py b/src/interdomain/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/interdomain/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/interdomain/client/InterdomainClient.py b/src/interdomain/client/InterdomainClient.py new file mode 100644 index 0000000000000000000000000000000000000000..f5631de61f9df3e35cac7efc1d768b9fbc9d5d7c --- /dev/null +++ b/src/interdomain/client/InterdomainClient.py @@ -0,0 +1,81 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import grpc, logging +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc +from common.proto.context_pb2 import AuthenticationResult, Slice, SliceId, SliceStatus, TeraFlowController +from common.proto.interdomain_pb2_grpc import InterdomainServiceStub +from common.tools.client.RetryDecorator import retry, delay_exponential +from common.tools.grpc.Tools import grpc_message_to_json_string + +LOGGER = logging.getLogger(__name__) +MAX_RETRIES = 15 +DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + +class InterdomainClient: + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.INTERDOMAIN) + if not port: port = get_service_port_grpc(ServiceNameEnum.INTERDOMAIN) + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) + LOGGER.debug('Creating channel to {:s}...'.format(self.endpoint)) + self.channel = None + self.stub = None + self.connect() + LOGGER.debug('Channel created') + + def connect(self): + self.channel = grpc.insecure_channel(self.endpoint) + self.stub = InterdomainServiceStub(self.channel) + + def close(self): + if self.channel is not None: self.channel.close() + self.channel = None + self.stub = None + + @RETRY_DECORATOR + def RequestSlice(self, request : Slice) -> SliceId: + LOGGER.debug('RequestSlice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.RequestSlice(request) + LOGGER.debug('RequestSlice result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def Authenticate(self, request : TeraFlowController) -> AuthenticationResult: + LOGGER.debug('Authenticate request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.Authenticate(request) + LOGGER.debug('Authenticate result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def LookUpSlice(self, request : Slice) -> SliceId: + LOGGER.debug('LookUpSlice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.LookUpSlice(request) + LOGGER.debug('LookUpSlice result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def OrderSliceFromCatalog(self, request : Slice) -> SliceStatus: + LOGGER.debug('OrderSliceFromCatalog request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.OrderSliceFromCatalog(request) + LOGGER.debug('OrderSliceFromCatalog result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def CreateSliceAndAddToCatalog(self, request : Slice) -> SliceStatus: + LOGGER.debug('CreateSliceAndAddToCatalog request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.CreateSliceAndAddToCatalog(request) + LOGGER.debug('CreateSliceAndAddToCatalog result: {:s}'.format(grpc_message_to_json_string(response))) + return response diff --git a/src/interdomain/client/__init__.py b/src/interdomain/client/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/interdomain/client/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/interdomain/requirements.in b/src/interdomain/requirements.in new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/interdomain/requirements.in @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/interdomain/service/InterdomainService.py b/src/interdomain/service/InterdomainService.py new file mode 100644 index 0000000000000000000000000000000000000000..59b6cd820d88caee36de7b2176d51523769ac947 --- /dev/null +++ b/src/interdomain/service/InterdomainService.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 common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc +from common.proto.interdomain_pb2_grpc import add_InterdomainServiceServicer_to_server +from common.tools.service.GenericGrpcService import GenericGrpcService +from .InterdomainServiceServicerImpl import InterdomainServiceServicerImpl +from .RemoteDomainClients import RemoteDomainClients + +class InterdomainService(GenericGrpcService): + def __init__(self, remote_domain_clients : RemoteDomainClients, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.INTERDOMAIN) + super().__init__(port, cls_name=cls_name) + self.interdomain_servicer = InterdomainServiceServicerImpl(remote_domain_clients) + + def install_servicers(self): + add_InterdomainServiceServicer_to_server(self.interdomain_servicer, self.server) diff --git a/src/interdomain/service/InterdomainServiceServicerImpl.py b/src/interdomain/service/InterdomainServiceServicerImpl.py new file mode 100644 index 0000000000000000000000000000000000000000..b72fc1b3122c3d04bde5394ae33d973fa33fa3b8 --- /dev/null +++ b/src/interdomain/service/InterdomainServiceServicerImpl.py @@ -0,0 +1,179 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import grpc, logging, uuid +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.proto.context_pb2 import AuthenticationResult, Slice, SliceId, SliceStatusEnum, TeraFlowController, TopologyId +from common.proto.interdomain_pb2_grpc import InterdomainServiceServicer +from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method +from common.tools.context_queries.Context import create_context +from common.tools.context_queries.InterDomain import ( + compute_interdomain_path, compute_traversed_domains, get_local_device_uuids, is_inter_domain) +from common.tools.context_queries.Topology import create_topology +from common.tools.grpc.Tools import grpc_message_to_json_string +from common.tools.object_factory.Topology import json_topology_id +from context.client.ContextClient import ContextClient +from dlt.connector.client.DltConnectorClient import DltConnectorClient +from interdomain.service.topology_abstractor.DltRecordSender import DltRecordSender +from pathcomp.frontend.client.PathCompClient import PathCompClient +from slice.client.SliceClient import SliceClient +from .RemoteDomainClients import RemoteDomainClients +from .Tools import compose_slice, compute_slice_owner, map_abstract_endpoints_to_real + +LOGGER = logging.getLogger(__name__) + +METRICS_POOL = MetricsPool('Interdomain', 'RPC') + +USE_DLT = True + +class InterdomainServiceServicerImpl(InterdomainServiceServicer): + def __init__(self, remote_domain_clients : RemoteDomainClients): + LOGGER.debug('Creating Servicer...') + self.remote_domain_clients = remote_domain_clients + LOGGER.debug('Servicer Created') + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def RequestSlice(self, request : Slice, context : grpc.ServicerContext) -> SliceId: + context_client = ContextClient() + pathcomp_client = PathCompClient() + slice_client = SliceClient() + dlt_connector_client = DltConnectorClient() + + local_device_uuids = get_local_device_uuids(context_client) + slice_owner_uuid = request.slice_owner.owner_uuid.uuid + not_inter_domain = not is_inter_domain(context_client, request.slice_endpoint_ids) + no_slice_owner = len(slice_owner_uuid) == 0 + is_local_slice_owner = slice_owner_uuid in local_device_uuids + if not_inter_domain and (no_slice_owner or is_local_slice_owner): + str_slice = grpc_message_to_json_string(request) + raise Exception('InterDomain can only handle inter-domain slice requests: {:s}'.format(str_slice)) + + interdomain_path = compute_interdomain_path(pathcomp_client, request) + str_interdomain_path = [ + [device_uuid, [ + (endpoint_id.device_id.device_uuid.uuid, endpoint_id.endpoint_uuid.uuid) + for endpoint_id in endpoint_ids + ]] + for device_uuid, endpoint_ids in interdomain_path + ] + LOGGER.info('interdomain_path={:s}'.format(str(str_interdomain_path))) + + traversed_domains = compute_traversed_domains(context_client, interdomain_path) + str_traversed_domains = [ + (domain_uuid, is_local_domain, [ + (endpoint_id.device_id.device_uuid.uuid, endpoint_id.endpoint_uuid.uuid) + for endpoint_id in endpoint_ids + ]) + for domain_uuid,is_local_domain,endpoint_ids in traversed_domains + ] + LOGGER.info('traversed_domains={:s}'.format(str(str_traversed_domains))) + + slice_owner_uuid = compute_slice_owner(context_client, traversed_domains) + LOGGER.info('slice_owner_uuid={:s}'.format(str(slice_owner_uuid))) + if slice_owner_uuid is None: + raise Exception('Unable to identify slice owner') + + reply = Slice() + reply.CopyFrom(request) + + dlt_record_sender = DltRecordSender(context_client, dlt_connector_client) + + for domain_uuid, is_local_domain, endpoint_ids in traversed_domains: + if is_local_domain: + slice_uuid = str(uuid.uuid4()) + LOGGER.info('[loop] [local] domain_uuid={:s} is_local_domain={:s} slice_uuid={:s}'.format( + str(domain_uuid), str(is_local_domain), str(slice_uuid))) + + # local slices always in DEFAULT_CONTEXT_NAME + #context_uuid = request.slice_id.context_id.context_uuid.uuid + context_uuid = DEFAULT_CONTEXT_NAME + endpoint_ids = map_abstract_endpoints_to_real(context_client, domain_uuid, endpoint_ids) + sub_slice = compose_slice( + context_uuid, slice_uuid, endpoint_ids, constraints=request.slice_constraints, + config_rules=request.slice_config.config_rules) + LOGGER.info('[loop] [local] sub_slice={:s}'.format(grpc_message_to_json_string(sub_slice))) + sub_slice_id = slice_client.CreateSlice(sub_slice) + else: + slice_uuid = request.slice_id.slice_uuid.uuid + LOGGER.info('[loop] [remote] domain_uuid={:s} is_local_domain={:s} slice_uuid={:s}'.format( + str(domain_uuid), str(is_local_domain), str(slice_uuid))) + + # create context/topology for the remote domains where we are creating slices + create_context(context_client, domain_uuid) + create_topology(context_client, domain_uuid, DEFAULT_TOPOLOGY_NAME) + + sub_slice = compose_slice( + domain_uuid, slice_uuid, endpoint_ids, constraints=request.slice_constraints, + config_rules=request.slice_config.config_rules, owner_uuid=slice_owner_uuid) + LOGGER.info('[loop] [remote] sub_slice={:s}'.format(grpc_message_to_json_string(sub_slice))) + sub_slice_id = context_client.SetSlice(sub_slice) + + if USE_DLT: + topology_id = TopologyId(**json_topology_id(domain_uuid)) + dlt_record_sender.add_slice(topology_id, sub_slice) + else: + interdomain_client = self.remote_domain_clients.get_peer('remote-teraflow') + sub_slice_reply = interdomain_client.LookUpSlice(sub_slice) + if sub_slice_reply == sub_slice.slice_id: # pylint: disable=no-member + # successful case + remote_sub_slice = interdomain_client.OrderSliceFromCatalog(sub_slice) + else: + # not in catalog + remote_sub_slice = interdomain_client.CreateSliceAndAddToCatalog(sub_slice) + if remote_sub_slice.slice_status.slice_status != SliceStatusEnum.SLICESTATUS_ACTIVE: + raise Exception('Remote Slice creation failed. Wrong Slice status returned') + + LOGGER.info('[loop] adding sub-slice') + reply.slice_subslice_ids.add().CopyFrom(sub_slice_id) # pylint: disable=no-member + + LOGGER.info('Recording Remote Slice requests to DLT') + dlt_record_sender.commit() + + LOGGER.info('Activating interdomain slice') + reply.slice_status.slice_status = SliceStatusEnum.SLICESTATUS_ACTIVE # pylint: disable=no-member + + LOGGER.info('Updating interdomain slice') + slice_id = context_client.SetSlice(reply) + return slice_id + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def Authenticate(self, request : TeraFlowController, context : grpc.ServicerContext) -> AuthenticationResult: + auth_result = AuthenticationResult() + auth_result.context_id.CopyFrom(request.context_id) # pylint: disable=no-member + auth_result.authenticated = True + return auth_result + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def LookUpSlice(self, request : Slice, context : grpc.ServicerContext) -> SliceId: + try: + context_client = ContextClient() + slice_ = context_client.GetSlice(request.slice_id) + return slice_.slice_id + except grpc.RpcError: + #LOGGER.exception('Unable to get slice({:s})'.format(grpc_message_to_json_string(request.slice_id))) + return SliceId() + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def OrderSliceFromCatalog(self, request : Slice, context : grpc.ServicerContext) -> Slice: + raise NotImplementedError('OrderSliceFromCatalog') + #return Slice() + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def CreateSliceAndAddToCatalog(self, request : Slice, context : grpc.ServicerContext) -> Slice: + context_client = ContextClient() + slice_client = SliceClient() + reply = slice_client.CreateSlice(request) + if reply != request.slice_id: + raise Exception('Slice creation failed. Wrong Slice Id was returned') + return context_client.GetSlice(request.slice_id) diff --git a/src/interdomain/service/RemoteDomainClients.py b/src/interdomain/service/RemoteDomainClients.py new file mode 100644 index 0000000000000000000000000000000000000000..297c9a60d0cc4c67fda7f746e5fead1837b9d4ee --- /dev/null +++ b/src/interdomain/service/RemoteDomainClients.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 logging, socket +from common.Constants import DEFAULT_CONTEXT_NAME, ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc +from common.proto.context_pb2 import TeraFlowController +from interdomain.client.InterdomainClient import InterdomainClient + +LOGGER = logging.getLogger(__name__) + +class RemoteDomainClients: + def __init__(self) -> None: + self.peer_domain = {} + + def add_peer( + self, domain_name : str, host : str, port : int, context_uuid : str = DEFAULT_CONTEXT_NAME + ) -> None: + while True: + try: + remote_teraflow_ip = socket.gethostbyname(host) + if len(remote_teraflow_ip) > 0: break + except socket.gaierror as e: + if str(e) == '[Errno -2] Name or service not known': continue + + interdomain_client = InterdomainClient(host=host, port=port) + request = TeraFlowController() + request.context_id.context_uuid.uuid = DEFAULT_CONTEXT_NAME # pylint: disable=no-member + request.ip_address = get_service_host(ServiceNameEnum.INTERDOMAIN) + request.port = int(get_service_port_grpc(ServiceNameEnum.INTERDOMAIN)) + + reply = interdomain_client.Authenticate(request) + if not reply.authenticated: + msg = 'Authentication against {:s}:{:d} rejected' + raise Exception(msg.format(str(remote_teraflow_ip), port)) + + self.peer_domain[domain_name] = interdomain_client + + def get_peer(self, domain_name : str) -> InterdomainClient: + LOGGER.warning('peers: {:s}'.format(str(self.peer_domain))) + return self.peer_domain.get(domain_name) + + def remove_peer(self, domain_name : str) -> None: + return self.peer_domain.pop(domain_name, None) diff --git a/src/interdomain/service/Tools.py b/src/interdomain/service/Tools.py new file mode 100644 index 0000000000000000000000000000000000000000..609dc6e07815de80d6d18f7464ce164ea3e14332 --- /dev/null +++ b/src/interdomain/service/Tools.py @@ -0,0 +1,131 @@ +# 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, logging +from typing import List, Optional, Tuple +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME, INTERDOMAIN_TOPOLOGY_NAME +from common.proto.context_pb2 import ( + ConfigRule, Constraint, ContextId, Device, Empty, EndPointId, Slice, SliceStatusEnum) +from common.tools.context_queries.CheckType import device_type_is_network, endpoint_type_is_border +from common.tools.context_queries.InterDomain import get_local_device_uuids +from common.tools.grpc.ConfigRules import copy_config_rules +from common.tools.grpc.Constraints import copy_constraints +from common.tools.grpc.Tools import grpc_message_to_json, grpc_message_to_json_string +from common.tools.object_factory.Context import json_context_id +from context.client.ContextClient import ContextClient + +LOGGER = logging.getLogger(__name__) + +def compute_slice_owner( + context_client : ContextClient, traversed_domains : List[Tuple[str, Device, bool, List[EndPointId]]] +) -> Optional[str]: + traversed_domain_uuids = {traversed_domain[0] for traversed_domain in traversed_domains} + + existing_topology_ids = context_client.ListTopologyIds(ContextId(**json_context_id(DEFAULT_CONTEXT_NAME))) + existing_topology_uuids = { + topology_id.topology_uuid.uuid for topology_id in existing_topology_ids.topology_ids + } + existing_topology_uuids.discard(DEFAULT_TOPOLOGY_NAME) + existing_topology_uuids.discard(INTERDOMAIN_TOPOLOGY_NAME) + + candidate_owner_uuids = traversed_domain_uuids.intersection(existing_topology_uuids) + if len(candidate_owner_uuids) != 1: + data = { + 'traversed_domain_uuids' : [td_uuid for td_uuid in traversed_domain_uuids ], + 'existing_topology_uuids': [et_uuid for et_uuid in existing_topology_uuids], + 'candidate_owner_uuids' : [co_uuid for co_uuid in candidate_owner_uuids ], + } + LOGGER.warning('Unable to identify slice owner: {:s}'.format(json.dumps(data))) + return None + + return candidate_owner_uuids.pop() + +def compose_slice( + context_uuid : str, slice_uuid : str, endpoint_ids : List[EndPointId], constraints : List[Constraint] = [], + config_rules : List[ConfigRule] = [], owner_uuid : Optional[str] = None +) -> Slice: + slice_ = Slice() + slice_.slice_id.context_id.context_uuid.uuid = context_uuid # pylint: disable=no-member + slice_.slice_id.slice_uuid.uuid = slice_uuid # pylint: disable=no-member + slice_.slice_status.slice_status = SliceStatusEnum.SLICESTATUS_PLANNED # pylint: disable=no-member + + if owner_uuid is not None: + slice_.slice_owner.owner_uuid.uuid = owner_uuid # pylint: disable=no-member + + if len(endpoint_ids) >= 2: + slice_.slice_endpoint_ids.add().CopyFrom(endpoint_ids[0]) # pylint: disable=no-member + slice_.slice_endpoint_ids.add().CopyFrom(endpoint_ids[-1]) # pylint: disable=no-member + + if len(constraints) > 0: + copy_constraints(constraints, slice_.slice_constraints) # pylint: disable=no-member + + if len(config_rules) > 0: + copy_config_rules(config_rules, slice_.slice_config.config_rules) # pylint: disable=no-member + + return slice_ + +def map_abstract_endpoints_to_real( + context_client : ContextClient, local_domain_uuid : str, abstract_endpoint_ids : List[EndPointId] +) -> List[EndPointId]: + + local_device_uuids = get_local_device_uuids(context_client) + all_devices = context_client.ListDevices(Empty()) + + map_endpoints_to_devices = dict() + for device in all_devices.devices: + LOGGER.info('[map_abstract_endpoints_to_real] Checking device {:s}'.format( + grpc_message_to_json_string(device))) + + if device_type_is_network(device.device_type): + LOGGER.info('[map_abstract_endpoints_to_real] Ignoring network device') + continue + device_uuid = device.device_id.device_uuid.uuid + if device_uuid not in local_device_uuids: + LOGGER.info('[map_abstract_endpoints_to_real] Ignoring non-local device') + continue + + for endpoint in device.device_endpoints: + LOGGER.info('[map_abstract_endpoints_to_real] Checking endpoint {:s}'.format( + grpc_message_to_json_string(endpoint))) + endpoint_id = endpoint.endpoint_id + device_uuid = endpoint_id.device_id.device_uuid.uuid + endpoint_uuid = endpoint_id.endpoint_uuid.uuid + map_endpoints_to_devices[(device_uuid, endpoint_uuid)] = endpoint_id + if endpoint_type_is_border(endpoint.endpoint_type): + map_endpoints_to_devices[(local_domain_uuid, endpoint_uuid)] = endpoint_id + + LOGGER.info('[map_abstract_endpoints_to_real] map_endpoints_to_devices={:s}'.format( + str({ + endpoint_tuple:grpc_message_to_json(endpoint_id) + for endpoint_tuple,endpoint_id in map_endpoints_to_devices.items() + }))) + + # map abstract device/endpoints to real device/endpoints + real_endpoint_ids = [] + for endpoint_id in abstract_endpoint_ids: + LOGGER.info('[map_abstract_endpoints_to_real] Mapping endpoint_id {:s} ...'.format( + grpc_message_to_json_string(endpoint_id))) + device_uuid = endpoint_id.device_id.device_uuid.uuid + endpoint_uuid = endpoint_id.endpoint_uuid.uuid + _endpoint_id = map_endpoints_to_devices.get((device_uuid, endpoint_uuid)) + if _endpoint_id is None: + LOGGER.warning('map_endpoints_to_devices={:s}'.format(str(map_endpoints_to_devices))) + MSG = 'Unable to map abstract EndPoint({:s}) to real one.' + raise Exception(MSG.format(grpc_message_to_json_string(endpoint_id))) + + LOGGER.info('[map_abstract_endpoints_to_real] ... to endpoint_id {:s}'.format( + grpc_message_to_json_string(_endpoint_id))) + real_endpoint_ids.append(_endpoint_id) + + return real_endpoint_ids diff --git a/src/interdomain/service/__init__.py b/src/interdomain/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/interdomain/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/interdomain/service/__main__.py b/src/interdomain/service/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..f4bdbb7b80ca3f355a92268e74d28e02f7883302 --- /dev/null +++ b/src/interdomain/service/__main__.py @@ -0,0 +1,85 @@ +# 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, signal, sys, threading +from prometheus_client import start_http_server +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, + wait_for_environment_variables) +from .topology_abstractor.TopologyAbstractor import TopologyAbstractor +from .InterdomainService import InterdomainService +from .RemoteDomainClients import RemoteDomainClients + +terminate = threading.Event() +LOGGER : logging.Logger = None + +def signal_handler(signal, frame): # pylint: disable=redefined-outer-name + LOGGER.warning('Terminate signal received') + terminate.set() + +def main(): + global LOGGER # pylint: disable=global-statement + + log_level = get_log_level() + logging.basicConfig(level=log_level, format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s") + LOGGER = logging.getLogger(__name__) + + wait_for_environment_variables([ + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + get_env_var_name(ServiceNameEnum.PATHCOMP, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.PATHCOMP, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + get_env_var_name(ServiceNameEnum.SLICE, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.SLICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + get_env_var_name(ServiceNameEnum.DLT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.DLT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + ]) + + signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGTERM, signal_handler) + + LOGGER.info('Starting...') + + # Start metrics server + metrics_port = get_metrics_port() + start_http_server(metrics_port) + + # Define remote domain clients + remote_domain_clients = RemoteDomainClients() + + # Starting Interdomain service + grpc_service = InterdomainService(remote_domain_clients) + grpc_service.start() + + # Subscribe to Context Events + topology_abstractor = TopologyAbstractor() + topology_abstractor.start() + + # TODO: improve with configuration the definition of the remote peers + #interdomain_service_port_grpc = get_service_port_grpc(ServiceNameEnum.INTERDOMAIN) + #remote_domain_clients.add_peer('remote-teraflow', 'remote-teraflow', interdomain_service_port_grpc) + + # Wait for Ctrl+C or termination signal + while not terminate.wait(timeout=0.1): pass + + LOGGER.info('Terminating...') + topology_abstractor.stop() + grpc_service.stop() + + LOGGER.info('Bye') + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/interdomain/service/_old_code/InterdomainServiceServicerImpl.py b/src/interdomain/service/_old_code/InterdomainServiceServicerImpl.py new file mode 100644 index 0000000000000000000000000000000000000000..e80f5c712ac2c47644cac609489761c67ffb69eb --- /dev/null +++ b/src/interdomain/service/_old_code/InterdomainServiceServicerImpl.py @@ -0,0 +1,149 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import grpc, logging +from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method +from common.proto.context_pb2 import ( + AuthenticationResult, Slice, SliceId, SliceStatus, SliceStatusEnum, TeraFlowController) +from common.proto.interdomain_pb2_grpc import InterdomainServiceServicer +#from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from interdomain.service.RemoteDomainClients import RemoteDomainClients +from slice.client.SliceClient import SliceClient + +LOGGER = logging.getLogger(__name__) + +METRICS_POOL = MetricsPool('Interdomain', 'RPC') + +class InterdomainServiceServicerImpl(InterdomainServiceServicer): + def __init__(self, remote_domain_clients : RemoteDomainClients): + LOGGER.debug('Creating Servicer...') + self.remote_domain_clients = remote_domain_clients + LOGGER.debug('Servicer Created') + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def RequestSlice(self, request : Slice, context : grpc.ServicerContext) -> SliceId: + context_client = ContextClient() + slice_client = SliceClient() + + domains_to_endpoints = {} + local_domain_uuid = None + for slice_endpoint_id in request.slice_endpoint_ids: + device_uuid = slice_endpoint_id.device_id.device_uuid.uuid + domain_uuid = device_uuid.split('@')[1] + endpoints = domains_to_endpoints.setdefault(domain_uuid, []) + endpoints.append(slice_endpoint_id) + if local_domain_uuid is None: local_domain_uuid = domain_uuid + + reply = Slice() + reply.CopyFrom(request) + + # decompose remote slices + for domain_uuid, slice_endpoint_ids in domains_to_endpoints.items(): + if domain_uuid == local_domain_uuid: continue + + remote_slice_request = Slice() + remote_slice_request.slice_id.context_id.context_uuid.uuid = request.slice_id.context_id.context_uuid.uuid + remote_slice_request.slice_id.slice_uuid.uuid = \ + request.slice_id.slice_uuid.uuid + ':subslice@' + local_domain_uuid + remote_slice_request.slice_status.slice_status = request.slice_status.slice_status + for endpoint_id in slice_endpoint_ids: + slice_endpoint_id = remote_slice_request.slice_endpoint_ids.add() + slice_endpoint_id.device_id.device_uuid.uuid = endpoint_id.device_id.device_uuid.uuid + slice_endpoint_id.endpoint_uuid.uuid = endpoint_id.endpoint_uuid.uuid + + # add endpoint connecting to remote domain + if domain_uuid == 'D1': + slice_endpoint_id = remote_slice_request.slice_endpoint_ids.add() + slice_endpoint_id.device_id.device_uuid.uuid = 'R4@D1' + slice_endpoint_id.endpoint_uuid.uuid = '2/1' + elif domain_uuid == 'D2': + slice_endpoint_id = remote_slice_request.slice_endpoint_ids.add() + slice_endpoint_id.device_id.device_uuid.uuid = 'R1@D2' + slice_endpoint_id.endpoint_uuid.uuid = '2/1' + + interdomain_client = self.remote_domain_clients.get_peer('remote-teraflow') + remote_slice_reply = interdomain_client.LookUpSlice(remote_slice_request) + if remote_slice_reply == remote_slice_request.slice_id: # pylint: disable=no-member + # successful case + remote_slice = interdomain_client.OrderSliceFromCatalog(remote_slice_request) + if remote_slice.slice_status.slice_status != SliceStatusEnum.SLICESTATUS_ACTIVE: + raise Exception('Remote Slice creation failed. Wrong Slice status returned') + else: + # not in catalog + remote_slice = interdomain_client.CreateSliceAndAddToCatalog(remote_slice_request) + if remote_slice.slice_status.slice_status != SliceStatusEnum.SLICESTATUS_ACTIVE: + raise Exception('Remote Slice creation failed. Wrong Slice status returned') + + #context_client.SetSlice(remote_slice) + #subslice_id = reply.slice_subslice_ids.add() + #subslice_id.CopyFrom(remote_slice.slice_id) + + local_slice_request = Slice() + local_slice_request.slice_id.context_id.context_uuid.uuid = request.slice_id.context_id.context_uuid.uuid + local_slice_request.slice_id.slice_uuid.uuid = request.slice_id.slice_uuid.uuid + ':subslice' + local_slice_request.slice_status.slice_status = request.slice_status.slice_status + for endpoint_id in domains_to_endpoints[local_domain_uuid]: + slice_endpoint_id = local_slice_request.slice_endpoint_ids.add() + slice_endpoint_id.CopyFrom(endpoint_id) + + # add endpoint connecting to remote domain + if local_domain_uuid == 'D1': + slice_endpoint_id = local_slice_request.slice_endpoint_ids.add() + slice_endpoint_id.device_id.device_uuid.uuid = 'R4@D1' + slice_endpoint_id.endpoint_uuid.uuid = '2/1' + elif local_domain_uuid == 'D2': + slice_endpoint_id = local_slice_request.slice_endpoint_ids.add() + slice_endpoint_id.device_id.device_uuid.uuid = 'R1@D2' + slice_endpoint_id.endpoint_uuid.uuid = '2/1' + + local_slice_id_reply = slice_client.CreateSlice(local_slice_request) + + subslice_id = reply.slice_subslice_ids.add() + subslice_id.context_id.context_uuid.uuid = local_slice_id_reply.context_id.context_uuid.uuid + subslice_id.slice_uuid.uuid = local_slice_id_reply.slice_uuid.uuid + + reply_slice_id = context_client.SetSlice(reply) + return reply_slice_id + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def Authenticate(self, request : TeraFlowController, context : grpc.ServicerContext) -> AuthenticationResult: + auth_result = AuthenticationResult() + auth_result.context_id.CopyFrom(request.context_id) # pylint: disable=no-member + auth_result.authenticated = True + return auth_result + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def LookUpSlice(self, request : Slice, context : grpc.ServicerContext) -> SliceId: + try: + context_client = ContextClient() + slice_ = context_client.GetSlice(request.slice_id) + return slice_.slice_id + except grpc.RpcError: + #LOGGER.exception('Unable to get slice({:s})'.format(grpc_message_to_json_string(request.slice_id))) + return SliceId() + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def OrderSliceFromCatalog(self, request : Slice, context : grpc.ServicerContext) -> Slice: + raise NotImplementedError('OrderSliceFromCatalog') + #return Slice() + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def CreateSliceAndAddToCatalog(self, request : Slice, context : grpc.ServicerContext) -> Slice: + context_client = ContextClient() + slice_client = SliceClient() + reply = slice_client.CreateSlice(request) + if reply != request.slice_id: # pylint: disable=no-member + raise Exception('Slice creation failed. Wrong Slice Id was returned') + return context_client.GetSlice(request.slice_id) diff --git a/src/interdomain/service/topology_abstractor/AbstractDevice.py b/src/interdomain/service/topology_abstractor/AbstractDevice.py new file mode 100644 index 0000000000000000000000000000000000000000..0de93daa8c6e7a77b696cdf437d6e870d33b3666 --- /dev/null +++ b/src/interdomain/service/topology_abstractor/AbstractDevice.py @@ -0,0 +1,190 @@ +# 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 +from typing import Dict, Optional +from common.Constants import DEFAULT_CONTEXT_NAME, INTERDOMAIN_TOPOLOGY_NAME +from common.DeviceTypes import DeviceTypeEnum +from common.proto.context_pb2 import ( + ContextId, Device, DeviceDriverEnum, DeviceId, DeviceOperationalStatusEnum, EndPoint) +from common.tools.context_queries.CheckType import ( + device_type_is_datacenter, device_type_is_network, endpoint_type_is_border) +from common.tools.context_queries.Device import add_device_to_topology, get_existing_device_uuids +from common.tools.object_factory.Context import json_context_id +from common.tools.object_factory.Device import json_device, json_device_id +from context.client.ContextClient import ContextClient + +LOGGER = logging.getLogger(__name__) + +class AbstractDevice: + def __init__(self, device_uuid : str, device_type : DeviceTypeEnum): + self.__context_client = ContextClient() + self.__device_uuid : str = device_uuid + self.__device_type : DeviceTypeEnum = device_type + self.__device : Optional[Device] = None + self.__device_id : Optional[DeviceId] = None + + # Dict[device_uuid, Dict[endpoint_uuid, abstract EndPoint]] + self.__device_endpoint_to_abstract : Dict[str, Dict[str, EndPoint]] = dict() + + # Dict[endpoint_uuid, device_uuid] + self.__abstract_endpoint_to_device : Dict[str, str] = dict() + + @property + def uuid(self) -> str: return self.__device_uuid + + @property + def device_id(self) -> Optional[DeviceId]: return self.__device_id + + @property + def device(self) -> Optional[Device]: return self.__device + + def get_endpoint(self, device_uuid : str, endpoint_uuid : str) -> Optional[EndPoint]: + return self.__device_endpoint_to_abstract.get(device_uuid, {}).get(endpoint_uuid) + + def initialize(self) -> bool: + if self.__device is not None: return False + + existing_device_uuids = get_existing_device_uuids(self.__context_client) + create_abstract_device = self.__device_uuid not in existing_device_uuids + + if create_abstract_device: + self._create_empty() + else: + self._load_existing() + + is_datacenter = device_type_is_datacenter(self.__device_type) + is_network = device_type_is_network(self.__device_type) + if is_datacenter or is_network: + # Add abstract device to topologies [INTERDOMAIN_TOPOLOGY_NAME] + context_id = ContextId(**json_context_id(DEFAULT_CONTEXT_NAME)) + topology_uuids = [INTERDOMAIN_TOPOLOGY_NAME] + for topology_uuid in topology_uuids: + add_device_to_topology(self.__context_client, context_id, topology_uuid, self.__device_uuid) + + # seems not needed; to be removed in future releases + #if is_datacenter and create_abstract_device: + # dc_device = self.__context_client.GetDevice(DeviceId(**json_device_id(self.__device_uuid))) + # if device_type_is_datacenter(dc_device.device_type): + # self.update_endpoints(dc_device) + #elif is_network: + # devices_in_admin_topology = get_devices_in_topology( + # self.__context_client, context_id, DEFAULT_TOPOLOGY_NAME) + # for device in devices_in_admin_topology: + # if device_type_is_datacenter(device.device_type): continue + # self.update_endpoints(device) + + return True + + def _create_empty(self) -> None: + device_uuid = self.__device_uuid + + device = Device(**json_device( + device_uuid, self.__device_type.value, DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED, + endpoints=[], config_rules=[], drivers=[DeviceDriverEnum.DEVICEDRIVER_UNDEFINED] + )) + self.__context_client.SetDevice(device) + self.__device = device + self.__device_id = self.__device.device_id + + def _load_existing(self) -> None: + self.__device_endpoint_to_abstract = dict() + self.__abstract_endpoint_to_device = dict() + + self.__device_id = DeviceId(**json_device_id(self.__device_uuid)) + self.__device = self.__context_client.GetDevice(self.__device_id) + self.__device_type = self.__device.device_type + device_uuid = self.__device_id.device_uuid.uuid + + device_type = self.__device_type + is_datacenter = device_type_is_datacenter(device_type) + is_network = device_type_is_network(device_type) + if not is_datacenter and not is_network: + LOGGER.warning('Unsupported InterDomain Device Type: {:s}'.format(str(device_type))) + return + + # for each endpoint in abstract device, populate internal data structures and mappings + for interdomain_endpoint in self.__device.device_endpoints: + endpoint_uuid : str = interdomain_endpoint.endpoint_id.endpoint_uuid.uuid + + if is_network: + endpoint_uuid,device_uuid = endpoint_uuid.split('@', maxsplit=1) + + self.__device_endpoint_to_abstract\ + .setdefault(device_uuid, {}).setdefault(endpoint_uuid, interdomain_endpoint) + self.__abstract_endpoint_to_device\ + .setdefault(endpoint_uuid, device_uuid) + + def _update_endpoint_type(self, device_uuid : str, endpoint_uuid : str, endpoint_type : str) -> bool: + device_endpoint_to_abstract = self.__device_endpoint_to_abstract.get(device_uuid, {}) + interdomain_endpoint = device_endpoint_to_abstract.get(endpoint_uuid) + interdomain_endpoint_type = interdomain_endpoint.endpoint_type + if endpoint_type == interdomain_endpoint_type: return False + interdomain_endpoint.endpoint_type = endpoint_type + return True + + def _add_endpoint(self, device_uuid : str, endpoint_uuid : str, endpoint_type : str) -> EndPoint: + interdomain_endpoint = self.__device.device_endpoints.add() + interdomain_endpoint.endpoint_id.device_id.CopyFrom(self.__device_id) + interdomain_endpoint.endpoint_id.endpoint_uuid.uuid = endpoint_uuid + interdomain_endpoint.endpoint_type = endpoint_type + + self.__device_endpoint_to_abstract\ + .setdefault(device_uuid, {}).setdefault(endpoint_uuid, interdomain_endpoint) + self.__abstract_endpoint_to_device\ + .setdefault(endpoint_uuid, device_uuid) + + return interdomain_endpoint + + def _remove_endpoint( + self, device_uuid : str, endpoint_uuid : str, interdomain_endpoint : EndPoint + ) -> None: + self.__abstract_endpoint_to_device.pop(endpoint_uuid, None) + device_endpoint_to_abstract = self.__device_endpoint_to_abstract.get(device_uuid, {}) + device_endpoint_to_abstract.pop(endpoint_uuid, None) + self.__device.device_endpoints.remove(interdomain_endpoint) + + def update_endpoints(self, device : Device) -> bool: + if device_type_is_datacenter(self.__device.device_type): return False + + device_uuid = device.device_id.device_uuid.uuid + device_border_endpoint_uuids = { + endpoint.endpoint_id.endpoint_uuid.uuid : endpoint.endpoint_type + for endpoint in device.device_endpoints + if endpoint_type_is_border(endpoint.endpoint_type) + } + + updated = False + + # for each border endpoint in abstract device that is not in device; remove from abstract device + device_endpoint_to_abstract = self.__device_endpoint_to_abstract.get(device_uuid, {}) + _device_endpoint_to_abstract = copy.deepcopy(device_endpoint_to_abstract) + for endpoint_uuid, interdomain_endpoint in _device_endpoint_to_abstract.items(): + if endpoint_uuid in device_border_endpoint_uuids: continue + # remove interdomain endpoint that is not in device + self._remove_endpoint(device_uuid, endpoint_uuid, interdomain_endpoint) + updated = True + + # for each border endpoint in device that is not in abstract device; add to abstract device + for endpoint_uuid,endpoint_type in device_border_endpoint_uuids.items(): + # if already added; just check endpoint type is not modified + if endpoint_uuid in self.__abstract_endpoint_to_device: + updated = updated or self._update_endpoint_type(device_uuid, endpoint_uuid, endpoint_type) + continue + + # otherwise, add it to the abstract device + self._add_endpoint(device_uuid, endpoint_uuid, endpoint_type) + updated = True + + return updated diff --git a/src/interdomain/service/topology_abstractor/AbstractLink.py b/src/interdomain/service/topology_abstractor/AbstractLink.py new file mode 100644 index 0000000000000000000000000000000000000000..bdab62476c709de7d3fa2c4de2dba687714aba77 --- /dev/null +++ b/src/interdomain/service/topology_abstractor/AbstractLink.py @@ -0,0 +1,126 @@ +# 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 +from typing import Dict, List, Optional, Tuple +from common.Constants import DEFAULT_CONTEXT_NAME, INTERDOMAIN_TOPOLOGY_NAME +from common.proto.context_pb2 import ContextId, EndPointId, Link, LinkId +from common.tools.context_queries.Link import add_link_to_topology, get_existing_link_uuids +from common.tools.object_factory.Context import json_context_id +from common.tools.object_factory.Link import json_link, json_link_id +from context.client.ContextClient import ContextClient + +LOGGER = logging.getLogger(__name__) + +class AbstractLink: + def __init__(self, link_uuid : str): + self.__context_client = ContextClient() + self.__link_uuid : str = link_uuid + self.__link : Optional[Link] = None + self.__link_id : Optional[LinkId] = None + + # Dict[(device_uuid, endpoint_uuid), abstract EndPointId] + self.__device_endpoint_to_abstract : Dict[Tuple[str, str], EndPointId] = dict() + + @property + def uuid(self) -> str: return self.__link_uuid + + @property + def link_id(self) -> Optional[LinkId]: return self.__link_id + + @property + def link(self) -> Optional[Link]: return self.__link + + @staticmethod + def compose_uuid( + device_uuid_a : str, endpoint_uuid_a : str, device_uuid_z : str, endpoint_uuid_z : str + ) -> str: + # sort endpoints lexicographically to prevent duplicities + link_endpoint_uuids = sorted([ + (device_uuid_a, endpoint_uuid_a), + (device_uuid_z, endpoint_uuid_z) + ]) + link_uuid = '{:s}/{:s}=={:s}/{:s}'.format( + link_endpoint_uuids[0][0], link_endpoint_uuids[0][1], + link_endpoint_uuids[1][0], link_endpoint_uuids[1][1]) + return link_uuid + + def initialize(self) -> bool: + if self.__link is not None: return False + + existing_link_uuids = get_existing_link_uuids(self.__context_client) + + create = self.__link_uuid not in existing_link_uuids + if create: + self._create_empty() + else: + self._load_existing() + + # Add abstract link to topologies [INTERDOMAIN_TOPOLOGY_NAME] + context_id = ContextId(**json_context_id(DEFAULT_CONTEXT_NAME)) + topology_uuids = [INTERDOMAIN_TOPOLOGY_NAME] + for topology_uuid in topology_uuids: + add_link_to_topology(self.__context_client, context_id, topology_uuid, self.__link_uuid) + + return create + + def _create_empty(self) -> None: + link = Link(**json_link(self.__link_uuid, endpoint_ids=[])) + self.__context_client.SetLink(link) + self.__link = link + self.__link_id = self.__link.link_id + + def _load_existing(self) -> None: + self.__link_id = LinkId(**json_link_id(self.__link_uuid)) + self.__link = self.__context_client.GetLink(self.__link_id) + + self.__device_endpoint_to_abstract = dict() + + # for each endpoint in abstract link, populate internal data structures and mappings + for endpoint_id in self.__link.link_endpoint_ids: + device_uuid : str = endpoint_id.device_id.device_uuid.uuid + endpoint_uuid : str = endpoint_id.endpoint_uuid.uuid + self.__device_endpoint_to_abstract.setdefault((device_uuid, endpoint_uuid), endpoint_id) + + def _add_endpoint(self, device_uuid : str, endpoint_uuid : str) -> None: + endpoint_id = self.__link.link_endpoint_ids.add() + endpoint_id.device_id.device_uuid.uuid = device_uuid + endpoint_id.endpoint_uuid.uuid = endpoint_uuid + self.__device_endpoint_to_abstract.setdefault((device_uuid, endpoint_uuid), endpoint_id) + + def _remove_endpoint(self, device_uuid : str, endpoint_uuid : str) -> None: + device_endpoint_to_abstract = self.__device_endpoint_to_abstract.get(device_uuid, {}) + endpoint_id = device_endpoint_to_abstract.pop(endpoint_uuid, None) + if endpoint_id is not None: self.__link.link_endpoint_ids.remove(endpoint_id) + + def update_endpoints(self, link_endpoint_uuids : List[Tuple[str, str]] = []) -> bool: + updated = False + + # for each endpoint in abstract link that is not in link; remove from abstract link + device_endpoint_to_abstract = copy.deepcopy(self.__device_endpoint_to_abstract) + for device_uuid, endpoint_uuid in device_endpoint_to_abstract.keys(): + if (device_uuid, endpoint_uuid) in link_endpoint_uuids: continue + # remove endpoint_id that is not in link + self._remove_endpoint(device_uuid, endpoint_uuid) + updated = True + + # for each endpoint in link that is not in abstract link; add to abstract link + for device_uuid, endpoint_uuid in link_endpoint_uuids: + # if already added; just check endpoint type is not modified + if (device_uuid, endpoint_uuid) in self.__device_endpoint_to_abstract: continue + # otherwise, add it to the abstract device + self._add_endpoint(device_uuid, endpoint_uuid) + updated = True + + return updated diff --git a/src/interdomain/service/topology_abstractor/DltRecordSender.py b/src/interdomain/service/topology_abstractor/DltRecordSender.py new file mode 100644 index 0000000000000000000000000000000000000000..d6efbc809ef848067d7ee496dca300ab8a04f406 --- /dev/null +++ b/src/interdomain/service/topology_abstractor/DltRecordSender.py @@ -0,0 +1,91 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging +from typing import Dict, List, Tuple +from common.proto.context_pb2 import Device, Link, Service, Slice, TopologyId +from common.proto.dlt_connector_pb2 import DltDeviceId, DltLinkId, DltServiceId, DltSliceId +from context.client.ContextClient import ContextClient +from dlt.connector.client.DltConnectorClient import DltConnectorClient +from .Types import DltRecordTypes + +LOGGER = logging.getLogger(__name__) + +class DltRecordSender: + def __init__(self, context_client : ContextClient, dlt_connector_client : DltConnectorClient) -> None: + self.context_client = context_client + self.dlt_connector_client = dlt_connector_client + self.dlt_record_uuids : List[str] = list() + self.dlt_record_uuid_to_data : Dict[str, Tuple[TopologyId, DltRecordTypes]] = dict() + + def _add_record(self, record_uuid : str, data : Tuple[TopologyId, DltRecordTypes]) -> None: + if record_uuid in self.dlt_record_uuid_to_data: return + self.dlt_record_uuid_to_data[record_uuid] = data + self.dlt_record_uuids.append(record_uuid) + + def add_device(self, topology_id : TopologyId, device : Device) -> None: + topology_uuid = topology_id.topology_uuid.uuid + device_uuid = device.device_id.device_uuid.uuid + record_uuid = '{:s}:device:{:s}'.format(topology_uuid, device_uuid) + self._add_record(record_uuid, (topology_id, device)) + + def add_link(self, topology_id : TopologyId, link : Link) -> None: + topology_uuid = topology_id.topology_uuid.uuid + link_uuid = link.link_id.link_uuid.uuid + record_uuid = '{:s}:link:{:s}'.format(topology_uuid, link_uuid) + self._add_record(record_uuid, (topology_id, link)) + + def add_service(self, topology_id : TopologyId, service : Service) -> None: + topology_uuid = topology_id.topology_uuid.uuid + context_uuid = service.service_id.context_id.context_uuid.uuid + service_uuid = service.service_id.service_uuid.uuid + record_uuid = '{:s}:service:{:s}/{:s}'.format(topology_uuid, context_uuid, service_uuid) + self._add_record(record_uuid, (topology_id, service)) + + def add_slice(self, topology_id : TopologyId, slice_ : Slice) -> None: + topology_uuid = topology_id.topology_uuid.uuid + context_uuid = slice_.slice_id.context_id.context_uuid.uuid + slice_uuid = slice_.slice_id.slice_uuid.uuid + record_uuid = '{:s}:slice:{:s}/{:s}'.format(topology_uuid, context_uuid, slice_uuid) + self._add_record(record_uuid, (topology_id, slice_)) + + def commit(self) -> None: + for dlt_record_uuid in self.dlt_record_uuids: + topology_id,dlt_record = self.dlt_record_uuid_to_data[dlt_record_uuid] + if isinstance(dlt_record, Device): + device_id = self.context_client.SetDevice(dlt_record) + dlt_device_id = DltDeviceId() + dlt_device_id.topology_id.CopyFrom(topology_id) # pylint: disable=no-member + dlt_device_id.device_id.CopyFrom(device_id) # pylint: disable=no-member + self.dlt_connector_client.RecordDevice(dlt_device_id) + elif isinstance(dlt_record, Link): + link_id = self.context_client.SetLink(dlt_record) + dlt_link_id = DltLinkId() + dlt_link_id.topology_id.CopyFrom(topology_id) # pylint: disable=no-member + dlt_link_id.link_id.CopyFrom(link_id) # pylint: disable=no-member + self.dlt_connector_client.RecordLink(dlt_link_id) + elif isinstance(dlt_record, Service): + service_id = self.context_client.SetService(dlt_record) + dlt_service_id = DltServiceId() + dlt_service_id.topology_id.CopyFrom(topology_id) # pylint: disable=no-member + dlt_service_id.service_id.CopyFrom(service_id) # pylint: disable=no-member + self.dlt_connector_client.RecordService(dlt_service_id) + elif isinstance(dlt_record, Slice): + slice_id = self.context_client.SetSlice(dlt_record) + dlt_slice_id = DltSliceId() + dlt_slice_id.topology_id.CopyFrom(topology_id) # pylint: disable=no-member + dlt_slice_id.slice_id.CopyFrom(slice_id) # pylint: disable=no-member + self.dlt_connector_client.RecordSlice(dlt_slice_id) + else: + LOGGER.error('Unsupported Record({:s})'.format(str(dlt_record))) diff --git a/src/interdomain/service/topology_abstractor/TopologyAbstractor.py b/src/interdomain/service/topology_abstractor/TopologyAbstractor.py new file mode 100644 index 0000000000000000000000000000000000000000..bdbf016f85a0c58969b7a58677f9695e2635c8c0 --- /dev/null +++ b/src/interdomain/service/topology_abstractor/TopologyAbstractor.py @@ -0,0 +1,288 @@ +# 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, threading +from typing import Dict, Optional, Tuple +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME, INTERDOMAIN_TOPOLOGY_NAME +from common.DeviceTypes import DeviceTypeEnum +from common.proto.context_pb2 import ( + ContextEvent, ContextId, Device, DeviceEvent, DeviceId, EndPoint, EndPointId, Link, LinkEvent, TopologyId, + TopologyEvent) +from common.tools.context_queries.CheckType import ( + device_type_is_datacenter, device_type_is_network, endpoint_type_is_border) +from common.tools.context_queries.Context import create_context +from common.tools.context_queries.Device import get_devices_in_topology, get_uuids_of_devices_in_topology +from common.tools.context_queries.Link import get_links_in_topology +from common.tools.context_queries.Topology import create_missing_topologies +from common.tools.grpc.Tools import grpc_message_to_json_string +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.Topology import json_topology_id +from context.client.ContextClient import ContextClient +from context.client.EventsCollector import EventsCollector +from dlt.connector.client.DltConnectorClient import DltConnectorClient +from .AbstractDevice import AbstractDevice +from .AbstractLink import AbstractLink +from .DltRecordSender import DltRecordSender +from .Types import EventTypes + +LOGGER = logging.getLogger(__name__) + +ADMIN_CONTEXT_ID = ContextId(**json_context_id(DEFAULT_CONTEXT_NAME)) +INTERDOMAIN_TOPOLOGY_ID = TopologyId(**json_topology_id(INTERDOMAIN_TOPOLOGY_NAME, context_id=ADMIN_CONTEXT_ID)) + +class TopologyAbstractor(threading.Thread): + def __init__(self) -> None: + super().__init__(daemon=True) + self.terminate = threading.Event() + + self.context_client = ContextClient() + self.dlt_connector_client = DltConnectorClient() + self.context_event_collector = EventsCollector(self.context_client) + + self.real_to_abstract_device_uuid : Dict[str, str] = dict() + self.real_to_abstract_link_uuid : Dict[str, str] = dict() + + self.abstract_device_to_topology_id : Dict[str, TopologyId] = dict() + self.abstract_link_to_topology_id : Dict[str, TopologyId] = dict() + + self.abstract_devices : Dict[str, AbstractDevice] = dict() + self.abstract_links : Dict[Tuple[str,str], AbstractLink] = dict() + + def stop(self): + self.terminate.set() + + def run(self) -> None: + self.context_client.connect() + create_context(self.context_client, DEFAULT_CONTEXT_NAME) + topology_uuids = [DEFAULT_TOPOLOGY_NAME, INTERDOMAIN_TOPOLOGY_NAME] + create_missing_topologies(self.context_client, ADMIN_CONTEXT_ID, topology_uuids) + + self.dlt_connector_client.connect() + self.context_event_collector.start() + + while not self.terminate.is_set(): + event = self.context_event_collector.get_event(timeout=0.1) + if event is None: continue + #if self.ignore_event(event): continue + LOGGER.info('Processing Event({:s})...'.format(grpc_message_to_json_string(event))) + self.update_abstraction(event) + + self.context_event_collector.stop() + self.context_client.close() + self.dlt_connector_client.close() + + #def ignore_event(self, event : EventTypes) -> List[DltRecordIdTypes]: + # # TODO: filter events resulting from abstraction computation + # # TODO: filter events resulting from updating remote abstractions + # if self.own_context_id is None: return False + # own_context_uuid = self.own_context_id.context_uuid.uuid + # + # if isinstance(event, ContextEvent): + # context_uuid = event.context_id.context_uuid.uuid + # return context_uuid == own_context_uuid + # elif isinstance(event, TopologyEvent): + # context_uuid = event.topology_id.context_id.context_uuid.uuid + # if context_uuid != own_context_uuid: return True + # topology_uuid = event.topology_id.topology_uuid.uuid + # if topology_uuid in {INTERDOMAIN_TOPOLOGY_NAME}: return True + # + # return False + + def _get_or_create_abstract_device( + self, device_uuid : str, device_type : DeviceTypeEnum, dlt_record_sender : DltRecordSender, + abstract_topology_id : TopologyId + ) -> AbstractDevice: + abstract_device = self.abstract_devices.get(device_uuid) + changed = False + if abstract_device is None: + abstract_device = AbstractDevice(device_uuid, device_type) + changed = abstract_device.initialize() + if changed: dlt_record_sender.add_device(abstract_topology_id, abstract_device.device) + self.abstract_devices[device_uuid] = abstract_device + self.abstract_device_to_topology_id[device_uuid] = abstract_topology_id + return abstract_device + + def _update_abstract_device( + self, device : Device, dlt_record_sender : DltRecordSender, abstract_topology_id : TopologyId, + abstract_device_uuid : Optional[str] = None + ) -> None: + device_uuid = device.device_id.device_uuid.uuid + if device_type_is_datacenter(device.device_type): + abstract_device_uuid = device_uuid + abstract_device = self._get_or_create_abstract_device( + device_uuid, DeviceTypeEnum.EMULATED_DATACENTER, dlt_record_sender, abstract_topology_id) + elif device_type_is_network(device.device_type): + LOGGER.warning('device_type is network; not implemented') + return + else: + abstract_device = self._get_or_create_abstract_device( + abstract_device_uuid, DeviceTypeEnum.NETWORK, dlt_record_sender, abstract_topology_id) + self.real_to_abstract_device_uuid[device_uuid] = abstract_device_uuid + changed = abstract_device.update_endpoints(device) + if changed: dlt_record_sender.add_device(abstract_topology_id, abstract_device.device) + + def _get_or_create_abstract_link( + self, link_uuid : str, dlt_record_sender : DltRecordSender, abstract_topology_id : TopologyId + ) -> AbstractLink: + abstract_link = self.abstract_links.get(link_uuid) + changed = False + if abstract_link is None: + abstract_link = AbstractLink(link_uuid) + changed = abstract_link.initialize() + if changed: dlt_record_sender.add_link(abstract_topology_id, abstract_link.link) + self.abstract_links[link_uuid] = abstract_link + self.abstract_link_to_topology_id[link_uuid] = abstract_topology_id + return abstract_link + + def _get_link_endpoint_data(self, endpoint_id : EndPointId) -> Optional[Tuple[AbstractDevice, EndPoint]]: + device_uuid : str = endpoint_id.device_id.device_uuid.uuid + endpoint_uuid : str = endpoint_id.endpoint_uuid.uuid + abstract_device_uuid = self.real_to_abstract_device_uuid.get(device_uuid) + if abstract_device_uuid is None: return None + abstract_device = self.abstract_devices.get(abstract_device_uuid) + if abstract_device is None: return None + endpoint = abstract_device.get_endpoint(device_uuid, endpoint_uuid) + if endpoint is None: return None + return abstract_device, endpoint + + def _compute_abstract_link(self, link : Link) -> Optional[str]: + if len(link.link_endpoint_ids) != 2: return None + + link_endpoint_data_A = self._get_link_endpoint_data(link.link_endpoint_ids[0]) + if link_endpoint_data_A is None: return None + abstract_device_A, endpoint_A = link_endpoint_data_A + if not endpoint_type_is_border(endpoint_A.endpoint_type): return None + + link_endpoint_data_Z = self._get_link_endpoint_data(link.link_endpoint_ids[-1]) + if link_endpoint_data_Z is None: return None + abstract_device_Z, endpoint_Z = link_endpoint_data_Z + if not endpoint_type_is_border(endpoint_Z.endpoint_type): return None + + link_uuid = AbstractLink.compose_uuid( + abstract_device_A.uuid, endpoint_A.endpoint_id.endpoint_uuid.uuid, + abstract_device_Z.uuid, endpoint_Z.endpoint_id.endpoint_uuid.uuid + ) + + # sort endpoints lexicographically to prevent duplicities + link_endpoint_uuids = sorted([ + (abstract_device_A.uuid, endpoint_A.endpoint_id.endpoint_uuid.uuid), + (abstract_device_Z.uuid, endpoint_Z.endpoint_id.endpoint_uuid.uuid) + ]) + + return link_uuid, link_endpoint_uuids + + def _update_abstract_link( + self, link : Link, dlt_record_sender : DltRecordSender, abstract_topology_id : TopologyId + ) -> None: + abstract_link_specs = self._compute_abstract_link(link) + if abstract_link_specs is None: return + abstract_link_uuid, link_endpoint_uuids = abstract_link_specs + + abstract_link = self._get_or_create_abstract_link(abstract_link_uuid, dlt_record_sender, abstract_topology_id) + link_uuid = link.link_id.link_uuid.uuid + self.real_to_abstract_link_uuid[link_uuid] = abstract_link_uuid + changed = abstract_link.update_endpoints(link_endpoint_uuids) + if changed: dlt_record_sender.add_link(abstract_topology_id, abstract_link.link) + + def _infer_abstract_links(self, device : Device, dlt_record_sender : DltRecordSender) -> None: + device_uuid = device.device_id.device_uuid.uuid + + interdomain_device_uuids = get_uuids_of_devices_in_topology( + self.context_client, ADMIN_CONTEXT_ID, INTERDOMAIN_TOPOLOGY_NAME) + + for endpoint in device.device_endpoints: + if not endpoint_type_is_border(endpoint.endpoint_type): continue + endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid + + abstract_link_uuid = AbstractLink.compose_uuid(device_uuid, endpoint_uuid, endpoint_uuid, device_uuid) + if abstract_link_uuid in self.abstract_links: continue + + if endpoint_uuid not in interdomain_device_uuids: continue + remote_device = self.context_client.GetDevice(DeviceId(**json_device_id(endpoint_uuid))) + remote_device_border_endpoint_uuids = { + endpoint.endpoint_id.endpoint_uuid.uuid : endpoint.endpoint_type + for endpoint in remote_device.device_endpoints + if endpoint_type_is_border(endpoint.endpoint_type) + } + if device_uuid not in remote_device_border_endpoint_uuids: continue + + link_endpoint_uuids = sorted([(device_uuid, endpoint_uuid), (endpoint_uuid, device_uuid)]) + + abstract_link = self._get_or_create_abstract_link( + abstract_link_uuid, dlt_record_sender, INTERDOMAIN_TOPOLOGY_ID) + changed = abstract_link.update_endpoints(link_endpoint_uuids) + if changed: dlt_record_sender.add_link(INTERDOMAIN_TOPOLOGY_ID, abstract_link.link) + + def update_abstraction(self, event : EventTypes) -> None: + dlt_record_sender = DltRecordSender(self.context_client, self.dlt_connector_client) + + if isinstance(event, ContextEvent): + LOGGER.warning('Ignoring Event({:s})'.format(grpc_message_to_json_string(event))) + + elif isinstance(event, TopologyEvent): + topology_id = event.topology_id + topology_uuid = topology_id.topology_uuid.uuid + context_id = topology_id.context_id + context_uuid = context_id.context_uuid.uuid + topology_uuids = {DEFAULT_TOPOLOGY_NAME, INTERDOMAIN_TOPOLOGY_NAME} + if (context_uuid == DEFAULT_CONTEXT_NAME) and (topology_uuid not in topology_uuids): + abstract_topology_id = TopologyId(**json_topology_id(topology_uuid, context_id=ADMIN_CONTEXT_ID)) + self._get_or_create_abstract_device( + topology_uuid, DeviceTypeEnum.NETWORK, dlt_record_sender, abstract_topology_id) + + devices = get_devices_in_topology(self.context_client, context_id, topology_uuid) + for device in devices: + self._update_abstract_device( + device, dlt_record_sender, abstract_topology_id, abstract_device_uuid=topology_uuid) + + links = get_links_in_topology(self.context_client, context_id, topology_uuid) + for link in links: + self._update_abstract_link(link, dlt_record_sender, abstract_topology_id) + + for device in devices: + self._infer_abstract_links(device, dlt_record_sender) + + else: + LOGGER.warning('Ignoring Event({:s})'.format(grpc_message_to_json_string(event))) + + elif isinstance(event, DeviceEvent): + device_id = event.device_id + device_uuid = device_id.device_uuid.uuid + abstract_device_uuid = self.real_to_abstract_device_uuid.get(device_uuid) + device = self.context_client.GetDevice(device_id) + if abstract_device_uuid is None: + LOGGER.warning('Ignoring Event({:s})'.format(grpc_message_to_json_string(event))) + else: + abstract_topology_id = self.abstract_device_to_topology_id[abstract_device_uuid] + self._update_abstract_device( + device, dlt_record_sender, abstract_topology_id, abstract_device_uuid=abstract_device_uuid) + + self._infer_abstract_links(device, dlt_record_sender) + + elif isinstance(event, LinkEvent): + link_id = event.link_id + link_uuid = link_id.link_uuid.uuid + abstract_link_uuid = self.real_to_abstract_link_uuid.get(link_uuid) + if abstract_link_uuid is None: + LOGGER.warning('Ignoring Event({:s})'.format(grpc_message_to_json_string(event))) + else: + abstract_topology_id = self.abstract_link_to_topology_id[abstract_link_uuid] + link = self.context_client.GetLink(link_id) + self._update_abstract_link(link, dlt_record_sender, abstract_topology_id) + + else: + LOGGER.warning('Unsupported Event({:s})'.format(grpc_message_to_json_string(event))) + + dlt_record_sender.commit() diff --git a/src/interdomain/service/topology_abstractor/Types.py b/src/interdomain/service/topology_abstractor/Types.py new file mode 100644 index 0000000000000000000000000000000000000000..fa1d135da932481cc19df9286a0af7fa62aff348 --- /dev/null +++ b/src/interdomain/service/topology_abstractor/Types.py @@ -0,0 +1,25 @@ +# 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 typing import Union +from common.proto.context_pb2 import ( + ConnectionEvent, ContextEvent, Device, DeviceEvent, DeviceId, Link, LinkEvent, LinkId, Service, ServiceEvent, + ServiceId, Slice, SliceEvent, SliceId, TopologyEvent) + +DltRecordIdTypes = Union[DeviceId, LinkId, SliceId, ServiceId] +DltRecordTypes = Union[Device, Link, Slice, Service] + +EventTypes = Union[ + ContextEvent, TopologyEvent, DeviceEvent, LinkEvent, ServiceEvent, SliceEvent, ConnectionEvent +] diff --git a/src/interdomain/service/topology_abstractor/__init__.py b/src/interdomain/service/topology_abstractor/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/interdomain/service/topology_abstractor/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/interdomain/tests/__init__.py b/src/interdomain/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/interdomain/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/interdomain/tests/test_unitary.py b/src/interdomain/tests/test_unitary.py new file mode 100644 index 0000000000000000000000000000000000000000..403dea54334da54a794b6da40dd64d1e6e856034 --- /dev/null +++ b/src/interdomain/tests/test_unitary.py @@ -0,0 +1,143 @@ +# 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, grpc +#import os +#import sqlite3 +# +#import pytest +#from typing import Tuple +# +#from interdomain.proto import context_pb2, kpi_sample_types_pb2, monitoring_pb2 +#from interdomain.client.interdomain_client import InterdomainClient +#from interdomain.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD +#from interdomain.service.InterdomainService import InterdomainService +# +#from common.orm.Database import Database +#from common.orm.Factory import get_database_backend, BackendEnum as DatabaseBackendEnum +#from common.message_broker.Factory import get_messagebroker_backend, BackendEnum as MessageBrokerBackendEnum +#from common.message_broker.MessageBroker import MessageBroker +# +#LOGGER = logging.getLogger(__name__) +#LOGGER.setLevel(logging.DEBUG) +# +############################ +## Tests Setup +############################ +# +#SERVER_ADDRESS = '127.0.0.1' +#LISTEN_ADDRESS = '[::]' +#GRPC_PORT_MONITORING = 9090 +# +#GRPC_PORT_CONTEXT = 10000 + grpc_port_context # avoid privileged ports +# +#SCENARIOS = [ # comment/uncomment scenarios to activate/deactivate them in the test unit +# ('all_inmemory', DatabaseBackendEnum.INMEMORY, {}, MessageBrokerBackendEnum.INMEMORY, {} ), +#] +# +# +## This fixture will be requested by test cases and last during testing session +#@pytest.fixture(scope='session') +#def interdomain_service(): +# LOGGER.warning('interdomain_service begin') +# +# interdomain_port = GRPC_INTERDOMAIN_PORT +# max_workers = GRPC_MAX_WORKERS +# grace_period = GRPC_GRACE_PERIOD +# +# LOGGER.info('Initializing InterdomainService...') +# grpc_service = InterdomainService(port=interdomain_port, max_workers=max_workers, grace_period=grace_period) +# server = grpc_service.start() +# +# # yield the server, when test finishes, execution will resume to stop it +# LOGGER.warning('interdomain_service yielding') +# yield server +# +# LOGGER.info('Terminating InterdomainService...') +# grpc_service.stop() +# +## This fixture will be requested by test cases and last during testing session. +## The client requires the server, so client fixture has the server as dependency. +#@pytest.fixture(scope='session') +#def interdomain_client(interdomain_service): +# LOGGER.warning('interdomain_client begin') +# client = InterdomainClient(server=SERVER_ADDRESS, port=GRPC_PORT_INTERDOMAIN) # instantiate the client +# LOGGER.warning('interdomain_client returning') +# return client +# +## This fixture will be requested by test cases and last during testing session. +#@pytest.fixture(scope='session') +#def create_TeraFlowController(): +# LOGGER.warning('create_TeraFlowController begin') +# # form request +# tf_ctl = context_pb2.TeraFlowController() +# tf_ctl.context_id = context_pb2.ContextId() +# tf_ctl.context_id.context_uuid = context_pb2.Uuid() +# tf_ctl.context_id.context_uuid.uuid = str(1) +# tf_ctl.ip_address = "127.0.0.1" +# tf_ctl.port = 9090 +# return tf_ctl +# +#@pytest.fixture(scope='session') +#def create_TransportSlice(): +# LOGGER.warning('create_TransportSlice begin') +# +# # form request +# slice_req = slice_pb2.TransportSlice() +# slice_req.contextId = context_pb2.ContextId() +# slice_req.contextId.context_uuid = context_pb2.Uuid() +# slice_req.contextId.context_uuid.uuid = str(1) +# slice_req.slice_id = context_pb2.Uuid() +# slice_req.slice_id.context_uuid.uuid = str(1) +# +# return slice_req +# +# +############################ +## Tests Implementation +############################ +# +# +## Test case that makes use of client fixture to test server's CreateKpi method +#def test_Authenticate(interdomain_client,create_TeraFlowController): +# # make call to server +# LOGGER.warning('test_Authenticate requesting') +# response = interdomain_client.Authenticate(create_TeraFlowController) +# LOGGER.debug(str(response)) +# assert isinstance(response, context.AuthenticationResult) +# +## Test case that makes use of client fixture to test server's MonitorKpi method +#def test_LookUpSlice(interdomain_client,create_TransportSlice): +# LOGGER.warning('test_LookUpSlice begin') +# +# response = interdomain_client.LookUpSlice(create_TransportSlice) +# LOGGER.debug(str(response)) +# assert isinstance(response, slice.SliceId) +# +## Test case that makes use of client fixture to test server's GetStreamKpi method +#def test_CreateSliceAndAddToCatalog(interdomain_client,create_TransportSlice): +# LOGGER.warning('test_CreateSliceAndAddToCatalog begin') +# response = interdomain_client.CreateSliceAndAddToCatalog(create_TransportSlice) +# LOGGER.debug(str(response)) +# assert isinstance(response, slice.SliceId) +# +## Test case that makes use of client fixture to test server's IncludeKpi method +#def test_OrderSliceFromCatalog(interdomain_client,create_TransportSlice): +# # make call to server +# LOGGER.warning('test_OrderSliceFromCatalog requesting') +# response = interdomain_client.OrderSliceFromCatalog(create_TransportSlice) +# LOGGER.debug(str(response)) +# assert isinstance(response, slice.SliceId) +# diff --git a/src/l3_attackmitigator/.gitlab-ci.yml b/src/l3_attackmitigator/.gitlab-ci.yml index dbf8d90fcbcb38a0574de4130b4181e77cf5afd6..c43b553a406bdbaf4cf77f80360469b87dd1c3e4 100644 --- a/src/l3_attackmitigator/.gitlab-ci.yml +++ b/src/l3_attackmitigator/.gitlab-ci.yml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Build, tag, and push the Docker images to the GitLab Docker registry +# Build, tag, and push the Docker image to the GitLab Docker registry build l3_attackmitigator: variables: IMAGE_NAME: 'l3_attackmitigator' # name of the microservice @@ -21,22 +21,24 @@ build l3_attackmitigator: before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile . - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" after_script: - docker images --filter="dangling=true" --quiet | xargs -r docker rmi rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: + - src/common/**/*.py + - proto/*.proto - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml -# Pull, execute, and run unitary tests for the Docker image from the GitLab registry +# Apply unit test to the component unit test l3_attackmitigator: variables: IMAGE_NAME: 'l3_attackmitigator' # name of the microservice @@ -46,7 +48,7 @@ unit test l3_attackmitigator: - build l3_attackmitigator before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi + - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi script: - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" @@ -55,7 +57,6 @@ unit test l3_attackmitigator: - docker ps -a - docker logs $IMAGE_NAME - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" - - docker exec -i $IMAGE_NAME bash -c "coverage xml -o /opt/results/${IMAGE_NAME}_coverage.xml" - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: @@ -63,8 +64,10 @@ unit test l3_attackmitigator: - docker network rm teraflowbridge rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: + - src/common/**/*.py + - proto/*.proto - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py @@ -75,7 +78,6 @@ unit test l3_attackmitigator: when: always reports: junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml - cobertura: src/$IMAGE_NAME/tests/${IMAGE_NAME}_coverage.xml # Deployment of the service in Kubernetes Cluster deploy l3_attackmitigator: diff --git a/src/l3_attackmitigator/Config.py b/src/l3_attackmitigator/Config.py index 429977bc585a01fb288aab121cdb3cedb8fa9ac0..fafeb8d11d1ec5e5dd2da16c699161ea03f4995d 100644 --- a/src/l3_attackmitigator/Config.py +++ b/src/l3_attackmitigator/Config.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/l3_attackmitigator/Dockerfile b/src/l3_attackmitigator/Dockerfile index 2ed76a70b6ca0e2a140cb926b3343aab7fed37a5..da9ed75ad4f627b5f5f54d21c2f1a8544a600e03 100644 --- a/src/l3_attackmitigator/Dockerfile +++ b/src/l3_attackmitigator/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM python:3-slim +FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ @@ -28,22 +28,41 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ chmod +x /bin/grpc_health_probe # Get generic Python packages -RUN python3 -m pip install --upgrade pip setuptools wheel pip-tools +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools -# Set working directory +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components WORKDIR /var/teraflow +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt -# Create module sub-folders -RUN mkdir -p /var/teraflow/l3_attackmitigator +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto + +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; -# Get Python packages per module -COPY l3_attackmitigator/requirements.in l3_attackmitigator/requirements.in -RUN pip-compile --output-file=l3_attackmitigator/requirements.txt l3_attackmitigator/requirements.in -RUN python3 -m pip install -r l3_attackmitigator/requirements.in +# Create component sub-folders, get specific Python packages +RUN mkdir -p /var/teraflow/l3_attackmitigator +WORKDIR /var/teraflow/l3_attackmitigator +COPY src/l3_attackmitigator/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN python3 -m pip install -r requirements.txt -# Add files into working directory -COPY common/. common -COPY l3_attackmitigator/. l3_attackmitigator +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/l3_attackmitigator/. l3_attackmitigator -# Start service service +# Start the service ENTRYPOINT ["python", "-m", "l3_attackmitigator.service"] diff --git a/src/l3_attackmitigator/__init__.py b/src/l3_attackmitigator/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/l3_attackmitigator/__init__.py +++ b/src/l3_attackmitigator/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/l3_attackmitigator/client/__init__.py b/src/l3_attackmitigator/client/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/l3_attackmitigator/client/__init__.py +++ b/src/l3_attackmitigator/client/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/l3_attackmitigator/client/l3_attackmitigatorClient.py b/src/l3_attackmitigator/client/l3_attackmitigatorClient.py index ba061c15d7f27383aefec63a92b15557d803fb80..fad553cc25ce655ed6ba6435b6511cf440774950 100644 --- a/src/l3_attackmitigator/client/l3_attackmitigatorClient.py +++ b/src/l3_attackmitigator/client/l3_attackmitigatorClient.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,10 +14,10 @@ import grpc, logging from common.tools.client.RetryDecorator import retry, delay_exponential -from l3_attackmitigator.proto.l3_attackmitigator_pb2_grpc import ( +from common.proto.l3_attackmitigator_pb2_grpc import ( L3AttackmitigatorStub, ) -from l3_attackmitigator.proto.l3_attackmitigator_pb2 import ( +from common.proto.l3_attackmitigator_pb2 import ( Output, EmptyMitigator ) diff --git a/src/l3_attackmitigator/proto/__init__.py b/src/l3_attackmitigator/proto/__init__.py deleted file mode 100644 index 70a33251242c51f49140e596b8208a19dd5245f7..0000000000000000000000000000000000000000 --- a/src/l3_attackmitigator/proto/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - diff --git a/src/l3_attackmitigator/proto/l3_attackmitigator_pb2.py b/src/l3_attackmitigator/proto/l3_attackmitigator_pb2.py deleted file mode 100644 index 0ad49c2ed33f8f352f200cf23c2b871683b9d086..0000000000000000000000000000000000000000 --- a/src/l3_attackmitigator/proto/l3_attackmitigator_pb2.py +++ /dev/null @@ -1,248 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: l3_attackmitigator.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='l3_attackmitigator.proto', - package='', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x18l3_attackmitigator.proto\"2\n\x0e\x45mptyMitigator\x12\x14\n\x07message\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_message\"\xf9\x01\n\x06Output\x12\x12\n\nconfidence\x18\x01 \x01(\x02\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x0c\n\x04ip_o\x18\x03 \x01(\t\x12\x10\n\x08tag_name\x18\x04 \x01(\t\x12\x0b\n\x03tag\x18\x05 \x01(\x05\x12\x0f\n\x07\x66low_id\x18\x06 \x01(\t\x12\x10\n\x08protocol\x18\x07 \x01(\t\x12\x0e\n\x06port_d\x18\x08 \x01(\t\x12\x12\n\x05ml_id\x18\t \x01(\tH\x00\x88\x01\x01\x12\x17\n\ntime_start\x18\n \x01(\x02H\x01\x88\x01\x01\x12\x15\n\x08time_end\x18\x0b \x01(\x02H\x02\x88\x01\x01\x42\x08\n\x06_ml_idB\r\n\x0b_time_startB\x0b\n\t_time_end2r\n\x11L3Attackmitigator\x12(\n\nSendOutput\x12\x07.Output\x1a\x0f.EmptyMitigator\"\x00\x12\x33\n\rGetMitigation\x12\x0f.EmptyMitigator\x1a\x0f.EmptyMitigator\"\x00\x62\x06proto3' -) - - - - -_EMPTYMITIGATOR = _descriptor.Descriptor( - name='EmptyMitigator', - full_name='EmptyMitigator', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='message', full_name='EmptyMitigator.message', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_message', full_name='EmptyMitigator._message', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=28, - serialized_end=78, -) - - -_OUTPUT = _descriptor.Descriptor( - name='Output', - full_name='Output', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='confidence', full_name='Output.confidence', index=0, - number=1, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='timestamp', full_name='Output.timestamp', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_o', full_name='Output.ip_o', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='tag_name', full_name='Output.tag_name', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='tag', full_name='Output.tag', index=4, - number=5, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='flow_id', full_name='Output.flow_id', index=5, - number=6, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='protocol', full_name='Output.protocol', index=6, - number=7, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port_d', full_name='Output.port_d', index=7, - number=8, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ml_id', full_name='Output.ml_id', index=8, - number=9, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_start', full_name='Output.time_start', index=9, - number=10, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_end', full_name='Output.time_end', index=10, - number=11, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_ml_id', full_name='Output._ml_id', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_start', full_name='Output._time_start', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_end', full_name='Output._time_end', - index=2, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=81, - serialized_end=330, -) - -_EMPTYMITIGATOR.oneofs_by_name['_message'].fields.append( - _EMPTYMITIGATOR.fields_by_name['message']) -_EMPTYMITIGATOR.fields_by_name['message'].containing_oneof = _EMPTYMITIGATOR.oneofs_by_name['_message'] -_OUTPUT.oneofs_by_name['_ml_id'].fields.append( - _OUTPUT.fields_by_name['ml_id']) -_OUTPUT.fields_by_name['ml_id'].containing_oneof = _OUTPUT.oneofs_by_name['_ml_id'] -_OUTPUT.oneofs_by_name['_time_start'].fields.append( - _OUTPUT.fields_by_name['time_start']) -_OUTPUT.fields_by_name['time_start'].containing_oneof = _OUTPUT.oneofs_by_name['_time_start'] -_OUTPUT.oneofs_by_name['_time_end'].fields.append( - _OUTPUT.fields_by_name['time_end']) -_OUTPUT.fields_by_name['time_end'].containing_oneof = _OUTPUT.oneofs_by_name['_time_end'] -DESCRIPTOR.message_types_by_name['EmptyMitigator'] = _EMPTYMITIGATOR -DESCRIPTOR.message_types_by_name['Output'] = _OUTPUT -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -EmptyMitigator = _reflection.GeneratedProtocolMessageType('EmptyMitigator', (_message.Message,), { - 'DESCRIPTOR' : _EMPTYMITIGATOR, - '__module__' : 'l3_attackmitigator_pb2' - # @@protoc_insertion_point(class_scope:EmptyMitigator) - }) -_sym_db.RegisterMessage(EmptyMitigator) - -Output = _reflection.GeneratedProtocolMessageType('Output', (_message.Message,), { - 'DESCRIPTOR' : _OUTPUT, - '__module__' : 'l3_attackmitigator_pb2' - # @@protoc_insertion_point(class_scope:Output) - }) -_sym_db.RegisterMessage(Output) - - - -_L3ATTACKMITIGATOR = _descriptor.ServiceDescriptor( - name='L3Attackmitigator', - full_name='L3Attackmitigator', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=332, - serialized_end=446, - methods=[ - _descriptor.MethodDescriptor( - name='SendOutput', - full_name='L3Attackmitigator.SendOutput', - index=0, - containing_service=None, - input_type=_OUTPUT, - output_type=_EMPTYMITIGATOR, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetMitigation', - full_name='L3Attackmitigator.GetMitigation', - index=1, - containing_service=None, - input_type=_EMPTYMITIGATOR, - output_type=_EMPTYMITIGATOR, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_L3ATTACKMITIGATOR) - -DESCRIPTOR.services_by_name['L3Attackmitigator'] = _L3ATTACKMITIGATOR - -# @@protoc_insertion_point(module_scope) diff --git a/src/l3_attackmitigator/proto/l3_attackmitigator_pb2_grpc.py b/src/l3_attackmitigator/proto/l3_attackmitigator_pb2_grpc.py deleted file mode 100644 index 3942d6843f99a341c8a6db7028e0d62a74d8ddb2..0000000000000000000000000000000000000000 --- a/src/l3_attackmitigator/proto/l3_attackmitigator_pb2_grpc.py +++ /dev/null @@ -1,102 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - - -from . import l3_attackmitigator_pb2 as l3__attackmitigator__pb2 - - -class L3AttackmitigatorStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.SendOutput = channel.unary_unary( - '/L3Attackmitigator/SendOutput', - request_serializer=l3__attackmitigator__pb2.Output.SerializeToString, - response_deserializer=l3__attackmitigator__pb2.EmptyMitigator.FromString, - ) - self.GetMitigation = channel.unary_unary( - '/L3Attackmitigator/GetMitigation', - request_serializer=l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, - response_deserializer=l3__attackmitigator__pb2.EmptyMitigator.FromString, - ) - - -class L3AttackmitigatorServicer(object): - """Missing associated documentation comment in .proto file.""" - - def SendOutput(self, request, context): - """Sends a greeting - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetMitigation(self, request, context): - """Sends another greeting - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_L3AttackmitigatorServicer_to_server(servicer, server): - rpc_method_handlers = { - 'SendOutput': grpc.unary_unary_rpc_method_handler( - servicer.SendOutput, - request_deserializer=l3__attackmitigator__pb2.Output.FromString, - response_serializer=l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, - ), - 'GetMitigation': grpc.unary_unary_rpc_method_handler( - servicer.GetMitigation, - request_deserializer=l3__attackmitigator__pb2.EmptyMitigator.FromString, - response_serializer=l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'L3Attackmitigator', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class L3Attackmitigator(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def SendOutput(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/L3Attackmitigator/SendOutput', - l3__attackmitigator__pb2.Output.SerializeToString, - l3__attackmitigator__pb2.EmptyMitigator.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetMitigation(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/L3Attackmitigator/GetMitigation', - l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, - l3__attackmitigator__pb2.EmptyMitigator.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/l3_attackmitigator/requirements.in b/src/l3_attackmitigator/requirements.in index ede9c839d93cc377e93c525bc1e85243576faa00..a8aba849708799232f6b0732c3661396266da329 100644 --- a/src/l3_attackmitigator/requirements.in +++ b/src/l3_attackmitigator/requirements.in @@ -1,9 +1,15 @@ -grpcio-health-checking -grpcio -grpcio-tools -prometheus-client -pytest -pytest-benchmark -numpy -scikit-learn -coverage \ No newline at end of file +# 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. + +# no extra dependency diff --git a/src/l3_attackmitigator/service/__init__.py b/src/l3_attackmitigator/service/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/l3_attackmitigator/service/__init__.py +++ b/src/l3_attackmitigator/service/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/l3_attackmitigator/service/__main__.py b/src/l3_attackmitigator/service/__main__.py index ac2ff528ae2df5d0604978534a256e111080d181..1e91d5e9729f027b096afa97d1808795193dc2fa 100644 --- a/src/l3_attackmitigator/service/__main__.py +++ b/src/l3_attackmitigator/service/__main__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/l3_attackmitigator/service/l3_attackmitigatorService.py b/src/l3_attackmitigator/service/l3_attackmitigatorService.py index ae52d6285c74e121f6062c42de69597d05c37b45..84ab811ef944808e042712191dfef7d2646f4926 100644 --- a/src/l3_attackmitigator/service/l3_attackmitigatorService.py +++ b/src/l3_attackmitigator/service/l3_attackmitigatorService.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ from concurrent import futures from grpc_health.v1.health import HealthServicer, OVERALL_HEALTH from grpc_health.v1.health_pb2 import HealthCheckResponse from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server -from l3_attackmitigator.proto.l3_attackmitigator_pb2_grpc import ( +from common.proto.l3_attackmitigator_pb2_grpc import ( add_L3AttackmitigatorServicer_to_server, ) from l3_attackmitigator.service.l3_attackmitigatorServiceServicerImpl import ( diff --git a/src/l3_attackmitigator/service/l3_attackmitigatorServiceServicerImpl.py b/src/l3_attackmitigator/service/l3_attackmitigatorServiceServicerImpl.py index 6e74cd455b8a166802f2a1f781451a0aa5e743ca..b697a83ff43c28a9051fb6465db3803ca1c068d8 100644 --- a/src/l3_attackmitigator/service/l3_attackmitigatorServiceServicerImpl.py +++ b/src/l3_attackmitigator/service/l3_attackmitigatorServiceServicerImpl.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,10 +14,10 @@ from __future__ import print_function import logging -from l3_attackmitigator.proto.l3_attackmitigator_pb2 import ( +from common.proto.l3_attackmitigator_pb2 import ( EmptyMitigator ) -from l3_attackmitigator.proto.l3_attackmitigator_pb2_grpc import ( +from common.proto.l3_attackmitigator_pb2_grpc import ( L3AttackmitigatorServicer, ) diff --git a/src/l3_attackmitigator/tests/__init__.py b/src/l3_attackmitigator/tests/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/l3_attackmitigator/tests/__init__.py +++ b/src/l3_attackmitigator/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/l3_attackmitigator/tests/test_unitary.py b/src/l3_attackmitigator/tests/test_unitary.py index 7a33cbd8a29c8d64ca468ac366d38bdc7199aacd..8f048f876e28ac1fcd8517690056c71afe685f8e 100644 --- a/src/l3_attackmitigator/tests/test_unitary.py +++ b/src/l3_attackmitigator/tests/test_unitary.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ import pytest from l3_attackmitigator.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD from l3_attackmitigator.client.l3_attackmitigatorClient import l3_attackmitigatorClient from l3_attackmitigator.service.l3_attackmitigatorService import l3_attackmitigatorService -from l3_attackmitigator.proto.l3_attackmitigator_pb2 import ( +from common.proto.l3_attackmitigator_pb2 import ( Output, ) diff --git a/src/l3_centralizedattackdetector/.gitlab-ci.yml b/src/l3_centralizedattackdetector/.gitlab-ci.yml index 43ca269d3c8c1456d86717f423c81fafbc5b03af..791b917524fa3ad2fa91e0bc4f928fcb60851341 100644 --- a/src/l3_centralizedattackdetector/.gitlab-ci.yml +++ b/src/l3_centralizedattackdetector/.gitlab-ci.yml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Build, tag, and push the Docker images to the GitLab Docker registry +# Build, tag, and push the Docker image to the GitLab Docker registry build l3_centralizedattackdetector: variables: IMAGE_NAME: 'l3_centralizedattackdetector' # name of the microservice @@ -21,22 +21,24 @@ build l3_centralizedattackdetector: before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile . - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" after_script: - docker images --filter="dangling=true" --quiet | xargs -r docker rmi rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: + - src/common/**/*.py + - proto/*.proto - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml -# Pull, execute, and run unitary tests for the Docker image from the GitLab registry +# Apply unit test to the component unit test l3_centralizedattackdetector: variables: IMAGE_NAME: 'l3_centralizedattackdetector' # name of the microservice @@ -46,7 +48,7 @@ unit test l3_centralizedattackdetector: - build l3_centralizedattackdetector before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi + - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi script: - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" @@ -55,7 +57,6 @@ unit test l3_centralizedattackdetector: - docker ps -a - docker logs $IMAGE_NAME - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" - - docker exec -i $IMAGE_NAME bash -c "coverage xml -o /opt/results/${IMAGE_NAME}_coverage.xml" - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: @@ -63,8 +64,10 @@ unit test l3_centralizedattackdetector: - docker network rm teraflowbridge rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: + - src/common/**/*.py + - proto/*.proto - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py @@ -75,7 +78,6 @@ unit test l3_centralizedattackdetector: when: always reports: junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml - cobertura: src/$IMAGE_NAME/tests/${IMAGE_NAME}_coverage.xml # Deployment of the service in Kubernetes Cluster deploy l3_centralizedattackdetector: diff --git a/src/l3_centralizedattackdetector/Config.py b/src/l3_centralizedattackdetector/Config.py index 2b7ec70f13e273c5913607f8b9cd4b6cb59555f7..f6c7e33553820b1214e5265cf219db629bcfe006 100644 --- a/src/l3_centralizedattackdetector/Config.py +++ b/src/l3_centralizedattackdetector/Config.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/l3_centralizedattackdetector/Dockerfile b/src/l3_centralizedattackdetector/Dockerfile index 6a52cda86e9de16213bc058a0ffeeba04f85f6f9..e5b9aa33b78b2593dc1df6d48edaf8c41b65a02b 100644 --- a/src/l3_centralizedattackdetector/Dockerfile +++ b/src/l3_centralizedattackdetector/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM python:3-slim +FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ @@ -28,22 +28,41 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ chmod +x /bin/grpc_health_probe # Get generic Python packages -RUN python3 -m pip install --upgrade pip setuptools wheel pip-tools +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools -# Set working directory +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components WORKDIR /var/teraflow +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt -# Create module sub-folders -RUN mkdir -p /var/teraflow/l3_centralizedattackdetector +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto + +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; -# Get Python packages per module -COPY l3_centralizedattackdetector/requirements.in l3_centralizedattackdetector/requirements.in -RUN pip-compile --output-file=l3_centralizedattackdetector/requirements.txt l3_centralizedattackdetector/requirements.in -RUN python3 -m pip install -r l3_centralizedattackdetector/requirements.in +# Create component sub-folders, get specific Python packages +RUN mkdir -p /var/teraflow/l3_centralizedattackdetector +WORKDIR /var/teraflow/l3_centralizedattackdetector +COPY src/l3_centralizedattackdetector/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN python3 -m pip install -r requirements.txt -# Add files into working directory -COPY common/. common -COPY l3_centralizedattackdetector/. l3_centralizedattackdetector +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/l3_centralizedattackdetector/. l3_centralizedattackdetector -# Start service service +# Start the service ENTRYPOINT ["python", "-m", "l3_centralizedattackdetector.service"] diff --git a/src/l3_centralizedattackdetector/__init__.py b/src/l3_centralizedattackdetector/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/l3_centralizedattackdetector/__init__.py +++ b/src/l3_centralizedattackdetector/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/l3_centralizedattackdetector/client/__init__.py b/src/l3_centralizedattackdetector/client/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/l3_centralizedattackdetector/client/__init__.py +++ b/src/l3_centralizedattackdetector/client/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/l3_centralizedattackdetector/client/l3_centralizedattackdetectorClient.py b/src/l3_centralizedattackdetector/client/l3_centralizedattackdetectorClient.py index b5181d63e02bcb77ec92e8c53374b38cb4bc72d3..f84bd84217c30e25c6e8ccfbb9b9e48c073a5ee5 100644 --- a/src/l3_centralizedattackdetector/client/l3_centralizedattackdetectorClient.py +++ b/src/l3_centralizedattackdetector/client/l3_centralizedattackdetectorClient.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,10 +14,10 @@ import grpc, logging from common.tools.client.RetryDecorator import retry, delay_exponential -from l3_centralizedattackdetector.proto.l3_centralizedattackdetector_pb2_grpc import ( +from common.proto.l3_centralizedattackdetector_pb2_grpc import ( L3CentralizedattackdetectorStub, ) -from l3_centralizedattackdetector.proto.l3_centralizedattackdetector_pb2 import ( +from common.proto.l3_centralizedattackdetector_pb2 import ( Empty, ModelInput, ModelOutput diff --git a/src/l3_centralizedattackdetector/genproto.sh b/src/l3_centralizedattackdetector/genproto.sh deleted file mode 100644 index a68c8638db15b776a7d1f70484daf2651c72253a..0000000000000000000000000000000000000000 --- a/src/l3_centralizedattackdetector/genproto.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -eu -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -#!/bin/bash -e - -# Make folder containing the script the root folder for its execution -cd $(dirname $0) - -rm -rf proto/*.py -rm -rf proto/__pycache__ -touch proto/__init__.py - -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto l3_centralizedattackdetector.proto -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto l3_attackmitigator.proto - -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/l3_centralizedattackdetector_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/l3_centralizedattackdetector_pb2_grpc.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/l3_attackmitigator_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/l3_attackmitigator_pb2_grpc.py diff --git a/src/l3_centralizedattackdetector/proto/__init__.py b/src/l3_centralizedattackdetector/proto/__init__.py deleted file mode 100644 index 70a33251242c51f49140e596b8208a19dd5245f7..0000000000000000000000000000000000000000 --- a/src/l3_centralizedattackdetector/proto/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - diff --git a/src/l3_centralizedattackdetector/proto/l3_attackmitigator_pb2.py b/src/l3_centralizedattackdetector/proto/l3_attackmitigator_pb2.py deleted file mode 100644 index 0ad49c2ed33f8f352f200cf23c2b871683b9d086..0000000000000000000000000000000000000000 --- a/src/l3_centralizedattackdetector/proto/l3_attackmitigator_pb2.py +++ /dev/null @@ -1,248 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: l3_attackmitigator.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='l3_attackmitigator.proto', - package='', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x18l3_attackmitigator.proto\"2\n\x0e\x45mptyMitigator\x12\x14\n\x07message\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_message\"\xf9\x01\n\x06Output\x12\x12\n\nconfidence\x18\x01 \x01(\x02\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x0c\n\x04ip_o\x18\x03 \x01(\t\x12\x10\n\x08tag_name\x18\x04 \x01(\t\x12\x0b\n\x03tag\x18\x05 \x01(\x05\x12\x0f\n\x07\x66low_id\x18\x06 \x01(\t\x12\x10\n\x08protocol\x18\x07 \x01(\t\x12\x0e\n\x06port_d\x18\x08 \x01(\t\x12\x12\n\x05ml_id\x18\t \x01(\tH\x00\x88\x01\x01\x12\x17\n\ntime_start\x18\n \x01(\x02H\x01\x88\x01\x01\x12\x15\n\x08time_end\x18\x0b \x01(\x02H\x02\x88\x01\x01\x42\x08\n\x06_ml_idB\r\n\x0b_time_startB\x0b\n\t_time_end2r\n\x11L3Attackmitigator\x12(\n\nSendOutput\x12\x07.Output\x1a\x0f.EmptyMitigator\"\x00\x12\x33\n\rGetMitigation\x12\x0f.EmptyMitigator\x1a\x0f.EmptyMitigator\"\x00\x62\x06proto3' -) - - - - -_EMPTYMITIGATOR = _descriptor.Descriptor( - name='EmptyMitigator', - full_name='EmptyMitigator', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='message', full_name='EmptyMitigator.message', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_message', full_name='EmptyMitigator._message', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=28, - serialized_end=78, -) - - -_OUTPUT = _descriptor.Descriptor( - name='Output', - full_name='Output', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='confidence', full_name='Output.confidence', index=0, - number=1, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='timestamp', full_name='Output.timestamp', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_o', full_name='Output.ip_o', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='tag_name', full_name='Output.tag_name', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='tag', full_name='Output.tag', index=4, - number=5, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='flow_id', full_name='Output.flow_id', index=5, - number=6, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='protocol', full_name='Output.protocol', index=6, - number=7, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port_d', full_name='Output.port_d', index=7, - number=8, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ml_id', full_name='Output.ml_id', index=8, - number=9, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_start', full_name='Output.time_start', index=9, - number=10, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_end', full_name='Output.time_end', index=10, - number=11, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_ml_id', full_name='Output._ml_id', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_start', full_name='Output._time_start', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_end', full_name='Output._time_end', - index=2, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=81, - serialized_end=330, -) - -_EMPTYMITIGATOR.oneofs_by_name['_message'].fields.append( - _EMPTYMITIGATOR.fields_by_name['message']) -_EMPTYMITIGATOR.fields_by_name['message'].containing_oneof = _EMPTYMITIGATOR.oneofs_by_name['_message'] -_OUTPUT.oneofs_by_name['_ml_id'].fields.append( - _OUTPUT.fields_by_name['ml_id']) -_OUTPUT.fields_by_name['ml_id'].containing_oneof = _OUTPUT.oneofs_by_name['_ml_id'] -_OUTPUT.oneofs_by_name['_time_start'].fields.append( - _OUTPUT.fields_by_name['time_start']) -_OUTPUT.fields_by_name['time_start'].containing_oneof = _OUTPUT.oneofs_by_name['_time_start'] -_OUTPUT.oneofs_by_name['_time_end'].fields.append( - _OUTPUT.fields_by_name['time_end']) -_OUTPUT.fields_by_name['time_end'].containing_oneof = _OUTPUT.oneofs_by_name['_time_end'] -DESCRIPTOR.message_types_by_name['EmptyMitigator'] = _EMPTYMITIGATOR -DESCRIPTOR.message_types_by_name['Output'] = _OUTPUT -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -EmptyMitigator = _reflection.GeneratedProtocolMessageType('EmptyMitigator', (_message.Message,), { - 'DESCRIPTOR' : _EMPTYMITIGATOR, - '__module__' : 'l3_attackmitigator_pb2' - # @@protoc_insertion_point(class_scope:EmptyMitigator) - }) -_sym_db.RegisterMessage(EmptyMitigator) - -Output = _reflection.GeneratedProtocolMessageType('Output', (_message.Message,), { - 'DESCRIPTOR' : _OUTPUT, - '__module__' : 'l3_attackmitigator_pb2' - # @@protoc_insertion_point(class_scope:Output) - }) -_sym_db.RegisterMessage(Output) - - - -_L3ATTACKMITIGATOR = _descriptor.ServiceDescriptor( - name='L3Attackmitigator', - full_name='L3Attackmitigator', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=332, - serialized_end=446, - methods=[ - _descriptor.MethodDescriptor( - name='SendOutput', - full_name='L3Attackmitigator.SendOutput', - index=0, - containing_service=None, - input_type=_OUTPUT, - output_type=_EMPTYMITIGATOR, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetMitigation', - full_name='L3Attackmitigator.GetMitigation', - index=1, - containing_service=None, - input_type=_EMPTYMITIGATOR, - output_type=_EMPTYMITIGATOR, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_L3ATTACKMITIGATOR) - -DESCRIPTOR.services_by_name['L3Attackmitigator'] = _L3ATTACKMITIGATOR - -# @@protoc_insertion_point(module_scope) diff --git a/src/l3_centralizedattackdetector/proto/l3_attackmitigator_pb2_grpc.py b/src/l3_centralizedattackdetector/proto/l3_attackmitigator_pb2_grpc.py deleted file mode 100644 index 3942d6843f99a341c8a6db7028e0d62a74d8ddb2..0000000000000000000000000000000000000000 --- a/src/l3_centralizedattackdetector/proto/l3_attackmitigator_pb2_grpc.py +++ /dev/null @@ -1,102 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - - -from . import l3_attackmitigator_pb2 as l3__attackmitigator__pb2 - - -class L3AttackmitigatorStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.SendOutput = channel.unary_unary( - '/L3Attackmitigator/SendOutput', - request_serializer=l3__attackmitigator__pb2.Output.SerializeToString, - response_deserializer=l3__attackmitigator__pb2.EmptyMitigator.FromString, - ) - self.GetMitigation = channel.unary_unary( - '/L3Attackmitigator/GetMitigation', - request_serializer=l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, - response_deserializer=l3__attackmitigator__pb2.EmptyMitigator.FromString, - ) - - -class L3AttackmitigatorServicer(object): - """Missing associated documentation comment in .proto file.""" - - def SendOutput(self, request, context): - """Sends a greeting - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetMitigation(self, request, context): - """Sends another greeting - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_L3AttackmitigatorServicer_to_server(servicer, server): - rpc_method_handlers = { - 'SendOutput': grpc.unary_unary_rpc_method_handler( - servicer.SendOutput, - request_deserializer=l3__attackmitigator__pb2.Output.FromString, - response_serializer=l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, - ), - 'GetMitigation': grpc.unary_unary_rpc_method_handler( - servicer.GetMitigation, - request_deserializer=l3__attackmitigator__pb2.EmptyMitigator.FromString, - response_serializer=l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'L3Attackmitigator', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class L3Attackmitigator(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def SendOutput(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/L3Attackmitigator/SendOutput', - l3__attackmitigator__pb2.Output.SerializeToString, - l3__attackmitigator__pb2.EmptyMitigator.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetMitigation(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/L3Attackmitigator/GetMitigation', - l3__attackmitigator__pb2.EmptyMitigator.SerializeToString, - l3__attackmitigator__pb2.EmptyMitigator.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/l3_centralizedattackdetector/proto/l3_centralizedattackdetector_pb2.py b/src/l3_centralizedattackdetector/proto/l3_centralizedattackdetector_pb2.py deleted file mode 100644 index cafbc6bf86a42e438dfccb1636f49b066be1530a..0000000000000000000000000000000000000000 --- a/src/l3_centralizedattackdetector/proto/l3_centralizedattackdetector_pb2.py +++ /dev/null @@ -1,409 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: l3_centralizedattackdetector.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='l3_centralizedattackdetector.proto', - package='', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\"l3_centralizedattackdetector.proto\"\xd9\x03\n\nModelInput\x12 \n\x18n_packets_server_seconds\x18\x01 \x01(\x02\x12 \n\x18n_packets_client_seconds\x18\x02 \x01(\x02\x12\x1d\n\x15n_bits_server_seconds\x18\x03 \x01(\x02\x12\x1d\n\x15n_bits_client_seconds\x18\x04 \x01(\x02\x12&\n\x1en_bits_server_n_packets_server\x18\x05 \x01(\x02\x12&\n\x1en_bits_client_n_packets_client\x18\x06 \x01(\x02\x12)\n!n_packets_server_n_packets_client\x18\x07 \x01(\x02\x12#\n\x1bn_bits_server_n_bits_client\x18\x08 \x01(\x02\x12\x0c\n\x04ip_o\x18\t \x01(\t\x12\x0e\n\x06port_o\x18\n \x01(\t\x12\x0c\n\x04ip_d\x18\x0b \x01(\t\x12\x0e\n\x06port_d\x18\x0c \x01(\t\x12\x0f\n\x07\x66low_id\x18\r \x01(\t\x12\x10\n\x08protocol\x18\x0e \x01(\t\x12\x17\n\ntime_start\x18\x0f \x01(\x02H\x00\x88\x01\x01\x12\x15\n\x08time_end\x18\x10 \x01(\x02H\x01\x88\x01\x01\x42\r\n\x0b_time_startB\x0b\n\t_time_end\")\n\x05\x45mpty\x12\x14\n\x07message\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_message\"\xfe\x01\n\x0bModelOutput\x12\x12\n\nconfidence\x18\x01 \x01(\x02\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x0c\n\x04ip_o\x18\x03 \x01(\t\x12\x10\n\x08tag_name\x18\x04 \x01(\t\x12\x0b\n\x03tag\x18\x05 \x01(\x05\x12\x0f\n\x07\x66low_id\x18\x06 \x01(\t\x12\x10\n\x08protocol\x18\x07 \x01(\t\x12\x0e\n\x06port_d\x18\x08 \x01(\t\x12\x12\n\x05ml_id\x18\t \x01(\tH\x00\x88\x01\x01\x12\x17\n\ntime_start\x18\n \x01(\x02H\x01\x88\x01\x01\x12\x15\n\x08time_end\x18\x0b \x01(\x02H\x02\x88\x01\x01\x42\x08\n\x06_ml_idB\r\n\x0b_time_startB\x0b\n\t_time_end2f\n\x1bL3Centralizedattackdetector\x12\"\n\tSendInput\x12\x0b.ModelInput\x1a\x06.Empty\"\x00\x12#\n\tGetOutput\x12\x06.Empty\x1a\x0c.ModelOutput\"\x00\x62\x06proto3' -) - - - - -_MODELINPUT = _descriptor.Descriptor( - name='ModelInput', - full_name='ModelInput', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='n_packets_server_seconds', full_name='ModelInput.n_packets_server_seconds', index=0, - number=1, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_packets_client_seconds', full_name='ModelInput.n_packets_client_seconds', index=1, - number=2, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_bits_server_seconds', full_name='ModelInput.n_bits_server_seconds', index=2, - number=3, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_bits_client_seconds', full_name='ModelInput.n_bits_client_seconds', index=3, - number=4, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_bits_server_n_packets_server', full_name='ModelInput.n_bits_server_n_packets_server', index=4, - number=5, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_bits_client_n_packets_client', full_name='ModelInput.n_bits_client_n_packets_client', index=5, - number=6, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_packets_server_n_packets_client', full_name='ModelInput.n_packets_server_n_packets_client', index=6, - number=7, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_bits_server_n_bits_client', full_name='ModelInput.n_bits_server_n_bits_client', index=7, - number=8, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_o', full_name='ModelInput.ip_o', index=8, - number=9, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port_o', full_name='ModelInput.port_o', index=9, - number=10, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_d', full_name='ModelInput.ip_d', index=10, - number=11, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port_d', full_name='ModelInput.port_d', index=11, - number=12, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='flow_id', full_name='ModelInput.flow_id', index=12, - number=13, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='protocol', full_name='ModelInput.protocol', index=13, - number=14, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_start', full_name='ModelInput.time_start', index=14, - number=15, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_end', full_name='ModelInput.time_end', index=15, - number=16, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_time_start', full_name='ModelInput._time_start', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_end', full_name='ModelInput._time_end', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=39, - serialized_end=512, -) - - -_EMPTY = _descriptor.Descriptor( - name='Empty', - full_name='Empty', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='message', full_name='Empty.message', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_message', full_name='Empty._message', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=514, - serialized_end=555, -) - - -_MODELOUTPUT = _descriptor.Descriptor( - name='ModelOutput', - full_name='ModelOutput', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='confidence', full_name='ModelOutput.confidence', index=0, - number=1, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='timestamp', full_name='ModelOutput.timestamp', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_o', full_name='ModelOutput.ip_o', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='tag_name', full_name='ModelOutput.tag_name', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='tag', full_name='ModelOutput.tag', index=4, - number=5, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='flow_id', full_name='ModelOutput.flow_id', index=5, - number=6, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='protocol', full_name='ModelOutput.protocol', index=6, - number=7, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port_d', full_name='ModelOutput.port_d', index=7, - number=8, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ml_id', full_name='ModelOutput.ml_id', index=8, - number=9, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_start', full_name='ModelOutput.time_start', index=9, - number=10, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_end', full_name='ModelOutput.time_end', index=10, - number=11, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_ml_id', full_name='ModelOutput._ml_id', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_start', full_name='ModelOutput._time_start', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_end', full_name='ModelOutput._time_end', - index=2, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=558, - serialized_end=812, -) - -_MODELINPUT.oneofs_by_name['_time_start'].fields.append( - _MODELINPUT.fields_by_name['time_start']) -_MODELINPUT.fields_by_name['time_start'].containing_oneof = _MODELINPUT.oneofs_by_name['_time_start'] -_MODELINPUT.oneofs_by_name['_time_end'].fields.append( - _MODELINPUT.fields_by_name['time_end']) -_MODELINPUT.fields_by_name['time_end'].containing_oneof = _MODELINPUT.oneofs_by_name['_time_end'] -_EMPTY.oneofs_by_name['_message'].fields.append( - _EMPTY.fields_by_name['message']) -_EMPTY.fields_by_name['message'].containing_oneof = _EMPTY.oneofs_by_name['_message'] -_MODELOUTPUT.oneofs_by_name['_ml_id'].fields.append( - _MODELOUTPUT.fields_by_name['ml_id']) -_MODELOUTPUT.fields_by_name['ml_id'].containing_oneof = _MODELOUTPUT.oneofs_by_name['_ml_id'] -_MODELOUTPUT.oneofs_by_name['_time_start'].fields.append( - _MODELOUTPUT.fields_by_name['time_start']) -_MODELOUTPUT.fields_by_name['time_start'].containing_oneof = _MODELOUTPUT.oneofs_by_name['_time_start'] -_MODELOUTPUT.oneofs_by_name['_time_end'].fields.append( - _MODELOUTPUT.fields_by_name['time_end']) -_MODELOUTPUT.fields_by_name['time_end'].containing_oneof = _MODELOUTPUT.oneofs_by_name['_time_end'] -DESCRIPTOR.message_types_by_name['ModelInput'] = _MODELINPUT -DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY -DESCRIPTOR.message_types_by_name['ModelOutput'] = _MODELOUTPUT -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ModelInput = _reflection.GeneratedProtocolMessageType('ModelInput', (_message.Message,), { - 'DESCRIPTOR' : _MODELINPUT, - '__module__' : 'l3_centralizedattackdetector_pb2' - # @@protoc_insertion_point(class_scope:ModelInput) - }) -_sym_db.RegisterMessage(ModelInput) - -Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { - 'DESCRIPTOR' : _EMPTY, - '__module__' : 'l3_centralizedattackdetector_pb2' - # @@protoc_insertion_point(class_scope:Empty) - }) -_sym_db.RegisterMessage(Empty) - -ModelOutput = _reflection.GeneratedProtocolMessageType('ModelOutput', (_message.Message,), { - 'DESCRIPTOR' : _MODELOUTPUT, - '__module__' : 'l3_centralizedattackdetector_pb2' - # @@protoc_insertion_point(class_scope:ModelOutput) - }) -_sym_db.RegisterMessage(ModelOutput) - - - -_L3CENTRALIZEDATTACKDETECTOR = _descriptor.ServiceDescriptor( - name='L3Centralizedattackdetector', - full_name='L3Centralizedattackdetector', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=814, - serialized_end=916, - methods=[ - _descriptor.MethodDescriptor( - name='SendInput', - full_name='L3Centralizedattackdetector.SendInput', - index=0, - containing_service=None, - input_type=_MODELINPUT, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetOutput', - full_name='L3Centralizedattackdetector.GetOutput', - index=1, - containing_service=None, - input_type=_EMPTY, - output_type=_MODELOUTPUT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_L3CENTRALIZEDATTACKDETECTOR) - -DESCRIPTOR.services_by_name['L3Centralizedattackdetector'] = _L3CENTRALIZEDATTACKDETECTOR - -# @@protoc_insertion_point(module_scope) diff --git a/src/l3_centralizedattackdetector/proto/l3_centralizedattackdetector_pb2_grpc.py b/src/l3_centralizedattackdetector/proto/l3_centralizedattackdetector_pb2_grpc.py deleted file mode 100644 index eaff683645c7d3f62afc8fc3e94c8e5841a42f00..0000000000000000000000000000000000000000 --- a/src/l3_centralizedattackdetector/proto/l3_centralizedattackdetector_pb2_grpc.py +++ /dev/null @@ -1,101 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from . import l3_centralizedattackdetector_pb2 as l3__centralizedattackdetector__pb2 - - -class L3CentralizedattackdetectorStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.SendInput = channel.unary_unary( - '/L3Centralizedattackdetector/SendInput', - request_serializer=l3__centralizedattackdetector__pb2.ModelInput.SerializeToString, - response_deserializer=l3__centralizedattackdetector__pb2.Empty.FromString, - ) - self.GetOutput = channel.unary_unary( - '/L3Centralizedattackdetector/GetOutput', - request_serializer=l3__centralizedattackdetector__pb2.Empty.SerializeToString, - response_deserializer=l3__centralizedattackdetector__pb2.ModelOutput.FromString, - ) - - -class L3CentralizedattackdetectorServicer(object): - """Missing associated documentation comment in .proto file.""" - - def SendInput(self, request, context): - """Sends a greeting - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetOutput(self, request, context): - """Sends another greeting - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_L3CentralizedattackdetectorServicer_to_server(servicer, server): - rpc_method_handlers = { - 'SendInput': grpc.unary_unary_rpc_method_handler( - servicer.SendInput, - request_deserializer=l3__centralizedattackdetector__pb2.ModelInput.FromString, - response_serializer=l3__centralizedattackdetector__pb2.Empty.SerializeToString, - ), - 'GetOutput': grpc.unary_unary_rpc_method_handler( - servicer.GetOutput, - request_deserializer=l3__centralizedattackdetector__pb2.Empty.FromString, - response_serializer=l3__centralizedattackdetector__pb2.ModelOutput.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'L3Centralizedattackdetector', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class L3Centralizedattackdetector(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def SendInput(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/L3Centralizedattackdetector/SendInput', - l3__centralizedattackdetector__pb2.ModelInput.SerializeToString, - l3__centralizedattackdetector__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetOutput(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/L3Centralizedattackdetector/GetOutput', - l3__centralizedattackdetector__pb2.Empty.SerializeToString, - l3__centralizedattackdetector__pb2.ModelOutput.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/l3_centralizedattackdetector/requirements.in b/src/l3_centralizedattackdetector/requirements.in index e14d501b5a23d29e4950a56f28ee08fc54568d4d..130abd9424379f173b5393a00d14337c582f31e9 100644 --- a/src/l3_centralizedattackdetector/requirements.in +++ b/src/l3_centralizedattackdetector/requirements.in @@ -1,10 +1,17 @@ -grpcio-health-checking -grpcio -grpcio-tools -prometheus-client -pytest -pytest-benchmark -numpy -scikit-learn -onnxruntime -coverage \ No newline at end of file +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +numpy==1.23.* +onnxruntime==1.12.* +scikit-learn==1.1.* diff --git a/src/l3_centralizedattackdetector/service/__init__.py b/src/l3_centralizedattackdetector/service/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/l3_centralizedattackdetector/service/__init__.py +++ b/src/l3_centralizedattackdetector/service/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/l3_centralizedattackdetector/service/__main__.py b/src/l3_centralizedattackdetector/service/__main__.py index 42c7412cb85a7c168d09347eda32d73ea61dbf0e..3408127242a01c110263d14947d63e64cfaa79a2 100644 --- a/src/l3_centralizedattackdetector/service/__main__.py +++ b/src/l3_centralizedattackdetector/service/__main__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorService.py b/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorService.py index 0eb101f0e36fc59e5c6e8b1346609693259e0ccf..bf58247d3c6467b6f9b3ca7d0dcbc9c5239195c4 100644 --- a/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorService.py +++ b/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorService.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ from concurrent import futures from grpc_health.v1.health import HealthServicer, OVERALL_HEALTH from grpc_health.v1.health_pb2 import HealthCheckResponse from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server -from l3_centralizedattackdetector.proto.l3_centralizedattackdetector_pb2_grpc import ( +from common.proto.l3_centralizedattackdetector_pb2_grpc import ( add_L3CentralizedattackdetectorServicer_to_server, ) from l3_centralizedattackdetector.service.l3_centralizedattackdetectorServiceServicerImpl import ( diff --git a/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorServiceServicerImpl.py b/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorServiceServicerImpl.py index 18006f5a60de4c6f5596d03e3b9482dc4040014d..dfe67813f875cbbc3173460efed73b212ba0ee0f 100644 --- a/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorServiceServicerImpl.py +++ b/src/l3_centralizedattackdetector/service/l3_centralizedattackdetectorServiceServicerImpl.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,17 +19,17 @@ import grpc import numpy as np import onnxruntime as rt import logging -from l3_centralizedattackdetector.proto.l3_centralizedattackdetector_pb2 import ( +from common.proto.l3_centralizedattackdetector_pb2 import ( Empty, ) -from l3_centralizedattackdetector.proto.l3_centralizedattackdetector_pb2_grpc import ( +from common.proto.l3_centralizedattackdetector_pb2_grpc import ( L3CentralizedattackdetectorServicer, ) -from l3_centralizedattackdetector.proto.l3_attackmitigator_pb2 import ( - Output, +from common.proto.l3_attackmitigator_pb2 import ( + L3AttackmitigatorOutput, ) -from l3_centralizedattackdetector.proto.l3_attackmitigator_pb2_grpc import ( +from common.proto.l3_attackmitigator_pb2_grpc import ( L3AttackmitigatorStub, ) @@ -88,7 +88,7 @@ class l3_centralizedattackdetectorServiceServicerImpl(L3Centralizedattackdetecto output_message["tag_name"] = "Normal" output_message["tag"] = 0 - return Output(**output_message) + return L3AttackmitigatorOutput(**output_message) def SendInput(self, request, context): # PERFORM INFERENCE WITH SENT INPUTS diff --git a/src/l3_centralizedattackdetector/service/ml_model/teraflow_rf.onnx b/src/l3_centralizedattackdetector/service/ml_model/teraflow_rf.onnx index e2bd04b7be0b6f0d60e1172448952388bb9edb6b..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 Binary files a/src/l3_centralizedattackdetector/service/ml_model/teraflow_rf.onnx and b/src/l3_centralizedattackdetector/service/ml_model/teraflow_rf.onnx differ diff --git a/src/l3_centralizedattackdetector/tests/__init__.py b/src/l3_centralizedattackdetector/tests/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/l3_centralizedattackdetector/tests/__init__.py +++ b/src/l3_centralizedattackdetector/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/l3_centralizedattackdetector/tests/test_unitary.py b/src/l3_centralizedattackdetector/tests/test_unitary.py index c63975cc896373f4d33a7dc8dc4c6d15692c8fe6..4d28755c02a1f68fb74e9b2b852aee51984f4b73 100644 --- a/src/l3_centralizedattackdetector/tests/test_unitary.py +++ b/src/l3_centralizedattackdetector/tests/test_unitary.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ import pytest from l3_centralizedattackdetector.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD from l3_centralizedattackdetector.client.l3_centralizedattackdetectorClient import l3_centralizedattackdetectorClient from l3_centralizedattackdetector.service.l3_centralizedattackdetectorService import l3_centralizedattackdetectorService -from l3_centralizedattackdetector.proto.l3_centralizedattackdetector_pb2 import ( +from common.proto.l3_centralizedattackdetector_pb2 import ( ModelInput, ) diff --git a/src/l3_distributedattackdetector/.gitlab-ci.yml b/src/l3_distributedattackdetector/.gitlab-ci.yml index 1e34c6c7e44d5bfdac06aabb2e738e368b633675..226cb642176a7d0854ee8dbdaf623cf7bcad1fc2 100644 --- a/src/l3_distributedattackdetector/.gitlab-ci.yml +++ b/src/l3_distributedattackdetector/.gitlab-ci.yml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Build, tag, and push the Docker images to the GitLab Docker registry +# Build, tag, and push the Docker image to the GitLab Docker registry build l3_distributedattackdetector: variables: IMAGE_NAME: 'l3_distributedattackdetector' # name of the microservice @@ -21,22 +21,24 @@ build l3_distributedattackdetector: before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile . - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" after_script: - docker images --filter="dangling=true" --quiet | xargs -r docker rmi rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: + - src/common/**/*.py + - proto/*.proto - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml -# Pull, execute, and run unitary tests for the Docker image from the GitLab registry +# Apply unit test to the component unit test l3_distributedattackdetector: variables: IMAGE_NAME: 'l3_distributedattackdetector' # name of the microservice @@ -46,7 +48,7 @@ unit test l3_distributedattackdetector: - build l3_distributedattackdetector before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi + - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi script: - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" @@ -55,7 +57,6 @@ unit test l3_distributedattackdetector: - docker ps -a - docker logs $IMAGE_NAME - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" - - docker exec -i $IMAGE_NAME bash -c "coverage xml -o /opt/results/${IMAGE_NAME}_coverage.xml" - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: @@ -63,8 +64,10 @@ unit test l3_distributedattackdetector: - docker network rm teraflowbridge rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: + - src/common/**/*.py + - proto/*.proto - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py @@ -75,7 +78,6 @@ unit test l3_distributedattackdetector: when: always reports: junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml - cobertura: src/$IMAGE_NAME/tests/${IMAGE_NAME}_coverage.xml # Deployment of the service in Kubernetes Cluster deploy l3_distributedattackdetector: diff --git a/src/l3_distributedattackdetector/Config.py b/src/l3_distributedattackdetector/Config.py index 73d3e471a2fc1b4ccc2a053064abd70e0b145a0f..e04de0b2622b621fb95f1c382ac3a152836de760 100644 --- a/src/l3_distributedattackdetector/Config.py +++ b/src/l3_distributedattackdetector/Config.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/l3_distributedattackdetector/Dockerfile b/src/l3_distributedattackdetector/Dockerfile index b0f1714e80055a328e90f070e9f957f8ec99708b..e78c41803f4b80a129ad9537265f68885f0a6d3b 100644 --- a/src/l3_distributedattackdetector/Dockerfile +++ b/src/l3_distributedattackdetector/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM python:3-slim +FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ @@ -28,23 +28,42 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ chmod +x /bin/grpc_health_probe # Get generic Python packages -RUN python3 -m pip install --upgrade pip setuptools wheel pip-tools +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools -# Set working directory +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components WORKDIR /var/teraflow +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt -# Create module sub-folders -RUN mkdir -p /var/teraflow/l3_distributedattackdetector +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto + +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; -# Get Python packages per module -COPY l3_distributedattackdetector/requirements.in l3_distributedattackdetector/requirements.in -RUN pip-compile --output-file=l3_distributedattackdetector/requirements.txt l3_distributedattackdetector/requirements.in -RUN python3 -m pip install -r l3_distributedattackdetector/requirements.in +# Create component sub-folders, get specific Python packages +RUN mkdir -p /var/teraflow/l3_distributedattackdetector +WORKDIR /var/teraflow/l3_distributedattackdetector +COPY src/l3_distributedattackdetector/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN python3 -m pip install -r requirements.txt -# Add files into working directory -COPY common/. common -COPY l3_distributedattackdetector/. l3_distributedattackdetector +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/l3_distributedattackdetector/. l3_distributedattackdetector -# Start service service +# Start the service RUN nohup bash -c "service/tstat -l -i lo -s service/piped &" && sleep 5 ENTRYPOINT ["python", "-m", "l3_distributedattackdetector.service"] diff --git a/src/l3_distributedattackdetector/__init__.py b/src/l3_distributedattackdetector/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/l3_distributedattackdetector/__init__.py +++ b/src/l3_distributedattackdetector/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/l3_distributedattackdetector/genproto.sh b/src/l3_distributedattackdetector/genproto.sh deleted file mode 100644 index 9ca93e30e45fbdc89eb4837fcf2e9fb8cbd2f3ee..0000000000000000000000000000000000000000 --- a/src/l3_distributedattackdetector/genproto.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -eu -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -#!/bin/bash -e - -# Make folder containing the script the root folder for its execution -cd $(dirname $0) - -rm -rf proto/*.py -rm -rf proto/__pycache__ -touch proto/__init__.py - -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto l3_centralizedattackdetector.proto - -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/l3_centralizedattackdetector_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/l3_centralizedattackdetector_pb2_grpc.py diff --git a/src/l3_distributedattackdetector/proto/__init__.py b/src/l3_distributedattackdetector/proto/__init__.py deleted file mode 100644 index 70a33251242c51f49140e596b8208a19dd5245f7..0000000000000000000000000000000000000000 --- a/src/l3_distributedattackdetector/proto/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - diff --git a/src/l3_distributedattackdetector/proto/l3_centralizedattackdetector_pb2.py b/src/l3_distributedattackdetector/proto/l3_centralizedattackdetector_pb2.py deleted file mode 100644 index cafbc6bf86a42e438dfccb1636f49b066be1530a..0000000000000000000000000000000000000000 --- a/src/l3_distributedattackdetector/proto/l3_centralizedattackdetector_pb2.py +++ /dev/null @@ -1,409 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: l3_centralizedattackdetector.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='l3_centralizedattackdetector.proto', - package='', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\"l3_centralizedattackdetector.proto\"\xd9\x03\n\nModelInput\x12 \n\x18n_packets_server_seconds\x18\x01 \x01(\x02\x12 \n\x18n_packets_client_seconds\x18\x02 \x01(\x02\x12\x1d\n\x15n_bits_server_seconds\x18\x03 \x01(\x02\x12\x1d\n\x15n_bits_client_seconds\x18\x04 \x01(\x02\x12&\n\x1en_bits_server_n_packets_server\x18\x05 \x01(\x02\x12&\n\x1en_bits_client_n_packets_client\x18\x06 \x01(\x02\x12)\n!n_packets_server_n_packets_client\x18\x07 \x01(\x02\x12#\n\x1bn_bits_server_n_bits_client\x18\x08 \x01(\x02\x12\x0c\n\x04ip_o\x18\t \x01(\t\x12\x0e\n\x06port_o\x18\n \x01(\t\x12\x0c\n\x04ip_d\x18\x0b \x01(\t\x12\x0e\n\x06port_d\x18\x0c \x01(\t\x12\x0f\n\x07\x66low_id\x18\r \x01(\t\x12\x10\n\x08protocol\x18\x0e \x01(\t\x12\x17\n\ntime_start\x18\x0f \x01(\x02H\x00\x88\x01\x01\x12\x15\n\x08time_end\x18\x10 \x01(\x02H\x01\x88\x01\x01\x42\r\n\x0b_time_startB\x0b\n\t_time_end\")\n\x05\x45mpty\x12\x14\n\x07message\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\n\n\x08_message\"\xfe\x01\n\x0bModelOutput\x12\x12\n\nconfidence\x18\x01 \x01(\x02\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x0c\n\x04ip_o\x18\x03 \x01(\t\x12\x10\n\x08tag_name\x18\x04 \x01(\t\x12\x0b\n\x03tag\x18\x05 \x01(\x05\x12\x0f\n\x07\x66low_id\x18\x06 \x01(\t\x12\x10\n\x08protocol\x18\x07 \x01(\t\x12\x0e\n\x06port_d\x18\x08 \x01(\t\x12\x12\n\x05ml_id\x18\t \x01(\tH\x00\x88\x01\x01\x12\x17\n\ntime_start\x18\n \x01(\x02H\x01\x88\x01\x01\x12\x15\n\x08time_end\x18\x0b \x01(\x02H\x02\x88\x01\x01\x42\x08\n\x06_ml_idB\r\n\x0b_time_startB\x0b\n\t_time_end2f\n\x1bL3Centralizedattackdetector\x12\"\n\tSendInput\x12\x0b.ModelInput\x1a\x06.Empty\"\x00\x12#\n\tGetOutput\x12\x06.Empty\x1a\x0c.ModelOutput\"\x00\x62\x06proto3' -) - - - - -_MODELINPUT = _descriptor.Descriptor( - name='ModelInput', - full_name='ModelInput', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='n_packets_server_seconds', full_name='ModelInput.n_packets_server_seconds', index=0, - number=1, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_packets_client_seconds', full_name='ModelInput.n_packets_client_seconds', index=1, - number=2, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_bits_server_seconds', full_name='ModelInput.n_bits_server_seconds', index=2, - number=3, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_bits_client_seconds', full_name='ModelInput.n_bits_client_seconds', index=3, - number=4, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_bits_server_n_packets_server', full_name='ModelInput.n_bits_server_n_packets_server', index=4, - number=5, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_bits_client_n_packets_client', full_name='ModelInput.n_bits_client_n_packets_client', index=5, - number=6, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_packets_server_n_packets_client', full_name='ModelInput.n_packets_server_n_packets_client', index=6, - number=7, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='n_bits_server_n_bits_client', full_name='ModelInput.n_bits_server_n_bits_client', index=7, - number=8, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_o', full_name='ModelInput.ip_o', index=8, - number=9, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port_o', full_name='ModelInput.port_o', index=9, - number=10, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_d', full_name='ModelInput.ip_d', index=10, - number=11, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port_d', full_name='ModelInput.port_d', index=11, - number=12, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='flow_id', full_name='ModelInput.flow_id', index=12, - number=13, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='protocol', full_name='ModelInput.protocol', index=13, - number=14, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_start', full_name='ModelInput.time_start', index=14, - number=15, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_end', full_name='ModelInput.time_end', index=15, - number=16, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_time_start', full_name='ModelInput._time_start', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_end', full_name='ModelInput._time_end', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=39, - serialized_end=512, -) - - -_EMPTY = _descriptor.Descriptor( - name='Empty', - full_name='Empty', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='message', full_name='Empty.message', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_message', full_name='Empty._message', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=514, - serialized_end=555, -) - - -_MODELOUTPUT = _descriptor.Descriptor( - name='ModelOutput', - full_name='ModelOutput', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='confidence', full_name='ModelOutput.confidence', index=0, - number=1, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='timestamp', full_name='ModelOutput.timestamp', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_o', full_name='ModelOutput.ip_o', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='tag_name', full_name='ModelOutput.tag_name', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='tag', full_name='ModelOutput.tag', index=4, - number=5, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='flow_id', full_name='ModelOutput.flow_id', index=5, - number=6, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='protocol', full_name='ModelOutput.protocol', index=6, - number=7, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port_d', full_name='ModelOutput.port_d', index=7, - number=8, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ml_id', full_name='ModelOutput.ml_id', index=8, - number=9, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_start', full_name='ModelOutput.time_start', index=9, - number=10, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='time_end', full_name='ModelOutput.time_end', index=10, - number=11, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='_ml_id', full_name='ModelOutput._ml_id', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_start', full_name='ModelOutput._time_start', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='_time_end', full_name='ModelOutput._time_end', - index=2, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=558, - serialized_end=812, -) - -_MODELINPUT.oneofs_by_name['_time_start'].fields.append( - _MODELINPUT.fields_by_name['time_start']) -_MODELINPUT.fields_by_name['time_start'].containing_oneof = _MODELINPUT.oneofs_by_name['_time_start'] -_MODELINPUT.oneofs_by_name['_time_end'].fields.append( - _MODELINPUT.fields_by_name['time_end']) -_MODELINPUT.fields_by_name['time_end'].containing_oneof = _MODELINPUT.oneofs_by_name['_time_end'] -_EMPTY.oneofs_by_name['_message'].fields.append( - _EMPTY.fields_by_name['message']) -_EMPTY.fields_by_name['message'].containing_oneof = _EMPTY.oneofs_by_name['_message'] -_MODELOUTPUT.oneofs_by_name['_ml_id'].fields.append( - _MODELOUTPUT.fields_by_name['ml_id']) -_MODELOUTPUT.fields_by_name['ml_id'].containing_oneof = _MODELOUTPUT.oneofs_by_name['_ml_id'] -_MODELOUTPUT.oneofs_by_name['_time_start'].fields.append( - _MODELOUTPUT.fields_by_name['time_start']) -_MODELOUTPUT.fields_by_name['time_start'].containing_oneof = _MODELOUTPUT.oneofs_by_name['_time_start'] -_MODELOUTPUT.oneofs_by_name['_time_end'].fields.append( - _MODELOUTPUT.fields_by_name['time_end']) -_MODELOUTPUT.fields_by_name['time_end'].containing_oneof = _MODELOUTPUT.oneofs_by_name['_time_end'] -DESCRIPTOR.message_types_by_name['ModelInput'] = _MODELINPUT -DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY -DESCRIPTOR.message_types_by_name['ModelOutput'] = _MODELOUTPUT -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ModelInput = _reflection.GeneratedProtocolMessageType('ModelInput', (_message.Message,), { - 'DESCRIPTOR' : _MODELINPUT, - '__module__' : 'l3_centralizedattackdetector_pb2' - # @@protoc_insertion_point(class_scope:ModelInput) - }) -_sym_db.RegisterMessage(ModelInput) - -Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { - 'DESCRIPTOR' : _EMPTY, - '__module__' : 'l3_centralizedattackdetector_pb2' - # @@protoc_insertion_point(class_scope:Empty) - }) -_sym_db.RegisterMessage(Empty) - -ModelOutput = _reflection.GeneratedProtocolMessageType('ModelOutput', (_message.Message,), { - 'DESCRIPTOR' : _MODELOUTPUT, - '__module__' : 'l3_centralizedattackdetector_pb2' - # @@protoc_insertion_point(class_scope:ModelOutput) - }) -_sym_db.RegisterMessage(ModelOutput) - - - -_L3CENTRALIZEDATTACKDETECTOR = _descriptor.ServiceDescriptor( - name='L3Centralizedattackdetector', - full_name='L3Centralizedattackdetector', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=814, - serialized_end=916, - methods=[ - _descriptor.MethodDescriptor( - name='SendInput', - full_name='L3Centralizedattackdetector.SendInput', - index=0, - containing_service=None, - input_type=_MODELINPUT, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetOutput', - full_name='L3Centralizedattackdetector.GetOutput', - index=1, - containing_service=None, - input_type=_EMPTY, - output_type=_MODELOUTPUT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_L3CENTRALIZEDATTACKDETECTOR) - -DESCRIPTOR.services_by_name['L3Centralizedattackdetector'] = _L3CENTRALIZEDATTACKDETECTOR - -# @@protoc_insertion_point(module_scope) diff --git a/src/l3_distributedattackdetector/proto/l3_centralizedattackdetector_pb2_grpc.py b/src/l3_distributedattackdetector/proto/l3_centralizedattackdetector_pb2_grpc.py deleted file mode 100644 index eaff683645c7d3f62afc8fc3e94c8e5841a42f00..0000000000000000000000000000000000000000 --- a/src/l3_distributedattackdetector/proto/l3_centralizedattackdetector_pb2_grpc.py +++ /dev/null @@ -1,101 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from . import l3_centralizedattackdetector_pb2 as l3__centralizedattackdetector__pb2 - - -class L3CentralizedattackdetectorStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.SendInput = channel.unary_unary( - '/L3Centralizedattackdetector/SendInput', - request_serializer=l3__centralizedattackdetector__pb2.ModelInput.SerializeToString, - response_deserializer=l3__centralizedattackdetector__pb2.Empty.FromString, - ) - self.GetOutput = channel.unary_unary( - '/L3Centralizedattackdetector/GetOutput', - request_serializer=l3__centralizedattackdetector__pb2.Empty.SerializeToString, - response_deserializer=l3__centralizedattackdetector__pb2.ModelOutput.FromString, - ) - - -class L3CentralizedattackdetectorServicer(object): - """Missing associated documentation comment in .proto file.""" - - def SendInput(self, request, context): - """Sends a greeting - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetOutput(self, request, context): - """Sends another greeting - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_L3CentralizedattackdetectorServicer_to_server(servicer, server): - rpc_method_handlers = { - 'SendInput': grpc.unary_unary_rpc_method_handler( - servicer.SendInput, - request_deserializer=l3__centralizedattackdetector__pb2.ModelInput.FromString, - response_serializer=l3__centralizedattackdetector__pb2.Empty.SerializeToString, - ), - 'GetOutput': grpc.unary_unary_rpc_method_handler( - servicer.GetOutput, - request_deserializer=l3__centralizedattackdetector__pb2.Empty.FromString, - response_serializer=l3__centralizedattackdetector__pb2.ModelOutput.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'L3Centralizedattackdetector', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class L3Centralizedattackdetector(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def SendInput(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/L3Centralizedattackdetector/SendInput', - l3__centralizedattackdetector__pb2.ModelInput.SerializeToString, - l3__centralizedattackdetector__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetOutput(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/L3Centralizedattackdetector/GetOutput', - l3__centralizedattackdetector__pb2.Empty.SerializeToString, - l3__centralizedattackdetector__pb2.ModelOutput.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/l3_distributedattackdetector/requirements.in b/src/l3_distributedattackdetector/requirements.in index ede9c839d93cc377e93c525bc1e85243576faa00..a8aba849708799232f6b0732c3661396266da329 100644 --- a/src/l3_distributedattackdetector/requirements.in +++ b/src/l3_distributedattackdetector/requirements.in @@ -1,9 +1,15 @@ -grpcio-health-checking -grpcio -grpcio-tools -prometheus-client -pytest -pytest-benchmark -numpy -scikit-learn -coverage \ No newline at end of file +# 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. + +# no extra dependency diff --git a/src/l3_distributedattackdetector/service/__init__.py b/src/l3_distributedattackdetector/service/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/l3_distributedattackdetector/service/__init__.py +++ b/src/l3_distributedattackdetector/service/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/l3_distributedattackdetector/service/__main__.py b/src/l3_distributedattackdetector/service/__main__.py index 29f943ce745bc1355ac063fea83a63b42e19f36b..1f558dfb6c271cf63a9e36ae06cb9993f7e49c57 100644 --- a/src/l3_distributedattackdetector/service/__main__.py +++ b/src/l3_distributedattackdetector/service/__main__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,10 +17,10 @@ import sys import os import time import grpc -from l3_distributedattackdetector.proto.l3_centralizedattackdetector_pb2_grpc import ( +from common.proto.l3_centralizedattackdetector_pb2_grpc import ( L3CentralizedattackdetectorStub, ) -from l3_distributedattackdetector.proto.l3_centralizedattackdetector_pb2 import ( +from common.proto.l3_centralizedattackdetector_pb2 import ( ModelInput, ) diff --git a/src/l3_distributedattackdetector/tests/__init__.py b/src/l3_distributedattackdetector/tests/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/l3_distributedattackdetector/tests/__init__.py +++ b/src/l3_distributedattackdetector/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/l3_distributedattackdetector/tests/data_generator.py b/src/l3_distributedattackdetector/tests/data_generator.py index 43c3d707c8ccd52ccc63afdc7278bf67ec3f628a..bd65566389b1dbfa3d42c6ae55e72d15f8f9c608 100644 --- a/src/l3_distributedattackdetector/tests/data_generator.py +++ b/src/l3_distributedattackdetector/tests/data_generator.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/l3_distributedattackdetector/tests/test_unitary.py b/src/l3_distributedattackdetector/tests/test_unitary.py index 0e868d7815ec0c3837bb2e9a1e439b98f3674f39..88e3dda986056e70f22cafc6124f0edc6770ee3e 100644 --- a/src/l3_distributedattackdetector/tests/test_unitary.py +++ b/src/l3_distributedattackdetector/tests/test_unitary.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/load_generator/.gitlab-ci.yml b/src/load_generator/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..5f2ee0d76105e57d31b0a6596d020ef53e65a631 --- /dev/null +++ b/src/load_generator/.gitlab-ci.yml @@ -0,0 +1,39 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Build, tag, and push the Docker image to the GitLab Docker registry +build load_generator: + variables: + IMAGE_NAME: 'load_generator' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: build + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + script: + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile . + - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml diff --git a/src/load_generator/Config.py b/src/load_generator/Config.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/load_generator/Config.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/load_generator/Dockerfile b/src/load_generator/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..c9297eb2fa08047ff1883f8c350ebbd1d0b5dd8c --- /dev/null +++ b/src/load_generator/Dockerfile @@ -0,0 +1,77 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM python:3.9-slim + +# Install dependencies +RUN apt-get --yes --quiet --quiet update && \ + apt-get --yes --quiet --quiet install wget g++ && \ + rm -rf /var/lib/apt/lists/* + +# Set Python to show logs as they occur +ENV PYTHONUNBUFFERED=0 + +# Download the gRPC health probe +RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ + wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ + chmod +x /bin/grpc_health_probe + +# Get generic Python packages +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools + +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components +WORKDIR /var/teraflow +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt + +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto + +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; + +# Create component sub-folders, get specific Python packages +RUN mkdir -p /var/teraflow/load_generator +WORKDIR /var/teraflow/load_generator +COPY src/load_generator/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN python3 -m pip install -r requirements.txt + +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/context/__init__.py context/__init__.py +COPY src/context/client/. context/client/ +COPY src/dlt/__init__.py dlt/__init__.py +COPY src/dlt/connector/__init__.py dlt/connector/__init__.py +COPY src/dlt/connector/. dlt/connector/ +COPY src/load_generator/. load_generator/ +COPY src/service/__init__.py service/__init__.py +COPY src/service/client/. service/client/ +COPY src/slice/__init__.py slice/__init__.py +COPY src/slice/client/. slice/client/ + +# Start the service +ENTRYPOINT ["python", "-m", "load_generator.service"] diff --git a/src/load_generator/README.md b/src/load_generator/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e6b0397bf435abb91f5e7c463da32367eba142cf --- /dev/null +++ b/src/load_generator/README.md @@ -0,0 +1,18 @@ +# Tool: Load Generator + +Simple tool to generate load in ETSI TeraFlowSDN controller with requests for creating services and slices. +The tool can be executed form command line or from WebUI interface. + +## Example (Command Line): + +Deploy TeraFlowSDN controller with your specific settings: +```(bash) +cd ~/tfs-ctrl +source my_deploy.sh +./deploy.sh +``` + +Run the tool: +```(bash) +./src/load_generator/run.sh +``` diff --git a/src/load_generator/__init__.py b/src/load_generator/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/load_generator/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/load_generator/client/LoadGeneratorClient.py b/src/load_generator/client/LoadGeneratorClient.py new file mode 100644 index 0000000000000000000000000000000000000000..99626bbbb59671af41c11054d34338194f42a6af --- /dev/null +++ b/src/load_generator/client/LoadGeneratorClient.py @@ -0,0 +1,60 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import grpc, logging +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc +from common.proto.context_pb2 import Empty +from common.proto.load_generator_pb2_grpc import LoadGeneratorServiceStub +from common.tools.client.RetryDecorator import retry, delay_exponential +from common.tools.grpc.Tools import grpc_message_to_json_string + +LOGGER = logging.getLogger(__name__) +MAX_RETRIES = 15 +DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + +class LoadGeneratorClient: + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.LOAD_GENERATOR) + if not port: port = get_service_port_grpc(ServiceNameEnum.LOAD_GENERATOR) + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) + LOGGER.debug('Creating channel to {:s}...'.format(self.endpoint)) + self.channel = None + self.stub = None + self.connect() + LOGGER.debug('Channel created') + + def connect(self): + self.channel = grpc.insecure_channel(self.endpoint) + self.stub = LoadGeneratorServiceStub(self.channel) + + def close(self): + if self.channel is not None: self.channel.close() + self.channel = None + self.stub = None + + @RETRY_DECORATOR + def Start(self, request : Empty) -> Empty: + LOGGER.debug('Start request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.Start(request) + LOGGER.debug('Start result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def Stop(self, request : Empty) -> Empty: + LOGGER.debug('Stop request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.Stop(request) + LOGGER.debug('Stop result: {:s}'.format(grpc_message_to_json_string(response))) + return response diff --git a/src/load_generator/client/__init__.py b/src/load_generator/client/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/load_generator/client/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/load_generator/command/__init__.py b/src/load_generator/command/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/load_generator/command/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/load_generator/command/__main__.py b/src/load_generator/command/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..7504eb6da6d6adea698249240abf2c4e4559297a --- /dev/null +++ b/src/load_generator/command/__main__.py @@ -0,0 +1,56 @@ +# 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, sys +from apscheduler.schedulers.blocking import BlockingScheduler +from load_generator.load_gen.Constants import RequestType +from load_generator.load_gen.Parameters import Parameters +from load_generator.load_gen.RequestGenerator import RequestGenerator +from load_generator.load_gen.RequestScheduler import RequestScheduler + +logging.basicConfig(level=logging.INFO) +LOGGER = logging.getLogger(__name__) + +def main(): + LOGGER.info('Starting...') + parameters = Parameters( + num_requests = 100, + request_types = [ + RequestType.SERVICE_L2NM, + RequestType.SERVICE_L3NM, + #RequestType.SERVICE_MW, + #RequestType.SERVICE_TAPI, + RequestType.SLICE_L2NM, + RequestType.SLICE_L3NM, + ], + offered_load = 50, + holding_time = 10, + dry_mode = False, # in dry mode, no request is sent to TeraFlowSDN + record_to_dlt = False, # if record_to_dlt, changes in device/link/service/slice are uploaded to DLT + dlt_domain_id = 'dlt-perf-eval', # domain used to uploaded entities, ignored when record_to_dlt = False + ) + + LOGGER.info('Initializing Generator...') + generator = RequestGenerator(parameters) + generator.initialize() + + LOGGER.info('Running Schedule...') + scheduler = RequestScheduler(parameters, generator, scheduler_class=BlockingScheduler) + scheduler.start() + + LOGGER.info('Done!') + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/load_generator/load_gen/Constants.py b/src/load_generator/load_gen/Constants.py new file mode 100644 index 0000000000000000000000000000000000000000..b71dd9a35329e2aef6ce64739f59103a656b4de3 --- /dev/null +++ b/src/load_generator/load_gen/Constants.py @@ -0,0 +1,28 @@ +# 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 enum import Enum + +class RequestType(Enum): + SERVICE_L2NM = 'svc-l2nm' + SERVICE_L3NM = 'svc-l3nm' + SERVICE_TAPI = 'svc-tapi' + SERVICE_MW = 'svc-mw' + SLICE_L2NM = 'slc-l2nm' + SLICE_L3NM = 'slc-l3nm' + +ENDPOINT_COMPATIBILITY = { + 'PHOTONIC_MEDIA:FLEX:G_6_25GHZ:INPUT': 'PHOTONIC_MEDIA:FLEX:G_6_25GHZ:OUTPUT', + 'PHOTONIC_MEDIA:DWDM:G_50GHZ:INPUT' : 'PHOTONIC_MEDIA:DWDM:G_50GHZ:OUTPUT', +} diff --git a/src/load_generator/load_gen/DltTools.py b/src/load_generator/load_gen/DltTools.py new file mode 100644 index 0000000000000000000000000000000000000000..8799f7d8a13aff6018ffe06700b4478daa2b3271 --- /dev/null +++ b/src/load_generator/load_gen/DltTools.py @@ -0,0 +1,123 @@ +# 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, queue +from typing import Optional, Set, Tuple +from common.proto.context_pb2 import DeviceId, LinkId, ServiceId, SliceId, TopologyId +from common.proto.dlt_connector_pb2 import DltDeviceId, DltLinkId, DltServiceId, DltSliceId +from common.tools.grpc.Tools import grpc_message_to_json_string +from common.tools.object_factory.Topology import json_topology_id +from context.client.ContextClient import ContextClient +from dlt.connector.client.DltConnectorClient import DltConnectorClient + +def explore_entities_to_record( + slice_id : Optional[SliceId] = None, service_id : Optional[ServiceId] = None +) -> Tuple[Set[str], Set[str], Set[str]]: + + context_client = ContextClient() + + slices_to_record : Set[str] = set() + services_to_record : Set[str] = set() + devices_to_record : Set[str] = set() + + slices_to_explore = queue.Queue() + services_to_explore = queue.Queue() + if slice_id is not None: slices_to_explore.put(slice_id) + if service_id is not None: services_to_explore.put(service_id) + + while not slices_to_explore.empty(): + slice_id = slices_to_explore.get() + slices_to_record.add(grpc_message_to_json_string(slice_id)) + + slice_ = context_client.GetSlice(slice_id) + + for endpoint_id in slice_.slice_endpoint_ids: + devices_to_record.add(grpc_message_to_json_string(endpoint_id.device_id)) + for subslice_id in slice_.slice_subslice_ids: + slices_to_explore.put(subslice_id) + for service_id in slice_.slice_service_ids: + services_to_explore.put(service_id) + + while not services_to_explore.empty(): + service_id = services_to_explore.get() + services_to_record.add(grpc_message_to_json_string(service_id)) + + service = context_client.GetService(service_id) + + for endpoint_id in service.service_endpoint_ids: + devices_to_record.add(grpc_message_to_json_string(endpoint_id.device_id)) + + connections = context_client.ListConnections(service_id) + for connection in connections.connections: + for endpoint_id in connection.path_hops_endpoint_ids: + devices_to_record.add(grpc_message_to_json_string(endpoint_id.device_id)) + for service_id in connection.sub_service_ids: + services_to_explore.put(service_id) + + return slices_to_record, services_to_record, devices_to_record + +def record_device_to_dlt( + dlt_connector_client : DltConnectorClient, domain_id : TopologyId, device_id : DeviceId, delete : bool = False +) -> None: + dlt_device_id = DltDeviceId() + dlt_device_id.topology_id.CopyFrom(domain_id) # pylint: disable=no-member + dlt_device_id.device_id.CopyFrom(device_id) # pylint: disable=no-member + dlt_device_id.delete = delete + dlt_connector_client.RecordDevice(dlt_device_id) + +def record_link_to_dlt( + dlt_connector_client : DltConnectorClient, domain_id : TopologyId, link_id : LinkId, delete : bool = False +) -> None: + dlt_link_id = DltLinkId() + dlt_link_id.topology_id.CopyFrom(domain_id) # pylint: disable=no-member + dlt_link_id.link_id.CopyFrom(link_id) # pylint: disable=no-member + dlt_link_id.delete = delete + dlt_connector_client.RecordLink(dlt_link_id) + +def record_service_to_dlt( + dlt_connector_client : DltConnectorClient, domain_id : TopologyId, service_id : ServiceId, delete : bool = False +) -> None: + dlt_service_id = DltServiceId() + dlt_service_id.topology_id.CopyFrom(domain_id) # pylint: disable=no-member + dlt_service_id.service_id.CopyFrom(service_id) # pylint: disable=no-member + dlt_service_id.delete = delete + dlt_connector_client.RecordService(dlt_service_id) + +def record_slice_to_dlt( + dlt_connector_client : DltConnectorClient, domain_id : TopologyId, slice_id : SliceId, delete : bool = False +) -> None: + dlt_slice_id = DltSliceId() + dlt_slice_id.topology_id.CopyFrom(domain_id) # pylint: disable=no-member + dlt_slice_id.slice_id.CopyFrom(slice_id) # pylint: disable=no-member + dlt_slice_id.delete = delete + dlt_connector_client.RecordSlice(dlt_slice_id) + +def record_entities( + slices_to_record : Set[str] = set(), services_to_record : Set[str] = set(), devices_to_record : Set[str] = set(), + delete : bool = False +) -> None: + dlt_connector_client = DltConnectorClient() + dlt_domain_id = TopologyId(**json_topology_id('dlt-perf-eval')) + + for str_device_id in devices_to_record: + device_id = DeviceId(**(json.loads(str_device_id))) + record_device_to_dlt(dlt_connector_client, dlt_domain_id, device_id, delete=delete) + + for str_service_id in services_to_record: + service_id = ServiceId(**(json.loads(str_service_id))) + record_service_to_dlt(dlt_connector_client, dlt_domain_id, service_id, delete=delete) + + for str_slice_id in slices_to_record: + slice_id = SliceId(**(json.loads(str_slice_id))) + record_slice_to_dlt(dlt_connector_client, dlt_domain_id, slice_id, delete=delete) diff --git a/src/load_generator/load_gen/Parameters.py b/src/load_generator/load_gen/Parameters.py new file mode 100644 index 0000000000000000000000000000000000000000..f0de3ea1aa268c520fd214f7f621953289ac5bc9 --- /dev/null +++ b/src/load_generator/load_gen/Parameters.py @@ -0,0 +1,72 @@ +# 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 typing import List, Optional + +class Parameters: + def __init__( + self, num_requests : int, request_types : List[str], offered_load : Optional[float] = None, + inter_arrival_time : Optional[float] = None, holding_time : Optional[float] = None, do_teardown : bool = True, + dry_mode : bool = False, record_to_dlt : bool = False, dlt_domain_id : Optional[str] = None + ) -> None: + self._num_requests = num_requests + self._request_types = request_types + self._offered_load = offered_load + self._inter_arrival_time = inter_arrival_time + self._holding_time = holding_time + self._do_teardown = do_teardown + self._dry_mode = dry_mode + self._record_to_dlt = record_to_dlt + self._dlt_domain_id = dlt_domain_id + + if self._offered_load is None and self._holding_time is not None and self._inter_arrival_time is not None: + self._offered_load = self._holding_time / self._inter_arrival_time + elif self._offered_load is not None and self._holding_time is not None and self._inter_arrival_time is None: + self._inter_arrival_time = self._holding_time / self._offered_load + elif self._offered_load is not None and self._holding_time is None and self._inter_arrival_time is not None: + self._holding_time = self._offered_load * self._inter_arrival_time + else: + MSG = 'Exactly two of offered_load({:s}), inter_arrival_time({:s}), holding_time({:s}) must be specified.' + raise Exception(MSG.format(str(self._offered_load), str(self._inter_arrival_time), str(self._holding_time))) + + if self._record_to_dlt and self._dlt_domain_id is None: + MSG = 'Parameter dlt_domain_id({:s}) must be specified with record_to_dlt({:s}).' + raise Exception(MSG.format(str(self._dlt_domain_id), str(self._record_to_dlt))) + + @property + def num_requests(self): return self._num_requests + + @property + def request_types(self): return self._request_types + + @property + def offered_load(self): return self._offered_load + + @property + def inter_arrival_time(self): return self._inter_arrival_time + + @property + def holding_time(self): return self._holding_time + + @property + def do_teardown(self): return self._do_teardown + + @property + def dry_mode(self): return self._dry_mode + + @property + def record_to_dlt(self): return self._record_to_dlt + + @property + def dlt_domain_id(self): return self._dlt_domain_id diff --git a/src/load_generator/load_gen/RequestGenerator.py b/src/load_generator/load_gen/RequestGenerator.py new file mode 100644 index 0000000000000000000000000000000000000000..906c26e98a75fe3c8f15d628f863faac4ba2ea16 --- /dev/null +++ b/src/load_generator/load_gen/RequestGenerator.py @@ -0,0 +1,452 @@ +# 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, json, random, threading +from typing import Dict, Optional, Set, Tuple +from common.proto.context_pb2 import Empty, TopologyId +from common.tools.grpc.Tools import grpc_message_to_json +from common.tools.object_factory.Constraint import json_constraint_custom +from common.tools.object_factory.ConfigRule import json_config_rule_set +from common.tools.object_factory.Device import json_device_id +from common.tools.object_factory.EndPoint import json_endpoint_id +from common.tools.object_factory.Service import ( + json_service_l2nm_planned, json_service_l3nm_planned, json_service_tapi_planned) +from common.tools.object_factory.Slice import json_slice +from common.tools.object_factory.Topology import json_topology_id +from context.client.ContextClient import ContextClient +from dlt.connector.client.DltConnectorClient import DltConnectorClient +from .Constants import ENDPOINT_COMPATIBILITY, RequestType +from .DltTools import record_device_to_dlt, record_link_to_dlt +from .Parameters import Parameters + +LOGGER = logging.getLogger(__name__) + +class RequestGenerator: + def __init__(self, parameters : Parameters) -> None: + self._parameters = parameters + self._lock = threading.Lock() + self._num_requests = 0 + self._available_device_endpoints : Dict[str, Set[str]] = dict() + self._used_device_endpoints : Dict[str, Dict[str, str]] = dict() + self._endpoint_ids_to_types : Dict[Tuple[str, str], str] = dict() + self._endpoint_types_to_ids : Dict[str, Set[Tuple[str, str]]] = dict() + + self._device_data : Dict[str, Dict] = dict() + self._device_endpoint_data : Dict[str, Dict[str, Dict]] = dict() + + def initialize(self) -> None: + with self._lock: + self._available_device_endpoints.clear() + self._used_device_endpoints.clear() + + context_client = ContextClient() + dlt_connector_client = DltConnectorClient() + + if self._parameters.record_to_dlt: + dlt_domain_id = TopologyId(**json_topology_id('dlt-perf-eval')) + + devices = context_client.ListDevices(Empty()) + for device in devices.devices: + device_uuid = device.device_id.device_uuid.uuid + self._device_data[device_uuid] = grpc_message_to_json(device) + + _endpoints = self._available_device_endpoints.setdefault(device_uuid, set()) + for endpoint in device.device_endpoints: + endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid + endpoints = self._device_endpoint_data.setdefault(device_uuid, dict()) + endpoints[endpoint_uuid] = grpc_message_to_json(endpoint) + + endpoint_type = endpoint.endpoint_type + _endpoints.add(endpoint_uuid) + self._endpoint_ids_to_types.setdefault((device_uuid, endpoint_uuid), endpoint_type) + self._endpoint_types_to_ids.setdefault(endpoint_type, set()).add((device_uuid, endpoint_uuid)) + + if self._parameters.record_to_dlt: + record_device_to_dlt(dlt_connector_client, dlt_domain_id, device.device_id) + + links = context_client.ListLinks(Empty()) + for link in links.links: + for endpoint_id in link.link_endpoint_ids: + device_uuid = endpoint_id.device_id.device_uuid.uuid + endpoint_uuid = endpoint_id.endpoint_uuid.uuid + _endpoints = self._available_device_endpoints.get(device_uuid, set()) + _endpoints.discard(endpoint_uuid) + if len(_endpoints) == 0: self._available_device_endpoints.pop(device_uuid, None) + + endpoint_type = self._endpoint_ids_to_types.pop((device_uuid, endpoint_uuid), None) + if endpoint_type is None: continue + + if endpoint_type not in self._endpoint_types_to_ids: continue + endpoints_for_type = self._endpoint_types_to_ids[endpoint_type] + endpoint_key = (device_uuid, endpoint_uuid) + if endpoint_key not in endpoints_for_type: continue + endpoints_for_type.discard(endpoint_key) + + if self._parameters.record_to_dlt: + record_link_to_dlt(dlt_connector_client, dlt_domain_id, link.link_id) + + @property + def num_requests_generated(self): return self._num_requests + + def dump_state(self) -> None: + with self._lock: + _endpoints = { + device_uuid:[endpoint_uuid for endpoint_uuid in endpoint_uuids] + for device_uuid,endpoint_uuids in self._available_device_endpoints.items() + } + LOGGER.info('[dump_state] available_device_endpoints = {:s}'.format(json.dumps(_endpoints))) + LOGGER.info('[dump_state] used_device_endpoints = {:s}'.format(json.dumps(self._used_device_endpoints))) + + def _use_device_endpoint( + self, service_uuid : str, request_type : RequestType, endpoint_types : Optional[Set[str]] = None, + exclude_device_uuids : Set[str] = set(), exclude_endpoint_uuids : Set[Tuple[str, str]] = set(), + ) -> Optional[Tuple[str, str]]: + with self._lock: + compatible_endpoints : Set[Tuple[str, str]] = set() + elegible_device_endpoints : Dict[str, Set[str]] = {} + + if endpoint_types is None: + # allow all + elegible_device_endpoints : Dict[str, Set[str]] = { + device_uuid:[ + endpoint_uuid for endpoint_uuid in device_endpoint_uuids + if (len(exclude_endpoint_uuids) == 0) or \ + ((device_uuid,endpoint_uuid) not in exclude_endpoint_uuids) + ] + for device_uuid,device_endpoint_uuids in self._available_device_endpoints.items() + if (device_uuid not in exclude_device_uuids) and \ + (len(device_endpoint_uuids) > 0) + } + else: + # allow only compatible endpoints + for endpoint_type in endpoint_types: + if endpoint_type not in self._endpoint_types_to_ids: continue + compatible_endpoints.update(self._endpoint_types_to_ids[endpoint_type]) + + for device_uuid,device_endpoint_uuids in self._available_device_endpoints.items(): + if device_uuid in exclude_device_uuids or len(device_endpoint_uuids) == 0: continue + for endpoint_uuid in device_endpoint_uuids: + endpoint_key = (device_uuid,endpoint_uuid) + if endpoint_key in exclude_endpoint_uuids: continue + if endpoint_key not in compatible_endpoints: continue + elegible_device_endpoints.setdefault(device_uuid, set()).add(endpoint_uuid) + + if len(elegible_device_endpoints) == 0: + LOGGER.warning(' '.join([ + '>> No endpoint is available:', + 'endpoint_types={:s}'.format(str(endpoint_types)), + 'exclude_device_uuids={:s}'.format(str(exclude_device_uuids)), + 'self._endpoint_types_to_ids={:s}'.format(str(self._endpoint_types_to_ids)), + 'self._available_device_endpoints={:s}'.format(str(self._available_device_endpoints)), + 'compatible_endpoints={:s}'.format(str(compatible_endpoints)), + ])) + return None + + device_uuid = random.choice(list(elegible_device_endpoints.keys())) + device_endpoint_uuids = elegible_device_endpoints.get(device_uuid) + endpoint_uuid = random.choice(list(device_endpoint_uuids)) + if request_type not in {RequestType.SERVICE_MW}: + # reserve the resources + self._available_device_endpoints.setdefault(device_uuid, set()).discard(endpoint_uuid) + self._used_device_endpoints.setdefault(device_uuid, dict())[endpoint_uuid] = service_uuid + return device_uuid, endpoint_uuid + + def _release_device_endpoint(self, device_uuid : str, endpoint_uuid : str) -> None: + with self._lock: + self._used_device_endpoints.setdefault(device_uuid, dict()).pop(endpoint_uuid, None) + self._available_device_endpoints.setdefault(device_uuid, set()).add(endpoint_uuid) + + def compose_request(self) -> Optional[Dict]: + with self._lock: + self._num_requests += 1 + num_request = self._num_requests + + #request_uuid = str(uuid.uuid4()) + request_uuid = 'svc_{:d}'.format(num_request) + + # choose request type + request_type = random.choice(self._parameters.request_types) + + if request_type in { + RequestType.SERVICE_L2NM, RequestType.SERVICE_L3NM, RequestType.SERVICE_TAPI, RequestType.SERVICE_MW + }: + return self._compose_service(num_request, request_uuid, request_type) + elif request_type in {RequestType.SLICE_L2NM, RequestType.SLICE_L3NM}: + return self._compose_slice(num_request, request_uuid, request_type) + + def _compose_service(self, num_request : int, request_uuid : str, request_type : str) -> Optional[Dict]: + # choose source endpoint + src_endpoint_types = set(ENDPOINT_COMPATIBILITY.keys()) if request_type in {RequestType.SERVICE_TAPI} else None + src = self._use_device_endpoint(request_uuid, request_type, endpoint_types=src_endpoint_types) + if src is None: + LOGGER.warning('>> No source endpoint is available') + return None + src_device_uuid,src_endpoint_uuid = src + + # identify compatible destination endpoint types + src_endpoint_type = self._endpoint_ids_to_types.get((src_device_uuid,src_endpoint_uuid)) + dst_endpoint_type = ENDPOINT_COMPATIBILITY.get(src_endpoint_type) + dst_endpoint_types = {dst_endpoint_type} if request_type in {RequestType.SERVICE_TAPI} else None + + # identify excluded destination devices + REQUESTTYPES_REUSING_DEVICES = {RequestType.SERVICE_TAPI, RequestType.SERVICE_MW} + exclude_device_uuids = {} if request_type in REQUESTTYPES_REUSING_DEVICES else {src_device_uuid} + + # choose feasible destination endpoint + dst = self._use_device_endpoint( + request_uuid, request_type, endpoint_types=dst_endpoint_types, exclude_device_uuids=exclude_device_uuids, + exclude_endpoint_uuids={src}) + + # if destination endpoint not found, release source, and terminate current service generation + if dst is None: + LOGGER.warning('>> No destination endpoint is available') + self._release_device_endpoint(src_device_uuid, src_endpoint_uuid) + return None + + # compose endpoints + dst_device_uuid,dst_endpoint_uuid = dst + endpoint_ids = [ + json_endpoint_id(json_device_id(src_device_uuid), src_endpoint_uuid), + json_endpoint_id(json_device_id(dst_device_uuid), dst_endpoint_uuid), + ] + + if request_type == RequestType.SERVICE_L2NM: + constraints = [ + json_constraint_custom('bandwidth[gbps]', '10.0'), + json_constraint_custom('latency[ms]', '20.0'), + ] + vlan_id = num_request % 1000 + circuit_id = '{:03d}'.format(vlan_id) + + src_device_name = self._device_data[src_device_uuid]['name'] + src_router_id = '10.0.0.{:d}'.format(int(src_device_name.replace('R', ''))) + + dst_device_name = self._device_data[dst_device_uuid]['name'] + dst_router_id = '10.0.0.{:d}'.format(int(dst_device_name.replace('R', ''))) + + config_rules = [ + json_config_rule_set('/settings', { + 'mtu': 1512 + }), + json_config_rule_set( + '/device[{:s}]/endpoint[{:s}]/settings'.format(src_device_uuid, src_endpoint_uuid), { + 'router_id': src_router_id, + 'sub_interface_index': vlan_id, + 'vlan_id': vlan_id, + 'remote_router': dst_router_id, + 'circuit_id': circuit_id, + }), + json_config_rule_set( + '/device[{:s}]/endpoint[{:s}]/settings'.format(dst_device_uuid, dst_endpoint_uuid), { + 'router_id': dst_router_id, + 'sub_interface_index': vlan_id, + 'vlan_id': vlan_id, + 'remote_router': src_router_id, + 'circuit_id': circuit_id, + }), + ] + return json_service_l2nm_planned( + request_uuid, endpoint_ids=endpoint_ids, constraints=constraints, config_rules=config_rules) + + elif request_type == RequestType.SERVICE_L3NM: + constraints = [ + json_constraint_custom('bandwidth[gbps]', '10.0'), + json_constraint_custom('latency[ms]', '20.0'), + ] + vlan_id = num_request % 1000 + bgp_as = 60000 + (num_request % 10000) + bgp_route_target = '{:5d}:{:03d}'.format(bgp_as, 333) + route_distinguisher = '{:5d}:{:03d}'.format(bgp_as, vlan_id) + + src_device_name = self._device_data[src_device_uuid]['name'] + src_endpoint_name = self._device_endpoint_data[src_device_uuid][src_endpoint_uuid]['name'] + src_router_id = '10.0.0.{:d}'.format(int(src_device_name.replace('R', ''))) + src_address_ip = '.'.join([src_device_name.replace('R', ''), '0'] + src_endpoint_name.split('/')) + + dst_device_name = self._device_data[dst_device_uuid]['name'] + dst_endpoint_name = self._device_endpoint_data[dst_device_uuid][dst_endpoint_uuid]['name'] + dst_router_id = '10.0.0.{:d}'.format(int(dst_device_name.replace('R', ''))) + dst_address_ip = '.'.join([dst_device_name.replace('R', ''), '0'] + dst_endpoint_name.split('/')) + + config_rules = [ + json_config_rule_set('/settings', { + 'mtu' : 1512, + 'bgp_as' : bgp_as, + 'bgp_route_target': bgp_route_target, + }), + json_config_rule_set( + '/device[{:s}]/endpoint[{:s}]/settings'.format(src_device_uuid, src_endpoint_uuid), { + 'router_id' : src_router_id, + 'route_distinguisher': route_distinguisher, + 'sub_interface_index': vlan_id, + 'vlan_id' : vlan_id, + 'address_ip' : src_address_ip, + 'address_prefix' : 16, + }), + json_config_rule_set( + '/device[{:s}]/endpoint[{:s}]/settings'.format(dst_device_uuid, dst_endpoint_uuid), { + 'router_id' : dst_router_id, + 'route_distinguisher': route_distinguisher, + 'sub_interface_index': vlan_id, + 'vlan_id' : vlan_id, + 'address_ip' : dst_address_ip, + 'address_prefix' : 16, + }), + ] + return json_service_l3nm_planned( + request_uuid, endpoint_ids=endpoint_ids, constraints=constraints, config_rules=config_rules) + + elif request_type == RequestType.SERVICE_TAPI: + config_rules = [ + json_config_rule_set('/settings', { + 'capacity_value' : 50.0, + 'capacity_unit' : 'GHz', + 'layer_proto_name': 'PHOTONIC_MEDIA', + 'layer_proto_qual': 'tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC', + 'direction' : 'UNIDIRECTIONAL', + }), + ] + return json_service_tapi_planned( + request_uuid, endpoint_ids=endpoint_ids, constraints=[], config_rules=config_rules) + + elif request_type == RequestType.SERVICE_MW: + vlan_id = 1000 + num_request % 1000 + config_rules = [ + json_config_rule_set('/settings', { + 'vlan_id': vlan_id, + }), + ] + return json_service_l2nm_planned( + request_uuid, endpoint_ids=endpoint_ids, constraints=[], config_rules=config_rules) + + def _compose_slice(self, num_request : int, request_uuid : str, request_type : str) -> Optional[Dict]: + # choose source endpoint + src = self._use_device_endpoint(request_uuid, request_type) + if src is None: + LOGGER.warning('>> No source endpoint is available') + return None + src_device_uuid,src_endpoint_uuid = src + + # identify excluded destination devices + REQUESTTYPES_REUSING_DEVICES = {RequestType.SERVICE_TAPI, RequestType.SERVICE_MW} + exclude_device_uuids = {} if request_type in REQUESTTYPES_REUSING_DEVICES else {src_device_uuid} + + # choose feasible destination endpoint + dst = self._use_device_endpoint(request_uuid, request_type, exclude_device_uuids=exclude_device_uuids) + + # if destination endpoint not found, release source, and terminate current service generation + if dst is None: + LOGGER.warning('>> No destination endpoint is available') + self._release_device_endpoint(src_device_uuid, src_endpoint_uuid) + return None + + # compose endpoints + dst_device_uuid,dst_endpoint_uuid = dst + endpoint_ids = [ + json_endpoint_id(json_device_id(src_device_uuid), src_endpoint_uuid), + json_endpoint_id(json_device_id(dst_device_uuid), dst_endpoint_uuid), + ] + constraints = [ + json_constraint_custom('bandwidth[gbps]', '10.0'), + json_constraint_custom('latency[ms]', '20.0'), + ] + + if request_type == RequestType.SLICE_L2NM: + vlan_id = num_request % 1000 + circuit_id = '{:03d}'.format(vlan_id) + + src_device_name = self._device_data[src_device_uuid]['name'] + src_router_id = '10.0.0.{:d}'.format(int(src_device_name.replace('R', ''))) + + dst_device_name = self._device_data[dst_device_uuid]['name'] + dst_router_id = '10.0.0.{:d}'.format(int(dst_device_name.replace('R', ''))) + + config_rules = [ + json_config_rule_set('/settings', { + 'mtu': 1512 + }), + json_config_rule_set( + '/device[{:s}]/endpoint[{:s}]/settings'.format(src_device_uuid, src_endpoint_uuid), { + 'router_id': src_router_id, + 'sub_interface_index': vlan_id, + 'vlan_id': vlan_id, + 'remote_router': dst_router_id, + 'circuit_id': circuit_id, + }), + json_config_rule_set( + '/device[{:s}]/endpoint[{:s}]/settings'.format(dst_device_uuid, dst_endpoint_uuid), { + 'router_id': dst_router_id, + 'sub_interface_index': vlan_id, + 'vlan_id': vlan_id, + 'remote_router': src_router_id, + 'circuit_id': circuit_id, + }), + ] + + elif request_type == RequestType.SLICE_L3NM: + vlan_id = num_request % 1000 + bgp_as = 60000 + (num_request % 10000) + bgp_route_target = '{:5d}:{:03d}'.format(bgp_as, 333) + route_distinguisher = '{:5d}:{:03d}'.format(bgp_as, vlan_id) + + src_device_name = self._device_data[src_device_uuid]['name'] + src_endpoint_name = self._device_endpoint_data[src_device_uuid][src_endpoint_uuid]['name'] + src_router_id = '10.0.0.{:d}'.format(int(src_device_name.replace('R', ''))) + src_address_ip = '.'.join([src_device_name.replace('R', ''), '0'] + src_endpoint_name.split('/')) + + dst_device_name = self._device_data[dst_device_uuid]['name'] + dst_endpoint_name = self._device_endpoint_data[dst_device_uuid][dst_endpoint_uuid]['name'] + dst_router_id = '10.0.0.{:d}'.format(int(dst_device_name.replace('R', ''))) + dst_address_ip = '.'.join([dst_device_name.replace('R', ''), '0'] + dst_endpoint_name.split('/')) + + config_rules = [ + json_config_rule_set('/settings', { + 'mtu' : 1512, + 'bgp_as' : bgp_as, + 'bgp_route_target': bgp_route_target, + }), + json_config_rule_set( + '/device[{:s}]/endpoint[{:s}]/settings'.format(src_device_uuid, src_endpoint_uuid), { + 'router_id' : src_router_id, + 'route_distinguisher': route_distinguisher, + 'sub_interface_index': vlan_id, + 'vlan_id' : vlan_id, + 'address_ip' : src_address_ip, + 'address_prefix' : 16, + }), + json_config_rule_set( + '/device[{:s}]/endpoint[{:s}]/settings'.format(dst_device_uuid, dst_endpoint_uuid), { + 'router_id' : dst_router_id, + 'route_distinguisher': route_distinguisher, + 'sub_interface_index': vlan_id, + 'vlan_id' : vlan_id, + 'address_ip' : dst_address_ip, + 'address_prefix' : 16, + }), + ] + + return json_slice( + request_uuid, endpoint_ids=endpoint_ids, constraints=constraints, config_rules=config_rules) + + def release_request(self, json_request : Dict) -> None: + if 'service_id' in json_request: + for endpoint_id in json_request['service_endpoint_ids']: + device_uuid = endpoint_id['device_id']['device_uuid']['uuid'] + endpoint_uuid = endpoint_id['endpoint_uuid']['uuid'] + self._release_device_endpoint(device_uuid, endpoint_uuid) + elif 'slice_id' in json_request: + for endpoint_id in json_request['slice_endpoint_ids']: + device_uuid = endpoint_id['device_id']['device_uuid']['uuid'] + endpoint_uuid = endpoint_id['endpoint_uuid']['uuid'] + self._release_device_endpoint(device_uuid, endpoint_uuid) diff --git a/src/load_generator/load_gen/RequestScheduler.py b/src/load_generator/load_gen/RequestScheduler.py new file mode 100644 index 0000000000000000000000000000000000000000..775da1580a2a6521dbdc8fe32236c1f2adb4b3a7 --- /dev/null +++ b/src/load_generator/load_gen/RequestScheduler.py @@ -0,0 +1,200 @@ +# 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, pytz, random +from apscheduler.executors.pool import ThreadPoolExecutor +from apscheduler.jobstores.memory import MemoryJobStore +from apscheduler.schedulers.blocking import BlockingScheduler +from datetime import datetime, timedelta +from typing import Dict, Optional +from common.proto.context_pb2 import Service, ServiceId, Slice, SliceId +from service.client.ServiceClient import ServiceClient +from slice.client.SliceClient import SliceClient +from .DltTools import explore_entities_to_record, record_entities +from .Parameters import Parameters +from .RequestGenerator import RequestGenerator + +logging.getLogger('apscheduler.executors.default').setLevel(logging.WARNING) +logging.getLogger('apscheduler.scheduler').setLevel(logging.WARNING) + +LOGGER = logging.getLogger(__name__) + +class RequestScheduler: + def __init__( + self, parameters : Parameters, generator : RequestGenerator, scheduler_class=BlockingScheduler + ) -> None: + self._scheduler = scheduler_class() + self._scheduler.configure( + jobstores = {'default': MemoryJobStore()}, + executors = {'default': ThreadPoolExecutor(max_workers=10)}, + job_defaults = { + 'coalesce': False, + 'max_instances': 100, + 'misfire_grace_time': 120, + }, + timezone=pytz.utc) + self._parameters = parameters + self._generator = generator + + def _schedule_request_setup(self) -> None: + infinite_loop = self._parameters.num_requests == 0 + num_requests_generated = self._generator.num_requests_generated - 1 # because it first increases, then checks + if not infinite_loop and (num_requests_generated >= self._parameters.num_requests): + LOGGER.info('Generation Done!') + #self._scheduler.shutdown() + return + iat = random.expovariate(1.0 / self._parameters.inter_arrival_time) + run_date = datetime.utcnow() + timedelta(seconds=iat) + self._scheduler.add_job( + self._request_setup, trigger='date', run_date=run_date, timezone=pytz.utc) + + def _schedule_request_teardown(self, request : Dict) -> None: + ht = random.expovariate(1.0 / self._parameters.holding_time) + run_date = datetime.utcnow() + timedelta(seconds=ht) + self._scheduler.add_job( + self._request_teardown, args=(request,), trigger='date', run_date=run_date, timezone=pytz.utc) + + def start(self): + self._schedule_request_setup() + self._scheduler.start() + + def stop(self): + self._scheduler.shutdown() + + def _request_setup(self) -> None: + self._schedule_request_setup() + + request = self._generator.compose_request() + if request is None: + LOGGER.warning('No resources available to compose new request') + return + + if 'service_id' in request: + service_uuid = request['service_id']['service_uuid']['uuid'] + src_device_uuid = request['service_endpoint_ids'][0]['device_id']['device_uuid']['uuid'] + src_endpoint_uuid = request['service_endpoint_ids'][0]['endpoint_uuid']['uuid'] + dst_device_uuid = request['service_endpoint_ids'][1]['device_id']['device_uuid']['uuid'] + dst_endpoint_uuid = request['service_endpoint_ids'][1]['endpoint_uuid']['uuid'] + LOGGER.info('Setup Service: uuid=%s src=%s:%s dst=%s:%s', + service_uuid, src_device_uuid, src_endpoint_uuid, dst_device_uuid, dst_endpoint_uuid) + self._create_update(service=request) + + elif 'slice_id' in request: + slice_uuid = request['slice_id']['slice_uuid']['uuid'] + src_device_uuid = request['slice_endpoint_ids'][0]['device_id']['device_uuid']['uuid'] + src_endpoint_uuid = request['slice_endpoint_ids'][0]['endpoint_uuid']['uuid'] + dst_device_uuid = request['slice_endpoint_ids'][1]['device_id']['device_uuid']['uuid'] + dst_endpoint_uuid = request['slice_endpoint_ids'][1]['endpoint_uuid']['uuid'] + LOGGER.info('Setup Slice: uuid=%s src=%s:%s dst=%s:%s', + slice_uuid, src_device_uuid, src_endpoint_uuid, dst_device_uuid, dst_endpoint_uuid) + self._create_update(slice_=request) + + if self._parameters.do_teardown: + self._schedule_request_teardown(request) + + def _request_teardown(self, request : Dict) -> None: + if 'service_id' in request: + service_uuid = request['service_id']['service_uuid']['uuid'] + src_device_uuid = request['service_endpoint_ids'][0]['device_id']['device_uuid']['uuid'] + src_endpoint_uuid = request['service_endpoint_ids'][0]['endpoint_uuid']['uuid'] + dst_device_uuid = request['service_endpoint_ids'][1]['device_id']['device_uuid']['uuid'] + dst_endpoint_uuid = request['service_endpoint_ids'][1]['endpoint_uuid']['uuid'] + LOGGER.info('Teardown Service: uuid=%s src=%s:%s dst=%s:%s', + service_uuid, src_device_uuid, src_endpoint_uuid, dst_device_uuid, dst_endpoint_uuid) + self._delete(service_id=ServiceId(**(request['service_id']))) + + elif 'slice_id' in request: + slice_uuid = request['slice_id']['slice_uuid']['uuid'] + src_device_uuid = request['slice_endpoint_ids'][0]['device_id']['device_uuid']['uuid'] + src_endpoint_uuid = request['slice_endpoint_ids'][0]['endpoint_uuid']['uuid'] + dst_device_uuid = request['slice_endpoint_ids'][1]['device_id']['device_uuid']['uuid'] + dst_endpoint_uuid = request['slice_endpoint_ids'][1]['endpoint_uuid']['uuid'] + LOGGER.info('Teardown Slice: uuid=%s src=%s:%s dst=%s:%s', + slice_uuid, src_device_uuid, src_endpoint_uuid, dst_device_uuid, dst_endpoint_uuid) + self._delete(slice_id=SliceId(**(request['slice_id']))) + + self._generator.release_request(request) + + def _create_update(self, service : Optional[Dict] = None, slice_ : Optional[Dict] = None) -> None: + if self._parameters.dry_mode: return + + service_id = None + if service is not None: + service_add = copy.deepcopy(service) + service_add['service_endpoint_ids'] = [] + service_add['service_constraints'] = [] + service_add['service_config'] = {'config_rules': []} + + service_client = ServiceClient() + service_id = service_client.CreateService(Service(**service_add)) + service_client.close() + + slice_id = None + if slice_ is not None: + slice_add = copy.deepcopy(slice_) + slice_add['slice_endpoint_ids'] = [] + slice_add['slice_constraints'] = [] + slice_add['slice_config'] = {'config_rules': []} + + slice_client = SliceClient() + slice_id = slice_client.CreateSlice(Slice(**slice_add)) + slice_client.close() + + if self._parameters.record_to_dlt: + entities_to_record = explore_entities_to_record(slice_id=slice_id, service_id=service_id) + slices_to_record, services_to_record, devices_to_record = entities_to_record + record_entities( + slices_to_record=slices_to_record, services_to_record=services_to_record, + devices_to_record=devices_to_record, delete=False) + + service_id = None + if service is not None: + service_client = ServiceClient() + service_id = service_client.UpdateService(Service(**service)) + service_client.close() + + slice_id = None + if slice_ is not None: + slice_client = SliceClient() + slice_id = slice_client.UpdateSlice(Slice(**slice_)) + slice_client.close() + + if self._parameters.record_to_dlt: + entities_to_record = explore_entities_to_record(slice_id=slice_id, service_id=service_id) + slices_to_record, services_to_record, devices_to_record = entities_to_record + record_entities( + slices_to_record=slices_to_record, services_to_record=services_to_record, + devices_to_record=devices_to_record, delete=False) + + def _delete(self, service_id : Optional[ServiceId] = None, slice_id : Optional[SliceId] = None) -> None: + if self._parameters.dry_mode: return + + if self._parameters.record_to_dlt: + entities_to_record = explore_entities_to_record(slice_id=slice_id, service_id=service_id) + slices_to_record, services_to_record, devices_to_record = entities_to_record + + if slice_id is not None: + slice_client = SliceClient() + slice_client.DeleteSlice(slice_id) + slice_client.close() + + if service_id is not None: + service_client = ServiceClient() + service_client.DeleteService(service_id) + service_client.close() + + if self._parameters.record_to_dlt: + record_entities( + slices_to_record=slices_to_record, services_to_record=services_to_record, + devices_to_record=devices_to_record, delete=True) diff --git a/src/load_generator/load_gen/__init__.py b/src/load_generator/load_gen/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/load_generator/load_gen/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/load_generator/requirements.in b/src/load_generator/requirements.in new file mode 100644 index 0000000000000000000000000000000000000000..03a61d7a3fa8fa880d8877a33025401b95da9e25 --- /dev/null +++ b/src/load_generator/requirements.in @@ -0,0 +1,15 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +APScheduler==3.8.1 diff --git a/src/tests/ofc22/show_logs_context.sh b/src/load_generator/run.sh similarity index 76% rename from src/tests/ofc22/show_logs_context.sh rename to src/load_generator/run.sh index 6d5b77fa9e0565e6df66856829644f31f55a4197..0ef004598ea91e54b6b054a48a0b830287ce5ed3 100755 --- a/src/tests/ofc22/show_logs_context.sh +++ b/src/load_generator/run.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,5 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -K8S_NAMESPACE="ofc22" -kubectl --namespace $K8S_NAMESPACE logs deployment/contextservice -c server +# Use this script to run standalone + +source tfs_runtime_env_vars.sh +python -m load_generator.command diff --git a/src/load_generator/service/LoadGeneratorService.py b/src/load_generator/service/LoadGeneratorService.py new file mode 100644 index 0000000000000000000000000000000000000000..bdcd33a110580450cfa335bda14e95cb8b01a3a7 --- /dev/null +++ b/src/load_generator/service/LoadGeneratorService.py @@ -0,0 +1,28 @@ +# 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 common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc +from common.proto.load_generator_pb2_grpc import add_LoadGeneratorServiceServicer_to_server +from common.tools.service.GenericGrpcService import GenericGrpcService +from .LoadGeneratorServiceServicerImpl import LoadGeneratorServiceServicerImpl + +class LoadGeneratorService(GenericGrpcService): + def __init__(self, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.LOAD_GENERATOR) + super().__init__(port, cls_name=cls_name) + self.load_generator_servicer = LoadGeneratorServiceServicerImpl() + + def install_servicers(self): + add_LoadGeneratorServiceServicer_to_server(self.load_generator_servicer, self.server) diff --git a/src/load_generator/service/LoadGeneratorServiceServicerImpl.py b/src/load_generator/service/LoadGeneratorServiceServicerImpl.py new file mode 100644 index 0000000000000000000000000000000000000000..c280581ddfab488249ff249e60118ec3030e0447 --- /dev/null +++ b/src/load_generator/service/LoadGeneratorServiceServicerImpl.py @@ -0,0 +1,64 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from typing import Optional +import grpc, logging +from apscheduler.schedulers.background import BackgroundScheduler +from common.proto.context_pb2 import Empty +from common.proto.load_generator_pb2_grpc import LoadGeneratorServiceServicer +from load_generator.load_gen.Constants import RequestType +from load_generator.load_gen.Parameters import Parameters +from load_generator.load_gen.RequestGenerator import RequestGenerator +from load_generator.load_gen.RequestScheduler import RequestScheduler + +LOGGER = logging.getLogger(__name__) + +class LoadGeneratorServiceServicerImpl(LoadGeneratorServiceServicer): + def __init__(self): + LOGGER.debug('Creating Servicer...') + self._parameters = Parameters( + num_requests = 100, + request_types = [ + RequestType.SERVICE_L2NM, + RequestType.SERVICE_L3NM, + #RequestType.SERVICE_MW, + #RequestType.SERVICE_TAPI, + RequestType.SLICE_L2NM, + RequestType.SLICE_L3NM, + ], + offered_load = 50, + holding_time = 10, + do_teardown = True, + dry_mode = False, # in dry mode, no request is sent to TeraFlowSDN + record_to_dlt = False, # if record_to_dlt, changes in device/link/service/slice are uploaded to DLT + dlt_domain_id = 'dlt-perf-eval', # domain used to uploaded entities, ignored when record_to_dlt = False + ) + self._generator : Optional[RequestGenerator] = None + self._scheduler : Optional[RequestScheduler] = None + LOGGER.debug('Servicer Created') + + def Start(self, request : Empty, context : grpc.ServicerContext) -> Empty: + LOGGER.info('Initializing Generator...') + self._generator = RequestGenerator(self._parameters) + self._generator.initialize() + + LOGGER.info('Running Schedule...') + self._scheduler = RequestScheduler(self._parameters, self._generator, scheduler_class=BackgroundScheduler) + self._scheduler.start() + return Empty() + + def Stop(self, request : Empty, context : grpc.ServicerContext) -> Empty: + if self._scheduler is not None: + self._scheduler.stop() + return Empty() diff --git a/src/load_generator/service/__init__.py b/src/load_generator/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/load_generator/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/load_generator/service/__main__.py b/src/load_generator/service/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..227099c59aa57f420c842a6210f3b8b146b23cda --- /dev/null +++ b/src/load_generator/service/__main__.py @@ -0,0 +1,64 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging, signal, sys, threading +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, + wait_for_environment_variables) +from .LoadGeneratorService import LoadGeneratorService + +log_level = get_log_level() +logging.basicConfig(level=log_level, format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s") +LOGGER = logging.getLogger(__name__) + +terminate = threading.Event() + +def signal_handler(signal, frame): # pylint: disable=redefined-outer-name + LOGGER.warning('Terminate signal received') + terminate.set() + +def main(): + wait_for_environment_variables([ + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + get_env_var_name(ServiceNameEnum.SERVICE, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.SERVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + get_env_var_name(ServiceNameEnum.SLICE, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.SLICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + ]) + + signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGTERM, signal_handler) + + LOGGER.info('Starting...') + + # Starting load generator service + grpc_service = LoadGeneratorService() + grpc_service.start() + + # Wait for Ctrl+C or termination signal + while not terminate.wait(timeout=0.1): pass + + scheduler = grpc_service.load_generator_servicer._scheduler + if scheduler is not None: scheduler.stop() + + LOGGER.info('Terminating...') + grpc_service.stop() + + LOGGER.info('Bye') + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/load_generator/tests/__init__.py b/src/load_generator/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/load_generator/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/load_generator/tests/deploy_specs.sh b/src/load_generator/tests/deploy_specs.sh new file mode 100755 index 0000000000000000000000000000000000000000..571990ecabfbf120b517f44fd99b4550a4b8a9a1 --- /dev/null +++ b/src/load_generator/tests/deploy_specs.sh @@ -0,0 +1,40 @@ +# 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. + +# Set the URL of your local Docker registry where the images will be uploaded to. +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 +# 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 + +# Set the tag you want to use for your images. +export TFS_IMAGE_TAG="dev" + +# Set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE="tfs" + +# Set additional manifest files to be applied after the deployment +export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml manifests/servicemonitors.yaml" + +# Set the new Grafana admin password +export TFS_GRAFANA_PASSWORD="admin123+" + +# If not already set, disable skip-build flag. +# If TFS_SKIP_BUILD is "YES", the containers are not rebuilt-retagged-repushed and existing ones are used. +export TFS_SKIP_BUILD="NO" #${TFS_SKIP_BUILD:-"YES"} diff --git a/src/load_generator/tests/descriptors.json b/src/load_generator/tests/descriptors.json new file mode 100644 index 0000000000000000000000000000000000000000..5fb0c086749cab3343277c28a902b3db48651320 --- /dev/null +++ b/src/load_generator/tests/descriptors.json @@ -0,0 +1,229 @@ +{ + "contexts": [ + { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_ids": [], "service_ids": [] + } + ], + "topologies": [ + { + "topology_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_uuid": {"uuid": "admin"} + }, + "device_ids": [ + {"device_uuid": {"uuid": "R1"}}, + {"device_uuid": {"uuid": "R2"}}, + {"device_uuid": {"uuid": "R3"}}, + {"device_uuid": {"uuid": "R4"}}, + {"device_uuid": {"uuid": "R5"}}, + {"device_uuid": {"uuid": "R6"}}, + {"device_uuid": {"uuid": "R7"}} + ], + "link_ids": [ + {"link_uuid": {"uuid": "R1==R2"}}, + {"link_uuid": {"uuid": "R2==R3"}}, + {"link_uuid": {"uuid": "R3==R4"}}, + {"link_uuid": {"uuid": "R4==R5"}}, + {"link_uuid": {"uuid": "R5==R6"}}, + {"link_uuid": {"uuid": "R6==R1"}}, + {"link_uuid": {"uuid": "R1==R7"}}, + {"link_uuid": {"uuid": "R3==R7"}}, + {"link_uuid": {"uuid": "R5==R7"}} + ] + } + ], + "devices": [ + { + "device_id": {"device_uuid": {"uuid": "R1"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper", "uuid": "1/1"}, + {"sample_types": [], "type": "copper", "uuid": "1/2"}, + {"sample_types": [], "type": "copper", "uuid": "1/3"}, + {"sample_types": [], "type": "copper", "uuid": "1/4"}, + {"sample_types": [], "type": "copper", "uuid": "1/5"}, + {"sample_types": [], "type": "copper", "uuid": "1/6"}, + {"sample_types": [], "type": "copper", "uuid": "2/1"}, + {"sample_types": [], "type": "copper", "uuid": "2/2"}, + {"sample_types": [], "type": "copper", "uuid": "2/3"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R2"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper", "uuid": "1/1"}, + {"sample_types": [], "type": "copper", "uuid": "1/2"}, + {"sample_types": [], "type": "copper", "uuid": "1/3"}, + {"sample_types": [], "type": "copper", "uuid": "1/4"}, + {"sample_types": [], "type": "copper", "uuid": "1/5"}, + {"sample_types": [], "type": "copper", "uuid": "1/6"}, + {"sample_types": [], "type": "copper", "uuid": "2/1"}, + {"sample_types": [], "type": "copper", "uuid": "2/2"}, + {"sample_types": [], "type": "copper", "uuid": "2/3"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R3"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper", "uuid": "1/1"}, + {"sample_types": [], "type": "copper", "uuid": "1/2"}, + {"sample_types": [], "type": "copper", "uuid": "1/3"}, + {"sample_types": [], "type": "copper", "uuid": "1/4"}, + {"sample_types": [], "type": "copper", "uuid": "1/5"}, + {"sample_types": [], "type": "copper", "uuid": "1/6"}, + {"sample_types": [], "type": "copper", "uuid": "2/1"}, + {"sample_types": [], "type": "copper", "uuid": "2/2"}, + {"sample_types": [], "type": "copper", "uuid": "2/3"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R4"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper", "uuid": "1/1"}, + {"sample_types": [], "type": "copper", "uuid": "1/2"}, + {"sample_types": [], "type": "copper", "uuid": "1/3"}, + {"sample_types": [], "type": "copper", "uuid": "1/4"}, + {"sample_types": [], "type": "copper", "uuid": "1/5"}, + {"sample_types": [], "type": "copper", "uuid": "1/6"}, + {"sample_types": [], "type": "copper", "uuid": "2/1"}, + {"sample_types": [], "type": "copper", "uuid": "2/2"}, + {"sample_types": [], "type": "copper", "uuid": "2/3"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R5"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper", "uuid": "1/1"}, + {"sample_types": [], "type": "copper", "uuid": "1/2"}, + {"sample_types": [], "type": "copper", "uuid": "1/3"}, + {"sample_types": [], "type": "copper", "uuid": "1/4"}, + {"sample_types": [], "type": "copper", "uuid": "1/5"}, + {"sample_types": [], "type": "copper", "uuid": "1/6"}, + {"sample_types": [], "type": "copper", "uuid": "2/1"}, + {"sample_types": [], "type": "copper", "uuid": "2/2"}, + {"sample_types": [], "type": "copper", "uuid": "2/3"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R6"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper", "uuid": "1/1"}, + {"sample_types": [], "type": "copper", "uuid": "1/2"}, + {"sample_types": [], "type": "copper", "uuid": "1/3"}, + {"sample_types": [], "type": "copper", "uuid": "1/4"}, + {"sample_types": [], "type": "copper", "uuid": "1/5"}, + {"sample_types": [], "type": "copper", "uuid": "1/6"}, + {"sample_types": [], "type": "copper", "uuid": "2/1"}, + {"sample_types": [], "type": "copper", "uuid": "2/2"}, + {"sample_types": [], "type": "copper", "uuid": "2/3"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R7"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper", "uuid": "1/1"}, + {"sample_types": [], "type": "copper", "uuid": "1/2"}, + {"sample_types": [], "type": "copper", "uuid": "1/3"}, + {"sample_types": [], "type": "copper", "uuid": "2/1"}, + {"sample_types": [], "type": "copper", "uuid": "2/2"}, + {"sample_types": [], "type": "copper", "uuid": "2/3"}, + {"sample_types": [], "type": "copper", "uuid": "2/4"}, + {"sample_types": [], "type": "copper", "uuid": "2/5"}, + {"sample_types": [], "type": "copper", "uuid": "2/6"} + ]}}} + ]} + } + ], + "links": [ + { + "link_id": {"link_uuid": {"uuid": "R1==R2"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1"}}, "endpoint_uuid": {"uuid": "2/1"}}, + {"device_id": {"device_uuid": {"uuid": "R2"}}, "endpoint_uuid": {"uuid": "2/2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2==R3"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2"}}, "endpoint_uuid": {"uuid": "2/1"}}, + {"device_id": {"device_uuid": {"uuid": "R3"}}, "endpoint_uuid": {"uuid": "2/2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R3==R4"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3"}}, "endpoint_uuid": {"uuid": "2/1"}}, + {"device_id": {"device_uuid": {"uuid": "R4"}}, "endpoint_uuid": {"uuid": "2/2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R4==R5"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R4"}}, "endpoint_uuid": {"uuid": "2/1"}}, + {"device_id": {"device_uuid": {"uuid": "R5"}}, "endpoint_uuid": {"uuid": "2/2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R5==R6"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R5"}}, "endpoint_uuid": {"uuid": "2/1"}}, + {"device_id": {"device_uuid": {"uuid": "R6"}}, "endpoint_uuid": {"uuid": "2/2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R6==R1"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R6"}}, "endpoint_uuid": {"uuid": "2/1"}}, + {"device_id": {"device_uuid": {"uuid": "R1"}}, "endpoint_uuid": {"uuid": "2/2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R1==R7"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1"}}, "endpoint_uuid": {"uuid": "2/3"}}, + {"device_id": {"device_uuid": {"uuid": "R7"}}, "endpoint_uuid": {"uuid": "2/1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R3==R7"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3"}}, "endpoint_uuid": {"uuid": "2/3"}}, + {"device_id": {"device_uuid": {"uuid": "R7"}}, "endpoint_uuid": {"uuid": "2/3"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R5==R7"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R5"}}, "endpoint_uuid": {"uuid": "2/3"}}, + {"device_id": {"device_uuid": {"uuid": "R7"}}, "endpoint_uuid": {"uuid": "2/5"}} + ] + } + ] +} \ No newline at end of file diff --git a/src/load_generator/tests/test_dlt_functional.py b/src/load_generator/tests/test_dlt_functional.py new file mode 100644 index 0000000000000000000000000000000000000000..764b0432053902b5533cc7844fcb12f42888de83 --- /dev/null +++ b/src/load_generator/tests/test_dlt_functional.py @@ -0,0 +1,73 @@ +# 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 +from common.proto.context_pb2 import ( + DEVICEOPERATIONALSTATUS_ENABLED, Device, DeviceId, LinkId, ServiceId, SliceId, TopologyId) +from common.proto.dlt_connector_pb2 import DltDeviceId, DltLinkId, DltServiceId, DltSliceId +from common.tools.object_factory.Device import json_device +from common.tools.object_factory.Topology import json_topology_id +from context.client.ContextClient import ContextClient +from dlt.connector.client.DltConnectorClient import DltConnectorClient + +def record_device_to_dlt( + dlt_connector_client : DltConnectorClient, domain_id : TopologyId, device_id : DeviceId, delete : bool = False +) -> None: + dlt_device_id = DltDeviceId() + dlt_device_id.topology_id.CopyFrom(domain_id) # pylint: disable=no-member + dlt_device_id.device_id.CopyFrom(device_id) # pylint: disable=no-member + dlt_device_id.delete = delete + dlt_connector_client.RecordDevice(dlt_device_id) + +def record_link_to_dlt( + dlt_connector_client : DltConnectorClient, domain_id : TopologyId, link_id : LinkId, delete : bool = False +) -> None: + dlt_link_id = DltLinkId() + dlt_link_id.topology_id.CopyFrom(domain_id) # pylint: disable=no-member + dlt_link_id.link_id.CopyFrom(link_id) # pylint: disable=no-member + dlt_link_id.delete = delete + dlt_connector_client.RecordLink(dlt_link_id) + +def record_service_to_dlt( + dlt_connector_client : DltConnectorClient, domain_id : TopologyId, service_id : ServiceId, delete : bool = False +) -> None: + dlt_service_id = DltServiceId() + dlt_service_id.topology_id.CopyFrom(domain_id) # pylint: disable=no-member + dlt_service_id.service_id.CopyFrom(service_id) # pylint: disable=no-member + dlt_service_id.delete = delete + dlt_connector_client.RecordService(dlt_service_id) + +def record_slice_to_dlt( + dlt_connector_client : DltConnectorClient, domain_id : TopologyId, slice_id : SliceId, delete : bool = False +) -> None: + dlt_slice_id = DltSliceId() + dlt_slice_id.topology_id.CopyFrom(domain_id) # pylint: disable=no-member + dlt_slice_id.slice_id.CopyFrom(slice_id) # pylint: disable=no-member + dlt_slice_id.delete = delete + dlt_connector_client.RecordSlice(dlt_slice_id) + +def main(): + context_client = ContextClient() + dlt_connector_client = DltConnectorClient() + + device = Device(**json_device('test-device', 'packet-router', DEVICEOPERATIONALSTATUS_ENABLED)) + device_id = context_client.SetDevice(device) + + dlt_domain_id = TopologyId(**json_topology_id('dlt-func-test')) + record_device_to_dlt(dlt_connector_client, dlt_domain_id, device_id, delete=False) + + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/monitoring/.gitignore b/src/monitoring/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..ac497892a71b6dda0ef118a1d174a5409849a201 --- /dev/null +++ b/src/monitoring/.gitignore @@ -0,0 +1,3 @@ +# Ignoring specific folders/files used internally while coding Monitoring component +proto/ +genproto_win.sh diff --git a/src/monitoring/.gitlab-ci.yml b/src/monitoring/.gitlab-ci.yml index f715417765de6d7517f2430e9bf3a2a9937fa8d6..ff620c53425f8f447dcb00ea03bc4c9f8ce4c5e9 100644 --- a/src/monitoring/.gitlab-ci.yml +++ b/src/monitoring/.gitlab-ci.yml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Build, tag and push the Docker image to the GitLab registry +# Build, tag, and push the Docker image to the GitLab Docker registry build monitoring: variables: IMAGE_NAME: 'monitoring' # name of the microservice @@ -21,15 +21,17 @@ build monitoring: before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile . - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" after_script: - docker images --filter="dangling=true" --quiet | xargs -r docker rmi rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: + - src/common/**/*.py + - proto/*.proto - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py @@ -37,7 +39,7 @@ build monitoring: - .gitlab-ci.yml # Apply unit test to the component -unit test monitoring: +unit_test monitoring: variables: IMAGE_NAME: 'monitoring' # name of the microservice IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) @@ -47,28 +49,30 @@ unit test monitoring: before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi - - if docker container ls | grep influxdb; then docker rm -f influxdb; else echo "influxdb image is not in the system"; fi + - if docker container ls | grep questdb; then docker rm -f questdb; else echo "questdb image is not in the system"; fi - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi script: - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - - docker run --name influxdb -d -p 8086:8086 -e INFLUXDB_DB=$INFLUXDB_DATABASE -e INFLUXDB_ADMIN_USER=$INFLUXDB_USER -e INFLUXDB_ADMIN_PASSWORD=$INFLUXDB_PASSWORD -e INFLUXDB_HTTP_AUTH_ENABLED=True --network=teraflowbridge --rm influxdb:1.8 + - docker pull questdb/questdb + - docker run --name questdb -d -p 9000:9000 -p 9009:9009 -p 8812:8812 -p 9003:9003 -e QDB_CAIRO_COMMIT_LAG=1000 -e QDB_CAIRO_MAX_UNCOMMITTED_ROWS=100000 --network=teraflowbridge --rm questdb/questdb - sleep 10 - - docker run --name $IMAGE_NAME -d -p 7070:7070 --env INFLUXDB_USER=$INFLUXDB_USER --env INFLUXDB_PASSWORD=$INFLUXDB_PASSWORD --env INFLUXDB_DATABASE=$INFLUXDB_DATABASE --env INFLUXDB_HOSTNAME=influxdb --env INFLUXDB_PORT=8086 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge --rm $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG + - docker run --name $IMAGE_NAME -d -p 7070:7070 --env METRICSDB_HOSTNAME=questdb --env METRICSDB_ILP_PORT=9009 --env METRICSDB_REST_PORT=9000 --env METRICSDB_TABLE=monitoring -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG - sleep 30 - docker ps -a - docker logs $IMAGE_NAME - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" - - docker exec -i $IMAGE_NAME bash -c "coverage xml -o /opt/results/${IMAGE_NAME}_coverage.xml" - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: - docker rm -f $IMAGE_NAME - - docker rm -f influxdb + - docker rm -f questdb - docker network rm teraflowbridge rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: + - src/common/**/*.py + - proto/*.proto - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py @@ -79,30 +83,29 @@ unit test monitoring: when: always reports: junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml - cobertura: src/$IMAGE_NAME/tests/${IMAGE_NAME}_coverage.xml - -# Deployment of the service in Kubernetes Cluster -deploy monitoring: - variables: - IMAGE_NAME: 'monitoring' # name of the microservice - IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) - stage: deploy - needs: - - unit test monitoring - # - integ_test execute - script: - - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' - - kubectl version - - kubectl get all - - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" - - kubectl get all - # environment: - # name: test - # url: https://example.com - # kubernetes: - # namespace: test - rules: - - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - when: manual - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - when: manual + +## Deployment of the service in Kubernetes Cluster +#deploy monitoring: +# variables: +# IMAGE_NAME: 'monitoring' # name of the microservice +# IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) +# stage: deploy +# needs: +# - unit test monitoring +# # - integ_test execute +# script: +# - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' +# - kubectl version +# - kubectl get all +# - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" +# - kubectl get all +# # environment: +# # name: test +# # url: https://example.com +# # kubernetes: +# # namespace: test +# rules: +# - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' +# when: manual +# - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' +# when: manual diff --git a/src/monitoring/Config.py b/src/monitoring/Config.py deleted file mode 100644 index cbae00509d8196b69bc2d6bacb39bfa5918be495..0000000000000000000000000000000000000000 --- a/src/monitoring/Config.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import logging - -# General settings -LOG_LEVEL = logging.WARNING - -# gRPC settings -GRPC_SERVICE_PORT = 7070 -GRPC_MAX_WORKERS = 10 -GRPC_GRACE_PERIOD = 60 -GRPC_SERVICE_HOST = '127.0.0.1' - -# Prometheus settings -METRICS_PORT = 9192 - -# Dependency micro-service connection settings -CONTEXT_SERVICE_HOST = '127.0.0.1' -CONTEXT_GRPC_SERVICE_PORT = 1010 - -DEVICE_SERVICE_HOST = '127.0.0.1' -DEVICE_GRPC_SERVICE_PORT = 2020 -DEVICE_GRPC_MAX_WORKERS = 10 -DEVICE_GRPC_GRACE_PERIOD = 60 - - - - diff --git a/src/monitoring/Dockerfile b/src/monitoring/Dockerfile index c1bba549eaaf5cfaaacd16d01a9d2204bc09c393..946f2cd1b5d16923aa1509948c759135c7f78eef 100644 --- a/src/monitoring/Dockerfile +++ b/src/monitoring/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,54 +12,59 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM python:3-slim +FROM python:3.9-slim # Install dependencies RUN apt-get --yes --quiet --quiet update && \ apt-get --yes --quiet --quiet install wget g++ && \ rm -rf /var/lib/apt/lists/* -# show python logs as they occur +# Set Python to show logs as they occur ENV PYTHONUNBUFFERED=0 -# download the grpc health probe +# Download the gRPC health probe RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ chmod +x /bin/grpc_health_probe # Get generic Python packages -RUN python3 -m pip install --upgrade pip setuptools wheel pip-tools +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools -# Set working directory +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components WORKDIR /var/teraflow +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt -# Create module sub-folders -RUN mkdir -p /var/teraflow/monitoring -RUN mkdir -p /var/teraflow/common -RUN mkdir -p /var/teraflow/common/tools -RUN mkdir -p /var/teraflow/common/rpc_method_wrapper -RUN mkdir -p /var/teraflow/device -RUN mkdir -p /var/teraflow/device/proto -RUN mkdir -p /var/teraflow/device/client -RUN mkdir -p /var/teraflow/context +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto -# Get Python packages per module -COPY monitoring/requirements.in requirements.in -RUN pip-compile --output-file=requirements.txt requirements.in -RUN python3 -m pip install -r requirements.txt +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; -# add files into working directory -COPY monitoring/. monitoring -COPY device/proto/. device/proto -COPY device/client/. device/client -COPY device/Config.py device -COPY common/. common -COPY context/. context +# Create component sub-folders, get specific Python packages +RUN mkdir -p /var/teraflow/monitoring +WORKDIR /var/teraflow/monitoring +COPY src/monitoring/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN python3 -m pip install -r requirements.txt -RUN rm -r common/message_broker/tests -RUN rm -r common/orm/tests -RUN rm -r common/rpc_method_wrapper/tests -RUN rm -r context/tests/test_unitary.py +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/context/. context/ +COPY src/device/. device/ +COPY src/monitoring/. monitoring/ +# Start the service ENTRYPOINT ["python", "-m", "monitoring.service"] - diff --git a/src/monitoring/__init__.py b/src/monitoring/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/monitoring/__init__.py +++ b/src/monitoring/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/monitoring/client/MonitoringClient.py b/src/monitoring/client/MonitoringClient.py new file mode 100644 index 0000000000000000000000000000000000000000..751ff6e38e52a9d09d170c440ced0a04a44e10a3 --- /dev/null +++ b/src/monitoring/client/MonitoringClient.py @@ -0,0 +1,183 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import grpc, logging +from typing import Iterator +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc + +from common.tools.client.RetryDecorator import retry, delay_exponential +from common.tools.grpc.Tools import grpc_message_to_json_string +from common.proto.context_pb2 import Empty +from common.proto.monitoring_pb2 import Kpi, KpiDescriptor, KpiId, MonitorKpiRequest, \ + KpiDescriptorList, KpiQuery, KpiList, SubsDescriptor, SubscriptionID, SubsList, \ + SubsResponse, AlarmDescriptor, AlarmID, AlarmList, AlarmResponse, AlarmSubscription, RawKpiTable +from common.proto.monitoring_pb2_grpc import MonitoringServiceStub + +LOGGER = logging.getLogger(__name__) +MAX_RETRIES = 15 +DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + +class MonitoringClient: + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.MONITORING) + if not port: port = get_service_port_grpc(ServiceNameEnum.MONITORING) + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) + LOGGER.debug('Creating channel to {:s}...'.format(str(self.endpoint))) + self.channel = None + self.stub = None + self.connect() + LOGGER.debug('Channel created') + + def connect(self): + self.channel = grpc.insecure_channel(self.endpoint) + self.stub = MonitoringServiceStub(self.channel) + + def close(self): + if self.channel is not None: self.channel.close() + self.channel = None + self.stub = None + + @RETRY_DECORATOR + def SetKpi(self, request : KpiDescriptor) -> KpiId: + LOGGER.debug('SetKpi: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.SetKpi(request) + LOGGER.debug('SetKpi result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def DeleteKpi(self,request : KpiId) -> Empty: + LOGGER.debug('DeleteKpi: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.DeleteKpi(request) + LOGGER.info('DeleteKpi result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetKpiDescriptor(self, request : KpiId) -> KpiDescriptor: + LOGGER.debug('GetKpiDescriptor: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetKpiDescriptor(request) + LOGGER.debug('GetKpiDescriptor result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetKpiDescriptorList(self, request : Empty) -> KpiDescriptorList: + LOGGER.debug('GetKpiDescriptorList: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetKpiDescriptorList(request) + LOGGER.debug('GetKpiDescriptorList result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def IncludeKpi(self, request : Kpi) -> Empty: + LOGGER.debug('IncludeKpi: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.IncludeKpi(request) + LOGGER.debug('IncludeKpi result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def MonitorKpi(self, request : MonitorKpiRequest) -> Empty: + LOGGER.debug('MonitorKpi: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.MonitorKpi(request) + LOGGER.debug('MonitorKpi result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def QueryKpiData(self, request : KpiQuery) -> RawKpiTable: + LOGGER.debug('QueryKpiData: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.QueryKpiData(request) + LOGGER.debug('QueryKpiData result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def SetKpiSubscription(self, request : SubsDescriptor) -> Iterator[SubsResponse]: + LOGGER.debug('SetKpiSubscription: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.SetKpiSubscription(request) + LOGGER.debug('SetKpiSubscription result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetSubsDescriptor(self, request : SubscriptionID) -> SubsDescriptor: + LOGGER.debug('GetSubsDescriptor: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetSubsDescriptor(request) + LOGGER.debug('GetSubsDescriptor result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetSubscriptions(self, request : Empty) -> SubsList: + LOGGER.debug('GetSubscriptions: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetSubscriptions(request) + LOGGER.debug('GetSubscriptions result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def DeleteSubscription(self, request : SubscriptionID) -> Empty: + LOGGER.debug('DeleteSubscription: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.DeleteSubscription(request) + LOGGER.debug('DeleteSubscription result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def SetKpiAlarm(self, request : AlarmDescriptor) -> AlarmID: + LOGGER.debug('SetKpiAlarm: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.SetKpiAlarm(request) + LOGGER.debug('SetKpiAlarm result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetAlarms(self, request : Empty) -> AlarmList: + LOGGER.debug('GetAlarms: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetAlarms(request) + LOGGER.debug('GetAlarms result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + def GetAlarmDescriptor(self, request : AlarmID) -> AlarmDescriptor: + LOGGER.debug('GetAlarmDescriptor: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetAlarmDescriptor(request) + LOGGER.debug('GetAlarmDescriptor result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + def GetAlarmResponseStream(self, request : AlarmSubscription) -> AlarmResponse: + LOGGER.debug('GetAlarmResponseStream: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetAlarmResponseStream(request) + LOGGER.debug('GetAlarmResponseStream result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + def DeleteAlarm(self, request : AlarmID) -> Empty: + LOGGER.debug('DeleteAlarm: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.DeleteAlarm(request) + LOGGER.debug('DeleteAlarm result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetStreamKpi(self, request : KpiId) -> Iterator[Kpi]: + LOGGER.debug('GetStreamKpi: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetStreamKpi(request) + LOGGER.debug('GetStreamKpi result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def GetInstantKpi(self, request : KpiId) -> Kpi: + LOGGER.debug('GetInstantKpi: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.GetInstantKpi(request) + LOGGER.debug('GetInstantKpi result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + +if __name__ == '__main__': + import sys + # get port + _port = sys.argv[1] if len(sys.argv) > 1 else '7070' + + # make call to server + client = MonitoringClient(port=_port) diff --git a/src/monitoring/client/__init__.py b/src/monitoring/client/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/monitoring/client/__init__.py +++ b/src/monitoring/client/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/monitoring/client/monitoring_client.py b/src/monitoring/client/monitoring_client.py deleted file mode 100644 index 62bfb519e7649427cad5b8f9e3bc0f849a9b9a39..0000000000000000000000000000000000000000 --- a/src/monitoring/client/monitoring_client.py +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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 grpc - -from monitoring.proto import monitoring_pb2 -from monitoring.proto import monitoring_pb2_grpc -from monitoring.proto import context_pb2 - -from common.logger import getJSONLogger -LOGGER = getJSONLogger('monitoring-client') -LOGGER.setLevel('DEBUG') - -class MonitoringClient: - - def __init__(self, server='monitoring', port='7070'): - endpoint = '{}:{}'.format(server, port) - LOGGER.info('init monitoringClient {}'.format(endpoint)) - self.channel = grpc.insecure_channel(endpoint) - self.server = monitoring_pb2_grpc.MonitoringServiceStub(self.channel) - - def CreateKpi(self, request): - LOGGER.info('CreateKpi: {}'.format(request)) - response = self.server.CreateKpi(request) - LOGGER.info('CreateKpi result: {}'.format(response)) - return response - - def MonitorKpi(self, request): - LOGGER.info('MonitorKpi: {}'.format(request)) - response = self.server.MonitorKpi(request) - LOGGER.info('MonitorKpi result: {}'.format(response)) - return response - - def IncludeKpi(self, request): - LOGGER.info('IncludeKpi: {}'.format(request)) - response = self.server.IncludeKpi(request) - LOGGER.info('IncludeKpi result: {}'.format(response)) - return response - - def GetStreamKpi(self, request): - LOGGER.info('GetStreamKpi: {}'.format(request)) - response = self.server.GetStreamKpi(request) - LOGGER.info('GetStreamKpi result: {}'.format(response)) - yield monitoring_pb2.Kpi() - - def GetInstantKpi(self, request): - LOGGER.info('GetInstantKpi: {}'.format(request)) - response = self.server.GetInstantKpi(request) - LOGGER.info('GetInstantKpi result: {}'.format(response)) - return monitoring_pb2.Kpi() - - def GetKpiDescriptor(self, request): - LOGGER.info('GetKpiDescriptor: {}'.format(request)) - response = self.server.GetKpiDescriptor(request) - LOGGER.info('GetKpiDescriptor result: {}'.format(response)) - return response - -if __name__ == '__main__': - # get port - port = sys.argv[1] if len(sys.argv) > 1 else '7070' - - # make call to server - client = MonitoringClient(port=port) diff --git a/src/monitoring/genproto.sh b/src/monitoring/genproto.sh deleted file mode 100755 index b37b49ba2078301d837610d10c10b9a095bec783..0000000000000000000000000000000000000000 --- a/src/monitoring/genproto.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -eu -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Make folder containing the script the root folder for its execution -cd $(dirname $0) - -rm -rf proto/*.py -rm -rf proto/__pycache__ -touch proto/__init__.py - -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto monitoring.proto -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto kpi_sample_types.proto - -rm proto/context_pb2_grpc.py -rm proto/kpi_sample_types_pb2_grpc.py - -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/monitoring_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/monitoring_pb2_grpc.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/context_pb2.py diff --git a/src/monitoring/proto/__init__.py b/src/monitoring/proto/__init__.py deleted file mode 100644 index 70a33251242c51f49140e596b8208a19dd5245f7..0000000000000000000000000000000000000000 --- a/src/monitoring/proto/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - diff --git a/src/monitoring/proto/context_pb2.py b/src/monitoring/proto/context_pb2.py deleted file mode 100644 index 68602b16f264ceac9acc3ef6669b09d5984e72c2..0000000000000000000000000000000000000000 --- a/src/monitoring/proto/context_pb2.py +++ /dev/null @@ -1,2662 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: context.proto -"""Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import kpi_sample_types_pb2 as kpi__sample__types__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='context.proto', - package='context', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xad\x10\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' - , - dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) - -_EVENTTYPEENUM = _descriptor.EnumDescriptor( - name='EventTypeEnum', - full_name='context.EventTypeEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_CREATE', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_UPDATE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_REMOVE', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3703, - serialized_end=3809, -) -_sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) - -EventTypeEnum = enum_type_wrapper.EnumTypeWrapper(_EVENTTYPEENUM) -_DEVICEDRIVERENUM = _descriptor.EnumDescriptor( - name='DeviceDriverEnum', - full_name='context.DeviceDriverEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_OPENCONFIG', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_TRANSPORT_API', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_P4', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_IETF_NETWORK_TOPOLOGY', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_ONF_TR_352', index=5, number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3812, - serialized_end=4009, -) -_sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) - -DeviceDriverEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEDRIVERENUM) -_DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( - name='DeviceOperationalStatusEnum', - full_name='context.DeviceOperationalStatusEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_DISABLED', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_ENABLED', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4012, - serialized_end=4155, -) -_sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) - -DeviceOperationalStatusEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEOPERATIONALSTATUSENUM) -_SERVICETYPEENUM = _descriptor.EnumDescriptor( - name='ServiceTypeEnum', - full_name='context.ServiceTypeEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_L3NM', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_L2NM', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_TAPI_CONNECTIVITY_SERVICE', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4158, - serialized_end=4287, -) -_sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) - -ServiceTypeEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICETYPEENUM) -_SERVICESTATUSENUM = _descriptor.EnumDescriptor( - name='ServiceStatusEnum', - full_name='context.ServiceStatusEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_PLANNED', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_ACTIVE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_PENDING_REMOVAL', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4290, - serialized_end=4426, -) -_sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) - -ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) -_CONFIGACTIONENUM = _descriptor.EnumDescriptor( - name='ConfigActionEnum', - full_name='context.ConfigActionEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_SET', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_DELETE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4428, - serialized_end=4521, -) -_sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) - -ConfigActionEnum = enum_type_wrapper.EnumTypeWrapper(_CONFIGACTIONENUM) -EVENTTYPE_UNDEFINED = 0 -EVENTTYPE_CREATE = 1 -EVENTTYPE_UPDATE = 2 -EVENTTYPE_REMOVE = 3 -DEVICEDRIVER_UNDEFINED = 0 -DEVICEDRIVER_OPENCONFIG = 1 -DEVICEDRIVER_TRANSPORT_API = 2 -DEVICEDRIVER_P4 = 3 -DEVICEDRIVER_IETF_NETWORK_TOPOLOGY = 4 -DEVICEDRIVER_ONF_TR_352 = 5 -DEVICEOPERATIONALSTATUS_UNDEFINED = 0 -DEVICEOPERATIONALSTATUS_DISABLED = 1 -DEVICEOPERATIONALSTATUS_ENABLED = 2 -SERVICETYPE_UNKNOWN = 0 -SERVICETYPE_L3NM = 1 -SERVICETYPE_L2NM = 2 -SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3 -SERVICESTATUS_UNDEFINED = 0 -SERVICESTATUS_PLANNED = 1 -SERVICESTATUS_ACTIVE = 2 -SERVICESTATUS_PENDING_REMOVAL = 3 -CONFIGACTION_UNDEFINED = 0 -CONFIGACTION_SET = 1 -CONFIGACTION_DELETE = 2 - - - -_EMPTY = _descriptor.Descriptor( - name='Empty', - full_name='context.Empty', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=50, - serialized_end=57, -) - - -_UUID = _descriptor.Descriptor( - name='Uuid', - full_name='context.Uuid', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='uuid', full_name='context.Uuid.uuid', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=59, - serialized_end=79, -) - - -_EVENT = _descriptor.Descriptor( - name='Event', - full_name='context.Event', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='timestamp', full_name='context.Event.timestamp', index=0, - number=1, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='event_type', full_name='context.Event.event_type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=81, - serialized_end=151, -) - - -_CONTEXTID = _descriptor.Descriptor( - name='ContextId', - full_name='context.ContextId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_uuid', full_name='context.ContextId.context_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=153, - serialized_end=201, -) - - -_CONTEXT = _descriptor.Descriptor( - name='Context', - full_name='context.Context', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.Context.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_ids', full_name='context.Context.topology_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_ids', full_name='context.Context.service_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='controller', full_name='context.Context.controller', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=204, - serialized_end=386, -) - - -_CONTEXTIDLIST = _descriptor.Descriptor( - name='ContextIdList', - full_name='context.ContextIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_ids', full_name='context.ContextIdList.context_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=388, - serialized_end=444, -) - - -_CONTEXTLIST = _descriptor.Descriptor( - name='ContextList', - full_name='context.ContextList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='contexts', full_name='context.ContextList.contexts', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=446, - serialized_end=495, -) - - -_CONTEXTEVENT = _descriptor.Descriptor( - name='ContextEvent', - full_name='context.ContextEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.ContextEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='context_id', full_name='context.ContextEvent.context_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=497, - serialized_end=582, -) - - -_TOPOLOGYID = _descriptor.Descriptor( - name='TopologyId', - full_name='context.TopologyId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.TopologyId.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_uuid', full_name='context.TopologyId.topology_uuid', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=584, - serialized_end=674, -) - - -_TOPOLOGY = _descriptor.Descriptor( - name='Topology', - full_name='context.Topology', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.Topology.topology_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_ids', full_name='context.Topology.device_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_ids', full_name='context.Topology.link_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=676, - serialized_end=802, -) - - -_TOPOLOGYIDLIST = _descriptor.Descriptor( - name='TopologyIdList', - full_name='context.TopologyIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_ids', full_name='context.TopologyIdList.topology_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=804, - serialized_end=863, -) - - -_TOPOLOGYLIST = _descriptor.Descriptor( - name='TopologyList', - full_name='context.TopologyList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topologies', full_name='context.TopologyList.topologies', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=865, - serialized_end=918, -) - - -_TOPOLOGYEVENT = _descriptor.Descriptor( - name='TopologyEvent', - full_name='context.TopologyEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.TopologyEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.TopologyEvent.topology_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=920, - serialized_end=1008, -) - - -_DEVICEID = _descriptor.Descriptor( - name='DeviceId', - full_name='context.DeviceId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_uuid', full_name='context.DeviceId.device_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1010, - serialized_end=1056, -) - - -_DEVICE = _descriptor.Descriptor( - name='Device', - full_name='context.Device', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_id', full_name='context.Device.device_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_type', full_name='context.Device.device_type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_config', full_name='context.Device.device_config', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_operational_status', full_name='context.Device.device_operational_status', index=3, - number=4, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_drivers', full_name='context.Device.device_drivers', index=4, - number=5, type=14, cpp_type=8, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_endpoints', full_name='context.Device.device_endpoints', index=5, - number=6, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1059, - serialized_end=1341, -) - - -_DEVICECONFIG = _descriptor.Descriptor( - name='DeviceConfig', - full_name='context.DeviceConfig', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='config_rules', full_name='context.DeviceConfig.config_rules', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1343, - serialized_end=1400, -) - - -_DEVICEIDLIST = _descriptor.Descriptor( - name='DeviceIdList', - full_name='context.DeviceIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_ids', full_name='context.DeviceIdList.device_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1402, - serialized_end=1455, -) - - -_DEVICELIST = _descriptor.Descriptor( - name='DeviceList', - full_name='context.DeviceList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='devices', full_name='context.DeviceList.devices', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1457, - serialized_end=1503, -) - - -_DEVICEEVENT = _descriptor.Descriptor( - name='DeviceEvent', - full_name='context.DeviceEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.DeviceEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='context.DeviceEvent.device_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1505, - serialized_end=1587, -) - - -_LINKID = _descriptor.Descriptor( - name='LinkId', - full_name='context.LinkId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_uuid', full_name='context.LinkId.link_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1589, - serialized_end=1631, -) - - -_LINK = _descriptor.Descriptor( - name='Link', - full_name='context.Link', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_id', full_name='context.Link.link_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_endpoint_ids', full_name='context.Link.link_endpoint_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1633, - serialized_end=1721, -) - - -_LINKIDLIST = _descriptor.Descriptor( - name='LinkIdList', - full_name='context.LinkIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_ids', full_name='context.LinkIdList.link_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1723, - serialized_end=1770, -) - - -_LINKLIST = _descriptor.Descriptor( - name='LinkList', - full_name='context.LinkList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='links', full_name='context.LinkList.links', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1772, - serialized_end=1812, -) - - -_LINKEVENT = _descriptor.Descriptor( - name='LinkEvent', - full_name='context.LinkEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.LinkEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_id', full_name='context.LinkEvent.link_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1814, - serialized_end=1890, -) - - -_SERVICEID = _descriptor.Descriptor( - name='ServiceId', - full_name='context.ServiceId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.ServiceId.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_uuid', full_name='context.ServiceId.service_uuid', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1892, - serialized_end=1980, -) - - -_SERVICE = _descriptor.Descriptor( - name='Service', - full_name='context.Service', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_id', full_name='context.Service.service_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_type', full_name='context.Service.service_type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_endpoint_ids', full_name='context.Service.service_endpoint_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_constraints', full_name='context.Service.service_constraints', index=3, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_status', full_name='context.Service.service_status', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_config', full_name='context.Service.service_config', index=5, - number=6, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1983, - serialized_end=2277, -) - - -_SERVICESTATUS = _descriptor.Descriptor( - name='ServiceStatus', - full_name='context.ServiceStatus', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_status', full_name='context.ServiceStatus.service_status', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2279, - serialized_end=2346, -) - - -_SERVICECONFIG = _descriptor.Descriptor( - name='ServiceConfig', - full_name='context.ServiceConfig', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='config_rules', full_name='context.ServiceConfig.config_rules', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2348, - serialized_end=2406, -) - - -_SERVICEIDLIST = _descriptor.Descriptor( - name='ServiceIdList', - full_name='context.ServiceIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_ids', full_name='context.ServiceIdList.service_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2408, - serialized_end=2464, -) - - -_SERVICELIST = _descriptor.Descriptor( - name='ServiceList', - full_name='context.ServiceList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='services', full_name='context.ServiceList.services', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2466, - serialized_end=2515, -) - - -_SERVICEEVENT = _descriptor.Descriptor( - name='ServiceEvent', - full_name='context.ServiceEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.ServiceEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_id', full_name='context.ServiceEvent.service_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2517, - serialized_end=2602, -) - - -_CONNECTIONID = _descriptor.Descriptor( - name='ConnectionId', - full_name='context.ConnectionId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_uuid', full_name='context.ConnectionId.connection_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2604, - serialized_end=2658, -) - - -_CONNECTION = _descriptor.Descriptor( - name='Connection', - full_name='context.Connection', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_id', full_name='context.Connection.connection_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_id', full_name='context.Connection.service_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='path_hops_endpoint_ids', full_name='context.Connection.path_hops_endpoint_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sub_service_ids', full_name='context.Connection.sub_service_ids', index=3, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2661, - serialized_end=2857, -) - - -_CONNECTIONIDLIST = _descriptor.Descriptor( - name='ConnectionIdList', - full_name='context.ConnectionIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_ids', full_name='context.ConnectionIdList.connection_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2859, - serialized_end=2924, -) - - -_CONNECTIONLIST = _descriptor.Descriptor( - name='ConnectionList', - full_name='context.ConnectionList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connections', full_name='context.ConnectionList.connections', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2926, - serialized_end=2984, -) - - -_CONNECTIONEVENT = _descriptor.Descriptor( - name='ConnectionEvent', - full_name='context.ConnectionEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.ConnectionEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='connection_id', full_name='context.ConnectionEvent.connection_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2986, - serialized_end=3080, -) - - -_ENDPOINTID = _descriptor.Descriptor( - name='EndPointId', - full_name='context.EndPointId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.EndPointId.topology_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='context.EndPointId.device_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='endpoint_uuid', full_name='context.EndPointId.endpoint_uuid', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3083, - serialized_end=3213, -) - - -_ENDPOINT = _descriptor.Descriptor( - name='EndPoint', - full_name='context.EndPoint', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='endpoint_id', full_name='context.EndPoint.endpoint_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='endpoint_type', full_name='context.EndPoint.endpoint_type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kpi_sample_types', full_name='context.EndPoint.kpi_sample_types', index=2, - number=3, type=14, cpp_type=8, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3216, - serialized_end=3350, -) - - -_CONFIGRULE = _descriptor.Descriptor( - name='ConfigRule', - full_name='context.ConfigRule', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='action', full_name='context.ConfigRule.action', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='resource_key', full_name='context.ConfigRule.resource_key', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='resource_value', full_name='context.ConfigRule.resource_value', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3352, - serialized_end=3453, -) - - -_CONSTRAINT = _descriptor.Descriptor( - name='Constraint', - full_name='context.Constraint', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='constraint_type', full_name='context.Constraint.constraint_type', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='constraint_value', full_name='context.Constraint.constraint_value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3455, - serialized_end=3518, -) - - -_TERAFLOWCONTROLLER = _descriptor.Descriptor( - name='TeraFlowController', - full_name='context.TeraFlowController', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.TeraFlowController.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_address', full_name='context.TeraFlowController.ip_address', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port', full_name='context.TeraFlowController.port', index=2, - number=3, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3520, - serialized_end=3614, -) - - -_AUTHENTICATIONRESULT = _descriptor.Descriptor( - name='AuthenticationResult', - full_name='context.AuthenticationResult', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.AuthenticationResult.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='authenticated', full_name='context.AuthenticationResult.authenticated', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3616, - serialized_end=3701, -) - -_EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM -_CONTEXTID.fields_by_name['context_uuid'].message_type = _UUID -_CONTEXT.fields_by_name['context_id'].message_type = _CONTEXTID -_CONTEXT.fields_by_name['topology_ids'].message_type = _TOPOLOGYID -_CONTEXT.fields_by_name['service_ids'].message_type = _SERVICEID -_CONTEXT.fields_by_name['controller'].message_type = _TERAFLOWCONTROLLER -_CONTEXTIDLIST.fields_by_name['context_ids'].message_type = _CONTEXTID -_CONTEXTLIST.fields_by_name['contexts'].message_type = _CONTEXT -_CONTEXTEVENT.fields_by_name['event'].message_type = _EVENT -_CONTEXTEVENT.fields_by_name['context_id'].message_type = _CONTEXTID -_TOPOLOGYID.fields_by_name['context_id'].message_type = _CONTEXTID -_TOPOLOGYID.fields_by_name['topology_uuid'].message_type = _UUID -_TOPOLOGY.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_TOPOLOGY.fields_by_name['device_ids'].message_type = _DEVICEID -_TOPOLOGY.fields_by_name['link_ids'].message_type = _LINKID -_TOPOLOGYIDLIST.fields_by_name['topology_ids'].message_type = _TOPOLOGYID -_TOPOLOGYLIST.fields_by_name['topologies'].message_type = _TOPOLOGY -_TOPOLOGYEVENT.fields_by_name['event'].message_type = _EVENT -_TOPOLOGYEVENT.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_DEVICEID.fields_by_name['device_uuid'].message_type = _UUID -_DEVICE.fields_by_name['device_id'].message_type = _DEVICEID -_DEVICE.fields_by_name['device_config'].message_type = _DEVICECONFIG -_DEVICE.fields_by_name['device_operational_status'].enum_type = _DEVICEOPERATIONALSTATUSENUM -_DEVICE.fields_by_name['device_drivers'].enum_type = _DEVICEDRIVERENUM -_DEVICE.fields_by_name['device_endpoints'].message_type = _ENDPOINT -_DEVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE -_DEVICEIDLIST.fields_by_name['device_ids'].message_type = _DEVICEID -_DEVICELIST.fields_by_name['devices'].message_type = _DEVICE -_DEVICEEVENT.fields_by_name['event'].message_type = _EVENT -_DEVICEEVENT.fields_by_name['device_id'].message_type = _DEVICEID -_LINKID.fields_by_name['link_uuid'].message_type = _UUID -_LINK.fields_by_name['link_id'].message_type = _LINKID -_LINK.fields_by_name['link_endpoint_ids'].message_type = _ENDPOINTID -_LINKIDLIST.fields_by_name['link_ids'].message_type = _LINKID -_LINKLIST.fields_by_name['links'].message_type = _LINK -_LINKEVENT.fields_by_name['event'].message_type = _EVENT -_LINKEVENT.fields_by_name['link_id'].message_type = _LINKID -_SERVICEID.fields_by_name['context_id'].message_type = _CONTEXTID -_SERVICEID.fields_by_name['service_uuid'].message_type = _UUID -_SERVICE.fields_by_name['service_id'].message_type = _SERVICEID -_SERVICE.fields_by_name['service_type'].enum_type = _SERVICETYPEENUM -_SERVICE.fields_by_name['service_endpoint_ids'].message_type = _ENDPOINTID -_SERVICE.fields_by_name['service_constraints'].message_type = _CONSTRAINT -_SERVICE.fields_by_name['service_status'].message_type = _SERVICESTATUS -_SERVICE.fields_by_name['service_config'].message_type = _SERVICECONFIG -_SERVICESTATUS.fields_by_name['service_status'].enum_type = _SERVICESTATUSENUM -_SERVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE -_SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID -_SERVICELIST.fields_by_name['services'].message_type = _SERVICE -_SERVICEEVENT.fields_by_name['event'].message_type = _EVENT -_SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID -_CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID -_CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID -_CONNECTION.fields_by_name['service_id'].message_type = _SERVICEID -_CONNECTION.fields_by_name['path_hops_endpoint_ids'].message_type = _ENDPOINTID -_CONNECTION.fields_by_name['sub_service_ids'].message_type = _SERVICEID -_CONNECTIONIDLIST.fields_by_name['connection_ids'].message_type = _CONNECTIONID -_CONNECTIONLIST.fields_by_name['connections'].message_type = _CONNECTION -_CONNECTIONEVENT.fields_by_name['event'].message_type = _EVENT -_CONNECTIONEVENT.fields_by_name['connection_id'].message_type = _CONNECTIONID -_ENDPOINTID.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_ENDPOINTID.fields_by_name['device_id'].message_type = _DEVICEID -_ENDPOINTID.fields_by_name['endpoint_uuid'].message_type = _UUID -_ENDPOINT.fields_by_name['endpoint_id'].message_type = _ENDPOINTID -_ENDPOINT.fields_by_name['kpi_sample_types'].enum_type = kpi__sample__types__pb2._KPISAMPLETYPE -_CONFIGRULE.fields_by_name['action'].enum_type = _CONFIGACTIONENUM -_TERAFLOWCONTROLLER.fields_by_name['context_id'].message_type = _CONTEXTID -_AUTHENTICATIONRESULT.fields_by_name['context_id'].message_type = _CONTEXTID -DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY -DESCRIPTOR.message_types_by_name['Uuid'] = _UUID -DESCRIPTOR.message_types_by_name['Event'] = _EVENT -DESCRIPTOR.message_types_by_name['ContextId'] = _CONTEXTID -DESCRIPTOR.message_types_by_name['Context'] = _CONTEXT -DESCRIPTOR.message_types_by_name['ContextIdList'] = _CONTEXTIDLIST -DESCRIPTOR.message_types_by_name['ContextList'] = _CONTEXTLIST -DESCRIPTOR.message_types_by_name['ContextEvent'] = _CONTEXTEVENT -DESCRIPTOR.message_types_by_name['TopologyId'] = _TOPOLOGYID -DESCRIPTOR.message_types_by_name['Topology'] = _TOPOLOGY -DESCRIPTOR.message_types_by_name['TopologyIdList'] = _TOPOLOGYIDLIST -DESCRIPTOR.message_types_by_name['TopologyList'] = _TOPOLOGYLIST -DESCRIPTOR.message_types_by_name['TopologyEvent'] = _TOPOLOGYEVENT -DESCRIPTOR.message_types_by_name['DeviceId'] = _DEVICEID -DESCRIPTOR.message_types_by_name['Device'] = _DEVICE -DESCRIPTOR.message_types_by_name['DeviceConfig'] = _DEVICECONFIG -DESCRIPTOR.message_types_by_name['DeviceIdList'] = _DEVICEIDLIST -DESCRIPTOR.message_types_by_name['DeviceList'] = _DEVICELIST -DESCRIPTOR.message_types_by_name['DeviceEvent'] = _DEVICEEVENT -DESCRIPTOR.message_types_by_name['LinkId'] = _LINKID -DESCRIPTOR.message_types_by_name['Link'] = _LINK -DESCRIPTOR.message_types_by_name['LinkIdList'] = _LINKIDLIST -DESCRIPTOR.message_types_by_name['LinkList'] = _LINKLIST -DESCRIPTOR.message_types_by_name['LinkEvent'] = _LINKEVENT -DESCRIPTOR.message_types_by_name['ServiceId'] = _SERVICEID -DESCRIPTOR.message_types_by_name['Service'] = _SERVICE -DESCRIPTOR.message_types_by_name['ServiceStatus'] = _SERVICESTATUS -DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG -DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST -DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST -DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT -DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID -DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION -DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST -DESCRIPTOR.message_types_by_name['ConnectionList'] = _CONNECTIONLIST -DESCRIPTOR.message_types_by_name['ConnectionEvent'] = _CONNECTIONEVENT -DESCRIPTOR.message_types_by_name['EndPointId'] = _ENDPOINTID -DESCRIPTOR.message_types_by_name['EndPoint'] = _ENDPOINT -DESCRIPTOR.message_types_by_name['ConfigRule'] = _CONFIGRULE -DESCRIPTOR.message_types_by_name['Constraint'] = _CONSTRAINT -DESCRIPTOR.message_types_by_name['TeraFlowController'] = _TERAFLOWCONTROLLER -DESCRIPTOR.message_types_by_name['AuthenticationResult'] = _AUTHENTICATIONRESULT -DESCRIPTOR.enum_types_by_name['EventTypeEnum'] = _EVENTTYPEENUM -DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM -DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM -DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM -DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM -DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { - 'DESCRIPTOR' : _EMPTY, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Empty) - }) -_sym_db.RegisterMessage(Empty) - -Uuid = _reflection.GeneratedProtocolMessageType('Uuid', (_message.Message,), { - 'DESCRIPTOR' : _UUID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Uuid) - }) -_sym_db.RegisterMessage(Uuid) - -Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), { - 'DESCRIPTOR' : _EVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Event) - }) -_sym_db.RegisterMessage(Event) - -ContextId = _reflection.GeneratedProtocolMessageType('ContextId', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextId) - }) -_sym_db.RegisterMessage(ContextId) - -Context = _reflection.GeneratedProtocolMessageType('Context', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Context) - }) -_sym_db.RegisterMessage(Context) - -ContextIdList = _reflection.GeneratedProtocolMessageType('ContextIdList', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextIdList) - }) -_sym_db.RegisterMessage(ContextIdList) - -ContextList = _reflection.GeneratedProtocolMessageType('ContextList', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextList) - }) -_sym_db.RegisterMessage(ContextList) - -ContextEvent = _reflection.GeneratedProtocolMessageType('ContextEvent', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextEvent) - }) -_sym_db.RegisterMessage(ContextEvent) - -TopologyId = _reflection.GeneratedProtocolMessageType('TopologyId', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyId) - }) -_sym_db.RegisterMessage(TopologyId) - -Topology = _reflection.GeneratedProtocolMessageType('Topology', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGY, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Topology) - }) -_sym_db.RegisterMessage(Topology) - -TopologyIdList = _reflection.GeneratedProtocolMessageType('TopologyIdList', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyIdList) - }) -_sym_db.RegisterMessage(TopologyIdList) - -TopologyList = _reflection.GeneratedProtocolMessageType('TopologyList', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyList) - }) -_sym_db.RegisterMessage(TopologyList) - -TopologyEvent = _reflection.GeneratedProtocolMessageType('TopologyEvent', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyEvent) - }) -_sym_db.RegisterMessage(TopologyEvent) - -DeviceId = _reflection.GeneratedProtocolMessageType('DeviceId', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceId) - }) -_sym_db.RegisterMessage(DeviceId) - -Device = _reflection.GeneratedProtocolMessageType('Device', (_message.Message,), { - 'DESCRIPTOR' : _DEVICE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Device) - }) -_sym_db.RegisterMessage(Device) - -DeviceConfig = _reflection.GeneratedProtocolMessageType('DeviceConfig', (_message.Message,), { - 'DESCRIPTOR' : _DEVICECONFIG, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceConfig) - }) -_sym_db.RegisterMessage(DeviceConfig) - -DeviceIdList = _reflection.GeneratedProtocolMessageType('DeviceIdList', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceIdList) - }) -_sym_db.RegisterMessage(DeviceIdList) - -DeviceList = _reflection.GeneratedProtocolMessageType('DeviceList', (_message.Message,), { - 'DESCRIPTOR' : _DEVICELIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceList) - }) -_sym_db.RegisterMessage(DeviceList) - -DeviceEvent = _reflection.GeneratedProtocolMessageType('DeviceEvent', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceEvent) - }) -_sym_db.RegisterMessage(DeviceEvent) - -LinkId = _reflection.GeneratedProtocolMessageType('LinkId', (_message.Message,), { - 'DESCRIPTOR' : _LINKID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkId) - }) -_sym_db.RegisterMessage(LinkId) - -Link = _reflection.GeneratedProtocolMessageType('Link', (_message.Message,), { - 'DESCRIPTOR' : _LINK, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Link) - }) -_sym_db.RegisterMessage(Link) - -LinkIdList = _reflection.GeneratedProtocolMessageType('LinkIdList', (_message.Message,), { - 'DESCRIPTOR' : _LINKIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkIdList) - }) -_sym_db.RegisterMessage(LinkIdList) - -LinkList = _reflection.GeneratedProtocolMessageType('LinkList', (_message.Message,), { - 'DESCRIPTOR' : _LINKLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkList) - }) -_sym_db.RegisterMessage(LinkList) - -LinkEvent = _reflection.GeneratedProtocolMessageType('LinkEvent', (_message.Message,), { - 'DESCRIPTOR' : _LINKEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkEvent) - }) -_sym_db.RegisterMessage(LinkEvent) - -ServiceId = _reflection.GeneratedProtocolMessageType('ServiceId', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceId) - }) -_sym_db.RegisterMessage(ServiceId) - -Service = _reflection.GeneratedProtocolMessageType('Service', (_message.Message,), { - 'DESCRIPTOR' : _SERVICE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Service) - }) -_sym_db.RegisterMessage(Service) - -ServiceStatus = _reflection.GeneratedProtocolMessageType('ServiceStatus', (_message.Message,), { - 'DESCRIPTOR' : _SERVICESTATUS, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceStatus) - }) -_sym_db.RegisterMessage(ServiceStatus) - -ServiceConfig = _reflection.GeneratedProtocolMessageType('ServiceConfig', (_message.Message,), { - 'DESCRIPTOR' : _SERVICECONFIG, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceConfig) - }) -_sym_db.RegisterMessage(ServiceConfig) - -ServiceIdList = _reflection.GeneratedProtocolMessageType('ServiceIdList', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceIdList) - }) -_sym_db.RegisterMessage(ServiceIdList) - -ServiceList = _reflection.GeneratedProtocolMessageType('ServiceList', (_message.Message,), { - 'DESCRIPTOR' : _SERVICELIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceList) - }) -_sym_db.RegisterMessage(ServiceList) - -ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceEvent) - }) -_sym_db.RegisterMessage(ServiceEvent) - -ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionId) - }) -_sym_db.RegisterMessage(ConnectionId) - -Connection = _reflection.GeneratedProtocolMessageType('Connection', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTION, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Connection) - }) -_sym_db.RegisterMessage(Connection) - -ConnectionIdList = _reflection.GeneratedProtocolMessageType('ConnectionIdList', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionIdList) - }) -_sym_db.RegisterMessage(ConnectionIdList) - -ConnectionList = _reflection.GeneratedProtocolMessageType('ConnectionList', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionList) - }) -_sym_db.RegisterMessage(ConnectionList) - -ConnectionEvent = _reflection.GeneratedProtocolMessageType('ConnectionEvent', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionEvent) - }) -_sym_db.RegisterMessage(ConnectionEvent) - -EndPointId = _reflection.GeneratedProtocolMessageType('EndPointId', (_message.Message,), { - 'DESCRIPTOR' : _ENDPOINTID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.EndPointId) - }) -_sym_db.RegisterMessage(EndPointId) - -EndPoint = _reflection.GeneratedProtocolMessageType('EndPoint', (_message.Message,), { - 'DESCRIPTOR' : _ENDPOINT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.EndPoint) - }) -_sym_db.RegisterMessage(EndPoint) - -ConfigRule = _reflection.GeneratedProtocolMessageType('ConfigRule', (_message.Message,), { - 'DESCRIPTOR' : _CONFIGRULE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConfigRule) - }) -_sym_db.RegisterMessage(ConfigRule) - -Constraint = _reflection.GeneratedProtocolMessageType('Constraint', (_message.Message,), { - 'DESCRIPTOR' : _CONSTRAINT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Constraint) - }) -_sym_db.RegisterMessage(Constraint) - -TeraFlowController = _reflection.GeneratedProtocolMessageType('TeraFlowController', (_message.Message,), { - 'DESCRIPTOR' : _TERAFLOWCONTROLLER, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TeraFlowController) - }) -_sym_db.RegisterMessage(TeraFlowController) - -AuthenticationResult = _reflection.GeneratedProtocolMessageType('AuthenticationResult', (_message.Message,), { - 'DESCRIPTOR' : _AUTHENTICATIONRESULT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.AuthenticationResult) - }) -_sym_db.RegisterMessage(AuthenticationResult) - - - -_CONTEXTSERVICE = _descriptor.ServiceDescriptor( - name='ContextService', - full_name='context.ContextService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=4524, - serialized_end=6617, - methods=[ - _descriptor.MethodDescriptor( - name='ListContextIds', - full_name='context.ContextService.ListContextIds', - index=0, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListContexts', - full_name='context.ContextService.ListContexts', - index=1, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetContext', - full_name='context.ContextService.GetContext', - index=2, - containing_service=None, - input_type=_CONTEXTID, - output_type=_CONTEXT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetContext', - full_name='context.ContextService.SetContext', - index=3, - containing_service=None, - input_type=_CONTEXT, - output_type=_CONTEXTID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveContext', - full_name='context.ContextService.RemoveContext', - index=4, - containing_service=None, - input_type=_CONTEXTID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetContextEvents', - full_name='context.ContextService.GetContextEvents', - index=5, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListTopologyIds', - full_name='context.ContextService.ListTopologyIds', - index=6, - containing_service=None, - input_type=_CONTEXTID, - output_type=_TOPOLOGYIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListTopologies', - full_name='context.ContextService.ListTopologies', - index=7, - containing_service=None, - input_type=_CONTEXTID, - output_type=_TOPOLOGYLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetTopology', - full_name='context.ContextService.GetTopology', - index=8, - containing_service=None, - input_type=_TOPOLOGYID, - output_type=_TOPOLOGY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetTopology', - full_name='context.ContextService.SetTopology', - index=9, - containing_service=None, - input_type=_TOPOLOGY, - output_type=_TOPOLOGYID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveTopology', - full_name='context.ContextService.RemoveTopology', - index=10, - containing_service=None, - input_type=_TOPOLOGYID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetTopologyEvents', - full_name='context.ContextService.GetTopologyEvents', - index=11, - containing_service=None, - input_type=_EMPTY, - output_type=_TOPOLOGYEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListDeviceIds', - full_name='context.ContextService.ListDeviceIds', - index=12, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICEIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListDevices', - full_name='context.ContextService.ListDevices', - index=13, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICELIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetDevice', - full_name='context.ContextService.GetDevice', - index=14, - containing_service=None, - input_type=_DEVICEID, - output_type=_DEVICE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetDevice', - full_name='context.ContextService.SetDevice', - index=15, - containing_service=None, - input_type=_DEVICE, - output_type=_DEVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveDevice', - full_name='context.ContextService.RemoveDevice', - index=16, - containing_service=None, - input_type=_DEVICEID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetDeviceEvents', - full_name='context.ContextService.GetDeviceEvents', - index=17, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICEEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListLinkIds', - full_name='context.ContextService.ListLinkIds', - index=18, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListLinks', - full_name='context.ContextService.ListLinks', - index=19, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetLink', - full_name='context.ContextService.GetLink', - index=20, - containing_service=None, - input_type=_LINKID, - output_type=_LINK, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetLink', - full_name='context.ContextService.SetLink', - index=21, - containing_service=None, - input_type=_LINK, - output_type=_LINKID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveLink', - full_name='context.ContextService.RemoveLink', - index=22, - containing_service=None, - input_type=_LINKID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetLinkEvents', - full_name='context.ContextService.GetLinkEvents', - index=23, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListServiceIds', - full_name='context.ContextService.ListServiceIds', - index=24, - containing_service=None, - input_type=_CONTEXTID, - output_type=_SERVICEIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListServices', - full_name='context.ContextService.ListServices', - index=25, - containing_service=None, - input_type=_CONTEXTID, - output_type=_SERVICELIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetService', - full_name='context.ContextService.GetService', - index=26, - containing_service=None, - input_type=_SERVICEID, - output_type=_SERVICE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetService', - full_name='context.ContextService.SetService', - index=27, - containing_service=None, - input_type=_SERVICE, - output_type=_SERVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveService', - full_name='context.ContextService.RemoveService', - index=28, - containing_service=None, - input_type=_SERVICEID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetServiceEvents', - full_name='context.ContextService.GetServiceEvents', - index=29, - containing_service=None, - input_type=_EMPTY, - output_type=_SERVICEEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListConnectionIds', - full_name='context.ContextService.ListConnectionIds', - index=30, - containing_service=None, - input_type=_SERVICEID, - output_type=_CONNECTIONIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListConnections', - full_name='context.ContextService.ListConnections', - index=31, - containing_service=None, - input_type=_SERVICEID, - output_type=_CONNECTIONLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetConnection', - full_name='context.ContextService.GetConnection', - index=32, - containing_service=None, - input_type=_CONNECTIONID, - output_type=_CONNECTION, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetConnection', - full_name='context.ContextService.SetConnection', - index=33, - containing_service=None, - input_type=_CONNECTION, - output_type=_CONNECTIONID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveConnection', - full_name='context.ContextService.RemoveConnection', - index=34, - containing_service=None, - input_type=_CONNECTIONID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetConnectionEvents', - full_name='context.ContextService.GetConnectionEvents', - index=35, - containing_service=None, - input_type=_EMPTY, - output_type=_CONNECTIONEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_CONTEXTSERVICE) - -DESCRIPTOR.services_by_name['ContextService'] = _CONTEXTSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/monitoring/proto/kpi_sample_types_pb2.py b/src/monitoring/proto/kpi_sample_types_pb2.py deleted file mode 100644 index ea7fd2f82757d4c3db02d7e2c7817e2787b0b490..0000000000000000000000000000000000000000 --- a/src/monitoring/proto/kpi_sample_types_pb2.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: kpi_sample_types.proto -"""Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='kpi_sample_types.proto', - package='kpi_sample_types', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x16kpi_sample_types.proto\x12\x10kpi_sample_types*\xbe\x01\n\rKpiSampleType\x12\x19\n\x15KPISAMPLETYPE_UNKNOWN\x10\x00\x12%\n!KPISAMPLETYPE_PACKETS_TRANSMITTED\x10\x65\x12\"\n\x1eKPISAMPLETYPE_PACKETS_RECEIVED\x10\x66\x12$\n\x1fKPISAMPLETYPE_BYTES_TRANSMITTED\x10\xc9\x01\x12!\n\x1cKPISAMPLETYPE_BYTES_RECEIVED\x10\xca\x01\x62\x06proto3' -) - -_KPISAMPLETYPE = _descriptor.EnumDescriptor( - name='KpiSampleType', - full_name='kpi_sample_types.KpiSampleType', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_PACKETS_TRANSMITTED', index=1, number=101, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_PACKETS_RECEIVED', index=2, number=102, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_BYTES_TRANSMITTED', index=3, number=201, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_BYTES_RECEIVED', index=4, number=202, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=45, - serialized_end=235, -) -_sym_db.RegisterEnumDescriptor(_KPISAMPLETYPE) - -KpiSampleType = enum_type_wrapper.EnumTypeWrapper(_KPISAMPLETYPE) -KPISAMPLETYPE_UNKNOWN = 0 -KPISAMPLETYPE_PACKETS_TRANSMITTED = 101 -KPISAMPLETYPE_PACKETS_RECEIVED = 102 -KPISAMPLETYPE_BYTES_TRANSMITTED = 201 -KPISAMPLETYPE_BYTES_RECEIVED = 202 - - -DESCRIPTOR.enum_types_by_name['KpiSampleType'] = _KPISAMPLETYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - -# @@protoc_insertion_point(module_scope) diff --git a/src/monitoring/proto/monitoring_pb2.py b/src/monitoring/proto/monitoring_pb2.py deleted file mode 100644 index b313ebb68f0da37a540898e8c362fd204a799076..0000000000000000000000000000000000000000 --- a/src/monitoring/proto/monitoring_pb2.py +++ /dev/null @@ -1,452 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: monitoring.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import context_pb2 as context__pb2 -from . import kpi_sample_types_pb2 as kpi__sample__types__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='monitoring.proto', - package='monitoring', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x10monitoring.proto\x12\nmonitoring\x1a\rcontext.proto\x1a\x16kpi_sample_types.proto\"\xda\x01\n\rKpiDescriptor\x12\x17\n\x0fkpi_description\x18\x01 \x01(\t\x12\x38\n\x0fkpi_sample_type\x18\x02 \x01(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\x12$\n\tdevice_id\x18\x03 \x01(\x0b\x32\x11.context.DeviceId\x12(\n\x0b\x65ndpoint_id\x18\x04 \x01(\x0b\x32\x13.context.EndPointId\x12&\n\nservice_id\x18\x05 \x01(\x0b\x32\x12.context.ServiceId\"p\n\x11MonitorKpiRequest\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x1b\n\x13sampling_duration_s\x18\x02 \x01(\x02\x12\x1b\n\x13sampling_interval_s\x18\x03 \x01(\x02\"&\n\x05KpiId\x12\x1d\n\x06kpi_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\"d\n\x03Kpi\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\'\n\tkpi_value\x18\x04 \x01(\x0b\x32\x14.monitoring.KpiValue\"a\n\x08KpiValue\x12\x10\n\x06intVal\x18\x01 \x01(\rH\x00\x12\x12\n\x08\x66loatVal\x18\x02 \x01(\x02H\x00\x12\x13\n\tstringVal\x18\x03 \x01(\tH\x00\x12\x11\n\x07\x62oolVal\x18\x04 \x01(\x08H\x00\x42\x07\n\x05value\",\n\x07KpiList\x12!\n\x08kpi_list\x18\x01 \x03(\x0b\x32\x0f.monitoring.Kpi2\xf3\x02\n\x11MonitoringService\x12;\n\tCreateKpi\x12\x19.monitoring.KpiDescriptor\x1a\x11.monitoring.KpiId\"\x00\x12\x42\n\x10GetKpiDescriptor\x12\x11.monitoring.KpiId\x1a\x19.monitoring.KpiDescriptor\"\x00\x12/\n\nIncludeKpi\x12\x0f.monitoring.Kpi\x1a\x0e.context.Empty\"\x00\x12=\n\nMonitorKpi\x12\x1d.monitoring.MonitorKpiRequest\x1a\x0e.context.Empty\"\x00\x12\x36\n\x0cGetStreamKpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x30\x01\x12\x35\n\rGetInstantKpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x62\x06proto3' - , - dependencies=[context__pb2.DESCRIPTOR,kpi__sample__types__pb2.DESCRIPTOR,]) - - - - -_KPIDESCRIPTOR = _descriptor.Descriptor( - name='KpiDescriptor', - full_name='monitoring.KpiDescriptor', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_description', full_name='monitoring.KpiDescriptor.kpi_description', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kpi_sample_type', full_name='monitoring.KpiDescriptor.kpi_sample_type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='monitoring.KpiDescriptor.device_id', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='endpoint_id', full_name='monitoring.KpiDescriptor.endpoint_id', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_id', full_name='monitoring.KpiDescriptor.service_id', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=72, - serialized_end=290, -) - - -_MONITORKPIREQUEST = _descriptor.Descriptor( - name='MonitorKpiRequest', - full_name='monitoring.MonitorKpiRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='monitoring.MonitorKpiRequest.kpi_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sampling_duration_s', full_name='monitoring.MonitorKpiRequest.sampling_duration_s', index=1, - number=2, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sampling_interval_s', full_name='monitoring.MonitorKpiRequest.sampling_interval_s', index=2, - number=3, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=292, - serialized_end=404, -) - - -_KPIID = _descriptor.Descriptor( - name='KpiId', - full_name='monitoring.KpiId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='monitoring.KpiId.kpi_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=406, - serialized_end=444, -) - - -_KPI = _descriptor.Descriptor( - name='Kpi', - full_name='monitoring.Kpi', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='monitoring.Kpi.kpi_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='timestamp', full_name='monitoring.Kpi.timestamp', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kpi_value', full_name='monitoring.Kpi.kpi_value', index=2, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=446, - serialized_end=546, -) - - -_KPIVALUE = _descriptor.Descriptor( - name='KpiValue', - full_name='monitoring.KpiValue', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='intVal', full_name='monitoring.KpiValue.intVal', index=0, - number=1, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='floatVal', full_name='monitoring.KpiValue.floatVal', index=1, - number=2, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='stringVal', full_name='monitoring.KpiValue.stringVal', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='boolVal', full_name='monitoring.KpiValue.boolVal', index=3, - number=4, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='value', full_name='monitoring.KpiValue.value', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=548, - serialized_end=645, -) - - -_KPILIST = _descriptor.Descriptor( - name='KpiList', - full_name='monitoring.KpiList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_list', full_name='monitoring.KpiList.kpi_list', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=647, - serialized_end=691, -) - -_KPIDESCRIPTOR.fields_by_name['kpi_sample_type'].enum_type = kpi__sample__types__pb2._KPISAMPLETYPE -_KPIDESCRIPTOR.fields_by_name['device_id'].message_type = context__pb2._DEVICEID -_KPIDESCRIPTOR.fields_by_name['endpoint_id'].message_type = context__pb2._ENDPOINTID -_KPIDESCRIPTOR.fields_by_name['service_id'].message_type = context__pb2._SERVICEID -_MONITORKPIREQUEST.fields_by_name['kpi_id'].message_type = _KPIID -_KPIID.fields_by_name['kpi_id'].message_type = context__pb2._UUID -_KPI.fields_by_name['kpi_id'].message_type = _KPIID -_KPI.fields_by_name['kpi_value'].message_type = _KPIVALUE -_KPIVALUE.oneofs_by_name['value'].fields.append( - _KPIVALUE.fields_by_name['intVal']) -_KPIVALUE.fields_by_name['intVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value'] -_KPIVALUE.oneofs_by_name['value'].fields.append( - _KPIVALUE.fields_by_name['floatVal']) -_KPIVALUE.fields_by_name['floatVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value'] -_KPIVALUE.oneofs_by_name['value'].fields.append( - _KPIVALUE.fields_by_name['stringVal']) -_KPIVALUE.fields_by_name['stringVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value'] -_KPIVALUE.oneofs_by_name['value'].fields.append( - _KPIVALUE.fields_by_name['boolVal']) -_KPIVALUE.fields_by_name['boolVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value'] -_KPILIST.fields_by_name['kpi_list'].message_type = _KPI -DESCRIPTOR.message_types_by_name['KpiDescriptor'] = _KPIDESCRIPTOR -DESCRIPTOR.message_types_by_name['MonitorKpiRequest'] = _MONITORKPIREQUEST -DESCRIPTOR.message_types_by_name['KpiId'] = _KPIID -DESCRIPTOR.message_types_by_name['Kpi'] = _KPI -DESCRIPTOR.message_types_by_name['KpiValue'] = _KPIVALUE -DESCRIPTOR.message_types_by_name['KpiList'] = _KPILIST -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -KpiDescriptor = _reflection.GeneratedProtocolMessageType('KpiDescriptor', (_message.Message,), { - 'DESCRIPTOR' : _KPIDESCRIPTOR, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiDescriptor) - }) -_sym_db.RegisterMessage(KpiDescriptor) - -MonitorKpiRequest = _reflection.GeneratedProtocolMessageType('MonitorKpiRequest', (_message.Message,), { - 'DESCRIPTOR' : _MONITORKPIREQUEST, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.MonitorKpiRequest) - }) -_sym_db.RegisterMessage(MonitorKpiRequest) - -KpiId = _reflection.GeneratedProtocolMessageType('KpiId', (_message.Message,), { - 'DESCRIPTOR' : _KPIID, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiId) - }) -_sym_db.RegisterMessage(KpiId) - -Kpi = _reflection.GeneratedProtocolMessageType('Kpi', (_message.Message,), { - 'DESCRIPTOR' : _KPI, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.Kpi) - }) -_sym_db.RegisterMessage(Kpi) - -KpiValue = _reflection.GeneratedProtocolMessageType('KpiValue', (_message.Message,), { - 'DESCRIPTOR' : _KPIVALUE, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiValue) - }) -_sym_db.RegisterMessage(KpiValue) - -KpiList = _reflection.GeneratedProtocolMessageType('KpiList', (_message.Message,), { - 'DESCRIPTOR' : _KPILIST, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiList) - }) -_sym_db.RegisterMessage(KpiList) - - - -_MONITORINGSERVICE = _descriptor.ServiceDescriptor( - name='MonitoringService', - full_name='monitoring.MonitoringService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=694, - serialized_end=1065, - methods=[ - _descriptor.MethodDescriptor( - name='CreateKpi', - full_name='monitoring.MonitoringService.CreateKpi', - index=0, - containing_service=None, - input_type=_KPIDESCRIPTOR, - output_type=_KPIID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetKpiDescriptor', - full_name='monitoring.MonitoringService.GetKpiDescriptor', - index=1, - containing_service=None, - input_type=_KPIID, - output_type=_KPIDESCRIPTOR, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='IncludeKpi', - full_name='monitoring.MonitoringService.IncludeKpi', - index=2, - containing_service=None, - input_type=_KPI, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='MonitorKpi', - full_name='monitoring.MonitoringService.MonitorKpi', - index=3, - containing_service=None, - input_type=_MONITORKPIREQUEST, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetStreamKpi', - full_name='monitoring.MonitoringService.GetStreamKpi', - index=4, - containing_service=None, - input_type=_KPIID, - output_type=_KPI, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetInstantKpi', - full_name='monitoring.MonitoringService.GetInstantKpi', - index=5, - containing_service=None, - input_type=_KPIID, - output_type=_KPI, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_MONITORINGSERVICE) - -DESCRIPTOR.services_by_name['MonitoringService'] = _MONITORINGSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/monitoring/proto/monitoring_pb2_grpc.py b/src/monitoring/proto/monitoring_pb2_grpc.py deleted file mode 100644 index 36c6835938af46b34b37f673bb6d4a1374a57cf0..0000000000000000000000000000000000000000 --- a/src/monitoring/proto/monitoring_pb2_grpc.py +++ /dev/null @@ -1,232 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from . import context_pb2 as context__pb2 -from . import monitoring_pb2 as monitoring__pb2 - - -class MonitoringServiceStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateKpi = channel.unary_unary( - '/monitoring.MonitoringService/CreateKpi', - request_serializer=monitoring__pb2.KpiDescriptor.SerializeToString, - response_deserializer=monitoring__pb2.KpiId.FromString, - ) - self.GetKpiDescriptor = channel.unary_unary( - '/monitoring.MonitoringService/GetKpiDescriptor', - request_serializer=monitoring__pb2.KpiId.SerializeToString, - response_deserializer=monitoring__pb2.KpiDescriptor.FromString, - ) - self.IncludeKpi = channel.unary_unary( - '/monitoring.MonitoringService/IncludeKpi', - request_serializer=monitoring__pb2.Kpi.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.MonitorKpi = channel.unary_unary( - '/monitoring.MonitoringService/MonitorKpi', - request_serializer=monitoring__pb2.MonitorKpiRequest.SerializeToString, - response_deserializer=context__pb2.Empty.FromString, - ) - self.GetStreamKpi = channel.unary_stream( - '/monitoring.MonitoringService/GetStreamKpi', - request_serializer=monitoring__pb2.KpiId.SerializeToString, - response_deserializer=monitoring__pb2.Kpi.FromString, - ) - self.GetInstantKpi = channel.unary_unary( - '/monitoring.MonitoringService/GetInstantKpi', - request_serializer=monitoring__pb2.KpiId.SerializeToString, - response_deserializer=monitoring__pb2.Kpi.FromString, - ) - - -class MonitoringServiceServicer(object): - """Missing associated documentation comment in .proto file.""" - - def CreateKpi(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetKpiDescriptor(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def IncludeKpi(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def MonitorKpi(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetStreamKpi(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetInstantKpi(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_MonitoringServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'CreateKpi': grpc.unary_unary_rpc_method_handler( - servicer.CreateKpi, - request_deserializer=monitoring__pb2.KpiDescriptor.FromString, - response_serializer=monitoring__pb2.KpiId.SerializeToString, - ), - 'GetKpiDescriptor': grpc.unary_unary_rpc_method_handler( - servicer.GetKpiDescriptor, - request_deserializer=monitoring__pb2.KpiId.FromString, - response_serializer=monitoring__pb2.KpiDescriptor.SerializeToString, - ), - 'IncludeKpi': grpc.unary_unary_rpc_method_handler( - servicer.IncludeKpi, - request_deserializer=monitoring__pb2.Kpi.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'MonitorKpi': grpc.unary_unary_rpc_method_handler( - servicer.MonitorKpi, - request_deserializer=monitoring__pb2.MonitorKpiRequest.FromString, - response_serializer=context__pb2.Empty.SerializeToString, - ), - 'GetStreamKpi': grpc.unary_stream_rpc_method_handler( - servicer.GetStreamKpi, - request_deserializer=monitoring__pb2.KpiId.FromString, - response_serializer=monitoring__pb2.Kpi.SerializeToString, - ), - 'GetInstantKpi': grpc.unary_unary_rpc_method_handler( - servicer.GetInstantKpi, - request_deserializer=monitoring__pb2.KpiId.FromString, - response_serializer=monitoring__pb2.Kpi.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'monitoring.MonitoringService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class MonitoringService(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def CreateKpi(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/monitoring.MonitoringService/CreateKpi', - monitoring__pb2.KpiDescriptor.SerializeToString, - monitoring__pb2.KpiId.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetKpiDescriptor(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/monitoring.MonitoringService/GetKpiDescriptor', - monitoring__pb2.KpiId.SerializeToString, - monitoring__pb2.KpiDescriptor.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def IncludeKpi(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/monitoring.MonitoringService/IncludeKpi', - monitoring__pb2.Kpi.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def MonitorKpi(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/monitoring.MonitoringService/MonitorKpi', - monitoring__pb2.MonitorKpiRequest.SerializeToString, - context__pb2.Empty.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetStreamKpi(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_stream(request, target, '/monitoring.MonitoringService/GetStreamKpi', - monitoring__pb2.KpiId.SerializeToString, - monitoring__pb2.Kpi.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def GetInstantKpi(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/monitoring.MonitoringService/GetInstantKpi', - monitoring__pb2.KpiId.SerializeToString, - monitoring__pb2.Kpi.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/monitoring/requirements.in b/src/monitoring/requirements.in index 77b66b79498d6df89a1d3b8989a02c06078eb1b9..981b4cdf291b6234d53de185ad83a1df2d1148a4 100644 --- a/src/monitoring/requirements.in +++ b/src/monitoring/requirements.in @@ -1,16 +1,34 @@ -google-api-core -grpcio-health-checking -grpcio -opencensus[stackdriver] -python-json-logger -google-cloud-profiler -numpy -prometheus-client -pytest -pytest-benchmark -influxdb -redis -anytree -apscheduler -xmltodict -coverage +# 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. + +anytree==2.8.0 +APScheduler==3.8.1 +#fastcache==1.1.0 +#google-api-core +#opencensus[stackdriver] +#google-cloud-profiler +#numpy +#Jinja2==3.0.3 +#ncclient==0.6.13 +#p4runtime==1.3.0 +#paramiko==2.9.2 +influx-line-protocol==0.1.4 +python-dateutil==2.8.2 +python-json-logger==2.0.2 +pytz==2021.3 +#redis==4.1.2 +requests==2.27.1 +xmltodict==0.12.0 +questdb==1.0.1 +psycopg2-binary==2.9.3 diff --git a/src/monitoring/service/AlarmManager.py b/src/monitoring/service/AlarmManager.py new file mode 100644 index 0000000000000000000000000000000000000000..495a5f365cb0220a647866de57915c5cee8ab94d --- /dev/null +++ b/src/monitoring/service/AlarmManager.py @@ -0,0 +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 pytz +from apscheduler.schedulers.background import BackgroundScheduler +from apscheduler.executors.pool import ProcessPoolExecutor +from apscheduler.jobstores.base import JobLookupError +from datetime import datetime +import time +import logging + +LOGGER = logging.getLogger(__name__) + +class AlarmManager(): + def __init__(self, metrics_db): + self.metrics_db = metrics_db + self.scheduler = BackgroundScheduler(executors={'processpool': ProcessPoolExecutor(max_workers=20)}) + self.scheduler.start() + LOGGER.info("Alarm Manager Initialized") + + def create_alarm(self, alarm_queue,alarm_id, kpi_id, kpiMinValue, kpiMaxValue, inRange, includeMinValue, includeMaxValue, subscription_frequency_ms, subscription_timeout_s=None): + start_date=None + end_date=None + if subscription_timeout_s: + start_timestamp=time.time() + end_timestamp = start_timestamp + subscription_timeout_s + start_date = datetime.utcfromtimestamp(start_timestamp).isoformat() + end_date = datetime.utcfromtimestamp(end_timestamp).isoformat() + + job = self.scheduler.add_job(self.metrics_db.get_alarm_data, + args=(alarm_queue,kpi_id, kpiMinValue, kpiMaxValue, inRange, includeMinValue, includeMaxValue, subscription_frequency_ms), + trigger='interval', seconds=(subscription_frequency_ms/1000), start_date=start_date, + end_date=end_date,timezone=pytz.utc, id=str(alarm_id)) + LOGGER.debug(f"Alarm job {alarm_id} succesfully created") + #job.remove() + + def delete_alarm(self, alarm_id): + try: + self.scheduler.remove_job(alarm_id) + LOGGER.debug(f"Alarm job {alarm_id} succesfully deleted") + except (Exception, JobLookupError) as e: + LOGGER.debug(f"Alarm job {alarm_id} does not exists") diff --git a/src/monitoring/service/EventTools.py b/src/monitoring/service/EventTools.py index 636556425af9ac02487386d81b9d8d4e786aa560..0d351eee968684f18571f0da9f094a806f577efd 100644 --- a/src/monitoring/service/EventTools.py +++ b/src/monitoring/service/EventTools.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,33 +12,39 @@ # See the License for the specific language governing permissions and # limitations under the License. -import threading -from queue import Queue - -import grpc - -from common.rpc_method_wrapper.ServiceExceptions import ServiceException +from typing import Dict +import grpc, logging, queue, threading +from common.method_wrappers.ServiceExceptions import ServiceException +from common.proto import monitoring_pb2 +from common.proto.context_pb2 import DeviceOperationalStatusEnum, Empty, EventTypeEnum +from common.proto.kpi_sample_types_pb2 import KpiSampleType from context.client.ContextClient import ContextClient -from context.proto import kpi_sample_types_pb2 -from context.proto.context_pb2 import Empty, EventTypeEnum +from monitoring.client.MonitoringClient import MonitoringClient +from monitoring.service.MonitoringServiceServicerImpl import LOGGER +from monitoring.service.NameMapping import NameMapping -from common.logger import getJSONLogger -from monitoring.client.monitoring_client import MonitoringClient -from monitoring.proto import monitoring_pb2 +LOGGER = logging.getLogger(__name__) -LOGGER = getJSONLogger('monitoringservice-server') -LOGGER.setLevel('DEBUG') +DEVICE_OP_STATUS_UNDEFINED = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_UNDEFINED +DEVICE_OP_STATUS_DISABLED = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED +DEVICE_OP_STATUS_ENABLED = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED +DEVICE_OP_STATUS_NOT_ENABLED = {DEVICE_OP_STATUS_UNDEFINED, DEVICE_OP_STATUS_DISABLED} +KPISAMPLETYPE_UNKNOWN = KpiSampleType.KPISAMPLETYPE_UNKNOWN class EventsDeviceCollector: - def __init__(self, context_client_grpc : ContextClient, monitoring_client_grpc : MonitoringClient) -> None: # pylint: disable=redefined-outer-name - self._events_queue = Queue() + def __init__(self, name_mapping : NameMapping) -> None: # pylint: disable=redefined-outer-name + self._events_queue = queue.Queue() - self._device_stream = context_client_grpc.GetDeviceEvents(Empty()) - self._context_client = context_client_grpc - self._channel = context_client_grpc.channel - self._monitoring_client = monitoring_client_grpc + self._context_client_grpc = ContextClient() + self._device_stream = self._context_client_grpc.GetDeviceEvents(Empty()) + self._context_client = self._context_client_grpc + self._channel = self._context_client_grpc.channel + self._monitoring_client = MonitoringClient(host='127.0.0.1') - self._device_thread = threading.Thread(target=self._collect, args=(self._device_stream ,), daemon=False) + self._device_thread = threading.Thread(target=self._collect, args=(self._device_stream,), daemon=False) + + self._device_to_state : Dict[str, DeviceOperationalStatusEnum] = dict() + self._name_mapping = name_mapping def grpc_server_on(self): try: @@ -58,7 +64,7 @@ class EventsDeviceCollector: def start(self): try: self._device_thread.start() - except RuntimeError as e: + except RuntimeError: LOGGER.exception('Start EventTools exception') def get_event(self, block : bool = True, timeout : float = 0.1): @@ -72,32 +78,56 @@ class EventsDeviceCollector: try: kpi_id_list = [] - while not self._events_queue.empty(): - LOGGER.info('getting Kpi by KpiID') - event = self.get_event(block=True) - if event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE: + while True: + # LOGGER.info('getting Kpi by KpiID') + try: + event = self.get_event(block=True, timeout=0.5) + + event_type = event.event.event_type + device_uuid = event.device_id.device_uuid.uuid + if event_type in {EventTypeEnum.EVENTTYPE_REMOVE}: + self._device_to_state.pop(device_uuid, None) + continue + + if event_type not in {EventTypeEnum.EVENTTYPE_CREATE, EventTypeEnum.EVENTTYPE_UPDATE}: + # Unknown event type + continue + device = self._context_client.GetDevice(event.device_id) - for j,end_point in enumerate(device.device_endpoints): - #for i, value in enumerate(kpi_sample_types_pb2.KpiSampleType.values()): - for i, value in enumerate(end_point.kpi_sample_types): - #if value == kpi_sample_types_pb2.KpiSampleType.KPISAMPLETYPE_UNKNOWN: continue + self._name_mapping.set_device_name(device_uuid, device.name) - kpi_descriptor = monitoring_pb2.KpiDescriptor() + old_operational_status = self._device_to_state.get(device_uuid, DEVICE_OP_STATUS_UNDEFINED) + device_was_not_enabled = (old_operational_status in DEVICE_OP_STATUS_NOT_ENABLED) + + new_operational_status = device.device_operational_status + device_is_enabled = (new_operational_status == DEVICE_OP_STATUS_ENABLED) + self._device_to_state[device_uuid] = new_operational_status - kpi_descriptor.kpi_description = device.device_type - kpi_descriptor.kpi_sample_type = value - #kpi_descriptor.service_id.service_uuid.uuid = "" - kpi_descriptor.device_id.CopyFrom(device.device_id) - kpi_descriptor.endpoint_id.CopyFrom(end_point.endpoint_id) + activate_monitoring = device_was_not_enabled and device_is_enabled + if not activate_monitoring: + # device is not ready for monitoring + continue - kpi_id = self._monitoring_client.CreateKpi(kpi_descriptor) + for endpoint in device.device_endpoints: + endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid + self._name_mapping.set_endpoint_name(endpoint_uuid, endpoint.name) + + for value in endpoint.kpi_sample_types: + if value == KPISAMPLETYPE_UNKNOWN: continue + + kpi_descriptor = monitoring_pb2.KpiDescriptor() + kpi_descriptor.kpi_description = device.device_type + kpi_descriptor.kpi_sample_type = value + kpi_descriptor.device_id.CopyFrom(device.device_id) # pylint: disable=no-member + kpi_descriptor.endpoint_id.CopyFrom(endpoint.endpoint_id) # pylint: disable=no-member + + kpi_id = self._monitoring_client.SetKpi(kpi_descriptor) kpi_id_list.append(kpi_id) + except queue.Empty: + break return kpi_id_list - - except ServiceException as e: + except ServiceException: LOGGER.exception('ListenEvents exception') - - except Exception as e: # pragma: no cover + except Exception: # pragma: no cover # pylint: disable=broad-except LOGGER.exception('ListenEvents exception') - diff --git a/src/monitoring/service/InfluxTools.py b/src/monitoring/service/InfluxTools.py index f19555437000acc3b44e2872f45d8a8e118a9b22..f2f877d9203974dbb91681e08be54f687071f463 100644 --- a/src/monitoring/service/InfluxTools.py +++ b/src/monitoring/service/InfluxTools.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/monitoring/service/ManagementDBTools.py b/src/monitoring/service/ManagementDBTools.py new file mode 100644 index 0000000000000000000000000000000000000000..a2beddccd633a1961238a6affa4b8d069c26762e --- /dev/null +++ b/src/monitoring/service/ManagementDBTools.py @@ -0,0 +1,288 @@ +# 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 sqlite3 +import logging + +LOGGER = logging.getLogger(__name__) + +class ManagementDB(): + def __init__(self, database): + try: + self.client = sqlite3.connect(database, check_same_thread=False) + self.create_monitoring_table() + self.create_subscription_table() + self.create_alarm_table() + LOGGER.info("ManagementDB initialized") + except: + LOGGER.info("ManagementDB cannot be initialized") + raise Exception("Critical error in the monitoring component") + + def create_monitoring_table(self): + try: + result=self.client.execute(""" + CREATE TABLE IF NOT EXISTS kpi( + kpi_id INTEGER PRIMARY KEY AUTOINCREMENT, + kpi_description TEXT, + kpi_sample_type INTEGER, + device_id INTEGER, + endpoint_id INTEGER, + service_id INTEGER, + slice_id INTEGER, + connection_id INTEGER, + monitor_flag INTEGER + ); + """) + LOGGER.debug("KPI table created in the ManagementDB") + except sqlite3.Error as e: + LOGGER.debug(f"KPI table cannot be created in the ManagementD. {e}") + raise Exception + + def create_subscription_table(self): + try: + result= self.client.execute(""" + CREATE TABLE IF NOT EXISTS subscription( + subs_id INTEGER PRIMARY KEY AUTOINCREMENT, + kpi_id INTEGER, + subscriber TEXT, + sampling_duration_s REAL, + sampling_interval_s REAL, + start_timestamp REAL, + end_timestamp REAL + ); + """) + LOGGER.info("Subscription table created in the ManagementDB") + except sqlite3.Error as e: + LOGGER.debug(f"Subscription table cannot be created in the ManagementDB. {e}") + raise Exception + + def create_alarm_table(self): + try: + result=self.client.execute(""" + CREATE TABLE IF NOT EXISTS alarm( + alarm_id INTEGER PRIMARY KEY AUTOINCREMENT, + alarm_description TEXT, + alarm_name TEXT, + kpi_id INTEGER, + kpi_min_value REAL, + kpi_max_value REAL, + in_range INTEGER, + include_min_value INTEGER, + include_max_value INTEGER + ); + """) + LOGGER.info("Alarm table created in the ManagementDB") + except sqlite3.Error as e: + LOGGER.debug(f"Alarm table cannot be created in the ManagementDB. {e}") + raise Exception + + def insert_KPI(self,kpi_description,kpi_sample_type,device_id,endpoint_id,service_id,slice_id,connection_id): + try: + c = self.client.cursor() + c.execute("SELECT kpi_id FROM kpi WHERE device_id is ? AND kpi_sample_type is ? AND endpoint_id is ? AND service_id is ? AND slice_id is ? AND connection_id is ?",(device_id,kpi_sample_type,endpoint_id,service_id,slice_id,connection_id)) + data=c.fetchone() + if data is None: + c.execute("INSERT INTO kpi (kpi_description,kpi_sample_type,device_id,endpoint_id,service_id,slice_id,connection_id) VALUES (?,?,?,?,?,?,?)", (kpi_description,kpi_sample_type,device_id,endpoint_id,service_id,slice_id,connection_id)) + self.client.commit() + kpi_id = c.lastrowid + LOGGER.debug(f"KPI {kpi_id} succesfully inserted in the ManagementDB") + return kpi_id + else: + kpi_id = data[0] + LOGGER.debug(f"KPI {kpi_id} already exists") + return kpi_id + except sqlite3.Error as e: + LOGGER.debug("KPI cannot be inserted in the ManagementDB: {e}") + + def insert_subscription(self,kpi_id,subscriber,sampling_duration_s,sampling_interval_s,start_timestamp, end_timestamp): + try: + c = self.client.cursor() + c.execute("SELECT subs_id FROM subscription WHERE kpi_id is ? AND subscriber is ? AND sampling_duration_s is ? AND sampling_interval_s is ? AND start_timestamp is ? AND end_timestamp is ?",(kpi_id,subscriber,sampling_duration_s,sampling_interval_s,start_timestamp, end_timestamp)) + data=c.fetchone() + if data is None: + c.execute("INSERT INTO subscription (kpi_id,subscriber,sampling_duration_s,sampling_interval_s,start_timestamp, end_timestamp) VALUES (?,?,?,?,?,?)", (kpi_id,subscriber,sampling_duration_s,sampling_interval_s,start_timestamp, end_timestamp)) + self.client.commit() + subs_id = c.lastrowid + LOGGER.debug(f"Subscription {subs_id} succesfully inserted in the ManagementDB") + return subs_id + else: + subs_id = data[0] + LOGGER.debug(f"Subscription {subs_id} already exists") + return subs_id + except sqlite3.Error as e: + LOGGER.debug("Subscription cannot be inserted in the ManagementDB: {e}") + + def insert_alarm(self,alarm_description,alarm_name,kpi_id,kpi_min_value,kpi_max_value,in_range,include_min_value,include_max_value): + try: + c = self.client.cursor() + c.execute("SELECT alarm_id FROM alarm WHERE alarm_description is ? AND alarm_name is ? AND kpi_id is ? AND kpi_min_value is ? AND kpi_max_value is ? AND in_range is ? AND include_min_value is ? AND include_max_value is ?",(alarm_description,alarm_name,kpi_id,kpi_min_value,kpi_max_value,in_range,include_min_value,include_max_value)) + data=c.fetchone() + if data is None: + c.execute("INSERT INTO alarm (alarm_description, alarm_name, kpi_id, kpi_min_value, kpi_max_value, in_range, include_min_value, include_max_value) VALUES (?,?,?,?,?,?,?,?)", (alarm_description,alarm_name,kpi_id,kpi_min_value,kpi_max_value,in_range,include_min_value,include_max_value)) + self.client.commit() + alarm_id=c.lastrowid + LOGGER.debug(f"Alarm {alarm_id} succesfully inserted in the ManagementDB") + return alarm_id + else: + alarm_id=data[0] + LOGGER.debug(f"Alarm {alarm_id} already exists") + return alarm_id + except sqlite3.Error as e: + LOGGER.debug(f"Alarm cannot be inserted in the ManagementDB: {e}") + + def delete_KPI(self,kpi_id): + try: + c = self.client.cursor() + c.execute("SELECT * FROM kpi WHERE kpi_id is ?",(kpi_id,)) + data=c.fetchone() + if data is None: + LOGGER.debug(f"KPI {kpi_id} does not exists") + return False + else: + c.execute("DELETE FROM kpi WHERE kpi_id is ?",(kpi_id,)) + self.client.commit() + LOGGER.debug(f"KPI {kpi_id} deleted from the ManagementDB") + return True + except sqlite3.Error as e: + LOGGER.debug(f"KPI cannot be deleted from the ManagementDB: {e}") + + def delete_subscription(self,subs_id): + try: + c = self.client.cursor() + c.execute("SELECT * FROM subscription WHERE subs_id is ?",(subs_id,)) + data=c.fetchone() + if data is None: + LOGGER.debug(f"Subscription {subs_id} does not exists") + return False + else: + c.execute("DELETE FROM subscription WHERE subs_id is ?",(subs_id,)) + self.client.commit() + LOGGER.debug(f"Subscription {subs_id} deleted from the ManagementDB") + return True + except sqlite3.Error as e: + LOGGER.debug(f"Subscription cannot be deleted from the ManagementDB: {e}") + + def delete_alarm(self,alarm_id): + try: + c = self.client.cursor() + c.execute("SELECT * FROM alarm WHERE alarm_id is ?",(alarm_id,)) + data=c.fetchone() + if data is None: + LOGGER.debug(f"Alarm {alarm_id} does not exists") + return False + else: + c.execute("DELETE FROM alarm WHERE alarm_id is ?",(alarm_id,)) + self.client.commit() + LOGGER.debug(f"Alarm {alarm_id} deleted from the ManagementDB") + return True + except sqlite3.Error as e: + LOGGER.debug(f"Alarm cannot be deleted from the ManagementDB: {e}") + + def get_KPI(self,kpi_id): + try: + data = self.client.execute("SELECT * FROM kpi WHERE kpi_id is ?",(kpi_id,)).fetchone() + if data: + LOGGER.debug(f"KPI {kpi_id} succesfully retrieved from the ManagementDB") + return data + else: + LOGGER.debug(f"KPI {kpi_id} does not exists") + return data + except sqlite3.Error as e: + LOGGER.debug(f"KPI {kpi_id} cannot be retrieved from the ManagementDB: {e}") + + def get_subscription(self,subs_id): + try: + data = self.client.execute("SELECT * FROM subscription WHERE subs_id is ?",(subs_id,)).fetchone() + if data: + LOGGER.debug(f"Subscription {subs_id} succesfully retrieved from the ManagementDB") + return data + else: + LOGGER.debug(f"Subscription {subs_id} does not exists") + return data + except sqlite3.Error as e: + LOGGER.debug(f"Subscription {subs_id} cannot be retrieved from the ManagementDB: {e}") + + def get_alarm(self,alarm_id): + try: + data = self.client.execute("SELECT * FROM alarm WHERE alarm_id is ?",(alarm_id,)).fetchone() + if data: + LOGGER.debug(f"Alarm {alarm_id} succesfully retrieved from the ManagementDB") + return data + else: + print(data) + LOGGER.debug(f"Alarm {alarm_id} does not exists") + return data + except sqlite3.Error as e: + LOGGER.debug(f"Alarm {alarm_id} cannot be retrieved from the ManagementDB: {e}") + + def get_KPIS(self): + try: + data = self.client.execute("SELECT * FROM kpi").fetchall() + LOGGER.debug(f"KPIs succesfully retrieved from the ManagementDB") + return data + except sqlite3.Error as e: + LOGGER.debug(f"KPIs cannot be retrieved from the ManagementDB: {e}") + + def get_subscriptions(self): + try: + data = self.client.execute("SELECT * FROM subscription").fetchall() + LOGGER.debug(f"Subscriptions succesfully retrieved from the ManagementDB") + return data + except sqlite3.Error as e: + LOGGER.debug(f"Subscriptions cannot be retrieved from the ManagementDB: {e}") + + def get_alarms(self): + try: + data = self.client.execute("SELECT * FROM alarm").fetchall() + LOGGER.debug(f"Alarms succesfully retrieved from the ManagementDB") + return data + except sqlite3.Error as e: + LOGGER.debug(f"Alarms cannot be retrieved from the ManagementDB: {e}") + + def check_monitoring_flag(self,kpi_id): + try: + c = self.client.cursor() + c.execute("SELECT monitor_flag FROM kpi WHERE kpi_id is ?",(kpi_id,)) + data=c.fetchone() + if data is None: + LOGGER.debug(f"KPI {kpi_id} does not exists") + return None + else: + if data[0] == 1: + return True + elif data[0] == 0: + return False + else: + LOGGER.debug(f"KPI {kpi_id} is wrong") + return None + except sqlite3.Error as e: + LOGGER.debug(f"KPI {kpi_id} cannot be checked from the ManagementDB: {e}") + + + def set_monitoring_flag(self,kpi_id,flag): + try: + c = self.client.cursor() + data = c.execute("SELECT * FROM kpi WHERE kpi_id is ?",(kpi_id,)).fetchone() + if data is None: + LOGGER.debug(f"KPI {kpi_id} does not exists") + return None + else: + if flag : + value = 1 + else: + value = 0 + c.execute("UPDATE kpi SET monitor_flag = ? WHERE kpi_id is ?",(value,kpi_id)) + return True + except sqlite3.Error as e: + LOGGER.debug(f"KPI {kpi_id} cannot be checked from the ManagementDB: {e}") \ No newline at end of file diff --git a/src/monitoring/service/MetricsDBTools.py b/src/monitoring/service/MetricsDBTools.py new file mode 100644 index 0000000000000000000000000000000000000000..6b98255411aa88ac18bd01474830b3bf268d3483 --- /dev/null +++ b/src/monitoring/service/MetricsDBTools.py @@ -0,0 +1,332 @@ +# 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 time +from random import random + +from questdb.ingress import Sender, IngressError +import requests +import json +import logging +import datetime +from common.tools.timestamp.Converters import timestamp_float_to_string, timestamp_utcnow_to_float +import psycopg2 + +from monitoring.service.NameMapping import NameMapping + +LOGGER = logging.getLogger(__name__) + + +class MetricsDB(): + def __init__(self, host, name_mapping : NameMapping, ilp_port=9009, rest_port=9000, table="monitoring", + commit_lag_ms=1000, retries=10, postgre=False, postgre_port=8812, postgre_user='admin', + postgre_password='quest'): + try: + self.host = host + self.name_mapping = name_mapping + self.ilp_port = int(ilp_port) + self.rest_port = rest_port + self.table = table + self.commit_lag_ms = commit_lag_ms + self.retries = retries + self.postgre = postgre + self.postgre_port = postgre_port + self.postgre_user = postgre_user + self.postgre_password = postgre_password + self.create_table() + LOGGER.info("MetricsDB initialized") + except: + LOGGER.info("MetricsDB cannot be initialized") + raise Exception("Critical error in the monitoring component") + + def is_postgre_enabled(self): + LOGGER.info(f"PostgreSQL is {self.postgre}") + return self.postgre + + def get_retry_number(self): + LOGGER.info(f"Retry number is {self.retries}") + return self.retries + + def get_commit_lag(self): + LOGGER.info(f"Commit lag of monitoring queries is {self.commit_lag_ms} ms") + return self.commit_lag_ms + + def enable_postgre_mode(self): + self.postgre = True + LOGGER.info("MetricsDB PostgreSQL query mode enabled") + + def disable_postgre_mode(self): + self.postgre = False + LOGGER.info("MetricsDB REST query mode enabled") + + def set_postgre_credentials(self, user, password): + self.postgre_user = user + self.postgre_password = password + LOGGER.info("MetricsDB PostgreSQL credentials changed") + + def set_retry_number(self, retries): + self.retries = retries + LOGGER.info(f"Retriy number changed to {retries}") + + def set_commit_lag(self, commit_lag_ms): + self.commit_lag_ms = commit_lag_ms + LOGGER.info(f"Commit lag of monitoring queries changed to {commit_lag_ms} ms") + + def create_table(self): + try: + query = f'CREATE TABLE IF NOT EXISTS {self.table}' \ + '(kpi_id SYMBOL,' \ + 'kpi_sample_type SYMBOL,' \ + 'device_id SYMBOL,' \ + 'device_name SYMBOL,' \ + 'endpoint_id SYMBOL,' \ + 'endpoint_name SYMBOL,' \ + 'service_id SYMBOL,' \ + 'slice_id SYMBOL,' \ + 'connection_id SYMBOL,' \ + 'timestamp TIMESTAMP,' \ + 'kpi_value DOUBLE)' \ + 'TIMESTAMP(timestamp);' + result = self.run_query(query) + if (result == True): + LOGGER.info(f"Table {self.table} created") + except (Exception) as e: + LOGGER.debug(f"Table {self.table} cannot be created. {e}") + raise Exception + + def write_KPI(self, time, kpi_id, kpi_sample_type, device_id, endpoint_id, service_id, slice_id, connection_id, kpi_value): + device_name = self.name_mapping.get_device_name(device_id) or '' + endpoint_name = self.name_mapping.get_endpoint_name(endpoint_id) or '' + + counter = 0 + while (counter < self.retries): + try: + with Sender(self.host, self.ilp_port) as sender: + sender.row( + self.table, + symbols={ + 'kpi_id': kpi_id, + 'kpi_sample_type': kpi_sample_type, + 'device_id': device_id, + 'device_name': device_name, + 'endpoint_id': endpoint_id, + 'endpoint_name': endpoint_name, + 'service_id': service_id, + 'slice_id': slice_id, + 'connection_id': connection_id,}, + columns={ + 'kpi_value': kpi_value}, + at=datetime.datetime.fromtimestamp(time)) + sender.flush() + counter = self.retries + LOGGER.debug(f"KPI written in the MetricsDB") + except (Exception, IngressError) as e: + counter = counter + 1 + if counter == self.retries: + raise Exception(f"Maximum number of retries achieved: {self.retries}") + + def run_query(self, sql_query): + counter = 0 + while (counter < self.retries): + try: + query_params = {'query': sql_query, 'fmt': 'json'} + url = f"http://{self.host}:{self.rest_port}/exec" + response = requests.get(url, params=query_params) + json_response = json.loads(response.text) + if ('ddl' in json_response): + LOGGER.debug(f"REST query executed succesfully, result: {json_response['ddl']}") + counter = self.retries + return True + elif ('dataset' in json_response): + LOGGER.debug(f"REST query executed, result: {json_response['dataset']}") + counter = self.retries + return json_response['dataset'] + except (Exception, requests.exceptions.RequestException) as e: + counter = counter + 1 + if counter == self.retries: + raise Exception(f"Maximum number of retries achieved: {self.retries}") + + def run_query_postgre(self, postgre_sql_query): + connection = None + cursor = None + counter = 0 + while (counter < self.retries): + try: + connection = psycopg2.connect( + user=self.postgre_user, + password=self.postgre_password, + host=self.host, + port=self.postgre_port, + database=self.table) + cursor = connection.cursor() + cursor.execute(postgre_sql_query) + result = cursor.fetchall() + LOGGER.debug(f"PostgreSQL query executed, result: {result}") + counter = self.retries + return result + except (Exception, psycopg2.Error) as e: + counter = counter + 1 + if counter == self.retries: + raise Exception(f"Maximum number of retries achieved: {self.retries}") + finally: + if cursor: + cursor.close() + if connection: + connection.close() + + def get_raw_kpi_list(self, kpi_id, monitoring_window_s, last_n_samples, start_timestamp, end_timestamp): + try: + query_root = f"SELECT timestamp, kpi_value FROM {self.table} WHERE kpi_id = '{kpi_id}' " + query = query_root + start_date = float() + end_date = float() + if last_n_samples: + query = query + f"ORDER BY timestamp DESC limit {last_n_samples}" + elif monitoring_window_s or start_timestamp or end_timestamp: + if start_timestamp and end_timestamp: + start_date = start_timestamp + end_date = end_timestamp + elif monitoring_window_s: + if start_timestamp and not end_timestamp: + start_date = start_timestamp + end_date = start_date + monitoring_window_s + elif end_timestamp and not start_timestamp: + end_date = end_timestamp + start_date = end_date - monitoring_window_s + elif not start_timestamp and not end_timestamp: + end_date = timestamp_utcnow_to_float() + start_date = end_date - monitoring_window_s + query = query + f"AND (timestamp BETWEEN '{timestamp_float_to_string(start_date)}' AND '{timestamp_float_to_string(end_date)}')" + else: + LOGGER.debug(f"Wrong parameters settings") + + LOGGER.debug(query) + + if self.postgre: + kpi_list = self.run_query_postgre(query) + LOGGER.debug(f"kpi_list postgre: {kpi_list}") + else: + kpi_list = self.run_query(query) + LOGGER.debug(f"kpi_list influx: {kpi_list}") + if kpi_list: + LOGGER.debug(f"New data received for subscription to KPI {kpi_id}") + return kpi_list + else: + LOGGER.debug(f"No new data for the subscription to KPI {kpi_id}") + except (Exception) as e: + LOGGER.debug(f"Subscription data cannot be retrieved. {e}") + + def get_subscription_data(self,subs_queue, kpi_id, sampling_interval_s=1): + try: + end_date = timestamp_utcnow_to_float() - self.commit_lag_ms / 1000 + start_date = end_date - sampling_interval_s + query = f"SELECT kpi_id, timestamp, kpi_value FROM {self.table} WHERE kpi_id = '{kpi_id}' AND (timestamp BETWEEN '{timestamp_float_to_string(start_date)}' AND '{timestamp_float_to_string(end_date)}')" + LOGGER.debug(query) + if self.postgre: + kpi_list = self.run_query_postgre(query) + LOGGER.debug(f"kpi_list postgre: {kpi_list}") + else: + kpi_list = self.run_query(query) + LOGGER.debug(f"kpi_list influx: {kpi_list}") + if kpi_list: + subs_queue.put_nowait(kpi_list) + LOGGER.debug(f"New data received for subscription to KPI {kpi_id}") + else: + LOGGER.debug(f"No new data for the subscription to KPI {kpi_id}") + except (Exception) as e: + LOGGER.debug(f"Subscription data cannot be retrieved. {e}") + + def get_alarm_data(self, alarm_queue, kpi_id, kpiMinValue, kpiMaxValue, inRange=True, includeMinValue=True, includeMaxValue=True, + subscription_frequency_ms=1000): + try: + end_date = timestamp_utcnow_to_float() - self.commit_lag_ms / 1000 + start_date = end_date - subscription_frequency_ms / 1000 + query = f"SELECT kpi_id, timestamp, kpi_value FROM {self.table} WHERE kpi_id = '{kpi_id}' AND (timestamp BETWEEN '{timestamp_float_to_string(start_date)}' AND '{timestamp_float_to_string(end_date)}')" + if self.postgre: + kpi_list = self.run_query_postgre(query) + else: + kpi_list = self.run_query(query) + if kpi_list: + LOGGER.debug(f"New data received for alarm of KPI {kpi_id}") + LOGGER.info(kpi_list) + valid_kpi_list = [] + for kpi in kpi_list: + alarm = False + kpi_value = kpi[2] + if (kpiMinValue == kpi_value and kpiMaxValue == kpi_value and inRange): + alarm = True + elif ( + inRange and kpiMinValue is not None and kpiMaxValue is not None and includeMinValue and includeMaxValue): + if (kpi_value >= kpiMinValue and kpi_value <= kpiMaxValue): + alarm = True + elif ( + inRange and kpiMinValue is not None and kpiMaxValue is not None and includeMinValue and not includeMaxValue): + if (kpi_value >= kpiMinValue and kpi_value < kpiMaxValue): + alarm = True + elif ( + inRange and kpiMinValue is not None and kpiMaxValue is not None and not includeMinValue and includeMaxValue): + if (kpi_value > kpiMinValue and kpi_value <= kpiMaxValue): + alarm = True + elif ( + inRange and kpiMinValue is not None and kpiMaxValue is not None and not includeMinValue and not includeMaxValue): + if (kpi_value > kpiMinValue and kpi_value < kpiMaxValue): + alarm = True + elif ( + not inRange and kpiMinValue is not None and kpiMaxValue is not None and includeMinValue and includeMaxValue): + if (kpi_value <= kpiMinValue or kpi_value >= kpiMaxValue): + alarm = True + elif ( + not inRange and kpiMinValue is not None and kpiMaxValue is not None and includeMinValue and not includeMaxValue): + if (kpi_value <= kpiMinValue or kpi_value > kpiMaxValue): + alarm = True + elif ( + not inRange and kpiMinValue is not None and kpiMaxValue is not None and not includeMinValue and includeMaxValue): + if (kpi_value < kpiMinValue or kpi_value >= kpiMaxValue): + alarm = True + elif ( + not inRange and kpiMinValue is not None and kpiMaxValue is not None and not includeMinValue and not includeMaxValue): + if (kpi_value < kpiMinValue or kpi_value > kpiMaxValue): + alarm = True + elif (inRange and kpiMinValue is not None and kpiMaxValue is None and includeMinValue): + if (kpi_value >= kpiMinValue): + alarm = True + elif (inRange and kpiMinValue is not None and kpiMaxValue is None and not includeMinValue): + if (kpi_value > kpiMinValue): + alarm = True + elif (not inRange and kpiMinValue is not None and kpiMaxValue is None and not includeMinValue): + if (kpi_value <= kpiMinValue): + alarm = True + elif (not inRange and kpiMinValue is not None and kpiMaxValue is None and not includeMinValue): + if (kpi_value <= kpiMinValue): + alarm = True + elif (inRange and kpiMinValue is None and kpiMaxValue is not None and includeMaxValue): + if (kpi_value <= kpiMaxValue): + alarm = True + elif (inRange and kpiMinValue is None and kpiMaxValue is not None and not includeMaxValue): + if (kpi_value < kpiMaxValue): + alarm = True + elif (not inRange and kpiMinValue is None and kpiMaxValue is not None and not includeMaxValue): + if (kpi_value >= kpiMaxValue): + alarm = True + elif (not inRange and kpiMinValue is None and kpiMaxValue is not None and not includeMaxValue): + if (kpi_value >= kpiMaxValue): + alarm = True + if alarm: + valid_kpi_list.append(kpi) + alarm_queue.put_nowait(valid_kpi_list) + LOGGER.debug(f"Alarm of KPI {kpi_id} triggered -> kpi_value:{kpi[2]}, timestamp:{kpi[1]}") + else: + LOGGER.debug(f"No new data for the alarm of KPI {kpi_id}") + except (Exception) as e: + LOGGER.debug(f"Alarm data cannot be retrieved. {e}") \ No newline at end of file diff --git a/src/monitoring/service/MonitoringService.py b/src/monitoring/service/MonitoringService.py index f1ecba3664dfee74fddb7093ff352724791b4f7d..5680a80943144db0e9a8f156c65ff0b15013482e 100644 --- a/src/monitoring/service/MonitoringService.py +++ b/src/monitoring/service/MonitoringService.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,63 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -from concurrent import futures - -import grpc, logging - +from common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc +from common.proto.monitoring_pb2_grpc import add_MonitoringServiceServicer_to_server +from common.tools.service.GenericGrpcService import GenericGrpcService from monitoring.service.MonitoringServiceServicerImpl import MonitoringServiceServicerImpl -from monitoring.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD -from monitoring.proto.monitoring_pb2_grpc import add_MonitoringServiceServicer_to_server - -from grpc_health.v1 import health -from grpc_health.v1 import health_pb2 -from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server - -from common.logger import getJSONLogger -LOGGER = getJSONLogger('monitoring-server') - -BIND_ADDRESS = '0.0.0.0' - -class MonitoringService: - def __init__(self, address=BIND_ADDRESS, port=GRPC_SERVICE_PORT, max_workers=GRPC_MAX_WORKERS, - grace_period=GRPC_GRACE_PERIOD): - self.address = address - self.port = port - self.endpoint = None - self.max_workers = max_workers - self.grace_period = grace_period - self.monitoring_servicer = None - self.health_servicer = None - self.pool = None - self.server = None +from monitoring.service.NameMapping import NameMapping - def start(self): - # create gRPC server - self.server = grpc.server(futures.ThreadPoolExecutor(max_workers=self.max_workers)) # ,interceptors=(tracer_interceptor,)) +class MonitoringService(GenericGrpcService): + def __init__(self, name_mapping : NameMapping, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.MONITORING) + super().__init__(port, cls_name=cls_name) + self.monitoring_servicer = MonitoringServiceServicerImpl(name_mapping) - # add monitoring servicer class to gRPC server - self.monitoring_servicer = MonitoringServiceServicerImpl() + def install_servicers(self): add_MonitoringServiceServicer_to_server(self.monitoring_servicer, self.server) - - # add gRPC health checker servicer class to gRPC server - self.health_servicer = health.HealthServicer( - experimental_non_blocking=True, experimental_thread_pool=futures.ThreadPoolExecutor(max_workers=1)) - add_HealthServicer_to_server(self.health_servicer, self.server) - - # start server - self.endpoint = '{:s}:{:s}'.format(str(self.address), str(self.port)) - LOGGER.info('Starting Service (tentative endpoint: {:s}, max_workers: {:s})...'.format( - str(self.endpoint), str(self.max_workers))) - - self.server.add_insecure_port(self.endpoint) - self.server.start() - self.health_servicer.set('', health_pb2.HealthCheckResponse.SERVING) # pylint: disable=maybe-no-member - - LOGGER.debug('Service started') - - def stop(self): - LOGGER.debug('Stopping service (grace period {} seconds)...'.format(self.grace_period)) - self.health_servicer.enter_graceful_shutdown() - self.server.stop(self.grace_period) - LOGGER.debug('Service stopped') - diff --git a/src/monitoring/service/MonitoringServiceServicerImpl.py b/src/monitoring/service/MonitoringServiceServicerImpl.py index 88cd2d3a83357dec5c49e1894ed4243ceb1b4b6e..0bbce15094b87a17e332aad21bf34a565e8dd087 100644 --- a/src/monitoring/service/MonitoringServiceServicerImpl.py +++ b/src/monitoring/service/MonitoringServiceServicerImpl.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,176 +12,605 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os,grpc, logging -import socket +import os, grpc +from queue import Queue -from prometheus_client import Summary -from prometheus_client import Counter -from common.Settings import get_setting +from typing import Iterator -from monitoring.Config import DEVICE_GRPC_SERVICE_PORT, DEVICE_SERVICE_HOST -from monitoring.proto.kpi_sample_types_pb2 import KpiSampleType -from monitoring.service import SqliteTools, InfluxTools -from monitoring.proto import monitoring_pb2 -from monitoring.proto import monitoring_pb2_grpc - -from common.rpc_method_wrapper.ServiceExceptions import ServiceException - -from context.proto import context_pb2 +from common.logger import getJSONLogger +from common.proto.context_pb2 import Empty +from common.proto.device_pb2 import MonitoringSettings +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.proto.monitoring_pb2_grpc import MonitoringServiceServicer +from common.proto.monitoring_pb2 import AlarmResponse, AlarmDescriptor, AlarmList, SubsList, KpiId, \ + KpiDescriptor, KpiList, KpiQuery, SubsDescriptor, SubscriptionID, AlarmID, KpiDescriptorList, \ + MonitorKpiRequest, Kpi, AlarmSubscription, SubsResponse, RawKpiTable, RawKpi, RawKpiList +from common.method_wrappers.ServiceExceptions import ServiceException +from common.tools.timestamp.Converters import timestamp_string_to_float, timestamp_utcnow_to_float +from monitoring.service import ManagementDBTools, MetricsDBTools from device.client.DeviceClient import DeviceClient -from device.proto import device_pb2 -LOGGER = logging.getLogger(__name__) +from prometheus_client import Counter, Summary -MONITORING_GETINSTANTKPI_REQUEST_TIME = Summary('monitoring_getinstantkpi_processing_seconds', 'Time spent processing monitoring instant kpi request') -MONITORING_INCLUDEKPI_COUNTER = Counter('monitoring_includekpi_counter', 'Monitoring include kpi request counter') +from monitoring.service.AlarmManager import AlarmManager +from monitoring.service.NameMapping import NameMapping +from monitoring.service.SubscriptionManager import SubscriptionManager -INFLUXDB_HOSTNAME = os.environ.get("INFLUXDB_HOSTNAME") -INFLUXDB_USER = os.environ.get("INFLUXDB_USER") -INFLUXDB_PASSWORD = os.environ.get("INFLUXDB_PASSWORD") -INFLUXDB_DATABASE = os.environ.get("INFLUXDB_DATABASE") +LOGGER = getJSONLogger('monitoringservice-server') +LOGGER.setLevel('DEBUG') -DEVICE_SERVICE_HOST = get_setting('DEVICESERVICE_SERVICE_HOST', default=DEVICE_SERVICE_HOST ) -DEVICE_SERVICE_PORT = get_setting('DEVICESERVICE_SERVICE_PORT_GRPC', default=DEVICE_GRPC_SERVICE_PORT) +MONITORING_GETINSTANTKPI_REQUEST_TIME = Summary( + 'monitoring_getinstantkpi_processing_seconds', 'Time spent processing monitoring instant kpi request') +MONITORING_INCLUDEKPI_COUNTER = Counter('monitoring_includekpi_counter', 'Monitoring include kpi request counter') +METRICSDB_HOSTNAME = os.environ.get("METRICSDB_HOSTNAME") +METRICSDB_ILP_PORT = os.environ.get("METRICSDB_ILP_PORT") +METRICSDB_REST_PORT = os.environ.get("METRICSDB_REST_PORT") +METRICSDB_TABLE = os.environ.get("METRICSDB_TABLE") -class MonitoringServiceServicerImpl(monitoring_pb2_grpc.MonitoringServiceServicer): - def __init__(self): +class MonitoringServiceServicerImpl(MonitoringServiceServicer): + def __init__(self, name_mapping : NameMapping): LOGGER.info('Init monitoringService') # Init sqlite monitoring db - self.sql_db = SqliteTools.SQLite('monitoring.db') - self.deviceClient = DeviceClient(address=DEVICE_SERVICE_HOST, port=DEVICE_GRPC_SERVICE_PORT) # instantiate the client - - # Create influx_db client - self.influx_db = InfluxTools.Influx(INFLUXDB_HOSTNAME,"8086",INFLUXDB_USER,INFLUXDB_PASSWORD,INFLUXDB_DATABASE) - - # CreateKpi (CreateKpiRequest) returns (KpiId) {} - def CreateKpi(self, request : monitoring_pb2.KpiDescriptor, grpc_context : grpc.ServicerContext) -> monitoring_pb2.KpiId : + self.management_db = ManagementDBTools.ManagementDB('monitoring.db') + self.deviceClient = DeviceClient() + self.metrics_db = MetricsDBTools.MetricsDB( + METRICSDB_HOSTNAME, name_mapping, METRICSDB_ILP_PORT, METRICSDB_REST_PORT, METRICSDB_TABLE) + self.subs_manager = SubscriptionManager(self.metrics_db) + self.alarm_manager = AlarmManager(self.metrics_db) + LOGGER.info('MetricsDB initialized') + + # SetKpi (SetKpiRequest) returns (KpiId) {} + def SetKpi( + self, request: KpiDescriptor, grpc_context: grpc.ServicerContext + ) -> KpiId: # CREATEKPI_COUNTER_STARTED.inc() - LOGGER.info('CreateKpi') + LOGGER.info('SetKpi') try: # Here the code to create a sqlite query to crete a KPI and return a KpiID - kpi_id = monitoring_pb2.KpiId() + response = KpiId() kpi_description = request.kpi_description kpi_sample_type = request.kpi_sample_type - kpi_device_id = request.device_id.device_uuid.uuid + kpi_device_id = request.device_id.device_uuid.uuid kpi_endpoint_id = request.endpoint_id.endpoint_uuid.uuid - kpi_service_id = request.service_id.service_uuid.uuid + kpi_service_id = request.service_id.service_uuid.uuid + kpi_slice_id = request.slice_id.slice_uuid.uuid + kpi_connection_id = request.connection_id.connection_uuid.uuid - data = self.sql_db.insert_KPI(kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id) - kpi_id.kpi_id.uuid = str(data) + if request.kpi_id.kpi_id.uuid != "": + response.kpi_id.uuid = request.kpi_id.kpi_id.uuid + # Here the code to modify an existing kpi + else: + data = self.management_db.insert_KPI( + kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id, kpi_slice_id, kpi_connection_id) + response.kpi_id.uuid = str(data) - # CREATEKPI_COUNTER_COMPLETED.inc() - return kpi_id + return response except ServiceException as e: - LOGGER.exception('CreateKpi exception') + LOGGER.exception('SetKpi exception') # CREATEKPI_COUNTER_FAILED.inc() grpc_context.abort(e.code, e.details) except Exception as e: # pragma: no cover - LOGGER.exception('CreateKpi exception') + LOGGER.exception('SetKpi exception') # CREATEKPI_COUNTER_FAILED.inc() grpc_context.abort(grpc.StatusCode.INTERNAL, str(e)) - # rpc MonitorKpi (MonitorKpiRequest) returns (context.Empty) {} - def MonitorKpi ( self, request : monitoring_pb2.MonitorKpiRequest, grpc_context : grpc.ServicerContext) -> context_pb2.Empty: + def DeleteKpi(self, request: KpiId, grpc_context: grpc.ServicerContext) -> Empty: - LOGGER.info('MonitorKpi') + LOGGER.info('DeleteKpi') try: - # Creates the request to send to the device service - monitor_device_request = device_pb2.MonitoringSettings() + LOGGER.debug(f'DeleteKpi with KpiID: {request.kpi_id.uuid}') + kpi_id = int(request.kpi_id.uuid) + kpi = self.management_db.get_KPI(kpi_id) + if kpi: + self.management_db.delete_KPI(kpi_id) + else: + LOGGER.info('DeleteKpi error: KpiID({:s}): not found in database'.format(str(kpi_id))) + return Empty() + except ServiceException as e: + LOGGER.exception('DeleteKpi exception') + grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('DeleteKpi exception') - kpiDescriptor = self.GetKpiDescriptor(request.kpi_id, grpc_context) + def GetKpiDescriptor(self, request: KpiId, grpc_context: grpc.ServicerContext) -> KpiDescriptor: + LOGGER.info('getting Kpi by KpiID') + try: + kpi_id = request.kpi_id.uuid + kpi_db = self.management_db.get_KPI(int(kpi_id)) + kpiDescriptor = KpiDescriptor() + if kpi_db is None: + LOGGER.info('GetKpiDescriptor error: KpiID({:s}): not found in database'.format(str(kpi_id))) + else: + kpiDescriptor.kpi_description = kpi_db[1] + kpiDescriptor.kpi_sample_type = kpi_db[2] + kpiDescriptor.device_id.device_uuid.uuid = str(kpi_db[3]) + kpiDescriptor.endpoint_id.endpoint_uuid.uuid = str(kpi_db[4]) + kpiDescriptor.service_id.service_uuid.uuid = str(kpi_db[5]) + kpiDescriptor.slice_id.slice_uuid.uuid = str(kpi_db[6]) + kpiDescriptor.connection_id.connection_uuid.uuid = str(kpi_db[7]) + return kpiDescriptor + except ServiceException as e: + LOGGER.exception('GetKpiDescriptor exception') + grpc_context.abort(e.code, e.details) + except Exception: # pragma: no cover + LOGGER.exception('GetKpiDescriptor exception') + + def GetKpiDescriptorList(self, request: Empty, grpc_context: grpc.ServicerContext) -> KpiDescriptorList: + + LOGGER.info('GetKpiDescriptorList') + try: + kpi_descriptor_list = KpiDescriptorList() + + data = self.management_db.get_KPIS() + LOGGER.debug(f"data: {data}") - monitor_device_request.kpi_descriptor.CopyFrom(kpiDescriptor) - monitor_device_request.kpi_id.kpi_id.uuid = request.kpi_id.kpi_id.uuid - monitor_device_request.sampling_duration_s = request.sampling_duration_s - monitor_device_request.sampling_interval_s = request.sampling_interval_s + for item in data: + kpi_descriptor = KpiDescriptor() + kpi_descriptor.kpi_id.kpi_id.uuid = str(item[0]) + kpi_descriptor.kpi_description = item[1] + kpi_descriptor.kpi_sample_type = item[2] + kpi_descriptor.device_id.device_uuid.uuid = str(item[3]) + kpi_descriptor.endpoint_id.endpoint_uuid.uuid = str(item[4]) + kpi_descriptor.service_id.service_uuid.uuid = str(item[5]) + kpi_descriptor.slice_id.slice_uuid.uuid = str(item[6]) + kpi_descriptor.connection_id.connection_uuid.uuid = str(item[7]) + + kpi_descriptor_list.kpi_descriptor_list.append(kpi_descriptor) + + return kpi_descriptor_list + except ServiceException as e: + LOGGER.exception('GetKpiDescriptorList exception') + grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('GetKpiDescriptorList exception') + + def IncludeKpi(self, request: Kpi, grpc_context: grpc.ServicerContext) -> Empty: + + LOGGER.info('IncludeKpi') - s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - if s.connect_ex((DEVICE_SERVICE_HOST, DEVICE_GRPC_SERVICE_PORT)) == 0: - self.deviceClient.MonitorDeviceKpi(monitor_device_request) + try: + kpi_id = request.kpi_id.kpi_id.uuid + kpiDescriptor = self.GetKpiDescriptor(request.kpi_id, grpc_context) + + if kpiDescriptor is None: + LOGGER.info('IncludeKpi error: KpiID({:s}): not found in database'.format(str(kpi_id))) else: - LOGGER.warning('Device service is not reachable') + kpiSampleType = KpiSampleType.Name(kpiDescriptor.kpi_sample_type).upper().replace('KPISAMPLETYPE_', '') + kpiId = kpi_id + deviceId = kpiDescriptor.device_id.device_uuid.uuid + endpointId = kpiDescriptor.endpoint_id.endpoint_uuid.uuid + serviceId = kpiDescriptor.service_id.service_uuid.uuid + sliceId = kpiDescriptor.slice_id.slice_uuid.uuid + connectionId = kpiDescriptor.connection_id.connection_uuid.uuid + time_stamp = request.timestamp.timestamp + kpi_value = getattr(request.kpi_value, request.kpi_value.WhichOneof('value')) + + # Build the structure to be included as point in the MetricsDB + self.metrics_db.write_KPI(time_stamp, kpiId, kpiSampleType, deviceId, endpointId, serviceId, sliceId, connectionId, kpi_value) + + return Empty() + except ServiceException as e: + LOGGER.exception('IncludeKpi exception') + # CREATEKPI_COUNTER_FAILED.inc() + grpc_context.abort(e.code, e.details) + except Exception: # pragma: no cover + LOGGER.exception('IncludeKpi exception') + # CREATEKPI_COUNTER_FAILED.inc() - return context_pb2.Empty() + def MonitorKpi(self, request: MonitorKpiRequest, grpc_context: grpc.ServicerContext) -> Empty: + + LOGGER.info('MonitorKpi') + try: + kpi_id = int(request.kpi_id.kpi_id.uuid) + kpi = self.management_db.get_KPI(kpi_id) + response = Empty() + + if kpi: + # Sets the request to send to the device service + monitor_device_request = MonitoringSettings() + + kpiDescriptor = self.GetKpiDescriptor(request.kpi_id, grpc_context) + + monitor_device_request.kpi_descriptor.CopyFrom(kpiDescriptor) + monitor_device_request.kpi_id.kpi_id.uuid = request.kpi_id.kpi_id.uuid + monitor_device_request.sampling_duration_s = request.monitoring_window_s + monitor_device_request.sampling_interval_s = request.sampling_rate_s + + if not self.management_db.check_monitoring_flag(kpi_id): + device_client = DeviceClient() + device_client.MonitorDeviceKpi(monitor_device_request) + self.management_db.set_monitoring_flag(kpi_id,True) + self.management_db.check_monitoring_flag(kpi_id) + else: + LOGGER.warning('MonitorKpi warning: KpiID({:s}) is currently being monitored'.format(str(kpi_id))) + else: + LOGGER.info('MonitorKpi error: KpiID({:s}): not found in database'.format(str(kpi_id))) + return response except ServiceException as e: LOGGER.exception('MonitorKpi exception') # CREATEKPI_COUNTER_FAILED.inc() grpc_context.abort(e.code, e.details) except Exception as e: # pragma: no cover LOGGER.exception('MonitorKpi exception') + grpc_context.abort(grpc.StatusCode.INTERNAL, str(e)) # CREATEKPI_COUNTER_FAILED.inc() + def QueryKpiData(self, request: KpiQuery, grpc_context: grpc.ServicerContext) -> RawKpiTable: + + LOGGER.info('QueryKpiData') + try: + raw_kpi_table = RawKpiTable() + + LOGGER.debug(str(request)) + + kpi_id_list = request.kpi_ids + monitoring_window_s = request.monitoring_window_s + last_n_samples = request.last_n_samples + start_timestamp = request.start_timestamp.timestamp + end_timestamp = request.end_timestamp.timestamp + + # Check if all the Kpi_ids exist + for item in kpi_id_list: + kpi_id = item.kpi_id.uuid + + kpiDescriptor = self.GetKpiDescriptor(item, grpc_context) + if kpiDescriptor is None: + LOGGER.info('QueryKpiData error: KpiID({:s}): not found in database'.format(str(kpi_id))) + break + else: + # Execute query per Kpi_id and introduce their kpi_list in the table + kpi_list = self.metrics_db.get_raw_kpi_list(kpi_id,monitoring_window_s,last_n_samples,start_timestamp,end_timestamp) + raw_kpi_list = RawKpiList() + raw_kpi_list.kpi_id.kpi_id.uuid = kpi_id + + LOGGER.debug(str(kpi_list)) + + if kpi_list is None: + LOGGER.info('QueryKpiData error: KpiID({:s}): points not found in metrics database'.format(str(kpi_id))) + else: + for item in kpi_list: + raw_kpi = RawKpi() + raw_kpi.timestamp.timestamp = timestamp_string_to_float(item[0]) + raw_kpi.kpi_value.floatVal = item[1] + raw_kpi_list.raw_kpis.append(raw_kpi) + + raw_kpi_table.raw_kpi_lists.append(raw_kpi_list) + + return raw_kpi_table + except ServiceException as e: + LOGGER.exception('QueryKpiData exception') + grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('QueryKpiData exception') - # rpc IncludeKpi(IncludeKpiRequest) returns(context.Empty) {} - def IncludeKpi(self, request : monitoring_pb2.Kpi, grpc_context : grpc.ServicerContext) -> context_pb2.Empty: + def SetKpiSubscription(self, request: SubsDescriptor, grpc_context: grpc.ServicerContext) -> SubsResponse: - LOGGER.info('IncludeKpi') + LOGGER.info('SubscribeKpi') + try: + subs_queue = Queue() + + kpi_id = request.kpi_id.kpi_id.uuid + sampling_duration_s = request.sampling_duration_s + sampling_interval_s = request.sampling_interval_s + start_timestamp = request.start_timestamp.timestamp + end_timestamp = request.end_timestamp.timestamp + + subscriber = "localhost" # Investigate how to get info from the requester + + subs_id = self.management_db.insert_subscription(kpi_id, subscriber, sampling_duration_s, + sampling_interval_s, start_timestamp, end_timestamp) + self.subs_manager.create_subscription(subs_queue, subs_id, kpi_id, sampling_interval_s, sampling_duration_s, + start_timestamp, end_timestamp) + + # parse queue to append kpis into the list + while True: + while not subs_queue.empty(): + subs_response = SubsResponse() + list = subs_queue.get_nowait() + for item in list: + kpi = Kpi() + kpi.kpi_id.kpi_id.uuid = str(item[0]) + kpi.timestamp.timestamp = timestamp_string_to_float(item[1]) + kpi.kpi_value.floatVal = item[2] # This must be improved + subs_response.kpi_list.kpi.append(kpi) + subs_response.subs_id.subs_id.uuid = str(subs_id) + yield subs_response + if timestamp_utcnow_to_float() > end_timestamp: + break + # yield subs_response + except ServiceException as e: + LOGGER.exception('SubscribeKpi exception') + grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('SubscribeKpi exception') + + def GetSubsDescriptor(self, request: SubscriptionID, grpc_context: grpc.ServicerContext) -> SubsDescriptor: + LOGGER.info('GetSubsDescriptor') try: - kpiDescriptor = self.GetKpiDescriptor(request.kpi_id, grpc_context) - if kpiDescriptor is None: - LOGGER.warning('Ignoring sample with KPIId({:s}): not found in database'.format(str(request.kpi_id))) - return context_pb2.Empty() + subs_id = request.subs_id.uuid + subs_db = self.management_db.get_subscription(int(request.subs_id.uuid)) + response = SubsDescriptor() + if subs_db is None: + LOGGER.info('GetSubsDescriptor error: SubsID({:s}): not found in database'.format(str(subs_id))) + else: + LOGGER.debug(subs_db) + response.subs_id.subs_id.uuid = str(subs_db[0]) + response.kpi_id.kpi_id.uuid = str(subs_db[1]) + response.sampling_duration_s = subs_db[3] + response.sampling_interval_s = subs_db[4] + response.start_timestamp.timestamp = subs_db[5] + response.end_timestamp.timestamp = subs_db[6] + + return response + except ServiceException as e: + LOGGER.exception('GetSubsDescriptor exception') + grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('GetSubsDescriptor exception') - kpiSampleType = KpiSampleType.Name(kpiDescriptor.kpi_sample_type).upper().replace('KPISAMPLETYPE_', '') - kpiId = request.kpi_id.kpi_id.uuid - deviceId = kpiDescriptor.device_id.device_uuid.uuid - endpointId = kpiDescriptor.endpoint_id.endpoint_uuid.uuid - serviceId = kpiDescriptor.service_id.service_uuid.uuid - time_stamp = request.timestamp - kpi_value = getattr(request.kpi_value, request.kpi_value.WhichOneof('value')) + def GetSubscriptions(self, request: Empty, grpc_context: grpc.ServicerContext) -> SubsList: - # Build the structure to be included as point in the influxDB - self.influx_db.write_KPI(time_stamp,kpiId,kpiSampleType,deviceId,endpointId,serviceId,kpi_value) + LOGGER.info('GetSubscriptions') + try: + response = SubsList() + data = self.management_db.get_subscriptions() + + for subs_db in data: + subs_descriptor = SubsDescriptor() + + subs_descriptor.subs_id.subs_id.uuid = str(subs_db[0]) + subs_descriptor.kpi_id.kpi_id.uuid = str(subs_db[1]) + subs_descriptor.sampling_duration_s = subs_db[3] + subs_descriptor.sampling_interval_s = subs_db[4] + subs_descriptor.start_timestamp.timestamp = subs_db[5] + subs_descriptor.end_timestamp.timestamp = subs_db[6] - #self.influx_db.read_KPI_points() + response.subs_descriptor.append(subs_descriptor) + return response except ServiceException as e: - LOGGER.exception('IncludeKpi exception') - # CREATEKPI_COUNTER_FAILED.inc() + LOGGER.exception('GetSubscriptions exception') grpc_context.abort(e.code, e.details) except Exception as e: # pragma: no cover - LOGGER.exception('IncludeKpi exception') - # CREATEKPI_COUNTER_FAILED.inc() - return context_pb2.Empty() + LOGGER.exception('GetSubscriptions exception') - def GetStreamKpi ( self, request, grpc_context : grpc.ServicerContext): - # receives monitoring.KpiId returns stream monitoring.Kpi - LOGGER.info('GetStreamKpi') - yield monitoring_pb2.Kpi() + def DeleteSubscription(self, request: SubscriptionID, grpc_context: grpc.ServicerContext) -> Empty: - @MONITORING_GETINSTANTKPI_REQUEST_TIME.time() - def GetInstantKpi ( self, request, grpc_context : grpc.ServicerContext): - # receives monitoring.KpiId returns monitoring.Kpi - LOGGER.info('GetInstantKpi') - return monitoring_pb2.Kpi() + LOGGER.info('DeleteSubscription') + try: + LOGGER.debug(f'DeleteSubscription with SubsID: {request.subs_id.uuid}') + subs_id = int(request.subs_id.uuid) + subs_db = self.management_db.get_subscription(int(request.subs_id.uuid)) + if subs_db: + self.management_db.delete_subscription(subs_id) + else: + LOGGER.info('DeleteSubscription error: SubsID({:s}): not found in database'.format(str(subs_id))) + return Empty() + except ServiceException as e: + LOGGER.exception('DeleteSubscription exception') + grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('DeleteSubscription exception') + def SetKpiAlarm(self, request: AlarmDescriptor, grpc_context: grpc.ServicerContext) -> AlarmResponse: - def GetKpiDescriptor(self, request : monitoring_pb2.KpiId, grpc_context : grpc.ServicerContext) -> monitoring_pb2.KpiDescriptor: - LOGGER.info('getting Kpi by KpiID') + LOGGER.info('SetKpiAlarm') try: - kpi_db = self.sql_db.get_KPI(int(request.kpi_id.uuid)) - #LOGGER.info('sql_db.get_KPIS={:s}'.format(str(self.sql_db.get_KPIS()))) - #LOGGER.info('kpi_db={:s}'.format(str(kpi_db))) - if kpi_db is None: return None + response = AlarmID() + + alarm_description = request.alarm_description + alarm_name = request.name + kpi_id = request.kpi_id.kpi_id.uuid + kpi_min_value = request.kpi_value_range.kpiMinValue.floatVal + kpi_max_value = request.kpi_value_range.kpiMaxValue.floatVal + in_range = request.kpi_value_range.inRange + include_min_value = request.kpi_value_range.includeMinValue + include_max_value = request.kpi_value_range.includeMaxValue + timestamp = request.timestamp.timestamp + + LOGGER.debug(f"request.AlarmID: {request.alarm_id.alarm_id.uuid}") + + if request.alarm_id.alarm_id.uuid != "": + alarm_id = request.alarm_id.alarm_id.uuid + # Here the code to modify an existing alarm + else: + alarm_id = self.management_db.insert_alarm(alarm_description, alarm_name, kpi_id, kpi_min_value, + kpi_max_value, + in_range, include_min_value, include_max_value) + LOGGER.debug(f"AlarmID: {alarm_id}") + response.alarm_id.uuid = str(alarm_id) - kpiDescriptor = monitoring_pb2.KpiDescriptor() + return response + except ServiceException as e: + LOGGER.exception('SetKpiAlarm exception') + grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('SetKpiAlarm exception') - kpiDescriptor.kpi_description = kpi_db[1] - kpiDescriptor.kpi_sample_type = kpi_db[2] - kpiDescriptor.device_id.device_uuid.uuid = str(kpi_db[3]) - kpiDescriptor.endpoint_id.endpoint_uuid.uuid = str(kpi_db[4]) - kpiDescriptor.service_id.service_uuid.uuid = str(kpi_db[5]) + def GetAlarms(self, request: Empty, grpc_context: grpc.ServicerContext) -> AlarmList: - return kpiDescriptor + LOGGER.info('GetAlarms') + try: + response = AlarmList() + data = self.management_db.get_alarms() + + for alarm in data: + alarm_descriptor = AlarmDescriptor() + + alarm_descriptor.alarm_id.alarm_id.uuid = str(alarm[0]) + alarm_descriptor.alarm_description = alarm[1] + alarm_descriptor.name = alarm[2] + alarm_descriptor.kpi_id.kpi_id.uuid = str(alarm[3]) + alarm_descriptor.kpi_value_range.kpiMinValue.floatVal = alarm[4] + alarm_descriptor.kpi_value_range.kpiMaxValue.floatVal = alarm[5] + alarm_descriptor.kpi_value_range.inRange = bool(alarm[6]) + alarm_descriptor.kpi_value_range.includeMinValue = bool(alarm[7]) + alarm_descriptor.kpi_value_range.includeMaxValue = bool(alarm[8]) + + response.alarm_descriptor.append(alarm_descriptor) + + return response except ServiceException as e: - LOGGER.exception('GetKpiDescriptor exception') + LOGGER.exception('GetAlarms exception') grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('GetAlarms exception') + + def GetAlarmDescriptor(self, request: AlarmID, grpc_context: grpc.ServicerContext) -> AlarmDescriptor: + LOGGER.info('GetAlarmDescriptor') + try: + alarm_id = request.alarm_id.uuid + LOGGER.debug(alarm_id) + alarm = self.management_db.get_alarm(alarm_id) + response = AlarmDescriptor() + + if alarm: + LOGGER.debug(f"{alarm}") + response.alarm_id.alarm_id.uuid = str(alarm_id) + response.alarm_description = alarm[1] + response.name = alarm[2] + response.kpi_id.kpi_id.uuid = str(alarm[3]) + response.kpi_value_range.kpiMinValue.floatVal = alarm[4] + response.kpi_value_range.kpiMaxValue.floatVal = alarm[5] + response.kpi_value_range.inRange = bool(alarm[6]) + response.kpi_value_range.includeMinValue = bool(alarm[7]) + response.kpi_value_range.includeMaxValue = bool(alarm[8]) + else: + LOGGER.info('GetAlarmDescriptor error: AlarmID({:s}): not found in database'.format(str(alarm_id))) + response.alarm_id.alarm_id.uuid = "NoID" + return response + except ServiceException as e: + LOGGER.exception('GetAlarmDescriptor exception') + grpc_context.abort(e.code, e.details) except Exception as e: # pragma: no cover - LOGGER.exception('GetKpiDescriptor exception') + LOGGER.exception('GetAlarmDescriptor exception') + + def GetAlarmResponseStream(self, request: AlarmSubscription, grpc_context: grpc.ServicerContext) -> Iterator[ + AlarmResponse]: + + LOGGER.info('GetAlarmResponseStream') + try: + alarm_id = request.alarm_id.alarm_id.uuid + alarm_data = self.management_db.get_alarm(alarm_id) + real_start_time = timestamp_utcnow_to_float() + + if alarm_data: + LOGGER.debug(f"{alarm_data}") + alarm_queue = Queue() + + alarm_id = request.alarm_id.alarm_id.uuid + kpi_id = alarm_data[3] + kpiMinValue = alarm_data[4] + kpiMaxValue = alarm_data[5] + inRange = alarm_data[6] + includeMinValue = alarm_data[7] + includeMaxValue = alarm_data[8] + subscription_frequency_ms = request.subscription_frequency_ms + subscription_timeout_s = request.subscription_timeout_s + + end_timestamp = real_start_time + subscription_timeout_s + + self.alarm_manager.create_alarm(alarm_queue, alarm_id, kpi_id, kpiMinValue, kpiMaxValue, inRange, + includeMinValue, includeMaxValue, subscription_frequency_ms, + subscription_timeout_s) + + while True: + while not alarm_queue.empty(): + alarm_response = AlarmResponse() + list = alarm_queue.get_nowait() + size = len(list) + for item in list: + kpi = Kpi() + kpi.kpi_id.kpi_id.uuid = str(item[0]) + kpi.timestamp.timestamp = timestamp_string_to_float(item[1]) + kpi.kpi_value.floatVal = item[2] # This must be improved + alarm_response.kpi_list.kpi.append(kpi) + alarm_response.alarm_id.alarm_id.uuid = alarm_id + yield alarm_response + if timestamp_utcnow_to_float() > end_timestamp: + break + else: + LOGGER.info('GetAlarmResponseStream error: AlarmID({:s}): not found in database'.format(str(alarm_id))) + alarm_response = AlarmResponse() + alarm_response.alarm_id.alarm_id.uuid = "NoID" + return alarm_response + except ServiceException as e: + LOGGER.exception('GetAlarmResponseStream exception') + grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('GetAlarmResponseStream exception') + + def DeleteAlarm(self, request: AlarmID, grpc_context: grpc.ServicerContext) -> Empty: + + LOGGER.info('DeleteAlarm') + try: + LOGGER.debug(f'DeleteAlarm with AlarmID: {request.alarm_id.uuid}') + alarm_id = int(request.alarm_id.uuid) + alarm = self.management_db.get_alarm(alarm_id) + response = Empty() + if alarm: + self.alarm_manager.delete_alarm(alarm_id) + self.management_db.delete_alarm(alarm_id) + else: + LOGGER.info('DeleteAlarm error: AlarmID({:s}): not found in database'.format(str(alarm_id))) + return response + except ServiceException as e: + LOGGER.exception('DeleteAlarm exception') + grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('DeleteAlarm exception') + + def GetStreamKpi(self, request: KpiId, grpc_context: grpc.ServicerContext) -> Iterator[Kpi]: + + LOGGER.info('GetStreamKpi') + + kpi_id = request.kpi_id.uuid + kpi_db = self.management_db.get_KPI(int(kpi_id)) + response = Kpi() + if kpi_db is None: + LOGGER.info('GetStreamKpi error: KpiID({:s}): not found in database'.format(str(kpi_id))) + response.kpi_id.kpi_id.uuid = "NoID" + return response + else: + yield response + + @MONITORING_GETINSTANTKPI_REQUEST_TIME.time() + def GetInstantKpi(self, request: KpiId, grpc_context: grpc.ServicerContext) -> Kpi: + + LOGGER.info('GetInstantKpi') + try: + kpi_id = request.kpi_id.uuid + response = Kpi() + if kpi_id == "": + LOGGER.info('GetInstantKpi error: KpiID({:s}): not found in database'.format(str(kpi_id))) + response.kpi_id.kpi_id.uuid = "NoID" + else: + query = f"SELECT kpi_id, timestamp, kpi_value FROM {METRICSDB_TABLE} WHERE kpi_id = '{kpi_id}' " \ + f"LATEST ON timestamp PARTITION BY kpi_id" + data = self.metrics_db.run_query(query) + LOGGER.debug(data) + if len(data) == 0: + response.kpi_id.kpi_id.uuid = request.kpi_id.uuid + else: + _data = data[0] + response.kpi_id.kpi_id.uuid = str(_data[0]) + response.timestamp.timestamp = timestamp_string_to_float(_data[1]) + response.kpi_value.floatVal = _data[2] + + return response + except ServiceException as e: + LOGGER.exception('GetInstantKpi exception') + # CREATEKPI_COUNTER_FAILED.inc() + grpc_context.abort(e.code, e.details) + except Exception as e: # pragma: no cover + LOGGER.exception('GetInstantKpi exception') + # CREATEKPI_COUNTER_FAILED.inc() + grpc_context.abort(grpc.StatusCode.INTERNAL, str(e)) + diff --git a/src/monitoring/service/NameMapping.py b/src/monitoring/service/NameMapping.py new file mode 100644 index 0000000000000000000000000000000000000000..17a48b3cd686f27ad5ad8c6f9027588d84f4feba --- /dev/null +++ b/src/monitoring/service/NameMapping.py @@ -0,0 +1,46 @@ +# 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 threading +from typing import Dict, Optional + +class NameMapping: + def __init__(self) -> None: + self.__lock = threading.Lock() + self.__device_to_name : Dict[str, str] = dict() + self.__endpoint_to_name : Dict[str, str] = dict() + + def get_device_name(self, device_uuid : str) -> Optional[str]: + with self.__lock: + return self.__device_to_name.get(device_uuid) + + def get_endpoint_name(self, endpoint_uuid : str) -> Optional[str]: + with self.__lock: + return self.__endpoint_to_name.get(endpoint_uuid) + + def set_device_name(self, device_uuid : str, device_name : str) -> None: + with self.__lock: + self.__device_to_name[device_uuid] = device_name + + def set_endpoint_name(self, endpoint_uuid : str, endpoint_name : str) -> None: + with self.__lock: + self.__endpoint_to_name[endpoint_uuid] = endpoint_name + + def delete_device_name(self, device_uuid : str) -> None: + with self.__lock: + self.__device_to_name.pop(device_uuid, None) + + def delete_endpoint_name(self, endpoint_uuid : str) -> None: + with self.__lock: + self.__endpoint_to_name.pop(endpoint_uuid, None) diff --git a/src/monitoring/service/SqliteTools.py b/src/monitoring/service/SqliteTools.py deleted file mode 100644 index 092d07e9b961e98a91bb244bcc992c701ad3cd72..0000000000000000000000000000000000000000 --- a/src/monitoring/service/SqliteTools.py +++ /dev/null @@ -1,73 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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 sqlite3 as sl - -class SQLite(): - def __init__(self, database): - self.client = sl.connect(database, check_same_thread=False) - self.client.execute(""" - CREATE TABLE IF NOT EXISTS KPI( - kpi_id INTEGER PRIMARY KEY AUTOINCREMENT, - kpi_description TEXT, - kpi_sample_type INTEGER, - device_id INTEGER, - endpoint_id INTEGER, - service_id INTEGER - ); - """) - - def insert_KPI(self,kpi_description,kpi_sample_type,device_id,endpoint_id,service_id ): - c = self.client.cursor() - c.execute("SELECT kpi_id FROM KPI WHERE device_id is ? AND kpi_sample_type is ? AND endpoint_id is ?",(device_id,kpi_sample_type,endpoint_id)) - data=c.fetchone() - if data is None: - c.execute("INSERT INTO KPI (kpi_description,kpi_sample_type,device_id,endpoint_id,service_id) VALUES (?,?,?,?,?)", (kpi_description,kpi_sample_type,device_id,endpoint_id,service_id)) - self.client.commit() - return c.lastrowid - else: - return data[0] - - def delete_KPI(self,device_id,kpi_sample_type): - c = self.client.cursor() - c.execute("SELECT kpi_id FROM KPI WHERE device_id is ? AND kpi_sample_type is ?",(device_id,kpi_sample_type)) - data=c.fetchone() - if data is None: - return False - else: - c.execute("DELETE FROM KPI WHERE device_id is ? AND kpi_sample_type is ?",(device_id,kpi_sample_type)) - self.client.commit() - return True - - def delete_kpid_id(self,kpi_id): - c = self.client.cursor() - c.execute("SELECT * FROM KPI WHERE kpi_id is ?",(kpi_id,)) - data=c.fetchone() - if data is None: - return False - else: - c.execute("DELETE FROM KPI WHERE kpi_id is ?",(kpi_id,)) - self.client.commit() - return True - - def get_KPI(self,kpi_id): - data = self.client.execute("SELECT * FROM KPI WHERE kpi_id is ?",(kpi_id,)) - return data.fetchone() - - def get_KPIS(self): - data = self.client.execute("SELECT * FROM KPI") - #print("\n") - #for row in data: - # print(row) - return data.fetchall() \ No newline at end of file diff --git a/src/monitoring/service/SubscriptionManager.py b/src/monitoring/service/SubscriptionManager.py new file mode 100644 index 0000000000000000000000000000000000000000..7c2b930cefcc620f97d1f759bda00d51ea5d6dd5 --- /dev/null +++ b/src/monitoring/service/SubscriptionManager.py @@ -0,0 +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 logging + +import pytz +from apscheduler.executors.pool import ProcessPoolExecutor +from apscheduler.schedulers.background import BackgroundScheduler + +from datetime import datetime +import time + + +LOGGER = logging.getLogger(__name__) + +class SubscriptionManager(): + def __init__(self, metrics_db): + self.metrics_db = metrics_db + self.scheduler = BackgroundScheduler(executors={'processpool': ProcessPoolExecutor(max_workers=20)}) + self.scheduler.start() + + def create_subscription(self,subs_queue, subscription_id, kpi_id, sampling_interval_s, sampling_duration_s=None, start_timestamp=None, end_timestamp=None): + start_date = None + end_date = None + if sampling_duration_s: + if not start_timestamp: + start_timestamp = time.time() + end_timestamp = start_timestamp + sampling_duration_s + if start_timestamp: + start_date = datetime.utcfromtimestamp(start_timestamp).isoformat() + if end_timestamp: + end_date = datetime.utcfromtimestamp(end_timestamp).isoformat() + + job = self.scheduler.add_job(self.metrics_db.get_subscription_data, args=(subs_queue,kpi_id, sampling_interval_s), + trigger='interval', seconds=sampling_interval_s, start_date=start_date, + end_date=end_date, timezone=pytz.utc, id=str(subscription_id)) + LOGGER.debug(f"Subscrition job {subscription_id} succesfully created") + #job.remove() + + def delete_subscription(self, subscription_id): + self.scheduler.remove_job(subscription_id) + LOGGER.debug(f"Subscription job {subscription_id} succesfully deleted") \ No newline at end of file diff --git a/src/monitoring/service/__init__.py b/src/monitoring/service/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/monitoring/service/__init__.py +++ b/src/monitoring/service/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/monitoring/service/__main__.py b/src/monitoring/service/__main__.py index 27cbe86a72e835eb8e6779b6b3627ab30abd25b1..fc460151b370c0eb5335787ed4677f7008881ad2 100644 --- a/src/monitoring/service/__main__.py +++ b/src/monitoring/service/__main__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,46 +12,32 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging, signal, sys, threading, socket - -from common.Settings import get_setting, wait_for_environment_variables -from context.client.ContextClient import ContextClient -from monitoring.Config import ( - GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD, LOG_LEVEL, METRICS_PORT, CONTEXT_GRPC_SERVICE_PORT, - CONTEXT_SERVICE_HOST) - -from monitoring.client.monitoring_client import MonitoringClient -from monitoring.proto import monitoring_pb2 -from monitoring.service.EventTools import EventsDeviceCollector -from monitoring.service.MonitoringService import MonitoringService - +import logging, signal, sys, threading, time from prometheus_client import start_http_server +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, + wait_for_environment_variables) +from common.proto import monitoring_pb2 +from .EventTools import EventsDeviceCollector +from .MonitoringService import MonitoringService +from .NameMapping import NameMapping terminate = threading.Event() LOGGER = None -LOCALHOST = '127.0.0.1' -def signal_handler(signal, frame): +def signal_handler(signal, frame): # pylint: disable=redefined-outer-name LOGGER.warning('Terminate signal received') terminate.set() -def start_monitoring(): +def start_monitoring(name_mapping : NameMapping): LOGGER.info('Start Monitoring...',) - grpc_service_port = get_setting('MONITORINGSERVICE_SERVICE_PORT_GRPC', default=GRPC_SERVICE_PORT ) - context_service_host = get_setting('CONTEXTSERVICE_SERVICE_HOST', default=CONTEXT_SERVICE_HOST ) - context_service_port = get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC', default=CONTEXT_GRPC_SERVICE_PORT) - - s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - if s.connect_ex((context_service_host, int(context_service_port))) != 0: - LOGGER.info('Context service is not reachable') - return - - context_client_grpc = ContextClient(address=context_service_host, port=context_service_port) - monitoring_client = MonitoringClient(server=LOCALHOST, port=grpc_service_port) # instantiate the client - events_collector = EventsDeviceCollector(context_client_grpc, monitoring_client) + events_collector = EventsDeviceCollector(name_mapping) events_collector.start() + # TODO: redesign this method to be more clear and clean + # Iterate while terminate is not set while not terminate.is_set(): list_new_kpi_ids = events_collector.listen_events() @@ -62,10 +48,11 @@ def start_monitoring(): # Create Monitor Kpi Requests monitor_kpi_request = monitoring_pb2.MonitorKpiRequest() monitor_kpi_request.kpi_id.CopyFrom(kpi_id) - monitor_kpi_request.sampling_duration_s = 120 - monitor_kpi_request.sampling_interval_s = 5 - - monitoring_client.MonitorKpi(monitor_kpi_request) + monitor_kpi_request.monitoring_window_s = 86400 + monitor_kpi_request.sampling_rate_s = 30 + events_collector._monitoring_client.MonitorKpi(monitor_kpi_request) + + time.sleep(0.5) # let other tasks run; do not overload CPU else: # Terminate is set, looping terminates LOGGER.warning("Stopping execution...") @@ -73,34 +60,33 @@ def start_monitoring(): events_collector.start() def main(): - global LOGGER - - grpc_service_port = get_setting('MONITORINGSERVICE_SERVICE_PORT_GRPC', default=GRPC_SERVICE_PORT) - max_workers = get_setting('MAX_WORKERS', default=GRPC_MAX_WORKERS ) - grace_period = get_setting('GRACE_PERIOD', default=GRPC_GRACE_PERIOD) - log_level = get_setting('LOG_LEVEL', default=LOG_LEVEL ) - metrics_port = get_setting('METRICS_PORT', default=METRICS_PORT ) + global LOGGER # pylint: disable=global-statement + log_level = get_log_level() logging.basicConfig(level=log_level) LOGGER = logging.getLogger(__name__) wait_for_environment_variables([ - 'CONTEXTSERVICE_SERVICE_HOST', 'CONTEXTSERVICE_SERVICE_PORT_GRPC', - 'DEVICESERVICE_SERVICE_HOST', 'DEVICESERVICE_SERVICE_PORT_GRPC' + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), ]) signal.signal(signal.SIGINT, signal_handler) signal.signal(signal.SIGTERM, signal_handler) LOGGER.info('Starting...') + # Start metrics server + metrics_port = get_metrics_port() start_http_server(metrics_port) + name_mapping = NameMapping() + # Starting monitoring service - grpc_service = MonitoringService(port=grpc_service_port, max_workers=max_workers, grace_period=grace_period) + grpc_service = MonitoringService(name_mapping) grpc_service.start() - start_monitoring() + start_monitoring(name_mapping) # Wait for Ctrl+C or termination signal while not terminate.wait(timeout=0.1): pass @@ -112,4 +98,4 @@ def main(): return 0 if __name__ == '__main__': - sys.exit(main()) \ No newline at end of file + sys.exit(main()) diff --git a/src/monitoring/tests/Messages.py b/src/monitoring/tests/Messages.py new file mode 100644 index 0000000000000000000000000000000000000000..a56207d9a74869ef625631f6a21762608ad59c14 --- /dev/null +++ b/src/monitoring/tests/Messages.py @@ -0,0 +1,159 @@ +# 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 random import random + +from common.proto import monitoring_pb2 +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.tools.timestamp.Converters import timestamp_utcnow_to_float + +def kpi_id(): + _kpi_id = monitoring_pb2.KpiId() + _kpi_id.kpi_id.uuid = str(1) # pylint: disable=maybe-no-member + return _kpi_id + +def create_kpi_request(kpi_id_str): + _create_kpi_request = monitoring_pb2.KpiDescriptor() + _create_kpi_request.kpi_description = 'KPI Description Test' + _create_kpi_request.kpi_sample_type = KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED + _create_kpi_request.device_id.device_uuid.uuid = 'DEV' + str(kpi_id_str) + _create_kpi_request.service_id.service_uuid.uuid = 'SERV' + str(kpi_id_str) + _create_kpi_request.slice_id.slice_uuid.uuid = 'SLC' + str(kpi_id_str) + _create_kpi_request.endpoint_id.endpoint_uuid.uuid = 'END' + str(kpi_id_str) + _create_kpi_request.connection_id.connection_uuid.uuid = 'CON' + str(kpi_id_str) + return _create_kpi_request + +def create_kpi_request_b(): + _create_kpi_request = monitoring_pb2.KpiDescriptor() + _create_kpi_request.kpi_description = 'KPI Description Test' + _create_kpi_request.kpi_sample_type = KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED + _create_kpi_request.device_id.device_uuid.uuid = 'DEV2' # pylint: disable=maybe-no-member + _create_kpi_request.service_id.service_uuid.uuid = 'SERV2' # pylint: disable=maybe-no-member + _create_kpi_request.slice_id.slice_uuid.uuid = 'SLC2' # pylint: disable=maybe-no-member + _create_kpi_request.endpoint_id.endpoint_uuid.uuid = 'END2' # pylint: disable=maybe-no-member + _create_kpi_request.connection_id.connection_uuid.uuid = 'CON2' # pylint: disable=maybe-no-member + return _create_kpi_request + +def create_kpi_request_c(): + _create_kpi_request = monitoring_pb2.KpiDescriptor() + _create_kpi_request.kpi_description = 'KPI Description Test' + _create_kpi_request.kpi_sample_type = KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED + _create_kpi_request.device_id.device_uuid.uuid = 'DEV3' # pylint: disable=maybe-no-member + _create_kpi_request.service_id.service_uuid.uuid = 'SERV3' # pylint: disable=maybe-no-member + _create_kpi_request.slice_id.slice_uuid.uuid = 'SLC3' # pylint: disable=maybe-no-member + _create_kpi_request.endpoint_id.endpoint_uuid.uuid = 'END3' # pylint: disable=maybe-no-member + _create_kpi_request.connection_id.connection_uuid.uuid = 'CON3' # pylint: disable=maybe-no-member + return _create_kpi_request + +def create_kpi_request_d(): + _create_kpi_request = monitoring_pb2.KpiDescriptor() + _create_kpi_request.kpi_description = 'KPI Description Test' + _create_kpi_request.kpi_sample_type = KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED + _create_kpi_request.device_id.device_uuid.uuid = 'DEV4' # pylint: disable=maybe-no-member + _create_kpi_request.service_id.service_uuid.uuid = 'SERV4' # pylint: disable=maybe-no-member + _create_kpi_request.slice_id.slice_uuid.uuid = 'SLC4' # pylint: disable=maybe-no-member + _create_kpi_request.endpoint_id.endpoint_uuid.uuid = 'END4' # pylint: disable=maybe-no-member + _create_kpi_request.connection_id.connection_uuid.uuid = 'CON4' # pylint: disable=maybe-no-member + return _create_kpi_request + +def monitor_kpi_request(kpi_uuid, monitoring_window_s, sampling_rate_s): + _monitor_kpi_request = monitoring_pb2.MonitorKpiRequest() + _monitor_kpi_request.kpi_id.kpi_id.uuid = kpi_uuid # pylint: disable=maybe-no-member + _monitor_kpi_request.monitoring_window_s = monitoring_window_s + _monitor_kpi_request.sampling_rate_s = sampling_rate_s + return _monitor_kpi_request + +def include_kpi_request(kpi_id): + _include_kpi_request = monitoring_pb2.Kpi() + _include_kpi_request.kpi_id.kpi_id.uuid = kpi_id.kpi_id.uuid + _include_kpi_request.timestamp.timestamp = timestamp_utcnow_to_float() + _include_kpi_request.kpi_value.floatVal = 500*random() # pylint: disable=maybe-no-member + return _include_kpi_request + +def kpi_descriptor_list(): + _kpi_descriptor_list = monitoring_pb2.KpiDescriptorList() + + return _kpi_descriptor_list + +def kpi_query(kpi_id_list): + _kpi_query = monitoring_pb2.KpiQuery() + + _kpi_query.kpi_ids.extend(kpi_id_list) + # _kpi_query.monitoring_window_s = 10 + # _kpi_query.last_n_samples = 2 + _kpi_query.start_timestamp.timestamp = timestamp_utcnow_to_float() - 10 + _kpi_query.end_timestamp.timestamp = timestamp_utcnow_to_float() + + return _kpi_query + +def subs_descriptor(kpi_id): + _subs_descriptor = monitoring_pb2.SubsDescriptor() + + sampling_duration_s = 10 + sampling_interval_s = 3 + real_start_time = timestamp_utcnow_to_float() + start_timestamp = real_start_time + end_timestamp = start_timestamp + sampling_duration_s + + _subs_descriptor.subs_id.subs_id.uuid = "" + _subs_descriptor.kpi_id.kpi_id.uuid = kpi_id.kpi_id.uuid + _subs_descriptor.sampling_duration_s = sampling_duration_s + _subs_descriptor.sampling_interval_s = sampling_interval_s + _subs_descriptor.start_timestamp.timestamp = start_timestamp + _subs_descriptor.end_timestamp.timestamp = end_timestamp + + return _subs_descriptor + +def subs_id(): + _subs_id = monitoring_pb2.SubsDescriptor() + + return _subs_id + +def alarm_descriptor(kpi_id): + _alarm_descriptor = monitoring_pb2.AlarmDescriptor() + + _alarm_descriptor.alarm_description = "Alarm Description" + _alarm_descriptor.name = "Alarm Name" + _alarm_descriptor.kpi_id.kpi_id.uuid = kpi_id.kpi_id.uuid + _alarm_descriptor.kpi_value_range.kpiMinValue.floatVal = 0.0 + _alarm_descriptor.kpi_value_range.kpiMaxValue.floatVal = 250.0 + _alarm_descriptor.kpi_value_range.inRange = True + _alarm_descriptor.kpi_value_range.includeMinValue = False + _alarm_descriptor.kpi_value_range.includeMaxValue = True + + return _alarm_descriptor + +def alarm_descriptor_b(): + _alarm_descriptor = monitoring_pb2.AlarmDescriptor() + + _alarm_descriptor.kpi_id.kpi_id.uuid = "2" + + return _alarm_descriptor + +def alarm_subscription(alarm_id): + _alarm_subscription = monitoring_pb2.AlarmSubscription() + + subscription_timeout_s = 10 + subscription_frequency_ms = 1000 + + _alarm_subscription.alarm_id.alarm_id.uuid = str(alarm_id.alarm_id.uuid) + _alarm_subscription.subscription_timeout_s = subscription_timeout_s + _alarm_subscription.subscription_frequency_ms = subscription_frequency_ms + + return _alarm_subscription + + +def alarm_id(): + _alarm_id = monitoring_pb2.AlarmID() + + return _alarm_id \ No newline at end of file diff --git a/src/monitoring/tests/Objects.py b/src/monitoring/tests/Objects.py new file mode 100644 index 0000000000000000000000000000000000000000..447ed0d601bd7079e55dc30e5cab66d25eb1fd88 --- /dev/null +++ b/src/monitoring/tests/Objects.py @@ -0,0 +1,30 @@ +# 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 common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.tools.object_factory.Device import ( + json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled) + +PACKET_PORT_SAMPLE_TYPES = [ + KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED, + KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED, + KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED, + KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED, +] + +DEVICE_DEV1_UUID = 'DEV1' +ENDPOINT_END1_UUID = 'END1' +DEVICE_DEV1_ENDPOINT_DEFS = [(ENDPOINT_END1_UUID, 'copper', PACKET_PORT_SAMPLE_TYPES)] +DEVICE_DEV1 = json_device_emulated_packet_router_disabled(DEVICE_DEV1_UUID) +DEVICE_DEV1_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_DEV1_ENDPOINT_DEFS) diff --git a/src/monitoring/tests/__init__.py b/src/monitoring/tests/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/monitoring/tests/__init__.py +++ b/src/monitoring/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/monitoring/tests/test_unitary.py b/src/monitoring/tests/test_unitary.py index 97cdf48905cfc0dfae0dc1a4fa1f2c84ea50df7a..1428b0ed56dbb24a24af8fde42e4d073a48c931d 100644 --- a/src/monitoring/tests/test_unitary.py +++ b/src/monitoring/tests/test_unitary.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,426 +12,614 @@ # See the License for the specific language governing permissions and # limitations under the License. +import copy, os, pytest #, threading, time import logging -import os -import socket -import pytest -from typing import Tuple - - -from monitoring.proto import context_pb2, kpi_sample_types_pb2 -from monitoring.proto import monitoring_pb2 -from monitoring.client.monitoring_client import MonitoringClient -from monitoring.Config import GRPC_SERVICE_PORT, GRPC_MAX_WORKERS, GRPC_GRACE_PERIOD, DEVICE_GRPC_GRACE_PERIOD, DEVICE_GRPC_MAX_WORKERS, DEVICE_GRPC_SERVICE_PORT, DEVICE_SERVICE_HOST -from monitoring.proto.kpi_sample_types_pb2 import KpiSampleType -from monitoring.service import SqliteTools, InfluxTools -from monitoring.service.MonitoringService import MonitoringService +#from queue import Queue +from random import random +from time import sleep +from typing import Union #, Tuple +from apscheduler.executors.pool import ProcessPoolExecutor +from apscheduler.schedulers.background import BackgroundScheduler +from apscheduler.schedulers.base import STATE_STOPPED +from grpc._channel import _MultiThreadedRendezvous +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_service_port_grpc) +#from common.logger import getJSONLogger +from common.proto.context_pb2 import DeviceOperationalStatusEnum, EventTypeEnum, DeviceEvent, Device, Empty +from common.proto.context_pb2_grpc import add_ContextServiceServicer_to_server +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.proto.monitoring_pb2 import KpiId, KpiDescriptor, SubsDescriptor, SubsList, AlarmID, \ + AlarmDescriptor, AlarmList, KpiDescriptorList, SubsResponse, AlarmResponse, RawKpiTable #, Kpi, KpiList +from common.tests.MockServicerImpl_Context import MockServicerImpl_Context +from common.tools.service.GenericGrpcService import GenericGrpcService +from common.tools.timestamp.Converters import timestamp_utcnow_to_float #, timestamp_string_to_float +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from device.service.DeviceService import DeviceService +from device.service.driver_api.DriverFactory import DriverFactory +from device.service.driver_api.DriverInstanceCache import DriverInstanceCache +from monitoring.client.MonitoringClient import MonitoringClient +#from monitoring.service.AlarmManager import AlarmManager from monitoring.service.EventTools import EventsDeviceCollector +from monitoring.service.ManagementDBTools import ManagementDB +from monitoring.service.MetricsDBTools import MetricsDB +from monitoring.service.MonitoringService import MonitoringService +from monitoring.service.NameMapping import NameMapping +#from monitoring.service.SubscriptionManager import SubscriptionManager +from monitoring.tests.Messages import create_kpi_request, create_kpi_request_d, include_kpi_request, monitor_kpi_request, \ + create_kpi_request_c, kpi_query, subs_descriptor, alarm_descriptor, alarm_subscription #, create_kpi_request_b +from monitoring.tests.Objects import DEVICE_DEV1, DEVICE_DEV1_CONNECT_RULES, DEVICE_DEV1_UUID -from common.orm.Database import Database -from common.orm.Factory import get_database_backend, BackendEnum as DatabaseBackendEnum -from common.message_broker.Factory import get_messagebroker_backend, BackendEnum as MessageBrokerBackendEnum -from common.message_broker.MessageBroker import MessageBroker +os.environ['DEVICE_EMULATED_ONLY'] = 'TRUE' +from device.service.drivers import DRIVERS # pylint: disable=wrong-import-position,ungrouped-imports -from context.Config import GRPC_SERVICE_PORT as grpc_port_context, GRPC_MAX_WORKERS as grpc_workers_context, GRPC_GRACE_PERIOD as grpc_grace_context -from context.client.ContextClient import ContextClient -from context.service.grpc_server.ContextService import ContextService -from context.service.Populate import populate -from context.proto.context_pb2 import EventTypeEnum, DeviceEvent, Device -from context.tests.Objects import (DEVICE_R1, DEVICE_R1_UUID) - -LOGGER = logging.getLogger(__name__) -LOGGER.setLevel(logging.DEBUG) ########################### # Tests Setup ########################### -SERVER_ADDRESS = '127.0.0.1' -LISTEN_ADDRESS = '[::]' -GRPC_PORT_MONITORING = 7070 +LOCAL_HOST = '127.0.0.1' +MOCKSERVICE_PORT = 10000 +os.environ[get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(MOCKSERVICE_PORT) + +DEVICE_SERVICE_PORT = MOCKSERVICE_PORT + get_service_port_grpc(ServiceNameEnum.DEVICE) # avoid privileged ports +os.environ[get_env_var_name(ServiceNameEnum.DEVICE, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.DEVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(DEVICE_SERVICE_PORT) -GRPC_PORT_CONTEXT = 10000 + grpc_port_context # avoid privileged ports -DEVICE_GRPC_SERVICE_PORT = 10000 + DEVICE_GRPC_SERVICE_PORT # avoid privileged ports -MONITORING_GRPC_SERVICE_PORT = GRPC_PORT_MONITORING # avoid privileged ports +MONITORING_SERVICE_PORT = MOCKSERVICE_PORT + get_service_port_grpc(ServiceNameEnum.MONITORING) # avoid privileged ports +os.environ[get_env_var_name(ServiceNameEnum.MONITORING, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.MONITORING, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(MONITORING_SERVICE_PORT) +METRICSDB_HOSTNAME = os.environ.get('METRICSDB_HOSTNAME') +METRICSDB_ILP_PORT = os.environ.get('METRICSDB_ILP_PORT') +METRICSDB_REST_PORT = os.environ.get('METRICSDB_REST_PORT') +METRICSDB_TABLE = os.environ.get('METRICSDB_TABLE') -SCENARIOS = [ # comment/uncomment scenarios to activate/deactivate them in the test unit - ('all_inmemory', DatabaseBackendEnum.INMEMORY, {}, MessageBrokerBackendEnum.INMEMORY, {} ), -] +LOGGER = logging.getLogger(__name__) + +class MockContextService(GenericGrpcService): + # Mock Service implementing Context to simplify unitary tests of Monitoring -INFLUXDB_HOSTNAME = os.environ.get("INFLUXDB_HOSTNAME") -INFLUXDB_PORT = os.environ.get("INFLUXDB_PORT") -INFLUXDB_USER = os.environ.get("INFLUXDB_USER") -INFLUXDB_PASSWORD = os.environ.get("INFLUXDB_PASSWORD") -INFLUXDB_DATABASE = os.environ.get("INFLUXDB_DATABASE") + def __init__(self, bind_port: Union[str, int]) -> None: + super().__init__(bind_port, LOCAL_HOST, enable_health_servicer=False, cls_name='MockService') -@pytest.fixture(scope='session', ids=[str(scenario[0]) for scenario in SCENARIOS], params=SCENARIOS) -def context_db_mb(request) -> Tuple[Database, MessageBroker]: - name,db_backend,db_settings,mb_backend,mb_settings = request.param - msg = 'Running scenario {:s} db_backend={:s}, db_settings={:s}, mb_backend={:s}, mb_settings={:s}...' - LOGGER.info(msg.format(str(name), str(db_backend.value), str(db_settings), str(mb_backend.value), str(mb_settings))) - _database = Database(get_database_backend(backend=db_backend, **db_settings)) - _message_broker = MessageBroker(get_messagebroker_backend(backend=mb_backend, **mb_settings)) - yield _database, _message_broker - _message_broker.terminate() + # pylint: disable=attribute-defined-outside-init + def install_servicers(self): + self.context_servicer = MockServicerImpl_Context() + add_ContextServiceServicer_to_server(self.context_servicer, self.server) @pytest.fixture(scope='session') -def context_service_grpc(context_db_mb : Tuple[Database, MessageBroker]): # pylint: disable=redefined-outer-name - database = context_db_mb[0] - database.clear_all() - _service = ContextService( - database, context_db_mb[1], port=GRPC_PORT_CONTEXT, max_workers=grpc_workers_context, - grace_period=grpc_grace_context) +def context_service(): + LOGGER.info('Initializing MockContextService...') + _service = MockContextService(MOCKSERVICE_PORT) _service.start() + + LOGGER.info('Yielding MockContextService...') yield _service + + LOGGER.info('Terminating MockContextService...') + _service.context_servicer.msg_broker.terminate() _service.stop() + LOGGER.info('Terminated MockContextService...') + @pytest.fixture(scope='session') -def context_client_grpc(context_service_grpc : ContextService): # pylint: disable=redefined-outer-name - _client = ContextClient(address='localhost', port=GRPC_PORT_CONTEXT) +def context_client(context_service : MockContextService): # pylint: disable=redefined-outer-name,unused-argument + LOGGER.info('Initializing ContextClient...') + _client = ContextClient() + + LOGGER.info('Yielding ContextClient...') yield _client + + LOGGER.info('Closing ContextClient...') _client.close() + LOGGER.info('Closed ContextClient...') -# This fixture will be requested by test cases and last during testing session @pytest.fixture(scope='session') -def monitoring_service(): - LOGGER.warning('monitoring_service begin') - - service_port = GRPC_SERVICE_PORT - max_workers = GRPC_MAX_WORKERS - grace_period = GRPC_GRACE_PERIOD - - LOGGER.info('Initializing MonitoringService...') - grpc_service = MonitoringService(port=service_port, max_workers=max_workers, grace_period=grace_period) - server = grpc_service.start() +def device_service(context_service : MockContextService): # pylint: disable=redefined-outer-name,unused-argument + LOGGER.info('Initializing DeviceService...') + driver_factory = DriverFactory(DRIVERS) + driver_instance_cache = DriverInstanceCache(driver_factory) + _service = DeviceService(driver_instance_cache) + _service.start() # yield the server, when test finishes, execution will resume to stop it - LOGGER.warning('monitoring_service yielding') - yield server - - LOGGER.info('Terminating MonitoringService...') - grpc_service.stop() + LOGGER.info('Yielding DeviceService...') + yield _service -# This fixture will be requested by test cases and last during testing session. -# The client requires the server, so client fixture has the server as dependency. -@pytest.fixture(scope='session') -def monitoring_client(monitoring_service): - LOGGER.warning('monitoring_client begin') - client = MonitoringClient(server=SERVER_ADDRESS, port=GRPC_PORT_MONITORING) # instantiate the client - LOGGER.warning('monitoring_client returning') - return client + LOGGER.info('Terminating DeviceService...') + _service.stop() -# This fixture will be requested by test cases and last during testing session. -@pytest.fixture(scope='session') -def kpi(): - LOGGER.warning('test_include_kpi begin') - # form request - kpi = monitoring_pb2.Kpi() - kpi.kpi_id.kpi_id.uuid = 'KPIID0000' - kpi.kpiDescription = 'KPI Desc' - return kpi + LOGGER.info('Terminated DeviceService...') @pytest.fixture(scope='session') -def kpi_id(): - LOGGER.warning('test_include_kpi begin') +def device_client(device_service : DeviceService): # pylint: disable=redefined-outer-name,unused-argument + LOGGER.info('Initializing DeviceClient...') + _client = DeviceClient() - # form request - kpi_id = monitoring_pb2.KpiId() - kpi_id.kpi_id.uuid = str(1) + LOGGER.info('Yielding DeviceClient...') + yield _client - return kpi_id + LOGGER.info('Closing DeviceClient...') + _client.close() -@pytest.fixture(scope='session') -def sql_db(): - sql_db = SqliteTools.SQLite('monitoring.db') - return sql_db + LOGGER.info('Closed DeviceClient...') +# This fixture will be requested by test cases and last during testing session @pytest.fixture(scope='session') -def influx_db(): - influx_db = InfluxTools.Influx(INFLUXDB_HOSTNAME, INFLUXDB_PORT, INFLUXDB_USER, INFLUXDB_PASSWORD, INFLUXDB_DATABASE) - return influx_db +def monitoring_service( + context_service : MockContextService, # pylint: disable=redefined-outer-name,unused-argument + device_service : DeviceService # pylint: disable=redefined-outer-name,unused-argument + ): + LOGGER.info('Initializing MonitoringService...') + name_mapping = NameMapping() + _service = MonitoringService(name_mapping) + _service.start() -@pytest.fixture(scope='session') -def create_kpi_request(): - LOGGER.warning('test_include_kpi begin') + # yield the server, when test finishes, execution will resume to stop it + LOGGER.info('Yielding MonitoringService...') + yield _service - create_kpi_request = monitoring_pb2.KpiDescriptor() - create_kpi_request.kpi_description = 'KPI Description Test' - create_kpi_request.kpi_sample_type = kpi_sample_types_pb2.KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED - create_kpi_request.device_id.device_uuid.uuid = 'DEV1' # pylint: disable=maybe-no-member - create_kpi_request.service_id.service_uuid.uuid = "SERV1" - create_kpi_request.endpoint_id.endpoint_uuid.uuid = "END1" + LOGGER.info('Terminating MonitoringService...') + _service.stop() - return create_kpi_request + LOGGER.info('Terminated MonitoringService...') +# This fixture will be requested by test cases and last during testing session. +# The client requires the server, so client fixture has the server as dependency. @pytest.fixture(scope='session') -def monitor_kpi_request(): - LOGGER.warning('test_monitor_kpi begin') +def monitoring_client(monitoring_service : MonitoringService): # pylint: disable=redefined-outer-name,unused-argument + LOGGER.info('Initializing MonitoringClient...') + _client = MonitoringClient() - monitor_kpi_request = monitoring_pb2.MonitorKpiRequest() - monitor_kpi_request.kpi_id.kpi_id.uuid = str(1) - monitor_kpi_request.sampling_duration_s = 120 - monitor_kpi_request.sampling_interval_s = 5 + # yield the server, when test finishes, execution will resume to stop it + LOGGER.info('Yielding MonitoringClient...') + yield _client - return monitor_kpi_request + LOGGER.info('Closing MonitoringClient...') + _client.close() + LOGGER.info('Closed MonitoringClient...') @pytest.fixture(scope='session') -def include_kpi_request(): - LOGGER.warning('test_include_kpi begin') - - include_kpi_request = monitoring_pb2.Kpi() - include_kpi_request.kpi_id.kpi_id.uuid = str(1) - include_kpi_request.timestamp = "2021-10-12T13:14:42Z" - include_kpi_request.kpi_value.intVal = 500 - - return include_kpi_request +def management_db(): + _management_db = ManagementDB('monitoring.db') + return _management_db @pytest.fixture(scope='session') -def address(): - address = '127.0.0.1' - return address +def metrics_db(monitoring_service : MonitoringService): # pylint: disable=redefined-outer-name + return monitoring_service.monitoring_servicer.metrics_db + #_metrics_db = MetricsDBTools.MetricsDB( + # METRICSDB_HOSTNAME, METRICSDB_ILP_PORT, METRICSDB_REST_PORT, METRICSDB_TABLE) + #return _metrics_db @pytest.fixture(scope='session') -def port(): - port = 7070 - return port +def subs_scheduler(): + _scheduler = BackgroundScheduler(executors={'processpool': ProcessPoolExecutor(max_workers=20)}) + _scheduler.start() + + return _scheduler + +def ingestion_data(kpi_id_int): + # pylint: disable=redefined-outer-name,unused-argument + metrics_db = MetricsDB('localhost', '9009', '9000', 'monitoring') + + kpiSampleType = KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED + kpiSampleType_name = KpiSampleType.Name(kpiSampleType).upper().replace('KPISAMPLETYPE_', '') + for _ in range(50): + kpiSampleType = kpiSampleType_name + kpiId = kpi_id_int + deviceId = 'DEV'+ str(kpi_id_int) + endpointId = 'END' + str(kpi_id_int) + serviceId = 'SERV' + str(kpi_id_int) + sliceId = 'SLC' + str(kpi_id_int) + connectionId = 'CON' + str(kpi_id_int) + time_stamp = timestamp_utcnow_to_float() + kpi_value = 500*random() + + metrics_db.write_KPI(time_stamp, kpiId, kpiSampleType, deviceId, endpointId, serviceId, sliceId, connectionId, + kpi_value) + sleep(0.1) ########################### # Tests Implementation ########################### # Test case that makes use of client fixture to test server's CreateKpi method -def test_create_kpi(monitoring_client,create_kpi_request): +def test_set_kpi(monitoring_client): # pylint: disable=redefined-outer-name # make call to server LOGGER.warning('test_create_kpi requesting') - response = monitoring_client.CreateKpi(create_kpi_request) - LOGGER.debug(str(response)) - assert isinstance(response, monitoring_pb2.KpiId) + for i in range(3): + response = monitoring_client.SetKpi(create_kpi_request(str(i+1))) + LOGGER.debug(str(response)) + assert isinstance(response, KpiId) -# Test case that makes use of client fixture to test server's MonitorKpi method -def test_monitor_kpi(monitoring_client,create_kpi_request): - LOGGER.warning('test_monitor_kpi begin') - response = monitoring_client.CreateKpi(create_kpi_request) - - monitor_kpi_request = monitoring_pb2.MonitorKpiRequest() - monitor_kpi_request.kpi_id.kpi_id.uuid = response.kpi_id.uuid - monitor_kpi_request.sampling_duration_s = 120 - monitor_kpi_request.sampling_interval_s = 5 +# Test case that makes use of client fixture to test server's DeleteKpi method +def test_delete_kpi(monitoring_client): # pylint: disable=redefined-outer-name + # make call to server + LOGGER.warning('delete_kpi requesting') + response = monitoring_client.SetKpi(create_kpi_request('4')) + response = monitoring_client.DeleteKpi(response) + LOGGER.debug(str(response)) + assert isinstance(response, Empty) - response = monitoring_client.MonitorKpi(monitor_kpi_request) +# Test case that makes use of client fixture to test server's GetKpiDescriptor method +def test_get_kpidescritor(monitoring_client): # pylint: disable=redefined-outer-name + LOGGER.warning('test_getkpidescritor_kpi begin') + response = monitoring_client.SetKpi(create_kpi_request('1')) + response = monitoring_client.GetKpiDescriptor(response) LOGGER.debug(str(response)) - assert isinstance(response, context_pb2.Empty) + assert isinstance(response, KpiDescriptor) +# Test case that makes use of client fixture to test server's GetKpiDescriptor method +def test_get_kpi_descriptor_list(monitoring_client): # pylint: disable=redefined-outer-name + LOGGER.warning('test_getkpidescritor_kpi begin') + response = monitoring_client.GetKpiDescriptorList(Empty()) + LOGGER.debug(str(response)) + assert isinstance(response, KpiDescriptorList) # Test case that makes use of client fixture to test server's IncludeKpi method -def test_include_kpi(monitoring_client,include_kpi_request): +def test_include_kpi(monitoring_client): # pylint: disable=redefined-outer-name # make call to server LOGGER.warning('test_include_kpi requesting') - response = monitoring_client.IncludeKpi(include_kpi_request) + kpi_id = monitoring_client.SetKpi(create_kpi_request('1')) + LOGGER.debug(str(kpi_id)) + response = monitoring_client.IncludeKpi(include_kpi_request(kpi_id)) LOGGER.debug(str(response)) - assert isinstance(response, context_pb2.Empty) + assert isinstance(response, Empty) -# Test case that makes use of client fixture to test server's GetStreamKpi method -def test_get_stream_kpi(monitoring_client,include_kpi_request): - LOGGER.warning('test_getstream_kpi begin') - response = monitoring_client.GetStreamKpi(kpi) - LOGGER.debug(str(response)) - #assert isinstance(response, monitoring_pb2.Kpi) +# Test case that makes use of client fixture to test server's MonitorKpi method +def test_monitor_kpi( + context_client : ContextClient, # pylint: disable=redefined-outer-name,unused-argument + device_client : DeviceClient, # pylint: disable=redefined-outer-name + monitoring_client : MonitoringClient, # pylint: disable=redefined-outer-name + ): + LOGGER.info('test_monitor_kpi begin') -# Test case that makes use of client fixture to test server's GetInstantKpi method -def test_get_instant_kpi(monitoring_client,kpi_id): - LOGGER.warning('test_getinstant_kpi begin') - response = monitoring_client.GetInstantKpi(kpi_id) + # ----- Update the object ------------------------------------------------------------------------------------------ + LOGGER.info('Adding Device {:s}'.format(DEVICE_DEV1_UUID)) + device_with_connect_rules = copy.deepcopy(DEVICE_DEV1) + device_with_connect_rules['device_config']['config_rules'].extend(DEVICE_DEV1_CONNECT_RULES) + device_id = device_client.AddDevice(Device(**device_with_connect_rules)) + assert device_id.device_uuid.uuid == DEVICE_DEV1_UUID + + response = monitoring_client.SetKpi(create_kpi_request('1')) + _monitor_kpi_request = monitor_kpi_request(response.kpi_id.uuid, 120, 5) # pylint: disable=maybe-no-member + response = monitoring_client.MonitorKpi(_monitor_kpi_request) LOGGER.debug(str(response)) - assert isinstance(response, monitoring_pb2.Kpi) + assert isinstance(response, Empty) -# Test case that makes use of client fixture to test server's GetInstantKpi method -def test_get_kpidescritor_kpi(monitoring_client,create_kpi_request): - LOGGER.warning('test_getkpidescritor_kpi begin') + device_client.DeleteDevice(device_id) - response = monitoring_client.CreateKpi(create_kpi_request) +# Test case that makes use of client fixture to test server's QueryKpiData method +def test_query_kpi_data(monitoring_client,subs_scheduler): # pylint: disable=redefined-outer-name - response = monitoring_client.GetKpiDescriptor(response) + kpi_id_list = [] + for i in range(2): + kpi_id = monitoring_client.SetKpi(create_kpi_request(str(i+1))) + subs_scheduler.add_job(ingestion_data, args=[kpi_id.kpi_id.uuid]) + kpi_id_list.append(kpi_id) + LOGGER.warning('test_query_kpi_data') + sleep(5) + response = monitoring_client.QueryKpiData(kpi_query(kpi_id_list)) LOGGER.debug(str(response)) - assert isinstance(response, monitoring_pb2.KpiDescriptor) - -def test_sqlitedb_tools_insert_kpi(sql_db, create_kpi_request): - LOGGER.warning('test_sqlitedb_tools_insert_kpi begin') - - kpi_description = create_kpi_request.kpi_description - kpi_sample_type = create_kpi_request.kpi_sample_type - kpi_device_id = create_kpi_request.device_id.device_uuid.uuid - kpi_endpoint_id = create_kpi_request.endpoint_id.endpoint_uuid.uuid - kpi_service_id = create_kpi_request.service_id.service_uuid.uuid - - response = sql_db.insert_KPI(kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id) - assert isinstance(response, int) - -def test_sqlitedb_tools_get_kpi(sql_db, create_kpi_request): - LOGGER.warning('test_sqlitedb_tools_get_kpi begin') - - kpi_description = create_kpi_request.kpi_description - kpi_sample_type = create_kpi_request.kpi_sample_type - kpi_device_id = create_kpi_request.device_id.device_uuid.uuid - kpi_endpoint_id = create_kpi_request.endpoint_id.endpoint_uuid.uuid - kpi_service_id = create_kpi_request.service_id.service_uuid.uuid + assert isinstance(response, RawKpiTable) + if (subs_scheduler.state != STATE_STOPPED): + subs_scheduler.shutdown() + +# Test case that makes use of client fixture to test server's SetKpiSubscription method +def test_set_kpi_subscription(monitoring_client,subs_scheduler): # pylint: disable=redefined-outer-name + LOGGER.warning('test_set_kpi_subscription') + kpi_id = monitoring_client.SetKpi(create_kpi_request('1')) + subs_scheduler.add_job(ingestion_data, args=[kpi_id.kpi_id.uuid]) + response = monitoring_client.SetKpiSubscription(subs_descriptor(kpi_id)) + assert isinstance(response, _MultiThreadedRendezvous) + for item in response: + LOGGER.debug(item) + assert isinstance(item, SubsResponse) + if (subs_scheduler.state != STATE_STOPPED): + subs_scheduler.shutdown() + +# Test case that makes use of client fixture to test server's GetSubsDescriptor method +def test_get_subs_descriptor(monitoring_client): # pylint: disable=redefined-outer-name + LOGGER.warning('test_get_subs_descriptor') + kpi_id = monitoring_client.SetKpi(create_kpi_request_c()) + monitoring_client.IncludeKpi(include_kpi_request(kpi_id)) + response = monitoring_client.SetKpiSubscription(subs_descriptor(kpi_id)) + for item in response: + response = monitoring_client.GetSubsDescriptor(item.subs_id) + LOGGER.debug(response) + assert isinstance(response, SubsDescriptor) + +# Test case that makes use of client fixture to test server's GetSubscriptions method +def test_get_subscriptions(monitoring_client): # pylint: disable=redefined-outer-name + LOGGER.warning('test_get_subscriptions') + response = monitoring_client.GetSubscriptions(Empty()) + LOGGER.debug(response) + assert isinstance(response, SubsList) + +# Test case that makes use of client fixture to test server's DeleteSubscription method +def test_delete_subscription(monitoring_client): # pylint: disable=redefined-outer-name + LOGGER.warning('test_delete_subscription') + kpi_id = monitoring_client.SetKpi(create_kpi_request_c()) + monitoring_client.IncludeKpi(include_kpi_request(kpi_id)) + subs = monitoring_client.SetKpiSubscription(subs_descriptor(kpi_id)) + for item in subs: + response = monitoring_client.DeleteSubscription(item.subs_id) + assert isinstance(response, Empty) + +# Test case that makes use of client fixture to test server's SetKpiAlarm method +def test_set_kpi_alarm(monitoring_client): # pylint: disable=redefined-outer-name + LOGGER.warning('test_set_kpi_alarm') + kpi_id = monitoring_client.SetKpi(create_kpi_request_c()) + response = monitoring_client.SetKpiAlarm(alarm_descriptor(kpi_id)) + LOGGER.debug(str(response)) + assert isinstance(response, AlarmID) + +# Test case that makes use of client fixture to test server's GetAlarms method +def test_get_alarms(monitoring_client): # pylint: disable=redefined-outer-name + LOGGER.warning('test_get_alarms') + response = monitoring_client.GetAlarms(Empty()) + LOGGER.debug(response) + assert isinstance(response, AlarmList) + +# Test case that makes use of client fixture to test server's GetAlarmDescriptor method +def test_get_alarm_descriptor(monitoring_client): # pylint: disable=redefined-outer-name + LOGGER.warning('test_get_alarm_descriptor') + _kpi_id = monitoring_client.SetKpi(create_kpi_request_c()) + _alarm_id = monitoring_client.SetKpiAlarm(alarm_descriptor(_kpi_id)) + _response = monitoring_client.GetAlarmDescriptor(_alarm_id) + LOGGER.debug(_response) + assert isinstance(_response, AlarmDescriptor) + +# Test case that makes use of client fixture to test server's GetAlarmResponseStream method +def test_get_alarm_response_stream(monitoring_client,subs_scheduler): # pylint: disable=redefined-outer-name + LOGGER.warning('test_get_alarm_descriptor') + _kpi_id = monitoring_client.SetKpi(create_kpi_request('3')) + _alarm_id = monitoring_client.SetKpiAlarm(alarm_descriptor(_kpi_id)) + subs_scheduler.add_job(ingestion_data,args=[_kpi_id.kpi_id.uuid]) + _response = monitoring_client.GetAlarmResponseStream(alarm_subscription(_alarm_id)) + assert isinstance(_response, _MultiThreadedRendezvous) + for item in _response: + LOGGER.debug(item) + assert isinstance(item,AlarmResponse) + + if(subs_scheduler.state != STATE_STOPPED): + subs_scheduler.shutdown() + +# Test case that makes use of client fixture to test server's DeleteAlarm method +def test_delete_alarm(monitoring_client): # pylint: disable=redefined-outer-name + LOGGER.warning('test_delete_alarm') + _kpi_id = monitoring_client.SetKpi(create_kpi_request_c()) + _alarm_id = monitoring_client.SetKpiAlarm(alarm_descriptor(_kpi_id)) + _response = monitoring_client.DeleteAlarm(_alarm_id) + LOGGER.debug(type(_response)) + assert isinstance(_response, Empty) - kpi_id = sql_db.insert_KPI(kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id) +# Test case that makes use of client fixture to test server's GetStreamKpi method +def test_get_stream_kpi(monitoring_client): # pylint: disable=redefined-outer-name + LOGGER.warning('test_getstream_kpi begin') + _kpi_id = monitoring_client.SetKpi(create_kpi_request_d()) + response = monitoring_client.GetStreamKpi(_kpi_id) + LOGGER.debug(str(response)) + assert isinstance(response, _MultiThreadedRendezvous) - response = sql_db.get_KPI(kpi_id) +# Test case that makes use of client fixture to test server's GetInstantKpi method +# def test_get_instant_kpi(monitoring_client): # pylint: disable=redefined-outer-name +# LOGGER.warning('test_getinstant_kpi begin') +# kpi_id = monitoring_client.SetKpi(KpiId()) +# monitoring_client.IncludeKpi(include_kpi_request(kpi_id)) +# sleep(0.3) +# response = monitoring_client.GetInstantKpi(kpi_id) +# LOGGER.debug(response) +# assert isinstance(response, Kpi) + +def test_managementdb_tools_kpis(management_db): # pylint: disable=redefined-outer-name + LOGGER.warning('test_managementdb_tools_kpis begin') + _create_kpi_request = create_kpi_request('5') + kpi_description = _create_kpi_request.kpi_description # pylint: disable=maybe-no-member + kpi_sample_type = _create_kpi_request.kpi_sample_type # pylint: disable=maybe-no-member + kpi_device_id = _create_kpi_request.device_id.device_uuid.uuid # pylint: disable=maybe-no-member + kpi_endpoint_id = _create_kpi_request.endpoint_id.endpoint_uuid.uuid # pylint: disable=maybe-no-member + kpi_service_id = _create_kpi_request.service_id.service_uuid.uuid # pylint: disable=maybe-no-member + kpi_slice_id = _create_kpi_request.slice_id.slice_uuid.uuid # pylint: disable=maybe-no-member + kpi_connection_id = _create_kpi_request.connection_id.connection_uuid.uuid # pylint: disable=maybe-no-member + + _kpi_id = management_db.insert_KPI( + kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id, + kpi_slice_id, kpi_connection_id) + assert isinstance(_kpi_id, int) + + response = management_db.get_KPI(_kpi_id) assert isinstance(response, tuple) -def test_sqlitedb_tools_get_kpis(sql_db): - LOGGER.warning('test_sqlitedb_tools_get_kpis begin') - response = sql_db.get_KPIS() - assert isinstance(response, list) - -def test_sqlitedb_tools_delete_kpi(sql_db, create_kpi_request): - LOGGER.warning('test_sqlitedb_tools_get_kpi begin') - - response = sql_db.delete_KPI("DEV1",kpi_sample_types_pb2.KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED) - - if response == False: - kpi_description = create_kpi_request.kpi_description - kpi_sample_type = create_kpi_request.kpi_sample_type - kpi_device_id = create_kpi_request.device_id.device_uuid.uuid - kpi_endpoint_id = create_kpi_request.endpoint_id.endpoint_uuid.uuid - kpi_service_id = create_kpi_request.service_id.service_uuid.uuid - - sql_db.insert_KPI(kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id) - response = sql_db.delete_KPI("DEV1", kpi_sample_types_pb2.KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED) + response = management_db.set_monitoring_flag(_kpi_id,True) + assert response is True + response = management_db.check_monitoring_flag(_kpi_id) + assert response is True + management_db.set_monitoring_flag(_kpi_id, False) + response = management_db.check_monitoring_flag(_kpi_id) + assert response is False - assert response == True - -def test_sqlitedb_tools_delete_kpid_id(sql_db, create_kpi_request): - LOGGER.warning('test_sqlitedb_tools_delete_kpid_id begin') - - response = sql_db.delete_kpid_id(1) - - if response == False: - kpi_description = create_kpi_request.kpi_description - kpi_sample_type = create_kpi_request.kpi_sample_type - kpi_device_id = create_kpi_request.device_id.device_uuid.uuid - kpi_endpoint_id = create_kpi_request.endpoint_id.endpoint_uuid.uuid - kpi_service_id = create_kpi_request.service_id.service_uuid.uuid - - kpi_id = sql_db.insert_KPI(kpi_description, kpi_sample_type, kpi_device_id, kpi_endpoint_id, kpi_service_id) - response = sql_db.delete_kpid_id(kpi_id) - - assert response == True + response = management_db.get_KPIS() + assert isinstance(response, list) + response = management_db.delete_KPI(_kpi_id) + assert response -def test_influxdb_tools_write_kpi(influx_db): - LOGGER.warning('test_influxdb_tools_write_kpi begin') -def test_influxdb_tools_read_kpi_points(influx_db): - LOGGER.warning('test_influxdb_tools_read_kpi_points begin') +def test_managementdb_tools_insert_alarm(management_db): + LOGGER.warning('test_managementdb_tools_insert_alarm begin') + _alarm_description = "Alarm Description" + _alarm_name = "Alarm Name" + _kpi_id = "3" + _kpi_min_value = 0.0 + _kpi_max_value = 250.0 + _in_range = True + _include_min_value = False + _include_max_value = True -def test_events_tools(context_client_grpc: ContextClient, # pylint: disable=redefined-outer-name - monitoring_client : MonitoringClient, - context_db_mb: Tuple[Database, MessageBroker]): + _alarm_id = management_db.insert_alarm(_alarm_description, _alarm_name, _kpi_id, _kpi_min_value, + _kpi_max_value, + _in_range, _include_min_value, _include_max_value) + LOGGER.debug(_alarm_id) + assert isinstance(_alarm_id,int) +# +# def test_metrics_db_tools(metrics_db): # pylint: disable=redefined-outer-name +# LOGGER.warning('test_metric_sdb_tools_write_kpi begin') +# _kpiId = "6" +# +# for i in range(50): +# _kpiSampleType = KpiSampleType.Name(KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED).upper().replace('KPISAMPLETYPE_', '') +# _deviceId = 'DEV4' +# _endpointId = 'END4' +# _serviceId = 'SERV4' +# _sliceId = 'SLC4' +# _connectionId = 'CON4' +# _time_stamp = timestamp_utcnow_to_float() +# _kpi_value = 500*random() +# +# metrics_db.write_KPI(_time_stamp, _kpiId, _kpiSampleType, _deviceId, _endpointId, _serviceId, _sliceId, _connectionId, +# _kpi_value) +# sleep(0.05) +# +# _query = f"SELECT * FROM monitoring WHERE kpi_id ='{_kpiId}'" +# _data = metrics_db.run_query(_query) +# assert len(_data) >= 50 +# +# def test_subscription_manager_create_subscription(management_db,metrics_db,subs_scheduler): +# LOGGER.warning('test_subscription_manager_create_subscription begin') +# subs_queue = Queue() +# +# subs_manager = SubscriptionManager(metrics_db) +# +# subs_scheduler.add_job(ingestion_data) +# +# kpi_id = "3" +# sampling_duration_s = 20 +# sampling_interval_s = 3 +# real_start_time = timestamp_utcnow_to_float() +# start_timestamp = real_start_time +# end_timestamp = start_timestamp + sampling_duration_s +# +# subs_id = management_db.insert_subscription(kpi_id, "localhost", sampling_duration_s, +# sampling_interval_s,start_timestamp,end_timestamp) +# subs_manager.create_subscription(subs_queue,subs_id,kpi_id,sampling_interval_s, +# sampling_duration_s,start_timestamp,end_timestamp) +# +# # This is here to simulate application activity (which keeps the main thread alive). +# total_points = 0 +# while True: +# while not subs_queue.empty(): +# list = subs_queue.get_nowait() +# kpi_list = KpiList() +# for item in list: +# kpi = Kpi() +# kpi.kpi_id.kpi_id.uuid = item[0] +# kpi.timestamp.timestamp = timestamp_string_to_float(item[1]) +# kpi.kpi_value.floatVal = item[2] +# kpi_list.kpi.append(kpi) +# total_points += 1 +# LOGGER.debug(kpi_list) +# if timestamp_utcnow_to_float() > end_timestamp: +# break +# +# assert total_points != 0 + +def test_events_tools( + context_client : ContextClient, # pylint: disable=redefined-outer-name,unused-argument + device_client : DeviceClient, # pylint: disable=redefined-outer-name + monitoring_client : MonitoringClient, # pylint: disable=redefined-outer-name,unused-argument + metrics_db : MetricsDB, # pylint: disable=redefined-outer-name + ): LOGGER.warning('test_get_device_events begin') - context_database = context_db_mb[0] - - # ----- Clean the database ----------------------------------------------------------------------------------------- - context_database.clear_all() - # ----- Initialize the EventsCollector ----------------------------------------------------------------------------- - events_collector = EventsDeviceCollector(context_client_grpc, monitoring_client) + events_collector = EventsDeviceCollector(metrics_db.name_mapping) events_collector.start() - # # ----- Dump state of database before create the object ------------------------------------------------------------ - db_entries = context_database.dump() - LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries))) - for db_entry in db_entries: - LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover - LOGGER.info('-----------------------------------------------------------') - assert len(db_entries) == 0 - - populate('localhost', GRPC_PORT_CONTEXT) # place this call in the appropriate line, according to your tests - # ----- Update the object ------------------------------------------------------------------------------------------ - response = context_client_grpc.SetDevice(Device(**DEVICE_R1)) - assert response.device_uuid.uuid == DEVICE_R1_UUID + LOGGER.info('Adding Device {:s}'.format(DEVICE_DEV1_UUID)) + device_with_connect_rules = copy.deepcopy(DEVICE_DEV1) + device_with_connect_rules['device_config']['config_rules'].extend(DEVICE_DEV1_CONNECT_RULES) + response = device_client.AddDevice(Device(**device_with_connect_rules)) + assert response.device_uuid.uuid == DEVICE_DEV1_UUID + device_client.DeleteDevice(response) events_collector.stop() + LOGGER.warning('test_get_device_events end') -def test_get_device_events(context_client_grpc: ContextClient, # pylint: disable=redefined-outer-name - monitoring_client : MonitoringClient, - context_db_mb: Tuple[Database, MessageBroker]): - LOGGER.warning('test_get_device_events begin') - - context_database = context_db_mb[0] +def test_get_device_events( + context_client : ContextClient, # pylint: disable=redefined-outer-name,unused-argument + device_client : DeviceClient, # pylint: disable=redefined-outer-name + monitoring_client : MonitoringClient, # pylint: disable=redefined-outer-name,unused-argument + metrics_db : MetricsDB, # pylint: disable=redefined-outer-name + ): - # ----- Clean the database ----------------------------------------------------------------------------------------- - context_database.clear_all() + LOGGER.warning('test_get_device_events begin') # ----- Initialize the EventsCollector ----------------------------------------------------------------------------- - events_collector = EventsDeviceCollector(context_client_grpc,monitoring_client) + events_collector = EventsDeviceCollector(metrics_db.name_mapping) events_collector.start() - # # ----- Dump state of database before create the object ------------------------------------------------------------ - db_entries = context_database.dump() - LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries))) - for db_entry in db_entries: - LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover - LOGGER.info('-----------------------------------------------------------') - assert len(db_entries) == 0 - - populate('localhost', GRPC_PORT_CONTEXT) # place this call in the appropriate line, according to your tests - # ----- Check create event ----------------------------------------------------------------------------------------- - event = events_collector.get_event(block=True) + LOGGER.info('Adding Device {:s}'.format(DEVICE_DEV1_UUID)) + device_with_connect_rules = copy.deepcopy(DEVICE_DEV1) + device_with_connect_rules['device_config']['config_rules'].extend(DEVICE_DEV1_CONNECT_RULES) + response = device_client.AddDevice(Device(**device_with_connect_rules)) + assert response.device_uuid.uuid == DEVICE_DEV1_UUID + event = events_collector.get_event(block=True) assert isinstance(event, DeviceEvent) assert event.event.event_type == EventTypeEnum.EVENTTYPE_CREATE - assert event.device_id.device_uuid.uuid == DEVICE_R1_UUID + assert event.device_id.device_uuid.uuid == DEVICE_DEV1_UUID + device_client.DeleteDevice(response) events_collector.stop() -def test_listen_events(monitoring_client: MonitoringClient, - context_client_grpc: ContextClient, # pylint: disable=redefined-outer-name - context_db_mb: Tuple[Database, MessageBroker]): + LOGGER.warning('test_get_device_events end') - LOGGER.warning('test_listen_events begin') - - context_database = context_db_mb[0] +def test_listen_events( + context_client : ContextClient, # pylint: disable=redefined-outer-name,unused-argument + device_client : DeviceClient, # pylint: disable=redefined-outer-name + monitoring_client : MonitoringClient, # pylint: disable=redefined-outer-name,unused-argument + metrics_db : MetricsDB, # pylint: disable=redefined-outer-name + ): - # ----- Clean the database ----------------------------------------------------------------------------------------- - context_database.clear_all() + LOGGER.warning('test_listen_events begin') # ----- Initialize the EventsCollector ----------------------------------------------------------------------------- - events_collector = EventsDeviceCollector(context_client_grpc,monitoring_client) + events_collector = EventsDeviceCollector(metrics_db.name_mapping) events_collector.start() - # # ----- Dump state of database before create the object ------------------------------------------------------------ - db_entries = context_database.dump() - LOGGER.info('----- Database Dump [{:3d} entries] -------------------------'.format(len(db_entries))) - for db_entry in db_entries: - LOGGER.info(' [{:>4s}] {:40s} :: {:s}'.format(*db_entry)) # pragma: no cover - LOGGER.info('-----------------------------------------------------------') - assert len(db_entries) == 0 + LOGGER.info('Adding Device {:s}'.format(DEVICE_DEV1_UUID)) + device_with_connect_rules = copy.deepcopy(DEVICE_DEV1) + device_with_connect_rules['device_config']['config_rules'].extend(DEVICE_DEV1_CONNECT_RULES) + response = device_client.AddDevice(Device(**device_with_connect_rules)) + assert response.device_uuid.uuid == DEVICE_DEV1_UUID - populate('localhost', GRPC_PORT_CONTEXT) # place this call in the appropriate line, according to your tests + LOGGER.info('Activating Device {:s}'.format(DEVICE_DEV1_UUID)) - kpi_id_list = events_collector.listen_events() + device = context_client.GetDevice(response) + device_with_op_state = Device() + device_with_op_state.CopyFrom(device) + device_with_op_state.device_operational_status = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED + response = context_client.SetDevice(device_with_op_state) + assert response.device_uuid.uuid == DEVICE_DEV1_UUID - assert bool(kpi_id_list) == True + sleep(1.0) -def test_socket_ports(address, port): - s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - result = s.connect_ex((address,port)) + kpi_id_list = events_collector.listen_events() + assert len(kpi_id_list) > 0 + + device_client.DeleteDevice(response) + events_collector.stop() - if result == 0: - print('socket is open') - else: - print('socket is not open') - s.close() + LOGGER.warning('test_listen_events end') diff --git a/src/opticalattackmitigator/.gitlab-ci.yml b/src/opticalattackmitigator/.gitlab-ci.yml index a39a83f6f4a7f98cce08fd4b7d5b9a0379105935..92968348b3f7ad9b35f39e6f6d86e5df180499ac 100644 --- a/src/opticalattackmitigator/.gitlab-ci.yml +++ b/src/opticalattackmitigator/.gitlab-ci.yml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -55,7 +55,6 @@ unit test opticalattackmitigator: - sleep 5 - docker ps -a - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" - - docker exec -i $IMAGE_NAME bash -c "coverage xml -o /opt/results/${IMAGE_NAME}_coverage.xml" - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: @@ -75,7 +74,6 @@ unit test opticalattackmitigator: when: always reports: junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml - cobertura: src/$IMAGE_NAME/tests/${IMAGE_NAME}_coverage.xml # Deployment of the opticalattackmitigator service in Kubernetes Cluster diff --git a/src/opticalattackmitigator/Config.py b/src/opticalattackmitigator/Config.py index 130381d8bd1db49803aefa992435808bed3a87d3..09ae554ad2e0abce66c7638144c07b2e0b740ae9 100644 --- a/src/opticalattackmitigator/Config.py +++ b/src/opticalattackmitigator/Config.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/opticalattackmitigator/Dockerfile b/src/opticalattackmitigator/Dockerfile index 40469805410e26b145d8a84beda8247fb7c7a56d..e3ba175b7616c88b7208c7476195786dffaa83d1 100644 --- a/src/opticalattackmitigator/Dockerfile +++ b/src/opticalattackmitigator/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/opticalattackmitigator/__init__.py b/src/opticalattackmitigator/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/opticalattackmitigator/__init__.py +++ b/src/opticalattackmitigator/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/opticalattackmitigator/client/OpticalAttackMitigatorClient.py b/src/opticalattackmitigator/client/OpticalAttackMitigatorClient.py index d0c53e57ee54a42955210308492e27d0bb332729..9aa24c696d346f8fb9874412cc1e2e18cfd018fe 100644 --- a/src/opticalattackmitigator/client/OpticalAttackMitigatorClient.py +++ b/src/opticalattackmitigator/client/OpticalAttackMitigatorClient.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/opticalattackmitigator/client/__init__.py b/src/opticalattackmitigator/client/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/opticalattackmitigator/client/__init__.py +++ b/src/opticalattackmitigator/client/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/opticalattackmitigator/genproto.sh b/src/opticalattackmitigator/genproto.sh index 9f0651441172ee902f16faedf65c6c0c54fba9a7..4cb0103b2428605c32cebc142c39dcdc764a3551 100755 --- a/src/opticalattackmitigator/genproto.sh +++ b/src/opticalattackmitigator/genproto.sh @@ -1,6 +1,6 @@ #!/bin/bash -eu # -# Copyright 2018 Google LLC +# 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. @@ -14,14 +14,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash -e - # Make folder containing the script the root folder for its execution cd $(dirname $0) rm -rf proto/*.py rm -rf proto/__pycache__ -touch proto/__init__.py +tee proto/__init__.py << EOF > /dev/null +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +EOF # building protos of services used python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto diff --git a/src/opticalattackmitigator/proto/__init__.py b/src/opticalattackmitigator/proto/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/opticalattackmitigator/proto/__init__.py +++ b/src/opticalattackmitigator/proto/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/opticalattackmitigator/proto/context_pb2.py b/src/opticalattackmitigator/proto/context_pb2.py index 68602b16f264ceac9acc3ef6669b09d5984e72c2..50d501d3ac053ad644554331af26e3c40cd426a1 100644 --- a/src/opticalattackmitigator/proto/context_pb2.py +++ b/src/opticalattackmitigator/proto/context_pb2.py @@ -21,7 +21,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xad\x10\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' + serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"T\n\x07SliceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12!\n\nslice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\x95\x02\n\x05Slice\x12\"\n\x08slice_id\x18\x01 \x01(\x0b\x32\x10.context.SliceId\x12/\n\x12slice_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\x12.\n\x11slice_constraints\x18\x03 \x03(\x0b\x32\x13.context.Constraint\x12-\n\x11slice_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\x12,\n\x12slice_subslice_ids\x18\x05 \x03(\x0b\x32\x10.context.SliceId\x12*\n\x0cslice_status\x18\x06 \x01(\x0b\x32\x14.context.SliceStatus\"=\n\x0bSliceStatus\x12.\n\x0cslice_status\x18\x01 \x01(\x0e\x32\x18.context.SliceStatusEnum\"2\n\x0bSliceIdList\x12#\n\tslice_ids\x18\x01 \x03(\x0b\x32\x10.context.SliceId\"+\n\tSliceList\x12\x1e\n\x06slices\x18\x01 \x03(\x0b\x32\x0e.context.Slice\"O\n\nSliceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12\"\n\x08slice_id\x18\x02 \x01(\x0b\x32\x10.context.SliceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*\x8b\x01\n\x0fSliceStatusEnum\x12\x19\n\x15SLICESTATUS_UNDEFINED\x10\x00\x12\x17\n\x13SLICESTATUS_PLANNED\x10\x01\x12\x14\n\x10SLICESTATUS_INIT\x10\x02\x12\x16\n\x12SLICESTATUS_ACTIVE\x10\x03\x12\x16\n\x12SLICESTATUS_DEINIT\x10\x04*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xef\x12\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12:\n\x0cListSliceIds\x12\x12.context.ContextId\x1a\x14.context.SliceIdList\"\x00\x12\x36\n\nListSlices\x12\x12.context.ContextId\x1a\x12.context.SliceList\"\x00\x12.\n\x08GetSlice\x12\x10.context.SliceId\x1a\x0e.context.Slice\"\x00\x12.\n\x08SetSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0bRemoveSlice\x12\x10.context.SliceId\x1a\x0e.context.Empty\"\x00\x12\x39\n\x0eGetSliceEvents\x12\x0e.context.Empty\x1a\x13.context.SliceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' , dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) @@ -55,8 +55,8 @@ _EVENTTYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3703, - serialized_end=3809, + serialized_start=4310, + serialized_end=4416, ) _sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) @@ -101,8 +101,8 @@ _DEVICEDRIVERENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3812, - serialized_end=4009, + serialized_start=4419, + serialized_end=4616, ) _sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) @@ -132,8 +132,8 @@ _DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4012, - serialized_end=4155, + serialized_start=4619, + serialized_end=4762, ) _sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) @@ -168,8 +168,8 @@ _SERVICETYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4158, - serialized_end=4287, + serialized_start=4765, + serialized_end=4894, ) _sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) @@ -204,12 +204,53 @@ _SERVICESTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4290, - serialized_end=4426, + serialized_start=4897, + serialized_end=5033, ) _sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) +_SLICESTATUSENUM = _descriptor.EnumDescriptor( + name='SliceStatusEnum', + full_name='context.SliceStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_PLANNED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_INIT', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_ACTIVE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_DEINIT', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=5036, + serialized_end=5175, +) +_sym_db.RegisterEnumDescriptor(_SLICESTATUSENUM) + +SliceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SLICESTATUSENUM) _CONFIGACTIONENUM = _descriptor.EnumDescriptor( name='ConfigActionEnum', full_name='context.ConfigActionEnum', @@ -235,8 +276,8 @@ _CONFIGACTIONENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4428, - serialized_end=4521, + serialized_start=5177, + serialized_end=5270, ) _sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) @@ -262,6 +303,11 @@ SERVICESTATUS_UNDEFINED = 0 SERVICESTATUS_PLANNED = 1 SERVICESTATUS_ACTIVE = 2 SERVICESTATUS_PENDING_REMOVAL = 3 +SLICESTATUS_UNDEFINED = 0 +SLICESTATUS_PLANNED = 1 +SLICESTATUS_INIT = 2 +SLICESTATUS_ACTIVE = 3 +SLICESTATUS_DEINIT = 4 CONFIGACTION_UNDEFINED = 0 CONFIGACTION_SET = 1 CONFIGACTION_DELETE = 2 @@ -1421,6 +1467,247 @@ _SERVICEEVENT = _descriptor.Descriptor( ) +_SLICEID = _descriptor.Descriptor( + name='SliceId', + full_name='context.SliceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.SliceId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_uuid', full_name='context.SliceId.slice_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2604, + serialized_end=2688, +) + + +_SLICE = _descriptor.Descriptor( + name='Slice', + full_name='context.Slice', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.Slice.slice_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_endpoint_ids', full_name='context.Slice.slice_endpoint_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_constraints', full_name='context.Slice.slice_constraints', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_service_ids', full_name='context.Slice.slice_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_subslice_ids', full_name='context.Slice.slice_subslice_ids', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.Slice.slice_status', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2691, + serialized_end=2968, +) + + +_SLICESTATUS = _descriptor.Descriptor( + name='SliceStatus', + full_name='context.SliceStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.SliceStatus.slice_status', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2970, + serialized_end=3031, +) + + +_SLICEIDLIST = _descriptor.Descriptor( + name='SliceIdList', + full_name='context.SliceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_ids', full_name='context.SliceIdList.slice_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3033, + serialized_end=3083, +) + + +_SLICELIST = _descriptor.Descriptor( + name='SliceList', + full_name='context.SliceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slices', full_name='context.SliceList.slices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3085, + serialized_end=3128, +) + + +_SLICEEVENT = _descriptor.Descriptor( + name='SliceEvent', + full_name='context.SliceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.SliceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.SliceEvent.slice_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3130, + serialized_end=3209, +) + + _CONNECTIONID = _descriptor.Descriptor( name='ConnectionId', full_name='context.ConnectionId', @@ -1448,8 +1735,8 @@ _CONNECTIONID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2604, - serialized_end=2658, + serialized_start=3211, + serialized_end=3265, ) @@ -1501,8 +1788,8 @@ _CONNECTION = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2661, - serialized_end=2857, + serialized_start=3268, + serialized_end=3464, ) @@ -1533,8 +1820,8 @@ _CONNECTIONIDLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2859, - serialized_end=2924, + serialized_start=3466, + serialized_end=3531, ) @@ -1565,8 +1852,8 @@ _CONNECTIONLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2926, - serialized_end=2984, + serialized_start=3533, + serialized_end=3591, ) @@ -1604,8 +1891,8 @@ _CONNECTIONEVENT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2986, - serialized_end=3080, + serialized_start=3593, + serialized_end=3687, ) @@ -1650,8 +1937,8 @@ _ENDPOINTID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3083, - serialized_end=3213, + serialized_start=3690, + serialized_end=3820, ) @@ -1696,8 +1983,8 @@ _ENDPOINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3216, - serialized_end=3350, + serialized_start=3823, + serialized_end=3957, ) @@ -1742,8 +2029,8 @@ _CONFIGRULE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3352, - serialized_end=3453, + serialized_start=3959, + serialized_end=4060, ) @@ -1781,8 +2068,8 @@ _CONSTRAINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3455, - serialized_end=3518, + serialized_start=4062, + serialized_end=4125, ) @@ -1827,8 +2114,8 @@ _TERAFLOWCONTROLLER = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3520, - serialized_end=3614, + serialized_start=4127, + serialized_end=4221, ) @@ -1866,8 +2153,8 @@ _AUTHENTICATIONRESULT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3616, - serialized_end=3701, + serialized_start=4223, + serialized_end=4308, ) _EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM @@ -1921,6 +2208,19 @@ _SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID _SERVICELIST.fields_by_name['services'].message_type = _SERVICE _SERVICEEVENT.fields_by_name['event'].message_type = _EVENT _SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID +_SLICEID.fields_by_name['context_id'].message_type = _CONTEXTID +_SLICEID.fields_by_name['slice_uuid'].message_type = _UUID +_SLICE.fields_by_name['slice_id'].message_type = _SLICEID +_SLICE.fields_by_name['slice_endpoint_ids'].message_type = _ENDPOINTID +_SLICE.fields_by_name['slice_constraints'].message_type = _CONSTRAINT +_SLICE.fields_by_name['slice_service_ids'].message_type = _SERVICEID +_SLICE.fields_by_name['slice_subslice_ids'].message_type = _SLICEID +_SLICE.fields_by_name['slice_status'].message_type = _SLICESTATUS +_SLICESTATUS.fields_by_name['slice_status'].enum_type = _SLICESTATUSENUM +_SLICEIDLIST.fields_by_name['slice_ids'].message_type = _SLICEID +_SLICELIST.fields_by_name['slices'].message_type = _SLICE +_SLICEEVENT.fields_by_name['event'].message_type = _EVENT +_SLICEEVENT.fields_by_name['slice_id'].message_type = _SLICEID _CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID _CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID _CONNECTION.fields_by_name['service_id'].message_type = _SERVICEID @@ -1969,6 +2269,12 @@ DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT +DESCRIPTOR.message_types_by_name['SliceId'] = _SLICEID +DESCRIPTOR.message_types_by_name['Slice'] = _SLICE +DESCRIPTOR.message_types_by_name['SliceStatus'] = _SLICESTATUS +DESCRIPTOR.message_types_by_name['SliceIdList'] = _SLICEIDLIST +DESCRIPTOR.message_types_by_name['SliceList'] = _SLICELIST +DESCRIPTOR.message_types_by_name['SliceEvent'] = _SLICEEVENT DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST @@ -1985,6 +2291,7 @@ DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM +DESCRIPTOR.enum_types_by_name['SliceStatusEnum'] = _SLICESTATUSENUM DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -2205,6 +2512,48 @@ ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_messag }) _sym_db.RegisterMessage(ServiceEvent) +SliceId = _reflection.GeneratedProtocolMessageType('SliceId', (_message.Message,), { + 'DESCRIPTOR' : _SLICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceId) + }) +_sym_db.RegisterMessage(SliceId) + +Slice = _reflection.GeneratedProtocolMessageType('Slice', (_message.Message,), { + 'DESCRIPTOR' : _SLICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Slice) + }) +_sym_db.RegisterMessage(Slice) + +SliceStatus = _reflection.GeneratedProtocolMessageType('SliceStatus', (_message.Message,), { + 'DESCRIPTOR' : _SLICESTATUS, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceStatus) + }) +_sym_db.RegisterMessage(SliceStatus) + +SliceIdList = _reflection.GeneratedProtocolMessageType('SliceIdList', (_message.Message,), { + 'DESCRIPTOR' : _SLICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceIdList) + }) +_sym_db.RegisterMessage(SliceIdList) + +SliceList = _reflection.GeneratedProtocolMessageType('SliceList', (_message.Message,), { + 'DESCRIPTOR' : _SLICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceList) + }) +_sym_db.RegisterMessage(SliceList) + +SliceEvent = _reflection.GeneratedProtocolMessageType('SliceEvent', (_message.Message,), { + 'DESCRIPTOR' : _SLICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceEvent) + }) +_sym_db.RegisterMessage(SliceEvent) + ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { 'DESCRIPTOR' : _CONNECTIONID, '__module__' : 'context_pb2' @@ -2291,8 +2640,8 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=4524, - serialized_end=6617, + serialized_start=5273, + serialized_end=7688, methods=[ _descriptor.MethodDescriptor( name='ListContextIds', @@ -2594,10 +2943,70 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, ), + _descriptor.MethodDescriptor( + name='ListSliceIds', + full_name='context.ContextService.ListSliceIds', + index=30, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListSlices', + full_name='context.ContextService.ListSlices', + index=31, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSlice', + full_name='context.ContextService.GetSlice', + index=32, + containing_service=None, + input_type=_SLICEID, + output_type=_SLICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetSlice', + full_name='context.ContextService.SetSlice', + index=33, + containing_service=None, + input_type=_SLICE, + output_type=_SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveSlice', + full_name='context.ContextService.RemoveSlice', + index=34, + containing_service=None, + input_type=_SLICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSliceEvents', + full_name='context.ContextService.GetSliceEvents', + index=35, + containing_service=None, + input_type=_EMPTY, + output_type=_SLICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), _descriptor.MethodDescriptor( name='ListConnectionIds', full_name='context.ContextService.ListConnectionIds', - index=30, + index=36, containing_service=None, input_type=_SERVICEID, output_type=_CONNECTIONIDLIST, @@ -2607,7 +3016,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='ListConnections', full_name='context.ContextService.ListConnections', - index=31, + index=37, containing_service=None, input_type=_SERVICEID, output_type=_CONNECTIONLIST, @@ -2617,7 +3026,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='GetConnection', full_name='context.ContextService.GetConnection', - index=32, + index=38, containing_service=None, input_type=_CONNECTIONID, output_type=_CONNECTION, @@ -2627,7 +3036,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='SetConnection', full_name='context.ContextService.SetConnection', - index=33, + index=39, containing_service=None, input_type=_CONNECTION, output_type=_CONNECTIONID, @@ -2637,7 +3046,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='RemoveConnection', full_name='context.ContextService.RemoveConnection', - index=34, + index=40, containing_service=None, input_type=_CONNECTIONID, output_type=_EMPTY, @@ -2647,7 +3056,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='GetConnectionEvents', full_name='context.ContextService.GetConnectionEvents', - index=35, + index=41, containing_service=None, input_type=_EMPTY, output_type=_CONNECTIONEVENT, diff --git a/src/opticalattackmitigator/requirements.in b/src/opticalattackmitigator/requirements.in index ea6b450c9c240c76b9f54ce4f3c0c6c25ec62289..378e9a10a70f6a41a264c6a76f47239d7515989a 100644 --- a/src/opticalattackmitigator/requirements.in +++ b/src/opticalattackmitigator/requirements.in @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + grpcio-health-checking grpcio prometheus-client diff --git a/src/opticalattackmitigator/service/OpticalAttackMitigatorService.py b/src/opticalattackmitigator/service/OpticalAttackMitigatorService.py index 875276b4ce80335b9eb0081a05d38bfa2c378e43..e2783e6ca6907cccad0e344cf2f058acabe53b93 100644 --- a/src/opticalattackmitigator/service/OpticalAttackMitigatorService.py +++ b/src/opticalattackmitigator/service/OpticalAttackMitigatorService.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/opticalattackmitigator/service/OpticalAttackMitigatorServiceServicerImpl.py b/src/opticalattackmitigator/service/OpticalAttackMitigatorServiceServicerImpl.py index 4a2dd041b52eaf89bda65acb7ae1e46beed8c48a..16777e799deef7e50905b70b049f25765ebe7d96 100644 --- a/src/opticalattackmitigator/service/OpticalAttackMitigatorServiceServicerImpl.py +++ b/src/opticalattackmitigator/service/OpticalAttackMitigatorServiceServicerImpl.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,16 +14,14 @@ import os, grpc, logging, random from influxdb import InfluxDBClient -from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method +from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method from opticalattackmitigator.proto.optical_attack_mitigator_pb2_grpc import ( AttackMitigatorServicer) from opticalattackmitigator.proto.optical_attack_mitigator_pb2 import AttackDescription, AttackResponse LOGGER = logging.getLogger(__name__) -SERVICE_NAME = 'OpticalAttackMitigator' -METHOD_NAMES = ['NotifyAttack'] -METRICS = create_metrics(SERVICE_NAME, METHOD_NAMES) +METRICS_POOL = MetricsPool('OpticalAttackMitigator', 'RPC') class OpticalAttackMitigatorServiceServicerImpl(AttackMitigatorServicer): @@ -32,7 +30,7 @@ class OpticalAttackMitigatorServiceServicerImpl(AttackMitigatorServicer): LOGGER.debug('Creating Servicer...') LOGGER.debug('Servicer Created') - @safe_and_metered_rpc_method(METRICS, LOGGER) + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def NotifyAttack(self, request : AttackDescription, context : grpc.ServicerContext) -> AttackResponse: LOGGER.debug(f"NotifyAttack: {request}") response: AttackResponse = AttackResponse() diff --git a/src/opticalattackmitigator/service/__init__.py b/src/opticalattackmitigator/service/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/opticalattackmitigator/service/__init__.py +++ b/src/opticalattackmitigator/service/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/opticalattackmitigator/service/__main__.py b/src/opticalattackmitigator/service/__main__.py index 10b50ac8ba5f5c7a11c5963eb8533bf6d05dfee2..649d079c0cee6347e452acbaf35263d77150bd45 100644 --- a/src/opticalattackmitigator/service/__main__.py +++ b/src/opticalattackmitigator/service/__main__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/opticalattackmitigator/tests/__init__.py b/src/opticalattackmitigator/tests/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/opticalattackmitigator/tests/__init__.py +++ b/src/opticalattackmitigator/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/opticalattackmitigator/tests/test_unitary.py b/src/opticalattackmitigator/tests/test_unitary.py index 74f91a837bf0c83026c88b28ae45f21493a2599d..24d0853b90a7b9f30fd25bfe7431f4e3e7e5fd0f 100644 --- a/src/opticalattackmitigator/tests/test_unitary.py +++ b/src/opticalattackmitigator/tests/test_unitary.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/opticalcentralizedattackdetector/.gitlab-ci.yml b/src/opticalcentralizedattackdetector/.gitlab-ci.yml index 8a1445e80347fe64dac1beb1780894fa98ba85fd..3db4de3f177cfb1478bc306067564e9a293e0737 100644 --- a/src/opticalcentralizedattackdetector/.gitlab-ci.yml +++ b/src/opticalcentralizedattackdetector/.gitlab-ci.yml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -55,7 +55,6 @@ unit test opticalcentralizedattackdetector: - sleep 5 - docker ps -a - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" - - docker exec -i $IMAGE_NAME bash -c "coverage xml -o /opt/results/${IMAGE_NAME}_coverage.xml" - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: @@ -75,7 +74,6 @@ unit test opticalcentralizedattackdetector: when: always reports: junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml - cobertura: src/$IMAGE_NAME/tests/${IMAGE_NAME}_coverage.xml # Deployment of the opticalcentralizedattackdetector service in Kubernetes Cluster diff --git a/src/opticalcentralizedattackdetector/Config.py b/src/opticalcentralizedattackdetector/Config.py index 5fd3e97e9f590bea9cdfc6ebf8e93e90fb0a4fea..c9bfe106b8d69ca52016ccc9512ec4598d3914bf 100644 --- a/src/opticalcentralizedattackdetector/Config.py +++ b/src/opticalcentralizedattackdetector/Config.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/opticalcentralizedattackdetector/Dockerfile b/src/opticalcentralizedattackdetector/Dockerfile index 190df9beae66e82900a8ab78a12d062e4d319fda..a7b32ccc6ee94f0fe741885452a44ca9fb7a0f3f 100644 --- a/src/opticalcentralizedattackdetector/Dockerfile +++ b/src/opticalcentralizedattackdetector/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/opticalcentralizedattackdetector/__init__.py b/src/opticalcentralizedattackdetector/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/opticalcentralizedattackdetector/__init__.py +++ b/src/opticalcentralizedattackdetector/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/opticalcentralizedattackdetector/client/OpticalCentralizedAttackDetectorClient.py b/src/opticalcentralizedattackdetector/client/OpticalCentralizedAttackDetectorClient.py index cfb78b41ec6a6d5385692813e1a839566d1c90e7..3dc2f3ae8f3837fe1c12d530d61fe70acf2563b6 100644 --- a/src/opticalcentralizedattackdetector/client/OpticalCentralizedAttackDetectorClient.py +++ b/src/opticalcentralizedattackdetector/client/OpticalCentralizedAttackDetectorClient.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/opticalcentralizedattackdetector/client/__init__.py b/src/opticalcentralizedattackdetector/client/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/opticalcentralizedattackdetector/client/__init__.py +++ b/src/opticalcentralizedattackdetector/client/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/opticalcentralizedattackdetector/genproto.sh b/src/opticalcentralizedattackdetector/genproto.sh index 76df9bf83af19ac8f1528c750b7d7f11e0a97cf3..85941a266c1def6f352d5ade7bfe5b9e99309fd9 100755 --- a/src/opticalcentralizedattackdetector/genproto.sh +++ b/src/opticalcentralizedattackdetector/genproto.sh @@ -1,6 +1,6 @@ #!/bin/bash -eu # -# Copyright 2018 Google LLC +# 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. @@ -14,14 +14,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash -e - # Make folder containing the script the root folder for its execution cd $(dirname $0) rm -rf proto/*.py rm -rf proto/__pycache__ -touch proto/__init__.py +tee proto/__init__.py << EOF > /dev/null +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +EOF # building protos of services used python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto diff --git a/src/opticalcentralizedattackdetector/proto/__init__.py b/src/opticalcentralizedattackdetector/proto/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/opticalcentralizedattackdetector/proto/__init__.py +++ b/src/opticalcentralizedattackdetector/proto/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/opticalcentralizedattackdetector/proto/context_pb2.py b/src/opticalcentralizedattackdetector/proto/context_pb2.py index 68602b16f264ceac9acc3ef6669b09d5984e72c2..50d501d3ac053ad644554331af26e3c40cd426a1 100644 --- a/src/opticalcentralizedattackdetector/proto/context_pb2.py +++ b/src/opticalcentralizedattackdetector/proto/context_pb2.py @@ -21,7 +21,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xad\x10\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' + serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"T\n\x07SliceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12!\n\nslice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\x95\x02\n\x05Slice\x12\"\n\x08slice_id\x18\x01 \x01(\x0b\x32\x10.context.SliceId\x12/\n\x12slice_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\x12.\n\x11slice_constraints\x18\x03 \x03(\x0b\x32\x13.context.Constraint\x12-\n\x11slice_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\x12,\n\x12slice_subslice_ids\x18\x05 \x03(\x0b\x32\x10.context.SliceId\x12*\n\x0cslice_status\x18\x06 \x01(\x0b\x32\x14.context.SliceStatus\"=\n\x0bSliceStatus\x12.\n\x0cslice_status\x18\x01 \x01(\x0e\x32\x18.context.SliceStatusEnum\"2\n\x0bSliceIdList\x12#\n\tslice_ids\x18\x01 \x03(\x0b\x32\x10.context.SliceId\"+\n\tSliceList\x12\x1e\n\x06slices\x18\x01 \x03(\x0b\x32\x0e.context.Slice\"O\n\nSliceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12\"\n\x08slice_id\x18\x02 \x01(\x0b\x32\x10.context.SliceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*\x8b\x01\n\x0fSliceStatusEnum\x12\x19\n\x15SLICESTATUS_UNDEFINED\x10\x00\x12\x17\n\x13SLICESTATUS_PLANNED\x10\x01\x12\x14\n\x10SLICESTATUS_INIT\x10\x02\x12\x16\n\x12SLICESTATUS_ACTIVE\x10\x03\x12\x16\n\x12SLICESTATUS_DEINIT\x10\x04*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xef\x12\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12:\n\x0cListSliceIds\x12\x12.context.ContextId\x1a\x14.context.SliceIdList\"\x00\x12\x36\n\nListSlices\x12\x12.context.ContextId\x1a\x12.context.SliceList\"\x00\x12.\n\x08GetSlice\x12\x10.context.SliceId\x1a\x0e.context.Slice\"\x00\x12.\n\x08SetSlice\x12\x0e.context.Slice\x1a\x10.context.SliceId\"\x00\x12\x31\n\x0bRemoveSlice\x12\x10.context.SliceId\x1a\x0e.context.Empty\"\x00\x12\x39\n\x0eGetSliceEvents\x12\x0e.context.Empty\x1a\x13.context.SliceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' , dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) @@ -55,8 +55,8 @@ _EVENTTYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3703, - serialized_end=3809, + serialized_start=4310, + serialized_end=4416, ) _sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) @@ -101,8 +101,8 @@ _DEVICEDRIVERENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3812, - serialized_end=4009, + serialized_start=4419, + serialized_end=4616, ) _sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) @@ -132,8 +132,8 @@ _DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4012, - serialized_end=4155, + serialized_start=4619, + serialized_end=4762, ) _sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) @@ -168,8 +168,8 @@ _SERVICETYPEENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4158, - serialized_end=4287, + serialized_start=4765, + serialized_end=4894, ) _sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) @@ -204,12 +204,53 @@ _SERVICESTATUSENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4290, - serialized_end=4426, + serialized_start=4897, + serialized_end=5033, ) _sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) +_SLICESTATUSENUM = _descriptor.EnumDescriptor( + name='SliceStatusEnum', + full_name='context.SliceStatusEnum', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_UNDEFINED', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_PLANNED', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_INIT', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_ACTIVE', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='SLICESTATUS_DEINIT', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=5036, + serialized_end=5175, +) +_sym_db.RegisterEnumDescriptor(_SLICESTATUSENUM) + +SliceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SLICESTATUSENUM) _CONFIGACTIONENUM = _descriptor.EnumDescriptor( name='ConfigActionEnum', full_name='context.ConfigActionEnum', @@ -235,8 +276,8 @@ _CONFIGACTIONENUM = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4428, - serialized_end=4521, + serialized_start=5177, + serialized_end=5270, ) _sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) @@ -262,6 +303,11 @@ SERVICESTATUS_UNDEFINED = 0 SERVICESTATUS_PLANNED = 1 SERVICESTATUS_ACTIVE = 2 SERVICESTATUS_PENDING_REMOVAL = 3 +SLICESTATUS_UNDEFINED = 0 +SLICESTATUS_PLANNED = 1 +SLICESTATUS_INIT = 2 +SLICESTATUS_ACTIVE = 3 +SLICESTATUS_DEINIT = 4 CONFIGACTION_UNDEFINED = 0 CONFIGACTION_SET = 1 CONFIGACTION_DELETE = 2 @@ -1421,6 +1467,247 @@ _SERVICEEVENT = _descriptor.Descriptor( ) +_SLICEID = _descriptor.Descriptor( + name='SliceId', + full_name='context.SliceId', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='context_id', full_name='context.SliceId.context_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_uuid', full_name='context.SliceId.slice_uuid', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2604, + serialized_end=2688, +) + + +_SLICE = _descriptor.Descriptor( + name='Slice', + full_name='context.Slice', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.Slice.slice_id', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_endpoint_ids', full_name='context.Slice.slice_endpoint_ids', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_constraints', full_name='context.Slice.slice_constraints', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_service_ids', full_name='context.Slice.slice_service_ids', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_subslice_ids', full_name='context.Slice.slice_subslice_ids', index=4, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.Slice.slice_status', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2691, + serialized_end=2968, +) + + +_SLICESTATUS = _descriptor.Descriptor( + name='SliceStatus', + full_name='context.SliceStatus', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_status', full_name='context.SliceStatus.slice_status', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2970, + serialized_end=3031, +) + + +_SLICEIDLIST = _descriptor.Descriptor( + name='SliceIdList', + full_name='context.SliceIdList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slice_ids', full_name='context.SliceIdList.slice_ids', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3033, + serialized_end=3083, +) + + +_SLICELIST = _descriptor.Descriptor( + name='SliceList', + full_name='context.SliceList', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='slices', full_name='context.SliceList.slices', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3085, + serialized_end=3128, +) + + +_SLICEEVENT = _descriptor.Descriptor( + name='SliceEvent', + full_name='context.SliceEvent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='event', full_name='context.SliceEvent.event', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='slice_id', full_name='context.SliceEvent.slice_id', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3130, + serialized_end=3209, +) + + _CONNECTIONID = _descriptor.Descriptor( name='ConnectionId', full_name='context.ConnectionId', @@ -1448,8 +1735,8 @@ _CONNECTIONID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2604, - serialized_end=2658, + serialized_start=3211, + serialized_end=3265, ) @@ -1501,8 +1788,8 @@ _CONNECTION = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2661, - serialized_end=2857, + serialized_start=3268, + serialized_end=3464, ) @@ -1533,8 +1820,8 @@ _CONNECTIONIDLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2859, - serialized_end=2924, + serialized_start=3466, + serialized_end=3531, ) @@ -1565,8 +1852,8 @@ _CONNECTIONLIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2926, - serialized_end=2984, + serialized_start=3533, + serialized_end=3591, ) @@ -1604,8 +1891,8 @@ _CONNECTIONEVENT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=2986, - serialized_end=3080, + serialized_start=3593, + serialized_end=3687, ) @@ -1650,8 +1937,8 @@ _ENDPOINTID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3083, - serialized_end=3213, + serialized_start=3690, + serialized_end=3820, ) @@ -1696,8 +1983,8 @@ _ENDPOINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3216, - serialized_end=3350, + serialized_start=3823, + serialized_end=3957, ) @@ -1742,8 +2029,8 @@ _CONFIGRULE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3352, - serialized_end=3453, + serialized_start=3959, + serialized_end=4060, ) @@ -1781,8 +2068,8 @@ _CONSTRAINT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3455, - serialized_end=3518, + serialized_start=4062, + serialized_end=4125, ) @@ -1827,8 +2114,8 @@ _TERAFLOWCONTROLLER = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3520, - serialized_end=3614, + serialized_start=4127, + serialized_end=4221, ) @@ -1866,8 +2153,8 @@ _AUTHENTICATIONRESULT = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3616, - serialized_end=3701, + serialized_start=4223, + serialized_end=4308, ) _EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM @@ -1921,6 +2208,19 @@ _SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID _SERVICELIST.fields_by_name['services'].message_type = _SERVICE _SERVICEEVENT.fields_by_name['event'].message_type = _EVENT _SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID +_SLICEID.fields_by_name['context_id'].message_type = _CONTEXTID +_SLICEID.fields_by_name['slice_uuid'].message_type = _UUID +_SLICE.fields_by_name['slice_id'].message_type = _SLICEID +_SLICE.fields_by_name['slice_endpoint_ids'].message_type = _ENDPOINTID +_SLICE.fields_by_name['slice_constraints'].message_type = _CONSTRAINT +_SLICE.fields_by_name['slice_service_ids'].message_type = _SERVICEID +_SLICE.fields_by_name['slice_subslice_ids'].message_type = _SLICEID +_SLICE.fields_by_name['slice_status'].message_type = _SLICESTATUS +_SLICESTATUS.fields_by_name['slice_status'].enum_type = _SLICESTATUSENUM +_SLICEIDLIST.fields_by_name['slice_ids'].message_type = _SLICEID +_SLICELIST.fields_by_name['slices'].message_type = _SLICE +_SLICEEVENT.fields_by_name['event'].message_type = _EVENT +_SLICEEVENT.fields_by_name['slice_id'].message_type = _SLICEID _CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID _CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID _CONNECTION.fields_by_name['service_id'].message_type = _SERVICEID @@ -1969,6 +2269,12 @@ DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT +DESCRIPTOR.message_types_by_name['SliceId'] = _SLICEID +DESCRIPTOR.message_types_by_name['Slice'] = _SLICE +DESCRIPTOR.message_types_by_name['SliceStatus'] = _SLICESTATUS +DESCRIPTOR.message_types_by_name['SliceIdList'] = _SLICEIDLIST +DESCRIPTOR.message_types_by_name['SliceList'] = _SLICELIST +DESCRIPTOR.message_types_by_name['SliceEvent'] = _SLICEEVENT DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST @@ -1985,6 +2291,7 @@ DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM +DESCRIPTOR.enum_types_by_name['SliceStatusEnum'] = _SLICESTATUSENUM DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -2205,6 +2512,48 @@ ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_messag }) _sym_db.RegisterMessage(ServiceEvent) +SliceId = _reflection.GeneratedProtocolMessageType('SliceId', (_message.Message,), { + 'DESCRIPTOR' : _SLICEID, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceId) + }) +_sym_db.RegisterMessage(SliceId) + +Slice = _reflection.GeneratedProtocolMessageType('Slice', (_message.Message,), { + 'DESCRIPTOR' : _SLICE, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.Slice) + }) +_sym_db.RegisterMessage(Slice) + +SliceStatus = _reflection.GeneratedProtocolMessageType('SliceStatus', (_message.Message,), { + 'DESCRIPTOR' : _SLICESTATUS, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceStatus) + }) +_sym_db.RegisterMessage(SliceStatus) + +SliceIdList = _reflection.GeneratedProtocolMessageType('SliceIdList', (_message.Message,), { + 'DESCRIPTOR' : _SLICEIDLIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceIdList) + }) +_sym_db.RegisterMessage(SliceIdList) + +SliceList = _reflection.GeneratedProtocolMessageType('SliceList', (_message.Message,), { + 'DESCRIPTOR' : _SLICELIST, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceList) + }) +_sym_db.RegisterMessage(SliceList) + +SliceEvent = _reflection.GeneratedProtocolMessageType('SliceEvent', (_message.Message,), { + 'DESCRIPTOR' : _SLICEEVENT, + '__module__' : 'context_pb2' + # @@protoc_insertion_point(class_scope:context.SliceEvent) + }) +_sym_db.RegisterMessage(SliceEvent) + ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { 'DESCRIPTOR' : _CONNECTIONID, '__module__' : 'context_pb2' @@ -2291,8 +2640,8 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=4524, - serialized_end=6617, + serialized_start=5273, + serialized_end=7688, methods=[ _descriptor.MethodDescriptor( name='ListContextIds', @@ -2594,10 +2943,70 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, ), + _descriptor.MethodDescriptor( + name='ListSliceIds', + full_name='context.ContextService.ListSliceIds', + index=30, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICEIDLIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='ListSlices', + full_name='context.ContextService.ListSlices', + index=31, + containing_service=None, + input_type=_CONTEXTID, + output_type=_SLICELIST, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSlice', + full_name='context.ContextService.GetSlice', + index=32, + containing_service=None, + input_type=_SLICEID, + output_type=_SLICE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='SetSlice', + full_name='context.ContextService.SetSlice', + index=33, + containing_service=None, + input_type=_SLICE, + output_type=_SLICEID, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='RemoveSlice', + full_name='context.ContextService.RemoveSlice', + index=34, + containing_service=None, + input_type=_SLICEID, + output_type=_EMPTY, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='GetSliceEvents', + full_name='context.ContextService.GetSliceEvents', + index=35, + containing_service=None, + input_type=_EMPTY, + output_type=_SLICEEVENT, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), _descriptor.MethodDescriptor( name='ListConnectionIds', full_name='context.ContextService.ListConnectionIds', - index=30, + index=36, containing_service=None, input_type=_SERVICEID, output_type=_CONNECTIONIDLIST, @@ -2607,7 +3016,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='ListConnections', full_name='context.ContextService.ListConnections', - index=31, + index=37, containing_service=None, input_type=_SERVICEID, output_type=_CONNECTIONLIST, @@ -2617,7 +3026,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='GetConnection', full_name='context.ContextService.GetConnection', - index=32, + index=38, containing_service=None, input_type=_CONNECTIONID, output_type=_CONNECTION, @@ -2627,7 +3036,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='SetConnection', full_name='context.ContextService.SetConnection', - index=33, + index=39, containing_service=None, input_type=_CONNECTION, output_type=_CONNECTIONID, @@ -2637,7 +3046,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='RemoveConnection', full_name='context.ContextService.RemoveConnection', - index=34, + index=40, containing_service=None, input_type=_CONNECTIONID, output_type=_EMPTY, @@ -2647,7 +3056,7 @@ _CONTEXTSERVICE = _descriptor.ServiceDescriptor( _descriptor.MethodDescriptor( name='GetConnectionEvents', full_name='context.ContextService.GetConnectionEvents', - index=35, + index=41, containing_service=None, input_type=_EMPTY, output_type=_CONNECTIONEVENT, diff --git a/src/opticalcentralizedattackdetector/proto/service_pb2.py b/src/opticalcentralizedattackdetector/proto/service_pb2.py index 7a006915b8be39710a17faab075e382e322d918f..8e2806c7685e24ab90a3d59a19f1e4f99ebc9712 100644 --- a/src/opticalcentralizedattackdetector/proto/service_pb2.py +++ b/src/opticalcentralizedattackdetector/proto/service_pb2.py @@ -20,7 +20,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rservice.proto\x12\x07service\x1a\rcontext.proto2\xfd\x01\n\x0eServiceService\x12\x37\n\rCreateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x37\n\rUpdateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rDeleteService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12\x42\n\x11GetConnectionList\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x62\x06proto3' + serialized_pb=b'\n\rservice.proto\x12\x07service\x1a\rcontext.proto2\xb9\x01\n\x0eServiceService\x12\x37\n\rCreateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x37\n\rUpdateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rDeleteService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x62\x06proto3' , dependencies=[context__pb2.DESCRIPTOR,]) @@ -38,7 +38,7 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, serialized_start=42, - serialized_end=295, + serialized_end=227, methods=[ _descriptor.MethodDescriptor( name='CreateService', @@ -70,16 +70,6 @@ _SERVICESERVICE = _descriptor.ServiceDescriptor( serialized_options=None, create_key=_descriptor._internal_create_key, ), - _descriptor.MethodDescriptor( - name='GetConnectionList', - full_name='service.ServiceService.GetConnectionList', - index=3, - containing_service=None, - input_type=context__pb2._SERVICEID, - output_type=context__pb2._CONNECTIONLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), ]) _sym_db.RegisterServiceDescriptor(_SERVICESERVICE) diff --git a/src/opticalcentralizedattackdetector/requirements.in b/src/opticalcentralizedattackdetector/requirements.in index ea6b450c9c240c76b9f54ce4f3c0c6c25ec62289..378e9a10a70f6a41a264c6a76f47239d7515989a 100644 --- a/src/opticalcentralizedattackdetector/requirements.in +++ b/src/opticalcentralizedattackdetector/requirements.in @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + grpcio-health-checking grpcio prometheus-client diff --git a/src/opticalcentralizedattackdetector/requirements.txt b/src/opticalcentralizedattackdetector/requirements.txt index fca44cbb133ae3c6d5ba2a6d12882ecad9a2c467..5d13e7bc5d318c65e5cc0fe8a4501631aa5428ff 100644 --- a/src/opticalcentralizedattackdetector/requirements.txt +++ b/src/opticalcentralizedattackdetector/requirements.txt @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # # This file is autogenerated by pip-compile with python 3.9 # To update, run: diff --git a/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorService.py b/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorService.py index e29566833a781afc8bf85b41b7d5dd10f2a4a2f5..f281063f47cd7ef79b06640a5588286699d55848 100644 --- a/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorService.py +++ b/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorService.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorServiceServicerImpl.py b/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorServiceServicerImpl.py index 9c77a959cbdc484af143015a2868121af3845b0a..c3ca1c1cfc21dd22c3f2f801a8d1c1321274ad29 100644 --- a/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorServiceServicerImpl.py +++ b/src/opticalcentralizedattackdetector/service/OpticalCentralizedAttackDetectorServiceServicerImpl.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,13 +14,10 @@ import os, grpc, logging, random from influxdb import InfluxDBClient -from common.rpc_method_wrapper.Decorator import create_metrics, safe_and_metered_rpc_method +from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method from context.client.ContextClient import ContextClient -from context.Config import GRPC_SERVICE_PORT as CONTEXT_GRPC_SERVICE_PORT -from monitoring.client.monitoring_client import MonitoringClient -from monitoring.Config import GRPC_SERVICE_PORT as MONITORING_GRPC_SERVICE_PORT +from monitoring.client.MonitoringClient import MonitoringClient from service.client.ServiceClient import ServiceClient -from service.Config import GRPC_SERVICE_PORT as SERVICE_GRPC_SERVICE_PORT from dbscanserving.proto.dbscanserving_pb2 import DetectionRequest, DetectionResponse, Sample from dbscanserving.client.DbscanServingClient import DbscanServingClient from dbscanserving.Config import GRPC_SERVICE_PORT as DBSCANSERVING_GRPC_SERVICE_PORT @@ -35,26 +32,27 @@ from opticalcentralizedattackdetector.proto.monitoring_pb2 import KpiList from opticalcentralizedattackdetector.proto.optical_centralized_attack_detector_pb2_grpc import ( OpticalCentralizedAttackDetectorServiceServicer) from opticalcentralizedattackdetector.Config import ( - CONTEXT_SERVICE_ADDRESS, SERVICE_SERVICE_ADDRESS, INFERENCE_SERVICE_ADDRESS, MONITORING_SERVICE_ADDRESS, - ATTACK_MITIGATOR_SERVICE_ADDRESS) + INFERENCE_SERVICE_ADDRESS, MONITORING_SERVICE_ADDRESS, ATTACK_MITIGATOR_SERVICE_ADDRESS) LOGGER = logging.getLogger(__name__) -SERVICE_NAME = 'OpticalCentralizedAttackDetector' -METHOD_NAMES = ['NotifyServiceUpdate', 'DetectAttack', 'ReportSummarizedKpi', 'ReportKpi'] -METRICS = create_metrics(SERVICE_NAME, METHOD_NAMES) +METRICS_POOL = MetricsPool('OpticalCentralizedAttackDetector', 'RPC') INFLUXDB_HOSTNAME = os.environ.get("INFLUXDB_HOSTNAME") INFLUXDB_USER = os.environ.get("INFLUXDB_USER") INFLUXDB_PASSWORD = os.environ.get("INFLUXDB_PASSWORD") INFLUXDB_DATABASE = os.environ.get("INFLUXDB_DATABASE") -context_client: ContextClient = ContextClient(address=CONTEXT_SERVICE_ADDRESS, port=CONTEXT_GRPC_SERVICE_PORT) -influxdb_client: InfluxDBClient = InfluxDBClient(host=MONITORING_SERVICE_ADDRESS, port=8086, username=INFLUXDB_USER, password=INFLUXDB_PASSWORD, database=INFLUXDB_DATABASE) -monitoring_client: MonitoringClient = MonitoringClient(server=MONITORING_SERVICE_ADDRESS, port=MONITORING_GRPC_SERVICE_PORT) -dbscanserving_client: DbscanServingClient = DbscanServingClient(address=INFERENCE_SERVICE_ADDRESS, port=DBSCANSERVING_GRPC_SERVICE_PORT) -service_client: ServiceClient = ServiceClient(SERVICE_SERVICE_ADDRESS, SERVICE_GRPC_SERVICE_PORT) -attack_mitigator_client: OpticalAttackMitigatorClient = OpticalAttackMitigatorClient(address=ATTACK_MITIGATOR_SERVICE_ADDRESS, port=ATTACK_MITIGATOR_GRPC_SERVICE_PORT) +context_client: ContextClient = ContextClient() +influxdb_client: InfluxDBClient = InfluxDBClient( + host=MONITORING_SERVICE_ADDRESS, port=8086, username=INFLUXDB_USER, password=INFLUXDB_PASSWORD, + database=INFLUXDB_DATABASE) +monitoring_client: MonitoringClient = MonitoringClient() +dbscanserving_client: DbscanServingClient = DbscanServingClient( + address=INFERENCE_SERVICE_ADDRESS, port=DBSCANSERVING_GRPC_SERVICE_PORT) +service_client: ServiceClient = ServiceClient() +attack_mitigator_client: OpticalAttackMitigatorClient = OpticalAttackMitigatorClient( + address=ATTACK_MITIGATOR_SERVICE_ADDRESS, port=ATTACK_MITIGATOR_GRPC_SERVICE_PORT) class OpticalCentralizedAttackDetectorServiceServicerImpl(OpticalCentralizedAttackDetectorServiceServicer): @@ -63,11 +61,11 @@ class OpticalCentralizedAttackDetectorServiceServicerImpl(OpticalCentralizedAtta LOGGER.debug('Creating Servicer...') LOGGER.debug('Servicer Created') - @safe_and_metered_rpc_method(METRICS, LOGGER) + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def NotifyServiceUpdate(self, request : Service, context : grpc.ServicerContext) -> Empty: return Empty() - @safe_and_metered_rpc_method(METRICS, LOGGER) + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def DetectAttack(self, request : Empty, context : grpc.ServicerContext) -> Empty: # retrieve list with current contexts @@ -131,10 +129,10 @@ class OpticalCentralizedAttackDetectorServiceServicerImpl(OpticalCentralizedAtta # if attack is detected, run the attack mitigator return Empty() - @safe_and_metered_rpc_method(METRICS, LOGGER) + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def ReportSummarizedKpi(self, request : KpiList, context : grpc.ServicerContext) -> Empty: return Empty() - @safe_and_metered_rpc_method(METRICS, LOGGER) + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def ReportKpi(self, request : KpiList, context : grpc.ServicerContext) -> Empty: return Empty() diff --git a/src/opticalcentralizedattackdetector/service/__init__.py b/src/opticalcentralizedattackdetector/service/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/opticalcentralizedattackdetector/service/__init__.py +++ b/src/opticalcentralizedattackdetector/service/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/opticalcentralizedattackdetector/service/__main__.py b/src/opticalcentralizedattackdetector/service/__main__.py index d21b96cf8adc6f9d9968f3553c9249a3b8cedf31..89dfe277d1b642727cca1199e250153264aeb5c2 100644 --- a/src/opticalcentralizedattackdetector/service/__main__.py +++ b/src/opticalcentralizedattackdetector/service/__main__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/opticalcentralizedattackdetector/tests/__init__.py b/src/opticalcentralizedattackdetector/tests/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/opticalcentralizedattackdetector/tests/__init__.py +++ b/src/opticalcentralizedattackdetector/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/opticalcentralizedattackdetector/tests/example_objects.py b/src/opticalcentralizedattackdetector/tests/example_objects.py index 3c5a26b6d0bde888560741f052906e0d2694c91d..a6859bfb4defd4ccb9df318222237efb8e9cb036 100644 --- a/src/opticalcentralizedattackdetector/tests/example_objects.py +++ b/src/opticalcentralizedattackdetector/tests/example_objects.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ # limitations under the License. from copy import deepcopy -from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME from context.proto.context_pb2 import ( ConfigActionEnum, DeviceDriverEnum, DeviceOperationalStatusEnum, ServiceStatusEnum, ServiceTypeEnum) @@ -31,7 +31,7 @@ def endpoint(topology_id, device_id, endpoint_uuid, endpoint_type): return {'endpoint_id': endpoint_id(topology_id, device_id, endpoint_uuid), 'endpoint_type': endpoint_type} ## use "deepcopy" to prevent propagating forced changes during tests -CONTEXT_ID = {'context_uuid': {'uuid': DEFAULT_CONTEXT_UUID}} +CONTEXT_ID = {'context_uuid': {'uuid': DEFAULT_CONTEXT_NAME}} CONTEXT = { 'context_id': deepcopy(CONTEXT_ID), 'topology_ids': [], @@ -47,7 +47,7 @@ CONTEXT_2 = { TOPOLOGY_ID = { 'context_id': deepcopy(CONTEXT_ID), - 'topology_uuid': {'uuid': DEFAULT_TOPOLOGY_UUID}, + 'topology_uuid': {'uuid': DEFAULT_TOPOLOGY_NAME}, } TOPOLOGY = { 'topology_id': deepcopy(TOPOLOGY_ID), diff --git a/src/opticalcentralizedattackdetector/tests/test_unitary.py b/src/opticalcentralizedattackdetector/tests/test_unitary.py index da0f4ca9f78478073354d8645cf0b455a5f7a874..d89ef2fe27a7d284b655698e7ee89e79b230b04b 100644 --- a/src/opticalcentralizedattackdetector/tests/test_unitary.py +++ b/src/opticalcentralizedattackdetector/tests/test_unitary.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/pathcomp/.gitignore b/src/pathcomp/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..48a680bf0f45eb556108c349bc45be896f4219aa --- /dev/null +++ b/src/pathcomp/.gitignore @@ -0,0 +1 @@ +backend/wireshark diff --git a/src/pathcomp/.gitlab-ci.yml b/src/pathcomp/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..20ec4e728837b87e061b2ecffa4b7549c658258f --- /dev/null +++ b/src/pathcomp/.gitlab-ci.yml @@ -0,0 +1,189 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Build, tag, and push the Docker image to the GitLab Docker registry +build pathcomp: + variables: + IMAGE_NAME: 'pathcomp' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: build + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + script: + # This first build tags the builder resulting image to prevent being removed by dangling image removal command + - docker build -t "${IMAGE_NAME}-backend:${IMAGE_TAG}-builder" --target builder -f ./src/$IMAGE_NAME/backend/Dockerfile . + - docker build -t "${IMAGE_NAME}-backend:$IMAGE_TAG" -f ./src/$IMAGE_NAME/backend/Dockerfile . + - docker build -t "${IMAGE_NAME}-frontend:$IMAGE_TAG" -f ./src/$IMAGE_NAME/frontend/Dockerfile . + - docker tag "${IMAGE_NAME}-backend:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-backend:$IMAGE_TAG" + - docker tag "${IMAGE_NAME}-frontend:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-frontend:$IMAGE_TAG" + - docker push "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-backend:$IMAGE_TAG" + - docker push "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-frontend:$IMAGE_TAG" + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/.gitlab-ci.yml + - src/$IMAGE_NAME/backend/**/*.{c,h,conf} + - src/$IMAGE_NAME/backend/Makefile + - src/$IMAGE_NAME/backend/Dockerfile + - src/$IMAGE_NAME/frontend/**/*.{py,in,yml} + - src/$IMAGE_NAME/frontend/Dockerfile + - src/$IMAGE_NAME/frontend/tests/*.py + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml + +# Apply unit test to the component +unit_test pathcomp-backend: + variables: + IMAGE_NAME: 'pathcomp' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: unit_test + needs: + - build pathcomp + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi + - if docker container ls | grep ${IMAGE_NAME}-frontend; then docker rm -f ${IMAGE_NAME}-frontend; else echo "${IMAGE_NAME}-frontend image is not in the system"; fi + - if docker container ls | grep ${IMAGE_NAME}-backend; then docker rm -f ${IMAGE_NAME}-backend; else echo "${IMAGE_NAME}-backend image is not in the system"; fi + script: + - docker pull "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-backend:$IMAGE_TAG" + - docker ps -a + #- docker run --name ${IMAGE_NAME}-backend -d -p 8081:8081 -v "$PWD/src/${IMAGE_NAME}/backend/tests:/opt/results" --network=teraflowbridge ${IMAGE_NAME}-backend:${IMAGE_TAG}-builder + - docker run --name ${IMAGE_NAME}-backend -d -p 8081:8081 --network=teraflowbridge ${IMAGE_NAME}-backend:${IMAGE_TAG}-builder + - sleep 5 + - docker ps -a + - docker logs ${IMAGE_NAME}-backend + - docker exec -i ${IMAGE_NAME}-backend bash -c "curl -0 -v -X POST -H 'Expect:' -H 'Content-Type:\ application/json' http://127.0.0.1:8081/pathComp/api/v1/compRoute -d @/var/teraflow/tests/pc-req.json" + - docker kill --signal=SIGUSR1 pathcomp-backend + - docker exec -i ${IMAGE_NAME}-backend bash -c "gcovr" + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' + after_script: + - docker logs ${IMAGE_NAME}-backend + - docker rm -f ${IMAGE_NAME}-backend + - docker network rm teraflowbridge + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/.gitlab-ci.yml + - src/$IMAGE_NAME/backend/**/*.{c,h,conf} + - src/$IMAGE_NAME/backend/Makefile + - src/$IMAGE_NAME/backend/Dockerfile + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml + #artifacts: + # when: always + # reports: + # junit: src/$IMAGE_NAME/backend/tests/${IMAGE_NAME}-backend_report.xml + +# Apply unit test to the component +unit_test pathcomp-frontend: + variables: + IMAGE_NAME: 'pathcomp' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: unit_test + needs: + - build pathcomp + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create --driver=bridge teraflowbridge; fi + - if docker container ls | grep ${IMAGE_NAME}-frontend; then docker rm -f ${IMAGE_NAME}-frontend; else echo "${IMAGE_NAME}-frontend image is not in the system"; fi + - if docker container ls | grep ${IMAGE_NAME}-backend; then docker rm -f ${IMAGE_NAME}-backend; else echo "${IMAGE_NAME}-backend image is not in the system"; fi + script: + - docker pull "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-frontend:$IMAGE_TAG" + - docker pull "$CI_REGISTRY_IMAGE/${IMAGE_NAME}-backend:$IMAGE_TAG" + - > + docker run --name ${IMAGE_NAME}-backend -d -p 8081:8081 --network=teraflowbridge + --volume "$PWD/src/${IMAGE_NAME}/backend/tests:/opt/results" + $CI_REGISTRY_IMAGE/${IMAGE_NAME}-backend:$IMAGE_TAG + - PATHCOMP_BACKEND_HOST=$(docker inspect ${IMAGE_NAME}-backend --format "{{.NetworkSettings.Networks.teraflowbridge.IPAddress}}") + - echo $PATHCOMP_BACKEND_HOST + - sleep 1 + - > + docker run --name ${IMAGE_NAME}-frontend -d -p 10020:10020 --network=teraflowbridge + --volume "$PWD/src/${IMAGE_NAME}/frontend/tests:/opt/results" + --env "PATHCOMP_BACKEND_HOST=${PATHCOMP_BACKEND_HOST}" + --env "PATHCOMP_BACKEND_PORT=8081" + $CI_REGISTRY_IMAGE/${IMAGE_NAME}-frontend:$IMAGE_TAG + - sleep 1 + - docker exec -i ${IMAGE_NAME}-frontend bash -c "env" + - docker exec -i ${IMAGE_NAME}-backend bash -c "env" + - sleep 5 + - docker ps -a + - docker logs ${IMAGE_NAME}-frontend + - docker logs ${IMAGE_NAME}-backend + - > + docker exec -i ${IMAGE_NAME}-frontend bash -c + "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/frontend/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}-frontend_report.xml" + - docker exec -i ${IMAGE_NAME}-frontend bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' + after_script: + - docker ps -a + - docker logs ${IMAGE_NAME}-frontend + - docker logs ${IMAGE_NAME}-backend + - docker rm -f ${IMAGE_NAME}-frontend + - docker rm -f ${IMAGE_NAME}-backend + - docker network rm teraflowbridge + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/.gitlab-ci.yml + - src/$IMAGE_NAME/frontend/**/*.{py,in,yml} + - src/$IMAGE_NAME/frontend/Dockerfile + - src/$IMAGE_NAME/frontend/tests/*.py + - src/$IMAGE_NAME/backend/**/*.{c,h,conf} + - src/$IMAGE_NAME/backend/Makefile + - src/$IMAGE_NAME/backend/Dockerfile + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml + artifacts: + when: always + reports: + junit: src/$IMAGE_NAME/frontend/tests/${IMAGE_NAME}-frontend_report.xml + +## Deployment of the service in Kubernetes Cluster +#deploy pathcomp: +# variables: +# IMAGE_NAME: 'pathcomp' # name of the microservice +# IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) +# stage: deploy +# needs: +# - unit test pathcomp-backend +# - unit test pathcomp-frontend +# # - integ_test execute +# script: +# - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' +# - kubectl version +# - kubectl get all +# - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" +# - kubectl get all +# # environment: +# # name: test +# # url: https://example.com +# # kubernetes: +# # namespace: test +# rules: +# - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' +# when: manual +# - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' +# when: manual diff --git a/src/pathcomp/__init__.py b/src/pathcomp/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf --- /dev/null +++ b/src/pathcomp/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/src/pathcomp/backend/Dockerfile b/src/pathcomp/backend/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..bbe5adc26c4b2b98d3efaaf4d13415f7487d5fa1 --- /dev/null +++ b/src/pathcomp/backend/Dockerfile @@ -0,0 +1,74 @@ +# 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. + +# Multi-stage Docker image build + +# Stage 1 +FROM ubuntu:20.04 AS builder +ARG DEBIAN_FRONTEND=noninteractive + +# Install build software +RUN apt-get update -y && apt-get install build-essential curl gcovr libglib2.0-dev -y +RUN apt-get install valgrind -y + +# mkdir +RUN mkdir -p /var/teraflow + +# Define working directory +WORKDIR /var/teraflow + +# Copy every file in working directory +COPY src/pathcomp/backend/. ./ + +# Build release version and move it to bin folder +RUN make release +RUN mkdir /var/teraflow/bin +RUN mv pathComp /var/teraflow/bin + +# Build code coverage version +RUN make clean +RUN make coverage +#RUN make debug + +EXPOSE 8081 + +# builder defines coverage version of pathcomp by default +# coverage entrypoint: +ENTRYPOINT [ "./pathComp-cvr", "config/pathcomp.conf", "screen_only" ] +# debug entrypoint: +#ENTRYPOINT [ "./pathComp-dbg", "config/pathcomp.conf", "screen_only" ] +# debug entrypoint with memory tracking: +#ENTRYPOINT [ "valgrind", "--leak-check=full", "--show-leak-kinds=all", "--track-origins=yes", "--show-error-list=yes", "./pathComp-dbg", "config/pathcomp.conf", "screen_only" ] + + +# Stage 2 +FROM ubuntu:20.04 AS release +ARG DEBIAN_FRONTEND=noninteractive + +# Install build software +RUN apt-get update -y && apt-get install curl libglib2.0-bin -y + +# mkdir +RUN mkdir -p /var/teraflow/config + +# Define working directory +WORKDIR /var/teraflow + +# We make four distinct layers so if there are application changes the library layers can be re-used +COPY --from=builder /var/teraflow/bin/pathComp . +COPY --from=builder /var/teraflow/config/pathcomp.conf ./config +COPY --from=builder /var/teraflow/tests/. ./tests + +# release entrypoint: +ENTRYPOINT [ "./pathComp", "config/pathcomp.conf", "screen_only" ] diff --git a/src/pathcomp/backend/Dockerfile-gdb b/src/pathcomp/backend/Dockerfile-gdb new file mode 100644 index 0000000000000000000000000000000000000000..c505022e3180a1d182d7a3fbc43c57a1be19dea2 --- /dev/null +++ b/src/pathcomp/backend/Dockerfile-gdb @@ -0,0 +1,37 @@ +# 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. + +# Multi-stage Docker image build + +# Stage 1 +FROM ubuntu:20.04 AS builder +ARG DEBIAN_FRONTEND=noninteractive + +# Install build software +RUN apt-get update -y && apt-get install build-essential libglib2.0-dev -y +RUN apt-get install gdb gdbserver -y + +# mkdir +RUN mkdir -p /var/teraflow + +# Define working directory +WORKDIR /var/teraflow + +# Copy every file in working directory +COPY src/pathcomp/backend/. ./ +RUN make + +EXPOSE 8081 + +ENTRYPOINT [ "gdb", "--args", "./pathComp", "config/pathcomp.conf", "screen_only" ] diff --git a/src/pathcomp/backend/Makefile b/src/pathcomp/backend/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..058701098308620cd1a71f3718b934c63646d42a --- /dev/null +++ b/src/pathcomp/backend/Makefile @@ -0,0 +1,67 @@ +# 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. + +CC = gcc +CFLAGS = -I. -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include/ +LDLIBS = -lm +LDFLAGS = + +all: pathComp + +release: CFLAGS += -O6 -Wall -DPOSIX_SOURCE +release: pathComp + +debug: CFLAGS += -O0 -ggdb -g -DDEBUG +debug: LDFLAGS += -g +debug: pathComp-dbg + +coverage: CFLAGS += -O0 -ggdb -g -DDEBUG -fprofile-arcs -ftest-coverage -DGCOV +coverage: LDFLAGS += -g -lgcov --coverage -fprofile-arcs -ftest-coverage -DGCOV +coverage: pathComp-cvr + +pathComp: pathComp.o pathComp_log.o pathComp_cjson.o pathComp_tools.o pathComp_ksp.o pathComp_sp.o pathComp_RESTapi.o + gcc -o pathComp pathComp.o pathComp_log.o pathComp_cjson.o pathComp_tools.o pathComp_ksp.o pathComp_sp.o pathComp_RESTapi.o \ + -L/usr/lib/x86_64-linux-gnu/ -lglib-2.0 -luuid $(LDFLAGS) $(LDLIBS) + +pathComp-dbg: pathComp.o pathComp_log.o pathComp_cjson.o pathComp_tools.o pathComp_ksp.o pathComp_sp.o pathComp_RESTapi.o + gcc -o pathComp-dbg pathComp.o pathComp_log.o pathComp_cjson.o pathComp_tools.o pathComp_ksp.o pathComp_sp.o pathComp_RESTapi.o \ + -L/usr/lib/x86_64-linux-gnu/ -lglib-2.0 -luuid $(LDFLAGS) $(LDLIBS) + +pathComp-cvr: pathComp.o pathComp_log.o pathComp_cjson.o pathComp_tools.o pathComp_ksp.o pathComp_sp.o pathComp_RESTapi.o + gcc -o pathComp-cvr pathComp.o pathComp_log.o pathComp_cjson.o pathComp_tools.o pathComp_ksp.o pathComp_sp.o pathComp_RESTapi.o \ + -L/usr/lib/x86_64-linux-gnu/ -lglib-2.0 -luuid $(LDFLAGS) $(LDLIBS) + +pathComp_log.o: pathComp_log.h pathComp_log.c + $(CC) $(CFLAGS) -c pathComp_log.c -o pathComp_log.o + +pathComp_cjson.o: pathComp_log.h pathComp_cjson.h pathComp_cjson.c + $(CC) $(CFLAGS) -c pathComp_cjson.c -o pathComp_cjson.o + +pathComp_tools.o: pathComp_log.h pathComp_tools.h pathComp_tools.c + $(CC) $(CFLAGS) -c pathComp_tools.c -o pathComp_tools.o + +pathComp_ksp.o: pathComp_log.h pathComp_tools.h pathComp_ksp.h pathComp_ksp.c + $(CC) $(CFLAGS) -c pathComp_ksp.c -o pathComp_ksp.o + +pathComp_sp.o: pathComp_log.h pathComp_tools.h pathComp_sp.h pathComp_sp.c + $(CC) $(CFLAGS) -c pathComp_sp.c -o pathComp_sp.o + +pathComp_RESTapi.o: pathComp_tools.h pathComp_log.h pathComp_cjson.h pathComp_ksp.h pathComp_sp.h pathComp_RESTapi.h pathComp_RESTapi.c + $(CC) $(CFLAGS) -c pathComp_RESTapi.c -o pathComp_RESTapi.o + +pathComp.o: pathComp_log.h pathComp_RESTapi.h pathComp.c pathComp.h + $(CC) $(CFLAGS) -c pathComp.c -o pathComp.o + +clean: + rm -f *.o *.gcno *.gcda *.gcov *.log pathComp pathComp-dbg pathComp-cvr diff --git a/src/pathcomp/backend/config/pathcomp.conf b/src/pathcomp/backend/config/pathcomp.conf new file mode 100644 index 0000000000000000000000000000000000000000..cd4e677e97fd7c70b74e687fa13e776d47b4d8fb --- /dev/null +++ b/src/pathcomp/backend/config/pathcomp.conf @@ -0,0 +1,2 @@ +PATHCOMP_IP_ADDR 0.0.0.0 +RESTAPI 1 \ No newline at end of file diff --git a/src/pathcomp/backend/pathComp.c b/src/pathcomp/backend/pathComp.c new file mode 100644 index 0000000000000000000000000000000000000000..aa6c2b7341862a0115581abee7f977edabe93126 --- /dev/null +++ b/src/pathcomp/backend/pathComp.c @@ -0,0 +1,187 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef GCOV +// Instrumentation to report code coverage live +// Ref: https://www.osadl.org/fileadmin/dam/interface/docbook/howtos/coverage.pdf +#include + +// Code coverage flush method; used to update code coverage reports while the server is running +void __gcov_flush(void); /* check in gcc sources gcc/gcov-io.h for the prototype */ + +void my_gcov_handler(int signum) +{ + printf("signal received: running __gcov_flush()\n"); + __gcov_flush(); /* dump coverage data on receiving SIGUSR1 */ +} +#endif + +#include "pathComp_log.h" +#include "pathComp_RESTapi.h" +#include "pathComp.h" + +// External Variables +FILE *logfile = NULL; + +// PATH COMP IP address API Client +struct in_addr pathComp_IpAddr; + +// REST API ENABLED +int RESTAPI_ENABLED = 0; + +GMainLoop * loop = NULL; + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp.c + * @brief Read the pathComp.conf file @ /etc/pathComp/ + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void read_pathComp_config_file(FILE *fp) +{ + DEBUG_PC ("Processing pathComp.conf"); + + char buff[128], ip[128]; + + // READ PATH COMP SERVER IP + memset (&pathComp_IpAddr, (int)0, sizeof (struct in_addr)); + fscanf(fp, "%s %s ", buff, ip); + pathComp_IpAddr.s_addr = inet_addr(ip); + DEBUG_PC("pathComp_IpAddr: %s", inet_ntoa (pathComp_IpAddr)); + memset (buff, 0, sizeof (buff)); + + // Read REST API + fscanf (fp, "%s %d ", buff, &RESTAPI_ENABLED); + if (RESTAPI_ENABLED) DEBUG_PC ("REST API: ON"); + if (RESTAPI_ENABLED == 0) DEBUG_PC ("REST API: OFF"); + + memset (buff, 0, sizeof (buff)); + DEBUG_PC ("CommandLine: %s", buff); + + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp.c + * @brief Main function for pathComp server + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +int main(int argc, char *argv[]) +{ + #ifdef GCOV + struct sigaction new_action, old_action; + /* setup signal hander */ + new_action.sa_handler = my_gcov_handler; + sigemptyset(&new_action.sa_mask); + new_action.sa_flags = 0; + sigaction(SIGUSR1, NULL, &old_action); + if (old_action.sa_handler != SIG_IGN) + sigaction (SIGUSR1, &new_action, NULL); + #endif + + DEBUG_PC ("********************************************************************"); + DEBUG_PC ("********************************************************************"); + DEBUG_PC (" ---------------------- Path Computation Server---------------------"); + DEBUG_PC ("********************************************************************"); + DEBUG_PC ("********************************************************************"); + + // processing input parameters + if (argc == 1) + { + DEBUG_PC ("Arguments are missing ..."); + exit (-1); + } + + // argv[1] specifies the folder and the configuration file + gchar configFile[50]; + strcpy (configFile, argv[1]); + DEBUG_PC ("Path Computation Server Config File is: %s", configFile); + + // argv[2] specifies the folder and the log file + gchar log[50]; + strcpy (log, argv[2]); + gint screen = strcmp(log, "screen_only"); + if (screen == 0) { + DEBUG_PC("All logs shown through stdout, i.e.,screen"); + logfile = NULL; + } + else { + DEBUG_PC("PATH COMP log File: %s", log); + // open the log file + logfile = fopen(log, "w"); + DEBUG_PC("log file is opened"); + } + + // Read the pathComp.conf file + FILE *pathComp_config = NULL; + pathComp_config = fopen (configFile, "r"); + if (pathComp_config == NULL) + { + DEBUG_PC ("File error\n"); + exit (-1); + } + DEBUG_PC ("pathComp_config.conf is opened"); + + // Check if flag -d for daemonize + if (argc > 3) + { + gchar options[10]; + strcpy (options, argv[3]); + gint ret = strcmp (options, "-d"); + if (ret == 0) daemon(0,0); + } + + // Process the config file + read_pathComp_config_file (pathComp_config); + + DEBUG_PC ("\n ---- PATH COMP MAIN LOOP ------"); + /** Creates a new GMainLoop structure */ + loop = g_main_loop_new (NULL, FALSE); + + // Iff RESTAPI_ENABLED is ON + if (RESTAPI_ENABLED) + { + RESTapi_init(PATH_COMP_PORT); + } + + /** execute loop */ + g_main_loop_run (loop); + + /** decrease the one reference of loop when it is finished */ + g_main_loop_unref(loop); + loop = NULL; + return 0; +} diff --git a/src/pathcomp/backend/pathComp.h b/src/pathcomp/backend/pathComp.h new file mode 100644 index 0000000000000000000000000000000000000000..decded67e9e760c4e4905691f2c1ce834f27eb38 --- /dev/null +++ b/src/pathcomp/backend/pathComp.h @@ -0,0 +1,35 @@ +/* + * 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. + */ + +#ifndef _PATHCOMP_H +#define _PATHCOMP_H + +#include +#include +#include + +/////////////////////////////////////////////////// +// IP addressing of peer functional entities +/////////////////////////////////////////////////// +extern struct in_addr pathComp_IpAddr; + +// TCP Port for the REST API communication with the PATH COMP process +#define PATH_COMP_PORT 8081 + +// External Variables +extern GMainLoop * loop; + +#endif \ No newline at end of file diff --git a/src/pathcomp/backend/pathComp_RESTapi.c b/src/pathcomp/backend/pathComp_RESTapi.c new file mode 100644 index 0000000000000000000000000000000000000000..8ee7f6d82537b7eab297334a0a0dcfad13f8af44 --- /dev/null +++ b/src/pathcomp/backend/pathComp_RESTapi.c @@ -0,0 +1,1998 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pathComp_log.h" +#include "pathComp_tools.h" +#include "pathComp_cjson.h" +#include "pathComp_ksp.h" +#include "pathComp_sp.h" +#include "pathComp_RESTapi.h" + +#define ISspace(x) isspace((int)(x)) + +#define SERVER_STRING "Server: PATHCOMP/0.1.0\r\n" + +// List of Clients connected to the PATH COMP +GList *RESTapi_tcp_client_list = NULL; + +// Id for CLient HTTP (REST API) Connection +guint CLIENT_ID = 0; +guint32 paId_req = 0; + +// Global variables +struct linkList_t* linkList; +struct deviceList_t* deviceList; +struct serviceList_t* serviceList; + +gchar algId[MAX_ALG_ID_LENGTH]; +gboolean syncPath = FALSE; + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Seek a connected tcp client by its fd in the RESTapi_tcp_client_list + * + * @param data + * @param userdata + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +gint find_rl_client_by_fd (gconstpointer data, gconstpointer userdata) +{ + /** check values */ + g_assert(data != NULL); + g_assert(userdata != NULL); + + struct pathComp_client *client = (struct pathComp_client*)data; + gint fd = *(gint *)userdata; + + if (client->fd == fd) + return 0; + return -1; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used to send a message to the corresponding channel + * + * @param source + * @param buf + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +gint rapi_send_message (GIOChannel *channel, char *buf) { + gsize nbytes, buffersize; + + //DEBUG_PC ("Msg prepared to be sent REST API RESPONSE "); + gint len = strlen ((const char*) buf); + //DEBUG_PC ("Targeted Length of the buffer: %d", len); + + buffersize = g_io_channel_get_buffer_size (channel); + //DEBUG_PC ("GIOChannel with Buffer Size: %d", (gint)buffersize); + + gsize newBufferSize = MAX_GIO_CHANNEL_BUFFER_SIZE; + g_io_channel_set_buffer_size (channel, newBufferSize); + + buffersize = g_io_channel_get_buffer_size (channel); + //DEBUG_PC ("GIOChannel with Buffer Size: %d", (gint)buffersize); + + /** Send message. */ + GError *error = NULL; + + char *ptr = buf; + gint nleft = strlen ((const char *)buf); + + while (nleft > 0) { + g_io_channel_write_chars (channel, (void *)ptr, nleft, &nbytes, &error); + if (error) { + DEBUG_PC ("Error sending the message to TCP Client"); + return (-1); + } + + //DEBUG_PC ("Sent %d bytes", (gint)nbytes); + nleft = nleft - nbytes; + //DEBUG_PC ("Remaining to be sent %d", nleft); + ptr += nbytes; + } + DEBUG_PC("RESPONSE MSG SENT"); + return 0; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used to return when something goes wrong when processing the REST API Command + * + * @param source + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void RESTapi_unimplemented (GIOChannel *source) +{ + gint ret = 0; + guchar buftmp[1024]; + char *buf = g_malloc0 (sizeof (char) * 2048000); + sprintf((char *)buf, "HTTP/1.1 400 Bad request\r\n"); + + sprintf((char *)buftmp, SERVER_STRING); + strcat ((char *)buf, (const char *)buftmp); + + sprintf((char *)buftmp, "Content-Type: text/plain\r\n"); + strcat ((char *)buf, (const char *)buftmp); + + sprintf((char *)buftmp, "\r\n"); + strcat ((char *)buf, (const char *)buftmp); + + sprintf((char *)buftmp, "Method Not Implemented\r\n"); + strcat ((char *)buf, (const char *)buftmp); + + sprintf((char *)buftmp, "\r\n"); + strcat ((char *)buf, (const char *)buftmp); + + sprintf((char *)buftmp, "

HTTP request method not supported.\r\n"); + strcat ((char *)buf, (const char *)buftmp); + + sprintf((char *)buftmp, "\r\n"); + strcat ((char *)buf, (const char *)buftmp); + + ret = rapi_send_message (source, buf); + g_free (buf); + (void)ret; + + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used to put in the buffer the date according to RFC 1123 + * + * @param date + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void rapi_add_date_header (char *date) +{ + static const char *DAYS[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; + static const char *MONTHS[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; + + time_t t = time(NULL); + struct tm *tm = NULL; + struct tm sys; + gmtime_r(&t, &sys); + tm = &sys; + + sprintf((char *)date, "DATE: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n", DAYS[tm->tm_wday], tm->tm_mday, + MONTHS[tm->tm_mon], 1900 + tm->tm_year, + tm->tm_hour, tm->tm_min, tm->tm_sec); + + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used to add DeviceId and EndpointId forming the computed path + * + * @param pathObj + * @param p + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void add_comp_path_deviceId_endpointId_json(cJSON* pathObj, struct path_t* p, struct compRouteOutput_t* oElem) { + g_assert(p); + g_assert(pathObj); + + // add array for the devideId and endpointIds + cJSON* devicesArray = cJSON_CreateArray(); + cJSON_AddItemToObject(pathObj, "devices", devicesArray); + + // Add the source endpoint + cJSON* sEndPointIdObj; + cJSON_AddItemToArray(devicesArray, sEndPointIdObj = cJSON_CreateObject()); + // Add the topology Id Object containing the topology uuid and context uuid + cJSON* stopIdObj; + cJSON_AddItemToObject(sEndPointIdObj, "topology_id", stopIdObj = cJSON_CreateObject()); + cJSON_AddItemToObject(stopIdObj, "contextId", cJSON_CreateString(oElem->service_endpoints_id[0].topology_id.contextId)); + cJSON_AddItemToObject(stopIdObj, "topology_uuid", cJSON_CreateString(oElem->service_endpoints_id[0].topology_id.topology_uuid)); + + // Add the device Id (uuid) + cJSON_AddItemToObject(sEndPointIdObj, "device_id", cJSON_CreateString(oElem->service_endpoints_id[0].device_uuid)); + // Add the endpoint Id (uuid) + cJSON_AddItemToObject(sEndPointIdObj, "endpoint_uuid", cJSON_CreateString(oElem->service_endpoints_id[0].endpoint_uuid)); + + + for (gint i = 0; i < p->numPathLinks; i++) { + struct pathLink_t* pL = &(p->pathLinks[i]); + cJSON* dElemObj; // Device Element Object of the array + cJSON_AddItemToArray(devicesArray, dElemObj = cJSON_CreateObject()); + + // Add the topologyId with the topologyuuid and contextId + cJSON* tIdObj; + cJSON_AddItemToObject(dElemObj, "topology_id", tIdObj = cJSON_CreateObject()); + cJSON_AddItemToObject(tIdObj, "contextId", cJSON_CreateString(pL->topologyId.contextId)); + cJSON_AddItemToObject(tIdObj, "topology_uuid", cJSON_CreateString(pL->topologyId.topology_uuid)); + + // Add Device Id + cJSON_AddItemToObject(dElemObj, "device_id", cJSON_CreateString(pL->aDeviceId)); + + // Add endpoint Id + cJSON_AddItemToObject(dElemObj, "endpoint_uuid", cJSON_CreateString(pL->aEndPointId)); + } + + // Add the sink endpoint + cJSON* sinkEndPointIdObj; + cJSON_AddItemToArray(devicesArray, sinkEndPointIdObj = cJSON_CreateObject()); + // Add the topology Id Object containing the topology uuid and context uuid + cJSON* sinkTopIdObj; + cJSON_AddItemToObject(sinkEndPointIdObj, "topology_id", sinkTopIdObj = cJSON_CreateObject()); + cJSON_AddItemToObject(sinkTopIdObj, "contextId", cJSON_CreateString(oElem->service_endpoints_id[1].topology_id.contextId)); + cJSON_AddItemToObject(sinkTopIdObj, "topology_uuid", cJSON_CreateString(oElem->service_endpoints_id[1].topology_id.topology_uuid)); + + // Add the device Id (uuid) + cJSON_AddItemToObject(sinkEndPointIdObj, "device_id", cJSON_CreateString(oElem->service_endpoints_id[1].device_uuid)); + // Add the endpoint Id (uuid) + cJSON_AddItemToObject(sinkEndPointIdObj, "endpoint_uuid", cJSON_CreateString(oElem->service_endpoints_id[1].endpoint_uuid)); + + return; +} + + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used to add the links forming the computed path + * + * @param pathObj + * @param p + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void add_comp_path_link_json(cJSON* pathObj, struct path_t* p) { + g_assert(p); + g_assert(pathObj); + + // Add array for the links + cJSON* linkArray = cJSON_CreateArray(); + cJSON_AddItemToObject(pathObj, "link", linkArray); + + for (gint i = 0; i < p->numPathLinks; i++) { + struct pathLink_t* pL = &(p->pathLinks[i]); + cJSON* lElemObj; // Link Element Object of the array + cJSON_AddItemToArray(linkArray, lElemObj = cJSON_CreateObject()); + + // Add link Id + cJSON_AddItemToObject(lElemObj, "link_Id", cJSON_CreateString(pL->linkId)); + + // Add link topologies + cJSON* linkTopoArray = cJSON_CreateArray(); + cJSON_AddItemToObject(lElemObj, "topology", linkTopoArray); + + for (gint j = 0; j < pL->numLinkTopologies; j++) { + struct linkTopology_t* linkTopo = &(pL->linkTopologies[j]); + cJSON* lTopoElemObj; + cJSON_AddItemToArray(linkTopoArray, lTopoElemObj = cJSON_CreateObject()); + cJSON_AddItemToObject(lTopoElemObj, "topology_uuid", cJSON_CreateString(linkTopo->topologyId)); + } + } + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Compose the JSON Body of the succesfully network connectivity service + * + * @param body + * @param length + * @param compRouteOutputList + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void rapi_response_json_contents (char *body, gint *length, struct compRouteOutputList_t *compRouteOutputList) +{ + char *buftmp; + cJSON *root = cJSON_CreateObject(); + DEBUG_PC ("Creating the JSON body of the response"); + + // Create response-list array + cJSON *responseListArray = cJSON_CreateArray(); + cJSON_AddItemToObject(root, "response-list", responseListArray); + + // Add computed routes to the response-list + for (gint i = 0; i < compRouteOutputList->numCompRouteConnList; i++) { + struct compRouteOutput_t *oElem = &(compRouteOutputList->compRouteConnection[i]); // reference to output element from the list of computed routes + cJSON *oElemObj; + cJSON_AddItemToArray (responseListArray, oElemObj = cJSON_CreateObject()); + + // Add the service Id Object + cJSON* servIdObj; + cJSON_AddItemToObject(oElemObj, "serviceId", servIdObj = cJSON_CreateObject()); + cJSON_AddItemToObject(servIdObj, "contextId", cJSON_CreateString(oElem->serviceId.contextId)); + cJSON_AddItemToObject(servIdObj, "service_uuid", cJSON_CreateString(oElem->serviceId.service_uuid)); + + // Add the service endpoints ids array + cJSON* sEndpointIdsArray = cJSON_CreateArray(); + cJSON_AddItemToObject(oElemObj, "service_endpoints_ids", sEndpointIdsArray); + + for (gint j = 0; j < oElem->num_service_endpoints_id; j++) { + //DEBUG_PC("parsing service endpoints ids"); + //DEBUG_PC("endpoint: %s [%s]", oElem->service_endpoints_id[j].device_uuid, oElem->service_endpoints_id[j].endpoint_uuid); + //struct service_endpoints_id_t* sEndPointId = &(oElem->service_endpoints_id[j]); + cJSON* sEndPointIdObj; + cJSON_AddItemToArray(sEndpointIdsArray, sEndPointIdObj = cJSON_CreateObject()); + // Add the topology Id Object containing the topology uuid and context uuid + cJSON* topIdObj; + cJSON_AddItemToObject(sEndPointIdObj, "topology_id", topIdObj = cJSON_CreateObject()); + cJSON_AddItemToObject(topIdObj, "contextId", cJSON_CreateString(oElem->service_endpoints_id[j].topology_id.contextId)); + cJSON_AddItemToObject(topIdObj, "topology_uuid", cJSON_CreateString(oElem->service_endpoints_id[j].topology_id.topology_uuid)); + + // Add the device Id (uuid) + cJSON_AddItemToObject(sEndPointIdObj, "device_id", cJSON_CreateString(oElem->service_endpoints_id[j].device_uuid)); + // Add the endpoint Id (uuid) + cJSON_AddItemToObject(sEndPointIdObj, "endpoint_uuid", cJSON_CreateString(oElem->service_endpoints_id[j].endpoint_uuid)); + } + // Add no path issue + if (oElem->noPathIssue == NO_PATH_CONS_ISSUE) { // Error on finding the route, e.g., no feasible path + DEBUG_PC("NO PATH FOUND, AN ISSUE OCCURRED: %d", oElem->noPathIssue); + cJSON* noPathObj; + cJSON_AddItemToObject(oElemObj, "noPath", noPathObj = cJSON_CreateObject()); + char str[5]; + sprintf(str, "%d", oElem->noPathIssue); + cJSON_AddItemToObject(noPathObj, "issue", cJSON_CreateString(str)); + continue; + } + + // Create the array to parse the computed path from the oElemObj + cJSON* pathArray = cJSON_CreateArray(); + cJSON_AddItemToObject(oElemObj, "path", pathArray); + for (gint k = 0; k < oElem->numPaths; k++) { + struct path_t* p = &(oElem->paths[k]); + cJSON* pathObj; + cJSON_AddItemToArray(pathArray, pathObj = cJSON_CreateObject()); + + // Add path capacity + cJSON* pathCapObj; + cJSON_AddItemToObject(pathObj, "path-capacity", pathCapObj = cJSON_CreateObject()); + cJSON* totalSizeObj; + cJSON_AddItemToObject(pathCapObj, "total-size", totalSizeObj = cJSON_CreateObject()); + cJSON_AddItemToObject(totalSizeObj, "value", cJSON_CreateNumber(p->path_capacity.value)); + cJSON_AddItemToObject(totalSizeObj, "unit", cJSON_CreateNumber(p->path_capacity.unit)); + + // Add path latency + cJSON* pathLatObj; + char lat[16]; + sprintf(lat, "%lf", p->path_latency.fixed_latency); + cJSON_AddItemToObject(pathObj, "path-latency", pathLatObj= cJSON_CreateObject()); + cJSON_AddItemToObject(pathLatObj, "fixed-latency-characteristic", cJSON_CreateString(lat)); + + // Add path cost + cJSON* pathCostObj; + cJSON_AddItemToObject(pathObj, "path-cost", pathCostObj = cJSON_CreateObject()); + cJSON_AddItemToObject(pathCostObj, "cost-name", cJSON_CreateString(p->path_cost.cost_name)); + char value[16]; + sprintf(value, "%lf", p->path_cost.cost_value); + cJSON_AddItemToObject(pathCostObj, "cost-value", cJSON_CreateString(value)); + char algorithm[16]; + sprintf(algorithm, "%lf", p->path_cost.cost_algorithm); + cJSON_AddItemToObject(pathCostObj, "cost-algorithm", cJSON_CreateString(algorithm)); + + // Add the links + //add_comp_path_link_json(pathObj, p); + // Add deviceId, endpointId + add_comp_path_deviceId_endpointId_json(pathObj, p, oElem); + } + } + + //DEBUG_PC ("JSON Body Response DONE"); + buftmp = (char *)cJSON_Print(root); + strcat (body, (const char*) buftmp); + *length = strlen ((const char*)body); + //DEBUG_PC ("JSON Body (length: %d)", *length); + //DEBUG_PC ("%s", body); + cJSON_Delete (root); + g_free(buftmp); + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used to return response OK via REST API with the computed serviceId + * + * @param source + * @param httpCode + * @param compRouteOutputList + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void rapi_response_ok (GIOChannel *source, gint httpCode, struct compRouteOutputList_t *compRouteOutputList) { + + gint ret = 0; + + //DEBUG_PC ("Creating the JSON Body and sending the response of the computed Route List"); + + char buftmp[1024]; + char *buf = g_malloc0 (sizeof (char) * 2048000); + // Create the Body of the Response + char * msgBody = g_malloc0 (sizeof (char) * 2048000); + gint length = 0; + + // If path computation was requested, the resulting computation is returned in the msg body + if (compRouteOutputList != NULL) { + rapi_response_json_contents(msgBody, &length, compRouteOutputList); + } + // no path computation was requested, then a basic msg is just added + else { + cJSON* root = cJSON_CreateObject(); + char status[3]; + sprintf(status, "OK"); + cJSON_AddItemToObject(root, "Status", cJSON_CreateString(status)); + msgBody = (char*)cJSON_Print(root); + length = strlen((const char*)msgBody); + cJSON_Delete(root); + } + + sprintf((char *)buf, "HTTP/1.1 200 OK\r\n"); + + sprintf((char *)buftmp, SERVER_STRING); + strcat ((char *)buf, (const char *)buftmp); + + sprintf ((char *)buftmp, "Content-Type: application/json\r\n"); + strcat ((char *)buf, (const char *)buftmp); + + // Add the length of the JSON enconding to the Content_Length + char buff_length[16]; + sprintf(buff_length, "%d", length); + + sprintf ((char *)buftmp, "Content-Length: "); + strcat ((char *)buftmp, (const char *)buff_length); + strcat ((char *)buftmp, "\r\n"); + strcat ((char *)buf, (const char *)buftmp); + + // Add DATE header + rapi_add_date_header ((char *)buftmp); + strcat ((char *)buf, (const char *)buftmp); + sprintf((char *)buftmp, "\r\n"); + strcat ((char *)buf, (const char *)buftmp); + + strcat((char*)buf, (const char*)msgBody); + + //DEBUG_PC ("%s", buf); + ret = rapi_send_message (source, buf); + g_free (buf); + memset (buftmp, '\0', sizeof ( buftmp)); + g_free (msgBody); + (void)ret; + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used to return response OK via REST API + * + * @param source + * @param error + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void rapi_response (GIOChannel *source, gint error) +{ + int ret = 0; + guchar buftmp[1024]; + char * buf = g_malloc0 (sizeof (char) * 2048000); + if (error == HTTP_RETURN_CODE_BAD_REQUEST) + sprintf((char *)buf, "HTTP/1.1 400 BAD REQUEST\r\n"); + else if (error == HTTP_RETURN_CODE_UNAUTHORIZED) + sprintf((char *)buf, "HTTP/1.1 401 UNAUTHORIZED\r\n"); + else if (error == HTTP_RETURN_CODE_FORBIDDEN) + sprintf((char *)buf, "HTTP/1.1 403 FORBIDDEN\r\n"); + else if (error == HTTP_RETURN_CODE_NOT_FOUND) + sprintf((char *)buf, "HTTP/1.1 404 NOT FOUND\r\n"); + + sprintf((char *)buftmp, SERVER_STRING); + strcat ((char *)buf, (const char *)buftmp); + + sprintf((char *)buftmp, "Content-Type: text/plain\r\n"); + strcat ((char *)buf, (const char *)buftmp); + + sprintf((char *)buftmp, "Content-Length: 0/plain\r\n"); + strcat ((char *)buf, (const char *)buftmp); + + // Add DATE header + rapi_add_date_header ((char *)buftmp); + strcat ((char *)buf, (const char *)buftmp); + + sprintf((char *)buftmp, "\r\n"); + strcat ((char *)buf, (const char *)buftmp); + // Print the prepared message + DEBUG_PC ("%s", buf); + + // Send the message + ret = rapi_send_message (source, buf); + g_free (buf); + (void)ret; + + return; +} + + +/////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used to parse the array of Endpoint Ids + * + * @param endPointArray + * @param s + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void parse_service_endPointsIds_array(cJSON* endPointIdArray, struct service_t* s) { + + for (gint i = 0; i < cJSON_GetArraySize(endPointIdArray); i++) { + s->num_service_endpoints_id++; + struct service_endpoints_id_t* serviceEndPointId = &(s->service_endpoints_id[i]); + + cJSON* item = cJSON_GetArrayItem(endPointIdArray, i); + + // Get the topology Id Object + cJSON* topologyIdObj = cJSON_GetObjectItem(item, "topology_id"); + if (cJSON_IsObject(topologyIdObj)) { + // Get the context Id (UUID) from the topologyIdObj + cJSON* contextIdObj = cJSON_GetObjectItem(topologyIdObj, "contextId"); + if (cJSON_IsString(contextIdObj)) { + duplicate_string(serviceEndPointId->topology_id.contextId, contextIdObj->valuestring); + //DEBUG_PC("Service EndPoint [%d]-- ContextId: %s (uuid string format)", i + 1, serviceEndPointId->topology_id.contextId); + } + // Get the topologyId (UUID) from the topologyIdObj + cJSON* topologyUuidObj = cJSON_GetObjectItem(topologyIdObj, "topology_uuid"); + if (cJSON_IsString(topologyUuidObj)) { + duplicate_string(serviceEndPointId->topology_id.topology_uuid, topologyUuidObj->valuestring); + //DEBUG_PC("Service Endpoint (%d) -- TopologyId: %s (uuid string format)", i + 1, serviceEndPointId->topology_id.topology_uuid); + } + } + // Get the deviceId (UUID) + cJSON* deviceIdObj = cJSON_GetObjectItem(item, "device_id"); + if (cJSON_IsString(deviceIdObj)) { + duplicate_string(serviceEndPointId->device_uuid, deviceIdObj->valuestring); + DEBUG_PC("[%d] - DeviceId: %s", i + 1, serviceEndPointId->device_uuid); + } + // Get the endpointId (UUID) + cJSON* endPointIdObj = cJSON_GetObjectItem(item, "endpoint_uuid"); + if (cJSON_IsString(endPointIdObj)) { + duplicate_string(serviceEndPointId->endpoint_uuid, endPointIdObj->valuestring); + DEBUG_PC("[%d] EndPointId: %s", i + 1, serviceEndPointId->endpoint_uuid); + } + } + return; +} + +/////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used to parse the array with the required service constraints + * + * @param constraintArray + * @param s + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void parse_service_constraints(cJSON* constraintArray, struct service_t* s) { + + for (gint i = 0; i < cJSON_GetArraySize(constraintArray); i++) { + + s->num_service_constraints++; + + struct constraint_t* constraint = &(s->constraints[i]); + + cJSON* item = cJSON_GetArrayItem(constraintArray, i); + + // Get the constraint type + cJSON* typeObj = cJSON_GetObjectItem(item, "constraint_type"); + if (cJSON_IsString(typeObj)) { + duplicate_string(constraint->constraint_type, typeObj->valuestring); + } + // Get the constraint value + cJSON* valueObj = cJSON_GetObjectItem(item, "constraint_value"); + if (cJSON_IsString(valueObj)) { + duplicate_string(constraint->constraint_value, valueObj->valuestring); + } + DEBUG_PC("Service Reqs [%d] -- Type: %s | Value: %s", i+1, constraint->constraint_type, constraint->constraint_value); + } + return; +} + +/////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used to parse the array with the different + * network services + * + * @param serviceArray + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void parsing_json_serviceList_array(cJSON* serviceArray) { + + for (gint i = 0; i < cJSON_GetArraySize(serviceArray); i++) + { + serviceList->numServiceList++; + struct service_t* service = &(serviceList->services[i]); + + cJSON* item = cJSON_GetArrayItem(serviceArray, i); + + // Get the algorithm Id + cJSON* algIdItem = cJSON_GetObjectItem(item, "algId"); + if (cJSON_IsString(algIdItem)) + { + duplicate_string(service->algId, algIdItem->valuestring); + DEBUG_PC ("algId: %s", service->algId); + // assumed that all the services request the same algId + duplicate_string(algId, service->algId); + } + + // Get the syncPaths + cJSON* synchPathObj = cJSON_GetObjectItemCaseSensitive(item, "syncPaths"); + if (cJSON_IsBool(synchPathObj)) + { + // Check Synchronization of multiple Paths to attain e.g. global concurrent optimization + if (cJSON_IsTrue(synchPathObj)) + { + syncPath = TRUE; + DEBUG_PC("Path Synchronization is required"); + } + if (cJSON_IsFalse(synchPathObj)) + { + syncPath = FALSE; + DEBUG_PC("No Path Synchronization"); + } + } + + // Get service Id in terms of contextId and service uuids + cJSON* serviceIdObj = cJSON_GetObjectItem(item, "serviceId"); + if (cJSON_IsObject(serviceIdObj)) { + // Get context Id uuid + cJSON* contextIdObj = cJSON_GetObjectItem(serviceIdObj, "contextId"); + if (cJSON_IsString(contextIdObj)) { + // convert the string in contextId->valuestring in uuid binary format + duplicate_string(service->serviceId.contextId, contextIdObj->valuestring); + DEBUG_PC("ContextId: %s (uuid string format)", service->serviceId.contextId); + } + // Get service Id uuid + cJSON* serviceUuidObj = cJSON_GetObjectItem(serviceIdObj, "service_uuid"); + if (cJSON_IsString(serviceUuidObj)) { + duplicate_string(service->serviceId.service_uuid, serviceUuidObj->valuestring); + DEBUG_PC("Service UUID: %s (uuid string format)", service->serviceId.service_uuid); + } + } + + // Get de service type + cJSON* serviceTypeObj = cJSON_GetObjectItem(item, "serviceType"); + if (cJSON_IsNumber(serviceTypeObj)) + { + service->service_type = (guint)(serviceTypeObj->valuedouble); + print_service_type(service->service_type); + } + + // Get the endPoints array of the service + cJSON* endPointIdsArray = cJSON_GetObjectItem(item, "service_endpoints_ids"); + if (cJSON_IsArray(endPointIdsArray)) { + parse_service_endPointsIds_array(endPointIdsArray, service); + } + + // Get the service constraints + cJSON* constraintArray = cJSON_GetObjectItem(item, "service_constraints"); + if (cJSON_IsArray(constraintArray)) { + parse_service_constraints(constraintArray, service); + } + + // Get the maximum number of paths to be computed (kPaths) + cJSON* kPathsObj = cJSON_GetObjectItemCaseSensitive(item, "kPaths"); + if (cJSON_IsNumber(kPathsObj)){ + service->kPaths = (guint)(kPathsObj->valuedouble); + } + } + return; +} + +/////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function parsing the capacity attributes in the endpoint + * + * @param capacity + * @param c + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void parse_capacity_object(cJSON* capacity, struct capacity_t* c) { + + cJSON* totalSizeObj = cJSON_GetObjectItem(capacity, "total-size"); + if (cJSON_IsObject(totalSizeObj)) { + //Get the capacity value + cJSON* valueObj = cJSON_GetObjectItem(totalSizeObj, "value"); + if (cJSON_IsNumber(valueObj)) { + memcpy(&c->value, &valueObj->valuedouble, sizeof (gdouble)); + } + // Get the Units + cJSON* unitObj = cJSON_GetObjectItem(totalSizeObj, "unit"); + if (cJSON_IsNumber(unitObj)) { + c->unit = (guint)(unitObj->valuedouble); + } + } + return; +} + +/////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function parsing the device endpoints + * + * @param endPointsArray + * @param d + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void parse_json_device_endpoints_array(cJSON* endPointsArray, struct device_t* d) { + + for (gint i = 0; i < cJSON_GetArraySize(endPointsArray); i++) { + d->numEndPoints++; + struct endPoint_t* endpoint = &(d->endPoints[i]); + + cJSON* item = cJSON_GetArrayItem(endPointsArray, i); + + // Get the Endpoint Identifier: topology, context, device and endpointId + cJSON* endPointIdObj = cJSON_GetObjectItem(item, "endpoint_id"); + if (cJSON_IsObject(endPointIdObj)) { + // Get the topology Id Object + cJSON* topologyIdObj = cJSON_GetObjectItem(endPointIdObj, "topology_id"); + if (cJSON_IsObject(topologyIdObj)) { + // Get the context Id (UUID) from the topologyIdObj + cJSON* contextIdObj = cJSON_GetObjectItem(topologyIdObj, "contextId"); + if (cJSON_IsString(contextIdObj)) { + duplicate_string(endpoint->endPointId.topology_id.contextId, contextIdObj->valuestring); + //DEBUG_PC("Device EndPoint (%d)-- ContextId: %s (uuid string format)", i + 1, endpoint->endPointId.topology_id.contextId); + } + // Get the topologyId (UUID) from the topologyIdObj + cJSON* topologyUuidObj = cJSON_GetObjectItem(topologyIdObj, "topology_uuid"); + if (cJSON_IsString(topologyUuidObj)) { + duplicate_string(endpoint->endPointId.topology_id.topology_uuid, topologyUuidObj->valuestring); + //DEBUG_PC("Device Endpoint (%d) -- TopologyId: %s (uuid string format)", i + 1, endpoint->endPointId.topology_id.topology_uuid); + } + } + // Get the deviceId + cJSON* deviceIdObj = cJSON_GetObjectItem(endPointIdObj, "device_id"); + if (cJSON_IsString(deviceIdObj)) { + duplicate_string(endpoint->endPointId.device_id, deviceIdObj->valuestring); + //DEBUG_PC("Device Endpoint (%d) -- Device Id: %s (uuid)", i + 1, endpoint->endPointId.device_id); + } + // Get the endpoint_uuid + cJSON* endPointUuidObj = cJSON_GetObjectItem(endPointIdObj, "endpoint_uuid"); + if (cJSON_IsString(endPointUuidObj)) { + duplicate_string(endpoint->endPointId.endpoint_uuid, endPointUuidObj->valuestring); + //DEBUG_PC("Device Endpoint (%d) -- EndPoint Uuid: %s (uuid)", i + 1, endpoint->endPointId.endpoint_uuid); + } + } + // Get the EndPoint Type + cJSON* endPointTypeObj = cJSON_GetObjectItem(item, "endpoint_type"); + if (cJSON_IsString(endPointTypeObj)) { + duplicate_string(endpoint->endpointType, endPointTypeObj->valuestring); + //DEBUG_PC("Device Endpoint (%d) -- EndPoint Type: %s", i + 1, endpoint->endpointType); + } + // Link Port Direction + cJSON* linkPortDirectionObj = cJSON_GetObjectItem(item, "link_port_direction"); + if (cJSON_IsNumber(linkPortDirectionObj)) { + endpoint->link_port_direction = (guint)(linkPortDirectionObj->valuedouble); + print_link_port_direction(endpoint->link_port_direction); + } + // EndPoint Termination Direction + cJSON* terminationDirectionObj = cJSON_GetObjectItem(item, "termination-direction"); + if (cJSON_IsNumber(terminationDirectionObj)) { + endpoint->termination_direction = (guint)(terminationDirectionObj->valuedouble); + print_termination_direction(endpoint->termination_direction); + } + // Endpoint Termination State + cJSON* terminationStateObj = cJSON_GetObjectItem(item, "termination-state"); + if (cJSON_IsNumber(terminationStateObj)) { + endpoint->termination_state = (guint)(terminationStateObj->valuedouble); + print_termination_state(endpoint->termination_state); + } + // total potential capacity + cJSON* totalPotentialCapacityObj = cJSON_GetObjectItem(item, "total-potential-capacity"); + if (cJSON_IsObject(totalPotentialCapacityObj)) + { + parse_capacity_object(totalPotentialCapacityObj, &endpoint->potential_capacity); + //DEBUG_PC("Device Endpoint (%d) -- Potential Capacity: %f", i + 1, endpoint->potential_capacity.value); + print_capacity_unit(endpoint->potential_capacity.unit); + } + // total available capacity + cJSON* availableCapacityObj = cJSON_GetObjectItem(item, "available-capacity"); + if (cJSON_IsObject(availableCapacityObj)) + { + parse_capacity_object(availableCapacityObj, &endpoint->available_capacity); + //DEBUG_PC("Device Endpoint (%d) -- Available Capacity: %f", i + 1, endpoint->available_capacity.value); + print_capacity_unit(endpoint->available_capacity.unit); + } + // inter-domain plug-in + cJSON* interDomainPlugInObj = cJSON_GetObjectItem(item, "inter-domain-plug-in"); + if (cJSON_IsObject(interDomainPlugInObj)) { + // Get the local + cJSON* idInterDomainLocal = cJSON_GetObjectItem(interDomainPlugInObj, "plug-id-inter-domain-local-id"); + if (cJSON_IsString(idInterDomainLocal)) { + duplicate_string(endpoint->inter_domain_plug_in.inter_domain_plug_in_local_id, idInterDomainLocal->valuestring); + //DEBUG_PC("Inter-Domain Local Id: %s", endpoint->inter_domain_plug_in.inter_domain_plug_in_local_id); + } + // Get the remote + cJSON* idInterDomainRemote = cJSON_GetObjectItem(interDomainPlugInObj, "plug-id-inter-domain-remote-id"); + if (cJSON_IsString(idInterDomainRemote)) { + duplicate_string(endpoint->inter_domain_plug_in.inter_domain_plug_in_remote_id, idInterDomainRemote->valuestring); + //DEBUG_PC("Inter-Domain Remote Id: %s", endpoint->inter_domain_plug_in.inter_domain_plug_in_remote_id); + } + } + } + return; +} + +/////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used to parse the set/list of devices forming the context/topology + * + * @param deviceArray + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void parsing_json_deviceList_array(cJSON* deviceArray) { + DEBUG_PC(""); + DEBUG_PC("========= PARSING DEVICE LIST ============"); + for (gint i = 0; i < cJSON_GetArraySize(deviceArray); i++) { + deviceList->numDevices++; + struct device_t* d = &(deviceList->devices[i]); + cJSON* item = cJSON_GetArrayItem(deviceArray, i); + + // Get the device UUID + cJSON* deviceUuidObj = cJSON_GetObjectItem(item, "device_Id"); + if (cJSON_IsString(deviceUuidObj)) { + duplicate_string(d->deviceId, deviceUuidObj->valuestring); + DEBUG_PC("Device (%d) -- Id: %s (uuid string format)", i + 1, d->deviceId); + } + + // Get the device Type + cJSON* deviceTypeObj = cJSON_GetObjectItem(item, "device_type"); + if (cJSON_IsString(deviceTypeObj)) { + duplicate_string(d->deviceType, deviceTypeObj->valuestring); + //DEBUG_PC(" Device Type: %s ---", d->deviceType); + } + DEBUG_PC("DeviceId: %s, Device Type: %s", d->deviceId, d->deviceType); + + // get the device endPoints + cJSON* deviceEndpointsArray = cJSON_GetObjectItem(item, "device_endpoints"); + if (cJSON_IsArray(deviceEndpointsArray)) { + parse_json_device_endpoints_array(deviceEndpointsArray, d); + } + } + return; +} + +/////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used to parse the JSON objects the endPoint of a link + * + * @param endPointsLinkObj + * @param l + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void parse_json_link_endpoints_array(cJSON *endPointsLinkObj, struct link_t* l) { + + for (gint i = 0; i < cJSON_GetArraySize(endPointsLinkObj); i++) { + //DEBUG_PC("link: %s has %d endPointIds", l->linkId, l->numLinkEndPointIds); + l->numLinkEndPointIds++; + struct link_endpointId_t* endPointLink = &(l->linkEndPointId[i]); + + cJSON* item = cJSON_GetArrayItem(endPointsLinkObj, i); + + // Get endPoint attributes (topologyId, deviceId, endpoint_uuid) + cJSON* endPointIdObj = cJSON_GetObjectItem(item, "endpoint_id"); + if (cJSON_IsObject(endPointIdObj)) { + // Get the topology Id Object + cJSON* topologyIdObj = cJSON_GetObjectItem(endPointIdObj, "topology_id"); + if (cJSON_IsObject(topologyIdObj)) { + // Get the context Id (UUID) from the topologyIdObj + cJSON* contextIdObj = cJSON_GetObjectItem(topologyIdObj, "contextId"); + if (cJSON_IsString(contextIdObj)) { + duplicate_string(endPointLink->topology_id.contextId, contextIdObj->valuestring); + //DEBUG_PC("Link EndPoint (%d)-- ContextId: %s (uuid string format)", i + 1, endPointLink->topology_id.contextId); + } + // Get the topologyId (UUID) from the topologyIdObj + cJSON* topologyUuidObj = cJSON_GetObjectItem(topologyIdObj, "topology_uuid"); + if (cJSON_IsString(topologyUuidObj)) { + duplicate_string(endPointLink->topology_id.topology_uuid, topologyUuidObj->valuestring); + //DEBUG_PC("Link Endpoint (%d) -- TopologyId: %s (uuid string format)", i + 1, endPointLink->topology_id.topology_uuid); + } + } + // Get the deviceId + cJSON* deviceIdObj = cJSON_GetObjectItem(endPointIdObj, "device_id"); + if (cJSON_IsString(deviceIdObj)) { + duplicate_string(endPointLink->deviceId, deviceIdObj->valuestring); + DEBUG_PC(" Link Endpoint[%d] -- DeviceId: %s", i + 1, endPointLink->deviceId); + } + // Get the endpoint_uuid + cJSON* endPointUuidObj = cJSON_GetObjectItem(endPointIdObj, "endpoint_uuid"); + if (cJSON_IsString(endPointUuidObj)) { + duplicate_string(endPointLink->endPointId, endPointUuidObj->valuestring); + //DEBUG_PC("Link Endpoint (%d) -- EndPoint Uuid: %s (uuid)", i + 1, endPointLink->endPointId); + } + } + } + //DEBUG_PC("link id: %s has %d endpoints", l->linkId, l->numLinkEndPointIds); + return; +} + +/////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used to parse the JSON objects describing the set of links + * + * @param linkListArray + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void parsing_json_linkList_array(cJSON* linkListArray) { + + DEBUG_PC(""); + DEBUG_PC("======= PARSING OF THE LINK LIST ARRAY =========="); + for (gint i = 0; i < cJSON_GetArraySize(linkListArray); i++) { + linkList->numLinks++; + struct link_t* l = &(linkList->links[i]); + //l->numLinkEndPointIds = 0; + + cJSON* item = cJSON_GetArrayItem(linkListArray, i); + // Get the link Id (uuid) + cJSON* linkIdObj = cJSON_GetObjectItem(item, "link_Id"); + if (cJSON_IsString(linkIdObj)) { + duplicate_string(l->linkId, linkIdObj->valuestring); + DEBUG_PC(" * Link (%d) -- Id: %s (uuid)", i + 1, l->linkId); + } + // Get the link endpoints (assumed to be p2p) + cJSON* endPointsLinkObj = cJSON_GetObjectItem(item, "link_endpoint_ids"); + if (cJSON_IsArray(endPointsLinkObj)) { + //DEBUG_PC("number linkEndPointIds: %d", l->numLinkEndPointIds); + parse_json_link_endpoints_array(endPointsLinkObj, l); + } + // get the fowarding direction + cJSON* fwdDirObj = cJSON_GetObjectItem(item, "forwarding_direction"); + if (cJSON_IsNumber(fwdDirObj)) { + l->forwarding_direction = (guint)(fwdDirObj->valuedouble); + print_link_forwarding_direction(l->forwarding_direction); + } + // total potential capacity + cJSON* totalPotentialCapacityObj = cJSON_GetObjectItem(item, "total-potential-capacity"); + if (cJSON_IsObject(totalPotentialCapacityObj)) + { + parse_capacity_object(totalPotentialCapacityObj, &l->potential_capacity); + //DEBUG_PC("Link (%d) -- Potential Capacity: %f", i + 1, l->potential_capacity.value); + print_capacity_unit(l->potential_capacity.unit); + } + // total available capacity + cJSON* availableCapacityObj = cJSON_GetObjectItem(item, "available-capacity"); + if (cJSON_IsObject(availableCapacityObj)) + { + parse_capacity_object(availableCapacityObj, &l->available_capacity); + //DEBUG_PC("Link (%d) -- Available Capacity: %f", i + 1, l->available_capacity.value); + print_capacity_unit(l->available_capacity.unit); + } + // Cost Characteristics + cJSON* costCharacObj = cJSON_GetObjectItem(item, "cost-characteristics"); + if (cJSON_IsObject(costCharacObj)) { + // Cost Name + cJSON* costNameObj = cJSON_GetObjectItem(costCharacObj, "cost-name"); + if (cJSON_IsString(costNameObj)) { + duplicate_string(l->cost_characteristics.cost_name, costNameObj->valuestring); + //DEBUG_PC("Link (%d) -- Cost Name: %s", i + 1, l->cost_characteristics.cost_name); + } + // Cost value + cJSON* costValueObj = cJSON_GetObjectItem(costCharacObj, "cost-value"); + if (cJSON_IsString(costValueObj)) { + char* endpr; + l->cost_characteristics.cost_value = (gdouble)(strtod(costValueObj->valuestring, &endpr)); + //DEBUG_PC("Link (%d) -- Cost Value: %f", i + 1, l->cost_characteristics.cost_value); + } + // Cost Algorithm + cJSON* costAlgObj = cJSON_GetObjectItem(costCharacObj, "cost-algorithm"); + if (cJSON_IsString(costAlgObj)) { + char* endpr; + l->cost_characteristics.cost_algorithm = (gdouble)(strtod(costAlgObj->valuestring, &endpr)); + //DEBUG_PC("Link (%d) -- Cost Algorithm: %f", i + 1, l->cost_characteristics.cost_algorithm); + } + } + // Latency Characteristics + cJSON* latencyCharacObj = cJSON_GetObjectItem(item, "latency-characteristics"); + if (cJSON_IsObject(latencyCharacObj)) { + cJSON* fixedLatencyCharacObj = cJSON_GetObjectItem(latencyCharacObj, "fixed-latency-characteristic"); + if (cJSON_IsString(fixedLatencyCharacObj)) { + char* endpr; + l->latency_characteristics.fixed_latency = (gdouble)(strtod(fixedLatencyCharacObj->valuestring, &endpr)); + //DEBUG_PC("Link (%d) -- Latency: %f", i + 1, l->latency_characteristics.fixed_latency); + } + } + } + return; +} + +/////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used to generate the reverse (unidirecitonal) link from those being learnt + * from the received context + * + * @author Ricardo Martínez + * @date 2022 + */ + //////////////////////////////////////////////////////////////////////////////////////// +void generate_reverse_linkList() { + DEBUG_PC(""); + DEBUG_PC("CREATION OF REVERSE LINKS"); + gint numLinks = linkList->numLinks; + + for (gint i = 0; i < numLinks; i++) { + struct link_t* refLink = &(linkList->links[i]); + struct link_t* newLink = &(linkList->links[numLinks + i]); + linkList->numLinks++; + // Copy the linkId + appending "_rev" + duplicate_string(newLink->linkId, refLink->linkId); + strcat(newLink->linkId, "_rev"); + + //DEBUG_PC("refLink: %s // newLink: %s", refLink->linkId, newLink->linkId); + + // Assumption: p2p links. The newLink endpoints are the reversed ones form the reference Link (refLink) + // i.e., refLink A->B, then newLink B->A + //DEBUG_PC("ref: %s has %d endpoints", refLink->linkId, refLink->numLinkEndPointIds); +#if 1 + if (refLink->numLinkEndPointIds != 2) { + DEBUG_PC("To construct the new Link from ref: %s, 2 EndPoints are a MUST", refLink->linkId); + exit(-1); + } +#endif + DEBUG_PC(" * Link[%d] -- Id: %s", numLinks + i, newLink->linkId); + + //DEBUG_PC("Number of Endpoints in Link: %d", refLink->numLinkEndPointIds); + for (gint j = refLink->numLinkEndPointIds - 1, m = 0; j >= 0; j--, m++) { + struct link_endpointId_t* refEndPId = &(refLink->linkEndPointId[j]); + struct link_endpointId_t* newEndPId = &(newLink->linkEndPointId[m]); + // Duplicate the topologyId information, i.e., contextId and topology_uuid + duplicate_string(newEndPId->topology_id.contextId, refEndPId->topology_id.contextId); + duplicate_string(newEndPId->topology_id.topology_uuid, refEndPId->topology_id.topology_uuid); + //duplicate the deviceId and endPoint_uuid + duplicate_string(newEndPId->deviceId, refEndPId->deviceId); + duplicate_string(newEndPId->endPointId, refEndPId->endPointId); + DEBUG_PC("refLink Endpoint[%d]: %s(%s)", j, refEndPId->deviceId, refEndPId->endPointId); + //DEBUG_PC("newLink Endpoint[%d]: %s(%s)", m, newEndPId->deviceId, newEndPId->endPointId); + newLink->numLinkEndPointIds++; + } + + // duplicate forwarding direction + newLink->forwarding_direction = refLink->forwarding_direction; + + // duplicate capacity attributes + memcpy(&newLink->potential_capacity.value, &refLink->potential_capacity.value, sizeof(gdouble)); + newLink->potential_capacity.unit = refLink->potential_capacity.unit; + + memcpy(&newLink->available_capacity.value, &refLink->available_capacity.value, sizeof(gdouble)); + newLink->available_capacity.unit = refLink->available_capacity.unit; + + // duplicate cost characteristics + memcpy(&newLink->cost_characteristics.cost_value, &refLink->cost_characteristics.cost_value, sizeof(gdouble)); + memcpy(&newLink->cost_characteristics.cost_algorithm, &refLink->cost_characteristics.cost_algorithm, sizeof(gdouble)); + duplicate_string(newLink->cost_characteristics.cost_name, refLink->cost_characteristics.cost_name); + + // duplicate latency characteristics + memcpy(&newLink->latency_characteristics.fixed_latency, &refLink->latency_characteristics.fixed_latency, sizeof(gdouble)); + } + DEBUG_PC("Terminating Reverse Links [total: %d]", linkList->numLinks); + return; +} + + +/////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used to parse the JSON object/s for the PATH COMP request (i.e. service + * requests, device and links) + * + * @param root + * @param source + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void parsing_json_obj_pathComp_request(cJSON * root, GIOChannel * source) +{ + //DEBUG_PC("**"); + if (deviceList == NULL){ + DEBUG_PC ("Device List does not exist ... STOP"); + exit(-1); + } + + if (linkList == NULL) { + DEBUG_PC("Link List does not exist ... STOP") + } + + if (serviceList == NULL) + { + DEBUG_PC ("Service List does not exist ... STOP"); + exit(-1); + } + + // Set of services to seek their path and resource selection + cJSON* serviceListArray = cJSON_GetObjectItem(root, "serviceList"); + if (cJSON_IsArray(serviceListArray)) { + parsing_json_serviceList_array(serviceListArray); + } + + // Get the deviceList + cJSON* deviceListArray = cJSON_GetObjectItem(root, "deviceList"); + if (cJSON_IsArray(deviceListArray)) { + parsing_json_deviceList_array(deviceListArray); + } + + // Get the linkList + cJSON* linkListArray = cJSON_GetObjectItem(root, "linkList"); + if (cJSON_IsArray(linkListArray)) { + parsing_json_linkList_array(linkListArray); + + // In the context information, if solely the list of links are passed for a single direction, + // the reverse direction MUST be created sythetically + generate_reverse_linkList(); + } + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used parse the JSON object/s + * + * @param data + * @param source + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +gint parsing_json_obj (guchar *data, GIOChannel *source) { + cJSON * root = cJSON_Parse((const char *)data); + char * print = cJSON_Print(root); + + DEBUG_PC("STARTING PARSING JSON CONTENTS"); + parsing_json_obj_pathComp_request (root, source); + // Release the root JSON object variable + cJSON_free (root); + g_free(print); + return 0; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Create new tcp client connected to PATH COMP + * + * @param channel_client, GIOChannel + * @param fd + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +struct pathComp_client * RESTapi_client_create (GIOChannel * channel_client, gint fd) { + /** check values */ + g_assert(channel_client != NULL); + + struct pathComp_client* client = g_malloc0 (sizeof (struct pathComp_client)); + if (client == NULL ) + { + DEBUG_PC ("Malloc for the client failed"); + exit(-1); + } + + /** Make client input/output buffer. */ + client->channel = channel_client; + client->obuf = stream_new(MAXLENGTH); + client->ibuf = stream_new(MAXLENGTH); + client->fd = fd; + + // Clients connected to the PATH COMP SERVER + CLIENT_ID++; + client->type = CLIENT_ID; + + //DEBUG_PC ("Client Id: %u is created (%p)", client->type, client); + //DEBUG_PC ("Client ibuf: %p || obuf: %p", client->ibuf, client->obuf); + + // Add the tcp client to the list + RESTapi_tcp_client_list = g_list_append (RESTapi_tcp_client_list, client); + //DEBUG_PC ("Num of TCP Clients: %d", g_list_length (RESTapi_tcp_client_list)); + return client; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Close the tcp client, removing from the rapi_tcp_client_list + * + * @param client + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void RESTapi_client_close (struct pathComp_client* client) +{ + //DEBUG_PC("Closing the client (Id: %d) %p", client->type, client); + //DEBUG_PC("Client ibuf: %p || obuf: %p", client->ibuf, client->obuf); + + if (client->ibuf != NULL) + { + //DEBUG_PC("Client ibuf: %p", client->ibuf); + stream_free(client->ibuf); + client->ibuf = NULL; + } + if (client->obuf != NULL) + { + //DEBUG_PC("Client obuf: %p", client->obuf); + stream_free(client->obuf); + client->obuf = NULL; + } + // Remove from the list + RESTapi_tcp_client_list = g_list_remove (RESTapi_tcp_client_list, client); + //DEBUG_PC ("TCP Client List: %d", g_list_length(RESTapi_tcp_client_list)); + + g_free (client); + client = NULL; + DEBUG_PC ("client has been removed ..."); + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Close operations over the passed tcp channel + * + * @param source + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void RESTapi_close_operations (GIOChannel * source) +{ + gint fd = g_io_channel_unix_get_fd (source); + + //DEBUG_PC ("Stop all the operations over the fd: %d", fd); + g_io_channel_flush(source, NULL); + GError *error = NULL; + g_io_channel_shutdown (source, TRUE, &error); + if(error) + { + DEBUG_PC ("An error occurred ..."); + } + g_io_channel_unref (source); + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Remove the client and close operations over the TCP connection + * + * @param client + * @param source + * @param fd + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void RESTapi_stop (struct pathComp_client* client, GIOChannel * source, gint fd) +{ + + DEBUG_PC("Client Socket: %d is Stopped", fd); + // remove client + RESTapi_client_close(client); + // Stop operations over that channel + RESTapi_close_operations(source); + close (fd); + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used read the different lines ending up in \r\n + * + * @param s + * @param buf + * @param size + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +gint RESTapi_get_line (GIOChannel *channel, gchar *buf, gint size) +{ + gint i = 0; + //DEBUG_PC ("\n"); + //DEBUG_PC ("----- Read REST API Line(\r\n) ------"); + gint n = 0; + guchar c = '\0'; // END OF FILE + gboolean cr = FALSE; + while (i < size - 1) + { + n = read_channel (channel, &c, 1); + if (n == -1) + { + //DEBUG_PC ("Close the channel and eliminate the client"); + return -1; + } + if (n > 0) + { + //DEBUG_PC ("%c", c); + buf[i] = c; + i++; + if (c == '\r') + { + cr = TRUE; + } + if ((c == '\n') && (cr == TRUE)) + { + break; + } + } + else + { + c = '\n'; + buf[i] = c; + i++; + break; + } + } + buf[i] = '\0'; + //DEBUG_PC ("Line (size: %d) buf: %s", i, buf); + return i; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used read the HTTP method + * + * @param buf + * @param j + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +guint RESTapi_get_method (gchar *buf, gint *j) +{ + guint RestApiMethod = 0; + gchar method[255]; + gint i = 0; + while (!ISspace(buf[*j]) && (i < sizeof(method) - 1)) + { + method[i] = buf[*j]; + i++; + *j = *j + 1; + } + method[i] = '\0'; + DEBUG_PC ("REST API METHOD: %s", method); + + // Check that the methods are GET, POST or PUT + if (strcasecmp((const char *)method, "GET") && strcasecmp((const char *)method, "POST") && + strcasecmp ((const char *)method, "HTTP/1.1") && strcasecmp ((const char *)method, "PUT")) + { + DEBUG_PC ("The method: %s is not currently supported ...", method); + return RestApiMethod; + } + // Method selector + if (strncmp ((const char*)method, "GET", 3) == 0) + { + RestApiMethod = REST_API_METHOD_GET; + } + else if (strncmp ((const char*)method, "POST", 4) == 0) + { + RestApiMethod = REST_API_METHOD_POST; + } + else if (strncmp ((const char *)method, "HTTP/1.1", 8) == 0) + { + RestApiMethod = REST_API_METHOD_HTTP; + } + else if (strncmp ((const char *)method, "PUT", 3) == 0) + { + RestApiMethod = REST_API_METHOD_PUT; + } + + return RestApiMethod; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used read the url + * + * @param buf + * @param j + * @param url + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +gint get_url (gchar *buf, gint *j, gchar *url) +{ + // Skip space char + while (ISspace(buf[*j]) && (*j < strlen(buf))) { + *j = *j + 1; + } + + //DEBUG_PC ("buf[%d]: %c", *j, buf[*j]); + int result = isspace (buf[*j]); + *buf = *buf + *j; + gint numChar = 0; + gint initChar = *j; + result = 0; + while (result == 0) { + *j = *j + 1; + result = isspace (buf[*j]); + numChar++; + } + //DEBUG_PC ("numChar: %d", numChar); + memcpy (url, buf + initChar, numChar); + url[numChar] = '\0'; + //DEBUG_PC ("url: %s", url); + return numChar; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used read the version + * + * @param buf + * @param j + * @param version + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +gint get_version (gchar *buf, gint *j, gchar *version) { + // Skip space char + while (ISspace(buf[*j]) && (*j < strlen(buf))) + { + *j = *j + 1; + } + //DEBUG_PC ("buf[%d]: %c", *j, buf[*j]); + int result = isspace (buf[*j]); + *buf = *buf + *j; + gint numChar = 0; + gint initChar = *j; + result = 0; + while (result == 0) { + *j = *j + 1; + result = isspace (buf[*j]); + numChar++; + } + //DEBUG_PC ("numChar: %d", numChar); + memcpy (version, buf + initChar, numChar); + version[numChar] = '\0'; + //DEBUG_PC ("version: %s", version); + return numChar; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used to trigger the route computation for the network connectivity service + * List and retrieve the result + * + * @param compRouteList + * @param raId + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +gint triggering_routeComp (struct compRouteOutputList_t *compRouteList, gchar *algId) { + g_assert (compRouteList); + gint httpCode = HTTP_RETURN_CODE_OK; + DEBUG_PC("Requested Algorithm: %s", algId); + //////////////////// Algorithm Selector (RAId)////////////////////////////////////// + // KSP algorithm + if (strncmp ((const char*)algId, "KSP", 3) == 0) + { + DEBUG_PC ("Alg Id: KSP"); + httpCode = pathComp_ksp_alg(compRouteList); + } + // simple SP algorithm + else if (strncmp((const char*)algId, "SP", 2) == 0) { + DEBUG_PC("Alg Id: SP"); + httpCode = pathComp_sp_alg(compRouteList); + } +#if 0 + // Infrastructure Abstraction (InA) + else if (strncmp ((const char*)raId, "InA", 3) == 0) + { + //DEBUG_PC ("RA: InA"); + httpCode = ra_InA_alg (compRouteList); + } + // Global Concurrent Optimization (GCO): Resoration / Re-Allocation / Re-Optimization + else if (strncmp ((const char*)raId, "GCO", 3) == 0) + { + //DEBUG_PC ("RA: GCO"); + httpCode = ra_GCO_alg (compRouteList); + } +#endif + return httpCode; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used to process the REST API commands + * + * @param source + * @param cond + * @param data + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +gboolean RESTapi_activity(GIOChannel *source, GIOCondition cond, gpointer data) +{ + /** some checks */ + g_assert(source != NULL); + g_assert(data != NULL); + + gchar buf[1024]; + gchar version[255]; + gchar http_result[255]; + gint body_length = 0; + + struct pathComp_client *client = (struct pathComp_client*)(data); + DEBUG_PC (" ************************************************************************** "); + DEBUG_PC (" REST API ACTIVITY Triggered "); + DEBUG_PC (" ************************************************************************** "); + + gint fd = g_io_channel_unix_get_fd (source); + DEBUG_PC ("fd: %d, cond: %d", fd, cond); + + if (cond != G_IO_IN) + { + DEBUG_PC ("Something happening with the channel and fd ... (cond: %d)", cond); + RESTapi_stop(client, source, fd); + return FALSE; + } + /** Clear input buffer. */ + stream_reset (client->ibuf); + + // get line + gint nbytes = RESTapi_get_line (source, buf, sizeof (buf)); + if (nbytes == -1) + { + DEBUG_PC ("nbytes -1 ... CLOSE CLIENT FD and eliminate CLIENT"); + RESTapi_stop(client, source, fd); + return FALSE; + } + + if ((buf[0] == '\n') && (nbytes == 1)) + { + //DEBUG_PC (" -- buf[0] = newline --"); + RESTapi_stop(client, source, fd); + return FALSE; + } + + gint i = 0, j = 0; + // Get the REST Method + guint RestApiMethod = RESTapi_get_method (buf, &j); + if (RestApiMethod == 0) { + DEBUG_PC ("The method is NOT supported ..."); + RESTapi_unimplemented (source); + RESTapi_stop(client, source, fd); + return FALSE; + } + + // get the REST url + gchar url[255]; + i = get_url (buf, &j, url); + url[i] = '\0'; + + // GET - used for checking status of pathComp ... used url /pathComp/api/v1/health + if (RestApiMethod == REST_API_METHOD_GET) { + if (strncmp((const char*)url, "/health", 7) != 0) { + DEBUG_PC("unknown url [%s] for GET method -- Heatlh function", url); + RESTapi_stop(client, source, fd); + exit(-1); + } + else { + DEBUG_PC("Sending API Response OK to health requests"); + rapi_response_ok(source, HTTP_RETURN_CODE_OK, NULL); + return TRUE; + } + } + + // for method POST, PUT check that the url is "/pathComp" + if (RestApiMethod == REST_API_METHOD_POST) { + if (strncmp((const char*)url, "/pathComp/api/v1/compRoute", 26) != 0) + { + DEBUG_PC("Unknown url: %s", url); + RESTapi_stop(client, source, fd); + exit(-1); + } + } + + // get the version + i = get_version (buf, &j, version); + version[i] = '\0'; + + // Assume HTTP/1.1, then there is Host Header + memset(buf, '\0', sizeof(buf)); + nbytes = RESTapi_get_line(source, buf, sizeof (buf)); + if (nbytes == -1) + { + DEBUG_PC ("nbytes -1 ... then close the fd and eliminate associated client"); + RESTapi_stop(client, source, fd); + return FALSE; + } + + //DEBUG_PC ("Header: %s", buf); + + // Headers --- The Header Fields ends up with a void line (i.e., \r\n) + while ((nbytes > 0) && (strcmp ("\r\n", (const char *)buf) != 0)) + { + /* read & discard headers */ + memset(buf, '\0', sizeof(buf)); + nbytes = RESTapi_get_line (source, buf, sizeof (buf)); + if (nbytes == -1) + { + DEBUG_PC ("nbytes -1 ... then close the fd and eliminate associated client"); + RESTapi_stop(client, source, fd); + return FALSE; + } + //DEBUG_PC ("Header: %s", buf); + if (strncmp ((const char *)buf, "Content-Length:", 15) == 0) + { + //DEBUG_PC ("Header Content-Length Found"); + gchar str[20]; + + gint i = 15, k = 0; // "Content-Length:" We skip the first 16 characters to directly retrieve the length in bytes of the Body of Request + gchar contentLength[255]; + memset (contentLength, '\0', sizeof (contentLength)); + while (buf[i] != '\r') + { + //DEBUG_PC ("%c", buf[i]); + str[k] = buf[i]; + k++, i++; + } + str[k] = '\0'; + j = 0, i = 0; + while (ISspace(str[j]) && (j < strlen(str))) + { + j++; + } + while (j < strlen(str)) + { + contentLength[i] = str[j]; + i++; j++; + } + contentLength[i] = '\0'; + body_length = atoi (contentLength); + //DEBUG_PC ("Body length: %d (%s) in Bytes", body_length, contentLength); + } + } + //DEBUG_PC("Read Entire HTTP Header"); + if (body_length == 0) + { + DEBUG_PC ("--- NO REST API Body length (length = %d) ---", body_length); + return TRUE; + } + ////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Processing Body of the Request + ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + //DEBUG_PC ("REST API Request - Body -"); + nbytes = read_channel (source, (guchar *)(client->ibuf->data + client->ibuf->putp), body_length); + if ((nbytes < 0) && (body_length > 0)) + { + DEBUG_PC ("nbytes: %d; body_length: %d", nbytes, body_length); + exit (-1); + } + + client->ibuf->putp += nbytes; + client->ibuf->endp += nbytes; + /////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Parsing the contents of the Request + /////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // build the device list + deviceList = create_device_list(); + // build the link list + linkList = create_link_list(); + // Create the network connectivity service list + serviceList = create_service_list(); + + // Process the json contents and store relevant information at Device, Link, + // and network connectivity service + gint ret = parsing_json_obj (client->ibuf->data, source); + if (ret == -1) { + DEBUG_PC ("Something wrong with the JSON Objects ... "); + RESTapi_stop(client, source, fd); + return FALSE; + } + + ////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Trigger the path computation + ////////////////////////////////////////////////////////////////////////////////////////////////////////////// + //DEBUG_PC ("Triggering the computation"); + struct compRouteOutputList_t *compRouteOutputList = create_route_list (); + gint httpCode = triggering_routeComp (compRouteOutputList, algId); + + // Send the response to the REST API Client + if (httpCode != HTTP_RETURN_CODE_OK) + { + DEBUG_PC ("HTTP CODE: %d -- NO OK", httpCode); + rapi_response (source, httpCode); + } + else + { + DEBUG_PC ("HTTP CODE: %d -- OK", httpCode); + rapi_response_ok (source, httpCode, compRouteOutputList); + } + + // Release the variables + g_free (compRouteOutputList); + g_free(linkList); + g_free(deviceList); + g_free(serviceList); + return TRUE; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Function used to accept a new connection and add the client to list of clients + * + * @param source, GIOChannel + * @param cond, GIOCondition + * @param data, gpointer + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +gboolean RESTapi_tcp_new_connection(GIOChannel *source, GIOCondition cond, gpointer data) +{ + DEBUG_PC (" ****** New TCP Connection (REST API) ******"); + /** get size of client_addre structure */ + struct sockaddr_in client_addr; + socklen_t client = sizeof(client_addr); + + if ((cond == G_IO_HUP) || (cond == G_IO_ERR) || (G_IO_NVAL)) + { + //DEBUG_PC ("Something happening with the channel and fd ... cond: %d", cond); + // Find the associated client (by the fd) and remove from PATH COMP client list. + // Stop all the operations over that PATH COMP client bound channel + struct pathComp_client *pathComp_client = NULL; + gint fd = g_io_channel_unix_get_fd (source); + GList *found = g_list_find_custom (RESTapi_tcp_client_list, &fd, find_rl_client_by_fd); + if (found != NULL) + { + pathComp_client = (struct pathComp_client*)(found->data); + // remove client + RESTapi_client_close(pathComp_client); + // Stop operations over that channel + RESTapi_close_operations(source); + close (fd); + return FALSE; + } + } + if (cond == G_IO_IN) + { + gint new = accept(g_io_channel_unix_get_fd(source), (struct sockaddr*)&client_addr, &client); + if (new < 0) + { + //DEBUG_PC ("Unable to accept new connection"); + return FALSE; + } + + /** new channel */ + GIOChannel * new_channel = g_io_channel_unix_new (new); + //DEBUG_PC ("TCP Connection (REST API) is UP; (socket: %d)", new); + + /** create pathComp client */ + struct pathComp_client *new_client = RESTapi_client_create (new_channel, new); + + /** + * force binary encoding with NULL + */ + GError *error = NULL; + if ( g_io_channel_set_encoding (new_channel, NULL, &error) != G_IO_STATUS_NORMAL) + { + DEBUG_PC ("Error: %s", error->message); + exit (-1); + } + g_io_channel_set_close_on_unref (new_channel, TRUE); + // On unbuffered channels, it is safe to mix read + // & write calls from the new and old APIs. + g_io_channel_set_buffered (new_channel, FALSE); + if (g_io_channel_set_flags (new_channel, G_IO_FLAG_NONBLOCK, &error) != G_IO_STATUS_NORMAL ) + { + DEBUG_PC ("Error: %s", error->message); + exit (-1); + } + //Adds the new channel into the main event loop. + g_io_add_watch (new_channel, G_IO_IN, RESTapi_activity, new_client); + } + return TRUE; +} + +/////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief enabling the reuse of the addr for the Server TCP + * + * @param sock + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void RESTapi_tcp_enable_reuseaddr (gint sock) +{ + gint tmp = 1; + if (sock < 0) + { + DEBUG_PC (" socket: %d !!!",sock); + exit (-1); + } + if (setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, (gchar *)&tmp, sizeof (tmp)) == -1) + { + DEBUG_PC ("bad setsockopt ..."); + exit (-1); + } + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_RESTapi.c + * @brief Main function for the creating / maintaining TCP session for the REST API + * + * @ port + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void RESTapi_init(gint port) +{ + DEBUG_PC ("REST API PORT (listening): %d", port); + + // File Descriptor - FD - for the socket + gint s = socket (AF_INET, SOCK_STREAM, 0); + if (s == -1) + { + DEBUG_PC ("Socket creation: FAILED!!"); + exit (-1); + } + DEBUG_PC (" CREATED TCP Connection [@fd: %d]", s); + + // Re-bind + RESTapi_tcp_enable_reuseaddr(s); + struct sockaddr_in addr; + memset (&addr, 0, sizeof (addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons ((u_short)port); + addr.sin_addr.s_addr = INADDR_ANY; + + // Associate IP address and Port to the created socket + if (bind (s, (struct sockaddr *)&addr, sizeof(addr)) == -1) + { + close (s); + DEBUG_PC ("Socket bind: FAILED!!"); + exit (-1); + } + DEBUG_PC ("Bind to Fd: %d DONE!!", s); + + /** Set up queue for incoming connections */ + if (listen (s, 10) == -1) + { + close (s); + DEBUG_PC ("Socket listen: FAILED!!"); + exit (-1); + } + + //DEBUG_PC ("Listen (up to 10) to Fd: %d Done", s); + + /** Create NEW channel to handle the socket operations*/ + GIOChannel *channel = g_io_channel_unix_new (s); + gsize buffersize = g_io_channel_get_buffer_size (channel); + //DEBUG_PC ("GIOChannel with Buffer Size: %d", (gint)buffersize); + + gsize newBufferSize = MAX_GIO_CHANNEL_BUFFER_SIZE; + g_io_channel_set_buffer_size (channel, newBufferSize); + buffersize = g_io_channel_get_buffer_size (channel); + + //DEBUG_PC ("GIOChannel with Buffer Size: %d", (gint)buffersize); + //DEBUG_PC ("Channel associated to fd: %d is created", s); + + // Adds the new channel into the main event loop. + g_io_add_watch (channel, G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL, RESTapi_tcp_new_connection, NULL); + return; +} \ No newline at end of file diff --git a/src/pathcomp/backend/pathComp_RESTapi.h b/src/pathcomp/backend/pathComp_RESTapi.h new file mode 100644 index 0000000000000000000000000000000000000000..3b662955959fd8ddad27e337338440b6834f9741 --- /dev/null +++ b/src/pathcomp/backend/pathComp_RESTapi.h @@ -0,0 +1,65 @@ +/* + * 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. + */ + +#ifndef _PATH_COMP_REST_API_H +#define _PATH_COMP_REST_API_H + + +#include +#include +#include + + +#define MAX_GIO_CHANNEL_BUFFER_SIZE 131072 + +// HTTP RETURN CODES +#define HTTP_RETURN_CODE_OK 200 +#define HTTP_RETURN_CODE_CREATED 201 +#define HTTP_RETURN_CODE_BAD_REQUEST 400 +#define HTTP_RETURN_CODE_UNAUTHORIZED 401 +#define HTTP_RETURN_CODE_FORBIDDEN 403 +#define HTTP_RETURN_CODE_NOT_FOUND 404 +#define HTTP_RETURN_CODE_NOT_ACCEPTABLE 406 + +// REST API METHODS (SIMPLY INT ENCODING) +#define REST_API_METHOD_GET 1 +#define REST_API_METHOD_POST 2 +#define REST_API_METHOD_HTTP 3 +#define REST_API_METHOD_PUT 4 + +#define MAXLENGTH 131072 + +//////////////////////////////////////////////////// +// Client Struct for connecting to PATH COMP SERVER +//////////////////////////////////////////////////// +// List of tcp clients connected to PATH COMP + +#define PATH_COMP_CLIENT_TYPE 1000 +struct pathComp_client +{ + /** IO Channel from client. */ + GIOChannel *channel; + + /** Input/output buffer to the client. */ + struct stream *obuf; + struct stream *ibuf; + + gint fd; // file descriptor + guint type; +}; + +void RESTapi_init (gint); +#endif diff --git a/src/pathcomp/backend/pathComp_cjson.c b/src/pathcomp/backend/pathComp_cjson.c new file mode 100644 index 0000000000000000000000000000000000000000..f030da9df934bd22295f12b68494f551cab0b79e --- /dev/null +++ b/src/pathcomp/backend/pathComp_cjson.c @@ -0,0 +1,2728 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include "pathComp_log.h" +#include "pathComp_cjson.h" + +/* define our own boolean type */ +#define true ((cJSON_bool)1) +#define false ((cJSON_bool)0) + +typedef struct +{ + const unsigned char *json; + size_t position; +} error; + +static error global_error = { NULL, 0 }; + +CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void) +{ + return (const char*) (global_error.json + global_error.position); +} + +/* Case insensitive string comparison, doesn't consider two NULL pointers equal though */ +static int case_insensitive_strcmp(const unsigned char *string1, const unsigned char *string2) +{ + if ((string1 == NULL) || (string2 == NULL)) + { + return 1; + } + + if (string1 == string2) + { + return 0; + } + + for(; tolower(*string1) == tolower(*string2); (void)string1++, string2++) + { + if (*string1 == '\0') + { + return 0; + } + } + + return tolower(*string1) - tolower(*string2); +} + +typedef struct internal_hooks +{ + void *(*allocate)(size_t size); + void (*deallocate)(void *pointer); + void *(*reallocate)(void *pointer, size_t size); +} internal_hooks; + + +#define internal_malloc malloc +#define internal_free free +#define internal_realloc realloc + + +static internal_hooks global_hooks = { internal_malloc, internal_free, internal_realloc }; + +static unsigned char* cJSON_strdup(const unsigned char* string, const internal_hooks * const hooks) +{ + size_t length = 0; + unsigned char *copy = NULL; + + if (string == NULL) + { + return NULL; + } + + length = strlen((const char*)string) + sizeof(""); + copy = (unsigned char*)hooks->allocate(length); + if (copy == NULL) + { + return NULL; + } + memcpy(copy, string, length); + + return copy; +} + +CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks) +{ + if (hooks == NULL) + { + /* Reset hooks */ + global_hooks.allocate = malloc; + global_hooks.deallocate = free; + global_hooks.reallocate = realloc; + return; + } + + global_hooks.allocate = malloc; + if (hooks->malloc_fn != NULL) + { + global_hooks.allocate = hooks->malloc_fn; + } + + global_hooks.deallocate = free; + if (hooks->free_fn != NULL) + { + global_hooks.deallocate = hooks->free_fn; + } + + /* use realloc only if both free and malloc are used */ + global_hooks.reallocate = NULL; + if ((global_hooks.allocate == malloc) && (global_hooks.deallocate == free)) + { + global_hooks.reallocate = realloc; + } +} + +/* Internal constructor. */ +static cJSON *cJSON_New_Item(const internal_hooks * const hooks) +{ + cJSON* node = (cJSON*)hooks->allocate(sizeof(cJSON)); + if (node) + { + memset(node, '\0', sizeof(cJSON)); + } + + return node; +} + +/* Delete a cJSON structure. */ +CJSON_PUBLIC(void) cJSON_Delete(cJSON *item) +{ + cJSON *next = NULL; + while (item != NULL) + { + next = item->next; + if (!(item->type & cJSON_IsReference) && (item->child != NULL)) + { + cJSON_Delete(item->child); + } + if (!(item->type & cJSON_IsReference) && (item->valuestring != NULL)) + { + global_hooks.deallocate(item->valuestring); + } + if (!(item->type & cJSON_StringIsConst) && (item->string != NULL)) + { + global_hooks.deallocate(item->string); + } + global_hooks.deallocate(item); + item = next; + } +} + +/* get the decimal point character of the current locale */ +static unsigned char get_decimal_point(void) +{ + return '.'; + +} + +typedef struct +{ + const unsigned char *content; + size_t length; + size_t offset; + size_t depth; /* How deeply nested (in arrays/objects) is the input at the current offset. */ + internal_hooks hooks; +} parse_buffer; + +/* check if the given size is left to read in a given parse buffer (starting with 1) */ +#define can_read(buffer, size) ((buffer != NULL) && (((buffer)->offset + size) <= (buffer)->length)) +/* check if the buffer can be accessed at the given index (starting with 0) */ +#define can_access_at_index(buffer, index) ((buffer != NULL) && (((buffer)->offset + index) < (buffer)->length)) +#define cannot_access_at_index(buffer, index) (!can_access_at_index(buffer, index)) +/* get a pointer to the buffer at the position */ +#define buffer_at_offset(buffer) ((buffer)->content + (buffer)->offset) + +/* Parse the input text to generate a number, and populate the result into item. */ +static cJSON_bool parse_number(cJSON * const item, parse_buffer * const input_buffer) +{ + double number = 0; + unsigned char *after_end = NULL; + unsigned char number_c_string[64]; + unsigned char decimal_point = get_decimal_point(); + size_t i = 0; + + if ((input_buffer == NULL) || (input_buffer->content == NULL)) + { + return false; + } + + /* copy the number into a temporary buffer and replace '.' with the decimal point + * of the current locale (for strtod) + * This also takes care of '\0' not necessarily being available for marking the end of the input */ + for (i = 0; (i < (sizeof(number_c_string) - 1)) && can_access_at_index(input_buffer, i); i++) + { + switch (buffer_at_offset(input_buffer)[i]) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '+': + case '-': + case 'e': + case 'E': + number_c_string[i] = buffer_at_offset(input_buffer)[i]; + break; + + case '.': + number_c_string[i] = decimal_point; + break; + + default: + goto loop_end; + } + } +loop_end: + number_c_string[i] = '\0'; + + number = strtod((const char*)number_c_string, (char**)&after_end); + if (number_c_string == after_end) + { + return false; /* parse_error */ + } + + item->valuedouble = number; + + /* use saturation in case of overflow */ + if (number >= INT_MAX) + { + item->valueint = INT_MAX; + } + else if (number <= INT_MIN) + { + item->valueint = INT_MIN; + } + else + { + item->valueint = (int)number; + } + + item->type = cJSON_Number; + + input_buffer->offset += (size_t)(after_end - number_c_string); + return true; +} + +/* don't ask me, but the original cJSON_SetNumberValue returns an integer or double */ +CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number) +{ + if (number >= INT_MAX) + { + object->valueint = INT_MAX; + } + else if (number <= INT_MIN) + { + object->valueint = INT_MIN; + } + else + { + object->valueint = (int)number; + } + + return object->valuedouble = number; +} + +typedef struct +{ + unsigned char *buffer; + size_t length; + size_t offset; + size_t depth; /* current nesting depth (for formatted printing) */ + cJSON_bool noalloc; + cJSON_bool format; /* is this print a formatted print */ + internal_hooks hooks; +} printbuffer; + +/* realloc printbuffer if necessary to have at least "needed" bytes more */ +static unsigned char* ensure(printbuffer * const p, size_t needed) +{ + unsigned char *newbuffer = NULL; + size_t newsize = 0; + + if ((p == NULL) || (p->buffer == NULL)) + { + return NULL; + } + + if ((p->length > 0) && (p->offset >= p->length)) + { + /* make sure that offset is valid */ + return NULL; + } + + if (needed > INT_MAX) + { + /* sizes bigger than INT_MAX are currently not supported */ + return NULL; + } + + needed += p->offset + 1; + if (needed <= p->length) + { + return p->buffer + p->offset; + } + + if (p->noalloc) { + return NULL; + } + + /* calculate new buffer size */ + if (needed > (INT_MAX / 2)) + { + /* overflow of int, use INT_MAX if possible */ + if (needed <= INT_MAX) + { + newsize = INT_MAX; + } + else + { + return NULL; + } + } + else + { + newsize = needed * 2; + } + + if (p->hooks.reallocate != NULL) + { + /* reallocate with realloc if available */ + newbuffer = (unsigned char*)p->hooks.reallocate(p->buffer, newsize); + if (newbuffer == NULL) + { + p->hooks.deallocate(p->buffer); + p->length = 0; + p->buffer = NULL; + + return NULL; + } + } + else + { + /* otherwise reallocate manually */ + newbuffer = (unsigned char*)p->hooks.allocate(newsize); + if (!newbuffer) + { + p->hooks.deallocate(p->buffer); + p->length = 0; + p->buffer = NULL; + + return NULL; + } + if (newbuffer) + { + memcpy(newbuffer, p->buffer, p->offset + 1); + } + p->hooks.deallocate(p->buffer); + } + p->length = newsize; + p->buffer = newbuffer; + + return newbuffer + p->offset; +} + +/* calculate the new length of the string in a printbuffer and update the offset */ +static void update_offset(printbuffer * const buffer) +{ + const unsigned char *buffer_pointer = NULL; + if ((buffer == NULL) || (buffer->buffer == NULL)) + { + return; + } + buffer_pointer = buffer->buffer + buffer->offset; + + buffer->offset += strlen((const char*)buffer_pointer); +} + +/* Render the number nicely from the given item into a string. */ +static cJSON_bool print_number(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output_pointer = NULL; + double d = item->valuedouble; + int length = 0; + size_t i = 0; + unsigned char number_buffer[26]; /* temporary buffer to print the number into */ + unsigned char decimal_point = get_decimal_point(); + double test; + + if (output_buffer == NULL) + { + return false; + } + + /* This checks for NaN and Infinity */ + if ((d * 0) != 0) + { + length = sprintf((char*)number_buffer, "null"); + } + else + { + /* Try 15 decimal places of precision to avoid nonsignificant nonzero digits */ + length = sprintf((char*)number_buffer, "%1.15g", d); + + /* Check whether the original double can be recovered */ + if ((sscanf((char*)number_buffer, "%lg", &test) != 1) || ((double)test != d)) + { + /* If not, print with 17 decimal places of precision */ + length = sprintf((char*)number_buffer, "%1.17g", d); + } + } + + /* sprintf failed or buffer overrun occured */ + if ((length < 0) || (length > (int)(sizeof(number_buffer) - 1))) + { + return false; + } + + /* reserve appropriate space in the output */ + output_pointer = ensure(output_buffer, (size_t)length); + if (output_pointer == NULL) + { + return false; + } + + /* copy the printed number to the output and replace locale + * dependent decimal point with '.' */ + for (i = 0; i < ((size_t)length); i++) + { + if (number_buffer[i] == decimal_point) + { + output_pointer[i] = '.'; + continue; + } + + output_pointer[i] = number_buffer[i]; + } + output_pointer[i] = '\0'; + + output_buffer->offset += (size_t)length; + + return true; +} + +/* parse 4 digit hexadecimal number */ +static unsigned parse_hex4(const unsigned char * const input) +{ + unsigned int h = 0; + size_t i = 0; + + for (i = 0; i < 4; i++) + { + /* parse digit */ + if ((input[i] >= '0') && (input[i] <= '9')) + { + h += (unsigned int) input[i] - '0'; + } + else if ((input[i] >= 'A') && (input[i] <= 'F')) + { + h += (unsigned int) 10 + input[i] - 'A'; + } + else if ((input[i] >= 'a') && (input[i] <= 'f')) + { + h += (unsigned int) 10 + input[i] - 'a'; + } + else /* invalid */ + { + return 0; + } + + if (i < 3) + { + /* shift left to make place for the next nibble */ + h = h << 4; + } + } + + return h; +} + +/* converts a UTF-16 literal to UTF-8 + * A literal can be one or two sequences of the form \uXXXX */ +static unsigned char utf16_literal_to_utf8(const unsigned char * const input_pointer, const unsigned char * const input_end, unsigned char **output_pointer) +{ + long unsigned int codepoint = 0; + unsigned int first_code = 0; + const unsigned char *first_sequence = input_pointer; + unsigned char utf8_length = 0; + unsigned char utf8_position = 0; + unsigned char sequence_length = 0; + unsigned char first_byte_mark = 0; + + if ((input_end - first_sequence) < 6) + { + /* input ends unexpectedly */ + goto fail; + } + + /* get the first utf16 sequence */ + first_code = parse_hex4(first_sequence + 2); + + /* check that the code is valid */ + if (((first_code >= 0xDC00) && (first_code <= 0xDFFF))) + { + goto fail; + } + + /* UTF16 surrogate pair */ + if ((first_code >= 0xD800) && (first_code <= 0xDBFF)) + { + const unsigned char *second_sequence = first_sequence + 6; + unsigned int second_code = 0; + sequence_length = 12; /* \uXXXX\uXXXX */ + + if ((input_end - second_sequence) < 6) + { + /* input ends unexpectedly */ + goto fail; + } + + if ((second_sequence[0] != '\\') || (second_sequence[1] != 'u')) + { + /* missing second half of the surrogate pair */ + goto fail; + } + + /* get the second utf16 sequence */ + second_code = parse_hex4(second_sequence + 2); + /* check that the code is valid */ + if ((second_code < 0xDC00) || (second_code > 0xDFFF)) + { + /* invalid second half of the surrogate pair */ + goto fail; + } + + + /* calculate the unicode codepoint from the surrogate pair */ + codepoint = 0x10000 + (((first_code & 0x3FF) << 10) | (second_code & 0x3FF)); + } + else + { + sequence_length = 6; /* \uXXXX */ + codepoint = first_code; + } + + /* encode as UTF-8 + * takes at maximum 4 bytes to encode: + * 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */ + if (codepoint < 0x80) + { + /* normal ascii, encoding 0xxxxxxx */ + utf8_length = 1; + } + else if (codepoint < 0x800) + { + /* two bytes, encoding 110xxxxx 10xxxxxx */ + utf8_length = 2; + first_byte_mark = 0xC0; /* 11000000 */ + } + else if (codepoint < 0x10000) + { + /* three bytes, encoding 1110xxxx 10xxxxxx 10xxxxxx */ + utf8_length = 3; + first_byte_mark = 0xE0; /* 11100000 */ + } + else if (codepoint <= 0x10FFFF) + { + /* four bytes, encoding 1110xxxx 10xxxxxx 10xxxxxx 10xxxxxx */ + utf8_length = 4; + first_byte_mark = 0xF0; /* 11110000 */ + } + else + { + /* invalid unicode codepoint */ + goto fail; + } + + /* encode as utf8 */ + for (utf8_position = (unsigned char)(utf8_length - 1); utf8_position > 0; utf8_position--) + { + /* 10xxxxxx */ + (*output_pointer)[utf8_position] = (unsigned char)((codepoint | 0x80) & 0xBF); + codepoint >>= 6; + } + /* encode first byte */ + if (utf8_length > 1) + { + (*output_pointer)[0] = (unsigned char)((codepoint | first_byte_mark) & 0xFF); + } + else + { + (*output_pointer)[0] = (unsigned char)(codepoint & 0x7F); + } + + *output_pointer += utf8_length; + + return sequence_length; + +fail: + return 0; +} + +/* Parse the input text into an unescaped cinput, and populate item. */ +static cJSON_bool parse_string(cJSON * const item, parse_buffer * const input_buffer) +{ + const unsigned char *input_pointer = buffer_at_offset(input_buffer) + 1; + const unsigned char *input_end = buffer_at_offset(input_buffer) + 1; + unsigned char *output_pointer = NULL; + unsigned char *output = NULL; + + /* not a string */ + if (buffer_at_offset(input_buffer)[0] != '\"') + { + goto fail; + } + + { + /* calculate approximate size of the output (overestimate) */ + size_t allocation_length = 0; + size_t skipped_bytes = 0; + while (((size_t)(input_end - input_buffer->content) < input_buffer->length) && (*input_end != '\"')) + { + /* is escape sequence */ + if (input_end[0] == '\\') + { + if ((size_t)(input_end + 1 - input_buffer->content) >= input_buffer->length) + { + /* prevent buffer overflow when last input character is a backslash */ + goto fail; + } + skipped_bytes++; + input_end++; + } + input_end++; + } + if (((size_t)(input_end - input_buffer->content) >= input_buffer->length) || (*input_end != '\"')) + { + goto fail; /* string ended unexpectedly */ + } + + /* This is at most how much we need for the output */ + allocation_length = (size_t) (input_end - buffer_at_offset(input_buffer)) - skipped_bytes; + output = (unsigned char*)input_buffer->hooks.allocate(allocation_length + sizeof("")); + if (output == NULL) + { + goto fail; /* allocation failure */ + } + } + + output_pointer = output; + /* loop through the string literal */ + while (input_pointer < input_end) + { + if (*input_pointer != '\\') + { + *output_pointer++ = *input_pointer++; + } + /* escape sequence */ + else + { + unsigned char sequence_length = 2; + if ((input_end - input_pointer) < 1) + { + goto fail; + } + + switch (input_pointer[1]) + { + case 'b': + *output_pointer++ = '\b'; + break; + case 'f': + *output_pointer++ = '\f'; + break; + case 'n': + *output_pointer++ = '\n'; + break; + case 'r': + *output_pointer++ = '\r'; + break; + case 't': + *output_pointer++ = '\t'; + break; + case '\"': + case '\\': + case '/': + *output_pointer++ = input_pointer[1]; + break; + + /* UTF-16 literal */ + case 'u': + sequence_length = utf16_literal_to_utf8(input_pointer, input_end, &output_pointer); + if (sequence_length == 0) + { + /* failed to convert UTF16-literal to UTF-8 */ + goto fail; + } + break; + + default: + goto fail; + } + input_pointer += sequence_length; + } + } + + /* zero terminate the output */ + *output_pointer = '\0'; + + item->type = cJSON_String; + item->valuestring = (char*)output; + + input_buffer->offset = (size_t) (input_end - input_buffer->content); + input_buffer->offset++; + + return true; + +fail: + if (output != NULL) + { + input_buffer->hooks.deallocate(output); + } + + if (input_pointer != NULL) + { + input_buffer->offset = (size_t)(input_pointer - input_buffer->content); + } + + return false; +} + +/* Render the cstring provided to an escaped version that can be printed. */ +static cJSON_bool print_string_ptr(const unsigned char * const input, printbuffer * const output_buffer) +{ + const unsigned char *input_pointer = NULL; + unsigned char *output = NULL; + unsigned char *output_pointer = NULL; + size_t output_length = 0; + /* numbers of additional characters needed for escaping */ + size_t escape_characters = 0; + + if (output_buffer == NULL) + { + return false; + } + + /* empty string */ + if (input == NULL) + { + output = ensure(output_buffer, sizeof("\"\"")); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "\"\""); + + return true; + } + + /* set "flag" to 1 if something needs to be escaped */ + for (input_pointer = input; *input_pointer; input_pointer++) + { + switch (*input_pointer) + { + case '\"': + case '\\': + case '\b': + case '\f': + case '\n': + case '\r': + case '\t': + /* one character escape sequence */ + escape_characters++; + break; + default: + if (*input_pointer < 32) + { + /* UTF-16 escape sequence uXXXX */ + escape_characters += 5; + } + break; + } + } + output_length = (size_t)(input_pointer - input) + escape_characters; + + output = ensure(output_buffer, output_length + sizeof("\"\"")); + if (output == NULL) + { + return false; + } + + /* no characters have to be escaped */ + if (escape_characters == 0) + { + output[0] = '\"'; + memcpy(output + 1, input, output_length); + output[output_length + 1] = '\"'; + output[output_length + 2] = '\0'; + + return true; + } + + output[0] = '\"'; + output_pointer = output + 1; + /* copy the string */ + for (input_pointer = input; *input_pointer != '\0'; (void)input_pointer++, output_pointer++) + { + if ((*input_pointer > 31) && (*input_pointer != '\"') && (*input_pointer != '\\')) + { + /* normal character, copy */ + *output_pointer = *input_pointer; + } + else + { + /* character needs to be escaped */ + *output_pointer++ = '\\'; + switch (*input_pointer) + { + case '\\': + *output_pointer = '\\'; + break; + case '\"': + *output_pointer = '\"'; + break; + case '\b': + *output_pointer = 'b'; + break; + case '\f': + *output_pointer = 'f'; + break; + case '\n': + *output_pointer = 'n'; + break; + case '\r': + *output_pointer = 'r'; + break; + case '\t': + *output_pointer = 't'; + break; + default: + /* escape and print as unicode codepoint */ + sprintf((char*)output_pointer, "u%04x", *input_pointer); + output_pointer += 4; + break; + } + } + } + output[output_length + 1] = '\"'; + output[output_length + 2] = '\0'; + + return true; +} + +/* Invoke print_string_ptr (which is useful) on an item. */ +static cJSON_bool print_string(const cJSON * const item, printbuffer * const p) +{ + return print_string_ptr((unsigned char*)item->valuestring, p); +} + +/* Predeclare these prototypes. */ +static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buffer); +static cJSON_bool print_value(const cJSON * const item, printbuffer * const output_buffer); +static cJSON_bool parse_array(cJSON * const item, parse_buffer * const input_buffer); +static cJSON_bool print_array(const cJSON * const item, printbuffer * const output_buffer); +static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_buffer); +static cJSON_bool print_object(const cJSON * const item, printbuffer * const output_buffer); + +/* Utility to jump whitespace and cr/lf */ +static parse_buffer *buffer_skip_whitespace(parse_buffer * const buffer) +{ + if ((buffer == NULL) || (buffer->content == NULL)) + { + return NULL; + } + + while (can_access_at_index(buffer, 0) && (buffer_at_offset(buffer)[0] <= 32)) + { + buffer->offset++; + } + + if (buffer->offset == buffer->length) + { + buffer->offset--; + } + + return buffer; +} + +/* skip the UTF-8 BOM (byte order mark) if it is at the beginning of a buffer */ +static parse_buffer *skip_utf8_bom(parse_buffer * const buffer) +{ + if ((buffer == NULL) || (buffer->content == NULL) || (buffer->offset != 0)) + { + return NULL; + } + + if (can_access_at_index(buffer, 4) && (strncmp((const char*)buffer_at_offset(buffer), "\xEF\xBB\xBF", 3) == 0)) + { + buffer->offset += 3; + } + + return buffer; +} + +/* Parse an object - create a new root, and populate. */ +CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated) +{ + parse_buffer buffer = { 0, 0, 0, 0, { 0, 0, 0 } }; + cJSON *item = NULL; + + /* reset error position */ + global_error.json = NULL; + global_error.position = 0; + + if (value == NULL) + { + goto fail; + } + + buffer.content = (const unsigned char*)value; + buffer.length = strlen((const char*)value) + sizeof(""); + buffer.offset = 0; + buffer.hooks = global_hooks; + + item = cJSON_New_Item(&global_hooks); + if (item == NULL) /* memory fail */ + { + goto fail; + } + + if (!parse_value(item, buffer_skip_whitespace(skip_utf8_bom(&buffer)))) + { + /* parse failure. ep is set. */ + goto fail; + } + + /* if we require null-terminated JSON without appended garbage, skip and then check for a null terminator */ + if (require_null_terminated) + { + buffer_skip_whitespace(&buffer); + if ((buffer.offset >= buffer.length) || buffer_at_offset(&buffer)[0] != '\0') + { + goto fail; + } + } + if (return_parse_end) + { + *return_parse_end = (const char*)buffer_at_offset(&buffer); + } + + return item; + +fail: + if (item != NULL) + { + cJSON_Delete(item); + } + + if (value != NULL) + { + error local_error; + local_error.json = (const unsigned char*)value; + local_error.position = 0; + + if (buffer.offset < buffer.length) + { + local_error.position = buffer.offset; + } + else if (buffer.length > 0) + { + local_error.position = buffer.length - 1; + } + + if (return_parse_end != NULL) + { + *return_parse_end = (const char*)local_error.json + local_error.position; + } + + global_error = local_error; + } + + return NULL; +} + +/* Default options for cJSON_Parse */ +CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value) +{ + return cJSON_ParseWithOpts(value, 0, 0); +} + +#define cjson_min(a, b) ((a < b) ? a : b) + +static unsigned char *print(const cJSON * const item, cJSON_bool format, const internal_hooks * const hooks) +{ + printbuffer buffer[1]; + unsigned char *printed = NULL; + + memset(buffer, 0, sizeof(buffer)); + + /* create buffer */ + buffer->buffer = (unsigned char*) hooks->allocate(256); + buffer->format = format; + buffer->hooks = *hooks; + if (buffer->buffer == NULL) + { + goto fail; + } + + /* print the value */ + if (!print_value(item, buffer)) + { + goto fail; + } + update_offset(buffer); + + /* check if reallocate is available */ + if (hooks->reallocate != NULL) + { + printed = (unsigned char*) hooks->reallocate(buffer->buffer, buffer->length); + buffer->buffer = NULL; + if (printed == NULL) { + goto fail; + } + } + else /* otherwise copy the JSON over to a new buffer */ + { + printed = (unsigned char*) hooks->allocate(buffer->offset + 1); + if (printed == NULL) + { + goto fail; + } + memcpy(printed, buffer->buffer, cjson_min(buffer->length, buffer->offset + 1)); + printed[buffer->offset] = '\0'; /* just to be sure */ + + /* free the buffer */ + hooks->deallocate(buffer->buffer); + } + + return printed; + +fail: + if (buffer->buffer != NULL) + { + hooks->deallocate(buffer->buffer); + } + + if (printed != NULL) + { + hooks->deallocate(printed); + } + + return NULL; +} + +/* Render a cJSON item/entity/structure to text. */ +CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item) +{ + return (char*)print(item, true, &global_hooks); +} + +CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item) +{ + return (char*)print(item, false, &global_hooks); +} + +CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt) +{ + printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }; + + if (prebuffer < 0) + { + return NULL; + } + + p.buffer = (unsigned char*)global_hooks.allocate((size_t)prebuffer); + if (!p.buffer) + { + return NULL; + } + + p.length = (size_t)prebuffer; + p.offset = 0; + p.noalloc = false; + p.format = fmt; + p.hooks = global_hooks; + + if (!print_value(item, &p)) + { + global_hooks.deallocate(p.buffer); + return NULL; + } + + return (char*)p.buffer; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buf, const int len, const cJSON_bool fmt) +{ + printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }; + + if ((len < 0) || (buf == NULL)) + { + return false; + } + + p.buffer = (unsigned char*)buf; + p.length = (size_t)len; + p.offset = 0; + p.noalloc = true; + p.format = fmt; + p.hooks = global_hooks; + + return print_value(item, &p); +} + +/* Parser core - when encountering text, process appropriately. */ +static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buffer) +{ + if ((input_buffer == NULL) || (input_buffer->content == NULL)) + { + return false; /* no input */ + } + + /* parse the different types of values */ + /* null */ + if (can_read(input_buffer, 4) && (strncmp((const char*)buffer_at_offset(input_buffer), "null", 4) == 0)) + { + item->type = cJSON_NULL; + input_buffer->offset += 4; + return true; + } + /* false */ + if (can_read(input_buffer, 5) && (strncmp((const char*)buffer_at_offset(input_buffer), "false", 5) == 0)) + { + item->type = cJSON_False; + input_buffer->offset += 5; + return true; + } + /* true */ + if (can_read(input_buffer, 4) && (strncmp((const char*)buffer_at_offset(input_buffer), "true", 4) == 0)) + { + item->type = cJSON_True; + item->valueint = 1; + input_buffer->offset += 4; + return true; + } + /* string */ + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '\"')) + { + return parse_string(item, input_buffer); + } + /* number */ + if (can_access_at_index(input_buffer, 0) && ((buffer_at_offset(input_buffer)[0] == '-') || ((buffer_at_offset(input_buffer)[0] >= '0') && (buffer_at_offset(input_buffer)[0] <= '9')))) + { + return parse_number(item, input_buffer); + } + /* array */ + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '[')) + { + return parse_array(item, input_buffer); + } + /* object */ + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '{')) + { + return parse_object(item, input_buffer); + } + + return false; +} + +/* Render a value to text. */ +static cJSON_bool print_value(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output = NULL; + + if ((item == NULL) || (output_buffer == NULL)) + { + return false; + } + + switch ((item->type) & 0xFF) + { + case cJSON_NULL: + output = ensure(output_buffer, 5); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "null"); + return true; + + case cJSON_False: + output = ensure(output_buffer, 6); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "false"); + return true; + + case cJSON_True: + output = ensure(output_buffer, 5); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "true"); + return true; + + case cJSON_Number: + return print_number(item, output_buffer); + + case cJSON_Raw: + { + size_t raw_length = 0; + if (item->valuestring == NULL) + { + if (!output_buffer->noalloc) + { + output_buffer->hooks.deallocate(output_buffer->buffer); + } + return false; + } + + raw_length = strlen(item->valuestring) + sizeof(""); + output = ensure(output_buffer, raw_length); + if (output == NULL) + { + return false; + } + memcpy(output, item->valuestring, raw_length); + return true; + } + + case cJSON_String: + return print_string(item, output_buffer); + + case cJSON_Array: + return print_array(item, output_buffer); + + case cJSON_Object: + return print_object(item, output_buffer); + + default: + return false; + } +} + +/* Build an array from input text. */ +static cJSON_bool parse_array(cJSON * const item, parse_buffer * const input_buffer) +{ + cJSON *head = NULL; /* head of the linked list */ + cJSON *current_item = NULL; + + if (input_buffer->depth >= CJSON_NESTING_LIMIT) + { + return false; /* to deeply nested */ + } + input_buffer->depth++; + + if (buffer_at_offset(input_buffer)[0] != '[') + { + /* not an array */ + goto fail; + } + + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ']')) + { + /* empty array */ + goto success; + } + + /* check if we skipped to the end of the buffer */ + if (cannot_access_at_index(input_buffer, 0)) + { + input_buffer->offset--; + goto fail; + } + + /* step back to character in front of the first element */ + input_buffer->offset--; + /* loop through the comma separated array elements */ + do + { + /* allocate next item */ + cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); + if (new_item == NULL) + { + goto fail; /* allocation failure */ + } + + /* attach next item to list */ + if (head == NULL) + { + /* start the linked list */ + current_item = head = new_item; + } + else + { + /* add to the end and advance */ + current_item->next = new_item; + new_item->prev = current_item; + current_item = new_item; + } + + /* parse next value */ + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (!parse_value(current_item, input_buffer)) + { + goto fail; /* failed to parse value */ + } + buffer_skip_whitespace(input_buffer); + } + while (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ',')); + + if (cannot_access_at_index(input_buffer, 0) || buffer_at_offset(input_buffer)[0] != ']') + { + goto fail; /* expected end of array */ + } + +success: + input_buffer->depth--; + + item->type = cJSON_Array; + item->child = head; + + input_buffer->offset++; + + return true; + +fail: + if (head != NULL) + { + cJSON_Delete(head); + } + + return false; +} + +/* Render an array to text */ +static cJSON_bool print_array(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output_pointer = NULL; + size_t length = 0; + cJSON *current_element = item->child; + + if (output_buffer == NULL) + { + return false; + } + + /* Compose the output array. */ + /* opening square bracket */ + output_pointer = ensure(output_buffer, 1); + if (output_pointer == NULL) + { + return false; + } + + *output_pointer = '['; + output_buffer->offset++; + output_buffer->depth++; + + while (current_element != NULL) + { + if (!print_value(current_element, output_buffer)) + { + return false; + } + update_offset(output_buffer); + if (current_element->next) + { + length = (size_t) (output_buffer->format ? 2 : 1); + output_pointer = ensure(output_buffer, length + 1); + if (output_pointer == NULL) + { + return false; + } + *output_pointer++ = ','; + if(output_buffer->format) + { + *output_pointer++ = ' '; + } + *output_pointer = '\0'; + output_buffer->offset += length; + } + current_element = current_element->next; + } + + output_pointer = ensure(output_buffer, 2); + if (output_pointer == NULL) + { + return false; + } + *output_pointer++ = ']'; + *output_pointer = '\0'; + output_buffer->depth--; + + return true; +} + +/* Build an object from the text. */ +static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_buffer) +{ + cJSON *head = NULL; /* linked list head */ + cJSON *current_item = NULL; + + if (input_buffer->depth >= CJSON_NESTING_LIMIT) + { + return false; /* to deeply nested */ + } + input_buffer->depth++; + + if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != '{')) + { + goto fail; /* not an object */ + } + + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '}')) + { + goto success; /* empty object */ + } + + /* check if we skipped to the end of the buffer */ + if (cannot_access_at_index(input_buffer, 0)) + { + input_buffer->offset--; + goto fail; + } + + /* step back to character in front of the first element */ + input_buffer->offset--; + /* loop through the comma separated array elements */ + do + { + /* allocate next item */ + cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); + if (new_item == NULL) + { + goto fail; /* allocation failure */ + } + + /* attach next item to list */ + if (head == NULL) + { + /* start the linked list */ + current_item = head = new_item; + } + else + { + /* add to the end and advance */ + current_item->next = new_item; + new_item->prev = current_item; + current_item = new_item; + } + + /* parse the name of the child */ + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (!parse_string(current_item, input_buffer)) + { + goto fail; /* faile to parse name */ + } + buffer_skip_whitespace(input_buffer); + + /* swap valuestring and string, because we parsed the name */ + current_item->string = current_item->valuestring; + current_item->valuestring = NULL; + + if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != ':')) + { + goto fail; /* invalid object */ + } + + /* parse the value */ + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (!parse_value(current_item, input_buffer)) + { + goto fail; /* failed to parse value */ + } + buffer_skip_whitespace(input_buffer); + } + while (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ',')); + + if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != '}')) + { + goto fail; /* expected end of object */ + } + +success: + input_buffer->depth--; + + item->type = cJSON_Object; + item->child = head; + + input_buffer->offset++; + return true; + +fail: + if (head != NULL) + { + cJSON_Delete(head); + } + + return false; +} + +/* Render an object to text. */ +static cJSON_bool print_object(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output_pointer = NULL; + size_t length = 0; + cJSON *current_item = item->child; + + if (output_buffer == NULL) + { + return false; + } + + /* Compose the output: */ + length = (size_t) (output_buffer->format ? 2 : 1); /* fmt: {\n */ + output_pointer = ensure(output_buffer, length + 1); + if (output_pointer == NULL) + { + return false; + } + + *output_pointer++ = '{'; + output_buffer->depth++; + if (output_buffer->format) + { + *output_pointer++ = '\n'; + } + output_buffer->offset += length; + + while (current_item) + { + if (output_buffer->format) + { + size_t i; + output_pointer = ensure(output_buffer, output_buffer->depth); + if (output_pointer == NULL) + { + return false; + } + for (i = 0; i < output_buffer->depth; i++) + { + *output_pointer++ = '\t'; + } + output_buffer->offset += output_buffer->depth; + } + + /* print key */ + if (!print_string_ptr((unsigned char*)current_item->string, output_buffer)) + { + return false; + } + update_offset(output_buffer); + + length = (size_t) (output_buffer->format ? 2 : 1); + output_pointer = ensure(output_buffer, length); + if (output_pointer == NULL) + { + return false; + } + *output_pointer++ = ':'; + if (output_buffer->format) + { + *output_pointer++ = '\t'; + } + output_buffer->offset += length; + + /* print value */ + if (!print_value(current_item, output_buffer)) + { + return false; + } + update_offset(output_buffer); + + /* print comma if not last */ + length = (size_t) ((output_buffer->format ? 1 : 0) + (current_item->next ? 1 : 0)); + output_pointer = ensure(output_buffer, length + 1); + if (output_pointer == NULL) + { + return false; + } + if (current_item->next) + { + *output_pointer++ = ','; + } + + if (output_buffer->format) + { + *output_pointer++ = '\n'; + } + *output_pointer = '\0'; + output_buffer->offset += length; + + current_item = current_item->next; + } + + output_pointer = ensure(output_buffer, output_buffer->format ? (output_buffer->depth + 1) : 2); + if (output_pointer == NULL) + { + return false; + } + if (output_buffer->format) + { + size_t i; + for (i = 0; i < (output_buffer->depth - 1); i++) + { + *output_pointer++ = '\t'; + } + } + *output_pointer++ = '}'; + *output_pointer = '\0'; + output_buffer->depth--; + + return true; +} + +/* Get Array size/item / object item. */ +CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array) +{ + cJSON *child = NULL; + size_t size = 0; + + if (array == NULL) + { + return 0; + } + + child = array->child; + + while(child != NULL) + { + size++; + child = child->next; + } + + /* FIXME: Can overflow here. Cannot be fixed without breaking the API */ + + return (int)size; +} + +static cJSON* get_array_item(const cJSON *array, size_t index) +{ + cJSON *current_child = NULL; + + if (array == NULL) + { + return NULL; + } + + current_child = array->child; + while ((current_child != NULL) && (index > 0)) + { + index--; + current_child = current_child->next; + } + + return current_child; +} + +CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index) +{ + if (index < 0) + { + return NULL; + } + + return get_array_item(array, (size_t)index); +} + +static cJSON *get_object_item(const cJSON * const object, const char * const name, const cJSON_bool case_sensitive) +{ + cJSON *current_element = NULL; + + if ((object == NULL) || (name == NULL)) + { + return NULL; + } + + current_element = object->child; + if (case_sensitive) + { + while ((current_element != NULL) && (strcmp(name, current_element->string) != 0)) + { + current_element = current_element->next; + } + } + else + { + while ((current_element != NULL) && (case_insensitive_strcmp((const unsigned char*)name, (const unsigned char*)(current_element->string)) != 0)) + { + current_element = current_element->next; + } + } + + return current_element; +} + +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string) +{ + return get_object_item(object, string, false); +} + +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string) +{ + return get_object_item(object, string, true); +} + +CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string) +{ + return cJSON_GetObjectItem(object, string) ? 1 : 0; +} + +/* Utility for array list handling. */ +static void suffix_object(cJSON *prev, cJSON *item) +{ + prev->next = item; + item->prev = prev; +} + +/* Utility for handling references. */ +static cJSON *create_reference(const cJSON *item, const internal_hooks * const hooks) +{ + cJSON *reference = NULL; + if (item == NULL) + { + return NULL; + } + + reference = cJSON_New_Item(hooks); + if (reference == NULL) + { + return NULL; + } + + memcpy(reference, item, sizeof(cJSON)); + reference->string = NULL; + reference->type |= cJSON_IsReference; + reference->next = reference->prev = NULL; + return reference; +} + +/* Add item to array/object. */ +CJSON_PUBLIC(void) cJSON_AddItemToArray(cJSON *array, cJSON *item) +{ + cJSON *child = NULL; + + if ((item == NULL) || (array == NULL)) + { + return; + } + + child = array->child; + + if (child == NULL) + { + /* list is empty, start new one */ + array->child = item; + } + else + { + /* append to the end */ + while (child->next) + { + child = child->next; + } + suffix_object(child, item); + } +} + +CJSON_PUBLIC(void) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item) +{ + if (item == NULL) + { + return; + } + + /* call cJSON_AddItemToObjectCS for code reuse */ + cJSON_AddItemToObjectCS(object, (char*)cJSON_strdup((const unsigned char*)string, &global_hooks), item); + /* remove cJSON_StringIsConst flag */ + item->type &= ~cJSON_StringIsConst; +} + +#if defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) + #pragma GCC diagnostic push +#endif +#ifdef __GNUC__ +#pragma GCC diagnostic ignored "-Wcast-qual" +#endif + +/* Add an item to an object with constant string as key */ +CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item) +{ + if ((item == NULL) || (string == NULL)) + { + return; + } + if (!(item->type & cJSON_StringIsConst) && item->string) + { + global_hooks.deallocate(item->string); + } + item->string = (char*)string; + item->type |= cJSON_StringIsConst; + cJSON_AddItemToArray(object, item); +} +#if defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) + #pragma GCC diagnostic pop +#endif + +CJSON_PUBLIC(void) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) +{ + if (array == NULL) + { + return; + } + + cJSON_AddItemToArray(array, create_reference(item, &global_hooks)); +} + +CJSON_PUBLIC(void) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item) +{ + if ((object == NULL) || (string == NULL)) + { + return; + } + + cJSON_AddItemToObject(object, string, create_reference(item, &global_hooks)); +} + +CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item) +{ + if ((parent == NULL) || (item == NULL)) + { + return NULL; + } + + if (item->prev != NULL) + { + /* not the first element */ + item->prev->next = item->next; + } + if (item->next != NULL) + { + /* not the last element */ + item->next->prev = item->prev; + } + + if (item == parent->child) + { + /* first element */ + parent->child = item->next; + } + /* make sure the detached item doesn't point anywhere anymore */ + item->prev = NULL; + item->next = NULL; + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which) +{ + if (which < 0) + { + return NULL; + } + + return cJSON_DetachItemViaPointer(array, get_array_item(array, (size_t)which)); +} + +CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which) +{ + cJSON_Delete(cJSON_DetachItemFromArray(array, which)); +} + +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string) +{ + cJSON *to_detach = cJSON_GetObjectItem(object, string); + + return cJSON_DetachItemViaPointer(object, to_detach); +} + +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string) +{ + cJSON *to_detach = cJSON_GetObjectItemCaseSensitive(object, string); + + return cJSON_DetachItemViaPointer(object, to_detach); +} + +CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string) +{ + cJSON_Delete(cJSON_DetachItemFromObject(object, string)); +} + +CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string) +{ + cJSON_Delete(cJSON_DetachItemFromObjectCaseSensitive(object, string)); +} + +/* Replace array/object items with new ones. */ +CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem) +{ + cJSON *after_inserted = NULL; + + if (which < 0) + { + return; + } + + after_inserted = get_array_item(array, (size_t)which); + if (after_inserted == NULL) + { + cJSON_AddItemToArray(array, newitem); + return; + } + + newitem->next = after_inserted; + newitem->prev = after_inserted->prev; + after_inserted->prev = newitem; + if (after_inserted == array->child) + { + array->child = newitem; + } + else + { + newitem->prev->next = newitem; + } +} + +CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement) +{ + if ((parent == NULL) || (replacement == NULL) || (item == NULL)) + { + return false; + } + + if (replacement == item) + { + return true; + } + + replacement->next = item->next; + replacement->prev = item->prev; + + if (replacement->next != NULL) + { + replacement->next->prev = replacement; + } + if (replacement->prev != NULL) + { + replacement->prev->next = replacement; + } + if (parent->child == item) + { + parent->child = replacement; + } + + item->next = NULL; + item->prev = NULL; + cJSON_Delete(item); + + return true; +} + +CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem) +{ + if (which < 0) + { + return; + } + + cJSON_ReplaceItemViaPointer(array, get_array_item(array, (size_t)which), newitem); +} + +static cJSON_bool replace_item_in_object(cJSON *object, const char *string, cJSON *replacement, cJSON_bool case_sensitive) +{ + if ((replacement == NULL) || (string == NULL)) + { + return false; + } + + /* replace the name in the replacement */ + if (!(replacement->type & cJSON_StringIsConst) && (replacement->string != NULL)) + { + cJSON_free(replacement->string); + } + replacement->string = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); + replacement->type &= ~cJSON_StringIsConst; + + cJSON_ReplaceItemViaPointer(object, get_object_item(object, string, case_sensitive), replacement); + + return true; +} + +CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newitem) +{ + replace_item_in_object(object, string, newitem, false); +} + +CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object, const char *string, cJSON *newitem) +{ + replace_item_in_object(object, string, newitem, true); +} + +/* Create basic types: */ +CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_NULL; + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateTrue(void) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_True; + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_False; + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool b) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = b ? cJSON_True : cJSON_False; + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_Number; + item->valuedouble = num; + + /* use saturation in case of overflow */ + if (num >= INT_MAX) + { + item->valueint = INT_MAX; + } + else if (num <= INT_MIN) + { + item->valueint = INT_MIN; + } + else + { + item->valueint = (int)num; + } + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_String; + item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); + if(!item->valuestring) + { + cJSON_Delete(item); + return NULL; + } + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_Raw; + item->valuestring = (char*)cJSON_strdup((const unsigned char*)raw, &global_hooks); + if(!item->valuestring) + { + cJSON_Delete(item); + return NULL; + } + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type=cJSON_Array; + } + + return item; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void) +{ + cJSON *item = cJSON_New_Item(&global_hooks); + if (item) + { + item->type = cJSON_Object; + } + + return item; +} + +/* Create Arrays: */ +CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count) +{ + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (numbers == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + for(i = 0; a && (i < (size_t)count); i++) + { + n = cJSON_CreateNumber(numbers[i]); + if (!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p, n); + } + p = n; + } + + return a; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count) +{ + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (numbers == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + + for(i = 0; a && (i < (size_t)count); i++) + { + n = cJSON_CreateNumber((double)numbers[i]); + if(!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p, n); + } + p = n; + } + + return a; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count) +{ + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (numbers == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + + for(i = 0;a && (i < (size_t)count); i++) + { + n = cJSON_CreateNumber(numbers[i]); + if(!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p, n); + } + p = n; + } + + return a; +} + +CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char **strings, int count) +{ + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (strings == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + + for (i = 0; a && (i < (size_t)count); i++) + { + n = cJSON_CreateString(strings[i]); + if(!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p,n); + } + p = n; + } + + return a; +} + +/* Duplication */ +CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse) +{ + cJSON *newitem = NULL; + cJSON *child = NULL; + cJSON *next = NULL; + cJSON *newchild = NULL; + + /* Bail on bad ptr */ + if (!item) + { + goto fail; + } + /* Create new item */ + newitem = cJSON_New_Item(&global_hooks); + if (!newitem) + { + goto fail; + } + /* Copy over all vars */ + newitem->type = item->type & (~cJSON_IsReference); + newitem->valueint = item->valueint; + newitem->valuedouble = item->valuedouble; + if (item->valuestring) + { + newitem->valuestring = (char*)cJSON_strdup((unsigned char*)item->valuestring, &global_hooks); + if (!newitem->valuestring) + { + goto fail; + } + } + if (item->string) + { + newitem->string = (item->type&cJSON_StringIsConst) ? item->string : (char*)cJSON_strdup((unsigned char*)item->string, &global_hooks); + if (!newitem->string) + { + goto fail; + } + } + /* If non-recursive, then we're done! */ + if (!recurse) + { + return newitem; + } + /* Walk the ->next chain for the child. */ + child = item->child; + while (child != NULL) + { + newchild = cJSON_Duplicate(child, true); /* Duplicate (with recurse) each item in the ->next chain */ + if (!newchild) + { + goto fail; + } + if (next != NULL) + { + /* If newitem->child already set, then crosswire ->prev and ->next and move on */ + next->next = newchild; + newchild->prev = next; + next = newchild; + } + else + { + /* Set newitem->child and move to it */ + newitem->child = newchild; + next = newchild; + } + child = child->next; + } + + return newitem; + +fail: + if (newitem != NULL) + { + cJSON_Delete(newitem); + } + + return NULL; +} + +CJSON_PUBLIC(void) cJSON_Minify(char *json) +{ + unsigned char *into = (unsigned char*)json; + + if (json == NULL) + { + return; + } + + while (*json) + { + if (*json == ' ') + { + json++; + } + else if (*json == '\t') + { + /* Whitespace characters. */ + json++; + } + else if (*json == '\r') + { + json++; + } + else if (*json=='\n') + { + json++; + } + else if ((*json == '/') && (json[1] == '/')) + { + /* double-slash comments, to end of line. */ + while (*json && (*json != '\n')) + { + json++; + } + } + else if ((*json == '/') && (json[1] == '*')) + { + /* multiline comments. */ + while (*json && !((*json == '*') && (json[1] == '/'))) + { + json++; + } + json += 2; + } + else if (*json == '\"') + { + /* string literals, which are \" sensitive. */ + *into++ = (unsigned char)*json++; + while (*json && (*json != '\"')) + { + if (*json == '\\') + { + *into++ = (unsigned char)*json++; + } + *into++ = (unsigned char)*json++; + } + *into++ = (unsigned char)*json++; + } + else + { + /* All other characters. */ + *into++ = (unsigned char)*json++; + } + } + + /* and null-terminate. */ + *into = '\0'; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_Invalid; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsFalse(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_False; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsTrue(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xff) == cJSON_True; +} + + +CJSON_PUBLIC(cJSON_bool) cJSON_IsBool(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & (cJSON_True | cJSON_False)) != 0; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsNull(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_NULL; +} + + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file transponder_agent/agent_cjson.c + * @brief Check if the item is a number (double) + * + * @param item + * + * @author Ricardo Martínez + * @date 2017 + */ +///////////////////////////////////////////////////////////////////////////////////////// +CJSON_PUBLIC(cJSON_bool) cJSON_IsNumber(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_Number; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file transponder_agent/agent_cjson.c + * @brief Check if the item is a string + * + * @param item + * + * @author Ricardo Martínez + * @date 2017 + */ +///////////////////////////////////////////////////////////////////////////////////////// +CJSON_PUBLIC(cJSON_bool) cJSON_IsString(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_String; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsArray(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_Array; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsObject(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_Object; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_IsRaw(const cJSON * const item) +{ + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_Raw; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive) +{ + if ((a == NULL) || (b == NULL) || ((a->type & 0xFF) != (b->type & 0xFF)) || cJSON_IsInvalid(a)) + { + return false; + } + + /* check if type is valid */ + switch (a->type & 0xFF) + { + case cJSON_False: + case cJSON_True: + case cJSON_NULL: + case cJSON_Number: + case cJSON_String: + case cJSON_Raw: + case cJSON_Array: + case cJSON_Object: + break; + + default: + return false; + } + + /* identical objects are equal */ + if (a == b) + { + return true; + } + + switch (a->type & 0xFF) + { + /* in these cases and equal type is enough */ + case cJSON_False: + case cJSON_True: + case cJSON_NULL: + return true; + + case cJSON_Number: + if (a->valuedouble == b->valuedouble) + { + return true; + } + return false; + + case cJSON_String: + case cJSON_Raw: + if ((a->valuestring == NULL) || (b->valuestring == NULL)) + { + return false; + } + if (strcmp(a->valuestring, b->valuestring) == 0) + { + return true; + } + + return false; + + case cJSON_Array: + { + cJSON *a_element = a->child; + cJSON *b_element = b->child; + + for (; (a_element != NULL) && (b_element != NULL);) + { + if (!cJSON_Compare(a_element, b_element, case_sensitive)) + { + return false; + } + + a_element = a_element->next; + b_element = b_element->next; + } + + /* one of the arrays is longer than the other */ + if (a_element != b_element) { + return false; + } + + return true; + } + + case cJSON_Object: + { + cJSON *a_element = NULL; + cJSON *b_element = NULL; + cJSON_ArrayForEach(a_element, a) + { + /* TODO This has O(n^2) runtime, which is horrible! */ + b_element = get_object_item(b, a_element->string, case_sensitive); + if (b_element == NULL) + { + return false; + } + + if (!cJSON_Compare(a_element, b_element, case_sensitive)) + { + return false; + } + } + + /* doing this twice, once on a and b to prevent true comparison if a subset of b + * TODO: Do this the proper way, this is just a fix for now */ + cJSON_ArrayForEach(b_element, b) + { + a_element = get_object_item(a, b_element->string, case_sensitive); + if (a_element == NULL) + { + return false; + } + + if (!cJSON_Compare(b_element, a_element, case_sensitive)) + { + return false; + } + } + + return true; + } + + default: + return false; + } +} + +CJSON_PUBLIC(void *) cJSON_malloc(size_t size) +{ + return global_hooks.allocate(size); +} + +CJSON_PUBLIC(void) cJSON_free(void *object) +{ + global_hooks.deallocate(object); +} diff --git a/src/pathcomp/backend/pathComp_cjson.h b/src/pathcomp/backend/pathComp_cjson.h new file mode 100644 index 0000000000000000000000000000000000000000..dbd233889fc04b8da3a04334d1c8b1e622771690 --- /dev/null +++ b/src/pathcomp/backend/pathComp_cjson.h @@ -0,0 +1,210 @@ +/* + * 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. + */ + +#ifndef _PATHCOMP_CJSON_H +#define _PATHCOMP_CJSON_H + + +#include +#include +#include + +#include + +/* project version */ +#define CJSON_VERSION_MAJOR 1 +#define CJSON_VERSION_MINOR 6 +#define CJSON_VERSION_PATCH 0 + + +/* cJSON Types: */ +#define cJSON_Invalid (0) +#define cJSON_False (1 << 0) +#define cJSON_True (1 << 1) +#define cJSON_NULL (1 << 2) +#define cJSON_Number (1 << 3) +#define cJSON_String (1 << 4) +#define cJSON_Array (1 << 5) +#define cJSON_Object (1 << 6) +#define cJSON_Raw (1 << 7) /* raw json */ + +#define cJSON_IsReference 256 +#define cJSON_StringIsConst 512 + +#define CJSON_PUBLIC(type) type + +#define CJSON_NESTING_LIMIT 1000 + +/* The cJSON structure: */ +typedef struct cJSON +{ + /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */ + struct cJSON *next; + struct cJSON *prev; + /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */ + struct cJSON *child; + + /* The type of the item, as above. */ + int type; + + /* The item's string, if type==cJSON_String and type == cJSON_Raw */ + char *valuestring; + /* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */ + int valueint; + /* The item's number, if type==cJSON_Number */ + double valuedouble; + + /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */ + char *string; +} cJSON; + +typedef struct cJSON_Hooks +{ + void *(*malloc_fn)(size_t sz); + void (*free_fn)(void *ptr); +} cJSON_Hooks; + +typedef int cJSON_bool; + +/* returns the version of cJSON as a string */ +CJSON_PUBLIC(const char*) cJSON_Version(void); + +/* Supply malloc, realloc and free functions to cJSON */ +CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks); + +/* Memory Management: the caller is always responsible to free the results from all variants of cJSON_Parse (with cJSON_Delete) and cJSON_Print (with stdlib free, cJSON_Hooks.free_fn, or cJSON_free as appropriate). The exception is cJSON_PrintPreallocated, where the caller has full responsibility of the buffer. */ +/* Supply a block of JSON, and this returns a cJSON object you can interrogate. */ +CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value); +/* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */ +/* If you supply a ptr in return_parse_end and parsing fails, then return_parse_end will contain a pointer to the error so will match cJSON_GetErrorPtr(). */ +CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated); + +/* Render a cJSON entity to text for transfer/storage. */ +CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item); +/* Render a cJSON entity to text for transfer/storage without any formatting. */ +CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item); +/* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */ +CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt); +/* Render a cJSON entity to text using a buffer already allocated in memory with given length. Returns 1 on success and 0 on failure. */ +/* NOTE: cJSON is not always 100% accurate in estimating how much memory it will use, so to be safe allocate 5 bytes more than you actually need */ +CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format); +/* Delete a cJSON entity and all subentities. */ +CJSON_PUBLIC(void) cJSON_Delete(cJSON *c); + +/* Returns the number of items in an array (or object). */ +CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array); +/* Retrieve item number "item" from array "array". Returns NULL if unsuccessful. */ +CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index); +/* Get item "string" from object. Case insensitive. */ +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string); +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string); +CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string); +/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */ +CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void); + +/* These functions check the type of an item */ +CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsFalse(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsTrue(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsBool(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsNull(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsNumber(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsString(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsArray(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsObject(const cJSON * const item); +CJSON_PUBLIC(cJSON_bool) cJSON_IsRaw(const cJSON * const item); + +/* These calls create a cJSON item of the appropriate type. */ +CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void); +CJSON_PUBLIC(cJSON *) cJSON_CreateTrue(void); +CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void); +CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool boolean); +CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num); +CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string); +/* raw json */ +CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw); +CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void); +CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void); + +/* These utilities create an Array of count items. */ +CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count); +CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count); +CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count); +CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char **strings, int count); + +/* Append item to the specified array/object. */ +CJSON_PUBLIC(void) cJSON_AddItemToArray(cJSON *array, cJSON *item); +CJSON_PUBLIC(void) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item); +/* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object. + * WARNING: When this function was used, make sure to always check that (item->type & cJSON_StringIsConst) is zero before + * writing to `item->string` */ +CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item); +/* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */ +CJSON_PUBLIC(void) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item); +CJSON_PUBLIC(void) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item); + +/* Remove/Detatch items from Arrays/Objects. */ +CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item); +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which); +CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which); +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string); +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string); +CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string); +CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string); + +/* Update array items. */ +CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem); /* Shifts pre-existing items to the right. */ +CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement); +CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem); +CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem); +CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object,const char *string,cJSON *newitem); + +/* Duplicate a cJSON item */ +CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse); +/* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will +need to be released. With recurse!=0, it will duplicate any children connected to the item. +The item->next and ->prev pointers are always zero on return from Duplicate. */ +/* Recursively compare two cJSON items for equality. If either a or b is NULL or invalid, they will be considered unequal. + * case_sensitive determines if object keys are treated case sensitive (1) or case insensitive (0) */ +CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive); + + +CJSON_PUBLIC(void) cJSON_Minify(char *json); + +/* Macros for creating things quickly. */ +#define cJSON_AddNullToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateNull()) +#define cJSON_AddTrueToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue()) +#define cJSON_AddFalseToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse()) +#define cJSON_AddBoolToObject(object,name,b) cJSON_AddItemToObject(object, name, cJSON_CreateBool(b)) +#define cJSON_AddNumberToObject(object,name,n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n)) +#define cJSON_AddStringToObject(object,name,s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s)) +#define cJSON_AddRawToObject(object,name,s) cJSON_AddItemToObject(object, name, cJSON_CreateRaw(s)) + +/* When assigning an integer value, it needs to be propagated to valuedouble too. */ +#define cJSON_SetIntValue(object, number) ((object) ? (object)->valueint = (object)->valuedouble = (number) : (number)) +/* helper for the cJSON_SetNumberValue macro */ +CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number); +#define cJSON_SetNumberValue(object, number) ((object != NULL) ? cJSON_SetNumberHelper(object, (double)number) : (number)) + +/* Macro for iterating over an array or object */ +#define cJSON_ArrayForEach(element, array) for(element = (array != NULL) ? (array)->child : NULL; element != NULL; element = element->next) + +/* malloc/free objects using the malloc/free functions that have been set with cJSON_InitHooks */ +CJSON_PUBLIC(void *) cJSON_malloc(size_t size); +CJSON_PUBLIC(void) cJSON_free(void *object); + + +#endif diff --git a/src/pathcomp/backend/pathComp_ksp.c b/src/pathcomp/backend/pathComp_ksp.c new file mode 100644 index 0000000000000000000000000000000000000000..4ea413d5eabbccbe1f86a3bc94edca822ffc4e8d --- /dev/null +++ b/src/pathcomp/backend/pathComp_ksp.c @@ -0,0 +1,542 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pathComp_log.h" +#include "pathComp_tools.h" +#include "pathComp_ksp.h" + +// Global Variables +struct map_nodes_t *mapNodes; +struct graph_t *graph; +struct contextSet_t* contextSet; + +/////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_ksp.c + * @brief Dijkstra algorithm + * + * @param srcMapIndex + * @param dstMapIndex + * @param g + * @param s + * @param SN + * @param RP + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void sp_comp(gint srcMapIndex, gint dstMapIndex, struct graph_t* g, struct service_t* s, + struct nodes_t* SN, struct compRouteOutputItem_t* RP) { + g_assert(s); + g_assert(g); + + // Set params into mapNodes related to the source nodes of the request + mapNodes->map[srcMapIndex].distance = 0.0; + mapNodes->map[srcMapIndex].latency = 0.0; + mapNodes->map[srcMapIndex].avaiBandwidth = 0.0; + + // Initialize the set Q and S + GList* S = NULL, * Q = NULL; + gint indexVertice = -1; + + // Add the source into the Q + struct nodeItem_t* nodeItem = g_malloc0(sizeof(struct nodeItem_t)); + if (nodeItem == NULL) { + DEBUG_PC("memory allocation failed\n"); + exit(-1); + } + // initialize some nodeItem attributes + nodeItem->distance = 0.0; + nodeItem->latency = 0.0; + duplicate_node_id(&mapNodes->map[srcMapIndex].verticeId, &nodeItem->node); + Q = g_list_insert_sorted(Q, nodeItem, sort_by_distance); + + // Check whether there is spurNode (SN) and rootPath (RP) + if (SN != NULL && RP != NULL) { + struct routeElement_t* re; + for (gint j = 0; j < RP->numRouteElements; j++) + { + // Get the source and target Nodes of the routeElement within the rootPath + re = &RP->routeElement[j]; + DEBUG_PC ("root Link: aNodeId: %s (%s) --> zNodeiId: %s (%s)", re->aNodeId.nodeId, re->aEndPointId, re->zNodeId.nodeId, re->zEndPointId); + + // if ingress of the root link (aNodeId) is the spurNode, then stops + if (compare_node_id(&re->aNodeId, SN) == 0) + { + DEBUG_PC ("root Link: aNodeId: %s and spurNode: %s -- stop exploring the rootPath (RP)", re->aNodeId.nodeId, SN->nodeId); + break; + } + // Extract from Q + GList* listnode = g_list_first(Q); + struct nodeItem_t* node = (struct nodeItem_t*)(listnode->data); + Q = g_list_remove(Q, node); + + //DEBUG_RL_RA ("Exploring node %s", node->node.nodeId); + indexVertice = graph_vertice_lookup(node->node.nodeId, g); + g_assert(indexVertice >= 0); + + // Get the indexTargetedVertice + gint indexTVertice = -1; + indexTVertice = graph_targeted_vertice_lookup(indexVertice, re->zNodeId.nodeId, g); + gint done = check_link(node, indexVertice, indexTVertice, g, s, &S, &Q, mapNodes); + (void)done; + + // Add to the S list + S = g_list_append(S, node); + } + + // Check that the first node in Q set is SpurNode, otherwise something went wrong ... + if (compare_node_id(&re->aNodeId, SN) != 0) { + //DEBUG_PC ("root Link: aNodeId: %s is NOT the spurNode: %s -- something wrong", re->aNodeId.nodeId, SN->nodeId); + g_list_free_full(S, g_free); + g_list_free_full(Q, g_free); + return; + } + } + while (g_list_length(Q) > 0) { + //Extract from Q set + GList* listnode = g_list_first(Q); + struct nodeItem_t* node = (struct nodeItem_t*)(listnode->data); + Q = g_list_remove(Q, node); + DEBUG_PC ("Q length: %d", g_list_length (Q)); + DEBUG_PC ("DeviceId: %s", node->node.nodeId); + + // visit all the links from u within the graph + indexVertice = graph_vertice_lookup(node->node.nodeId, g); + g_assert(indexVertice >= 0); + + // Check the targeted vertices from u + for (gint i = 0; i < g->vertices[indexVertice].numTargetedVertices; i++) { + gint done = check_link(node, indexVertice, i, g, s, &S, &Q, mapNodes); + (void)done; + } + // Add node into the S Set + S = g_list_append(S, node); + //DEBUG_PC ("S length: %d", g_list_length (S)); + } + g_list_free_full(S, g_free); + g_list_free_full(Q, g_free); + return; +} + +/////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_ksp.c + * @brief KSP computation using Dijkstra algorithm + * + * @param pred + * @param g + * @param s + * @param SN + * @param RP + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +gint ksp_comp(struct pred_t* pred, struct graph_t* g, struct service_t* s, + struct nodes_t *SN, struct compRouteOutputItem_t *RP) { + g_assert(pred); + g_assert(g); + g_assert(s); + + // Check the both ingress src and dst endpoints are in the graph + gint srcMapIndex = get_map_index_by_nodeId(s->service_endpoints_id[0].device_uuid, mapNodes); + if (srcMapIndex == -1) { + DEBUG_PC("ingress DeviceId: %s NOT in the graph", s->service_endpoints_id[0].device_uuid); + return -1; + } + + gint dstMapIndex = get_map_index_by_nodeId(s->service_endpoints_id[1].device_uuid, mapNodes); + if (dstMapIndex == -1) { + DEBUG_PC("egress DeviceId: %s NOT in the graph", s->service_endpoints_id[1].device_uuid); + return -1; + } + + // Compute the shortest path route + sp_comp(srcMapIndex, dstMapIndex, g, s, SN, RP); + + // Check that a feasible solution in term of latency and bandwidth is found + gint map_dstIndex = get_map_index_by_nodeId(s->service_endpoints_id[1].device_uuid, mapNodes); + struct map_t* dest_map = &mapNodes->map[map_dstIndex]; + if (!(dest_map->distance < INFINITY_COST)) { + DEBUG_PC("destination: %s NOT reachable", s->service_endpoints_id[1].device_uuid); + return -1; + } + + DEBUG_PC("AvailBw @ %s is %f", dest_map->verticeId.nodeId, dest_map->avaiBandwidth); + // Check that the computed available bandwidth is larger than 0.0 + if (dest_map->avaiBandwidth <= (gfloat)0.0) { + DEBUG_PC("dst: %s NOT REACHABLE", s->service_endpoints_id[1].device_uuid); + return -1; + } + DEBUG_PC("dst: %s REACHABLE", s->service_endpoints_id[1].device_uuid); + // Handle predecessors + build_predecessors(pred, s, mapNodes); + return 1; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_ksp.c + * @brief K-CSPF algorithm execution (YEN algorithm) + * + * @param s + * @param path + * @param g + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void alg_comp(struct service_t* s, struct compRouteOutput_t* path, struct graph_t *g) { + g_assert(s); + g_assert(path); + g_assert(g); + + // create map of devices/nodes to handle the path computation using the context + mapNodes = create_map_node(); + build_map_node(mapNodes, g); + + // predecessors to store the computed path + struct pred_t* predecessors = create_predecessors(); + + struct service_endpoints_id_t* iEp = &(s->service_endpoints_id[0]); + struct service_endpoints_id_t* eEp = &(s->service_endpoints_id[1]); + + // Compute the 1st KSP path + gint done = ksp_comp (predecessors, g, s, NULL, NULL); + if (done == -1) { + DEBUG_PC("NO PATH FOUND %s[%s] ---> %s[%s]", iEp->device_uuid, iEp->endpoint_uuid, eEp->device_uuid, eEp->endpoint_uuid); + comp_route_connection_issue_handler(path, s); + g_free(mapNodes); g_free(predecessors); + return; + } + + // Construct the path from the computed predecessors + struct compRouteOutputItem_t* p = create_path_item(); + //print_predecessors(predecessors); + build_path(p, predecessors, s); + //DEBUG_PC ("Path is constructed"); + + gint indexDest = get_map_index_by_nodeId(eEp->device_uuid, mapNodes); + struct map_t* dst_map = &mapNodes->map[indexDest]; + // Get the delay and cost + memcpy(&p->cost, &dst_map->distance, sizeof(gdouble)); + memcpy(&p->availCap, &dst_map->avaiBandwidth, sizeof(dst_map->avaiBandwidth)); + memcpy(&p->delay, &dst_map->latency, sizeof(mapNodes->map[indexDest].latency)); + DEBUG_PC ("Computed Path Avail Bw: %f, Path Cost: %f, latency: %f", p->availCap, p->cost, p->delay); + print_path(p); + + // If 1st SP satisfies the requirements from the req, STOP + gboolean feasibleRoute = check_computed_path_feasability(s, p); + if (feasibleRoute == TRUE) { + DEBUG_PC("1st K-CSPF FEASIBLE, STOP!"); + print_path (p); + path->numPaths++; + + // Copy the serviceId + DEBUG_PC("contextId: %s", s->serviceId.contextId); + copy_service_id(&path->serviceId, &s->serviceId); + + // copy the service endpoints, in general, there will be 2 (point-to-point network connectivity services) + for (gint i = 0; i < s->num_service_endpoints_id; i++) { + struct service_endpoints_id_t* iEp = &(s->service_endpoints_id[i]); + struct service_endpoints_id_t* oEp = &(path->service_endpoints_id[i]); + copy_service_endpoint_id(oEp, iEp); + } + path->num_service_endpoints_id = s->num_service_endpoints_id; + + // Copy the computed path + struct path_t* targetedPath = &(path->paths[path->numPaths - 1]); + duplicate_path_t(p, targetedPath); + print_path_t (targetedPath); + g_free(predecessors); + g_free(p); + g_free(mapNodes); + return; + } + + DEBUG_PC("1st CSPF COMPUTATION IS NOT FEASIBLE --> TRIGGER K COMPUTATIONS"); + // Create A and B sets of paths to handle the YEN algorithm + struct path_set_t* A = create_path_set(); + struct path_set_t* B = create_path_set(); + + // Add the previously computed path into A->paths[0] + duplicate_path(p, &A->paths[0]); + + A->numPaths++; + g_free(predecessors); + g_free(p); + for (gint k = 1; k < MAX_KSP_VALUE; k++) { + DEBUG_PC("------------ kth (%d) ---------------------", k); + struct compRouteOutputItem_t* p = create_path_item(); + duplicate_path(&A->paths[k - 1], p); + // The spurNode ranges from near-end node of the first link to the near-end of the last link forming the kth path + gint i = 0; + struct compRouteOutputItem_t* rootPath = create_path_item(); + for (i = 0; i < p->numRouteElements; i++) { + struct nodes_t* spurNode = create_node(); + struct nodes_t* nextSpurNode = create_node(); + struct routeElement_t* re = &(p->routeElement[i]); + // Create predecessors to store the computed path + struct pred_t* predecessors = create_predecessors(); + // Clear previous mapNodes, i.e. create it again + g_free(mapNodes); + mapNodes = create_map_node(); + build_map_node(mapNodes, g); + struct nodes_t* n = &re->aNodeId; + duplicate_node_id(n, spurNode); + n = &re->zNodeId; + duplicate_node_id(n, nextSpurNode); + DEBUG_PC("spurNode: %s --> nextSpurNode: %s", spurNode->nodeId, nextSpurNode->nodeId); + + // rootPath contains a set of links of A[k-1] from the source Node till the SpurNode -> NextSpurNode + // Example: A[k-1] = {L1, L2, L3, L4}, i.e. " Node_a -- L1 --> Node_b -- L2 --> Node_c -- L3 --> Node_d -- L4 --> Node_e " + // E.g., for the ith iteration if the spurNode = Node_c and NextSpurNode = Node_d; then rootPath = {L1, L2, L3} + add_routeElement_path_back(re, rootPath); + DEBUG_PC("rootPath:"); + print_path(rootPath); + + // For all existing and computed paths p in A check if from the source to the NextSpurNode + // the set of links matches with those contained in the rootPath + // If YES, remove from the auxiliary graph the next link in p from NextSpurNode + // Otherwise do nothing + struct graph_t* gAux = create_graph(); + // Baseline graph + //build_graph (gAux); + duplicate_graph(g, gAux); + // Modified graph + modify_targeted_graph(gAux, A, rootPath, spurNode); + + // Trigger the computation of the path from src to dst constrained to traverse all the links from src + // to spurNode contained into rootPath over the resulting graph + if (ksp_comp(predecessors, gAux, s, spurNode, rootPath) == -1) { + DEBUG_PC("FAILED SP from %s via spurNode: %s to %s", iEp->device_uuid, spurNode->nodeId, eEp->device_uuid); + g_free(nextSpurNode); + g_free(spurNode); + g_free(gAux); + g_free(predecessors); + continue; + } + DEBUG_PC("SUCCESFUL SP from %s via spurNode: %s to %s", iEp->device_uuid, spurNode->nodeId, eEp->device_uuid); + // Create the node list from the predecessors + struct compRouteOutputItem_t* newKpath = create_path_item(); + build_path(newKpath, predecessors, s); + DEBUG_PC("new K (for k: %d) Path is built", k); + gint indexDest = get_map_index_by_nodeId(eEp->device_uuid, mapNodes); + struct map_t* dst_map = &mapNodes->map[indexDest]; + + memcpy(&newKpath->cost, &dst_map->distance, sizeof(gdouble)); + memcpy(&newKpath->availCap, &dst_map->avaiBandwidth, sizeof(dst_map->avaiBandwidth)); + memcpy(&newKpath->delay, &dst_map->latency, sizeof(mapNodes->map[indexDest].latency)); + DEBUG_PC("New PATH (@ kth: %d) ADDED to B[%d] - {Path Cost: %f, e2e latency: %f, bw: %f ", k, B->numPaths, newKpath->cost, newKpath->delay, newKpath->availCap); + // Add the computed kth SP to the heap B + duplicate_path(newKpath, &B->paths[B->numPaths]); + B->numPaths++; + DEBUG_PC("Number of B paths: %d", B->numPaths); + + g_free(newKpath); + g_free(nextSpurNode); + g_free(spurNode); + g_free(gAux); + g_free(predecessors); + } + + // If B is empty then stops + if (B->numPaths == 0) { + DEBUG_PC("B does not have any path ... the stops kth computation"); + break; + } + + // Sort the potential paths contained in B by cost and latency and available bandwidth + sort_path_set(B); + + // Add the lowest path into A[k] + DEBUG_PC("-------------------------------------------------------------"); + DEBUG_PC("To Add SP from B[0] to A[%d] --- Path Cost: %f, e2e Latency: %f", A->numPaths, B->paths[0].cost, B->paths[0].delay); + duplicate_path(&B->paths[0], &A->paths[A->numPaths]); + A->numPaths++; + DEBUG_PC("A Set size: %d", A->numPaths); + DEBUG_PC("-------------------------------------------------------------"); + + // Remove/pòp front element from the path set B (i.e. remove B[0]) + pop_front_path_set(B); + DEBUG_PC("B Set Size: %d", B->numPaths); + } + + // Copy the serviceId + copy_service_id(&path->serviceId, &s->serviceId); + // copy the service endpoints, in general, there will be 2 (point-to-point network connectivity services) + for (gint m = 0; m < s->num_service_endpoints_id; m++) { + struct service_endpoints_id_t* iEp = &(s->service_endpoints_id[m]); + struct service_endpoints_id_t* oEp = &(path->service_endpoints_id[m]); + copy_service_endpoint_id(oEp, iEp); + } + + for (gint ksp = 1; ksp < A->numPaths; ksp++){ + if (ksp >= MAX_KSP_VALUE) { + DEBUG_PC("Number Requested paths (%d) REACHED - STOP", ksp); + break; + } + gdouble feasibleRoute = check_computed_path_feasability(s, &A->paths[ksp]); + if (feasibleRoute == TRUE) { + DEBUG_PC("A[k-th%d] available: %f, pathCost: %f; latency: %f", ksp, A->paths[ksp].availCap, A->paths[ksp].cost, A->paths[ksp].delay); + struct compRouteOutputItem_t* pathaux = &A->paths[ksp]; + path->numPaths++; + struct path_t* targetedPath = &path->paths[path->numPaths - 1]; + duplicate_path_t(pathaux, targetedPath); + print_path_t(targetedPath); + remove_path_set(A); + remove_path_set(B); + return; + } + } + remove_path_set(A); + remove_path_set(B); + // No paths found --> Issue + DEBUG_PC("K-SP failed!!!"); + comp_route_connection_issue_handler(path, s); + + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_ksp.c + * @brief Iterates over the list of network connectivity service requests + * to compute their own paths fulfilling the constraints + * + * @param outputList + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void ksp_alg_execution_services(struct compRouteOutputList_t* outputList) { + g_assert(outputList); + g_assert(contextSet); + g_assert(serviceList); + + DEBUG_PC("----- Starting the KSP Computation ------"); + + // Iterate over the list of requested network connectivity services + for (gint i = 0; i < serviceList->numServiceList; i++) { + struct service_t* service = &(serviceList->services[i]); + + DEBUG_PC("Starting the Computation for ServiceId: %s [ContextId: %s]", service->serviceId.service_uuid, service->serviceId.contextId); + struct compRouteOutput_t* pathService = &(outputList->compRouteConnection[i]); + // check endpoints of the service are different (PE devices/nodes are different) + if (same_src_dst_pe_nodeid(service) == 0) { + DEBUG_PC("PEs are the same... no path computation"); + comp_route_connection_issue_handler(pathService, service); + outputList->numCompRouteConnList++; + continue; + } + // get the graph associated to the contextId in the contextSet, if no then error + struct graph_t* g = get_graph_by_contextId(contextSet, service->serviceId.contextId); + if (g == NULL) { + DEBUG_PC("The targeted contextId is NOT in the ContextSet ... then NO graph"); + comp_route_connection_issue_handler(pathService, service); + outputList->numCompRouteConnList++; + continue; + } + alg_comp(service, pathService, g); + outputList->numCompRouteConnList++; + + // for each network connectivity service, a single computed path (out of the KCSP) is retuned + // If path is found, then the selected resources must be pre-assigned into the context information + if (pathService->noPathIssue == NO_PATH_CONS_ISSUE) + { + continue; + } + struct path_t* path = &(pathService->paths[pathService->numPaths - 1]); + allocate_graph_resources(path, service, g); + allocate_graph_reverse_resources(path, service, g); + print_graph(g); + } + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_ksp.c + * @brief handles the path computation triggering k-cspf algorithm + * + * @param compRouteOutput + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +gint pathComp_ksp_alg(struct compRouteOutputList_t * routeConnList) +{ + g_assert(routeConnList); + gint numSuccesPathComp = 0, numPathCompIntents = 0; + + DEBUG_PC ("================================================================"); + DEBUG_PC ("=========================== KSP ========================="); + DEBUG_PC ("================================================================"); + // increase the number of Path Comp. Intents + numPathCompIntents++; + gint http_code = HTTP_CODE_OK; + + // timestamp t0 + struct timeval t0; + gettimeofday(&t0, NULL); + + // Allocate memory for the context + contextSet = create_contextSet(); + // Build up the contextSet (>= 1) + build_contextSet(contextSet); + print_contextSet(contextSet); +#if 1 + //Triggering the path computation for each specific network connectivity service + ksp_alg_execution_services (routeConnList); + + // -- timestamp t1 + struct timeval t1, delta; + gettimeofday(&t1, NULL); + delta.tv_sec = t1.tv_sec - t0.tv_sec; + delta.tv_usec = t1.tv_usec - t0.tv_usec; + delta = tv_adjust(delta); + + numSuccesPathComp++; + update_stats_path_comp(routeConnList, delta, numSuccesPathComp, numPathCompIntents); + print_path_connection_list(routeConnList); +#endif + + g_free(contextSet); + return http_code; +} \ No newline at end of file diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceId.java b/src/pathcomp/backend/pathComp_ksp.h similarity index 58% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceId.java rename to src/pathcomp/backend/pathComp_ksp.h index af82cd4d41c417e201d5d014527304842ca472bb..ef52d315903d234568a88b024882654b459b94ff 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/DeviceId.java +++ b/src/pathcomp/backend/pathComp_ksp.h @@ -1,11 +1,11 @@ /* - * Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) + * Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, @@ -14,17 +14,15 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +#ifndef _PATHCOMP_KSP_H +#define _PATHCOMP_KSP_H -public class DeviceId { - private final Uuid deviceId; +#include +#include +#include - public DeviceId(Uuid deviceId) { - this.deviceId = deviceId; - } +// Prototype of external declaration of functions +gint pathComp_ksp_alg (struct compRouteOutputList_t *); - public Uuid getDeviceId() { - return deviceId; - } -} +#endif diff --git a/src/pathcomp/backend/pathComp_log.c b/src/pathcomp/backend/pathComp_log.c new file mode 100644 index 0000000000000000000000000000000000000000..1f78ce098888ed198744c8c59bf6458bf4ae8d00 --- /dev/null +++ b/src/pathcomp/backend/pathComp_log.c @@ -0,0 +1,186 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pathComp_log.h" + + +//////////////////////////////////////////////////////////////////////////////////////// + /** + * @file pathComp_log.c + * @brief Create a new variable + * + * @param size + * + * @author Ricardo Mart�nez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +struct stream* stream_new(size_t size) +{ + /** check values */ + g_assert(size > 0); + + struct stream* stream = g_malloc0(sizeof(struct stream)); + if (stream == NULL) + { + DEBUG_PC("%s memory failed\n", __FUNCTION__); + exit(-1); + } + + stream->data = g_malloc0(size); + if (stream->data == NULL) + { + DEBUG_PC("%s memory failed\n", __FUNCTION__); + exit(-1); + } + stream->size = size; + + /** check values */ + g_assert(stream != NULL); + + return stream; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_log.c + * @brief removal of a stream variable + * + * @param stream + * + * @author Ricardo Mart�nez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void stream_free(struct stream* s) +{ + /** check values */ + g_assert(s != NULL); + + //DEBUG_PC("s: %p, s->data: %p", s, s->data); + /** free data */ + g_free(s->data); + g_free(s); + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_log.c + * @brief reset the contents of the stream + * + * @param stream + * + * @author Ricardo Mart�nez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void stream_reset(struct stream* s) +{ + /** check values */ + g_assert(s != NULL); + g_assert(s->putp >= 0); + g_assert(s->endp >= 0); + g_assert(s->endp >= 0); + + /** reset */ + s->putp = 0; + s->endp = 0; + s->getp = 0; + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_log.c + * @brief Read over a TCP channel the contents + * + * @param channel + * @param ptr + * @nbytes + * + * @author Ricardo Mart�nez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +gint read_channel(GIOChannel* channel, guchar* ptr, gint nbytes) +{ + /** check values */ + g_assert(channel != NULL); + g_assert(ptr != NULL); + g_assert(nbytes >= 0); + + /** get the file descriptor */ + gint fd; + fd = g_io_channel_unix_get_fd(channel); + + gsize nread; + gint nleft; + GError* error = NULL; + GIOStatus status; + + nleft = nbytes; + + // Set blocking + int flags = fcntl(fd, F_GETFL, 0); + fcntl(fd, F_SETFL, flags &= ~O_NONBLOCK); + + while (nleft > 0) + { + status = g_io_channel_read_chars(channel, (void*)ptr, nleft, &nread, &error); + if (status != G_IO_STATUS_NORMAL) + { + //DEBUG_PC ("gio-test: ...from %d: G_IO_STATUS_%s\n", fd, + // (status == G_IO_STATUS_AGAIN ? "AGAIN" : + // (status == G_IO_STATUS_EOF ? "EOF" : + // (status == G_IO_STATUS_ERROR ? "ERROR" : "???")))); + return -1; + } + if (nread < 0) + { + return (nread); + } + else + { + if (nread == 0) + break; + } + + nleft -= nread; + ptr += nread; + } + + /** check values */ + g_assert(channel != NULL); + g_assert(ptr != NULL); + g_assert(nleft >= 0); + g_assert(nbytes >= 0); + + return nbytes - nleft; +} \ No newline at end of file diff --git a/src/pathcomp/backend/pathComp_log.h b/src/pathcomp/backend/pathComp_log.h new file mode 100644 index 0000000000000000000000000000000000000000..e9f12a5f1c40a4835915393e8f154cda46b4e918 --- /dev/null +++ b/src/pathcomp/backend/pathComp_log.h @@ -0,0 +1,85 @@ +/* + * 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. + */ + +#ifndef _PATHCOMP_LOG_H +#define _PATHCOMP_LOG_H + +#include +#include +#include + +#define MAXLENGTH 131072 + + /** Stream buffer. */ +struct stream +{ + struct stream *next; + + guchar* data; + + /** Put pointer. */ + gulong putp; + + /** Get pointer. */ + gulong getp; + + /** End of pointer. */ + gulong endp; + + /** Data size. */ + gulong size; +}; + +extern FILE* logfile; + +////////////////////////////////////////////////////// +// For debugging +////////////////////////////////////////////////////// +////////////////////////////////////////////////////// +// For debugging +////////////////////////////////////////////////////// +#define __SHORT_FILENAME__ \ + (strrchr(__FILE__,'/') \ + ? strrchr(__FILE__,'/')+1 \ + : __FILE__ \ + ) + +#define DEBUG_PC(format,...) \ +{ \ + if (logfile != NULL) \ + { \ + g_fprintf(logfile,"%s:%1.5d %30s "format"\n",\ + __SHORT_FILENAME__, \ + __LINE__, __FUNCTION__, ##__VA_ARGS__); \ + fflush(logfile); \ + } \ + else \ + { \ + g_fprintf(stdout,"%s:%1.5d %30s "format"\n", \ + __SHORT_FILENAME__, \ + __LINE__, __FUNCTION__, ##__VA_ARGS__); \ + fflush(stdout); \ + } \ +} + +//// Prototypes //////// +struct stream* stream_new(size_t); +void stream_free(struct stream*); +void stream_reset(struct stream*); + +gint read_channel(GIOChannel*, guchar*, gint); + +#endif \ No newline at end of file diff --git a/src/pathcomp/backend/pathComp_sp.c b/src/pathcomp/backend/pathComp_sp.c new file mode 100644 index 0000000000000000000000000000000000000000..447b0d2a6d002d12808f80c855c74f8d0b489743 --- /dev/null +++ b/src/pathcomp/backend/pathComp_sp.c @@ -0,0 +1,359 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pathComp_log.h" +#include "pathComp_tools.h" +#include "pathComp_sp.h" + +// Global Variables +struct map_nodes_t* mapNodes; +struct graph_t* graph; +struct contextSet_t* contextSet; + +/////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_sp.c + * @brief Excecution Dijkstra algorithm + * + * @param srcMapIndex + * @param dstMapIndex + * @param g + * @param s + * + * @author Ricardo Mart�nez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void dijkstra(gint srcMapIndex, gint dstMapIndex, struct graph_t* g, struct service_t* s) { + g_assert(s); + g_assert(g); + + // Set params into mapNodes related to the source nodes of the request + mapNodes->map[srcMapIndex].distance = 0.0; + mapNodes->map[srcMapIndex].latency = 0.0; + mapNodes->map[srcMapIndex].avaiBandwidth = 0.0; + + // Initialize the set Q and S + GList* S = NULL, *Q = NULL; + gint indexVertice = -1; + + // Add the source into the Q + struct nodeItem_t* nodeItem = g_malloc0(sizeof(struct nodeItem_t)); + if (nodeItem == NULL) { + DEBUG_PC("memory allocation failed\n"); + exit(-1); + } + // initialize some nodeItem attributes + nodeItem->distance = 0.0; + nodeItem->latency = 0.0; + duplicate_node_id(&mapNodes->map[srcMapIndex].verticeId, &nodeItem->node); + Q = g_list_insert_sorted(Q, nodeItem, sort_by_distance); + + while (g_list_length(Q) > 0) { + //Extract from Q set + GList* listnode = g_list_first(Q); + struct nodeItem_t* node = (struct nodeItem_t*)(listnode->data); + Q = g_list_remove(Q, node); + DEBUG_PC("Q length: %d", g_list_length(Q)); + DEBUG_PC("DeviceId: %s", node->node.nodeId); + + // visit all the links from u within the graph + indexVertice = graph_vertice_lookup(node->node.nodeId, g); + g_assert(indexVertice >= 0); + + // Check the targeted vertices from u + for (gint i = 0; i < g->vertices[indexVertice].numTargetedVertices; i++) { + gint done = check_link(node, indexVertice, i, g, s, &S, &Q, mapNodes); + (void)done; + } + // Add node into the S Set + S = g_list_append(S, node); + //DEBUG_PC ("S length: %d", g_list_length (S)); + } + g_list_free_full(S, g_free); + g_list_free_full(Q, g_free); + return; +} + +/////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_sp.c + * @brief handling the Dijkstra algorithm + * + * @param pred + * @param g + * @param s + * + * @author Ricardo Mart�nez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +gint computation(struct pred_t* pred, struct graph_t* g, struct service_t* s) { + g_assert(pred); + g_assert(g); + g_assert(s); + + // Check the both ingress src and dst endpoints are in the graph + gint srcMapIndex = get_map_index_by_nodeId(s->service_endpoints_id[0].device_uuid, mapNodes); + if (srcMapIndex == -1) { + DEBUG_PC("ingress DeviceId: %s NOT in the graph", s->service_endpoints_id[0].device_uuid); + return -1; + } + + gint dstMapIndex = get_map_index_by_nodeId(s->service_endpoints_id[1].device_uuid, mapNodes); + if (dstMapIndex == -1) { + DEBUG_PC("egress DeviceId: %s NOT in the graph", s->service_endpoints_id[1].device_uuid); + return -1; + } + + // Compute the shortest path + dijkstra(srcMapIndex, dstMapIndex, g, s); + + // Check that a feasible solution in term of latency and bandwidth is found + gint map_dstIndex = get_map_index_by_nodeId(s->service_endpoints_id[1].device_uuid, mapNodes); + struct map_t* dest_map = &mapNodes->map[map_dstIndex]; + if (!(dest_map->distance < INFINITY_COST)) { + DEBUG_PC("destination: %s NOT reachable", s->service_endpoints_id[1].device_uuid); + return -1; + } + + DEBUG_PC("AvailBw @ %s is %f", dest_map->verticeId.nodeId, dest_map->avaiBandwidth); + // Check that the computed available bandwidth is larger than 0.0 + if (dest_map->avaiBandwidth <= (gfloat)0.0) { + DEBUG_PC("dst: %s NOT REACHABLE", s->service_endpoints_id[1].device_uuid); + return -1; + } + DEBUG_PC("dst: %s REACHABLE", s->service_endpoints_id[1].device_uuid); + // Handle predecessors + build_predecessors(pred, s, mapNodes); + + return 1; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_sp.c + * @brief CSPF algorithm execution + * + * @param s + * @param path + * @param g + * + * @author Ricardo Mart�nez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void computation_shortest_path(struct service_t* s, struct compRouteOutput_t* path, struct graph_t* g) { + g_assert(s); + g_assert(path); + g_assert(g); + + // create map of devices / nodes to handle the path computation using the context + mapNodes = create_map_node(); + build_map_node(mapNodes, g); + + // predecessors to store the computed path + struct pred_t* predecessors = create_predecessors(); + + struct service_endpoints_id_t* iEp = &(s->service_endpoints_id[0]); + struct service_endpoints_id_t* eEp = &(s->service_endpoints_id[1]); + + // SP computation + gint done = computation(predecessors, g, s); + if (done == -1) { + DEBUG_PC("NO PATH FOUND %s[%s] ---> %s[%s]", iEp->device_uuid, iEp->endpoint_uuid, eEp->device_uuid, eEp->endpoint_uuid); + comp_route_connection_issue_handler(path, s); + g_free(mapNodes); g_free(predecessors); + return; + } + + // Construct the path from the computed predecessors + struct compRouteOutputItem_t* p = create_path_item(); + //print_predecessors(predecessors); + build_path(p, predecessors, s); + //DEBUG_PC ("Path is constructed"); + + gint indexDest = get_map_index_by_nodeId(eEp->device_uuid, mapNodes); + struct map_t* dst_map = &mapNodes->map[indexDest]; + // Get the delay and cost + memcpy(&p->cost, &dst_map->distance, sizeof(gdouble)); + memcpy(&p->availCap, &dst_map->avaiBandwidth, sizeof(dst_map->avaiBandwidth)); + memcpy(&p->delay, &dst_map->latency, sizeof(mapNodes->map[indexDest].latency)); + DEBUG_PC("Computed Path Avail Bw: %f, Path Cost: %f, latency: %f", p->availCap, p->cost, p->delay); + print_path(p); + + gboolean feasibleRoute = check_computed_path_feasability(s, p); + if (feasibleRoute == TRUE) { + DEBUG_PC("SP Feasible"); + print_path(p); + path->numPaths++; + + // Copy the serviceId + DEBUG_PC("contextId: %s", s->serviceId.contextId); + copy_service_id(&path->serviceId, &s->serviceId); + + // copy the service endpoints, in general, there will be 2 (point-to-point network connectivity services) + for (gint i = 0; i < s->num_service_endpoints_id; i++) { + struct service_endpoints_id_t* iEp = &(s->service_endpoints_id[i]); + struct service_endpoints_id_t* oEp = &(path->service_endpoints_id[i]); + copy_service_endpoint_id(oEp, iEp); + } + path->num_service_endpoints_id = s->num_service_endpoints_id; + + // Copy the computed path + struct path_t* targetedPath = &(path->paths[path->numPaths - 1]); + duplicate_path_t(p, targetedPath); + print_path_t(targetedPath); + g_free(predecessors); + g_free(p); + g_free(mapNodes); + return; + } + + DEBUG_PC("SP FAILED!!!"); + comp_route_connection_issue_handler(path, s); + + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_sp.c + * @brief Iterates over the list of network connectivity service requests + * to compute their own paths fulfilling the constraints + * + * @param outputList + * + * @author Ricardo Mart�nez + * @date 2022 + */ +void sp_execution_services(struct compRouteOutputList_t* oPathList) +{ + g_assert(oPathList); + g_assert(contextSet); + g_assert(serviceList); + + DEBUG_PC("----- Starting the SP Computation ------"); + + for (gint i = 0; i < serviceList->numServiceList; i++) { + struct service_t* service = &(serviceList->services[i]); + + DEBUG_PC("Starting the Computation for ServiceId: %s [ContextId: %s]", service->serviceId.service_uuid, service->serviceId.contextId); + struct compRouteOutput_t* pathService = &(oPathList->compRouteConnection[i]); + // check endpoints of the service are different (PE devices/nodes are different) + if (same_src_dst_pe_nodeid(service) == 0) { + DEBUG_PC("PEs are the same... no path computation"); + comp_route_connection_issue_handler(pathService, service); + oPathList->numCompRouteConnList++; + continue; + } + + // get the graph associated to the contextId in the contextSet, if no then error + struct graph_t* g = get_graph_by_contextId(contextSet, service->serviceId.contextId); + if (g == NULL) { + DEBUG_PC("The targeted contextId is NOT in the ContextSet ... then NO graph"); + comp_route_connection_issue_handler(pathService, service); + oPathList->numCompRouteConnList++; + continue; + } + + computation_shortest_path(service, pathService, g); + oPathList->numCompRouteConnList++; + + // for each network connectivity service, a single computed path (out of the KCSP) is retuned + // If path is found, then the selected resources must be pre-assigned into the context information + if (pathService->noPathIssue == NO_PATH_CONS_ISSUE) { + continue; + } + struct path_t* path = &(pathService->paths[pathService->numPaths - 1]); + allocate_graph_resources(path, service, g); + allocate_graph_reverse_resources(path, service, g); + print_graph(g); + } + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_sp.c + * @brief handles the path computation for the constrained shortest path + * + * @param compRouteOutput + * + * @author Ricardo Mart�nez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +gint pathComp_sp_alg(struct compRouteOutputList_t* routeConnList) +{ + g_assert(routeConnList); + + gint numSuccesPathComp = 0, numPathCompIntents = 0; + + DEBUG_PC("================================================================"); + DEBUG_PC("=========================== SP ========================="); + DEBUG_PC("================================================================"); + // increase the number of Path Comp. Intents + numPathCompIntents++; + gint http_code = HTTP_CODE_OK; + + // timestamp t0 + struct timeval t0; + gettimeofday(&t0, NULL); + + // Allocate memory for the context + contextSet = create_contextSet(); + // Build up the contextSet (>= 1) + build_contextSet(contextSet); + print_contextSet(contextSet); +#if 1 + //Triggering the path computation for each specific network connectivity service + sp_execution_services(routeConnList); + + // -- timestamp t1 + struct timeval t1, delta; + gettimeofday(&t1, NULL); + delta.tv_sec = t1.tv_sec - t0.tv_sec; + delta.tv_usec = t1.tv_usec - t0.tv_usec; + delta = tv_adjust(delta); + + numSuccesPathComp++; + update_stats_path_comp(routeConnList, delta, numSuccesPathComp, numPathCompIntents); + print_path_connection_list(routeConnList); +#endif + + g_free(contextSet); + return http_code; +} + + diff --git a/src/policy/src/main/java/eu/teraflow/policy/context/model/Uuid.java b/src/pathcomp/backend/pathComp_sp.h similarity index 59% rename from src/policy/src/main/java/eu/teraflow/policy/context/model/Uuid.java rename to src/pathcomp/backend/pathComp_sp.h index 857f7a51a2a8fed2ee954da8a9f4244a57c237be..5b2d31d43566bbdf9d9f927cfe4bca08be0a920b 100644 --- a/src/policy/src/main/java/eu/teraflow/policy/context/model/Uuid.java +++ b/src/pathcomp/backend/pathComp_sp.h @@ -1,11 +1,11 @@ /* - * Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) + * Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, @@ -14,17 +14,15 @@ * limitations under the License. */ -package eu.teraflow.policy.context.model; +#ifndef _PATHCOMP_SP_H +#define _PATHCOMP_SP_H -public class Uuid { - private String id; +#include +#include +#include - public Uuid(String id) { - this.id = id; - } + // Prototype of external declaration of functions +gint pathComp_sp_alg(struct compRouteOutputList_t*); - public String getId() { - return id; - } -} +#endif \ No newline at end of file diff --git a/src/pathcomp/backend/pathComp_tools.c b/src/pathcomp/backend/pathComp_tools.c new file mode 100644 index 0000000000000000000000000000000000000000..5f1748b1a58a0d1b935c064ef4b92ac8ee0da389 --- /dev/null +++ b/src/pathcomp/backend/pathComp_tools.c @@ -0,0 +1,2768 @@ +/* + * 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. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pathComp_log.h" +#include "pathComp.h" +#include "pathComp_tools.h" + +gint numPathCompIntents = 0; // number of events triggering the path computation +//gint numSuccesPathComp = 0; // number of events resulting in succesfully path computations fulfilling the constraints +struct timeval total_path_comp_time; +gdouble totalReqBw = 0.0; +gdouble totalServedBw = 0.0; + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Function for time processing + * + * @param a + * + * @author Ricardo Martínez + * @date 2022 + */ + //////////////////////////////////////////////////////////////////////////////////////// +struct timeval tv_adjust (struct timeval a) { + while (a.tv_usec >= 1000000) { + a.tv_usec -= 1000000; + a.tv_sec++; + } + + while (a.tv_usec < 0) { + a.tv_usec += 1000000; + a.tv_sec--; + } + return a; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief friendly function to copy safely strings + * + * @param dst + * @param src + * + * @author Ricardo Martínez + * @date 2022 + */ + //////////////////////////////////////////////////////////////////////////////////////// +void duplicate_string(gchar* dst, gchar* src) { + g_assert(dst); + g_assert(src); + strcpy(dst, src); + dst[strlen(dst)] = '\0'; + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Function used to print the computed the path + * + * @param path + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void print_path (struct compRouteOutputItem_t *p) { + g_assert(p); + + DEBUG_PC ("=========== COMPUTED PATH ======================="); + DEBUG_PC ("Path Avail. Bw: %f, E2E Path Latency: %f, Path Cost: %f", p->availCap, p->delay, p->cost); + for (gint k = 0; k < p->numRouteElements; k++) { + DEBUG_PC ("aNodeId: %s (%s) --> zNodeId: %s (%s)", p->routeElement[k].aNodeId.nodeId, p->routeElement[k].aEndPointId, + p->routeElement[k].zNodeId.nodeId, p->routeElement[k].zEndPointId); + DEBUG_PC("linkId: %s", p->routeElement[k].linkId); + DEBUG_PC("aTopologyId: %s", p->routeElement[k].aTopologyId); + DEBUG_PC("zTopologyId: %s", p->routeElement[k].zTopologyId); + } + DEBUG_PC ("=================================================================="); + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Function used to print the output path formed by link Ids + * + * @param p + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void print_path_t(struct path_t* p) { + g_assert(p); + DEBUG_PC(" ============ COMPUTED OUTPUT PATH ================="); + DEBUG_PC("Path Avail Capacity: %f, Cost: %f, Latency: %f", p->path_capacity.value, + p->path_cost.cost_value, p->path_latency.fixed_latency); + DEBUG_PC("number of links of path %d", p->numPathLinks); + for (gint k = 0; k < p->numPathLinks; k++) { + DEBUG_PC("Link: %s", p->pathLinks[k].linkId); + for (gint l = 0; l < p->pathLinks[k].numLinkTopologies; l++) { + DEBUG_PC("end Link [%d] TopologyId: %s", l, p->pathLinks[k].linkTopologies[l].topologyId); + } + DEBUG_PC(" ContextId: %s", p->pathLinks[k].topologyId.contextId); + DEBUG_PC(" TopologyUUid: %s", p->pathLinks[k].topologyId.topology_uuid); + DEBUG_PC(" aDeviceId: %s", p->pathLinks[k].aDeviceId); + DEBUG_PC(" aEndpointId: %s", p->pathLinks[k].aEndPointId); + } + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Returns the char (36 bytes) format of a uuid + * + * @param uuid + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +gchar* get_uuid_char(uuid_t uuid) { + gchar* uuidChar = g_malloc0(16); // uuid has 36 chars + if (uuidChar == NULL) { + DEBUG_PC("Memory Allocation failure"); + exit(-1); + } + uuid_unparse(uuid, (char *)uuidChar); + return uuidChar; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Makes a copy of the service identifier (including the context) + * + * @param o + * @param i + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void copy_service_id(struct serviceId_t* o, struct serviceId_t* i) { + g_assert(o); + g_assert(i); + + memcpy(o->contextId, i->contextId, sizeof(i->contextId)); + memcpy(o->service_uuid, i->service_uuid, sizeof(i->service_uuid)); + + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Makes a copy of the service endpoint identifier (including the topology (contect and topology id), device and endpoint (port)) + * + * @param oEp + * @param iEp + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void copy_service_endpoint_id(struct service_endpoints_id_t* oEp, struct service_endpoints_id_t* iEp) { + g_assert(oEp); + g_assert(iEp); + + // copy topology information + memcpy(oEp->topology_id.contextId, iEp->topology_id.contextId, sizeof(iEp->topology_id.contextId)); + memcpy(oEp->topology_id.topology_uuid, iEp->topology_id.topology_uuid, sizeof(iEp->topology_id.topology_uuid)); + + // copy the endpoint + memcpy(oEp->device_uuid, iEp->device_uuid, sizeof(iEp->device_uuid)); + memcpy(oEp->endpoint_uuid, iEp->endpoint_uuid, sizeof(iEp->endpoint_uuid)); + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief From the set of contexts, it is returned the graph associated to that contexct matching + * with the passed contextId + * + * @param Set + * @param contextId + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +struct graph_t* get_graph_by_contextId(struct contextSet_t* Set, gchar* contextId) { + g_assert(Set); + g_assert(contextId); + + // iterate over the set of context. Pick the one matching with contextId, and return the graph. + // If not found, return NULL + struct graph_t* g = NULL; + for (gint i = 0; i < Set->num_context_set; i++) { + struct context_t* context = &(Set->contextList[i]); + if (strcmp(context->contextId, contextId) == 0) { + g = &(context->g); + return g; + } + } + return NULL; +} + +/////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Process the service constraint and maps them into the path constraints + * to be fulfilled + * + * @param path_constraints + * @param s + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +struct path_constraints_t * get_path_constraints(struct service_t* s) { + g_assert(s); + + struct path_constraints_t* path_constraints = g_malloc0(sizeof(struct path_constraints_t)); + if (path_constraints == NULL) { + DEBUG_PC("Memory Allocation Failure"); + exit(-1); + } + + char* eptr; + for (gint i = 0; i < s->num_service_constraints; i++) { + struct constraint_t* constraint = &(s->constraints[i]);; + if (strncmp((const char*)constraint->constraint_type, "bandwidth", 9) == 0) { + path_constraints->bwConstraint = (gdouble)(strtod((char*)constraint->constraint_value, &eptr)); + path_constraints->bw = TRUE; + //DEBUG_PC("Path Constraint Bw: %f", path_constraints->bwConstraint); + } + if (strncmp((const char*)constraint->constraint_type, "cost", 4) == 0) { + path_constraints->costConstraint = (gdouble)(strtod((char*)constraint->constraint_value, &eptr)); + path_constraints->cost = TRUE; + //DEBUG_PC("Path Constraint Cost: %f", path_constraints->costConstraint); + } + if (strncmp((const char*)constraint->constraint_type, "latency", 7) == 0) { + path_constraints->latencyConstraint = (gdouble)(strtod((char*)constraint->constraint_value, &eptr)); + path_constraints->latency = TRUE; + //DEBUG_PC("Path Constraint Latency: %f", path_constraints->latencyConstraint); + } + if (strncmp((const char*)constraint->constraint_type, "energy", 6) == 0) { + path_constraints->energyConstraint = (gdouble)(strtod((char*)constraint->constraint_value, &eptr)); + path_constraints->energy = TRUE; + //DEBUG_PC("Path Constraint Energy: %f", path_constraints->energyConstraint); + } + } + return path_constraints; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Creates the predecessors to keep the computed path + * + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +struct pred_t * create_predecessors () +{ + struct pred_t *predecessors = g_malloc0 (sizeof (struct pred_t)); + if (predecessors == NULL) + { + DEBUG_PC ("memory allocation failed\n"); + exit (-1); + } + return predecessors; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief create edge + * + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +struct edges_t* create_edge() +{ + struct edges_t* e = g_malloc0(sizeof(struct edges_t)); + if (e == NULL) + { + DEBUG_PC("Memory allocation failed\n"); + exit(-1); + } + return e; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Prints the list of the predecessors for a given computed Shortest Path + * + * @param p + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void print_predecessors (struct pred_t *p) +{ + g_assert (p); + DEBUG_PC ("Number of Predecessors: %d", p->numPredComp); + for (gint i = 0; i < p->numPredComp; i++) { + struct pred_comp_t *pComp = &(p->predComp[i]); + DEBUG_PC ("deviceId: %s", pComp->v.nodeId); + struct edges_t *e = &(pComp->e); + DEBUG_PC("Edge[#%d] (linkId): %s", i, e->linkId); + DEBUG_PC ("\t %s[%s] ===>", e->aNodeId.nodeId, e->aEndPointId); + DEBUG_PC("\t %s[%s]", e->zNodeId.nodeId, e->zEndPointId); + DEBUG_PC("\t aTopologyId: %s", e->aTopologyId); + DEBUG_PC("\t zTopologyId: %s", e->zTopologyId); + } + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Builds the list of predecessors for the request destination using the computed Shortest Path + * being stored in map + * + * @param p + * @param s + * @param map + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void build_predecessors (struct pred_t *p, struct service_t *s, struct map_nodes_t *map) +{ + g_assert (p); + g_assert (s); + g_assert (map); + + struct nodes_t *v = create_node(); + duplicate_string(v->nodeId, s->service_endpoints_id[1].device_uuid); + + struct edges_t *e = create_edge (); + get_edge_from_map_by_node (e, v, map); + + // Get u (being source of edge e) + struct nodes_t u; + duplicate_node_id (&e->aNodeId, &u); + + // Add to the predecessors list + struct pred_comp_t *pred = &(p->predComp[p->numPredComp]); + duplicate_node_id (&u, &pred->v); + struct edges_t *e1 = &(pred->e); + duplicate_edge (e1, e); + p->numPredComp++; + // Back-trace edges till reaching the srcPEId + struct nodes_t* srcNode = create_node(); + duplicate_string(srcNode->nodeId, s->service_endpoints_id[0].device_uuid); + + while (compare_node_id (&u, srcNode) != 0) { + duplicate_node_id (&u, v); + get_edge_from_map_by_node (e, v, map); + // Get the u (being source of edge e) + duplicate_node_id (&e->aNodeId, &u); + // Get the new predecessor + struct pred_comp_t *pred = &p->predComp[p->numPredComp]; + // Add to the predecessors list + duplicate_node_id (&u, &pred->v); + struct edges_t *e1 = &(pred->e); + duplicate_edge (e1, e); + p->numPredComp++; + } + print_predecessors (p); + g_free (e); + g_free(v); + g_free(srcNode); + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief It creates a struct nodes_t + * + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +struct nodes_t * create_node () +{ + struct nodes_t *n = g_malloc0 (sizeof (struct nodes_t)); + if (n == NULL) { + DEBUG_PC ("memory allocation problem"); + exit (-1); + } + return n; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief It creates a routeElement_t + * + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +struct routeElement_t * create_routeElement () +{ + struct routeElement_t *rE = g_malloc0 (sizeof (struct routeElement_t)); + if (rE == NULL) + { + DEBUG_PC ("memory allocation problem"); + exit (-1); + } + return rE; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief copy node ids + * + * @param src + * @param dst + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void duplicate_node_id (struct nodes_t *src, struct nodes_t *dst) +{ + g_assert (src); + g_assert (dst); + + //DEBUG_PC ("Duplicate nodeId for %s", src->nodeId); + strcpy (dst->nodeId, src->nodeId); + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief compares a pair of node Ids + * + * @param a + * @param b + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +gint compare_node_id (struct nodes_t *a, struct nodes_t *b) +{ + g_assert (a); + g_assert (b); + return (memcmp (&a->nodeId, b->nodeId, strlen (b->nodeId))); +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief duplicate two routeElement_t + * + * @param src + * @param dst + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void duplicate_routeElement (struct routeElement_t *src, struct routeElement_t *dst) +{ + g_assert (src); + g_assert (dst); + + duplicate_node_id (&(src->aNodeId), &(dst->aNodeId)); + duplicate_node_id (&(src->zNodeId), &(dst->zNodeId)); + duplicate_string(dst->aEndPointId, src->aEndPointId); + duplicate_string(dst->zEndPointId, src->zEndPointId); + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief duplicate two edges + * + * @param e1 (destination) + * @param e2 (source) + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void duplicate_edge (struct edges_t *e1, struct edges_t *e2) { + g_assert (e1); + g_assert (e2); + + duplicate_node_id (&e2->aNodeId, &e1->aNodeId); + duplicate_node_id (&e2->zNodeId, &e1->zNodeId); + //DEBUG_PC ("e->aNodeId: %s ---> e->zNodeId: %s", e1->aNodeId.nodeId, e1->zNodeId.nodeId); + duplicate_string(e1->aEndPointId, e2->aEndPointId); + duplicate_string(e1->zEndPointId, e2->zEndPointId); + duplicate_string(e1->linkId, e2->linkId); + duplicate_string(e1->interDomain_localId, e2->interDomain_localId); + duplicate_string(e1->interDomain_remoteId, e2->interDomain_remoteId); + duplicate_string(e1->aTopologyId, e2->aTopologyId); + duplicate_string(e1->zTopologyId, e2->zTopologyId); + + e1->unit = e2->unit; + memcpy(&e1->totalCap, &e2->totalCap, sizeof(gdouble)); + memcpy(&e1->availCap, &e2->availCap, sizeof(gdouble)); + + memcpy (&e1->cost, &e2->cost, sizeof (gdouble)); + memcpy (&e1->delay, &e2->delay, sizeof (gdouble)); + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Duplicate path + * + * @param a - original + * @param b - copy + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void duplicate_path (struct compRouteOutputItem_t *a, struct compRouteOutputItem_t *b) { + g_assert (a); + g_assert (b); + memcpy (&b->availCap, &a->availCap, sizeof (gdouble)); + b->numRouteElements = a->numRouteElements; + memcpy(&b->cost, &a->cost, sizeof(gdouble)); + memcpy (&b->delay, &a->delay, sizeof (gdouble)); + for (gint k = 0; k < a->numRouteElements; k++) { + //DEBUG_PC ("aNodeId: %s // zNodeId: %s", a->routeElement[k].aNodeId.nodeId, a->routeElement[k].zNodeId.nodeId); + // aNodeId duplication + struct nodes_t *n1 = &(a->routeElement[k].aNodeId); + struct nodes_t *n2 = &(b->routeElement[k].aNodeId); + duplicate_node_id (n1, n2); + + //zNodeId duplication + n1 = &(a->routeElement[k].zNodeId); + n2 = &(b->routeElement[k].zNodeId); + duplicate_node_id (n1, n2); + duplicate_string(b->routeElement[k].aEndPointId, a->routeElement[k].aEndPointId); + duplicate_string(b->routeElement[k].zEndPointId, a->routeElement[k].zEndPointId); + duplicate_string(b->routeElement[k].linkId, a->routeElement[k].linkId); + duplicate_string(b->routeElement[k].aTopologyId, a->routeElement[k].aTopologyId); + duplicate_string(b->routeElement[k].zTopologyId, a->routeElement[k].zTopologyId); + } + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Duplicate path from compRouteOutputItem_t to path_t + * + * @param a - original + * @param b - copy + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void duplicate_path_t(struct compRouteOutputItem_t* a, struct path_t* b) +{ + g_assert(a); + g_assert(b); + + memcpy(&b->path_capacity.value, &a->availCap, sizeof(gdouble)); + memcpy(&b->path_cost.cost_value, &a->cost, sizeof(gdouble)); + memcpy(&b->path_latency.fixed_latency, &a->delay, sizeof(gdouble)); + + b->numPathLinks = a->numRouteElements; + + for (gint k = 0; k < a->numRouteElements; k++) { + struct routeElement_t* rE = &(a->routeElement[k]); + struct pathLink_t* pL = &(b->pathLinks[k]); + + // copy the aDeviceId and aEndpointId, zDeviceId and zEndPointId + duplicate_string(pL->aDeviceId, rE->aNodeId.nodeId); + duplicate_string(pL->zDeviceId, rE->zNodeId.nodeId); + duplicate_string(pL->aEndPointId, rE->aEndPointId); + duplicate_string(pL->zEndPointId, rE->zEndPointId); + + duplicate_string(pL->topologyId.topology_uuid, rE->aTopologyId); + duplicate_string(pL->topologyId.contextId, rE->contextId); + + //copy the linkId + duplicate_string(pL->linkId, rE->linkId); + pL->numLinkTopologies++; + duplicate_string(pL->linkTopologies[pL->numLinkTopologies - 1].topologyId, rE->aTopologyId); + pL->numLinkTopologies++; + duplicate_string(pL->linkTopologies[pL->numLinkTopologies - 1].topologyId, rE->zTopologyId); + } + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Return the index into mapN related nodeId + * + * @param nodeId + * @para mapN + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +gint get_map_index_by_nodeId (gchar *nodeId, struct map_nodes_t * mapN) +{ + gint index = -1; + gint i = 0; + + for (i = 0; i < mapN->numMapNodes; i++) + { + //DEBUG_PC ("i: %d; current: %s // targeted: %s", i, mapN->map[i].verticeId.nodeId, nodeId); + if (memcmp (mapN->map[i].verticeId.nodeId, nodeId, strlen (nodeId)) == 0) + { + index = i; + //DEBUG_PC ("Index: %d", index); + return index; + } + } + //DEBUG_PC ("Index: %d", index); + return index; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Get the edge e enabling reaching the computed v in mapNodes + * + * @param e + * @param v + * @param mapN + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void get_edge_from_map_by_node (struct edges_t *e, struct nodes_t* v, struct map_nodes_t *mapN) { + + //DEBUG_PC ("Get the Edge into map from node v: %s", v.nodeId); + // Get the edge reaching the node v from mapNodes + gint map_vIndex = get_map_index_by_nodeId (v->nodeId, mapN); + + //DEBUG_PC ("aNodeId: %s --> zNodeId: %s", mapN->map[map_vIndex].predecessor.aNodeId.nodeId, mapN->map[map_vIndex].predecessor.zNodeId.nodeId); + + struct edges_t *te = &(mapN->map[map_vIndex].predecessor); + duplicate_edge (e, te); + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Get the edge from the predecessors array for a given node n + * + * @param e + * @param n + * @param predecessors + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void get_edge_from_predecessors (struct edges_t *e, struct nodes_t* n, struct pred_t *predecessors) { + g_assert(predecessors); + + DEBUG_PC ("Get edge outgoing node %s from predecessors list", n->nodeId); + //print_predecessors (predecessors); + for (gint i = 0; i < predecessors->numPredComp; i++) { + struct pred_comp_t *pred = &(predecessors->predComp[i]); + if (compare_node_id (n, &pred->v) == 0) { + // Add to the predecessors list + struct edges_t *te = &(pred->e); + DEBUG_PC("add e (linkId): %s", te->linkId); + duplicate_edge (e, te); + return; + } + } + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Construct the path using the predecessors list + * + * @param path + * @param predecessors + * @param s + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void build_path (struct compRouteOutputItem_t *p, struct pred_t *predecessors, struct service_t *s) { + //DEBUG_PC ("\n"); + // Get the source device Id of the network connectivity service + struct nodes_t *v = create_node(); + duplicate_string(v->nodeId, s->service_endpoints_id[0].device_uuid); + + struct edges_t* e = create_edge(); + + // Get the edge for v in predecessors + get_edge_from_predecessors (e, v, predecessors); + // Get the target for e + struct nodes_t u; + duplicate_node_id (&e->zNodeId, &u); + //DEBUG_PC ("u: %s", u.nodeId); + struct path_constraints_t* pathCons = get_path_constraints(s); + + // Add route element to the path being constructed + gint k = 0; + duplicate_node_id (&e->aNodeId, &p->routeElement[k].aNodeId); + duplicate_node_id (&e->zNodeId, &p->routeElement[k].zNodeId); + duplicate_string(p->routeElement[k].aEndPointId, e->aEndPointId); + duplicate_string(p->routeElement[k].zEndPointId, e->zEndPointId); + duplicate_string(p->routeElement[k].linkId, e->linkId); + duplicate_string(p->routeElement[k].aTopologyId, e->aTopologyId); + duplicate_string(p->routeElement[k].zTopologyId, e->zTopologyId); + duplicate_string(p->routeElement[k].contextId, s->serviceId.contextId); + p->numRouteElements++; + + // Get the destination device Id of the network connectivity service + struct nodes_t* dst = create_node(); + duplicate_string(dst->nodeId, s->service_endpoints_id[1].device_uuid); + while (compare_node_id (&u, dst) != 0) + { + k++; + p->numRouteElements++; + // v = u + duplicate_node_id (&u, v); + get_edge_from_predecessors (e, v, predecessors); + // Get the target u + duplicate_node_id (&e->zNodeId, &u); + // Add route element to the path being constructed + duplicate_node_id (&e->aNodeId, &p->routeElement[k].aNodeId); + duplicate_node_id (&e->zNodeId, &p->routeElement[k].zNodeId); + duplicate_string(p->routeElement[k].aEndPointId, e->aEndPointId); + duplicate_string(p->routeElement[k].zEndPointId, e->zEndPointId); + duplicate_string(p->routeElement[k].linkId, e->linkId); + duplicate_string(p->routeElement[k].aTopologyId, e->aTopologyId); + duplicate_string(p->routeElement[k].zTopologyId, e->zTopologyId); + duplicate_string(p->routeElement[k].contextId, s->serviceId.contextId); + + // copy the contextId + //duplicate_string(p->routeElement[k].contextId, s->service_endpoints_id[0].topology_id.contextId); + } + g_free(e); g_free(v); g_free(pathCons); + //DEBUG_PC ("Path is constructed"); + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Print the graph for DEBUG_PCging purposes + * + * @param g + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void print_graph (struct graph_t *g) +{ + DEBUG_PC ("================================================================"); + DEBUG_PC ("=========================== GRAPH =========================="); + DEBUG_PC ("================================================================"); + + DEBUG_PC("Graph Num Vertices: %d", g->numVertices); + + gint i = 0, j = 0, k = 0; + for (i = 0; i < g->numVertices; i++) + { + DEBUG_PC ("Head Vertice [%s]", g->vertices[i].verticeId.nodeId); + for (j = 0; j < g->vertices[i].numTargetedVertices; j++) + { + DEBUG_PC (" Tail Vertice: %s", g->vertices[i].targetedVertices[j].tVertice.nodeId); + for (k = 0; k < g->vertices[i].targetedVertices[j].numEdges; k++) + { + struct edges_t *e = &(g->vertices[i].targetedVertices[j].edges[k]); + DEBUG_PC ("%s(%s) --> %s(%s) [C: %f, Bw: %f b/s, Delay: %f ms]", e->aNodeId.nodeId, e->aEndPointId, e->zNodeId.nodeId, + e->zEndPointId, e->cost, e->availCap, e->delay); + } + } + } + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Look for a given edge into the graph + * + * @param verticeIndex + * @param targetedVerticeIndex + * @param e + * @param g + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +gint graph_edge_lookup (gint verticeIndex, gint targetedVerticeIndex, struct edges_t *e, struct graph_t *g) { + gint indexEdge = -1; + + for (gint j = 0; j < g->vertices[verticeIndex].targetedVertices[targetedVerticeIndex].numEdges; j++) { + struct edges_t *e2 = &(g->vertices[verticeIndex].targetedVertices[targetedVerticeIndex].edges[j]); + if ((compare_node_id (&e->aNodeId, &e2->aNodeId) == 0) && + (compare_node_id (&e->zNodeId, &e2->zNodeId) == 0) && + (strcmp (e->aEndPointId, e2->aEndPointId) == 0) && + (strcmp (e->zEndPointId, e2->zEndPointId) == 0) && + (strcmp(e->linkId, e2->linkId) == 0)) { + DEBUG_PC ("%s (%s) --> %s (%s) [linkId: %s] FOUND in the Graph at index: %d", e->aNodeId.nodeId, e->aEndPointId, e->zNodeId.nodeId, + e->zEndPointId, e->linkId, j); + indexEdge = j; + return indexEdge; + } + } + return indexEdge; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Look for a given vertice within the graph using the nodeId + * + * @param nodeId + * @param g + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +gint graph_vertice_lookup (gchar *nodeId, struct graph_t *g) +{ + gint index = -1; + //DEBUG_PC("Searching Node: %s", nodeId); + for (gint i = 0; i < g->numVertices; i++) { + //DEBUG_PC("Checked Graph Node: %s", g->vertices[i].verticeId.nodeId); + if (memcmp (g->vertices[i].verticeId.nodeId, nodeId, strlen (nodeId)) == 0) + { + index = i; + //DEBUG_PC ("%s is found in the graph vertice [%d]", nodeId, index); + break; + } + } + return (index); +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Check if a nodeId is already considered into the set of targeted vertices from a given vertice + * + * @param nodeId + * @param vIndex + * @param g + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +gint graph_targeted_vertice_lookup (gint vIndex, gchar *nodeId, struct graph_t *g) +{ + gint addedTargetedVerticeIndex = -1; + gint i = 0; + + if (g->vertices[vIndex].numTargetedVertices == 0) + { + return (addedTargetedVerticeIndex); + } + + for (i = 0; i < g->vertices[vIndex].numTargetedVertices; i++) + { + if (memcmp (g->vertices[vIndex].targetedVertices[i].tVertice.nodeId, nodeId, strlen (nodeId)) == 0) + { + DEBUG_PC ("Targeted %s reachable from %s", nodeId, g->vertices[vIndex].verticeId.nodeId); + addedTargetedVerticeIndex = i; + return (addedTargetedVerticeIndex); + } + } + // not found ... + return (addedTargetedVerticeIndex); +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Check if a nodeId is already considered into the set of targeted vertices from a given vertice, if not to be added + * + * @param nodeId + * @param vIndex + * @param g + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +gint graph_targeted_vertice_add (gint vIndex, gchar *nodeId, struct graph_t *g) +{ + gint addedTargetedVerticeIndex = -1; + gint i = 0; + + if (g->vertices[vIndex].numTargetedVertices == 0) + { + //DEBUG_PC ("targeted vertice %s being reachable from vertice %s", nodeId, g->vertices[vIndex].verticeId.nodeId); + addedTargetedVerticeIndex = 0; + return (addedTargetedVerticeIndex); + } + + for (i = 0; i < g->vertices[vIndex].numTargetedVertices; i++) + { + if (memcmp (g->vertices[vIndex].targetedVertices[i].tVertice.nodeId, nodeId, strlen (nodeId)) == 0) + { + //DEBUG_PC ("Targeted vertice %s is already considered in the reachable from vertice %s", nodeId, g->vertices[vIndex].verticeId.nodeId); + addedTargetedVerticeIndex = -1; + return (addedTargetedVerticeIndex); + } + } + // It is not found, next to be added at i position + addedTargetedVerticeIndex = i; + return (addedTargetedVerticeIndex); +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Remove edge from the graph + * + * @param g + * @param e + * + * @author Ricardo Martínez + * @date 2022 + */ +void remove_edge_from_graph (struct graph_t *g, struct edges_t *e) +{ + // Find the ingress vertice into the graph + DEBUG_PC ("Removing from Graph %s[%s]) ---> %s[%s] (linkId: %s)", e->aNodeId.nodeId, e->aEndPointId, e->zNodeId.nodeId, e->aEndPointId, e->linkId); + gint verticeIndex = -1; + verticeIndex = graph_vertice_lookup (e->aNodeId.nodeId, g); + if (verticeIndex == -1) { + DEBUG_PC ("Edge w/ %s is NOT in the Graph!!", e->aNodeId.nodeId); + return; + } + + // Find the targeted vertice from vertice Id + gint targetedVerticeIndex = -1; + targetedVerticeIndex = graph_targeted_vertice_lookup (verticeIndex, e->zNodeId.nodeId, g); + if (targetedVerticeIndex == -1) { + DEBUG_PC ("%s --> %s NOT in the Graph!!", e->aNodeId.nodeId, e->zNodeId.nodeId); + return; + } + + //DEBUG_PC ("%s --> %s found in the Graph", e->aNodeId.nodeId, e->zNodeId.nodeId); + + // Get the edge position + gint edgeIndex = -1; + edgeIndex = graph_edge_lookup (verticeIndex, targetedVerticeIndex, e, g); + if (edgeIndex == -1) { + DEBUG_PC ("%s --> %s NOT in the Graph!!", e->aNodeId.nodeId, e->zNodeId.nodeId); + return; + } + + //DEBUG_PC ("%s --> %s FOUND in Graph w/ edgeIndex: %d", e->aNodeId.nodeId, e->zNodeId.nodeId, edgeIndex); + + // Remove the edge + //DEBUG_PC ("Start Removing %s --> %s from Graph", e->aNodeId.nodeId, e->zNodeId.nodeId); + struct targetNodes_t *v = &(g->vertices[verticeIndex].targetedVertices[targetedVerticeIndex]); + for (gint j = edgeIndex; j < v->numEdges; j++) { + struct edges_t *e1 = &(v->edges[j]); + struct edges_t *e2 = &(v->edges[j+1]); + duplicate_edge (e1, e2); + } + v->numEdges --; + DEBUG_PC ("Number of Edges between %s and %s is %d", e->aNodeId.nodeId, e->zNodeId.nodeId, v->numEdges); + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief create the pointer for keeping a set of the paths (struct compRouteOutput_t) + * + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +struct path_set_t * create_path_set () +{ + struct path_set_t * p = g_malloc0 (sizeof (struct path_set_t)); + if (p == NULL) + { + DEBUG_PC ("Memory allocation problem"); + exit (-1); + } + return p; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Remove the path set + * + * @param p + * + * @author Ricardo Martínez + * @date 2021 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void remove_path_set(struct path_set_t* p) +{ + g_assert(p); + g_free(p); + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Create map of nodes to handle the path computation + * + * @param mapN + * @param g + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void build_map_node (struct map_nodes_t *mapN, struct graph_t *g) +{ + //DEBUG_PC ("Construction of the Map of Nodes"); + for (gint i = 0; i < g->numVertices; i++) + { + duplicate_node_id (&g->vertices[i].verticeId, &mapN->map[i].verticeId); + mapN->map[i].distance = INFINITY_COST; + mapN->map[i].avaiBandwidth = 0.0; + mapN->map[i].latency = INFINITY_COST; + mapN->numMapNodes++; + } + //DEBUG_PC ("mapNodes formed by %d Nodes", mapN->numMapNodes); + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Allocate memory for path of struct compRouteOutputList_t * + * + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +struct compRouteOutputList_t * create_route_list () +{ + struct compRouteOutputList_t *p = g_malloc0 (sizeof (struct compRouteOutputList_t)); + if (p == NULL) + { + DEBUG_PC ("Memory Allocation Problem"); + exit (-1); + } + return p; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Allocate memory for path of struct compRouteOutputItem_t * + * + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +struct compRouteOutputItem_t *create_path_item () +{ + struct compRouteOutputItem_t *p = g_malloc0 (sizeof (struct compRouteOutputItem_t)); + if (p == NULL) { + DEBUG_PC ("Memory Allocation Problem"); + exit (-1); + } + return p; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Sort the set of paths according to the metric (1st criteria) and latency (2nd criteria) + * + * @params setP + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void sort_path_set(struct path_set_t* setP) { + g_assert(setP); + // Sort the paths contained in setP by shotest metric and latency + float epsilon = 0.0000001; + + for (gint i = 0; i < setP->numPaths; i++) { + for (gint j = 0; j < (setP->numPaths - i - 1); j++) { + struct compRouteOutputItem_t* path1 = &setP->paths[j]; + struct compRouteOutputItem_t* path2 = &setP->paths[j + 1]; + + struct compRouteOutputItem_t* pathTmp = create_path_item(); + // 1st Criteria (avail Bw) + if ((path2->availCap - path1->availCap > 0.0) && (fabs(path1->availCap - path2->availCap) > epsilon)) { + duplicate_path(path1, pathTmp); + duplicate_path(path2, path1); + duplicate_path(pathTmp, path2); + g_free(pathTmp); + continue; + } + else if ((path1->availCap - path2->availCap > 0.0) && (fabs(path1->availCap - path2->availCap) > epsilon)) { + g_free(pathTmp); + continue; + } + // likely the same available bw between path1 and path2 + else if (fabs(path1->availCap - path2->availCap) < epsilon) { + // 2nd criteria: sort path cost + if (path1->cost > path2->cost) { + duplicate_path(path1, pathTmp); + duplicate_path(path2, path1); + duplicate_path(pathTmp, path2); + g_free(pathTmp); + continue; + } + else if (path1->cost < path2->cost) { + g_free(pathTmp); + continue; + } + // 3rd criteria: same path cost, prioritize the one with lowest e2e latency + else if (path1->cost == path2->cost) { + if ((path2->delay - path1->delay > 0.0) && (fabs(path1->delay - path2->delay) > epsilon)) { + g_free(pathTmp); + continue; + } + else if ((path1->delay - path2->delay > 0.0) && (fabs(path1->delay - path2->delay) > epsilon)) { + duplicate_path(path1, pathTmp); + duplicate_path(path2, path1); + duplicate_path(pathTmp, path2); + g_free(pathTmp); + continue; + } + // Same bw, same cost and same latency, path1 and path2 are practically the same + else if (fabs(path1->delay - path2->delay) < epsilon) { + g_free(pathTmp); + continue; + } + } + } + } + } + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Remove first element from the path sets + * + * @params setP + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void pop_front_path_set (struct path_set_t *setP) { + for (gint j = 0; j < setP->numPaths - 1; j++) { + struct compRouteOutputItem_t *path1 = &setP->paths[j]; + struct compRouteOutputItem_t *path2 = &setP->paths[j+1]; + duplicate_path (path2, path1); + } + setP->numPaths--; + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Add routeElement to the back of the path + * + * @param rE + * @param p + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void add_routeElement_path_back (struct routeElement_t *rE, struct compRouteOutputItem_t *p) +{ + //DEBUG_PC ("p->numRouteElements: %d", p->numRouteElements); + p->numRouteElements++; + gint index = p->numRouteElements - 1; + + struct nodes_t *pn = &(p->routeElement[index].aNodeId); + struct nodes_t *rEn = &(rE->aNodeId); + + // duplicate aNodeId + duplicate_node_id (rEn, pn); + pn = &(p->routeElement[index].zNodeId); + rEn = &(rE->zNodeId); + duplicate_node_id (rEn, pn); + duplicate_string(p->routeElement[index].aEndPointId, rE->aEndPointId); + duplicate_string(p->routeElement[index].zEndPointId, rE->zEndPointId); + duplicate_string(p->routeElement[index].linkId, rE->linkId); + duplicate_string(p->routeElement[index].aTopologyId, rE->aTopologyId); + duplicate_string(p->routeElement[index].zTopologyId, rE->zTopologyId); + + return; +} + +/////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief This function compares ap and rootPath. If all the links are equal between both ap and rootPath till the sN, then the link from sN to next node + * ap is returned + * + * @params ap + * @params p + * @params sN + * @params e + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +gboolean matching_path_rootPath (struct compRouteOutputItem_t *ap, struct compRouteOutputItem_t *rootPath, struct nodes_t *sN, struct edges_t *e) { + gint j = 0; + gboolean ret = FALSE; + while ((j < ap->numRouteElements) && (j < rootPath->numRouteElements)) { + if ((memcmp (ap->routeElement[j].aNodeId.nodeId, rootPath->routeElement[j].aNodeId.nodeId, sizeof (ap->routeElement[j].aNodeId.nodeId)) == 0) && + //(memcmp (ap->routeElement[j].zNodeId.nodeId, rootPath->routeElement[j].zNodeId.nodeId, sizeof (ap->routeElement[j].zNodeId.nodeId)) != 0) && + (memcmp (sN->nodeId, rootPath->routeElement[j].aNodeId.nodeId, sizeof (ap->routeElement[j].aNodeId.nodeId)) == 0)) { + duplicate_node_id (&ap->routeElement[j].aNodeId, &e->aNodeId); + duplicate_node_id (&ap->routeElement[j].zNodeId, &e->zNodeId); + duplicate_string(e->aEndPointId, ap->routeElement[j].aEndPointId); + duplicate_string(e->zEndPointId, ap->routeElement[j].zEndPointId); + duplicate_string(e->linkId, ap->routeElement[j].linkId); + return TRUE; + } + if ((memcmp (ap->routeElement[j].aNodeId.nodeId, rootPath->routeElement[j].aNodeId.nodeId, sizeof (ap->routeElement[j].aNodeId.nodeId)) == 0) && + (memcmp (ap->routeElement[j].zNodeId.nodeId, rootPath->routeElement[j].zNodeId.nodeId, sizeof (ap->routeElement[j].zNodeId.nodeId)) == 0)) { + j++; + continue; + } + + if ((memcmp (ap->routeElement[j].aNodeId.nodeId, rootPath->routeElement[j].aNodeId.nodeId, sizeof (ap->routeElement[j].aNodeId.nodeId)) != 0) || + (memcmp (ap->routeElement[j].zNodeId.nodeId, rootPath->routeElement[j].zNodeId.nodeId, sizeof (ap->routeElement[j].zNodeId.nodeId)) != 0)) { + //DEBUG_PC ("ap and rootPath not in the same path"); + return ret; + } + } + return ret; +} + +/////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief This function is used to modify the graph to be used for running the subsequent SP computations acording to the YEN algorithm principles + * + * @params g + * @params A + * @params rootPath + * @params spurNode + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void modify_targeted_graph (struct graph_t *g, struct path_set_t *A, struct compRouteOutputItem_t * rootPath, struct nodes_t * spurNode) { + //DEBUG_PC ("Modify the Targeted graph according to the Yen algorithm principles"); + for (gint j = 0; j < A->numPaths; j++) + { + struct compRouteOutputItem_t *ap = &A->paths[j]; + struct edges_t *e = create_edge (); + gboolean ret = FALSE; + ret = matching_path_rootPath (ap, rootPath, spurNode, e); + if (ret == TRUE) { + //DEBUG_PC ("Removal %s [%u]--> %s [%u] from the graph", e->aNodeId.nodeId, e->aLinkId, e->zNodeId.nodeId, e->zLinkId); + remove_edge_from_graph (g, e); + //DEBUG_PC ("Print Resulting Graph"); + //print_graph (g); + g_free (e); + } + if (ret == FALSE) + { + g_free (e); + continue; + } + } + return; +} + +/////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Supporting fucntion to Check if a nodeId is already in the items of a given GList + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +gint find_nodeId (gconstpointer data, gconstpointer userdata) +{ + /** check values */ + g_assert(data != NULL); + g_assert(userdata != NULL); + + struct nodeItem_t *SNodeId = (struct nodeItem_t *)data; + guchar * nodeId = (guchar *)userdata; + + //DEBUG_PC ("SNodeId (%s) nodeId (%s)", SNodeId->node.nodeId, nodeId); + + if (!memcmp(SNodeId->node.nodeId, nodeId, strlen (SNodeId->node.nodeId))) + { + return (0); + } + return -1; +} + +/////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Explores the link between u and v + * + * @param u + * @param v + * @param g + * @param s + * @param S + * @param Q + * @param mapNodes + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +gint check_link (struct nodeItem_t *u, gint indexGraphU, gint indexGraphV, struct graph_t *g, + struct service_t *s, GList **S, GList **Q, struct map_nodes_t *mapNodes) { + g_assert(g); + g_assert(s); + g_assert(mapNodes); + + struct targetNodes_t *v = &(g->vertices[indexGraphU].targetedVertices[indexGraphV]); + DEBUG_PC("Explored link (u ===> v):"); + DEBUG_PC("u: %s ====>", u->node.nodeId); + DEBUG_PC("====> v: %s", v->tVertice.nodeId); + + // v already explored in S? then, discard it + GList *found = g_list_find_custom (*S, v->tVertice.nodeId, find_nodeId); + if (found != NULL) { + DEBUG_PC ("v (%s) in S, discard to explore it!", v->tVertice.nodeId); + return 0; + } + + // Get the set of constraints imposed by the service + struct path_constraints_t* path_constraints = get_path_constraints(s); + gdouble distance_through_u = INFINITY_COST; + gdouble latency_through_u = INFINITY_COST; + gint i = 0; + + // Check bandwidth requirement is fulfillied on edge u --> v + gint foundAvailBw = 0; + gdouble edgeAvailBw = 0.0; + for (i = 0; i < v->numEdges; i++) { + struct edges_t *e = &(v->edges[i]); + memcpy (&edgeAvailBw, &(e->availCap), sizeof (gdouble)); + DEBUG_PC("edge:u ===> v"); + DEBUG_PC ("%s[%s] ===>", u->node.nodeId, e->aEndPointId); + DEBUG_PC("====> %s[%s]", v->tVertice.nodeId, e->zEndPointId); + DEBUG_PC("edge available bw: %f", edgeAvailBw); + + // if network service constraint specifies "bandwidth" needs (assuming coherent units) + if (path_constraints->bw == TRUE) { + if (edgeAvailBw < path_constraints->bwConstraint) { + continue; + } + else { + foundAvailBw = 1; + break; + } + } + } + // if bw path constraint is specified but not sastified ... discard the edge + if ((path_constraints->bw == TRUE) && (foundAvailBw == 0)) + { + DEBUG_PC ("AvailBw: %f < path_constraint: %f -- Discard Edge", edgeAvailBw, path_constraints->bwConstraint); + g_free(path_constraints); + return 0; + } + + gint indexEdge = i; // get the index for the explored edge + // Update distance, latency and availBw through u to reach v + gint map_uIndex = get_map_index_by_nodeId (u->node.nodeId, mapNodes); + struct map_t *u_map = &mapNodes->map[map_uIndex]; + distance_through_u = u_map->distance + v->edges[indexEdge].cost; + latency_through_u = u_map->latency + v->edges[indexEdge].delay; + gdouble availBw_through_u = 0.0; + + // ingress endpoint (u) is the src of the request + if (strcmp (u->node.nodeId, s->service_endpoints_id[0].device_uuid) == 0) { + //DEBUG_PC ("AvailBw %f on %s --> %s", edgeAvailBw, u->node.nodeId, v->tVertice.nodeId); + memcpy (&availBw_through_u, &edgeAvailBw, sizeof (gdouble)); + } + else { + // Get the minimum available bandwidth between the src-->u and the new added edge u-->v + //DEBUG_PC ("Current AvailBw: %f from src to %s", u_map->avaiBandwidth, u->node.nodeId); + //DEBUG_PC ("AvailBw: %f %s --> %s", edgeAvailBw, u->node.nodeId, v->tVertice.nodeId); + if (u_map->avaiBandwidth <= edgeAvailBw) { + memcpy (&availBw_through_u, &u_map->avaiBandwidth, sizeof (gdouble)); + } + else { + memcpy (&availBw_through_u, &edgeAvailBw, sizeof (gdouble)); + } + } + // Relax the link according to the pathCost and latency + gint map_vIndex = get_map_index_by_nodeId (v->tVertice.nodeId, mapNodes); + struct map_t *v_map = &mapNodes->map[map_vIndex]; + // If cost dist (u, v) > dist (src, v) relax the link + if (distance_through_u > v_map->distance) { + //DEBUG_PC ("dist(src, u) + dist(u, v): %f > dist (src, v): %f --> Discard Link", distance_through_u, v_map->distance); + return 0; + } + // If dist (src, u) + dist (u, v) = current dist(src, v), then use the latency as discarding criteria + if ((distance_through_u == v_map->distance) && (latency_through_u > v_map->latency)) { + //DEBUG_PC ("dist(src, u) + dist(u,v) = current dist(src, v), but latency (src,u) + latency (u, v) > current latency (src, v)"); + return 0; + } + // If dist (src, u) + dist (u,v) == current dist(src, v) AND latency (src, u) + latency (u, v) == current latency (src, v), the available bandwidth is the criteria + if ((distance_through_u == v_map->distance) && (latency_through_u == v_map->latency) && (availBw_through_u < v_map->avaiBandwidth)) { + return 0; + } + DEBUG_PC ("%s --> %s Relaxed", u->node.nodeId, v->tVertice.nodeId); + DEBUG_PC ("\t AvailBw: %f Mb/s, Cost: %f, Latency: %f ms", availBw_through_u, distance_through_u, latency_through_u); + + // Update Q list -- + struct nodeItem_t *nodeItem = g_malloc0 (sizeof (struct nodeItem_t)); + if (nodeItem == NULL) { + DEBUG_PC ("memory allocation failed\n"); + exit (-1); + } + nodeItem->distance = distance_through_u; + memcpy(&nodeItem->distance, &distance_through_u, sizeof(gdouble)); + memcpy(&nodeItem->latency, &latency_through_u, sizeof(gdouble)); + duplicate_node_id (&v->tVertice, &nodeItem->node); + // add node to the Q list + *Q = g_list_insert_sorted (*Q, nodeItem, sort_by_distance); + //DEBUG_PC ("%s ADDED to Q (length: %d)", nodeItem->node.nodeId, g_list_length(*Q)); + + // Update the mapNodes for the specific reached tv + v_map->distance = distance_through_u; + memcpy(&v_map->distance, &distance_through_u, sizeof(gdouble)); + memcpy (&v_map->avaiBandwidth, &availBw_through_u, sizeof (gdouble)); + memcpy (&v_map->latency, &latency_through_u, sizeof (gdouble)); + // Duplicate the predecessor edge into the mapNodes + struct edges_t *e1 = &(v_map->predecessor); + struct edges_t *e2 = &(v->edges[indexEdge]); + duplicate_edge (e1, e2); + DEBUG_PC ("u->v Edge: %s(%s) --> %s(%s)", e2->aNodeId.nodeId, e2->aEndPointId, e2->zNodeId.nodeId, e2->zEndPointId); + DEBUG_PC("v-pred aTopology: %s", e2->aTopologyId); + DEBUG_PC("v-pred zTopology: %s", e2->zTopologyId); + + // Check whether v is dstPEId + //DEBUG_PC ("Targeted dstPEId: %s", req->dstPEId.nodeId); + //DEBUG_PC ("nodeId added to the map: %s", v_map->verticeId.nodeId); + //DEBUG_PC ("Q Length: %d", g_list_length(*Q)); + g_free(path_constraints); + return 0; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Check the feasability of a path wrt the constraints imposed by the request in terms of latency + * + * @param s + * @param p + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +gboolean check_computed_path_feasability (struct service_t *s, struct compRouteOutputItem_t* p) { + float epsilon = 0.0000001; + struct path_constraints_t* pathCons = get_path_constraints(s); + gboolean ret = TRUE; + + if (pathCons->latency == TRUE) { + if ((pathCons->latencyConstraint - p->delay > 0.0) || (fabs(pathCons->latencyConstraint - p->delay) < epsilon)) { + DEBUG_PC("Computed Path (latency: %f) is feasible wrt Connection Demand: %f", p->delay, pathCons->latencyConstraint); + } + else { + DEBUG_PC("Computed Path (latency: %f) is NOT feasible wrt Connection Demand: %f", p->delay, pathCons->latencyConstraint); + g_free(pathCons); + return FALSE; + } + } + // Other constraints... + + g_free(pathCons); + return ret; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Sorting the GList Q items by distance + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +gint sort_by_distance (gconstpointer a, gconstpointer b) +{ + //DEBUG_PC ("sort by distance a and b"); + g_assert(a != NULL); + g_assert(b != NULL); + + //DEBUG_PC ("sort by distance a and b"); + struct nodeItem_t *node1 = (struct nodeItem_t *)a; + struct nodeItem_t *node2 = (struct nodeItem_t *)b; + g_assert (node1); + g_assert (node2); + + //DEBUG_PC ("a->distance %u; b->distance %u", node1->distance, node2->distance); + //DEBUG_PC("a->latency: %f; b->latency: %f", node1->latency, node2->latency); + //1st criteria, sorting by lowest distance + if (node1->distance > node2->distance) + return 1; + else if (node1->distance < node2->distance) + return 0; + if (node1->distance == node2->distance) + { + if (node1->latency > node2->latency) + return 1; + else if (node1->latency <= node2->latency) + return 0; + } +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Allocate memory for graph + * + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +struct graph_t * create_graph () { + struct graph_t * g = g_malloc0 (sizeof (struct graph_t)); + if (g == NULL) + { + DEBUG_PC ("Memory Allocation Problem"); + exit (-1); + } + return g; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Allocate memory for mapNodes + * + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +struct map_nodes_t * create_map_node () { + struct map_nodes_t * mN = g_malloc0 (sizeof (struct map_nodes_t)); + if (mN == NULL) + { + DEBUG_PC ("Memory allocation failed"); + exit (-1); + } + return mN; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Look up for the service in the servieList bound to a serviceUUID + * + * @params serviceUUID + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// + +struct service_t* get_service_for_computed_path(gchar* serviceUUID) { + for (gint i = 0; i < serviceList->numServiceList; i++) { + struct service_t* s = &(serviceList->services[i]); + if (strcmp(s->serviceId.service_uuid, serviceUUID) == 0) + return s; + } + return NULL; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Allocate memory for struct deviceList_t + * + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +struct deviceList_t* create_device_list() +{ + struct deviceList_t* dList = g_malloc0(sizeof(struct deviceList_t)); + if (dList == NULL) + { + DEBUG_PC("Memory Allocation Failure"); + exit(-1); + } + return dList; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Allocate memory for struct linkList_t + * + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +struct linkList_t* create_link_list() { + struct linkList_t* lList = g_malloc0(sizeof(struct linkList_t)); + if (lList == NULL) + { + DEBUG_PC("Memory Allocation Failure"); + exit(-1); + } + lList->numLinks = 0; + return lList; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Allocate memory for struct serviceList_t + * + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +struct serviceList_t* create_service_list() { + struct serviceList_t* sList = g_malloc0(sizeof(struct serviceList_t)); + if (sList == NULL) + { + DEBUG_PC("Memory Allocation Failure"); + exit(-1); + } + return sList; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Friendly function to log the service type + * + * @param type + * + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void print_service_type(guint type) { + switch (type) { + case SERVICE_TYPE_UNKNOWN: + DEBUG_PC("Service Type UNKNOWN"); + break; + case SERVICE_TYPE_L3NM: + DEBUG_PC("Service Type L3NM"); + break; + case SERVICE_TYPE_L2NM: + DEBUG_PC("Service Type L2NM"); + break; + case SERVICE_TYPE_TAPI: + DEBUG_PC("Service Type L2NM"); + break; + } + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Friendly function to log the port direction + * + * @param direction + * + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void print_link_port_direction(guint direction) +{ + switch (direction) { + case LINK_PORT_DIRECTION_BIDIRECTIONAL: + //DEBUG_PC("Bidirectional Port Direction"); + break; + case LINK_PORT_DIRECTION_INPUT: + //DEBUG_PC("Input Port Direction"); + break; + case LINK_PORT_DIRECTION_OUTPUT: + //DEBUG_PC("Output Port Direction"); + break; + case LINK_PORT_DIRECTION_UNKNOWN: + //DEBUG_PC("Unknown Port Direction"); + break; + } + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Friendly function to log the port termination direction + * + * @param direction + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void print_termination_direction(guint direction) +{ + switch (direction) { + case TERMINATION_DIRECTION_BIDIRECTIONAL: + //DEBUG_PC("Bidirectional Termination Direction"); + break; + case TERMINATION_DIRECTION_SINK: + //DEBUG_PC("Input Termination Direction"); + break; + case TERMINATION_DIRECTION_SOURCE: + //DEBUG_PC("Output Termination Direction"); + break; + case TERMINATION_DIRECTION_UNKNOWN: + //DEBUG_PC("Unknown Termination Direction"); + break; + } + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Friendly function to log the termination state + * + * @param state + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void print_termination_state(guint state) +{ + switch (state) { + case TERMINATION_STATE_CAN_NEVER_TERMINATE: + //DEBUG_PC("Can never Terminate"); + break; + case TERMINATION_STATE_NOT_TERMINATED: + DEBUG_PC("Not terminated"); + break; + case TERMINATION_STATE_TERMINATED_SERVER_TO_CLIENT_FLOW: + DEBUG_PC("Terminated server to client flow"); + break; + case TERMINATION_STATE_TERMINATED_CLIENT_TO_SERVER_FLOW: + DEBUG_PC("Terminated client to server flow"); + break; + case TERMINATION_STATE_TERMINATED_BIDIRECTIONAL: + //DEBUG_PC("Terminated bidirectional"); + break; + } + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Friendly function to log the capacity unit + * + * @param unit + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void print_capacity_unit(guint unit) { + + switch (unit) { + case CAPACITY_UNIT_TB: + DEBUG_PC("Unit in TB"); + break; + case CAPACITY_UNIT_TBPS: + DEBUG_PC("Unit in TB/s"); + break; + case CAPACITY_UNIT_GB: + DEBUG_PC("Unit in GB"); + break; + case CAPACITY_UNIT_GBPS: + DEBUG_PC("Unit in GB/s"); + break; + case CAPACITY_UNIT_MB: + DEBUG_PC("Unit in MB"); + break; + case CAPACITY_UNIT_MBPS: + //DEBUG_PC("Unit in MB/s"); + break; + case CAPACITY_UNIT_KB: + DEBUG_PC("Unit in KB"); + break; + case CAPACITY_UNIT_KBPS: + DEBUG_PC("Unit in KB/s"); + break; + case CAPACITY_UNIT_GHZ: + DEBUG_PC("Unit in GHz"); + break; + case CAPACITY_UNIT_MHZ: + DEBUG_PC("Unit in MHz"); + break; + } + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Friendly function to log the link forwarding direction + * + * @param linkFwDir + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void print_link_forwarding_direction(guint linkFwDir) { + switch (linkFwDir) { + case LINK_FORWARDING_DIRECTION_BIDIRECTIONAL: + DEBUG_PC("BIDIRECTIONAL LINK FORWARDING DIRECTION"); + break; + case LINK_FORWARDING_DIRECTION_UNIDIRECTIONAL: + DEBUG_PC("UNIDIRECTIONAL LINK FORWARDING DIRECTION"); + break; + case LINK_FORWARDING_DIRECTION_UNKNOWN: + DEBUG_PC("UNKNOWN LINK FORWARDING DIRECTION"); + break; + } + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Allocate memory for the contextSet + * + * @param + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +struct contextSet_t* create_contextSet() { + struct contextSet_t* c = g_malloc0(sizeof(struct contextSet_t)); + if (c == NULL) { + DEBUG_PC("Memory Allocation Failure"); + exit(-1); + } + return c; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Search a specific contextUuid element into the contextSet + * + * @param contextUuid + * @param set + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +struct context_t* find_contextId_in_set(gchar* contextUuid, struct contextSet_t* set) { + + g_assert(set); + //DEBUG_PC("Checking if contextId: %s in in the ContextList??", contextUuid); + + for (gint i = 0; i < set->num_context_set; i++) { + struct context_t* c = &(set->contextList[i]); + //DEBUG_PC("Context Item [%d] Id: %s", i, c->contextId); + if (strcmp(contextUuid, c->contextId) == 0) { + //DEBUG_PC("contextId: %s is FOUND in the ContextSet_List", contextUuid); + return c; + } + } + //DEBUG_PC("contextId: %s NOT FOUND in the ContextSet_List", contextUuid); + return NULL; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Add a specific context uuid into the context set + * + * @param contextUuid + * @param set + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +struct context_t* add_contextId_in_set(gchar *contextUuid, struct contextSet_t *set) { + + set->num_context_set++; + struct context_t* c = &(set->contextList[set->num_context_set - 1]); + duplicate_string(c->contextId, contextUuid); + return c; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Find a vertex in a specific graph + * + * @param contextUuid + * @param set + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +struct vertices_t* find_vertex_in_graph_context(struct graph_t *g, gchar* deviceId) { + + for (gint i = 0; i < g->numVertices; i++) + { + struct vertices_t* v = &(g->vertices[i]); + if (strcmp(v->verticeId.nodeId, deviceId) == 0) { + return v; + } + } + return NULL; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Adding a deviceId into a graph + * + * @param g + * @param deviceId + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +struct vertices_t* add_vertex_in_graph(struct graph_t* g, gchar* deviceId) { + g->numVertices++; + struct vertices_t* v = &(g->vertices[g->numVertices - 1]); + duplicate_string(v->verticeId.nodeId, deviceId); + return v; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Construct the graphs (vertices and edges) bound to every individual context + * + * @param cSet + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void build_contextSet_deviceList(struct contextSet_t* cSet) { + // Check every device their endpoints + for (gint i = 0; i < deviceList->numDevices; i++) { + struct device_t* d = &(deviceList->devices[i]); + //DEBUG_PC("Exploring DeviceId: %s", d->deviceId); + + // Check the associated endPoints + for (gint j = 0; j < d->numEndPoints; j++) { + struct endPoint_t* eP = &(d->endPoints[j]); + // Get endPointId (topology, context, device Id and endpoint uuid) + struct endPointId_t* ePid = &(eP->endPointId); //end point id + //DEBUG_PC(" EndPointId: %s || Type: %s", eP->endPointId.endpoint_uuid, d->deviceType); + //DEBUG_PC(" TopologyId: %s || ContextId: %s", eP->endPointId.topology_id.topology_uuid, eP->endPointId.topology_id.contextId); + + // Add contextId in ContextSet and the deviceId (+endpoint) into the vertex set + struct context_t *c = find_contextId_in_set(eP->endPointId.topology_id.contextId, cSet); + if (c == NULL) { + //DEBUG_PC(" contextUuid: %s MUST BE ADDED to ContextSet", eP->endPointId.topology_id.contextId); + c = add_contextId_in_set(eP->endPointId.topology_id.contextId, cSet); + } + // Check if the deviceId and endPointUuid are already considered in the graph of the context c + struct vertices_t* v = find_vertex_in_graph_context(&c->g, d->deviceId); + if (v == NULL) { + //DEBUG_PC(" deviceId: %s MUST BE ADDED to the Context Graph", d->deviceId); + v = add_vertex_in_graph(&c->g, d->deviceId); + } + } + } + //print_contextSet(cSet); + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Determine whether a deviceId is in the targetNode list of a specific vertex v + * + * @param v + * @param deviceId + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +struct targetNodes_t* find_targeted_vertex_in_graph_context(struct vertices_t* v, gchar *deviceId) { + for (gint k = 0; k < v->numTargetedVertices; k++) { + struct targetNodes_t* w = &(v->targetedVertices[k]); + if (strcmp(w->tVertice.nodeId, deviceId) == 0) { + return w; + } + } + return NULL; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Add a deviceId a targetNode of a specific vertex v + * + * @param v + * @param deviceId + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +struct targetNodes_t* add_targeted_vertex_in_graph_context(struct vertices_t* v, gchar* bDeviceId) { + v->numTargetedVertices++; + struct targetNodes_t* w = &(v->targetedVertices[v->numTargetedVertices - 1]); + duplicate_string(w->tVertice.nodeId, bDeviceId); + return w; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Returns the structure of a device endpoint bound to a specific deviceId and endPointId + * + * @param devId + * @param endPointUuid + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +struct endPoint_t* find_device_tied_endpoint(gchar* devId, gchar* endPointUuid) { + //DEBUG_PC("devId: %s ePId: %s", devId, endPointUuid); + for (gint i = 0; i < deviceList->numDevices; i++) { + struct device_t* d = &(deviceList->devices[i]); + if (strcmp(d->deviceId, devId) != 0) { + continue; + } + // Iterate over the endpoints tied to the deviceId + for (gint j = 0; j < d->numEndPoints; j++) { + struct endPoint_t* eP = &(d->endPoints[j]); + //DEBUG_PC("looked endPointId: %s", eP->endPointId.endpoint_uuid); + if (strcmp(eP->endPointId.endpoint_uuid, endPointUuid) == 0) { + return eP; + } + } + } + return NULL; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Adding the edge/linnk in the targetedNodes w list + * + * @param w + * @param l + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void add_edge_in_targetedVertice_set(struct targetNodes_t* w, struct link_t* l) { + //DEBUG_PC("\t targetedVertex: %s", w->tVertice.nodeId); + w->numEdges++; + struct edges_t* e = &(w->edges[w->numEdges - 1]); + // Copy the link Id UUID + duplicate_string(e->linkId, l->linkId); + + // copy the deviceId and endpointsIds (A --> Z) + struct link_endpointId_t* aEndpointId = &(l->linkEndPointId[0]); + duplicate_string(e->aNodeId.nodeId, aEndpointId->deviceId); + duplicate_string(e->aEndPointId, aEndpointId->endPointId); + duplicate_string(e->aTopologyId, aEndpointId->topology_id.topology_uuid); + + struct link_endpointId_t* zEndpointId = &(l->linkEndPointId[1]); + duplicate_string(e->zNodeId.nodeId, zEndpointId->deviceId); + duplicate_string(e->zEndPointId, zEndpointId->endPointId); + duplicate_string(e->zTopologyId, zEndpointId->topology_id.topology_uuid); + + // The potential and available capacity is indeed retrieved using aEndpointId in the deviceList + struct endPoint_t* eP = find_device_tied_endpoint(aEndpointId->deviceId, aEndpointId->endPointId); + if (eP == NULL) { + DEBUG_PC("devId: %s endPointUuid: %s NOT in Device List!!--- Weird", aEndpointId->deviceId, aEndpointId->endPointId); + exit(-1); + } + //Potential(total) and available capacity + e->unit = eP->potential_capacity.unit; + memcpy(&e->totalCap, &eP->potential_capacity.value, sizeof(gdouble)); + memcpy(&e->availCap, &eP->available_capacity.value, sizeof(gdouble)); + + // Copy interdomain local/remote Ids + memcpy(e->interDomain_localId, eP->inter_domain_plug_in.inter_domain_plug_in_local_id, + strlen(eP->inter_domain_plug_in.inter_domain_plug_in_local_id)); + memcpy(e->interDomain_remoteId, eP->inter_domain_plug_in.inter_domain_plug_in_remote_id, + strlen(eP->inter_domain_plug_in.inter_domain_plug_in_remote_id)); + + // cost value + memcpy(&e->cost, &l->cost_characteristics.cost_value, sizeof(gdouble)); + + // latency + memcpy(&e->delay, &l->latency_characteristics.fixed_latency, sizeof(gdouble)); + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Searching a specific edge/link by the linkId(UUID) + * + * @param w + * @param l + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +struct edges_t* find_edge_in_targetedVertice_set(struct targetNodes_t* w, struct link_t* l) { + + for (gint i = 0; i < w->numEdges; i++) { + struct edges_t* e = &(w->edges[i]); + if (strcmp(e->linkId, l->linkId) == 0) { + return e; + } + } + return NULL; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief supporting the construction of the graph per context using the explicit + * contents/info of the link list + * + * @param set + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void build_contextSet_linklList(struct contextSet_t* set) { + g_assert(set); + + // for each link in linkList: + // 1st- Retrieve endpoints A --> B feauture (context Id, device Id, endpoint Id) + // 2st - In the graph associated to the contextId, check wheter A (deviceId) is in the vertices list + // o No, this is weird ... exist + // o Yes, get the other link endpoint (i.e., B) and check whether it exists. If NOT add it, considering + // all the attributes; Otherwise, check whether the link is different from existing edges between A and B + + for (gint j = 0; j < linkList->numLinks; j++) { + struct link_t* l = &(linkList->links[j]); + // link assumed to be P2P A --> B; I.e. 2 endPoints; 1st specifies A and 2nd specifie B + struct link_endpointId_t* aEndpointId = &(l->linkEndPointId[0]); + struct topology_id_t* topologyId = &(aEndpointId->topology_id); + // get the contextId + gchar contextUuid[UUID_CHAR_LENGTH]; + duplicate_string(contextUuid, topologyId->contextId); + //DEBUG_PC("Link: %s in Context: %s", l->linkId, contextUuid); + + // Check first contextUuid exists in the cSet + struct context_t* c = find_contextId_in_set(contextUuid, set); + if (c == NULL) { + DEBUG_PC("ContextId: %s does NOT exist... weird", contextUuid); + exit(-1); + } + + // get the device ID of A + gchar aDeviceId[UUID_CHAR_LENGTH]; + duplicate_string(aDeviceId, aEndpointId->deviceId); + + struct graph_t* g = &(c->g); // get the graph associated to the context c + struct vertices_t* v = find_vertex_in_graph_context(g, aDeviceId); + if (v == NULL) { + DEBUG_PC("aDeviceId: %s IS NOT IN Vertices of contextId: %s", aDeviceId, contextUuid); + exit(-1); + } + // get the bEndpointId + struct link_endpointId_t* bEndpointId = &(l->linkEndPointId[1]); + gchar bDeviceId[UUID_CHAR_LENGTH]; + duplicate_string(bDeviceId, bEndpointId->deviceId); + // Check whether device B is in the targeted Vertices from A (i.e., v)? + // If not, add B in the targeted vertices B + create the edge and add it + // If B exist, check whether the explored link/edge is already in the list of edges + struct targetNodes_t* w = find_targeted_vertex_in_graph_context(v, bDeviceId); + if (w == NULL) { + //DEBUG_PC("B device [%s] is PEER of A device [%s]", bDeviceId, v->verticeId.nodeId); + w = add_targeted_vertex_in_graph_context(v, bDeviceId); + add_edge_in_targetedVertice_set(w, l); + } + else { + // w exists, it is needed to check whether the edge (link) should be added + struct edges_t* e = find_edge_in_targetedVertice_set(w, l); + if (e == NULL) { + // Add the link into the list + add_edge_in_targetedVertice_set(w, l); + } + else { + DEBUG_PC("The link already exists ..."); + continue; + } + } + } + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Create the set of (distinct) contexts with the deviceList and linkList + * + * @param cSet + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void build_contextSet(struct contextSet_t* cSet) { + g_assert(cSet); + g_assert(deviceList); + g_assert(linkList); + + // devices are tied to contexts, i.e. depending on the contextId of the devices + build_contextSet_deviceList(cSet); + + // Once the diverse contexts are created and the devices/endpoints asigned to the + // respective graph tied to each context, it is needed to create the edges + build_contextSet_linklList(cSet); + + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Print the contents of the ContextIds + * + * @param set + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void print_contextSet(struct contextSet_t* set) { + g_assert(set); + + for (gint i = 0; i < set->num_context_set; i++) { + struct context_t* c = &(set->contextList[i]); + DEBUG_PC("-------------------------------------------------------------"); + DEBUG_PC(" Context Id: %s", c->contextId); + DEBUG_PC("-------------------------------------------------------------"); + + struct graph_t* g = &(c->g); + for (gint j = 0; j < g->numVertices; j++) { + struct vertices_t* v = &(g->vertices[j]); + DEBUG_PC(" Head Device Id: %s", v->verticeId.nodeId); + for (gint k = 0; k < v->numTargetedVertices; k++) { + struct targetNodes_t* w = &(v->targetedVertices[k]); + DEBUG_PC(" [%d] --- Peer Device Id: %s", k, w->tVertice.nodeId); + for (gint l = 0; l < w->numEdges; l++) { + struct edges_t* e = &(w->edges[l]); + DEBUG_PC(" \t link Id: %s", e->linkId); + DEBUG_PC(" \t aEndPointId: %s", e->aEndPointId); + DEBUG_PC(" \t zEndPointId: %s", e->zEndPointId); + DEBUG_PC(" \t Available Capacity: %f, Latency: %f, Cost: %f", e->availCap, e->delay, e->cost); + DEBUG_PC(" \t aTopologyId: %s", e->aTopologyId); + DEBUG_PC(" \t zTopologyId: %s", e->zTopologyId); + } + } + } + } + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Check whether src and dst PE nodeId of the req are the same + * + * @param r + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +gint same_src_dst_pe_nodeid(struct service_t* s) +{ + // Check that source PE and dst PE are NOT the same, i.e., different ingress and egress endpoints (iEp, eEp) + struct service_endpoints_id_t* iEp = &(s->service_endpoints_id[0]); + struct service_endpoints_id_t* eEp = &(s->service_endpoints_id[1]); + + gchar* iEpUUID = iEp->endpoint_uuid; + gchar* eEpUUID = eEp->endpoint_uuid; + gchar* iDevUUID = iEp->device_uuid; + gchar* eDevUUID = eEp->device_uuid; + + // Compare the device uuids + if (strcmp(iDevUUID, eDevUUID) != 0) { + DEBUG_PC("DIFFERENT --- iDevId: %s and eDevId: %s", iDevUUID, eDevUUID); + return 1; + } + // Compare the endpoints (ports) + if (strcmp(iEpUUID, eEpUUID) != 0) { + DEBUG_PC("DIFFERENT --- iEpUUID: %s and eEpUUID: %s", iEpUUID, eEpUUID); + return 1; + } + return 0; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Handles issues with the route computation + * + * @param route + * @param s + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void comp_route_connection_issue_handler (struct compRouteOutput_t *path, struct service_t *s) +{ + g_assert(path); + g_assert(s); + + // Increase the number of computed routes/paths despite there was an issue to be reported + path->numPaths++; + // Copy the serviceId + copy_service_id(&(path->serviceId), &(s->serviceId)); + + // copy the service endpoints, in general, there will be 2 (point-to-point network connectivity services) + for (gint i = 0; i < s->num_service_endpoints_id; i++) { + struct service_endpoints_id_t* iEp = &(s->service_endpoints_id[i]); + struct service_endpoints_id_t* oEp = &(path->service_endpoints_id[i]); + copy_service_endpoint_id(oEp, iEp); + } + path->num_service_endpoints_id = s->num_service_endpoints_id; + path->noPathIssue = NO_PATH_CONS_ISSUE; + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief released the allocated memory fo compRouteOutputList_t + * + * @param ro + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void destroy_compRouteOutputList (struct compRouteOutputList_t *ro) +{ + g_assert (ro); + g_free (ro); + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief creates a copy of the underlying graph + * + * @param originalGraph + * @param destGraph + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void duplicate_graph (struct graph_t *originalGraph, struct graph_t *destGraph) { + g_assert (originalGraph); + g_assert (destGraph); + + destGraph->numVertices = originalGraph->numVertices; + for (gint i = 0; i < originalGraph->numVertices; i++) { + struct vertices_t *oVertex = &(originalGraph->vertices[i]); + struct vertices_t *dVertex = &(destGraph->vertices[i]); + dVertex->numTargetedVertices = oVertex->numTargetedVertices; + duplicate_node_id (&oVertex->verticeId, &dVertex->verticeId); + + for (gint j = 0; j < oVertex->numTargetedVertices; j++) { + struct targetNodes_t *oTargetedVertex = &(oVertex->targetedVertices[j]); + struct targetNodes_t *dTargetedVertex = &(dVertex->targetedVertices[j]); + duplicate_node_id (&oTargetedVertex->tVertice, &dTargetedVertex->tVertice); + dTargetedVertex->numEdges = oTargetedVertex->numEdges; + + for (gint k = 0; k < oTargetedVertex->numEdges; k++) { + struct edges_t *oEdge = &(oTargetedVertex->edges[k]); + struct edges_t *dEdge = &(dTargetedVertex->edges[k]); + duplicate_edge (dEdge, oEdge); + } + } + } + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Function used to retrieve from the graph the edge instance associated to the + * pathLink (pL) + * + * @param pL + * @parma g + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +struct edges_t* get_edge_from_graph_by_linkId(struct pathLink_t* pL, struct graph_t* g) { + g_assert(pL); + g_assert(g); + + for (gint i = 0; i < g->numVertices; i++) { + struct vertices_t* v = &(g->vertices[i]); + for (gint j = 0; j < v->numTargetedVertices; j++) { + struct targetNodes_t* tv = &(v->targetedVertices[j]); + for (gint k = 0; k < tv->numEdges; k++) { + struct edges_t* e = &(tv->edges[k]); + if (strcmp(e->linkId, pL->linkId) == 0) { + return e; + } + } + } + } + return NULL; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Function used to retrieve from the graph the reverse edge (rev_e) associated to an edge (e) + * + * @param e + * @parma g + * + * @author Ricardo Martínez + * @date 2022 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +struct edges_t* get_reverse_edge_from_the_graph(struct edges_t* e, struct graph_t* g) { + g_assert(e); + g_assert(g); + + for (gint i = 0; i < g->numVertices; i++) { + struct vertices_t* v = &(g->vertices[i]); + // Check Route Element zNodeId with the v->verticeId + if (compare_node_id(&e->zNodeId, &v->verticeId) != 0) + continue; + // Check Route Element zNodeis with any of reachable targeted vertices from v + gboolean foundTargVert = FALSE; + gint indexTargVert = -1; + for (gint j = 0; j < v->numTargetedVertices; j++) { + struct targetNodes_t* tv = &(v->targetedVertices[j]); + if (compare_node_id(&e->aNodeId, &tv->tVertice) == 0) + { + foundTargVert = TRUE; + indexTargVert = j; + break; + } + } + if (foundTargVert == FALSE) { + continue; + } + + // The targeted vertice is found, then check matching with the endpoints + struct targetNodes_t* tv = &(v->targetedVertices[indexTargVert]); + for (gint k = 0; k < tv->numEdges; k++) { + struct edges_t* rev_e = &(tv->edges[k]); + if ((strcmp(rev_e->aEndPointId, e->zEndPointId) == 0) && + (strcmp(rev_e->zEndPointId, e->aEndPointId) == 0)) { + return rev_e; + } + } + } + return NULL; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Function used to reflect in the graph the assigned/allocated resources contained in the path p + * considering the needs (e.g., bandwidth) of service s + * + * @param p + * @param s + * @parma g + * + * @author Ricardo Martínez + * @date 2022 + */ +///////////////////////////////////////////////////////////////////////////////////////// +void allocate_graph_resources (struct path_t *p, struct service_t *s, struct graph_t *g) +{ + g_assert (p); + g_assert (s); + g_assert (g); + // Retrieve the requested bw by the service + struct path_constraints_t* pathCons = get_path_constraints(s); + + for (gint i = 0; i < p->numPathLinks; i++) { + struct pathLink_t* pL = &(p->pathLinks[i]); + // get the edge associated to the linkId in the graph + struct edges_t* e = get_edge_from_graph_by_linkId(pL, g); + if (e == NULL) { + DEBUG_PC("The linkId: %s is NOT found in the Graph!!!", pL->linkId); + exit(-1); + } + //Update the availBw in the edge + gdouble resBw = e->availCap - pathCons->bwConstraint; + DEBUG_PC("Updating the Avail Bw @ edge/link: %s", e->linkId); + DEBUG_PC("Initial avaiCap @ e/link: %f, demanded Bw: %f, resulting Avail Bw: %f", e->availCap, pathCons->bwConstraint, resBw); + memcpy(&e->availCap, &resBw, sizeof(gdouble)); + DEBUG_PC("Final e/link avail Bw: %f", e->availCap); + } + g_free(pathCons); + + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Function used to reflect in the graph the assigned/allocated resources contained in the reverse direction of the path p + * considering the needs (e.g., bandwidth) of service s + * + * @param p + * @param s + * @parma g + * + * @author Ricardo Martínez + * @date 2021 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void allocate_graph_reverse_resources(struct path_t* p, struct service_t * s, struct graph_t* g) +{ + g_assert(p); + g_assert(s); + g_assert(g); + + struct path_constraints_t* pathCons = get_path_constraints(s); + for (gint i = 0; i < p->numPathLinks; i++) { + struct pathLink_t* pL = &(p->pathLinks[i]); + struct edges_t* e = get_edge_from_graph_by_linkId(pL, g); + if (e == NULL) { + DEBUG_PC("The linkId: %s is NOT found in the Graph!!!", pL->linkId); + exit(-1); + } + struct edges_t* rev_e = get_reverse_edge_from_the_graph(e, g); + if (rev_e == NULL) { + DEBUG_PC("the reverse edge of linkId: %s is NOT found in the Graph!!!", pL->linkId); + exit(-1); + } + //Update the availBw in the edge + gdouble resBw = rev_e->availCap - pathCons->bwConstraint; + DEBUG_PC("Updating the Avail Bw @ reverse edge/link: %s", rev_e->linkId); + DEBUG_PC("Initial avaiCap @ reverse edge e/link: %f, demanded Bw: %f, resulting Avail Bw: %f", rev_e->availCap, pathCons->bwConstraint, resBw); + memcpy(&rev_e->availCap, &resBw, sizeof(gdouble)); + DEBUG_PC("Final reverse edge e/link avail Bw: %f", rev_e->availCap); + } + g_free(pathCons); + return; +} + +//////////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief Function used to printall the computed paths for the requested network connectivity services + * + * @param routeList + * + * @author Ricardo Martínez + * @date 2021 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void print_path_connection_list(struct compRouteOutputList_t* routeList) { + g_assert(routeList); + for (gint i = 0; i < routeList->numCompRouteConnList; i++) { + DEBUG_PC("==================== Service Item: %d ===================", i); + struct compRouteOutput_t* rO = &(routeList->compRouteConnection[i]); + DEBUG_PC("num service endpoints: %d", rO->num_service_endpoints_id); + struct serviceId_t* s = &(rO->serviceId); + DEBUG_PC("ContextId: %s, ServiceId: %s", s->contextId, s->service_uuid); + DEBUG_PC("ingress --- %s [%s]", rO->service_endpoints_id[0].device_uuid, + rO->service_endpoints_id[0].endpoint_uuid); + DEBUG_PC("egress --- %s [%s]", rO->service_endpoints_id[1].device_uuid, + rO->service_endpoints_id[1].endpoint_uuid); + + if (rO->noPathIssue == NO_PATH_CONS_ISSUE) { + DEBUG_PC("NO PATH SUCCESSFULLY COMPUTED"); + continue; + } + // Path + DEBUG_PC("Number of paths: %d", rO->numPaths); + for (gint j = 0; j < rO->numPaths; j++) { + struct path_t* p = &(rO->paths[j]); + print_path_t(p); + } + } + return; +} + +/////////////////////////////////////////////////////////////////////////////////// +/** + * @file pathComp_tools.c + * @brief update statistics for the path computation operations + * + * @param routeConnList + * @param d + * + * @author Ricardo Martínez + * @date 2021 + */ + ///////////////////////////////////////////////////////////////////////////////////////// +void update_stats_path_comp(struct compRouteOutputList_t* routeConnList, struct timeval d, gint numSuccesPathComp, gint numPathCompIntents) { + g_assert(routeConnList); + + total_path_comp_time.tv_sec = total_path_comp_time.tv_sec + d.tv_sec; + total_path_comp_time.tv_usec = total_path_comp_time.tv_usec + d.tv_usec; + total_path_comp_time = tv_adjust(total_path_comp_time); + + gdouble path_comp_time_msec = (((total_path_comp_time.tv_sec) * 1000) + ((total_path_comp_time.tv_usec) / 1000)); + gdouble av_alg_comp_time = ((path_comp_time_msec / numSuccesPathComp)); + DEBUG_PC("\t --- STATS PATH COMP ----"); + DEBUG_PC("Succesfully Comp: %d | Path Comp Requests: %d", numSuccesPathComp, numPathCompIntents); + DEBUG_PC("AV. PATH COMP ALG. TIME: %f ms", av_alg_comp_time); + + for (gint i = 0; i < serviceList->numServiceList; i++) { + struct service_t* s = &(serviceList->services[i]); + char* eptr; + for (gint j = 0; j < s->num_service_constraints; j++) { + struct constraint_t* constraints = &(s->constraints[j]); + if (strncmp((const char*)(constraints->constraint_type), "bandwidth", 9) == 0) { + totalReqBw += (gdouble)(strtod((char*)constraints->constraint_value, &eptr)); + } + } + } + for (gint k = 0; k < routeConnList->numCompRouteConnList; k++) { + struct compRouteOutput_t* rO = &(routeConnList->compRouteConnection[k]); + if (rO->noPathIssue == NO_PATH_CONS_ISSUE) { + continue; + } + // Get the requested service bw bound to that computed path + struct path_t* p = &(rO->paths[0]); + struct service_t* s = get_service_for_computed_path(rO->serviceId.service_uuid); + if (s == NULL) { + DEBUG_PC("Weird the service associated to a path is not found"); + exit(-1); + } + for (gint l = 0; l < s->num_service_constraints; l++) { + struct constraint_t* constraints = &(s->constraints[l]); + char* eptr; + if (strncmp((const char*)(constraints->constraint_type), "bandwidth", 9) == 0) { + totalServedBw += (gdouble)(strtod((char*)constraints->constraint_value, &eptr)); + } + } + } + gdouble avServedRatio = totalServedBw / totalReqBw; + DEBUG_PC("AV. Served Ratio: %f", avServedRatio); + gdouble avBlockedBwRatio = (gdouble)(1.0 - avServedRatio); + DEBUG_PC("AV. BBE: %f", avBlockedBwRatio); + return; + +} diff --git a/src/pathcomp/backend/pathComp_tools.h b/src/pathcomp/backend/pathComp_tools.h new file mode 100644 index 0000000000000000000000000000000000000000..b6bcea04c8aa01b6cf730460e0075327f872f344 --- /dev/null +++ b/src/pathcomp/backend/pathComp_tools.h @@ -0,0 +1,613 @@ +/* + * 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. + */ + +#ifndef _PATHCOMP_TOOLS_H +#define _PATHCOMP_TOOLS_H + +#include +#include +#include +#include + +// External variables +extern struct map_nodes_t* mapNodes; +extern struct graph_t* graph; +extern struct contextSet_t* contextSet; +extern struct linkList_t* linkList; +extern struct deviceList_t* deviceList; +extern struct serviceList_t* serviceList; + +#define INFINITY_COST 0xFFFFFFFF +#define MAX_NUM_PRED 100 + +#define MAX_KSP_VALUE 3 + +// HTTP RETURN CODES +#define HTTP_CODE_OK 200 +#define HTTP_CODE_CREATED 201 +#define HTTP_CODE_BAD_REQUEST 400 +#define HTTP_CODE_UNAUTHORIZED 401 +#define HTTP_CODE_FORBIDDEN 403 +#define HTTP_CODE_NOT_FOUND 404 +#define HTTP_CODE_NOT_ACCEPTABLE 406 + +#define MAX_NODE_ID_SIZE 37 // UUID 128 Bits - In hexadecimal requires 36 char +#define MAX_CONTEXT_ID 37 +//#define UUID_CHAR_LENGTH 37 +#define UUID_CHAR_LENGTH 100 +struct nodes_t { + gchar nodeId[UUID_CHAR_LENGTH]; +}; + +struct nodeItem_t { + struct nodes_t node; + gdouble distance; + gdouble latency; +}; + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Structures for collecting the RL topology including: intra WAN topology and inter-WAN links +/////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#define MAX_INTER_DOMAIN_PLUG_IN_SIZE 128 +struct edges_t { + //aNodeId/Device Id + struct nodes_t aNodeId; + //zNodeId/Device Id + struct nodes_t zNodeId; + + // UUID of the endPointIds + gchar aEndPointId[UUID_CHAR_LENGTH]; + gchar zEndPointId[UUID_CHAR_LENGTH]; + + // UUID of the link + gchar linkId[UUID_CHAR_LENGTH]; + + // Potential(total) and available capacity + gint unit; + gdouble totalCap, availCap; + + gdouble cost; + gdouble delay; + + // inter-domain local and remote Ids + gchar interDomain_localId[MAX_INTER_DOMAIN_PLUG_IN_SIZE]; + gchar interDomain_remoteId[MAX_INTER_DOMAIN_PLUG_IN_SIZE]; + + gchar aTopologyId[UUID_CHAR_LENGTH]; + gchar zTopologyId[UUID_CHAR_LENGTH]; +}; + +// Structure to handle the path computation +struct pred_comp_t { + struct nodes_t v; + struct edges_t e; +}; + +struct pred_t { + struct pred_comp_t predComp[MAX_NUM_PRED]; + gint numPredComp; +}; + +// Structures for the managing the path computation algorithm +struct map_t { + struct nodes_t verticeId; + struct edges_t predecessor; + gdouble distance; + gdouble avaiBandwidth; + gdouble latency; +}; + +#define MAX_MAP_NODE_SIZE 100 +struct map_nodes_t { + struct map_t map[MAX_MAP_NODE_SIZE]; + gint numMapNodes; +}; + +#define MAX_NUM_VERTICES 20 // 100 # LGR: reduced from 100 to 20 to divide by 5 the memory used +#define MAX_NUM_EDGES 40 // 100 # LGR: reduced from 100 to 40 to divide by 2.5 the memory used +// Structures for the graph composition +struct targetNodes_t { + // remote / targeted node + struct nodes_t tVertice; + // edge conencting a pair of vertices + struct edges_t edges[MAX_NUM_EDGES]; + gint numEdges; +}; + +struct vertices_t { + struct targetNodes_t targetedVertices[MAX_NUM_VERTICES]; + gint numTargetedVertices; + struct nodes_t verticeId; +}; + +struct graph_t { + struct vertices_t vertices[MAX_NUM_VERTICES]; + gint numVertices; +}; + +//////////////////////////////////////////////////// +// Structure for the Set of Contexts +/////////////////////////////////////////////////// +struct context_t { + gchar contextId[UUID_CHAR_LENGTH]; // UUID char format 36 chars + // conext Id has a graph associated + struct graph_t g; +}; + +//////////////////////////////////////////////////// +// Structure for the Set of Contexts +/////////////////////////////////////////////////// +#define MAX_NUMBER_CONTEXT 1 // 100 # LGR: reduced from 100 to 1 to divide by 100 the memory used +struct contextSet_t { + struct context_t contextList[MAX_NUMBER_CONTEXT]; + gint num_context_set; +}; + +#define MAX_ALG_ID_LENGTH 10 +//////////////////////////////////////////////////// +// External Variables +/////////////////////////////////////////////////// +extern gchar algId[MAX_ALG_ID_LENGTH]; + +//////////////////////////////////////////////////// +// Structure for the Requested Transport Connectivity Services +/////////////////////////////////////////////////// +#define SERVICE_TYPE_UNKNOWN 0 +#define SERVICE_TYPE_L3NM 1 +#define SERVICE_TYPE_L2NM 2 +#define SERVICE_TYPE_TAPI 3 + +/////////////////////////////////////////////////////////////////// +// Structure for the topology_id +/////////////////////////////////////////////////////////////////// +struct topology_id_t { + gchar contextId[UUID_CHAR_LENGTH]; + gchar topology_uuid[UUID_CHAR_LENGTH]; +}; + +struct inter_domain_plug_in_t { + gchar inter_domain_plug_in_local_id[MAX_INTER_DOMAIN_PLUG_IN_SIZE]; + gchar inter_domain_plug_in_remote_id[MAX_INTER_DOMAIN_PLUG_IN_SIZE]; +}; + +/////////////////////////////////////////////////////////////////// +// Structure for the endPointId +/////////////////////////////////////////////////////////////////// +struct endPointId_t { + struct topology_id_t topology_id; + gchar device_id[UUID_CHAR_LENGTH]; + gchar endpoint_uuid[UUID_CHAR_LENGTH]; +}; + +/////////////////////////////////////////////////////////////////// +// Structure for the endPoint +/////////////////////////////////////////////////////////////////// +#define CAPACITY_UNIT_TB 0 +#define CAPACITY_UNIT_TBPS 1 +#define CAPACITY_UNIT_GB 2 +#define CAPACITY_UNIT_GBPS 3 +#define CAPACITY_UNIT_MB 4 +#define CAPACITY_UNIT_MBPS 5 +#define CAPACITY_UNIT_KB 6 +#define CAPACITY_UNIT_KBPS 7 +#define CAPACITY_UNIT_GHZ 8 +#define CAPACITY_UNIT_MHZ 9 +struct capacity_t { + gdouble value; + gint unit; +}; + +/////////////////////////////////////////////////////////////////// +// Structure for the endPoint +/////////////////////////////////////////////////////////////////// +#define MAX_ENDPOINT_TYPE_SIZE 128 +// Link Port Direction +#define LINK_PORT_DIRECTION_BIDIRECTIONAL 0 +#define LINK_PORT_DIRECTION_INPUT 1 +#define LINK_PORT_DIRECTION_OUTPUT 2 +#define LINK_PORT_DIRECTION_UNKNOWN 3 +// Termination Direction +#define TERMINATION_DIRECTION_BIDIRECTIONAL 0 +#define TERMINATION_DIRECTION_SINK 1 +#define TERMINATION_DIRECTION_SOURCE 2 +#define TERMINATION_DIRECTION_UNKNOWN 3 +// Termination State +#define TERMINATION_STATE_CAN_NEVER_TERMINATE 0 +#define TERMINATION_STATE_NOT_TERMINATED 1 +#define TERMINATION_STATE_TERMINATED_SERVER_TO_CLIENT_FLOW 2 +#define TERMINATION_STATE_TERMINATED_CLIENT_TO_SERVER_FLOW 3 +#define TERMINATION_STATE_TERMINATED_BIDIRECTIONAL 4 + +struct endPoint_t { + struct endPointId_t endPointId; + gchar endpointType[MAX_ENDPOINT_TYPE_SIZE]; + guint link_port_direction; + guint termination_direction; + guint termination_state; + struct capacity_t potential_capacity; + struct capacity_t available_capacity; + // inter-domain identifiers + struct inter_domain_plug_in_t inter_domain_plug_in; +}; + +/////////////////////////////////////////////////////////////////// +// Structure for the device contents +/////////////////////////////////////////////////////////////////// +#define MAX_DEV_TYPE_SIZE 128 +#define MAX_DEV_ENDPOINT_LENGTH 40 // 10 # LGR: controllers might have large number of endpoints +struct device_t { + gchar deviceId[UUID_CHAR_LENGTH]; // device ID using UUID (128 bits) + + gchar deviceType[MAX_DEV_TYPE_SIZE]; // Specifies the device type + + // define the endpoints attached to the device + gint numEndPoints; + struct endPoint_t endPoints[MAX_DEV_ENDPOINT_LENGTH]; +}; + +/////////////////////////////////////////////////////////////////// +// Structure for the device List +/////////////////////////////////////////////////////////////////// +#define MAX_NUM_DEVICE 200 +struct deviceList_t { + // device information + gint numDevices; + struct device_t devices[MAX_NUM_DEVICE]; +}; + +/////////////////////////////////////////////////////////////////// +// Structure for the link EndPoint Id +/////////////////////////////////////////////////////////////////// +struct link_endpointId_t { + struct topology_id_t topology_id; + gchar deviceId[UUID_CHAR_LENGTH]; // Device UUID + gchar endPointId[UUID_CHAR_LENGTH]; // Link EndPoint UUID +}; + +/////////////////////////////////////////////////////////////////// +// Structure for the link cost characteristics +/////////////////////////////////////////////////////////////////// +#define LINK_COST_NAME_SIZE 128 +struct cost_characteristics_t { + gchar cost_name[LINK_COST_NAME_SIZE]; + gdouble cost_value; + gdouble cost_algorithm; +}; + +/////////////////////////////////////////////////////////////////// +// Structure for the latency characteristics of the link +/////////////////////////////////////////////////////////////////// +struct latency_characteristics_t { + gdouble fixed_latency; +}; + +/////////////////////////////////////////////////////////////////// +// Structure for the link +/////////////////////////////////////////////////////////////////// +#define MAX_NUM_LINK_ENDPOINT_IDS 2 + +#define LINK_FORWARDING_DIRECTION_BIDIRECTIONAL 0 +#define LINK_FORWARDING_DIRECTION_UNIDIRECTIONAL 1 +#define LINK_FORWARDING_DIRECTION_UNKNOWN 2 +struct link_t { + gchar linkId[UUID_CHAR_LENGTH]; // link Id using UUID (128 bits) + + gint numLinkEndPointIds; + struct link_endpointId_t linkEndPointId[MAX_NUM_LINK_ENDPOINT_IDS]; + + guint forwarding_direction; + struct capacity_t potential_capacity; + struct capacity_t available_capacity; + struct cost_characteristics_t cost_characteristics; + struct latency_characteristics_t latency_characteristics; +}; + +/////////////////////////////////////////////////////////////////// +// Structure for the link List +/////////////////////////////////////////////////////////////////// +#define MAX_NUM_LIST 2000 +struct linkList_t { + gint numLinks; + struct link_t links[MAX_NUM_LIST]; +}; + +//////////////////////////////////////////////////// +// Structure for service Identifier +/////////////////////////////////////////////////// +struct serviceId_t { + gchar contextId[UUID_CHAR_LENGTH]; + gchar service_uuid[UUID_CHAR_LENGTH]; +}; + +//////////////////////////////////////////////////// +// Structure the service endpoint ids +/////////////////////////////////////////////////// +struct service_endpoints_id_t { + struct topology_id_t topology_id; + gchar device_uuid[UUID_CHAR_LENGTH]; + gchar endpoint_uuid[UUID_CHAR_LENGTH]; +}; + +//////////////////////////////////////////////////// +// Structure for handling generic targeted service constraints +//////////////////////////////////////////////////// +#define MAX_CONSTRAINT_SIZE 128 +// Constraint Type: bandwidth, latency, energy, cost +struct constraint_t { + gchar constraint_type[MAX_CONSTRAINT_SIZE]; + gchar constraint_value[MAX_CONSTRAINT_SIZE]; +}; + +//////////////////////////////////////////////////// +// Structure for individual service request +//////////////////////////////////////////////////// +#define SERVICE_TYPE_UNKNOWN 0 +#define SERVICE_TYPE_L3NM 1 +#define SERVICE_TYPE_L2NM 2 +#define SERVICE_TYPE_TAPI 3 + +#define MAX_NUM_SERVICE_ENPOINTS_ID 2 + +#define MAX_NUM_SERVICE_CONSTRAINTS 10 +struct service_t { + // Indentifier used to determine the used Algorithm Id, e.g., KSP + gchar algId[MAX_ALG_ID_LENGTH]; + + // PATHS expected for the output + guint kPaths; + + struct serviceId_t serviceId; + + guint service_type; // unknown, l2nm, l3nm, tapi + + // endpoints of the network connectivity service, assumed p2p + // the 1st one assumed to be the source (ingress) and the 2nd one is the sink (egress) + struct service_endpoints_id_t service_endpoints_id[MAX_NUM_SERVICE_ENPOINTS_ID]; + guint num_service_endpoints_id; + + // Service Constraints + struct constraint_t constraints[MAX_NUM_SERVICE_CONSTRAINTS]; + guint num_service_constraints; +}; + +//////////////////////////////////////////////////// +// Structure to handle path constraints during computation +//////////////////////////////////////////////////// +struct path_constraints_t { + gdouble bwConstraint; + gboolean bw; + + gdouble costConstraint; + gboolean cost; + + gdouble latencyConstraint; + gboolean latency; + + gdouble energyConstraint; + gboolean energy; +}; + +//////////////////////////////////////////////////// +// Structure for the handling the service requests +/////////////////////////////////////////////////// +#define MAX_SERVICE_LIST 100 +struct serviceList_t { + struct service_t services[MAX_SERVICE_LIST]; + gint numServiceList; +}; + +//////////////////////////////////////////////////////////////////////////////////////////// +// Structure describing the links forming a computed path +//////////////////////////////////////////////////////////////////////////////////////////// +struct linkTopology_t { + gchar topologyId[UUID_CHAR_LENGTH]; +}; + +struct pathLink_t { + gchar linkId[UUID_CHAR_LENGTH]; // link id UUID in char format + + gchar aDeviceId[UUID_CHAR_LENGTH]; + gchar zDeviceId[UUID_CHAR_LENGTH]; + gchar aEndPointId[UUID_CHAR_LENGTH]; + gchar zEndPointId[UUID_CHAR_LENGTH]; + + struct topology_id_t topologyId; + + struct linkTopology_t linkTopologies[2]; // a p2p link (at most) can connect to devices (endpoints) attached to 2 different topologies + gint numLinkTopologies; +}; + +//////////////////////////////////////////////////////////////////////////////////////////// +// Structure describing a computed path +//////////////////////////////////////////////////////////////////////////////////////////// +#define MAX_ROUTE_ELEMENTS 50 +struct routeElement_t { + //aNodeId/Device Id + struct nodes_t aNodeId; + //zNodeId/Device Id + struct nodes_t zNodeId; + + // UUID of the endPointIds + gchar aEndPointId[UUID_CHAR_LENGTH]; + gchar zEndPointId[UUID_CHAR_LENGTH]; + + // UUID of the link + gchar linkId[UUID_CHAR_LENGTH]; + + gchar aTopologyId[UUID_CHAR_LENGTH]; + gchar zTopologyId[UUID_CHAR_LENGTH]; + + // contextId + gchar contextId[UUID_CHAR_LENGTH]; +}; + +struct compRouteOutputItem_t { + // Potential(total) and available capacity + gint unit; + gdouble totalCap, availCap; + + gdouble cost; + gdouble delay; + + struct routeElement_t routeElement[MAX_ROUTE_ELEMENTS]; + gint numRouteElements; +}; + +#define MAX_NUM_PATHS 30 +struct path_set_t { + struct compRouteOutputItem_t paths[MAX_NUM_PATHS]; + gint numPaths; +}; + +#define MAX_NUM_PATH_LINKS 20 +struct path_t { + struct capacity_t path_capacity; + struct latency_characteristics_t path_latency; + struct cost_characteristics_t path_cost; + + struct pathLink_t pathLinks[MAX_NUM_PATH_LINKS]; + guint numPathLinks; +}; + +#define NO_PATH_CONS_ISSUE 1 // No path due to a constraint issue +#define MAX_NUM_COMPUTED_PATHS 10 +struct compRouteOutput_t +{ + // object describing the service identifier: serviceId and contextId + struct serviceId_t serviceId; + + // array describing the service endpoints ids + struct service_endpoints_id_t service_endpoints_id[MAX_NUM_SERVICE_ENPOINTS_ID]; + guint num_service_endpoints_id; + + struct path_t paths[MAX_NUM_COMPUTED_PATHS]; + gint numPaths; + + // if the transport connectivity service cannot be computed, this value is set to 0 determining the constraints were not fulfilled + gint noPathIssue; +}; + +//////////////////////////////////////////////////////////////////////////////////////////// +// Structure to handle the response list with all the computed network connectivity services +//////////////////////////////////////////////////////////////////////////////////////////// +#define MAX_COMP_CONN_LIST 100 +struct compRouteOutputList_t +{ + struct compRouteOutput_t compRouteConnection[MAX_COMP_CONN_LIST]; + gint numCompRouteConnList; + + ///////////////// Metrics ////////////////////////////////////////// + // Number of total succesfully computed connections, i.e., at least 1 feasible path exists + // for every connection in the list + gint compRouteOK; + // For the succesfully newly computed/recovered/re-allocated/re-optimized connections, this + // metric determines the average allocable bandwidth over all the (re-)computed paths for the succesfully + // (i.e., feasible path) connections + gdouble compRouteConnAvBandwidth; + // For the succesfully newly computed/recovered/re-allocated/re-optimized connections, this + // metric determines the average path length (in terms of number of hops) over the computed path for the + // succesfully (i.e., feasible path) connections + gdouble compRouteConnAvPathLength; +}; + +// Prototype of external declaration of functions +void print_path (struct compRouteOutputItem_t *); +void print_path_t(struct path_t*); + +void duplicate_string(gchar *, gchar *); + +gchar* get_uuid_char(uuid_t); +void copy_service_id(struct serviceId_t*, struct serviceId_t *); +void copy_service_endpoint_id(struct service_endpoints_id_t *, struct service_endpoints_id_t *); + +struct graph_t* get_graph_by_contextId(struct contextSet_t *, gchar *); + +struct pred_t * create_predecessors (); +struct edges_t* create_edge(); +void print_predecessors (struct pred_t *); +void build_predecessors (struct pred_t *, struct service_t *, struct map_nodes_t *); +struct nodes_t * create_node (); +struct routeElement_t * create_routeElement (); + +void duplicate_node_id (struct nodes_t *, struct nodes_t *); +gint compare_node_id (struct nodes_t *, struct nodes_t *); +void duplicate_routeElement (struct routeElement_t *, struct routeElement_t *); +void duplicate_edge (struct edges_t *, struct edges_t *); +void duplicate_path (struct compRouteOutputItem_t *, struct compRouteOutputItem_t *); +void duplicate_path_t(struct compRouteOutputItem_t *, struct path_t *); +gint get_map_index_by_nodeId (gchar *, struct map_nodes_t *); +void get_edge_from_map_by_node (struct edges_t *, struct nodes_t*, struct map_nodes_t *); +void get_edge_from_predecessors (struct edges_t *, struct nodes_t*, struct pred_t *); +void build_path (struct compRouteOutputItem_t *, struct pred_t *, struct service_t *); +void print_graph (struct graph_t *); + +gint graph_vertice_lookup (gchar *, struct graph_t *); +gint graph_targeted_vertice_lookup (gint, gchar *, struct graph_t *); +gint graph_targeted_vertice_add (gint, gchar *, struct graph_t *); + +void remove_edge_from_graph (struct graph_t *, struct edges_t *); + +struct path_set_t * create_path_set (); +void sort_path_set (struct path_set_t *); +void pop_front_path_set (struct path_set_t *); +void remove_path_set(struct path_set_t*); + +void build_map_node(struct map_nodes_t *, struct graph_t *); +struct compRouteOutputList_t * create_route_list(); +struct compRouteOutputItem_t * create_path_item (); +void add_routeElement_path_back (struct routeElement_t *, struct compRouteOutputItem_t *); +gboolean matching_path_rootPath (struct compRouteOutputItem_t *, struct compRouteOutputItem_t *, struct nodes_t *, struct edges_t *); +void modify_targeted_graph (struct graph_t *, struct path_set_t *, struct compRouteOutputItem_t *, struct nodes_t *); +gint find_nodeId (gconstpointer, gconstpointer); +gint check_link (struct nodeItem_t *, gint, gint, struct graph_t *, struct service_t *, GList **, GList **, struct map_nodes_t *); +gboolean check_computed_path_feasability (struct service_t *, struct compRouteOutputItem_t * ); + +gint sort_by_distance (gconstpointer, gconstpointer); + +struct graph_t * create_graph (); +struct map_nodes_t * create_map_node (); + +struct service_t * get_service_for_computed_path(gchar *); + +struct deviceList_t* create_device_list(); +struct linkList_t* create_link_list(); +struct serviceList_t* create_service_list(); + +void print_service_type(guint); +void print_link_port_direction(guint); +void print_termination_direction(guint); +void print_termination_state(guint); +void print_capacity_unit(guint); +void print_link_forwarding_direction(guint); + +struct contextSet_t* create_contextSet(); +void build_contextSet(struct contextSet_t *); +void print_contextSet(struct contextSet_t *); + +gint same_src_dst_pe_nodeid (struct service_t *); +void comp_route_connection_issue_handler (struct compRouteOutput_t *, struct service_t *); + +void destroy_compRouteOutputList (struct compRouteOutputList_t *); +void duplicate_graph (struct graph_t *, struct graph_t *); + +void allocate_graph_resources (struct path_t *, struct service_t *, struct graph_t *); +void allocate_graph_reverse_resources(struct path_t*, struct service_t *, struct graph_t *); +void print_route_solution_list (GList *); +struct timeval tv_adjust(struct timeval); + +void print_path_connection_list(struct compRouteOutputList_t*); +void update_stats_path_comp(struct compRouteOutputList_t*, struct timeval, gint, gint); +#endif \ No newline at end of file diff --git a/src/pathcomp/backend/tests/inter_domain_test.txt b/src/pathcomp/backend/tests/inter_domain_test.txt new file mode 100644 index 0000000000000000000000000000000000000000..3aeaa3779a816c7b79ff20601d80450de1743d4a --- /dev/null +++ b/src/pathcomp/backend/tests/inter_domain_test.txt @@ -0,0 +1,543 @@ +{ +"serviceList": [ +{ +"algId": "KSP", +"syncPaths": false, +"serviceId": { +"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"service_uuid": "651550d8-46a0-4f36-9fb9-21b8e4f1b8d2" +}, +"serviceType": 1, +"service_endpoints_ids": [ +{ +"topology_id": { +"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaa" +}, +"device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa11", +"endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa111" +}, +{ +"topology_id": { +"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" +}, +"device_id": "cccccccc-cccc-cccc-cccc-cccccccccc33", +"endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc331" +} +], +"service_constraints": [ +{"constraint_type": "bandwidth", "constraint_value": "100"}, +{"constraint_type": "latency", "constraint_value": "20"} +], +"kPaths": 3 +} +], +"deviceList": [ +{"device_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa11", "device_type": "L3", +"device_endpoints": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa11", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa111"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 4, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa11", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa112"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa11", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa113"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}} +] +}, +{"device_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa13", "device_type": "L3", +"device_endpoints": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa13", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa132"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa13", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa133"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa13", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa134"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}} +] +}, +{"device_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa12", "device_type": "L3", +"device_endpoints": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa12", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa122"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa12", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa123"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa12", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa124"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}} +] +}, +{"device_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa14", "device_type": "L3", +"device_endpoints": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa14", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa142"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa14", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa143"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa14", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa141"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, "inter-domain-plug-in": {"plug-id-inter-domain-local-id": "a2", "plug-id-inter-domain-remote-id":"c1"}} +] +}, +{"device_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa15", "device_type": "L3", +"device_endpoints": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa15", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa151"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, "inter-domain-plug-in":{"plug-id-inter-domain-local-id":"a1", +"plug-id-inter-domain-remote-id":"b1"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa15", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa152"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa15", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa153"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}} +] +}, +{"device_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb21", "device_type": "L3", +"device_endpoints": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb21", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb211"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, "inter-domain-plug-in":{"plug-id-inter-domain-local-id":"b1", +"plug-id-inter-domain-remote-id":"a1"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb21", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb212"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb21", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb213"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}} +] +}, +{"device_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb23", "device_type": "L3", +"device_endpoints": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb23", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb231"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, "inter-domain-plug-in":{"plug-id-inter-domain-local-id":"b2", +"plug-id-inter-domain-remote-id":"c2"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb23", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb232"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb23", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb233"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}} +] +}, +{"device_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb24", "device_type": "L3", +"device_endpoints": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb24", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb241"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, "inter-domain-plug-in":{"plug-id-inter-domain-local-id":"b4", +"plug-id-inter-domain-remote-id":"c3"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb24", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb242"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb24", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb243"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}} +] +}, +{"device_Id": "cccccccc-cccc-cccc-cccc-cccccccccc31", "device_type": "L3", +"device_endpoints": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc31", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc311"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, "inter-domain-plug-in":{"plug-id-inter-domain-local-id":"c1", +"plug-id-inter-domain-remote-id":"a2"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc31", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc312"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc31", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc313"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}} +] +}, +{"device_Id": "cccccccc-cccc-cccc-cccc-cccccccccc32", "device_type": "L3", +"device_endpoints": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc32", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc321"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, "inter-domain-plug-in":{"plug-id-inter-domain-local-id":"c2", +"plug-id-inter-domain-remote-id":"b2"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc32", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc322"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc32", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc323"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}} +] +}, +{"device_Id": "cccccccc-cccc-cccc-cccc-cccccccccc33", "device_type": "L3", +"device_endpoints": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc33", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc331"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, "inter-domain-plug-in":{"plug-id-inter-domain-local-id":"c3", +"plug-id-inter-domain-remote-id":"b4"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc33", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc332"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc33", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc333"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}} +] +} +], +"linkList": [ +{"link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1112", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa11", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa113"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa12", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa122"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1211", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa12", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa122"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa11", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa113"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1113", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa11", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa112"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa13", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa132"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1311", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa13", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa132"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa11", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa112"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1312", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa13", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa133"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa12", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa123"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1213", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa12", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa123"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa13", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa133"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1214", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa12", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa124"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa14", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa142"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1412", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa14", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa142"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa12", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa124"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1315", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa13", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa134"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa15", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa152"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1513", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa15", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa152"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa13", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa134"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1415", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa14", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa143"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa15", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa153"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1514", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa15", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa153"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa14", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa143"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1521", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa15", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa151"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb21", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb211"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbb2115", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb21", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb211"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa15", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa151"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1431", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa14", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa141"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc31", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc311"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "cccccccc-cccc-cccc-cccc-cccccccc3114", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc31", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc311"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa14", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa141"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbb2124", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb21", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb212"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb24", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb242"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbb2421", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb24", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb242"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb21", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb212"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbb2123", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb21", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb213"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb23", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb233"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbb2321", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb23", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb233"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb21", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb213"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbb2324", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb23", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb232"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb24", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb243"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbb2424", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb24", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb243"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb23", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb232"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbb2332", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb23", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb231"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc32", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc321"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "cccccccc-cccc-cccc-cccc-cccccccc3223", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc32", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc321"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb23", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb231"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbb2433", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb24", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb241"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc34", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc331"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "cccccccc-cccc-cccc-cccc-cccccccc3324", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc33", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc331"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb24", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb241"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "cccccccc-cccc-cccc-cccc-cccccccc3132", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc31", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc312"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc32", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc323"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "cccccccc-cccc-cccc-cccc-cccccccc3231", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc32", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc323"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc31", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc312"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "cccccccc-cccc-cccc-cccc-cccccccc3133", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc31", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc313"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc33", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc333"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "cccccccc-cccc-cccc-cccc-cccccccc3331", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc33", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc333"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc31", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc313"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "cccccccc-cccc-cccc-cccc-cccccccc3233", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc32", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc322"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc33", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc332"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "cccccccc-cccc-cccc-cccc-cccccccc3332", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc33", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc332"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc32", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc322"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +} +] +} \ No newline at end of file diff --git a/src/pathcomp/backend/tests/pc-req.json b/src/pathcomp/backend/tests/pc-req.json new file mode 100644 index 0000000000000000000000000000000000000000..f465c95235dc80851b9e91dc80c3df60d3b4dbe0 --- /dev/null +++ b/src/pathcomp/backend/tests/pc-req.json @@ -0,0 +1,1230 @@ +{ + "deviceList": [ + { + "device_Id": "A1", + "device_endpoints": [ + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "A1", + "endpoint_uuid": "1", + "topology_id": { + "contextId": "admin", + "topology_uuid": "A" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "A1", + "endpoint_uuid": "2", + "topology_id": { + "contextId": "admin", + "topology_uuid": "A" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "A1", + "endpoint_uuid": "2000", + "topology_id": { + "contextId": "admin", + "topology_uuid": "A" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + } + ], + "device_type": "emu-packet-router" + }, + { + "device_Id": "A2", + "device_endpoints": [ + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "A2", + "endpoint_uuid": "1", + "topology_id": { + "contextId": "admin", + "topology_uuid": "A" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "A2", + "endpoint_uuid": "2", + "topology_id": { + "contextId": "admin", + "topology_uuid": "A" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "A2", + "endpoint_uuid": "1001", + "topology_id": { + "contextId": "admin", + "topology_uuid": "A" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + } + ], + "device_type": "emu-packet-router" + }, + { + "device_Id": "A3", + "device_endpoints": [ + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "A3", + "endpoint_uuid": "1", + "topology_id": { + "contextId": "admin", + "topology_uuid": "A" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "A3", + "endpoint_uuid": "2", + "topology_id": { + "contextId": "admin", + "topology_uuid": "A" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + } + ], + "device_type": "emu-packet-router" + }, + { + "device_Id": "B1", + "device_endpoints": [ + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "B1", + "endpoint_uuid": "1", + "topology_id": { + "contextId": "admin", + "topology_uuid": "B" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "B1", + "endpoint_uuid": "2", + "topology_id": { + "contextId": "admin", + "topology_uuid": "B" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "B1", + "endpoint_uuid": "2000", + "topology_id": { + "contextId": "admin", + "topology_uuid": "B" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + } + ], + "device_type": "emu-packet-router" + }, + { + "device_Id": "B2", + "device_endpoints": [ + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "B2", + "endpoint_uuid": "1", + "topology_id": { + "contextId": "admin", + "topology_uuid": "B" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "B2", + "endpoint_uuid": "2", + "topology_id": { + "contextId": "admin", + "topology_uuid": "B" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "B2", + "endpoint_uuid": "1002", + "topology_id": { + "contextId": "admin", + "topology_uuid": "B" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + } + ], + "device_type": "emu-packet-router" + }, + { + "device_Id": "B3", + "device_endpoints": [ + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "B3", + "endpoint_uuid": "1", + "topology_id": { + "contextId": "admin", + "topology_uuid": "B" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "B3", + "endpoint_uuid": "2", + "topology_id": { + "contextId": "admin", + "topology_uuid": "B" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + } + ], + "device_type": "emu-packet-router" + }, + { + "device_Id": "C1", + "device_endpoints": [ + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "C1", + "endpoint_uuid": "1", + "topology_id": { + "contextId": "admin", + "topology_uuid": "C" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "C1", + "endpoint_uuid": "2", + "topology_id": { + "contextId": "admin", + "topology_uuid": "C" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "C1", + "endpoint_uuid": "1001", + "topology_id": { + "contextId": "admin", + "topology_uuid": "C" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + } + ], + "device_type": "emu-packet-router" + }, + { + "device_Id": "C2", + "device_endpoints": [ + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "C2", + "endpoint_uuid": "1", + "topology_id": { + "contextId": "admin", + "topology_uuid": "C" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "C2", + "endpoint_uuid": "2", + "topology_id": { + "contextId": "admin", + "topology_uuid": "C" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + } + ], + "device_type": "emu-packet-router" + }, + { + "device_Id": "C3", + "device_endpoints": [ + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "C3", + "endpoint_uuid": "1", + "topology_id": { + "contextId": "admin", + "topology_uuid": "C" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "C3", + "endpoint_uuid": "2", + "topology_id": { + "contextId": "admin", + "topology_uuid": "C" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "endpoint_id": { + "device_id": "C3", + "endpoint_uuid": "1002", + "topology_id": { + "contextId": "admin", + "topology_uuid": "C" + } + }, + "endpoint_type": "copper", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + } + ], + "device_type": "emu-packet-router" + } + ], + "linkList": [ + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "cost-characteristics": { + "cost-algorithm": "0", + "cost-name": "linkcost", + "cost-value": "1" + }, + "forwarding_direction": 0, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + }, + "link_Id": "A1/1==A2/1", + "link_endpoint_ids": [ + { + "endpoint_id": { + "device_id": "A1", + "endpoint_uuid": "1", + "topology_id": { + "contextId": "admin", + "topology_uuid": "A" + } + } + }, + { + "endpoint_id": { + "device_id": "A2", + "endpoint_uuid": "1", + "topology_id": { + "contextId": "admin", + "topology_uuid": "A" + } + } + } + ], + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "cost-characteristics": { + "cost-algorithm": "0", + "cost-name": "linkcost", + "cost-value": "1" + }, + "forwarding_direction": 0, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + }, + "link_Id": "A1/2==A3/1", + "link_endpoint_ids": [ + { + "endpoint_id": { + "device_id": "A1", + "endpoint_uuid": "2", + "topology_id": { + "contextId": "admin", + "topology_uuid": "A" + } + } + }, + { + "endpoint_id": { + "device_id": "A3", + "endpoint_uuid": "1", + "topology_id": { + "contextId": "admin", + "topology_uuid": "A" + } + } + } + ], + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "cost-characteristics": { + "cost-algorithm": "0", + "cost-name": "linkcost", + "cost-value": "1" + }, + "forwarding_direction": 0, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + }, + "link_Id": "A2/1001==C3/1002", + "link_endpoint_ids": [ + { + "endpoint_id": { + "device_id": "A2", + "endpoint_uuid": "1001", + "topology_id": { + "contextId": "admin", + "topology_uuid": "A" + } + } + }, + { + "endpoint_id": { + "device_id": "C3", + "endpoint_uuid": "1002", + "topology_id": { + "contextId": "admin", + "topology_uuid": "C" + } + } + } + ], + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "cost-characteristics": { + "cost-algorithm": "0", + "cost-name": "linkcost", + "cost-value": "1" + }, + "forwarding_direction": 0, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + }, + "link_Id": "A2/2==A3/2", + "link_endpoint_ids": [ + { + "endpoint_id": { + "device_id": "A2", + "endpoint_uuid": "2", + "topology_id": { + "contextId": "admin", + "topology_uuid": "A" + } + } + }, + { + "endpoint_id": { + "device_id": "A3", + "endpoint_uuid": "2", + "topology_id": { + "contextId": "admin", + "topology_uuid": "A" + } + } + } + ], + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "cost-characteristics": { + "cost-algorithm": "0", + "cost-name": "linkcost", + "cost-value": "1" + }, + "forwarding_direction": 0, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + }, + "link_Id": "B1/1==B2/1", + "link_endpoint_ids": [ + { + "endpoint_id": { + "device_id": "B1", + "endpoint_uuid": "1", + "topology_id": { + "contextId": "admin", + "topology_uuid": "B" + } + } + }, + { + "endpoint_id": { + "device_id": "B2", + "endpoint_uuid": "1", + "topology_id": { + "contextId": "admin", + "topology_uuid": "B" + } + } + } + ], + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "cost-characteristics": { + "cost-algorithm": "0", + "cost-name": "linkcost", + "cost-value": "1" + }, + "forwarding_direction": 0, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + }, + "link_Id": "B1/2==B3/1", + "link_endpoint_ids": [ + { + "endpoint_id": { + "device_id": "B1", + "endpoint_uuid": "2", + "topology_id": { + "contextId": "admin", + "topology_uuid": "B" + } + } + }, + { + "endpoint_id": { + "device_id": "B3", + "endpoint_uuid": "1", + "topology_id": { + "contextId": "admin", + "topology_uuid": "B" + } + } + } + ], + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "cost-characteristics": { + "cost-algorithm": "0", + "cost-name": "linkcost", + "cost-value": "1" + }, + "forwarding_direction": 0, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + }, + "link_Id": "B2/2==B3/2", + "link_endpoint_ids": [ + { + "endpoint_id": { + "device_id": "B2", + "endpoint_uuid": "2", + "topology_id": { + "contextId": "admin", + "topology_uuid": "B" + } + } + }, + { + "endpoint_id": { + "device_id": "B3", + "endpoint_uuid": "2", + "topology_id": { + "contextId": "admin", + "topology_uuid": "B" + } + } + } + ], + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "cost-characteristics": { + "cost-algorithm": "0", + "cost-name": "linkcost", + "cost-value": "1" + }, + "forwarding_direction": 0, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + }, + "link_Id": "C1/1001==B2/1002", + "link_endpoint_ids": [ + { + "endpoint_id": { + "device_id": "C1", + "endpoint_uuid": "1001", + "topology_id": { + "contextId": "admin", + "topology_uuid": "C" + } + } + }, + { + "endpoint_id": { + "device_id": "B2", + "endpoint_uuid": "1002", + "topology_id": { + "contextId": "admin", + "topology_uuid": "B" + } + } + } + ], + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "cost-characteristics": { + "cost-algorithm": "0", + "cost-name": "linkcost", + "cost-value": "1" + }, + "forwarding_direction": 0, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + }, + "link_Id": "C1/1==C2/1", + "link_endpoint_ids": [ + { + "endpoint_id": { + "device_id": "C1", + "endpoint_uuid": "1", + "topology_id": { + "contextId": "admin", + "topology_uuid": "C" + } + } + }, + { + "endpoint_id": { + "device_id": "C2", + "endpoint_uuid": "1", + "topology_id": { + "contextId": "admin", + "topology_uuid": "C" + } + } + } + ], + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "cost-characteristics": { + "cost-algorithm": "0", + "cost-name": "linkcost", + "cost-value": "1" + }, + "forwarding_direction": 0, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + }, + "link_Id": "C1/2==C3/1", + "link_endpoint_ids": [ + { + "endpoint_id": { + "device_id": "C1", + "endpoint_uuid": "2", + "topology_id": { + "contextId": "admin", + "topology_uuid": "C" + } + } + }, + { + "endpoint_id": { + "device_id": "C3", + "endpoint_uuid": "1", + "topology_id": { + "contextId": "admin", + "topology_uuid": "C" + } + } + } + ], + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + }, + { + "available-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + }, + "cost-characteristics": { + "cost-algorithm": "0", + "cost-name": "linkcost", + "cost-value": "1" + }, + "forwarding_direction": 0, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + }, + "link_Id": "C2/2==C3/2", + "link_endpoint_ids": [ + { + "endpoint_id": { + "device_id": "C2", + "endpoint_uuid": "2", + "topology_id": { + "contextId": "admin", + "topology_uuid": "C" + } + } + }, + { + "endpoint_id": { + "device_id": "C3", + "endpoint_uuid": "2", + "topology_id": { + "contextId": "admin", + "topology_uuid": "C" + } + } + } + ], + "total-potential-capacity": { + "total-size": { + "unit": 5, + "value": 200 + } + } + } + ], + "serviceList": [ + { + "algId": "KSP", + "kPaths": 2, + "serviceId": { + "contextId": "admin", + "service_uuid": "svc:A1/2000==B1/2000" + }, + "serviceType": 1, + "service_constraints": [ + { + "constraint_type": "bandwidth[gbps]", + "constraint_value": "10.0" + }, + { + "constraint_type": "latency[ms]", + "constraint_value": "12.0" + } + ], + "service_endpoints_ids": [ + { + "device_id": "A1", + "endpoint_uuid": "2000", + "topology_id": { + "contextId": "admin", + "topology_uuid": "A" + } + }, + { + "device_id": "B1", + "endpoint_uuid": "2000", + "topology_id": { + "contextId": "admin", + "topology_uuid": "B" + } + } + ], + "syncPaths": false + } + ] +} \ No newline at end of file diff --git a/src/pathcomp/backend/tests/run-test.sh b/src/pathcomp/backend/tests/run-test.sh new file mode 100755 index 0000000000000000000000000000000000000000..1f6a4bd4556b380b9ea254341eee640e28e7095d --- /dev/null +++ b/src/pathcomp/backend/tests/run-test.sh @@ -0,0 +1,15 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +curl -0 -v -X POST -H "Expect:" -H "Content-Type: application/json" http://172.17.0.2:8081/pathComp/api/v1/compRoute -d @inter_domain_test.txt \ No newline at end of file diff --git a/src/pathcomp/backend/tests/test.txt b/src/pathcomp/backend/tests/test.txt new file mode 100644 index 0000000000000000000000000000000000000000..a2bab9f2b908dc2c4a17b86134cea38f6d0ed0b7 --- /dev/null +++ b/src/pathcomp/backend/tests/test.txt @@ -0,0 +1,236 @@ +{ +"serviceList": [ +{ +"algId": "KSP", +"syncPaths": false, +"serviceId": { +"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"service_uuid": "651550d8-46a0-4f36-9fb9-21b8e4f1b8d2" +}, +"serviceType": 1, +"service_endpoints_ids": [ +{ +"topology_id": { +"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d" +}, +"device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", +"endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa1" +}, +{ +"topology_id": { +"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d" +}, +"device_id": "eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee", +"endpoint_uuid": "eeeeeeee-eeee-eeee-eeee-eeeeeeeeeee1" +} +], +"service_constraints": [ +{"constraint_type": "bandwidth", "constraint_value": "100"}, +{"constraint_type": "latency", "constraint_value": "10"} +], +"kPaths": 3 +} +], +"deviceList": [ +{"device_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "device_type": "L3", +"device_endpoints": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa1"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 4, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa2"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa3"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}} +] +}, +{"device_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb", "device_type": "L3", +"device_endpoints": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbb2"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbb3"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbb4"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}} +] +}, +{"device_Id": "cccccccc-cccc-cccc-cccc-cccccccccccc", "device_type": "L3", +"device_endpoints": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccccc", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccccc2"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccccc", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccccc3"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccccc", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccccc4"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}} +] +}, +{"device_Id": "dddddddd-dddd-dddd-dddd-dddddddddddd", "device_type": "L3", +"device_endpoints": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "dddddddd-dddd-dddd-dddd-dddddddddddd", "endpoint_uuid": "dddddddd-dddd-dddd-dddd-ddddddddddd2"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "dddddddd-dddd-dddd-dddd-dddddddddddd", "endpoint_uuid": "dddddddd-dddd-dddd-dddd-ddddddddddd3"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}} +] +}, +{"device_Id": "eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee", "device_type": "L3", +"device_endpoints": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee", "endpoint_uuid": "eeeeeeee-eeee-eeee-eeee-eeeeeeeeeee1"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 4, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee", "endpoint_uuid": "eeeeeeee-eeee-eeee-eeee-eeeeeeeeeee2"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee", "endpoint_uuid": "eeeeeeee-eeee-eeee-eeee-eeeeeeeeeee3"}, +"endpoint_type": "termination", "link_port_direction": 0, "termination-direction": 0, "termination-state": 0, "total-potential-capacity": {"total-size": {"value": 200, +"unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}} +] +} +], +"linkList": [ +{"link_Id": "ffffffff-ffff-ffff-ffff-ffffffffffab", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa2"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbb2"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "10"} +}, +{"link_Id": "ffffffff-ffff-ffff-ffff-ffffffffffba", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbb2"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa2"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "ffffffff-ffff-ffff-ffff-ffffffffffac", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa3"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccccc", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccccc2"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "ffffffff-ffff-ffff-ffff-ffffffffffca", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccccc", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccccc2"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa3"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "ffffffff-ffff-ffff-ffff-ffffffffffcb", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccccc", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccccc3"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbb3"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "ffffffff-ffff-ffff-ffff-ffffffffffbc", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbb3"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccccc", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccccc3"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "ffffffff-ffff-ffff-ffff-ffffffffffcd", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccccc", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccccc4"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "dddddddd-dddd-dddd-dddd-dddddddddddd", "endpoint_uuid": "dddddddd-dddd-dddd-dddd-ddddddddddd2"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "ffffffff-ffff-ffff-ffff-ffffffffffdc", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "dddddddd-dddd-dddd-dddd-dddddddddddd", "endpoint_uuid": "dddddddd-dddd-dddd-dddd-ddddddddddd2"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "cccccccc-cccc-cccc-cccc-cccccccccccc", "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccccc4"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "ffffffff-ffff-ffff-ffff-ffffffffffbe", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbb4"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee", "endpoint_uuid": "eeeeeeee-eeee-eeee-eeee-eeeeeeeeeee2"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "ffffffff-ffff-ffff-ffff-ffffffffffeb", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee", "endpoint_uuid": "eeeeeeee-eeee-eeee-eeee-eeeeeeeeeee2"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb", "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbb4"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "ffffffff-ffff-ffff-ffff-ffffffffffde", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "dddddddd-dddd-dddd-dddd-dddddddddddd", "endpoint_uuid": "dddddddd-dddd-dddd-dddd-ddddddddddd3"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee", "endpoint_uuid": "eeeeeeee-eeee-eeee-eeee-eeeeeeeeeee3"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +}, +{"link_Id": "ffffffff-ffff-ffff-ffff-ffffffffffed", +"link_endpoint_ids": [ +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee", "endpoint_uuid": "eeeeeeee-eeee-eeee-eeee-eeeeeeeeeee3"}}, +{"endpoint_id": {"topology_id": {"contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", +"topology_uuid": "abf65601-a36b-496f-8e21-1708e5f96e2d"}, "device_id": "dddddddd-dddd-dddd-dddd-dddddddddddd", "endpoint_uuid": "dddddddd-dddd-dddd-dddd-ddddddddddd3"}} +], +"forwarding_direction": 1, "total-potential-capacity": { "total-size": {"value": 200, "unit": 5}}, "available-capacity": {"total-size": {"value": 200, "unit": 5}}, +"cost-characteristics": {"cost-name": "linkcost","cost-value": "1","cost-algorithm": "0"},"latency-characteristics": {"fixed-latency-characteristic": "2"} +} +] +} \ No newline at end of file diff --git a/src/pathcomp/frontend/Config.py b/src/pathcomp/frontend/Config.py new file mode 100644 index 0000000000000000000000000000000000000000..f17a9f5377b5abcbd9001d1d3773e26998cb3211 --- /dev/null +++ b/src/pathcomp/frontend/Config.py @@ -0,0 +1,38 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +DEFAULT_PATHCOMP_BACKEND_SCHEME = 'http' +DEFAULT_PATHCOMP_BACKEND_HOST = '127.0.0.1' +DEFAULT_PATHCOMP_BACKEND_PORT = '8081' +DEFAULT_PATHCOMP_BACKEND_BASEURL = '/pathComp/api/v1/compRoute' + +PATHCOMP_BACKEND_SCHEME = str(os.environ.get('PATHCOMP_BACKEND_SCHEME', DEFAULT_PATHCOMP_BACKEND_SCHEME )) +PATHCOMP_BACKEND_BASEURL = str(os.environ.get('PATHCOMP_BACKEND_BASEURL', DEFAULT_PATHCOMP_BACKEND_BASEURL)) + +# Find IP:port of backend container as follows: +# - first check env vars PATHCOMP_BACKEND_HOST & PATHCOMP_BACKEND_PORT +# - if not set, check env vars PATHCOMPSERVICE_SERVICE_HOST & PATHCOMPSERVICE_SERVICE_PORT_HTTP +# - if not set, use DEFAULT_PATHCOMP_BACKEND_HOST & DEFAULT_PATHCOMP_BACKEND_PORT +backend_host = DEFAULT_PATHCOMP_BACKEND_HOST +backend_host = os.environ.get('PATHCOMPSERVICE_SERVICE_HOST', backend_host) +PATHCOMP_BACKEND_HOST = str(os.environ.get('PATHCOMP_BACKEND_HOST', backend_host)) + +backend_port = DEFAULT_PATHCOMP_BACKEND_PORT +backend_port = os.environ.get('PATHCOMPSERVICE_SERVICE_PORT_HTTP', backend_port) +PATHCOMP_BACKEND_PORT = int(os.environ.get('PATHCOMP_BACKEND_PORT', backend_port)) + +BACKEND_URL = '{:s}://{:s}:{:d}{:s}'.format( + PATHCOMP_BACKEND_SCHEME, PATHCOMP_BACKEND_HOST, PATHCOMP_BACKEND_PORT, PATHCOMP_BACKEND_BASEURL) diff --git a/src/pathcomp/frontend/Dockerfile b/src/pathcomp/frontend/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..352de75f31366b65e62e2f6357d1bd5f28bd2b0f --- /dev/null +++ b/src/pathcomp/frontend/Dockerfile @@ -0,0 +1,70 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM python:3.9-slim + +# Install dependencies +RUN apt-get --yes --quiet --quiet update && \ + apt-get --yes --quiet --quiet install wget g++ && \ + rm -rf /var/lib/apt/lists/* + +# Set Python to show logs as they occur +ENV PYTHONUNBUFFERED=0 + +# Download the gRPC health probe +RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ + wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ + chmod +x /bin/grpc_health_probe + +# Get generic Python packages +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools + +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components +WORKDIR /var/teraflow +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt + +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto + +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; + +# Create component sub-folders, get specific Python packages +RUN mkdir -p /var/teraflow/pathcomp +WORKDIR /var/teraflow/pathcomp +COPY src/pathcomp/frontend/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN python3 -m pip install -r requirements.txt + +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/context/. context/ +COPY src/device/. device/ +COPY src/pathcomp/. pathcomp/ + +# Start the service +ENTRYPOINT ["python", "-m", "pathcomp.frontend.service"] diff --git a/src/pathcomp/frontend/__init__.py b/src/pathcomp/frontend/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf --- /dev/null +++ b/src/pathcomp/frontend/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/src/pathcomp/frontend/client/PathCompClient.py b/src/pathcomp/frontend/client/PathCompClient.py new file mode 100644 index 0000000000000000000000000000000000000000..3ce5b2f33c2c0fac530363dd21f3eac26e42a2c7 --- /dev/null +++ b/src/pathcomp/frontend/client/PathCompClient.py @@ -0,0 +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 grpc, logging +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc +from common.proto.pathcomp_pb2 import PathCompReply, PathCompRequest +from common.proto.pathcomp_pb2_grpc import PathCompServiceStub +from common.tools.client.RetryDecorator import retry, delay_exponential +from common.tools.grpc.Tools import grpc_message_to_json_string + +LOGGER = logging.getLogger(__name__) +MAX_RETRIES = 15 +DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + +class PathCompClient: + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.PATHCOMP) + if not port: port = get_service_port_grpc(ServiceNameEnum.PATHCOMP) + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) + LOGGER.debug('Creating channel to {:s}...'.format(str(self.endpoint))) + self.channel = None + self.stub = None + self.connect() + LOGGER.debug('Channel created') + + def connect(self): + self.channel = grpc.insecure_channel(self.endpoint) + self.stub = PathCompServiceStub(self.channel) + + def close(self): + if self.channel is not None: self.channel.close() + self.channel = None + self.stub = None + + @RETRY_DECORATOR + def Compute(self, request : PathCompRequest) -> PathCompReply: + LOGGER.debug('Compute request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.Compute(request) + LOGGER.debug('Compute result: {:s}'.format(grpc_message_to_json_string(response))) + return response diff --git a/src/pathcomp/frontend/client/__init__.py b/src/pathcomp/frontend/client/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/pathcomp/frontend/client/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/pathcomp/frontend/example/command.txt b/src/pathcomp/frontend/example/command.txt new file mode 100644 index 0000000000000000000000000000000000000000..59002337f8efe1db607ebd724bb89287142e9d94 --- /dev/null +++ b/src/pathcomp/frontend/example/command.txt @@ -0,0 +1,4 @@ +curl -0 -v -X POST \ + -H "Expect:" -H "Content-Type: application/json" \ + http://172.17.0.2:8081/pathComp/api/v1/compRoute \ + -d @src/pathcomp/backend/test/inter_domain_test.txt diff --git a/src/pathcomp/frontend/example/reply.json b/src/pathcomp/frontend/example/reply.json new file mode 100644 index 0000000000000000000000000000000000000000..6bb4bef233d7eda6215a06d83a03f97901d8ad83 --- /dev/null +++ b/src/pathcomp/frontend/example/reply.json @@ -0,0 +1,92 @@ +{ + "response-list": [ + { + "serviceId": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "service_uuid": "651550d8-46a0-4f36-9fb9-21b8e4f1b8d2" + }, + "service_endpoints_ids": [ + { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa11", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa111" + }, + { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc33", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc331" + } + ], + "path": [ + { + "path-capacity": { + "total-size": { + "value": 200, + "unit": 0 + } + }, + "path-latency": { + "fixed-latency-characteristic": "8.000000" + }, + "path-cost": { + "cost-name": "", + "cost-value": "4.000000", + "cost-algorithm": "0.000000" + }, + "link": [ + { + "link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1112", + "topology": [ + { + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + { + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + } + ] + }, + { + "link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1214", + "topology": [ + { + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + { + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + } + ] + }, + { + "link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1431", + "topology": [ + { + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + { + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + } + ] + }, + { + "link_Id": "cccccccc-cccc-cccc-cccc-cccccccc3133", + "topology": [ + { + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + { + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/pathcomp/frontend/example/request.json b/src/pathcomp/frontend/example/request.json new file mode 100644 index 0000000000000000000000000000000000000000..a13f20f12fd9d181d0a21ffc737979cae23bf457 --- /dev/null +++ b/src/pathcomp/frontend/example/request.json @@ -0,0 +1,2474 @@ +{ + "serviceList": [ + { + "algId": "KSP", + "syncPaths": false, + "serviceId": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "service_uuid": "651550d8-46a0-4f36-9fb9-21b8e4f1b8d2" + }, + "serviceType": 1, + "service_endpoints_ids": [ + { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa11", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa111" + }, + { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc33", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc331" + } + ], + "service_constraints": [ + { + "constraint_type": "bandwidth", + "constraint_value": "100" + }, + { + "constraint_type": "latency", + "constraint_value": "20" + } + ], + "kPaths": 3 + } + ], + "deviceList": [ + { + "device_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa11", + "device_type": "L3", + "device_endpoints": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa11", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa111" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 4, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa11", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa112" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa11", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa113" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + } + ] + }, + { + "device_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa13", + "device_type": "L3", + "device_endpoints": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa13", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa132" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa13", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa133" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa13", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa134" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + } + ] + }, + { + "device_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa12", + "device_type": "L3", + "device_endpoints": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa12", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa122" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa12", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa123" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa12", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa124" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + } + ] + }, + { + "device_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa14", + "device_type": "L3", + "device_endpoints": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa14", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa142" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa14", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa143" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa14", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa141" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "inter-domain-plug-in": { + "plug-id-inter-domain-local-id": "a2", + "plug-id-inter-domain-remote-id": "c1" + } + } + ] + }, + { + "device_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa15", + "device_type": "L3", + "device_endpoints": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa15", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa151" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "inter-domain-plug-in": { + "plug-id-inter-domain-local-id": "a1", + "plug-id-inter-domain-remote-id": "b1" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa15", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa152" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa15", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa153" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + } + ] + }, + { + "device_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb21", + "device_type": "L3", + "device_endpoints": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb21", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb211" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "inter-domain-plug-in": { + "plug-id-inter-domain-local-id": "b1", + "plug-id-inter-domain-remote-id": "a1" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb21", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb212" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb21", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb213" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + } + ] + }, + { + "device_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb23", + "device_type": "L3", + "device_endpoints": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb23", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb231" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "inter-domain-plug-in": { + "plug-id-inter-domain-local-id": "b2", + "plug-id-inter-domain-remote-id": "c2" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb23", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb232" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb23", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb233" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + } + ] + }, + { + "device_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb24", + "device_type": "L3", + "device_endpoints": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb24", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb241" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "inter-domain-plug-in": { + "plug-id-inter-domain-local-id": "b4", + "plug-id-inter-domain-remote-id": "c3" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb24", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb242" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb24", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb243" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + } + ] + }, + { + "device_Id": "cccccccc-cccc-cccc-cccc-cccccccccc31", + "device_type": "L3", + "device_endpoints": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc31", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc311" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "inter-domain-plug-in": { + "plug-id-inter-domain-local-id": "c1", + "plug-id-inter-domain-remote-id": "a2" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc31", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc312" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc31", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc313" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + } + ] + }, + { + "device_Id": "cccccccc-cccc-cccc-cccc-cccccccccc32", + "device_type": "L3", + "device_endpoints": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc32", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc321" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "inter-domain-plug-in": { + "plug-id-inter-domain-local-id": "c2", + "plug-id-inter-domain-remote-id": "b2" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc32", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc322" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc32", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc323" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + } + ] + }, + { + "device_Id": "cccccccc-cccc-cccc-cccc-cccccccccc33", + "device_type": "L3", + "device_endpoints": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc33", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc331" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "inter-domain-plug-in": { + "plug-id-inter-domain-local-id": "c3", + "plug-id-inter-domain-remote-id": "b4" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc33", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc332" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc33", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc333" + }, + "endpoint_type": "termination", + "link_port_direction": 0, + "termination-direction": 0, + "termination-state": 0, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + } + } + ] + } + ], + "linkList": [ + { + "link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1112", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa11", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa113" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa12", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa122" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1211", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa12", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa122" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa11", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa113" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1113", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa11", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa112" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa13", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa132" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1311", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa13", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa132" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa11", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa112" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1312", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa13", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa133" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa12", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa123" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1213", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa12", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa123" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa13", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa133" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1214", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa12", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa124" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa14", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa142" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1412", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa14", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa142" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa12", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa124" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1315", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa13", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa134" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa15", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa152" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1513", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa15", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa152" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa13", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa134" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1415", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa14", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa143" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa15", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa153" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1514", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa15", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa153" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa14", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa143" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1521", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa15", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa151" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb21", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb211" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbb2115", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb21", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb211" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa15", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa151" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa1431", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa14", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa141" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc31", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc311" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "cccccccc-cccc-cccc-cccc-cccccccc3114", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc31", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc311" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + }, + "device_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaa14", + "endpoint_uuid": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaa141" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbb2124", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb21", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb212" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb24", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb242" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbb2421", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb24", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb242" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb21", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb212" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbb2123", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb21", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb213" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb23", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb233" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbb2321", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb23", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb233" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb21", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb213" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbb2324", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb23", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb232" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb24", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb243" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbb2424", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb24", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb243" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb23", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb232" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbb2332", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb23", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb231" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc32", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc321" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "cccccccc-cccc-cccc-cccc-cccccccc3223", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc32", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc321" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb23", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb231" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbb2433", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb24", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb241" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc34", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc331" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "cccccccc-cccc-cccc-cccc-cccccccc3324", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc33", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc331" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" + }, + "device_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb24", + "endpoint_uuid": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbb241" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "cccccccc-cccc-cccc-cccc-cccccccc3132", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc31", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc312" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc32", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc323" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "cccccccc-cccc-cccc-cccc-cccccccc3231", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc32", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc323" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc31", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc312" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "cccccccc-cccc-cccc-cccc-cccccccc3133", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc31", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc313" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc33", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc333" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "cccccccc-cccc-cccc-cccc-cccccccc3331", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc33", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc333" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc31", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc313" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "cccccccc-cccc-cccc-cccc-cccccccc3233", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc32", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc322" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc33", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc332" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + }, + { + "link_Id": "cccccccc-cccc-cccc-cccc-cccccccc3332", + "link_endpoint_ids": [ + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc33", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc332" + } + }, + { + "endpoint_id": { + "topology_id": { + "contextId": "b55a05a5-ae2d-4ff3-85ca-97fac0c56f91", + "topology_uuid": "cccccccc-cccc-cccc-cccc-cccccccccccc" + }, + "device_id": "cccccccc-cccc-cccc-cccc-cccccccccc32", + "endpoint_uuid": "cccccccc-cccc-cccc-cccc-ccccccccc322" + } + } + ], + "forwarding_direction": 1, + "total-potential-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "available-capacity": { + "total-size": { + "value": 200, + "unit": 5 + } + }, + "cost-characteristics": { + "cost-name": "linkcost", + "cost-value": "1", + "cost-algorithm": "0" + }, + "latency-characteristics": { + "fixed-latency-characteristic": "2" + } + } + ] +} diff --git a/src/pathcomp/frontend/requirements.in b/src/pathcomp/frontend/requirements.in new file mode 100644 index 0000000000000000000000000000000000000000..d99d4cd02b1a9fa39633b35d998b228b3b9e9fc7 --- /dev/null +++ b/src/pathcomp/frontend/requirements.in @@ -0,0 +1,16 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +requests==2.27.1 diff --git a/src/pathcomp/frontend/service/PathCompService.py b/src/pathcomp/frontend/service/PathCompService.py new file mode 100644 index 0000000000000000000000000000000000000000..d86cea7559758b846f668577b2c3b2c67f4cd6c8 --- /dev/null +++ b/src/pathcomp/frontend/service/PathCompService.py @@ -0,0 +1,28 @@ +# 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 common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc +from common.tools.service.GenericGrpcService import GenericGrpcService +from common.proto.pathcomp_pb2_grpc import add_PathCompServiceServicer_to_server +from .PathCompServiceServicerImpl import PathCompServiceServicerImpl + +class PathCompService(GenericGrpcService): + def __init__(self, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.PATHCOMP) + super().__init__(port, cls_name=cls_name) + self.pathcomp_servicer = PathCompServiceServicerImpl() + + def install_servicers(self): + add_PathCompServiceServicer_to_server(self.pathcomp_servicer, self.server) diff --git a/src/pathcomp/frontend/service/PathCompServiceServicerImpl.py b/src/pathcomp/frontend/service/PathCompServiceServicerImpl.py new file mode 100644 index 0000000000000000000000000000000000000000..6fc33dbd45a92405fb2fa115e12cb460a9111d54 --- /dev/null +++ b/src/pathcomp/frontend/service/PathCompServiceServicerImpl.py @@ -0,0 +1,76 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import grpc, logging, threading +from common.Constants import DEFAULT_CONTEXT_NAME, INTERDOMAIN_TOPOLOGY_NAME +from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method +from common.proto.context_pb2 import ContextId, Empty +from common.proto.pathcomp_pb2 import PathCompReply, PathCompRequest +from common.proto.pathcomp_pb2_grpc import PathCompServiceServicer +from common.tools.context_queries.Device import get_devices_in_topology +from common.tools.context_queries.Link import get_links_in_topology +from common.tools.context_queries.InterDomain import is_inter_domain +from common.tools.grpc.Tools import grpc_message_to_json_string +from common.tools.object_factory.Context import json_context_id +from context.client.ContextClient import ContextClient +from pathcomp.frontend.service.algorithms.Factory import get_algorithm + +LOGGER = logging.getLogger(__name__) + +METRICS_POOL = MetricsPool('PathComp', 'RPC') + +ADMIN_CONTEXT_ID = ContextId(**json_context_id(DEFAULT_CONTEXT_NAME)) + +class PathCompServiceServicerImpl(PathCompServiceServicer): + def __init__(self) -> None: + LOGGER.debug('Creating Servicer...') + self._lock = threading.Lock() + LOGGER.debug('Servicer Created') + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def Compute(self, request : PathCompRequest, context : grpc.ServicerContext) -> PathCompReply: + LOGGER.debug('[Compute] begin ; request = {:s}'.format(grpc_message_to_json_string(request))) + + context_client = ContextClient() + + if (len(request.services) == 1) and is_inter_domain(context_client, request.services[0].service_endpoint_ids): + devices = get_devices_in_topology(context_client, ADMIN_CONTEXT_ID, INTERDOMAIN_TOPOLOGY_NAME) + links = get_links_in_topology(context_client, ADMIN_CONTEXT_ID, INTERDOMAIN_TOPOLOGY_NAME) + else: + # TODO: improve filtering of devices and links + # TODO: add contexts, topologies, and membership of devices/links in topologies + devices = context_client.ListDevices(Empty()) + links = context_client.ListLinks(Empty()) + + algorithm = get_algorithm(request) + algorithm.add_devices(devices) + algorithm.add_links(links) + algorithm.add_service_requests(request) + + #LOGGER.debug('device_list = {:s}' .format(str(algorithm.device_list ))) + #LOGGER.debug('endpoint_dict = {:s}'.format(str(algorithm.endpoint_dict))) + #LOGGER.debug('link_list = {:s}' .format(str(algorithm.link_list ))) + #LOGGER.debug('service_list = {:s}' .format(str(algorithm.service_list ))) + #LOGGER.debug('service_dict = {:s}' .format(str(algorithm.service_dict ))) + + #import time + #ts = time.time() + #algorithm.execute('request-{:f}.json'.format(ts), 'reply-{:f}.json'.format(ts)) + with self._lock: + # ensure backend receives requests one at a time + algorithm.execute() + + reply = algorithm.get_reply() + LOGGER.debug('[Compute] end ; reply = {:s}'.format(grpc_message_to_json_string(reply))) + return reply diff --git a/src/pathcomp/frontend/service/__init__.py b/src/pathcomp/frontend/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/pathcomp/frontend/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/pathcomp/frontend/service/__main__.py b/src/pathcomp/frontend/service/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..e3f7d36196be4319cf8364d8569d5289bec2dd89 --- /dev/null +++ b/src/pathcomp/frontend/service/__main__.py @@ -0,0 +1,65 @@ +# 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, signal, sys, threading +from prometheus_client import start_http_server +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, + wait_for_environment_variables) +from .PathCompService import PathCompService + +terminate = threading.Event() +LOGGER : logging.Logger = None + +def signal_handler(signal, frame): # pylint: disable=redefined-outer-name + LOGGER.warning('Terminate signal received') + terminate.set() + +def main(): + global LOGGER # pylint: disable=global-statement + + log_level = get_log_level() + logging.basicConfig(level=log_level, format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s") + LOGGER = logging.getLogger(__name__) + + wait_for_environment_variables([ + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + ]) + + signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGTERM, signal_handler) + + LOGGER.info('Starting...') + + # Start metrics server + metrics_port = get_metrics_port() + start_http_server(metrics_port) + + # Starting service service + grpc_service = PathCompService() + grpc_service.start() + + # Wait for Ctrl+C or termination signal + while not terminate.wait(timeout=0.1): pass + + LOGGER.info('Terminating...') + grpc_service.stop() + + LOGGER.info('Bye') + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/pathcomp/frontend/service/algorithms/Factory.py b/src/pathcomp/frontend/service/algorithms/Factory.py new file mode 100644 index 0000000000000000000000000000000000000000..0e00dc11b707467b4e36d80d559502deb26d226b --- /dev/null +++ b/src/pathcomp/frontend/service/algorithms/Factory.py @@ -0,0 +1,33 @@ +# 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 ._Algorithm import _Algorithm +from .KDisjointPathAlgorithm import KDisjointPathAlgorithm +from .KShortestPathAlgorithm import KShortestPathAlgorithm +from .ShortestPathAlgorithm import ShortestPathAlgorithm + +ALGORITHMS = { + 'shortest_path' : ShortestPathAlgorithm, + 'k_shortest_path': KShortestPathAlgorithm, + 'k_disjoint_path': KDisjointPathAlgorithm, +} + +def get_algorithm(request) -> _Algorithm: + algorithm_name = request.WhichOneof('algorithm') + algorithm_class = ALGORITHMS.get(algorithm_name) + if algorithm_class is None: + raise Exception('Algorithm({:s}) not supported'.format(str(algorithm_name))) + algorithm_settings = getattr(request, algorithm_name) + algorithm_instance = algorithm_class(algorithm_settings) + return algorithm_instance diff --git a/src/pathcomp/frontend/service/algorithms/KDisjointPathAlgorithm.py b/src/pathcomp/frontend/service/algorithms/KDisjointPathAlgorithm.py new file mode 100644 index 0000000000000000000000000000000000000000..a9fc4fa3d499f634f021d9ebbb4a749b4f8715c7 --- /dev/null +++ b/src/pathcomp/frontend/service/algorithms/KDisjointPathAlgorithm.py @@ -0,0 +1,243 @@ +# 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 operator +from typing import Dict, List, Optional, Set, Tuple +from common.proto.context_pb2 import Connection, Link, Service +from common.proto.pathcomp_pb2 import Algorithm_KDisjointPath, Algorithm_KShortestPath, PathCompReply, PathCompRequest +from common.tools.grpc.Tools import grpc_message_to_json_string +from pathcomp.frontend.service.algorithms.tools.ComputeSubServices import convert_explicit_path_hops_to_connections +from pathcomp.frontend.service.algorithms.tools.EroPathToHops import eropath_to_hops +from ._Algorithm import _Algorithm +from .KShortestPathAlgorithm import KShortestPathAlgorithm + +Service_Id = Tuple[str, str] # (context_uuid, service_uuid) +Service_Constraints = Dict[str, str] # {constraint_type => constraint_value} +Endpoint_Id = Tuple[str, str] # (device_uuid, endpoint_uuid) +Endpoint_Details = Tuple[str, int] # (site_id, priority) +Service_Endpoints = Dict[Endpoint_Id, Endpoint_Details] +Service_Details = Tuple[int, Service_Constraints, Service_Endpoints] +Services_Details = Dict[Service_Id, Service_Details] + +CUSTOM_CONSTRAINTS = {'bandwidth[gbps]', 'latency[ms]', 'jitter[us]'} + +DUMP_EXECUTION_STEPS = False + +class KDisjointPathAlgorithm(_Algorithm): + def __init__(self, algorithm : Algorithm_KDisjointPath, class_name=__name__) -> None: + super().__init__('KDP', False, class_name=class_name) + self.num_disjoint = algorithm.num_disjoint + self.services_details : Services_Details = dict() + + def add_service_requests(self, request: PathCompRequest) -> None: + super().add_service_requests(request) + for service in request.services: + service_id = service.service_id + context_uuid = service_id.context_id.context_uuid.uuid + service_uuid = service_id.service_uuid.uuid + service_key = (context_uuid, service_uuid) + + constraints = dict() + endpoints = dict() + service_details = (int(service.service_type), constraints, endpoints) + self.services_details.setdefault(service_key, service_details) + + for constraint in service.service_constraints: + if constraint.WhichOneof('constraint') == 'custom': + constraint_type = constraint.custom.constraint_type + if constraint_type not in CUSTOM_CONSTRAINTS: continue + constraint_value = constraint.custom.constraint_value + constraints[constraint_type] = constraint_value + + if constraint.WhichOneof('constraint') == 'endpoint_location': + endpoint_id = constraint.endpoint_location.endpoint_id + device_uuid = endpoint_id.device_id.device_uuid.uuid + device_uuid = self.device_name_mapping.get(device_uuid, device_uuid) + endpoint_uuid = endpoint_id.endpoint_uuid.uuid + endpoint_uuid = self.endpoint_name_mapping.get((device_uuid, endpoint_uuid), endpoint_uuid) + location_kind = constraint.endpoint_location.location.WhichOneof('location') + if location_kind != 'region': + MSG = 'Unsupported LocationType({:s}) in Constraint({:s})' + raise Exception(MSG.format(location_kind, grpc_message_to_json_string(constraint))) + site_id = constraint.endpoint_location.location.region + endpoints.setdefault((device_uuid, endpoint_uuid), dict())['site_id'] = site_id + + if constraint.WhichOneof('constraint') == 'endpoint_priority': + endpoint_id = constraint.endpoint_priority.endpoint_id + device_uuid = endpoint_id.device_id.device_uuid.uuid + device_uuid = self.device_name_mapping.get(device_uuid, device_uuid) + endpoint_uuid = endpoint_id.endpoint_uuid.uuid + endpoint_uuid = self.endpoint_name_mapping.get((device_uuid, endpoint_uuid), endpoint_uuid) + priority = constraint.endpoint_priority.priority + endpoints.setdefault((device_uuid, endpoint_uuid), dict())['priority'] = priority + + # TODO: ensure these constraints are provided in the request + if 'bandwidth[gbps]' not in constraints: constraints['bandwidth[gbps]'] = '20.0' + if 'latency[ms]' not in constraints: constraints['latency[ms]'] = '20.0' + + def get_link_from_endpoint(self, endpoint : Dict) -> Tuple[Dict, Link]: + device_uuid = endpoint['device_id'] + endpoint_uuid = endpoint['endpoint_uuid'] + item = self.endpoint_to_link_dict.get((device_uuid, endpoint_uuid)) + if item is None: + MSG = 'Link for Endpoint({:s}, {:s}) not found' + self.logger.warning(MSG.format(device_uuid, endpoint_uuid)) + return None + return item + + def path_to_links(self, path_endpoints : List[Dict]) -> Tuple[List[Dict], Set[str]]: + path_links = list() + path_link_ids = set() + for endpoint in path_endpoints: + link_tuple = self.get_link_from_endpoint(endpoint) + if link_tuple is None: continue + json_link,_ = link_tuple + json_link_id = json_link['link_Id'] + if len(path_links) == 0 or path_links[-1]['link_Id'] != json_link_id: + path_links.append(json_link) + path_link_ids.add(json_link_id) + return path_links, path_link_ids + + def remove_traversed_links(self, link_list : List[Dict], path_endpoints : List[Dict]): + _, path_link_ids = self.path_to_links(path_endpoints) + new_link_list = list(filter(lambda l: l['link_Id'] not in path_link_ids, link_list)) + #self.logger.info('cur_link_list = {:s}'.format(str(link_list))) + #self.logger.info('new_link_list = {:s}'.format(str(new_link_list))) + return new_link_list + + def execute(self, dump_request_filename: Optional[str] = None, dump_reply_filename: Optional[str] = None) -> None: + algorithm = KShortestPathAlgorithm(Algorithm_KShortestPath(k_inspection=0, k_return=1)) + algorithm.sync_paths = True + algorithm.device_list = self.device_list + algorithm.device_name_mapping = self.device_name_mapping + algorithm.device_dict = self.device_dict + algorithm.endpoint_dict = self.endpoint_dict + algorithm.endpoint_name_mapping = self.endpoint_name_mapping + algorithm.link_list = self.link_list + algorithm.link_dict = self.link_dict + algorithm.endpoint_to_link_dict = self.endpoint_to_link_dict + + Path = List[Dict] + Path_NoPath = Optional[Path] # None = no path, list = path + self.json_reply : Dict[Tuple[str, str], List[Path_NoPath]] = dict() + + for num_path in range(self.num_disjoint): + algorithm.service_list = list() + algorithm.service_dict = dict() + + #self.logger.warning('services_details = {:s}'.format(str(self.services_details))) + + _request = PathCompRequest() + for service_key, service_details in self.services_details.items(): + service_type, constraints, endpoints = service_details + _service = _request.services.add() # pylint: disable=no-member + _service.service_id.context_id.context_uuid.uuid = service_key[0] + _service.service_id.service_uuid.uuid = service_key[1] + _service.service_type = service_type + + for constraint_type, constraint_value in constraints.items(): + constraint = _service.service_constraints.add() + constraint.custom.constraint_type = constraint_type + constraint.custom.constraint_value = constraint_value + + site_to_endpoints : Dict[str, List[Tuple[Endpoint_Id, int]]] = {} + for endpoint_key,endpoint_details in endpoints.items(): + site_id = endpoint_details.get('site_id') + if site_id is None: continue + priority = endpoint_details.get('priority', 999) + site_to_endpoints.setdefault(site_id, list()).append((endpoint_key, priority)) + + for site_id,site_endpoints in site_to_endpoints.items(): + pending_endpoints = sorted(site_endpoints, key=operator.itemgetter(1)) + if len(pending_endpoints) == 0: continue + endpoint_key, _ = pending_endpoints[0] + device_uuid, endpoint_uuid = endpoint_key + endpoint_id = _service.service_endpoint_ids.add() + endpoint_id.device_id.device_uuid.uuid = device_uuid + endpoint_id.endpoint_uuid.uuid = endpoint_uuid + endpoints.pop(endpoint_key) + + algorithm.add_service_requests(_request) + + dump_request_filename = 'ksp-{:d}-request.json'.format(num_path) if DUMP_EXECUTION_STEPS else None + dump_reply_filename = 'ksp-{:d}-reply.txt'.format(num_path) if DUMP_EXECUTION_STEPS else None + algorithm.execute(dump_request_filename, dump_reply_filename) + + response_list = algorithm.json_reply.get('response-list', []) + for response in response_list: + service_id = response['serviceId'] + service_key = (service_id['contextId'], service_id['service_uuid']) + json_reply_service = self.json_reply.setdefault(service_key, list()) + + no_path_issue = response.get('noPath', {}).get('issue') + if no_path_issue is not None: + json_reply_service.append(None) + continue + + path_endpoints = response['path'][0]['devices'] + json_reply_service.append(path_endpoints) + algorithm.link_list = self.remove_traversed_links(algorithm.link_list, path_endpoints) + + self.logger.debug('self.json_reply = {:s}'.format(str(self.json_reply))) + + def get_reply(self) -> PathCompReply: + reply = PathCompReply() + grpc_services : Dict[Tuple[str, str], Service] = {} + grpc_connections : Dict[Tuple[int, str], Connection] = {} + for service_key,paths in self.json_reply.items(): + context_uuid, service_uuid = service_key + + grpc_services[service_key] = self.add_service_to_reply(reply, context_uuid, service_uuid) + + for num_path,service_path_ero in enumerate(paths): + self.logger.warning('num_path={:d}'.format(num_path)) + self.logger.warning('service_path_ero={:s}'.format(str(service_path_ero))) + if service_path_ero is None: continue + path_hops = eropath_to_hops(service_path_ero, self.endpoint_to_link_dict) + self.logger.warning('path_hops={:s}'.format(str(path_hops))) + connections = convert_explicit_path_hops_to_connections(path_hops, self.device_dict, service_uuid) + self.logger.warning('connections={:s}'.format(str(connections))) + + for connection in connections: + connection_uuid,device_layer,path_hops,_ = connection + + service_key = (context_uuid, connection_uuid) + grpc_service = grpc_services.get(service_key) + if grpc_service is not None: continue + grpc_service = self.add_service_to_reply( + reply, context_uuid, connection_uuid, device_layer=device_layer, path_hops=path_hops) + grpc_services[service_key] = grpc_service + + for connection in connections: + connection_uuid,device_layer,path_hops,dependencies = connection + + service_key = (context_uuid, connection_uuid) + grpc_service = grpc_services.get(service_key) + if grpc_service is None: raise Exception('Service({:s}) not found'.format(str(service_key))) + + connection_uuid = '{:s}:{:d}'.format(connection_uuid, num_path) + grpc_connection = grpc_connections.get(connection_uuid) + if grpc_connection is not None: continue + grpc_connection = self.add_connection_to_reply(reply, connection_uuid, grpc_service, path_hops) + grpc_connections[connection_uuid] = grpc_connection + + for sub_service_uuid in dependencies: + sub_service_key = (context_uuid, sub_service_uuid) + grpc_sub_service = grpc_services.get(sub_service_key) + if grpc_sub_service is None: + raise Exception('Service({:s}) not found'.format(str(sub_service_key))) + grpc_sub_service_id = grpc_connection.sub_service_ids.add() + grpc_sub_service_id.CopyFrom(grpc_sub_service.service_id) + + return reply diff --git a/src/pathcomp/frontend/service/algorithms/KShortestPathAlgorithm.py b/src/pathcomp/frontend/service/algorithms/KShortestPathAlgorithm.py new file mode 100644 index 0000000000000000000000000000000000000000..920d72e828f6f84bc064f1c7357105907ffdac4c --- /dev/null +++ b/src/pathcomp/frontend/service/algorithms/KShortestPathAlgorithm.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 common.proto.pathcomp_pb2 import Algorithm_KShortestPath +from ._Algorithm import _Algorithm + +class KShortestPathAlgorithm(_Algorithm): + def __init__(self, algorithm : Algorithm_KShortestPath, class_name=__name__) -> None: + super().__init__('KSP', False, class_name=class_name) + self.k_inspection = algorithm.k_inspection + self.k_return = algorithm.k_return + + def add_service_requests(self, requested_services) -> None: + super().add_service_requests(requested_services) + for service_request in self.service_list: + service_request['algId' ] = self.algorithm_id + service_request['syncPaths'] = self.sync_paths + service_request['kPaths' ] = self.k_return diff --git a/src/pathcomp/frontend/service/algorithms/ShortestPathAlgorithm.py b/src/pathcomp/frontend/service/algorithms/ShortestPathAlgorithm.py new file mode 100644 index 0000000000000000000000000000000000000000..4719b8703b4810ad23fcb6e4aa973c7b55088bab --- /dev/null +++ b/src/pathcomp/frontend/service/algorithms/ShortestPathAlgorithm.py @@ -0,0 +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. + +from typing import Dict, Optional +from common.proto.pathcomp_pb2 import Algorithm_ShortestPath, PathCompRequest +from ._Algorithm import _Algorithm + +class ShortestPathAlgorithm(_Algorithm): + def __init__(self, algorithm : Algorithm_ShortestPath, class_name=__name__) -> None: + super().__init__('SP', False, class_name=class_name) + + def add_service_requests(self, request : PathCompRequest) -> None: + super().add_service_requests(request) + for service_request in self.service_list: + service_request['algId' ] = self.algorithm_id + service_request['syncPaths'] = self.sync_paths + + def _single_device_request(self) -> Optional[Dict]: + if len(self.service_list) != 1: return None + service = self.service_list[0] + endpoint_ids = service['service_endpoints_ids'] + if len(endpoint_ids) != 2: return None + if endpoint_ids[0]['device_id'] != endpoint_ids[-1]['device_id']: return None + return {'response-list': [{ + 'serviceId': service['serviceId'], + 'service_endpoints_ids': [endpoint_ids[0], endpoint_ids[-1]], + 'path': [{ + # not used by now + #'path-capacity': {'total-size': {'value': 200, 'unit': 0}}, + #'path-latency': {'fixed-latency-characteristic': '2.000000'}, + #'path-cost': {'cost-name': '', 'cost-value': '1.000000', 'cost-algorithm': '0.000000'}, + 'devices': [endpoint_ids[0], endpoint_ids[-1]] + }] + }]} + + def execute(self, dump_request_filename : Optional[str] = None, dump_reply_filename : Optional[str] = None) -> None: + # if request is composed of a single service with single device (not supported by backend), + # produce synthetic reply directly + self.json_reply = self._single_device_request() + if self.json_reply is None: + # otherwise, follow normal logic through the backend + return super().execute(dump_request_filename, dump_reply_filename) diff --git a/src/pathcomp/frontend/service/algorithms/_Algorithm.py b/src/pathcomp/frontend/service/algorithms/_Algorithm.py new file mode 100644 index 0000000000000000000000000000000000000000..b6316774921171eb8ed6cf3faafd4b607bdcb831 --- /dev/null +++ b/src/pathcomp/frontend/service/algorithms/_Algorithm.py @@ -0,0 +1,274 @@ +# 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, logging, requests +from typing import Dict, List, Optional, Tuple, Union +from common.proto.context_pb2 import ( + ConfigRule, Connection, Device, DeviceList, EndPointId, Link, LinkList, Service, ServiceStatusEnum, + ServiceTypeEnum) +from common.proto.pathcomp_pb2 import PathCompReply, PathCompRequest +from common.tools.object_factory.ConfigRule import json_config_rule_set +from pathcomp.frontend.Config import BACKEND_URL +from pathcomp.frontend.service.algorithms.tools.ConstantsMappings import DEVICE_LAYER_TO_SERVICE_TYPE, DeviceLayerEnum +from .tools.EroPathToHops import eropath_to_hops +from .tools.ComposeRequest import compose_device, compose_link, compose_service +from .tools.ComputeSubServices import ( + convert_explicit_path_hops_to_connections, convert_explicit_path_hops_to_plain_connection) + +class _Algorithm: + def __init__(self, algorithm_id : str, sync_paths : bool, class_name=__name__) -> None: + # algorithm_id: algorithm to be executed + # sync_paths: if multiple services are included in the request, tunes how to prevent contention. If true, + # services are computed one after the other and resources assigned to service i, are considered as + # used when computing services i+1..n; otherwise, resources are never marked as used during the + # path computation. + + self.logger = logging.getLogger(class_name) + self.algorithm_id = algorithm_id + self.sync_paths = sync_paths + + self.device_list : List[Dict] = list() + self.device_dict : Dict[str, Tuple[Dict, Device]] = dict() + self.device_name_mapping : Dict[str, str] = dict() + self.endpoint_dict : Dict[str, Dict[str, Tuple[Dict, EndPointId]]] = dict() + self.endpoint_name_mapping : Dict[Tuple[str, str], str] = dict() + self.link_list : List[Dict] = list() + self.link_dict : Dict[str, Tuple[Dict, Link]] = dict() + self.endpoint_to_link_dict : Dict[Tuple[str, str], Tuple[Dict, Link]] = dict() + self.service_list : List[Dict] = list() + self.service_dict : Dict[Tuple[str, str], Tuple[Dict, Service]] = dict() + + def add_devices(self, grpc_devices : Union[List[Device], DeviceList]) -> None: + if isinstance(grpc_devices, DeviceList): grpc_devices = grpc_devices.devices + for grpc_device in grpc_devices: + json_device = compose_device(grpc_device) + self.device_list.append(json_device) + + device_uuid = json_device['device_Id'] + self.device_dict[device_uuid] = (json_device, grpc_device) + + _device_uuid = grpc_device.device_id.device_uuid.uuid + _device_name = grpc_device.name + self.device_name_mapping[_device_name] = _device_uuid + + device_endpoint_dict : Dict[str, Tuple[Dict, EndPointId]] = dict() + for json_endpoint,grpc_endpoint in zip(json_device['device_endpoints'], grpc_device.device_endpoints): + endpoint_uuid = json_endpoint['endpoint_id']['endpoint_uuid'] + endpoint_tuple = (json_endpoint['endpoint_id'], grpc_endpoint.endpoint_id) + device_endpoint_dict[endpoint_uuid] = endpoint_tuple + + _endpoint_uuid = grpc_endpoint.endpoint_id.endpoint_uuid.uuid + _endpoint_name = grpc_endpoint.name + self.endpoint_name_mapping[(_device_uuid, _endpoint_name)] = _endpoint_uuid + self.endpoint_name_mapping[(_device_name, _endpoint_name)] = _endpoint_uuid + + self.endpoint_dict[device_uuid] = device_endpoint_dict + + def add_links(self, grpc_links : Union[List[Link], LinkList]) -> None: + if isinstance(grpc_links, LinkList): grpc_links = grpc_links.links + for grpc_link in grpc_links: + json_link = compose_link(grpc_link) + if len(json_link['link_endpoint_ids']) != 2: continue + self.link_list.append(json_link) + + link_uuid = json_link['link_Id'] + self.link_dict[link_uuid] = (json_link, grpc_link) + + for link_endpoint_id in json_link['link_endpoint_ids']: + link_endpoint_id = link_endpoint_id['endpoint_id'] + device_uuid = link_endpoint_id['device_id'] + endpoint_uuid = link_endpoint_id['endpoint_uuid'] + endpoint_key = (device_uuid, endpoint_uuid) + link_tuple = (json_link, grpc_link) + self.endpoint_to_link_dict[endpoint_key] = link_tuple + + def add_service_requests(self, request : PathCompRequest) -> None: + for grpc_service in request.services: + json_service = compose_service(grpc_service) + self.service_list.append(json_service) + service_id = json_service['serviceId'] + service_key = (service_id['contextId'], service_id['service_uuid']) + service_tuple = (json_service, grpc_service) + self.service_dict[service_key] = service_tuple + + def execute(self, dump_request_filename : Optional[str] = None, dump_reply_filename : Optional[str] = None) -> None: + request = {'serviceList': self.service_list, 'deviceList': self.device_list, 'linkList': self.link_list} + + self.logger.debug('[execute] request={:s}'.format(json.dumps(request, sort_keys=True, indent=4))) + if dump_request_filename is not None: + with open(dump_request_filename, 'w', encoding='UTF-8') as f: + f.write(json.dumps(request, sort_keys=True, indent=4)) + + self.logger.debug('[execute] BACKEND_URL: {:s}'.format(str(BACKEND_URL))) + reply = requests.post(BACKEND_URL, json=request) + self.status_code = reply.status_code + self.raw_reply = reply.content.decode('UTF-8') + + self.logger.debug('[execute] status_code={:s} reply={:s}'.format(str(reply.status_code), str(self.raw_reply))) + if dump_reply_filename is not None: + with open(dump_reply_filename, 'w', encoding='UTF-8') as f: + f.write('status_code={:s} reply={:s}'.format(str(self.status_code), str(self.raw_reply))) + + if reply.status_code not in {requests.codes.ok}: # pylint: disable=no-member + raise Exception('Backend error({:s}) for request({:s})'.format( + str(self.raw_reply), json.dumps(request, sort_keys=True))) + + self.json_reply = reply.json() + + def add_connection_to_reply( + self, reply : PathCompReply, connection_uuid : str, service : Service, path_hops : List[Dict] + ) -> Connection: + connection = reply.connections.add() + + connection.connection_id.connection_uuid.uuid = connection_uuid + connection.service_id.CopyFrom(service.service_id) + + for path_hop in path_hops: + device_uuid = path_hop['device'] + + ingress_endpoint_uuid = path_hop['ingress_ep'] + endpoint_id = connection.path_hops_endpoint_ids.add() + endpoint_id.CopyFrom(self.endpoint_dict[device_uuid][ingress_endpoint_uuid][1]) + + egress_endpoint_uuid = path_hop['egress_ep'] + endpoint_id = connection.path_hops_endpoint_ids.add() + endpoint_id.CopyFrom(self.endpoint_dict[device_uuid][egress_endpoint_uuid][1]) + + return connection + + def add_service_to_reply( + self, reply : PathCompReply, context_uuid : str, service_uuid : str, + device_layer : Optional[DeviceLayerEnum] = None, path_hops : List[Dict] = [], + config_rules : List = [] + ) -> Service: + # TODO: implement support for multi-point services + # Control deactivated to enable disjoint paths with multiple redundant endpoints on each side + #service_endpoint_ids = service.service_endpoint_ids + #if len(service_endpoint_ids) != 2: raise NotImplementedError('Service must have 2 endpoints') + + service_key = (context_uuid, service_uuid) + tuple_service = self.service_dict.get(service_key) + if tuple_service is not None: + service = reply.services.add() + service.CopyFrom(tuple_service[1]) + else: + service = reply.services.add() + service.service_id.context_id.context_uuid.uuid = context_uuid + service.service_id.service_uuid.uuid = service_uuid + + if device_layer is not None: + service_type = DEVICE_LAYER_TO_SERVICE_TYPE.get(device_layer.value) + if service_type is None: + MSG = 'Unable to map DeviceLayer({:s}) to ServiceType' + raise Exception(MSG.format(str(device_layer))) + service.service_type = service_type + + if service_type == ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE: + json_tapi_settings = { + 'capacity_value' : 50.0, + 'capacity_unit' : 'GHz', + 'layer_proto_name': 'PHOTONIC_MEDIA', + 'layer_proto_qual': 'tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC', + 'direction' : 'UNIDIRECTIONAL', + } + config_rule = ConfigRule(**json_config_rule_set('/settings', json_tapi_settings)) + service.service_config.config_rules.append(config_rule) + else: + service.service_config.config_rules.extend(config_rules) + + service.service_status.service_status = ServiceStatusEnum.SERVICESTATUS_PLANNED + + if path_hops is not None and len(path_hops) > 0: + ingress_endpoint_id = service.service_endpoint_ids.add() + ingress_endpoint_id.device_id.device_uuid.uuid = path_hops[0]['device'] + ingress_endpoint_id.endpoint_uuid.uuid = path_hops[0]['ingress_ep'] + + egress_endpoint_id = service.service_endpoint_ids.add() + egress_endpoint_id.device_id.device_uuid.uuid = path_hops[-1]['device'] + egress_endpoint_id.endpoint_uuid.uuid = path_hops[-1]['egress_ep'] + + return service + + def get_reply(self) -> PathCompReply: + response_list = self.json_reply.get('response-list', []) + reply = PathCompReply() + grpc_services : Dict[Tuple[str, str], Service] = {} + grpc_connections : Dict[str, Connection] = {} + for response in response_list: + service_id = response['serviceId'] + context_uuid = service_id['contextId'] + service_uuid = service_id['service_uuid'] + service_key = (context_uuid, service_uuid) + upper_service = self.add_service_to_reply(reply, context_uuid, service_uuid) + grpc_services[service_key] = upper_service + + no_path_issue = response.get('noPath', {}).get('issue') + if no_path_issue is not None: + # no path found: leave connection with no endpoints + # no_path_issue == 1 => no path due to a constraint + continue + + for service_path_ero in response['path']: + path_hops = eropath_to_hops(service_path_ero['devices'], self.endpoint_to_link_dict) + try: + connections = convert_explicit_path_hops_to_connections(path_hops, self.device_dict, service_uuid) + except: # pylint: disable=bare-except + # if not able to extrapolate sub-services and sub-connections, + # assume single service and single connection + connections = convert_explicit_path_hops_to_plain_connection(path_hops, service_uuid) + + for connection in connections: + connection_uuid,device_layer,path_hops,_ = connection + service_key = (context_uuid, connection_uuid) + grpc_service = grpc_services.get(service_key) + if grpc_service is None: + config_rules = upper_service.service_config.config_rules + grpc_service = self.add_service_to_reply( + reply, context_uuid, connection_uuid, device_layer=device_layer, path_hops=path_hops, + config_rules=config_rules) + grpc_services[service_key] = grpc_service + + for connection in connections: + connection_uuid,device_layer,path_hops,dependencies = connection + + service_key = (context_uuid, connection_uuid) + grpc_service = grpc_services.get(service_key) + if grpc_service is None: raise Exception('Service({:s}) not found'.format(str(service_key))) + + grpc_connection = grpc_connections.get(connection_uuid) + if grpc_connection is not None: continue + grpc_connection = self.add_connection_to_reply(reply, connection_uuid, grpc_service, path_hops) + grpc_connections[connection_uuid] = grpc_connection + + for service_uuid in dependencies: + sub_service_key = (context_uuid, service_uuid) + grpc_sub_service = grpc_services.get(sub_service_key) + if grpc_sub_service is None: + raise Exception('Service({:s}) not found'.format(str(sub_service_key))) + grpc_sub_service_id = grpc_connection.sub_service_ids.add() + grpc_sub_service_id.CopyFrom(grpc_sub_service.service_id) + + # ... "path-capacity": {"total-size": {"value": 200, "unit": 0}}, + # ... "path-latency": {"fixed-latency-characteristic": "10.000000"}, + # ... "path-cost": {"cost-name": "", "cost-value": "5.000000", "cost-algorithm": "0.000000"}, + #path_capacity = service_path['path-capacity']['total-size'] + #path_capacity_value = path_capacity['value'] + #path_capacity_unit = CapacityUnit(path_capacity['unit']) + #path_latency = service_path['path-latency']['fixed-latency-characteristic'] + #path_cost = service_path['path-cost'] + #path_cost_name = path_cost['cost-name'] + #path_cost_value = path_cost['cost-value'] + #path_cost_algorithm = path_cost['cost-algorithm'] + + return reply diff --git a/src/pathcomp/frontend/service/algorithms/__init__.py b/src/pathcomp/frontend/service/algorithms/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/pathcomp/frontend/service/algorithms/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/pathcomp/frontend/service/algorithms/tools/ComposeRequest.py b/src/pathcomp/frontend/service/algorithms/tools/ComposeRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..bfb4da05fb57bef03fb94fc8973271ceb45f619a --- /dev/null +++ b/src/pathcomp/frontend/service/algorithms/tools/ComposeRequest.py @@ -0,0 +1,153 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging +from typing import Dict +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.proto.context_pb2 import Constraint, Device, EndPointId, Link, Service, ServiceId, TopologyId +from common.tools.grpc.Tools import grpc_message_to_json_string +from .ConstantsMappings import ( + CapacityUnit, LinkForwardingDirection, LinkPortDirection, TerminationDirection, TerminationState) + +LOGGER = logging.getLogger(__name__) + +def compose_topology_id(topology_id : TopologyId) -> Dict: # pylint: disable=unused-argument + # force context_uuid and topology_uuid to be always DEFAULT_CONTEXT_NAME and DEFAULT_TOPOLOGY_NAME for simplicity + # for interdomain, contexts and topologies are managed in particular ways + + context_uuid = DEFAULT_CONTEXT_NAME + #context_uuid = topology_id.context_id.context_uuid.uuid + #if len(context_uuid) == 0: context_uuid = DEFAULT_CONTEXT_NAME + + topology_uuid = DEFAULT_TOPOLOGY_NAME + #topology_uuid = topology_id.topology_uuid.uuid + #if len(topology_uuid) == 0: topology_uuid = DEFAULT_TOPOLOGY_NAME + + return {'contextId': context_uuid, 'topology_uuid': topology_uuid} + +def compose_service_id(service_id : ServiceId) -> Dict: + # force context_uuid to be always DEFAULT_CONTEXT_NAME for simplicity + # for interdomain, contexts are managed in particular ways + + #context_uuid = service_id.context_id.context_uuid.uuid + #if len(context_uuid) == 0: context_uuid = DEFAULT_CONTEXT_NAME + context_uuid = DEFAULT_CONTEXT_NAME + + service_uuid = service_id.service_uuid.uuid + return {'contextId': context_uuid, 'service_uuid': service_uuid} + +def compose_endpoint_id(endpoint_id : EndPointId) -> Dict: + topology_id = compose_topology_id(endpoint_id.topology_id) + device_uuid = endpoint_id.device_id.device_uuid.uuid + endpoint_uuid = endpoint_id.endpoint_uuid.uuid + return {'topology_id': topology_id, 'device_id': device_uuid, 'endpoint_uuid': endpoint_uuid} + +def compose_capacity(value : str, unit : str) -> Dict: + return {'total-size': {'value': value, 'unit': unit}} + +def compose_endpoint( + endpoint_id : Dict, endpoint_type : str, link_port_direction : int, termination_direction : int, + termination_state : int, total_potential_capacity : Dict, available_capacity : Dict +) -> Dict: + return { + 'endpoint_id': endpoint_id, 'endpoint_type': endpoint_type, 'link_port_direction': link_port_direction, + 'termination-direction': termination_direction, 'termination-state': termination_state, + 'total-potential-capacity': total_potential_capacity, 'available-capacity': available_capacity, + } + +def compose_cost_characteristics(cost_name : str, cost_value : str, cost_algorithm : str) -> Dict: + return {'cost-name': cost_name, 'cost-value': cost_value, 'cost-algorithm': cost_algorithm} + +def compose_latency_characteristics(fixed_latency_characteristic : str) -> Dict: + return {'fixed-latency-characteristic': fixed_latency_characteristic} + +def compose_constraint(constraint : Constraint) -> Dict: + if constraint.WhichOneof('constraint') != 'custom': + str_constraint = grpc_message_to_json_string(constraint) + LOGGER.warning('Ignoring unsupported Constraint({:s})'.format(str_constraint)) + return None + constraint_type = constraint.custom.constraint_type + if constraint_type in {'diversity'}: + str_constraint = grpc_message_to_json_string(constraint) + LOGGER.warning('Ignoring unsupported Constraint({:s})'.format(str_constraint)) + return None + constraint_value = constraint.custom.constraint_value + return {'constraint_type': constraint_type, 'constraint_value': constraint_value} + +def compose_device(grpc_device : Device) -> Dict: + device_uuid = grpc_device.device_id.device_uuid.uuid + device_type = grpc_device.device_type + + endpoints = [] + for device_endpoint in grpc_device.device_endpoints: + endpoint_id = compose_endpoint_id(device_endpoint.endpoint_id) + endpoint_type = device_endpoint.endpoint_type + link_port_direction = LinkPortDirection.BIDIRECTIONAL.value + termination_direction = TerminationDirection.BIDIRECTIONAL.value + termination_state = TerminationState.TERMINATED_BIDIRECTIONAL.value + total_potential_capacity = compose_capacity(200, CapacityUnit.MBPS.value) + available_capacity = compose_capacity(200, CapacityUnit.MBPS.value) + endpoint = compose_endpoint( + endpoint_id, endpoint_type, link_port_direction, termination_direction, + termination_state, total_potential_capacity, available_capacity) + endpoints.append(endpoint) + + return {'device_Id': device_uuid, 'device_type': device_type, 'device_endpoints': endpoints} + +def compose_link(grpc_link : Link) -> Dict: + link_uuid = grpc_link.link_id.link_uuid.uuid + + endpoint_ids = [ + {'endpoint_id' : compose_endpoint_id(link_endpoint_id)} + for link_endpoint_id in grpc_link.link_endpoint_ids + ] + + forwarding_direction = LinkForwardingDirection.BIDIRECTIONAL.value + total_potential_capacity = compose_capacity(200, CapacityUnit.MBPS.value) + available_capacity = compose_capacity(200, CapacityUnit.MBPS.value) + cost_characteristics = compose_cost_characteristics('linkcost', '1', '0') + latency_characteristics = compose_latency_characteristics('2') + + return { + 'link_Id': link_uuid, 'link_endpoint_ids': endpoint_ids, 'forwarding_direction': forwarding_direction, + 'total-potential-capacity': total_potential_capacity, 'available-capacity': available_capacity, + 'cost-characteristics': cost_characteristics, 'latency-characteristics': latency_characteristics, + } + +def compose_service(grpc_service : Service) -> Dict: + service_id = compose_service_id(grpc_service.service_id) + service_type = grpc_service.service_type + + endpoint_ids = [ + compose_endpoint_id(service_endpoint_id) + for service_endpoint_id in grpc_service.service_endpoint_ids + ] + + constraints = list(filter(lambda constraint: constraint is not None, [ + compose_constraint(service_constraint) + for service_constraint in grpc_service.service_constraints + ])) + + constraint_types = {constraint['constraint_type'] for constraint in constraints} + if 'bandwidth[gbps]' not in constraint_types: + constraints.append({'constraint_type': 'bandwidth[gbps]', 'constraint_value': '20.0'}) + if 'latency[ms]' not in constraint_types: + constraints.append({'constraint_type': 'latency[ms]', 'constraint_value': '20.0'}) + + return { + 'serviceId': service_id, + 'serviceType': service_type, + 'service_endpoints_ids': endpoint_ids, + 'service_constraints': constraints, + } diff --git a/src/pathcomp/frontend/service/algorithms/tools/ComputeSubServices.py b/src/pathcomp/frontend/service/algorithms/tools/ComputeSubServices.py new file mode 100644 index 0000000000000000000000000000000000000000..b92a19b52c4887e01f7f1bc58de897c783683eeb --- /dev/null +++ b/src/pathcomp/frontend/service/algorithms/tools/ComputeSubServices.py @@ -0,0 +1,112 @@ +# 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. + +# Convert the path defined as explicit hops with ingress and egress endpoints per device into a set of connections and +# compute the dependencies among them. +# +# Example: +# o-- int DC1 eth1 -- 10/1 CS1 1/2 -- 1/2 R2 2/1 -- a7.. OLS 60.. -- 2/1 R3 1/1 -- 1/1 CS2 10/1 -- eth1 DC2 int --o +# APP PKT PKT CTRL PKT PKT APP +# +# path_hops = [ +# {'device': 'DC1-GW', 'ingress_ep': 'int', 'egress_ep': 'eth1'}, +# {'device': 'CS1-GW1', 'ingress_ep': '10/1', 'egress_ep': '1/2'}, +# {'device': 'TN-R2', 'ingress_ep': '1/2', 'egress_ep': '2/1'}, +# {'device': 'TN-OLS', 'ingress_ep': 'a7a80b23a703', 'egress_ep': '60519106029e'}, +# {'device': 'TN-R3', 'ingress_ep': '2/1', 'egress_ep': '1/1'}, +# {'device': 'CS2-GW1', 'ingress_ep': '1/1', 'egress_ep': '10/1'}, +# {'device': 'DC2-GW', 'ingress_ep': 'eth1', 'egress_ep': 'int'} +# ] +# +# connections=[ +# (UUID('7548edf7-ee7c-4adf-ac0f-c7a0c0dfba8e'), , [ +# {'device': 'TN-OLS', 'ingress_ep': '833760219d0f', 'egress_ep': 'cf176771a4b9'} +# ], []), +# (UUID('c2e57966-5d82-4705-a5fe-44cf6487219e'), , [ +# {'device': 'CS1-GW1', 'ingress_ep': '10/1', 'egress_ep': '1/2'}, +# {'device': 'TN-R2', 'ingress_ep': '1/2', 'egress_ep': '2/1'}, +# {'device': 'TN-R3', 'ingress_ep': '2/1', 'egress_ep': '1/1'}, +# {'device': 'CS2-GW1', 'ingress_ep': '1/1', 'egress_ep': '10/1'} +# ], [UUID('7548edf7-ee7c-4adf-ac0f-c7a0c0dfba8e')]), +# (UUID('1e205c82-f6ea-4977-9e97-dc27ef1f4802'), , [ +# {'device': 'DC1-GW', 'ingress_ep': 'int', 'egress_ep': 'eth1'}, +# {'device': 'DC2-GW', 'ingress_ep': 'eth1', 'egress_ep': 'int'} +# ], [UUID('c2e57966-5d82-4705-a5fe-44cf6487219e')]) +# ] + +import queue, uuid +from typing import Dict, List, Tuple +from common.proto.context_pb2 import Device +from .ConstantsMappings import DEVICE_TYPE_TO_LAYER, DeviceLayerEnum + +def convert_explicit_path_hops_to_connections( + path_hops : List[Dict], device_dict : Dict[str, Tuple[Dict, Device]], main_connection_uuid : str +) -> List[Tuple[str, DeviceLayerEnum, List[str], List[str]]]: + + connection_stack = queue.LifoQueue() + connections : List[Tuple[str, DeviceLayerEnum, List[str], List[str]]] = list() + old_device_layer = None + last_device_uuid = None + for path_hop in path_hops: + device_uuid = path_hop['device'] + if last_device_uuid == device_uuid: continue + device_tuple = device_dict.get(device_uuid) + if device_tuple is None: raise Exception('Device({:s}) not found'.format(str(device_uuid))) + json_device,_ = device_tuple + device_type = json_device['device_type'] + device_layer = DEVICE_TYPE_TO_LAYER.get(device_type) + if device_layer is None: raise Exception('Undefined Layer for DeviceType({:s})'.format(str(device_type))) + + if old_device_layer is None: + # path ingress + connection_stack.put((main_connection_uuid, device_layer, [path_hop], [])) + elif old_device_layer > device_layer: + # underlying connection begins + connection_uuid = str(uuid.uuid4()) + connection_stack.put((connection_uuid, device_layer, [path_hop], [])) + elif old_device_layer == device_layer: + # same connection continues + connection_stack.queue[-1][2].append(path_hop) + elif old_device_layer < device_layer: + # underlying connection ended + connection = connection_stack.get() + connections.append(connection) + connection_stack.queue[-1][3].append(connection[0]) + connection_stack.queue[-1][2].append(path_hop) + else: + raise Exception('Uncontrolled condition') + + old_device_layer = device_layer + last_device_uuid = device_uuid + + # path egress + connections.append(connection_stack.get()) + assert connection_stack.empty() + return connections + +def convert_explicit_path_hops_to_plain_connection( + path_hops : List[Dict], main_connection_uuid : str +) -> List[Tuple[str, DeviceLayerEnum, List[str], List[str]]]: + + connection : Tuple[str, DeviceLayerEnum, List[str], List[str]] = \ + (main_connection_uuid, DeviceLayerEnum.PACKET_DEVICE, [], []) + + last_device_uuid = None + for path_hop in path_hops: + device_uuid = path_hop['device'] + if last_device_uuid == device_uuid: continue + connection[2].append(path_hop) + last_device_uuid = device_uuid + + return [connection] diff --git a/src/pathcomp/frontend/service/algorithms/tools/ConstantsMappings.py b/src/pathcomp/frontend/service/algorithms/tools/ConstantsMappings.py new file mode 100644 index 0000000000000000000000000000000000000000..cd1956a873dd2170c7a75db0c677db34162449ee --- /dev/null +++ b/src/pathcomp/frontend/service/algorithms/tools/ConstantsMappings.py @@ -0,0 +1,115 @@ +# 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 enum import IntEnum +from common.DeviceTypes import DeviceTypeEnum +from common.proto.context_pb2 import ServiceTypeEnum + +class CapacityUnit(IntEnum): + TB = 0 + TBPS = 1 + GB = 2 + GBPS = 3 + MB = 4 + MBPS = 5 + KB = 6 + KBPS = 7 + GHZ = 8 + MHZ = 9 + +CAPACITY_MULTIPLIER = { + CapacityUnit.TB : 1.e12, + CapacityUnit.TBPS : 1.e12, + CapacityUnit.GB : 1.e9, + CapacityUnit.GBPS : 1.e9, + CapacityUnit.MB : 1.e6, + CapacityUnit.MBPS : 1.e6, + CapacityUnit.KB : 1.e3, + CapacityUnit.KBPS : 1.e3, + CapacityUnit.GHZ : 1.e9, + CapacityUnit.MHZ : 1.e6, +} + +class LinkPortDirection(IntEnum): + BIDIRECTIONAL = 0 + INPUT = 1 + OUTPUT = 2 + UNKNOWN = 3 + +class TerminationDirection(IntEnum): + BIDIRECTIONAL = 0 + SINK = 1 + SOURCE = 2 + UNKNOWN = 3 + +class TerminationState(IntEnum): + CAN_NEVER_TERMINATE = 0 + NOT_TERMINATED = 1 + TERMINATED_SERVER_TO_CLIENT = 2 + TERMINATED_CLIENT_TO_SERVER = 3 + TERMINATED_BIDIRECTIONAL = 4 + PERMENANTLY_TERMINATED = 5 + TERMINATION_STATE_UNKNOWN = 6 + +class LinkForwardingDirection(IntEnum): + BIDIRECTIONAL = 0 + UNIDIRECTIONAL = 1 + UNKNOWN = 2 + +class DeviceLayerEnum(IntEnum): + APPLICATION_CONTROLLER = 41 # Layer 4 domain controller + APPLICATION_DEVICE = 40 # Layer 4 domain device + PACKET_CONTROLLER = 31 # Layer 3 domain controller + PACKET_DEVICE = 30 # Layer 3 domain device + MAC_LAYER_CONTROLLER = 21 # Layer 2 domain controller + MAC_LAYER_DEVICE = 20 # Layer 2 domain device + OPTICAL_CONTROLLER = 1 # Layer 0 domain controller + OPTICAL_DEVICE = 0 # Layer 0 domain device + +DEVICE_TYPE_TO_LAYER = { + DeviceTypeEnum.EMULATED_DATACENTER.value : DeviceLayerEnum.APPLICATION_DEVICE, + DeviceTypeEnum.DATACENTER.value : DeviceLayerEnum.APPLICATION_DEVICE, + DeviceTypeEnum.NETWORK.value : DeviceLayerEnum.APPLICATION_DEVICE, + + DeviceTypeEnum.EMULATED_PACKET_ROUTER.value : DeviceLayerEnum.PACKET_DEVICE, + DeviceTypeEnum.PACKET_ROUTER.value : DeviceLayerEnum.PACKET_DEVICE, + DeviceTypeEnum.EMULATED_PACKET_SWITCH.value : DeviceLayerEnum.MAC_LAYER_DEVICE, + DeviceTypeEnum.PACKET_SWITCH.value : DeviceLayerEnum.MAC_LAYER_DEVICE, + + DeviceTypeEnum.EMULATED_P4_SWITCH.value : DeviceLayerEnum.MAC_LAYER_DEVICE, + DeviceTypeEnum.P4_SWITCH.value : DeviceLayerEnum.MAC_LAYER_DEVICE, + + DeviceTypeEnum.EMULATED_MICROWAVE_RADIO_SYSTEM.value : DeviceLayerEnum.MAC_LAYER_CONTROLLER, + DeviceTypeEnum.MICROWAVE_RADIO_SYSTEM.value : DeviceLayerEnum.MAC_LAYER_CONTROLLER, + + DeviceTypeEnum.EMULATED_OPEN_LINE_SYSTEM.value : DeviceLayerEnum.OPTICAL_CONTROLLER, + DeviceTypeEnum.OPEN_LINE_SYSTEM.value : DeviceLayerEnum.OPTICAL_CONTROLLER, + DeviceTypeEnum.XR_CONSTELLATION.value : DeviceLayerEnum.OPTICAL_CONTROLLER, + + DeviceTypeEnum.EMULATED_OPTICAL_ROADM.value : DeviceLayerEnum.OPTICAL_DEVICE, + DeviceTypeEnum.OPTICAL_ROADM.value : DeviceLayerEnum.OPTICAL_DEVICE, + DeviceTypeEnum.EMULATED_OPTICAL_TRANSPONDER.value : DeviceLayerEnum.OPTICAL_DEVICE, + DeviceTypeEnum.OPTICAL_TRANSPONDER.value : DeviceLayerEnum.OPTICAL_DEVICE, +} + +DEVICE_LAYER_TO_SERVICE_TYPE = { + DeviceLayerEnum.APPLICATION_DEVICE.value : ServiceTypeEnum.SERVICETYPE_L3NM, + DeviceLayerEnum.PACKET_DEVICE.value : ServiceTypeEnum.SERVICETYPE_L3NM, + + DeviceLayerEnum.MAC_LAYER_CONTROLLER.value : ServiceTypeEnum.SERVICETYPE_L2NM, + DeviceLayerEnum.MAC_LAYER_DEVICE.value : ServiceTypeEnum.SERVICETYPE_L2NM, + + DeviceLayerEnum.OPTICAL_CONTROLLER.value : ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE, + DeviceLayerEnum.OPTICAL_DEVICE.value : ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE, +} diff --git a/src/pathcomp/frontend/service/algorithms/tools/EroPathToHops.py b/src/pathcomp/frontend/service/algorithms/tools/EroPathToHops.py new file mode 100644 index 0000000000000000000000000000000000000000..c8a902999ddfb5011fd7ec09fa99ff6fa697ea40 --- /dev/null +++ b/src/pathcomp/frontend/service/algorithms/tools/EroPathToHops.py @@ -0,0 +1,84 @@ +# 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. + +# Convert the Explicit Route Object (ERO)-like paths produced by the PathComp component (response['path']) into +# explicit hops with ingress and egress endpoints per device (path_hops). +# +# response['path'] = [{ +# 'path-capacity': {'total-size': {'value': 200, 'unit': 0}}, +# 'path-latency': {'fixed-latency-characteristic': '12.000000'}, +# 'path-cost': {'cost-name': '', 'cost-value': '6.000000', 'cost-algorithm': '0.000000'}, +# 'devices': [ +# {'device_id': 'DC1-GW', 'endpoint_uuid': 'int'}, +# {'device_id': 'DC1-GW', 'endpoint_uuid': 'eth1'}, +# {'device_id': 'CS1-GW1', 'endpoint_uuid': '1/2'}, +# {'device_id': 'TN-R2', 'endpoint_uuid': '2/1'}, +# {'device_id': 'TN-OLS', 'endpoint_uuid': 'ca46812e8ad7'}, +# {'device_id': 'TN-R3', 'endpoint_uuid': '1/1'}, +# {'device_id': 'CS2-GW1', 'endpoint_uuid': '10/1'}, +# {'device_id': 'DC2-GW', 'endpoint_uuid': 'int'} +# ] +# }] +# +# path_hops = [ +# {'device': 'DC1-GW', 'ingress_ep': 'int', 'egress_ep': 'eth1'}, +# {'device': 'CS1-GW1', 'ingress_ep': '10/1', 'egress_ep': '1/2'}, +# {'device': 'TN-R2', 'ingress_ep': '1/2', 'egress_ep': '2/1'}, +# {'device': 'TN-OLS', 'ingress_ep': '951f2f57e4a4', 'egress_ep': 'ca46812e8ad7'}, +# {'device': 'TN-R3', 'ingress_ep': '2/1', 'egress_ep': '1/1'}, +# {'device': 'CS2-GW1', 'ingress_ep': '1/1', 'egress_ep': '10/1'}, +# {'device': 'DC2-GW', 'ingress_ep': 'eth1', 'egress_ep': 'int'} +# ] +# + +import logging +from typing import Dict, List + +LOGGER = logging.getLogger(__name__) + +def eropath_to_hops(ero_path : List[Dict], endpoint_to_link_dict : Dict) -> List[Dict]: + try: + path_hops = [] + for endpoint in ero_path: + device_uuid = endpoint['device_id'] + endpoint_uuid = endpoint['endpoint_uuid'] + + if len(path_hops) == 0: + path_hops.append({'device': device_uuid, 'ingress_ep': endpoint_uuid}) + continue + + last_hop = path_hops[-1] + if (last_hop['device'] == device_uuid): + if ('ingress_ep' not in last_hop) or ('egress_ep' in last_hop): continue + last_hop['egress_ep'] = endpoint_uuid + continue + + endpoint_key = (last_hop['device'], last_hop['egress_ep']) + link_tuple = endpoint_to_link_dict.get(endpoint_key) + ingress = next(iter([ + ep_id for ep_id in link_tuple[0]['link_endpoint_ids'] + if (ep_id['endpoint_id']['device_id'] == device_uuid) and\ + (ep_id['endpoint_id']['endpoint_uuid'] != endpoint_uuid) + ]), None) + if ingress['endpoint_id']['device_id'] != device_uuid: raise Exception('Malformed path') + path_hops.append({ + 'device': ingress['endpoint_id']['device_id'], + 'ingress_ep': ingress['endpoint_id']['endpoint_uuid'], + 'egress_ep': endpoint_uuid, + }) + return path_hops + except: + LOGGER.exception('Unhandled exception: ero_path={:s} endpoint_to_link_dict={:s}'.format( + str(ero_path), str(endpoint_to_link_dict))) + raise diff --git a/src/pathcomp/frontend/service/algorithms/tools/__init__.py b/src/pathcomp/frontend/service/algorithms/tools/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/pathcomp/frontend/service/algorithms/tools/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/pathcomp/frontend/tests/.gitignore b/src/pathcomp/frontend/tests/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..6b97d6fe3ad32f39097745229ab7f547f26ecb12 --- /dev/null +++ b/src/pathcomp/frontend/tests/.gitignore @@ -0,0 +1 @@ +# Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. diff --git a/src/pathcomp/frontend/tests/MockService_Dependencies.py b/src/pathcomp/frontend/tests/MockService_Dependencies.py new file mode 100644 index 0000000000000000000000000000000000000000..e903bc0e028c7ef97f21d7422f37255574547338 --- /dev/null +++ b/src/pathcomp/frontend/tests/MockService_Dependencies.py @@ -0,0 +1,40 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +from typing import Union +from common.Constants import ServiceNameEnum +from common.Settings import ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name +from common.proto.context_pb2_grpc import add_ContextServiceServicer_to_server +from common.tests.MockServicerImpl_Context import MockServicerImpl_Context +from common.tools.service.GenericGrpcService import GenericGrpcService + +LOCAL_HOST = '127.0.0.1' + +SERVICE_CONTEXT = ServiceNameEnum.CONTEXT + +class MockService_Dependencies(GenericGrpcService): + # Mock Service implementing Context, Device, and Service to simplify unitary tests of PathComp + + def __init__(self, bind_port: Union[str, int]) -> None: + super().__init__(bind_port, LOCAL_HOST, enable_health_servicer=False, cls_name='MockService') + + # pylint: disable=attribute-defined-outside-init + def install_servicers(self): + self.context_servicer = MockServicerImpl_Context() + add_ContextServiceServicer_to_server(self.context_servicer, self.server) + + def configure_env_vars(self): + os.environ[get_env_var_name(SERVICE_CONTEXT, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) diff --git a/src/pathcomp/frontend/tests/Objects_A_B_C.py b/src/pathcomp/frontend/tests/Objects_A_B_C.py new file mode 100644 index 0000000000000000000000000000000000000000..ca9764a34ef0550351c4a0ebcdbd041805c49dde --- /dev/null +++ b/src/pathcomp/frontend/tests/Objects_A_B_C.py @@ -0,0 +1,138 @@ +# 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 common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.tools.object_factory.Constraint import json_constraint_custom +from common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Device import json_device_emulated_packet_router_disabled, json_device_id +from common.tools.object_factory.EndPoint import json_endpoints +from common.tools.object_factory.Link import get_link_uuid, json_link, json_link_id +from common.tools.object_factory.Service import get_service_uuid, json_service_l3nm_planned +from common.tools.object_factory.Topology import json_topology, json_topology_id + +def compose_device(device_uuid, endpoint_uuids, topology_id=None): + device_id = json_device_id(device_uuid) + endpoints = [(endpoint_uuid, 'copper', []) for endpoint_uuid in endpoint_uuids] + endpoints = json_endpoints(device_id, endpoints, topology_id=topology_id) + device = json_device_emulated_packet_router_disabled(device_uuid, endpoints=endpoints) + return device_id, endpoints, device + +def compose_link(endpoint_a, endpoint_z): + link_uuid = get_link_uuid(endpoint_a['endpoint_id'], endpoint_z['endpoint_id']) + link_id = json_link_id(link_uuid) + link = json_link(link_uuid, [endpoint_a['endpoint_id'], endpoint_z['endpoint_id']]) + return link_id, link + +def compose_service(endpoint_a, endpoint_z, constraints=[]): + service_uuid = get_service_uuid(endpoint_a['endpoint_id'], endpoint_z['endpoint_id']) + endpoint_ids = [endpoint_a['endpoint_id'], endpoint_z['endpoint_id']] + service = json_service_l3nm_planned(service_uuid, endpoint_ids=endpoint_ids, constraints=constraints) + return service + +# ----- Context -------------------------------------------------------------------------------------------------------- +CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) +CONTEXT = json_context(DEFAULT_CONTEXT_NAME) + +# ----- Domains -------------------------------------------------------------------------------------------------------- +TOPOLOGY_ADMIN_UUID = DEFAULT_TOPOLOGY_NAME +TOPOLOGY_ADMIN_ID = json_topology_id(TOPOLOGY_ADMIN_UUID, context_id=CONTEXT_ID) +TOPOLOGY_ADMIN = json_topology(TOPOLOGY_ADMIN_UUID, context_id=CONTEXT_ID) + +TOPOLOGY_A_UUID = 'A' +TOPOLOGY_A_ID = json_topology_id(TOPOLOGY_A_UUID, context_id=CONTEXT_ID) +TOPOLOGY_A = json_topology(TOPOLOGY_A_UUID, context_id=CONTEXT_ID) + +TOPOLOGY_B_UUID = 'B' +TOPOLOGY_B_ID = json_topology_id(TOPOLOGY_B_UUID, context_id=CONTEXT_ID) +TOPOLOGY_B = json_topology(TOPOLOGY_B_UUID, context_id=CONTEXT_ID) + +TOPOLOGY_C_UUID = 'C' +TOPOLOGY_C_ID = json_topology_id(TOPOLOGY_C_UUID, context_id=CONTEXT_ID) +TOPOLOGY_C = json_topology(TOPOLOGY_C_UUID, context_id=CONTEXT_ID) + +# ----- Devices Domain A ----------------------------------------------------------------------------------------------- +DEVICE_A1_ID, DEVICE_A1_ENDPOINTS, DEVICE_A1 = compose_device('A1', ['1', '2', '2000'], topology_id=TOPOLOGY_A_ID) +DEVICE_A2_ID, DEVICE_A2_ENDPOINTS, DEVICE_A2 = compose_device('A2', ['1', '2', '1001'], topology_id=TOPOLOGY_A_ID) +DEVICE_A3_ID, DEVICE_A3_ENDPOINTS, DEVICE_A3 = compose_device('A3', ['1', '2' ], topology_id=TOPOLOGY_A_ID) + +# ----- Devices Domain B ----------------------------------------------------------------------------------------------- +DEVICE_B1_ID, DEVICE_B1_ENDPOINTS, DEVICE_B1 = compose_device('B1', ['1', '2', '2000'], topology_id=TOPOLOGY_B_ID) +DEVICE_B2_ID, DEVICE_B2_ENDPOINTS, DEVICE_B2 = compose_device('B2', ['1', '2', '1002'], topology_id=TOPOLOGY_B_ID) +DEVICE_B3_ID, DEVICE_B3_ENDPOINTS, DEVICE_B3 = compose_device('B3', ['1', '2' ], topology_id=TOPOLOGY_B_ID) + +# ----- Devices Domain C ----------------------------------------------------------------------------------------------- +DEVICE_C1_ID, DEVICE_C1_ENDPOINTS, DEVICE_C1 = compose_device('C1', ['1', '2', '1001'], topology_id=TOPOLOGY_C_ID) +DEVICE_C2_ID, DEVICE_C2_ENDPOINTS, DEVICE_C2 = compose_device('C2', ['1', '2' ], topology_id=TOPOLOGY_C_ID) +DEVICE_C3_ID, DEVICE_C3_ENDPOINTS, DEVICE_C3 = compose_device('C3', ['1', '2', '1002'], topology_id=TOPOLOGY_C_ID) + +# ----- InterDomain Links ---------------------------------------------------------------------------------------------- +LINK_A2_C3_ID, LINK_A2_C3 = compose_link(DEVICE_A2_ENDPOINTS[2], DEVICE_C3_ENDPOINTS[2]) +LINK_C1_B2_ID, LINK_C1_B2 = compose_link(DEVICE_C1_ENDPOINTS[2], DEVICE_B2_ENDPOINTS[2]) + +# ----- IntraDomain A Links -------------------------------------------------------------------------------------------- +LINK_A1_A2_ID, LINK_A1_A2 = compose_link(DEVICE_A1_ENDPOINTS[0], DEVICE_A2_ENDPOINTS[0]) +LINK_A1_A3_ID, LINK_A1_A3 = compose_link(DEVICE_A1_ENDPOINTS[1], DEVICE_A3_ENDPOINTS[0]) +LINK_A2_A3_ID, LINK_A2_A3 = compose_link(DEVICE_A2_ENDPOINTS[1], DEVICE_A3_ENDPOINTS[1]) + +# ----- IntraDomain B Links -------------------------------------------------------------------------------------------- +LINK_B1_B2_ID, LINK_B1_B2 = compose_link(DEVICE_B1_ENDPOINTS[0], DEVICE_B2_ENDPOINTS[0]) +LINK_B1_B3_ID, LINK_B1_B3 = compose_link(DEVICE_B1_ENDPOINTS[1], DEVICE_B3_ENDPOINTS[0]) +LINK_B2_B3_ID, LINK_B2_B3 = compose_link(DEVICE_B2_ENDPOINTS[1], DEVICE_B3_ENDPOINTS[1]) + +# ----- IntraDomain C Links -------------------------------------------------------------------------------------------- +LINK_C1_C2_ID, LINK_C1_C2 = compose_link(DEVICE_C1_ENDPOINTS[0], DEVICE_C2_ENDPOINTS[0]) +LINK_C1_C3_ID, LINK_C1_C3 = compose_link(DEVICE_C1_ENDPOINTS[1], DEVICE_C3_ENDPOINTS[0]) +LINK_C2_C3_ID, LINK_C2_C3 = compose_link(DEVICE_C2_ENDPOINTS[1], DEVICE_C3_ENDPOINTS[1]) + +# ----- Service -------------------------------------------------------------------------------------------------------- +SERVICE_A1_B1 = compose_service(DEVICE_A1_ENDPOINTS[2], DEVICE_B1_ENDPOINTS[2], constraints=[ + json_constraint_custom('bandwidth[gbps]', 10.0), + json_constraint_custom('latency[ms]', 12.0), +]) + +# ----- Containers ----------------------------------------------------------------------------------------------------- +CONTEXTS = [ CONTEXT] +TOPOLOGIES = [ TOPOLOGY_ADMIN, TOPOLOGY_A, TOPOLOGY_B, TOPOLOGY_C] +DEVICES = [ DEVICE_A1, DEVICE_A2, DEVICE_A3, + DEVICE_B1, DEVICE_B2, DEVICE_B3, + DEVICE_C1, DEVICE_C2, DEVICE_C3, ] +LINKS = [ LINK_A2_C3, LINK_C1_B2, + LINK_A1_A2, LINK_A1_A3, LINK_A2_A3, + LINK_B1_B2, LINK_B1_B3, LINK_B2_B3, + LINK_C1_C2, LINK_C1_C3, LINK_C2_C3, ] +SERVICES = [ SERVICE_A1_B1] + +OBJECTS_PER_TOPOLOGY = [ + (TOPOLOGY_ADMIN_ID, + [ DEVICE_A1_ID, DEVICE_A2_ID, DEVICE_A3_ID, + DEVICE_B1_ID, DEVICE_B2_ID, DEVICE_B3_ID, + DEVICE_C1_ID, DEVICE_C2_ID, DEVICE_C3_ID, ], + [ LINK_A2_C3_ID, LINK_C1_B2_ID, + LINK_A1_A2_ID, LINK_A1_A3_ID, LINK_A2_A3_ID, + LINK_B1_B2_ID, LINK_B1_B3_ID, LINK_B2_B3_ID, + LINK_C1_C2_ID, LINK_C1_C3_ID, LINK_C2_C3_ID, ], + ), + (TOPOLOGY_A_ID, + [ DEVICE_A1_ID, DEVICE_A2_ID, DEVICE_A3_ID, ], + [ LINK_A1_A2_ID, LINK_A1_A3_ID, LINK_A2_A3_ID, ], + ), + (TOPOLOGY_B_ID, + [ DEVICE_B1_ID, DEVICE_B2_ID, DEVICE_B3_ID, ], + [ LINK_B1_B2_ID, LINK_B1_B3_ID, LINK_B2_B3_ID, ], + ), + (TOPOLOGY_C_ID, + [ DEVICE_C1_ID, DEVICE_C2_ID, DEVICE_C3_ID, ], + [ LINK_C1_C2_ID, LINK_C1_C3_ID, LINK_C2_C3_ID, ], + ), +] diff --git a/src/pathcomp/frontend/tests/Objects_DC_CSGW_TN.py b/src/pathcomp/frontend/tests/Objects_DC_CSGW_TN.py new file mode 100644 index 0000000000000000000000000000000000000000..1d057c10edcea30e1bf38f63d8a1ad0c6a0a4d46 --- /dev/null +++ b/src/pathcomp/frontend/tests/Objects_DC_CSGW_TN.py @@ -0,0 +1,191 @@ +# 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 common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.tools.object_factory.Constraint import json_constraint_custom +from common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Device import ( + json_device_emulated_connect_rules, json_device_emulated_datacenter_disabled, + json_device_emulated_packet_router_disabled, json_device_id) +from common.tools.object_factory.EndPoint import json_endpoints +from common.tools.object_factory.Link import get_link_uuid, json_link, json_link_id +from common.tools.object_factory.Service import get_service_uuid, json_service_l3nm_planned +from common.tools.object_factory.Topology import json_topology, json_topology_id + +# if true, Device component is present and will infeer the endpoints from connect-rules +# if false, Device component is not present and device objects must contain preconfigured endpoints +ADD_CONNECT_RULES_TO_DEVICES = False + +def compose_router(device_uuid, endpoint_uuids, topology_id=None): + device_id = json_device_id(device_uuid) + r_endpoints = [(endpoint_uuid, 'copper', []) for endpoint_uuid in endpoint_uuids] + config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] + endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) + j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints + device = json_device_emulated_packet_router_disabled(device_uuid, config_rules=config_rules, endpoints=j_endpoints) + return device_id, endpoints, device + +def compose_datacenter(device_uuid, endpoint_uuids, topology_id=None): + device_id = json_device_id(device_uuid) + r_endpoints = [(endpoint_uuid, 'copper', []) for endpoint_uuid in endpoint_uuids] + config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] + endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) + j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints + device = json_device_emulated_datacenter_disabled(device_uuid, config_rules=config_rules, endpoints=j_endpoints) + return device_id, endpoints, device + +def compose_link(endpoint_a, endpoint_z): + link_uuid = get_link_uuid(endpoint_a['endpoint_id'], endpoint_z['endpoint_id']) + link_id = json_link_id(link_uuid) + link = json_link(link_uuid, [endpoint_a['endpoint_id'], endpoint_z['endpoint_id']]) + return link_id, link + +def compose_service(endpoint_a, endpoint_z, constraints=[]): + service_uuid = get_service_uuid(endpoint_a['endpoint_id'], endpoint_z['endpoint_id']) + endpoint_ids = [endpoint_a['endpoint_id'], endpoint_z['endpoint_id']] + service = json_service_l3nm_planned(service_uuid, endpoint_ids=endpoint_ids, constraints=constraints) + return service + +# ----- Context -------------------------------------------------------------------------------------------------------- +CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) +CONTEXT = json_context(DEFAULT_CONTEXT_NAME) + +# ----- Domains -------------------------------------------------------------------------------------------------------- +# Overall network topology +TOPO_ADMIN_UUID = DEFAULT_TOPOLOGY_NAME +TOPO_ADMIN_ID = json_topology_id(TOPO_ADMIN_UUID, context_id=CONTEXT_ID) +TOPO_ADMIN = json_topology(TOPO_ADMIN_UUID, context_id=CONTEXT_ID) + +# DataCenter #1 Network +TOPO_DC1_UUID = 'DC1' +TOPO_DC1_ID = json_topology_id(TOPO_DC1_UUID, context_id=CONTEXT_ID) +TOPO_DC1 = json_topology(TOPO_DC1_UUID, context_id=CONTEXT_ID) + +# DataCenter #2 Network +TOPO_DC2_UUID = 'DC2' +TOPO_DC2_ID = json_topology_id(TOPO_DC2_UUID, context_id=CONTEXT_ID) +TOPO_DC2 = json_topology(TOPO_DC2_UUID, context_id=CONTEXT_ID) + +# CellSite #1 Network +TOPO_CS1_UUID = 'CS1' +TOPO_CS1_ID = json_topology_id(TOPO_CS1_UUID, context_id=CONTEXT_ID) +TOPO_CS1 = json_topology(TOPO_CS1_UUID, context_id=CONTEXT_ID) + +# CellSite #2 Network +TOPO_CS2_UUID = 'CS2' +TOPO_CS2_ID = json_topology_id(TOPO_CS2_UUID, context_id=CONTEXT_ID) +TOPO_CS2 = json_topology(TOPO_CS2_UUID, context_id=CONTEXT_ID) + +# Transport Network Network +TOPO_TN_UUID = 'TN' +TOPO_TN_ID = json_topology_id(TOPO_TN_UUID, context_id=CONTEXT_ID) +TOPO_TN = json_topology(TOPO_TN_UUID, context_id=CONTEXT_ID) + + +# ----- Devices -------------------------------------------------------------------------------------------------------- +# DataCenters +DEV_DC1GW_ID, DEV_DC1GW_EPS, DEV_DC1GW = compose_datacenter('DC1-GW', ['eth1', 'eth2', 'int']) +DEV_DC2GW_ID, DEV_DC2GW_EPS, DEV_DC2GW = compose_datacenter('DC2-GW', ['eth1', 'eth2', 'int']) + +# CellSites +DEV_CS1GW1_ID, DEV_CS1GW1_EPS, DEV_CS1GW1 = compose_router('CS1-GW1', ['10/1', '1/1', '1/2']) +DEV_CS1GW2_ID, DEV_CS1GW2_EPS, DEV_CS1GW2 = compose_router('CS1-GW2', ['10/1', '1/1', '1/2']) +DEV_CS2GW1_ID, DEV_CS2GW1_EPS, DEV_CS2GW1 = compose_router('CS2-GW1', ['10/1', '1/1', '1/2']) +DEV_CS2GW2_ID, DEV_CS2GW2_EPS, DEV_CS2GW2 = compose_router('CS2-GW2', ['10/1', '1/1', '1/2']) + +# Transport Network +DEV_TNR1_ID, DEV_TNR1_EPS, DEV_TNR1 = compose_router('TN-R1', ['1/1', '1/2', '2/1', '2/2', '2/3']) +DEV_TNR2_ID, DEV_TNR2_EPS, DEV_TNR2 = compose_router('TN-R2', ['1/1', '1/2', '2/1', '2/2', '2/3']) +DEV_TNR3_ID, DEV_TNR3_EPS, DEV_TNR3 = compose_router('TN-R3', ['1/1', '1/2', '2/1', '2/2', '2/3']) +DEV_TNR4_ID, DEV_TNR4_EPS, DEV_TNR4 = compose_router('TN-R4', ['1/1', '1/2', '2/1', '2/2', '2/3']) + + +# ----- Links ---------------------------------------------------------------------------------------------------------- +# InterDomain DC-CSGW +LINK_DC1GW_CS1GW1_ID, LINK_DC1GW_CS1GW1 = compose_link(DEV_DC1GW_EPS[0], DEV_CS1GW1_EPS[0]) +LINK_DC1GW_CS1GW2_ID, LINK_DC1GW_CS1GW2 = compose_link(DEV_DC1GW_EPS[1], DEV_CS1GW2_EPS[0]) +LINK_DC2GW_CS2GW1_ID, LINK_DC2GW_CS2GW1 = compose_link(DEV_DC2GW_EPS[0], DEV_CS2GW1_EPS[0]) +LINK_DC2GW_CS2GW2_ID, LINK_DC2GW_CS2GW2 = compose_link(DEV_DC2GW_EPS[1], DEV_CS2GW2_EPS[0]) + +# InterDomain CSGW-TN +LINK_CS1GW1_TNR1_ID, LINK_CS1GW1_TNR1 = compose_link(DEV_CS1GW1_EPS[1], DEV_TNR1_EPS[0]) +LINK_CS1GW2_TNR2_ID, LINK_CS1GW2_TNR2 = compose_link(DEV_CS1GW2_EPS[1], DEV_TNR2_EPS[0]) +LINK_CS1GW1_TNR2_ID, LINK_CS1GW1_TNR2 = compose_link(DEV_CS1GW1_EPS[2], DEV_TNR2_EPS[1]) +LINK_CS1GW2_TNR1_ID, LINK_CS1GW2_TNR1 = compose_link(DEV_CS1GW2_EPS[2], DEV_TNR1_EPS[1]) +LINK_CS2GW1_TNR3_ID, LINK_CS2GW1_TNR3 = compose_link(DEV_CS2GW1_EPS[1], DEV_TNR3_EPS[0]) +LINK_CS2GW2_TNR4_ID, LINK_CS2GW2_TNR4 = compose_link(DEV_CS2GW2_EPS[1], DEV_TNR4_EPS[0]) +LINK_CS2GW1_TNR4_ID, LINK_CS2GW1_TNR4 = compose_link(DEV_CS2GW1_EPS[2], DEV_TNR4_EPS[1]) +LINK_CS2GW2_TNR3_ID, LINK_CS2GW2_TNR3 = compose_link(DEV_CS2GW2_EPS[2], DEV_TNR3_EPS[1]) + +# IntraDomain TN +LINK_TNR1_TNR2_ID, LINK_TNR1_TNR2 = compose_link(DEV_TNR1_EPS[2], DEV_TNR2_EPS[3]) +LINK_TNR2_TNR3_ID, LINK_TNR2_TNR3 = compose_link(DEV_TNR2_EPS[2], DEV_TNR3_EPS[3]) +LINK_TNR3_TNR4_ID, LINK_TNR3_TNR4 = compose_link(DEV_TNR3_EPS[2], DEV_TNR4_EPS[3]) +LINK_TNR4_TNR1_ID, LINK_TNR4_TNR1 = compose_link(DEV_TNR4_EPS[2], DEV_TNR1_EPS[3]) +LINK_TNR1_TNR3_ID, LINK_TNR1_TNR3 = compose_link(DEV_TNR1_EPS[4], DEV_TNR3_EPS[4]) +LINK_TNR2_TNR4_ID, LINK_TNR2_TNR4 = compose_link(DEV_TNR2_EPS[4], DEV_TNR4_EPS[4]) + + +# ----- Service -------------------------------------------------------------------------------------------------------- +SERVICE_DC1GW_DC2GW = compose_service(DEV_DC1GW_EPS[2], DEV_DC2GW_EPS[2], constraints=[ + json_constraint_custom('bandwidth[gbps]', 10.0), + json_constraint_custom('latency[ms]', 20.0), +]) + +# ----- Containers ----------------------------------------------------------------------------------------------------- +CONTEXTS = [ CONTEXT ] +TOPOLOGIES = [ TOPO_ADMIN, TOPO_DC1, TOPO_DC2, TOPO_CS1, TOPO_CS2, TOPO_TN ] +DEVICES = [ DEV_DC1GW, DEV_DC2GW, + DEV_CS1GW1, DEV_CS1GW2, DEV_CS2GW1, DEV_CS2GW2, + DEV_TNR1, DEV_TNR2, DEV_TNR3, DEV_TNR4, + ] +LINKS = [ LINK_DC1GW_CS1GW1, LINK_DC1GW_CS1GW2, LINK_DC2GW_CS2GW1, LINK_DC2GW_CS2GW2, + LINK_CS1GW1_TNR1, LINK_CS1GW2_TNR2, LINK_CS1GW1_TNR2, LINK_CS1GW2_TNR1, + LINK_CS2GW1_TNR3, LINK_CS2GW2_TNR4, LINK_CS2GW1_TNR4, LINK_CS2GW2_TNR3, + LINK_TNR1_TNR2, LINK_TNR2_TNR3, LINK_TNR3_TNR4, LINK_TNR4_TNR1, LINK_TNR1_TNR3, LINK_TNR2_TNR4, + ] +SERVICES = [ SERVICE_DC1GW_DC2GW ] + +OBJECTS_PER_TOPOLOGY = [ + (TOPO_ADMIN_ID, + [ DEV_DC1GW_ID, DEV_DC2GW_ID, + DEV_CS1GW1_ID, DEV_CS1GW2_ID, DEV_CS2GW1_ID, DEV_CS2GW2_ID, + DEV_TNR1_ID, DEV_TNR2_ID, DEV_TNR3_ID, DEV_TNR4_ID, + ], + [ LINK_DC1GW_CS1GW1_ID, LINK_DC1GW_CS1GW2_ID, LINK_DC2GW_CS2GW1_ID, LINK_DC2GW_CS2GW2_ID, + LINK_CS1GW1_TNR1_ID, LINK_CS1GW2_TNR2_ID, LINK_CS1GW1_TNR2_ID, LINK_CS1GW2_TNR1_ID, + LINK_CS2GW1_TNR3_ID, LINK_CS2GW2_TNR4_ID, LINK_CS2GW1_TNR4_ID, LINK_CS2GW2_TNR3_ID, + LINK_TNR1_TNR2_ID, LINK_TNR2_TNR3_ID, LINK_TNR3_TNR4_ID, LINK_TNR4_TNR1_ID, LINK_TNR1_TNR3_ID, + LINK_TNR2_TNR4_ID, + ], + ), + (TOPO_DC1_ID, + [DEV_DC1GW_ID], + []), + (TOPO_DC2_ID, + [DEV_DC2GW_ID], + []), + (TOPO_CS1_ID, + [DEV_CS1GW1_ID, DEV_CS1GW2_ID], + []), + (TOPO_CS2_ID, + [DEV_CS2GW1_ID, DEV_CS2GW2_ID], + []), + (TOPO_TN_ID, + [ DEV_TNR1_ID, DEV_TNR2_ID, DEV_TNR3_ID, DEV_TNR4_ID, + ], + [ LINK_TNR1_TNR2_ID, LINK_TNR2_TNR3_ID, LINK_TNR3_TNR4_ID, LINK_TNR4_TNR1_ID, LINK_TNR1_TNR3_ID, + LINK_TNR2_TNR4_ID, + ]), +] diff --git a/src/pathcomp/frontend/tests/Objects_DC_CSGW_TN_OLS.py b/src/pathcomp/frontend/tests/Objects_DC_CSGW_TN_OLS.py new file mode 100644 index 0000000000000000000000000000000000000000..8f6e88719f4019edbeea36c7b4a641fbd7abbea4 --- /dev/null +++ b/src/pathcomp/frontend/tests/Objects_DC_CSGW_TN_OLS.py @@ -0,0 +1,202 @@ +# 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 uuid +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.tools.object_factory.Constraint import json_constraint_custom +from common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Device import ( + json_device_emulated_connect_rules, json_device_emulated_datacenter_disabled, + json_device_emulated_packet_router_disabled, json_device_emulated_tapi_disabled, json_device_id) +from common.tools.object_factory.EndPoint import json_endpoints +from common.tools.object_factory.Link import get_link_uuid, json_link, json_link_id +from common.tools.object_factory.Service import get_service_uuid, json_service_l3nm_planned +from common.tools.object_factory.Topology import json_topology, json_topology_id + +# if true, Device component is present and will infeer the endpoints from connect-rules +# if false, Device component is not present and device objects must contain preconfigured endpoints +ADD_CONNECT_RULES_TO_DEVICES = False + +def compose_router(device_uuid, endpoint_uuids, topology_id=None): + device_id = json_device_id(device_uuid) + r_endpoints = [(endpoint_uuid, 'copper', []) for endpoint_uuid in endpoint_uuids] + config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] + endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) + j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints + device = json_device_emulated_packet_router_disabled(device_uuid, config_rules=config_rules, endpoints=j_endpoints) + return device_id, endpoints, device + +def compose_ols(device_uuid, endpoint_uuids, topology_id=None): + device_id = json_device_id(device_uuid) + r_endpoints = [(endpoint_uuid, 'optical', []) for endpoint_uuid in endpoint_uuids] + config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] + endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) + j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints + device = json_device_emulated_tapi_disabled(device_uuid, config_rules=config_rules, endpoints=j_endpoints) + return device_id, endpoints, device + +def compose_datacenter(device_uuid, endpoint_uuids, topology_id=None): + device_id = json_device_id(device_uuid) + r_endpoints = [(endpoint_uuid, 'copper', []) for endpoint_uuid in endpoint_uuids] + config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] + endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) + j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints + device = json_device_emulated_datacenter_disabled(device_uuid, config_rules=config_rules, endpoints=j_endpoints) + return device_id, endpoints, device + +def compose_link(endpoint_a, endpoint_z): + link_uuid = get_link_uuid(endpoint_a['endpoint_id'], endpoint_z['endpoint_id']) + link_id = json_link_id(link_uuid) + link = json_link(link_uuid, [endpoint_a['endpoint_id'], endpoint_z['endpoint_id']]) + return link_id, link + +def compose_service(endpoint_a, endpoint_z, constraints=[]): + service_uuid = get_service_uuid(endpoint_a['endpoint_id'], endpoint_z['endpoint_id']) + endpoint_ids = [endpoint_a['endpoint_id'], endpoint_z['endpoint_id']] + service = json_service_l3nm_planned(service_uuid, endpoint_ids=endpoint_ids, constraints=constraints) + return service + +# ----- Context -------------------------------------------------------------------------------------------------------- +CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) +CONTEXT = json_context(DEFAULT_CONTEXT_NAME) + +# ----- Domains -------------------------------------------------------------------------------------------------------- +# Overall network topology +TOPO_ADMIN_UUID = DEFAULT_TOPOLOGY_NAME +TOPO_ADMIN_ID = json_topology_id(TOPO_ADMIN_UUID, context_id=CONTEXT_ID) +TOPO_ADMIN = json_topology(TOPO_ADMIN_UUID, context_id=CONTEXT_ID) + +# DataCenter #1 Network +TOPO_DC1_UUID = 'DC1' +TOPO_DC1_ID = json_topology_id(TOPO_DC1_UUID, context_id=CONTEXT_ID) +TOPO_DC1 = json_topology(TOPO_DC1_UUID, context_id=CONTEXT_ID) + +# DataCenter #2 Network +TOPO_DC2_UUID = 'DC2' +TOPO_DC2_ID = json_topology_id(TOPO_DC2_UUID, context_id=CONTEXT_ID) +TOPO_DC2 = json_topology(TOPO_DC2_UUID, context_id=CONTEXT_ID) + +# CellSite #1 Network +TOPO_CS1_UUID = 'CS1' +TOPO_CS1_ID = json_topology_id(TOPO_CS1_UUID, context_id=CONTEXT_ID) +TOPO_CS1 = json_topology(TOPO_CS1_UUID, context_id=CONTEXT_ID) + +# CellSite #2 Network +TOPO_CS2_UUID = 'CS2' +TOPO_CS2_ID = json_topology_id(TOPO_CS2_UUID, context_id=CONTEXT_ID) +TOPO_CS2 = json_topology(TOPO_CS2_UUID, context_id=CONTEXT_ID) + +# Transport Network Network +TOPO_TN_UUID = 'TN' +TOPO_TN_ID = json_topology_id(TOPO_TN_UUID, context_id=CONTEXT_ID) +TOPO_TN = json_topology(TOPO_TN_UUID, context_id=CONTEXT_ID) + + +# ----- Devices -------------------------------------------------------------------------------------------------------- +# DataCenters +DEV_DC1GW_ID, DEV_DC1GW_EPS, DEV_DC1GW = compose_datacenter('DC1-GW', ['eth1', 'eth2', 'int']) +DEV_DC2GW_ID, DEV_DC2GW_EPS, DEV_DC2GW = compose_datacenter('DC2-GW', ['eth1', 'eth2', 'int']) + +# CellSites +DEV_CS1GW1_ID, DEV_CS1GW1_EPS, DEV_CS1GW1 = compose_router('CS1-GW1', ['10/1', '1/1', '1/2']) +DEV_CS1GW2_ID, DEV_CS1GW2_EPS, DEV_CS1GW2 = compose_router('CS1-GW2', ['10/1', '1/1', '1/2']) +DEV_CS2GW1_ID, DEV_CS2GW1_EPS, DEV_CS2GW1 = compose_router('CS2-GW1', ['10/1', '1/1', '1/2']) +DEV_CS2GW2_ID, DEV_CS2GW2_EPS, DEV_CS2GW2 = compose_router('CS2-GW2', ['10/1', '1/1', '1/2']) + +# Transport Network +DEV_TNR1_ID, DEV_TNR1_EPS, DEV_TNR1 = compose_router('TN-R1', ['1/1', '1/2', '2/1']) +DEV_TNR2_ID, DEV_TNR2_EPS, DEV_TNR2 = compose_router('TN-R2', ['1/1', '1/2', '2/1']) +DEV_TNR3_ID, DEV_TNR3_EPS, DEV_TNR3 = compose_router('TN-R3', ['1/1', '1/2', '2/1']) +DEV_TNR4_ID, DEV_TNR4_EPS, DEV_TNR4 = compose_router('TN-R4', ['1/1', '1/2', '2/1']) +tols_ep_uuids = [str(uuid.uuid4()).split('-')[-1] for _ in range(4)] +DEV_TOLS_ID, DEV_TOLS_EPS, DEV_TOLS = compose_ols('TN-OLS', tols_ep_uuids) + + +# ----- Links ---------------------------------------------------------------------------------------------------------- +# InterDomain DC-CSGW +LINK_DC1GW_CS1GW1_ID, LINK_DC1GW_CS1GW1 = compose_link(DEV_DC1GW_EPS[0], DEV_CS1GW1_EPS[0]) +LINK_DC1GW_CS1GW2_ID, LINK_DC1GW_CS1GW2 = compose_link(DEV_DC1GW_EPS[1], DEV_CS1GW2_EPS[0]) +LINK_DC2GW_CS2GW1_ID, LINK_DC2GW_CS2GW1 = compose_link(DEV_DC2GW_EPS[0], DEV_CS2GW1_EPS[0]) +LINK_DC2GW_CS2GW2_ID, LINK_DC2GW_CS2GW2 = compose_link(DEV_DC2GW_EPS[1], DEV_CS2GW2_EPS[0]) + +# InterDomain CSGW-TN +LINK_CS1GW1_TNR1_ID, LINK_CS1GW1_TNR1 = compose_link(DEV_CS1GW1_EPS[1], DEV_TNR1_EPS[0]) +LINK_CS1GW2_TNR2_ID, LINK_CS1GW2_TNR2 = compose_link(DEV_CS1GW2_EPS[1], DEV_TNR2_EPS[0]) +LINK_CS1GW1_TNR2_ID, LINK_CS1GW1_TNR2 = compose_link(DEV_CS1GW1_EPS[2], DEV_TNR2_EPS[1]) +LINK_CS1GW2_TNR1_ID, LINK_CS1GW2_TNR1 = compose_link(DEV_CS1GW2_EPS[2], DEV_TNR1_EPS[1]) +LINK_CS2GW1_TNR3_ID, LINK_CS2GW1_TNR3 = compose_link(DEV_CS2GW1_EPS[1], DEV_TNR3_EPS[0]) +LINK_CS2GW2_TNR4_ID, LINK_CS2GW2_TNR4 = compose_link(DEV_CS2GW2_EPS[1], DEV_TNR4_EPS[0]) +LINK_CS2GW1_TNR4_ID, LINK_CS2GW1_TNR4 = compose_link(DEV_CS2GW1_EPS[2], DEV_TNR4_EPS[1]) +LINK_CS2GW2_TNR3_ID, LINK_CS2GW2_TNR3 = compose_link(DEV_CS2GW2_EPS[2], DEV_TNR3_EPS[1]) + +# IntraDomain TN +LINK_TNR1_TOLS_ID, LINK_TNR1_TOLS = compose_link(DEV_TNR1_EPS[2], DEV_TOLS_EPS[0]) +LINK_TNR2_TOLS_ID, LINK_TNR2_TOLS = compose_link(DEV_TNR2_EPS[2], DEV_TOLS_EPS[1]) +LINK_TNR3_TOLS_ID, LINK_TNR3_TOLS = compose_link(DEV_TNR3_EPS[2], DEV_TOLS_EPS[2]) +LINK_TNR4_TOLS_ID, LINK_TNR4_TOLS = compose_link(DEV_TNR4_EPS[2], DEV_TOLS_EPS[3]) + + +# ----- Service -------------------------------------------------------------------------------------------------------- +SERVICE_DC1GW_DC2GW = compose_service(DEV_DC1GW_EPS[2], DEV_DC2GW_EPS[2], constraints=[ + json_constraint_custom('bandwidth[gbps]', 10.0), + json_constraint_custom('latency[ms]', 20.0), +]) + +# ----- Containers ----------------------------------------------------------------------------------------------------- +CONTEXTS = [ CONTEXT ] +TOPOLOGIES = [ TOPO_ADMIN, TOPO_DC1, TOPO_DC2, TOPO_CS1, TOPO_CS2, TOPO_TN ] +DEVICES = [ DEV_DC1GW, DEV_DC2GW, + DEV_CS1GW1, DEV_CS1GW2, DEV_CS2GW1, DEV_CS2GW2, + DEV_TNR1, DEV_TNR2, DEV_TNR3, DEV_TNR4, + DEV_TOLS, + ] +LINKS = [ LINK_DC1GW_CS1GW1, LINK_DC1GW_CS1GW2, LINK_DC2GW_CS2GW1, LINK_DC2GW_CS2GW2, + LINK_CS1GW1_TNR1, LINK_CS1GW2_TNR2, LINK_CS1GW1_TNR2, LINK_CS1GW2_TNR1, + LINK_CS2GW1_TNR3, LINK_CS2GW2_TNR4, LINK_CS2GW1_TNR4, LINK_CS2GW2_TNR3, + LINK_TNR1_TOLS, LINK_TNR2_TOLS, LINK_TNR3_TOLS, LINK_TNR4_TOLS, + ] +SERVICES = [ SERVICE_DC1GW_DC2GW ] + +OBJECTS_PER_TOPOLOGY = [ + (TOPO_ADMIN_ID, + [ DEV_DC1GW_ID, DEV_DC2GW_ID, + DEV_CS1GW1_ID, DEV_CS1GW2_ID, DEV_CS2GW1_ID, DEV_CS2GW2_ID, + DEV_TNR1_ID, DEV_TNR2_ID, DEV_TNR3_ID, DEV_TNR4_ID, + DEV_TOLS_ID, + ], + [ LINK_DC1GW_CS1GW1_ID, LINK_DC1GW_CS1GW2_ID, LINK_DC2GW_CS2GW1_ID, LINK_DC2GW_CS2GW2_ID, + LINK_CS1GW1_TNR1_ID, LINK_CS1GW2_TNR2_ID, LINK_CS1GW1_TNR2_ID, LINK_CS1GW2_TNR1_ID, + LINK_CS2GW1_TNR3_ID, LINK_CS2GW2_TNR4_ID, LINK_CS2GW1_TNR4_ID, LINK_CS2GW2_TNR3_ID, + LINK_TNR1_TOLS_ID, LINK_TNR2_TOLS_ID, LINK_TNR3_TOLS_ID, LINK_TNR4_TOLS_ID, + ], + ), + (TOPO_DC1_ID, + [DEV_DC1GW_ID], + []), + (TOPO_DC2_ID, + [DEV_DC2GW_ID], + []), + (TOPO_CS1_ID, + [DEV_CS1GW1_ID, DEV_CS1GW2_ID], + []), + (TOPO_CS2_ID, + [DEV_CS2GW1_ID, DEV_CS2GW2_ID], + []), + (TOPO_TN_ID, + [ DEV_TNR1_ID, DEV_TNR2_ID, DEV_TNR3_ID, DEV_TNR4_ID, + DEV_TOLS_ID, + ], + [ LINK_TNR1_TOLS_ID, LINK_TNR2_TOLS_ID, LINK_TNR3_TOLS_ID, LINK_TNR4_TOLS_ID, + ]), +] diff --git a/src/pathcomp/frontend/tests/PrepareTestScenario.py b/src/pathcomp/frontend/tests/PrepareTestScenario.py new file mode 100644 index 0000000000000000000000000000000000000000..387f6aedef1a88559f974a0b792ac1499d42a3f7 --- /dev/null +++ b/src/pathcomp/frontend/tests/PrepareTestScenario.py @@ -0,0 +1,56 @@ +# 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 pytest, os +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_service_port_grpc) +from context.client.ContextClient import ContextClient +from pathcomp.frontend.client.PathCompClient import PathCompClient +from pathcomp.frontend.service.PathCompService import PathCompService +from pathcomp.frontend.tests.MockService_Dependencies import MockService_Dependencies + +LOCAL_HOST = '127.0.0.1' +MOCKSERVICE_PORT = 10000 +PATHCOMP_SERVICE_PORT = MOCKSERVICE_PORT + int(get_service_port_grpc(ServiceNameEnum.PATHCOMP)) # avoid privileged ports +os.environ[get_env_var_name(ServiceNameEnum.PATHCOMP, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.PATHCOMP, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(PATHCOMP_SERVICE_PORT) + +@pytest.fixture(scope='session') +def mock_service(): + _service = MockService_Dependencies(MOCKSERVICE_PORT) + _service.configure_env_vars() + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def context_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name + _client = ContextClient() + yield _client + _client.close() + +@pytest.fixture(scope='session') +def pathcomp_service(context_client : ContextClient): # pylint: disable=redefined-outer-name + + _service = PathCompService() + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def pathcomp_client(pathcomp_service : PathCompService): # pylint: disable=redefined-outer-name + _client = PathCompClient() + yield _client + _client.close() diff --git a/src/pathcomp/frontend/tests/__init__.py b/src/pathcomp/frontend/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/pathcomp/frontend/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/pathcomp/frontend/tests/test_unitary.py b/src/pathcomp/frontend/tests/test_unitary.py new file mode 100644 index 0000000000000000000000000000000000000000..fd14c8a7aed4ec6e1a1c73aaa9425008abe7db60 --- /dev/null +++ b/src/pathcomp/frontend/tests/test_unitary.py @@ -0,0 +1,275 @@ +# 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, os +from common.proto.context_pb2 import Context, ContextId, DeviceId, Link, LinkId, Topology, Device, TopologyId +from common.proto.pathcomp_pb2 import PathCompRequest +from common.tools.grpc.Tools import grpc_message_to_json +from common.tools.object_factory.Constraint import ( + json_constraint_custom, json_constraint_endpoint_location_region, json_constraint_endpoint_priority, + json_constraint_sla_availability) +from common.tools.object_factory.Device import json_device_id +from common.tools.object_factory.EndPoint import json_endpoint_id +from common.tools.object_factory.Service import json_service_l3nm_planned +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from pathcomp.frontend.client.PathCompClient import PathCompClient + +# Scenarios: +#from .Objects_A_B_C import CONTEXTS, DEVICES, LINKS, OBJECTS_PER_TOPOLOGY, SERVICES, TOPOLOGIES +#from .Objects_DC_CSGW_TN import CONTEXTS, DEVICES, LINKS, OBJECTS_PER_TOPOLOGY, SERVICES, TOPOLOGIES +from .Objects_DC_CSGW_TN_OLS import CONTEXTS, DEVICES, LINKS, OBJECTS_PER_TOPOLOGY, SERVICES, TOPOLOGIES + +# configure backend environment variables before overwriting them with fixtures to use real backend pathcomp +DEFAULT_PATHCOMP_BACKEND_SCHEME = 'http' +DEFAULT_PATHCOMP_BACKEND_HOST = '127.0.0.1' +DEFAULT_PATHCOMP_BACKEND_PORT = '8081' +DEFAULT_PATHCOMP_BACKEND_BASEURL = '/pathComp/api/v1/compRoute' + +os.environ['PATHCOMP_BACKEND_SCHEME'] = os.environ.get('PATHCOMP_BACKEND_SCHEME', DEFAULT_PATHCOMP_BACKEND_SCHEME) +os.environ['PATHCOMP_BACKEND_BASEURL'] = os.environ.get('PATHCOMP_BACKEND_BASEURL', DEFAULT_PATHCOMP_BACKEND_BASEURL) + +# Find IP:port of backend container as follows: +# - first check env vars PATHCOMP_BACKEND_HOST & PATHCOMP_BACKEND_PORT +# - if not set, check env vars PATHCOMPSERVICE_SERVICE_HOST & PATHCOMPSERVICE_SERVICE_PORT_HTTP +# - if not set, use DEFAULT_PATHCOMP_BACKEND_HOST & DEFAULT_PATHCOMP_BACKEND_PORT +backend_host = DEFAULT_PATHCOMP_BACKEND_HOST +backend_host = os.environ.get('PATHCOMPSERVICE_SERVICE_HOST', backend_host) +os.environ['PATHCOMP_BACKEND_HOST'] = os.environ.get('PATHCOMP_BACKEND_HOST', backend_host) + +backend_port = DEFAULT_PATHCOMP_BACKEND_PORT +backend_port = os.environ.get('PATHCOMPSERVICE_SERVICE_PORT_HTTP', backend_port) +os.environ['PATHCOMP_BACKEND_PORT'] = os.environ.get('PATHCOMP_BACKEND_PORT', backend_port) + +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, pathcomp_service, context_client, pathcomp_client) + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +def test_prepare_environment( + context_client : ContextClient): # pylint: disable=redefined-outer-name + + for context in CONTEXTS : context_client.SetContext (Context (**context )) + for topology in TOPOLOGIES: context_client.SetTopology(Topology(**topology)) + for device in DEVICES : context_client.SetDevice (Device (**device )) + for link in LINKS : context_client.SetLink (Link (**link )) + + for topology_id, device_ids, link_ids in OBJECTS_PER_TOPOLOGY: + topology = Topology() + topology.CopyFrom(context_client.GetTopology(TopologyId(**topology_id))) + + device_ids_in_topology = {device_id.device_uuid.uuid for device_id in topology.device_ids} + func_device_id_not_added = lambda device_id: device_id['device_uuid']['uuid'] not in device_ids_in_topology + func_device_id_json_to_grpc = lambda device_id: DeviceId(**device_id) + device_ids_to_add = list(map(func_device_id_json_to_grpc, filter(func_device_id_not_added, device_ids))) + topology.device_ids.extend(device_ids_to_add) + + link_ids_in_topology = {link_id.link_uuid.uuid for link_id in topology.link_ids} + func_link_id_not_added = lambda link_id: link_id['link_uuid']['uuid'] not in link_ids_in_topology + func_link_id_json_to_grpc = lambda link_id: LinkId(**link_id) + link_ids_to_add = list(map(func_link_id_json_to_grpc, filter(func_link_id_not_added, link_ids))) + topology.link_ids.extend(link_ids_to_add) + + context_client.SetTopology(topology) + +def test_request_service_shortestpath( + pathcomp_client : PathCompClient): # pylint: disable=redefined-outer-name + + request_services = copy.deepcopy(SERVICES) + #request_services[0]['service_constraints'] = [ + # json_constraint_custom('bandwidth[gbps]', 1000.0), + # json_constraint_custom('latency[ms]', 1200.0), + #] + pathcomp_request = PathCompRequest(services=request_services) + pathcomp_request.shortest_path.Clear() # hack to select the shortest path algorithm that has no attributes + + pathcomp_reply = pathcomp_client.Compute(pathcomp_request) + + pathcomp_reply = grpc_message_to_json(pathcomp_reply) + reply_services = pathcomp_reply['services'] + reply_connections = pathcomp_reply['connections'] + assert len(request_services) <= len(reply_services) + request_service_ids = { + '{:s}/{:s}'.format( + svc['service_id']['context_id']['context_uuid']['uuid'], + svc['service_id']['service_uuid']['uuid'] + ) + for svc in request_services + } + reply_service_ids = { + '{:s}/{:s}'.format( + svc['service_id']['context_id']['context_uuid']['uuid'], + svc['service_id']['service_uuid']['uuid'] + ) + for svc in reply_services + } + # Assert all requested services have a reply + # It permits having other services not requested (i.e., sub-services) + assert len(request_service_ids.difference(reply_service_ids)) == 0 + + reply_connection_service_ids = { + '{:s}/{:s}'.format( + conn['service_id']['context_id']['context_uuid']['uuid'], + conn['service_id']['service_uuid']['uuid'] + ) + for conn in reply_connections + } + # Assert all requested services have a connection associated + # It permits having other connections not requested (i.e., connections for sub-services) + assert len(request_service_ids.difference(reply_connection_service_ids)) == 0 + + # TODO: implement other checks. examples: + # - request service and reply service endpoints match + # - request service and reply connection endpoints match + # - reply sub-service and reply sub-connection endpoints match + # - others? + #for json_service,json_connection in zip(json_services, json_connections): + + +def test_request_service_kshortestpath( + pathcomp_client : PathCompClient): # pylint: disable=redefined-outer-name + + request_services = SERVICES + pathcomp_request = PathCompRequest(services=request_services) + pathcomp_request.k_shortest_path.k_inspection = 2 #pylint: disable=no-member + pathcomp_request.k_shortest_path.k_return = 2 #pylint: disable=no-member + + pathcomp_reply = pathcomp_client.Compute(pathcomp_request) + + pathcomp_reply = grpc_message_to_json(pathcomp_reply) + reply_services = pathcomp_reply['services'] + reply_connections = pathcomp_reply['connections'] + assert len(request_services) <= len(reply_services) + request_service_ids = { + '{:s}/{:s}'.format( + svc['service_id']['context_id']['context_uuid']['uuid'], + svc['service_id']['service_uuid']['uuid'] + ) + for svc in request_services + } + reply_service_ids = { + '{:s}/{:s}'.format( + svc['service_id']['context_id']['context_uuid']['uuid'], + svc['service_id']['service_uuid']['uuid'] + ) + for svc in reply_services + } + # Assert all requested services have a reply + # It permits having other services not requested (i.e., sub-services) + assert len(request_service_ids.difference(reply_service_ids)) == 0 + + reply_connection_service_ids = { + '{:s}/{:s}'.format( + conn['service_id']['context_id']['context_uuid']['uuid'], + conn['service_id']['service_uuid']['uuid'] + ) + for conn in reply_connections + } + # Assert all requested services have a connection associated + # It permits having other connections not requested (i.e., connections for sub-services) + assert len(request_service_ids.difference(reply_connection_service_ids)) == 0 + + # TODO: implement other checks. examples: + # - request service and reply service endpoints match + # - request service and reply connection endpoints match + # - reply sub-service and reply sub-connection endpoints match + # - others? + #for json_service,json_connection in zip(json_services, json_connections): + + +def test_request_service_kdisjointpath( + pathcomp_client : PathCompClient): # pylint: disable=redefined-outer-name + + service_uuid = 'DC1-DC2' + raw_endpoints = [ + ('CS1-GW1', '10/1', 'DC1', 10), + ('CS1-GW2', '10/1', 'DC1', 20), + ('CS2-GW1', '10/1', 'DC2', 10), + ('CS2-GW2', '10/1', 'DC2', 20), + ] + + endpoint_ids, constraints = [], [ + json_constraint_custom('bandwidth[gbps]', 10.0), + json_constraint_custom('latency[ms]', 12.0), + json_constraint_sla_availability(2, True), + json_constraint_custom('diversity', {'end-to-end-diverse': 'all-other-accesses'}), + ] + + for device_uuid, endpoint_uuid, region, priority in raw_endpoints: + device_id = json_device_id(device_uuid) + endpoint_id = json_endpoint_id(device_id, endpoint_uuid) + endpoint_ids.append(endpoint_id) + constraints.extend([ + json_constraint_endpoint_location_region(endpoint_id, region), + json_constraint_endpoint_priority(endpoint_id, priority), + ]) + + service = json_service_l3nm_planned(service_uuid, endpoint_ids=endpoint_ids, constraints=constraints) + request_services = [service] + + pathcomp_request = PathCompRequest(services=request_services) + pathcomp_request.k_disjoint_path.num_disjoint = 2 #pylint: disable=no-member + + pathcomp_reply = pathcomp_client.Compute(pathcomp_request) + + pathcomp_reply = grpc_message_to_json(pathcomp_reply) + reply_services = pathcomp_reply['services'] + reply_connections = pathcomp_reply['connections'] + assert len(request_services) <= len(reply_services) + request_service_ids = { + '{:s}/{:s}'.format( + svc['service_id']['context_id']['context_uuid']['uuid'], + svc['service_id']['service_uuid']['uuid'] + ) + for svc in request_services + } + reply_service_ids = { + '{:s}/{:s}'.format( + svc['service_id']['context_id']['context_uuid']['uuid'], + svc['service_id']['service_uuid']['uuid'] + ) + for svc in reply_services + } + # Assert all requested services have a reply + # It permits having other services not requested (i.e., sub-services) + assert len(request_service_ids.difference(reply_service_ids)) == 0 + + reply_connection_service_ids = { + '{:s}/{:s}'.format( + conn['service_id']['context_id']['context_uuid']['uuid'], + conn['service_id']['service_uuid']['uuid'] + ) + for conn in reply_connections + } + # Assert all requested services have a connection associated + # It permits having other connections not requested (i.e., connections for sub-services) + assert len(request_service_ids.difference(reply_connection_service_ids)) == 0 + + # TODO: implement other checks. examples: + # - request service and reply service endpoints match + # - request service and reply connection endpoints match + # - reply sub-service and reply sub-connection endpoints match + # - others? + #for json_service,json_connection in zip(json_services, json_connections): + + +def test_cleanup_environment( + context_client : ContextClient): # pylint: disable=redefined-outer-name + + for link in LINKS : context_client.RemoveLink (LinkId (**link ['link_id' ])) + for device in DEVICES : context_client.RemoveDevice (DeviceId (**device ['device_id' ])) + for topology in TOPOLOGIES: context_client.RemoveTopology(TopologyId(**topology['topology_id'])) + for context in CONTEXTS : context_client.RemoveContext (ContextId (**context ['context_id' ])) diff --git a/src/pathcomp/misc/example-results-kdisjointpaths.json b/src/pathcomp/misc/example-results-kdisjointpaths.json new file mode 100644 index 0000000000000000000000000000000000000000..9eda25d484e45db53471ea3f655d511cbcc42c18 --- /dev/null +++ b/src/pathcomp/misc/example-results-kdisjointpaths.json @@ -0,0 +1,73 @@ +{ + "connections": [ + { + "connection_id": {"connection_uuid": {"uuid": "d8cb463a-77c4-4149-80fc-32c4842a191d"}}, + "path_hops_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "DC1-GW"}}, "endpoint_uuid": {"uuid": "int"}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "DC1"}}}, + {"device_id": {"device_uuid": {"uuid": "DC1-GW"}}, "endpoint_uuid": {"uuid": "eth1"}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "DC1"}}}, + {"device_id": {"device_uuid": {"uuid": "CS1-GW1"}}, "endpoint_uuid": {"uuid": "200"}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "CS1"}}}, + {"device_id": {"device_uuid": {"uuid": "TN-R2"}}, "endpoint_uuid": {"uuid": "1"}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "TN"}}}, + {"device_id": {"device_uuid": {"uuid": "TN-R3"}}, "endpoint_uuid": {"uuid": "100"}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "TN"}}}, + {"device_id": {"device_uuid": {"uuid": "CS2-GW1"}}, "endpoint_uuid": {"uuid": "1000"}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "CS2"}}}, + {"device_id": {"device_uuid": {"uuid": "DC2-GW"}}, "endpoint_uuid": {"uuid": "int"}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "DC2"}}} + ], + "service_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "service_uuid": {"uuid": "svc:DC1-GW/int==DC2-GW/int"} + }, + "sub_service_ids": [] + }, + { + "connection_id": {"connection_uuid": {"uuid": "9f7c5075-0736-4d2a-8435-b8e8c37fa6ea"}}, + "path_hops_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "DC1-GW"}}, "endpoint_uuid": {"uuid": "int"}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "DC1"}}}, + {"device_id": {"device_uuid": {"uuid": "DC1-GW"}}, "endpoint_uuid": {"uuid": "eth2"}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "DC1"}}}, + {"device_id": {"device_uuid": {"uuid": "CS1-GW2"}}, "endpoint_uuid": {"uuid": "200"}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "CS1"}}}, + {"device_id": {"device_uuid": {"uuid": "TN-R1"}}, "endpoint_uuid": {"uuid": "3"}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "TN"}}}, + {"device_id": {"device_uuid": {"uuid": "TN-R3"}}, "endpoint_uuid": {"uuid": "200"}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "TN"}}}, + {"device_id": {"device_uuid": {"uuid": "CS2-GW2"}}, "endpoint_uuid": {"uuid": "1000"}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "CS2"}}}, + {"device_id": {"device_uuid": {"uuid": "DC2-GW"}}, "endpoint_uuid": {"uuid": "int"}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "DC2"}}} + ], + "service_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "service_uuid": {"uuid": "svc:DC1-GW/int==DC2-GW/int"} + }, + "sub_service_ids": [] + } + ], + "services": [ + { + "service_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "service_uuid": {"uuid": "svc:DC1-GW/int==DC2-GW/int"} + }, + "service_type": "SERVICETYPE_L3NM", + "service_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "DC1-GW"}}, "endpoint_uuid": {"uuid": "int"}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "DC1"}}}, + {"device_id": {"device_uuid": {"uuid": "DC2-GW"}}, "endpoint_uuid": {"uuid": "int"}, + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "DC2"}}} + ], + "service_status": {"service_status": "SERVICESTATUS_PLANNED"}, + "service_constraints": [ + {"custom": {"constraint_type": "bandwidth[gbps]", "constraint_value": "10.0"}}, + {"custom": {"constraint_type": "latency[ms]", "constraint_value": "12.0"}} + ], + "service_config": {"config_rules": []} + } + ] +} \ No newline at end of file diff --git a/src/pathcomp/misc/my_deploy-tests.sh b/src/pathcomp/misc/my_deploy-tests.sh new file mode 100755 index 0000000000000000000000000000000000000000..66564e9a07a6a9ea8eb7cc6ba545c551f614a526 --- /dev/null +++ b/src/pathcomp/misc/my_deploy-tests.sh @@ -0,0 +1,36 @@ +# 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. + +# Set the URL of your local Docker registry where the images will be uploaded to. +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 +# interdomain slice pathcomp dlt +# dbscanserving opticalattackmitigator opticalcentralizedattackdetector +# l3_attackmitigator l3_centralizedattackdetector l3_distributedattackdetector +export TFS_COMPONENTS="context device pathcomp service" + +# Set the tag you want to use for your images. +export TFS_IMAGE_TAG="dev" + +# Set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE="tfs" + +# Set additional manifest files to be applied after the deployment +export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml" + +# Set the neew Grafana admin password +export TFS_GRAFANA_PASSWORD="admin123+" diff --git a/src/pathcomp/misc/test-commands.sh b/src/pathcomp/misc/test-commands.sh new file mode 100755 index 0000000000000000000000000000000000000000..c52b6ce50d761cd2d2d469ad5e55c26bfe84a035 --- /dev/null +++ b/src/pathcomp/misc/test-commands.sh @@ -0,0 +1,33 @@ +#!/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. + +docker build -t "pathcomp-frontend:latest" -f ./src/pathcomp/frontend/Dockerfile . +docker build -t "pathcomp-backend:builder" --target builder -f ./src/pathcomp/backend/Dockerfile . +docker build -t "pathcomp-backend:latest" -f ./src/pathcomp/backend/Dockerfile . +docker build -t "pathcomp-backend:gdb" -f ./src/pathcomp/backend/Dockerfile-gdb . + +docker network create --driver=bridge --subnet=172.28.0.0/24 --gateway=172.28.0.254 tfbr + +docker run --name pathcomp-frontend -d --network=tfbr --ip 172.28.0.1 pathcomp-frontend:latest +docker run --name pathcomp-backend -d --network=tfbr --ip 172.28.0.2 pathcomp-backend:latest + +docker rm -f pathcomp-frontend pathcomp-backend +docker network rm tfbr + +docker images --filter="dangling=true" --quiet | xargs -r docker rmi + +docker exec -i pathcomp bash -c "pytest --log-level=INFO --verbose pathcomp/tests/test_unitary.py" + +./scripts/run_tests_locally-pathcomp-frontend.sh diff --git a/src/policy/.gitlab-ci.yml b/src/policy/.gitlab-ci.yml index 1f855bb18188790697b1adcaa998fe9196d71055..8c326ff16e77e2bfef7e065b1e11921e65ec8e9b 100644 --- a/src/policy/.gitlab-ci.yml +++ b/src/policy/.gitlab-ci.yml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,62 +12,88 @@ # See the License for the specific language governing permissions and # limitations under the License. +variables: + IMAGE_NAME_POLICY: 'policy' + REPORTS_PATH_POLICY: "src/${IMAGE_NAME_POLICY}/reports" + BUILD_ENV_POLICY: build-policy.env + # Package application needed to run tests & build the image on next stage build policy: - variables: - IMAGE_NAME: 'policy' # name of the microservice - IMAGE_NAME_TEST: 'policy-test' # name of the microservice - IMAGE_TAG: '0.1.0' # tag of the container image (production, development, etc) stage: build script: - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/src/main/docker/Dockerfile.multistage.jvm ./src/$IMAGE_NAME/ --target builder + - export IMAGE_TAG=$(grep -m1 '' ./src/$IMAGE_NAME_POLICY/pom.xml | grep -oP '(?<=>).*(?=<)') + - echo "IMAGE_TAG=${IMAGE_TAG}" >> ${BUILD_ENV_POLICY} + - cat ${BUILD_ENV_POLICY} + - docker build -t "$IMAGE_NAME_POLICY:$IMAGE_TAG" -f ./src/$IMAGE_NAME_POLICY/src/main/docker/Dockerfile.multistage.jvm ./src/$IMAGE_NAME_POLICY/ --target builder + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi + artifacts: + reports: + dotenv: ${BUILD_ENV_POLICY} rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: - - src/$IMAGE_NAME/** - - manifests/${IMAGE_NAME}service.yaml + - src/$IMAGE_NAME_POLICY/** + - manifests/${IMAGE_NAME_POLICY}service.yaml - .gitlab-ci.yml # Run tests, build & push the image unit_test policy: variables: - IMAGE_NAME: 'policy' # name of the microservice - IMAGE_NAME_TEST: 'policy-test' # name of the microservice - IMAGE_TAG: '0.1.0' # tag of the container image (production, development, etc) + REPORTS_CONTAINER: "${IMAGE_NAME_POLICY}-reports" stage: unit_test needs: - build policy before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + - docker rm ${REPORTS_CONTAINER} || true script: - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/src/main/docker/Dockerfile.multistage.jvm ./src/$IMAGE_NAME/ --target unit-test - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/src/main/docker/Dockerfile.multistage.jvm ./src/$IMAGE_NAME/ --target release - - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + - echo "Running tests for image ${IMAGE_TAG}" + - docker build -t "$IMAGE_NAME_POLICY:$IMAGE_TAG" -f ./src/$IMAGE_NAME_POLICY/src/main/docker/Dockerfile.multistage.jvm ./src/$IMAGE_NAME_POLICY/ --target unit-test + # Transfer JaCoCo and Surefire reports from within tests image + - docker create --name ${REPORTS_CONTAINER} "$IMAGE_NAME_POLICY:$IMAGE_TAG" + - mkdir -p ${REPORTS_PATH_POLICY} + - docker cp ${REPORTS_CONTAINER}:/app/target/site/jacoco/index.html ${REPORTS_PATH_POLICY}/coverage.html + - docker cp ${REPORTS_CONTAINER}:/app/target/site/jacoco/jacoco.xml ${REPORTS_PATH_POLICY}/jacoco.xml + - docker cp ${REPORTS_CONTAINER}:/app/target/surefire-reports/ ${REPORTS_PATH_POLICY}/ + - cat ${REPORTS_PATH_POLICY}/coverage.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/JaCoCo Coverage Total:/' + - docker run -v "$(pwd)/src/${IMAGE_NAME_POLICY}:/${IMAGE_NAME_POLICY}" --rm registry.gitlab.com/haynes/jacoco2cobertura:1.0.7 python /opt/cover2cover.py ${IMAGE_NAME_POLICY}/reports/jacoco.xml ${IMAGE_NAME_POLICY}/src/main/java > ${REPORTS_PATH_POLICY}/cobertura.xml + # Build final image + - docker build -t "$IMAGE_NAME_POLICY:$IMAGE_TAG" -f ./src/$IMAGE_NAME_POLICY/src/main/docker/Dockerfile.multistage.jvm ./src/$IMAGE_NAME_POLICY/ --target release + - docker tag "$IMAGE_NAME_POLICY:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME_POLICY:$IMAGE_TAG" + - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME_POLICY:$IMAGE_TAG" + after_script: + - docker rm ${REPORTS_CONTAINER} + - docker rm -f "$IMAGE_NAME_POLICY:$IMAGE_TAG" + coverage: '/JaCoCo Coverage Total: ([0-9]{1,3})%/' + artifacts: + reports: + junit: + - ${REPORTS_PATH_POLICY}/surefire-reports/TEST-*.xml rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: - - src/$IMAGE_NAME/** - - manifests/${IMAGE_NAME}service.yaml + - src/$IMAGE_NAME_POLICY/** + - manifests/${IMAGE_NAME_POLICY}service.yaml - .gitlab-ci.yml -# Deployment of policy service in Kubernetes Cluster -deploy policy: - stage: deploy - needs: - - build policy - - unit_test policy - script: - - kubectl version - - kubectl get all - - kubectl delete --ignore-not-found=true -f "manifests/policyservice.yaml" - - kubectl apply -f "manifests/policyservice.yaml" - - kubectl delete pods --selector app=policyservice - - 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)' - when: manual - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - when: manual \ No newline at end of file +## Deployment of policy service in Kubernetes Cluster +#deploy policy: +# stage: deploy +# needs: +# - build policy +# - unit_test policy +# script: +# - kubectl version +# - kubectl get all +# - kubectl delete --ignore-not-found=true -f "manifests/policyservice.yaml" +# - kubectl apply -f "manifests/policyservice.yaml" +# - kubectl delete pods --selector app=policyservice +# - 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)' +# when: manual +# - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' +# when: manual \ No newline at end of file diff --git a/src/policy/README.md b/src/policy/README.md index 4268343577871cf98b9f701a32cd8a1ff4d9a72a..a5ce13c6e68197be7909472c7ff03862909ec059 100644 --- a/src/policy/README.md +++ b/src/policy/README.md @@ -1,19 +1,77 @@ -# Policy Management TeraFlow OS service +# TeraFlowSDN Policy Management service -The Policy Management service is tested on Ubuntu 20.04. Follow the instructions below to build, test, and run this service on your local environment. +This repository hosts the TeraFlowSDN Policy Management service. +Follow the instructions below to build, test, and run this service on your local environment. -## Compile code +## TeraFlowSDN Policy Management service architecture -` +The TeraFlowSDN Policy Management service architecture consists of ten (10) interfaces listed below: + +Interfaces | +|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| 1. The `PolicyGateway` interface that implements all the RPC functions that are described in `policy.proto` file. | +| 2. The `MonitoringGateway` interface that communicates with a `Monitoring` service gRPC client to invoke key RPC functions described in `monitoring.proto` file. | +| 3. The `ContextGateway` interface that communicates with a `Context` service gRPC client to invoke key RPC functions described in `context.proto` file. | +| 4. The `ServiceGateway` interface that communicates with a `Service` service gRPC client to invoke key RPC functions described in `service.proto` file. | +| 5. The `DeviceGateway` interface that communicates with a `Device` service gRPC client to invoke key RPC functions described in `device.proto` file. | +| 6. The `PolicyService` interface that implements the Policy RPC methods by communicating with a `Monitoring` gRPC client, a `Context` gRPC client, a `Service` gRPC client, and a `Device` gRPC client through the `MonitoringService`, `ContextService`, `ServiceService`, and `DeviceService` interfaces respectively. | +| 7. The `MonitoringService` interface that implements the `SetKpiAlarm()` and `GetAlarmResponseStream()` methods by communicating with a `Monitoring` gRPC client through the use of the `MonitoringGateway` interface. | +| 8. The `ContextService` interface that implements the `GetService()`, `GetDevice()`, `GetPolicyRule`, `SetPolicyRule`, and `DeletePolicyRule` methods by communicating with a `Context` gRPC client through the use of the `ContextGateway` interface. | +| 9. The `ServiceService` interface that implements the `UpdateService()` method by communicating with a `Service` gRPC client through the use of the `ServiceGateway` interface. | +| 10. The `DeviceService` interface that implements the `ConfigureDevice()` method by communicating with a `Device` gRPC client through the use of the `DeviceGateway` interface. | + +## Prerequisites + +The TeraFlowSDN Policy Management service is currently tested against Ubuntu 20.04 and Java 11. + +To quickly install Java 11 on a Debian-based Linux distro do: + +```bash +sudo apt-get install openjdk-11-jdk -y +``` + +Feel free to try more recent Java versions. + +## Compile + +```bash ./mvnw compile -` -## Execute unit tests +``` -` +## Run tests + +```bash ./mvnw test -` +``` + ## Run service -` +```bash ./mvnw quarkus:dev -` +```` + +## Clean + +```bash +./mvnw clean +``` + +## Deploying on a Kubernetes cluster + +To create the K8s manifest file under `target/kubernetes/kubernetes.yml` to be used run + +```bash +./mvnw clean package -DskipUTs -DskipITs +``` + +To deploy the application in a K8s cluster run + +```bash +kubectl apply -f "manifests/policyservice.yaml" +``` + +## Maintainers + +This TeraFlowSDN service is implemented by [UBITECH](https://www.ubitech.eu). + +Feel free to contact Georgios Katsikas (gkatsikas at ubitech dot eu) in case you have questions. diff --git a/src/policy/mvnw b/src/policy/mvnw old mode 100755 new mode 100644 diff --git a/src/policy/pom.xml b/src/policy/pom.xml index 02077d79a1649b0531aa7dca09fa08fe806f82b5..6ea28421abedf6916e998b6cfdebe23c34908c4a 100644 --- a/src/policy/pom.xml +++ b/src/policy/pom.xml @@ -1,6 +1,6 @@ '/endpoints/endpoint[172.26.60.243:9]' + node_id_src, tp_id_src = check_endpoint(endpoint_name_src, service_uuid) + node_id_dst, tp_id_dst = check_endpoint(endpoint_name_dst, service_uuid) + + json_config_rule = json_config_rule_set('/services/service[{:s}]'.format(service_uuid), { + 'uuid' : service_uuid, + 'node_id_src': node_id_src, + 'tp_id_src' : tp_id_src, + 'node_id_dst': node_id_dst, + 'tp_id_dst' : tp_id_dst, + 'vlan_id' : vlan_id, + }) + del device_obj.device_config.config_rules[:] + device_obj.device_config.config_rules.append(ConfigRule(**json_config_rule)) + self.__task_executor.configure_device(device_obj) + results.append(True) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Unable to SetEndpoint for Service({:s})'.format(str(service_uuid))) + results.append(e) + + 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]]: + + chk_type('endpoints', endpoints, list) + if len(endpoints) != 2: return [] + + service_uuid = self.__service.service_id.service_uuid.uuid + + results = [] + try: + device_uuid_src, _ = get_device_endpoint_uuids(endpoints[0]) + device_uuid_dst, _ = get_device_endpoint_uuids(endpoints[1]) + + if device_uuid_src != device_uuid_dst: + raise Exception('Diferent Src-Dst devices not supported by now') + device_uuid = device_uuid_src + + device_obj = self.__task_executor.get_device(DeviceId(**json_device_id(device_uuid))) + + json_config_rule = json_config_rule_delete('/services/service[{:s}]'.format(service_uuid), { + 'uuid': service_uuid + }) + del device_obj.device_config.config_rules[:] + device_obj.device_config.config_rules.append(ConfigRule(**json_config_rule)) + self.__task_executor.configure_device(device_obj) + results.append(True) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Unable to DeleteEndpoint for Service({:s})'.format(str(service_uuid))) + results.append(e) + + return results + + @metered_subclass_method(METRICS_POOL) + def SetConstraint(self, constraints : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + 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]]: + 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]]: + chk_type('resources', resources, list) + if len(resources) == 0: return [] + + results = [] + for resource in resources: + try: + resource_value = json.loads(resource[1]) + self.__settings_handler.set(resource[0], resource_value) + results.append(True) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Unable to SetConfig({:s})'.format(str(resource))) + results.append(e) + + return results + + @metered_subclass_method(METRICS_POOL) + def DeleteConfig(self, resources : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: + chk_type('resources', resources, list) + if len(resources) == 0: return [] + + results = [] + for resource in resources: + try: + self.__settings_handler.delete(resource[0]) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Unable to DeleteConfig({:s})'.format(str(resource))) + results.append(e) + + return results diff --git a/src/service/service/service_handlers/microwave/__init__.py b/src/service/service/service_handlers/microwave/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/service/service/service_handlers/microwave/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/service/service/service_handlers/p4/__init__.py b/src/service/service/service_handlers/p4/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..38d04994fb0fa1951fb465bc127eb72659dc2eaf --- /dev/null +++ b/src/service/service/service_handlers/p4/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/src/service/service/service_handlers/p4/p4_service_handler.py b/src/service/service/service_handlers/p4/p4_service_handler.py new file mode 100644 index 0000000000000000000000000000000000000000..500c50378401c016a6cf30c73c78149e2097d2b8 --- /dev/null +++ b/src/service/service/service_handlers/p4/p4_service_handler.py @@ -0,0 +1,305 @@ +# 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 anytree, json, logging +from typing import Any, Dict, List, Optional, Tuple, Union +from common.proto.context_pb2 import ConfigActionEnum, ConfigRule, DeviceId, Service +from common.tools.object_factory.ConfigRule import json_config_rule, 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, chk_length +from service.service.service_handler_api._ServiceHandler import _ServiceHandler +from service.service.service_handler_api.AnyTreeTools import TreeNode, delete_subnode, get_subnode, set_subnode_value +from service.service.task_scheduler.TaskExecutor import TaskExecutor + +LOGGER = logging.getLogger(__name__) + +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 + } + ] + } +) + +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 + + 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[:] + + # One way + rule = create_rule_set(matched_endpoint_uuid, endpoint_uuid) + device.device_config.config_rules.append(ConfigRule(**rule)) + # The other way + rule = create_rule_set(endpoint_uuid, matched_endpoint_uuid) + 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 + + 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[:] + + # One way + rule = create_rule_del(matched_endpoint_uuid, endpoint_uuid) + device.device_config.config_rules.append(ConfigRule(**rule)) + # The other way + rule = create_rule_del(endpoint_uuid, matched_endpoint_uuid) + 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 + + 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))] + + 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))] + + 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))] + + 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/service/service/service_handlers/tapi_tapi/TapiServiceHandler.py b/src/service/service/service_handlers/tapi_tapi/TapiServiceHandler.py index 8406f8f01712cbbd944f2db8c95ac4cd9d48bafe..8abd12b2a24c49a6c5e50cebe7a2d65dc7ce4eb1 100644 --- a/src/service/service/service_handlers/tapi_tapi/TapiServiceHandler.py +++ b/src/service/service/service_handlers/tapi_tapi/TapiServiceHandler.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,60 +12,42 @@ # See the License for the specific language governing permissions and # limitations under the License. -import anytree, json, logging +import json, logging from typing import Any, Dict, List, Optional, Tuple, Union -from common.orm.Database import Database -from common.orm.HighLevel import get_object -from common.orm.backend.Tools import key_to_str +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 context.client.ContextClient import ContextClient -from device.client.DeviceClient import DeviceClient -from device.proto.context_pb2 import Device -from service.service.database.ConfigModel import ORM_ConfigActionEnum, get_config_rules -from service.service.database.ContextModel import ContextModel -from service.service.database.DeviceModel import DeviceModel -from service.service.database.ServiceModel import ServiceModel +from service.service.service_handler_api.Tools import get_device_endpoint_uuids, get_endpoint_matching from service.service.service_handler_api._ServiceHandler import _ServiceHandler -from service.service.service_handler_api.AnyTreeTools import TreeNode, delete_subnode, get_subnode, set_subnode_value -from service.service.service_handlers.Tools import config_rule_set, config_rule_delete +from service.service.service_handler_api.SettingsHandler import SettingsHandler +from service.service.task_scheduler.TaskExecutor import TaskExecutor LOGGER = logging.getLogger(__name__) +METRICS_POOL = MetricsPool('Service', 'Handler', labels={'handler': 'tapi_tapi'}) + class TapiServiceHandler(_ServiceHandler): def __init__( # pylint: disable=super-init-not-called - self, db_service : ServiceModel, database : Database, context_client : ContextClient, - device_client : DeviceClient, **settings + self, service : Service, task_executor : TaskExecutor, **settings ) -> None: - self.__db_service = db_service - self.__database = database - self.__context_client = context_client # pylint: disable=unused-private-member - self.__device_client = device_client - - self.__db_context : ContextModel = get_object(self.__database, ContextModel, self.__db_service.context_fk) - str_service_key = key_to_str([self.__db_context.context_uuid, self.__db_service.service_uuid]) - db_config = get_config_rules(self.__database, str_service_key, 'running') - self.__resolver = anytree.Resolver(pathattr='name') - self.__config = TreeNode('.') - for action, resource_key, resource_value in db_config: - if action == ORM_ConfigActionEnum.SET: - try: - resource_value = json.loads(resource_value) - except: # pylint: disable=bare-except - pass - set_subnode_value(self.__resolver, self.__config, resource_key, resource_value) - elif action == ORM_ConfigActionEnum.DELETE: - delete_subnode(self.__resolver, self.__config, resource_key) - - def SetEndpoint(self, endpoints : List[Tuple[str, str, Optional[str]]]) -> List[Union[bool, Exception]]: + self.__service = service + self.__task_executor = task_executor + self.__settings_handler = SettingsHandler(service.service_config, **settings) + + @metered_subclass_method(METRICS_POOL) + def SetEndpoint( + self, endpoints : List[Tuple[str, str, Optional[str]]], connection_uuid : Optional[str] = None + ) -> List[Union[bool, Exception]]: + chk_type('endpoints', endpoints, list) if len(endpoints) != 2: return [] - service_uuid = self.__db_service.service_uuid - service_settings : TreeNode = get_subnode(self.__resolver, self.__config, 'settings', None) - if service_settings is None: raise Exception('Unable to settings for Service({:s})'.format(str(service_uuid))) - - json_settings : Dict = service_settings.value - capacity_value = json_settings.get('capacity_value', 1) + service_uuid = self.__service.service_id.service_uuid.uuid + settings = self.__settings_handler.get('/settings') + json_settings : Dict = {} if settings is None else settings.value + capacity_value = json_settings.get('capacity_value', 50.0) capacity_unit = json_settings.get('capacity_unit', 'GHz') layer_proto_name = json_settings.get('layer_proto_name', 'PHOTONIC_MEDIA') layer_proto_qual = json_settings.get('layer_proto_qual', 'tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_NMC') @@ -73,24 +55,30 @@ class TapiServiceHandler(_ServiceHandler): results = [] try: - device_uuid = endpoints[0][0] - db_device : DeviceModel = get_object(self.__database, DeviceModel, device_uuid, raise_if_not_found=True) - json_device = db_device.dump(include_config_rules=False, include_drivers=True, include_endpoints=True) - json_device_config : Dict = json_device.setdefault('device_config', {}) - json_device_config_rules : List = json_device_config.setdefault('config_rules', []) - json_device_config_rules.extend([ - config_rule_set('/service[{:s}]'.format(service_uuid), { - 'uuid' : service_uuid, - 'input_sip' : endpoints[0][1], - 'output_sip' : endpoints[1][1], - 'capacity_unit' : capacity_unit, - 'capacity_value' : capacity_value, - 'layer_protocol_name' : layer_proto_name, - 'layer_protocol_qualifier': layer_proto_qual, - 'direction' : direction, - }), - ]) - self.__device_client.ConfigureDevice(Device(**json_device)) + device_uuid_src, endpoint_uuid_src = get_device_endpoint_uuids(endpoints[0]) + device_uuid_dst, endpoint_uuid_dst = get_device_endpoint_uuids(endpoints[1]) + + if device_uuid_src != device_uuid_dst: + raise Exception('Diferent Src-Dst devices not supported by now') + device_uuid = device_uuid_src + + device_obj = self.__task_executor.get_device(DeviceId(**json_device_id(device_uuid))) + endpoint_name_src = get_endpoint_matching(device_obj, endpoint_uuid_src).name + endpoint_name_dst = get_endpoint_matching(device_obj, endpoint_uuid_dst).name + + json_config_rule = json_config_rule_set('/services/service[{:s}]'.format(service_uuid), { + 'uuid' : service_uuid, + 'input_sip' : endpoint_name_src, + 'output_sip' : endpoint_name_dst, + 'capacity_unit' : capacity_unit, + 'capacity_value' : capacity_value, + 'layer_protocol_name' : layer_proto_name, + 'layer_protocol_qualifier': layer_proto_qual, + 'direction' : direction, + }) + del device_obj.device_config.config_rules[:] + device_obj.device_config.config_rules.append(ConfigRule(**json_config_rule)) + self.__task_executor.configure_device(device_obj) results.append(True) except Exception as e: # pylint: disable=broad-except LOGGER.exception('Unable to SetEndpoint for Service({:s})'.format(str(service_uuid))) @@ -98,22 +86,33 @@ class TapiServiceHandler(_ServiceHandler): return results - def DeleteEndpoint(self, endpoints : List[Tuple[str, str, Optional[str]]]) -> List[Union[bool, Exception]]: + @metered_subclass_method(METRICS_POOL) + def DeleteEndpoint( + self, endpoints : List[Tuple[str, str, Optional[str]]], connection_uuid : Optional[str] = None + ) -> List[Union[bool, Exception]]: + chk_type('endpoints', endpoints, list) if len(endpoints) != 2: return [] - service_uuid = self.__db_service.service_uuid + service_uuid = self.__service.service_id.service_uuid.uuid + results = [] try: - device_uuid = endpoints[0][0] - db_device : DeviceModel = get_object(self.__database, DeviceModel, device_uuid, raise_if_not_found=True) - json_device = db_device.dump(include_config_rules=False, include_drivers=True, include_endpoints=True) - json_device_config : Dict = json_device.setdefault('device_config', {}) - json_device_config_rules : List = json_device_config.setdefault('config_rules', []) - json_device_config_rules.extend([ - config_rule_delete('/service[{:s}]'.format(service_uuid), {'uuid': service_uuid}) - ]) - self.__device_client.ConfigureDevice(Device(**json_device)) + device_uuid_src, _ = get_device_endpoint_uuids(endpoints[0]) + device_uuid_dst, _ = get_device_endpoint_uuids(endpoints[1]) + + if device_uuid_src != device_uuid_dst: + raise Exception('Diferent Src-Dst devices not supported by now') + device_uuid = device_uuid_src + + device_obj = self.__task_executor.get_device(DeviceId(**json_device_id(device_uuid))) + + json_config_rule = json_config_rule_delete('/services/service[{:s}]'.format(service_uuid), { + 'uuid': service_uuid + }) + del device_obj.device_config.config_rules[:] + device_obj.device_config.config_rules.append(ConfigRule(**json_config_rule)) + self.__task_executor.configure_device(device_obj) results.append(True) except Exception as e: # pylint: disable=broad-except LOGGER.exception('Unable to DeleteEndpoint for Service({:s})'.format(str(service_uuid))) @@ -121,6 +120,7 @@ class TapiServiceHandler(_ServiceHandler): return results + @metered_subclass_method(METRICS_POOL) def SetConstraint(self, constraints : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: chk_type('constraints', constraints, list) if len(constraints) == 0: return [] @@ -129,6 +129,7 @@ class TapiServiceHandler(_ServiceHandler): 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]]: chk_type('constraints', constraints, list) if len(constraints) == 0: return [] @@ -137,6 +138,7 @@ class TapiServiceHandler(_ServiceHandler): 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]]: chk_type('resources', resources, list) if len(resources) == 0: return [] @@ -144,9 +146,8 @@ class TapiServiceHandler(_ServiceHandler): results = [] for resource in resources: try: - resource_key, resource_value = resource - resource_value = json.loads(resource_value) - set_subnode_value(self.__resolver, self.__config, resource_key, resource_value) + resource_value = json.loads(resource[1]) + self.__settings_handler.set(resource[0], resource_value) results.append(True) except Exception as e: # pylint: disable=broad-except LOGGER.exception('Unable to SetConfig({:s})'.format(str(resource))) @@ -154,6 +155,7 @@ class TapiServiceHandler(_ServiceHandler): return results + @metered_subclass_method(METRICS_POOL) def DeleteConfig(self, resources : List[Tuple[str, Any]]) -> List[Union[bool, Exception]]: chk_type('resources', resources, list) if len(resources) == 0: return [] @@ -161,8 +163,7 @@ class TapiServiceHandler(_ServiceHandler): results = [] for resource in resources: try: - resource_key, _ = resource - delete_subnode(self.__resolver, self.__config, resource_key) + self.__settings_handler.delete(resource[0]) except Exception as e: # pylint: disable=broad-except LOGGER.exception('Unable to DeleteConfig({:s})'.format(str(resource))) results.append(e) diff --git a/src/service/service/service_handlers/tapi_tapi/__init__.py b/src/service/service/service_handlers/tapi_tapi/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/service/service/service_handlers/tapi_tapi/__init__.py +++ b/src/service/service/service_handlers/tapi_tapi/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/service/service/task_scheduler/ConnectionExpander.py b/src/service/service/task_scheduler/ConnectionExpander.py new file mode 100644 index 0000000000000000000000000000000000000000..fa51c36ce4bf9dd9f1dd465e07e804b068ebae57 --- /dev/null +++ b/src/service/service/task_scheduler/ConnectionExpander.py @@ -0,0 +1,66 @@ +# 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 typing import Dict, List, Optional, Tuple +from common.tools.grpc.Tools import grpc_message_to_json_string +from common.proto.context_pb2 import Connection, Empty, EndPointId, Link +from context.client.ContextClient import ContextClient + +class ConnectionExpander: + def __init__(self) -> None: + self.context_client = ContextClient() + self.endpointkey_to_link : Dict[Tuple[str, str], Link] = dict() + self.refresh_links() + + def refresh_links(self) -> None: + links = self.context_client.ListLinks(Empty()) + for link in links.links: + for link_endpoint_id in link.link_endpoint_ids: + device_uuid = link_endpoint_id.device_id.device_uuid.uuid + endpoint_uuid = link_endpoint_id.endpoint_uuid.uuid + endpoint_key = (device_uuid, endpoint_uuid) + self.endpointkey_to_link[endpoint_key] = link + + def get_link_from_endpoint_id(self, endpoint_id : EndPointId, raise_if_not_found : bool = False) -> Optional[Link]: + device_uuid = endpoint_id.device_id.device_uuid.uuid + endpoint_uuid = endpoint_id.endpoint_uuid.uuid + endpoint_key = (device_uuid, endpoint_uuid) + link = self.endpointkey_to_link.get(endpoint_key) + if link is None and raise_if_not_found: + str_endpoint_id = grpc_message_to_json_string(endpoint_id) + raise Exception('Link for Endpoint({:s}) not found'.format(str_endpoint_id)) + return link + + def get_links(self, connection : Connection) -> List[Link]: + path_links = list() + last_link_uuid = None + for endpoint_id in connection.path_hops_endpoint_ids: + link = self.get_link_from_endpoint_id(endpoint_id, raise_if_not_found=True) + link_uuid = link.link_id.link_uuid.uuid + if last_link_uuid is None or last_link_uuid != link_uuid: + path_links.append(link) + last_link_uuid = link_uuid + return path_links + + def get_endpoints_traversed(self, connection : Connection) -> List[EndPointId]: + path_endpoint_ids = list() + last_link_uuid = None + for endpoint_id in connection.path_hops_endpoint_ids: + link = self.get_link_from_endpoint_id(endpoint_id, raise_if_not_found=True) + link_uuid = link.link_id.link_uuid.uuid + if last_link_uuid is None or last_link_uuid != link_uuid: + for link_endpoint_id in link.link_endpoint_ids: + path_endpoint_ids.append(link_endpoint_id) + last_link_uuid = link_uuid + return path_endpoint_ids diff --git a/src/service/service/task_scheduler/TaskExecutor.py b/src/service/service/task_scheduler/TaskExecutor.py new file mode 100644 index 0000000000000000000000000000000000000000..932c56e2b1934e12e7849a60c22d3ca1be7f8093 --- /dev/null +++ b/src/service/service/task_scheduler/TaskExecutor.py @@ -0,0 +1,144 @@ +# 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 enum import Enum +from typing import TYPE_CHECKING, Any, Dict, Optional, Union +from common.method_wrappers.ServiceExceptions import NotFoundException +from common.proto.context_pb2 import Connection, ConnectionId, Device, DeviceId, Service, ServiceId +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from service.service.service_handler_api.ServiceHandlerFactory import ServiceHandlerFactory, get_service_handler_class +from service.service.tools.ContextGetters import get_connection, get_device, get_service +from service.service.tools.ObjectKeys import get_connection_key, get_device_key, get_service_key + +if TYPE_CHECKING: + from service.service.service_handler_api._ServiceHandler import _ServiceHandler + +CacheableObject = Union[Connection, Device, Service] + +class CacheableObjectType(Enum): + CONNECTION = 'connection' + DEVICE = 'device' + SERVICE = 'service' + +class TaskExecutor: + def __init__(self, service_handler_factory : ServiceHandlerFactory) -> None: + self._service_handler_factory = service_handler_factory + self._context_client = ContextClient() + self._device_client = DeviceClient() + self._grpc_objects_cache : Dict[str, CacheableObject] = dict() + + @property + def service_handler_factory(self) -> ServiceHandlerFactory: return self._service_handler_factory + + # ----- Common methods --------------------------------------------------------------------------------------------- + + def _load_grpc_object(self, object_type : CacheableObjectType, object_key : str) -> Optional[CacheableObject]: + object_key = '{:s}:{:s}'.format(object_type.value, object_key) + return self._grpc_objects_cache.get(object_key) + + def _store_grpc_object(self, object_type : CacheableObjectType, object_key : str, grpc_object) -> None: + object_key = '{:s}:{:s}'.format(object_type.value, object_key) + self._grpc_objects_cache[object_key] = grpc_object + + def _delete_grpc_object(self, object_type : CacheableObjectType, object_key : str) -> None: + object_key = '{:s}:{:s}'.format(object_type.value, object_key) + self._grpc_objects_cache.pop(object_key, None) + + def _store_editable_grpc_object( + self, object_type : CacheableObjectType, object_key : str, grpc_class, grpc_ro_object + ) -> Any: + grpc_rw_object = grpc_class() + grpc_rw_object.CopyFrom(grpc_ro_object) + self._store_grpc_object(object_type, object_key, grpc_rw_object) + return grpc_rw_object + + # ----- Connection-related methods --------------------------------------------------------------------------------- + + def get_connection(self, connection_id : ConnectionId) -> Connection: + connection_key = get_connection_key(connection_id) + connection = self._load_grpc_object(CacheableObjectType.CONNECTION, connection_key) + if connection is None: + connection = get_connection(self._context_client, connection_id) + if connection is None: raise NotFoundException('Connection', connection_key) + connection : Connection = self._store_editable_grpc_object( + CacheableObjectType.CONNECTION, connection_key, Connection, connection) + return connection + + def set_connection(self, connection : Connection) -> None: + connection_key = get_connection_key(connection.connection_id) + self._context_client.SetConnection(connection) + self._store_grpc_object(CacheableObjectType.CONNECTION, connection_key, connection) + + def delete_connection(self, connection_id : ConnectionId) -> None: + connection_key = get_connection_key(connection_id) + self._context_client.RemoveConnection(connection_id) + self._delete_grpc_object(CacheableObjectType.CONNECTION, connection_key) + + # ----- Device-related methods ------------------------------------------------------------------------------------- + + def get_device(self, device_id : DeviceId) -> Device: + device_key = get_device_key(device_id) + device = self._load_grpc_object(CacheableObjectType.DEVICE, device_key) + if device is None: + device = get_device(self._context_client, device_id) + if device is None: raise NotFoundException('Device', device_key) + device : Device = self._store_editable_grpc_object( + CacheableObjectType.DEVICE, device_key, Device, device) + return device + + def configure_device(self, device : Device) -> None: + device_key = get_device_key(device.device_id) + self._device_client.ConfigureDevice(device) + self._store_grpc_object(CacheableObjectType.DEVICE, device_key, device) + + def get_devices_from_connection(self, connection : Connection) -> Dict[str, Device]: + devices = dict() + for endpoint_id in connection.path_hops_endpoint_ids: + device = self.get_device(endpoint_id.device_id) + device_uuid = endpoint_id.device_id.device_uuid.uuid + if device is None: raise Exception('Device({:s}) not found'.format(str(device_uuid))) + devices[device_uuid] = device + return devices + + # ----- Service-related methods ------------------------------------------------------------------------------------ + + def get_service(self, service_id : ServiceId) -> Service: + service_key = get_service_key(service_id) + service = self._load_grpc_object(CacheableObjectType.SERVICE, service_key) + if service is None: + service = get_service(self._context_client, service_id) + if service is None: raise NotFoundException('Service', service_key) + service : service = self._store_editable_grpc_object( + CacheableObjectType.SERVICE, service_key, Service, service) + return service + + def set_service(self, service : Service) -> None: + service_key = get_service_key(service.service_id) + self._context_client.SetService(service) + self._store_grpc_object(CacheableObjectType.SERVICE, service_key, service) + + def delete_service(self, service_id : ServiceId) -> None: + service_key = get_service_key(service_id) + self._context_client.RemoveService(service_id) + self._delete_grpc_object(CacheableObjectType.SERVICE, service_key) + + # ----- Service Handler Factory ------------------------------------------------------------------------------------ + + def get_service_handler( + self, connection : Connection, service : Service, **service_handler_settings + ) -> '_ServiceHandler': + connection_devices = self.get_devices_from_connection(connection) + service_handler_class = get_service_handler_class(self._service_handler_factory, service, connection_devices) + return service_handler_class(service, self, **service_handler_settings) diff --git a/src/service/service/task_scheduler/TaskScheduler.py b/src/service/service/task_scheduler/TaskScheduler.py new file mode 100644 index 0000000000000000000000000000000000000000..f55527e4756022fc4941605f54ab82b74c0937f0 --- /dev/null +++ b/src/service/service/task_scheduler/TaskScheduler.py @@ -0,0 +1,212 @@ +# 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 graphlib, logging, queue, time +from typing import TYPE_CHECKING, Dict, Tuple +from common.proto.context_pb2 import Connection, ConnectionId, Service, ServiceId, ServiceStatusEnum +from common.proto.pathcomp_pb2 import PathCompReply +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from service.service.tools.ObjectKeys import get_connection_key, get_service_key +from .tasks._Task import _Task +from .tasks.Task_ConnectionConfigure import Task_ConnectionConfigure +from .tasks.Task_ConnectionDeconfigure import Task_ConnectionDeconfigure +from .tasks.Task_ServiceDelete import Task_ServiceDelete +from .tasks.Task_ServiceSetStatus import Task_ServiceSetStatus +from .TaskExecutor import CacheableObjectType, TaskExecutor + +if TYPE_CHECKING: + from service.service.service_handler_api.ServiceHandlerFactory import ServiceHandlerFactory + +LOGGER = logging.getLogger(__name__) + +class TasksScheduler: + def __init__(self, service_handler_factory : 'ServiceHandlerFactory') -> None: + self._dag = graphlib.TopologicalSorter() + self._executor = TaskExecutor(service_handler_factory) + self._tasks : Dict[str, _Task] = dict() + self._context_client = ContextClient() + + # ----- Helper methods --------------------------------------------------------------------------------------------- + + def _add_task_if_not_exists(self, task : _Task) -> str: + task_key = task.key + if task_key not in self._tasks: + self._tasks[task_key] = task + return task_key + + def _add_connection_to_executor_cache(self, connection : Connection) -> None: + connection_key = get_connection_key(connection.connection_id) + self._executor._store_editable_grpc_object( + CacheableObjectType.CONNECTION, connection_key, Connection, connection) + + def _add_service_to_executor_cache(self, service : Service) -> None: + service_key = get_service_key(service.service_id) + self._executor._store_editable_grpc_object( + CacheableObjectType.SERVICE, service_key, Service, service) + + # ----- Task & DAG composition methods ----------------------------------------------------------------------------- + + def _service_create(self, service_id : ServiceId) -> Tuple[str, str]: + service_planned_key = self._add_task_if_not_exists(Task_ServiceSetStatus( + self._executor, service_id, ServiceStatusEnum.SERVICESTATUS_PLANNED)) + + service_active_key = self._add_task_if_not_exists(Task_ServiceSetStatus( + self._executor, service_id, ServiceStatusEnum.SERVICESTATUS_ACTIVE)) + + # activating a service requires the service is in planning state + self._dag.add(service_active_key, service_planned_key) + return service_planned_key, service_active_key + + def _service_remove(self, service_id : ServiceId) -> Tuple[str, str]: + service_removing_key = self._add_task_if_not_exists(Task_ServiceSetStatus( + self._executor, service_id, ServiceStatusEnum.SERVICESTATUS_PENDING_REMOVAL)) + + service_delete_key = self._add_task_if_not_exists(Task_ServiceDelete(self._executor, service_id)) + + # deleting a service requires the service is in removing state + self._dag.add(service_delete_key, service_removing_key) + return service_removing_key, service_delete_key + + def _connection_configure(self, connection_id : ConnectionId, service_id : ServiceId) -> str: + connection_configure_key = self._add_task_if_not_exists(Task_ConnectionConfigure( + self._executor, connection_id)) + + # the connection configuration depends on its connection's service being in planning state + service_planned_key = self._add_task_if_not_exists(Task_ServiceSetStatus( + self._executor, service_id, ServiceStatusEnum.SERVICESTATUS_PLANNED)) + self._dag.add(connection_configure_key, service_planned_key) + + # the connection's service depends on the connection configuration to transition to active state + service_active_key = self._add_task_if_not_exists(Task_ServiceSetStatus( + self._executor, service_id, ServiceStatusEnum.SERVICESTATUS_ACTIVE)) + self._dag.add(service_active_key, connection_configure_key) + + return connection_configure_key + + def _connection_deconfigure(self, connection_id : ConnectionId, service_id : ServiceId) -> str: + connection_deconfigure_key = self._add_task_if_not_exists(Task_ConnectionDeconfigure( + self._executor, connection_id)) + + # the connection deconfiguration depends on its connection's service being in removing state + service_pending_removal_key = self._add_task_if_not_exists(Task_ServiceSetStatus( + self._executor, service_id, ServiceStatusEnum.SERVICESTATUS_PENDING_REMOVAL)) + self._dag.add(connection_deconfigure_key, service_pending_removal_key) + + # the connection's service depends on the connection deconfiguration to transition to delete + service_delete_key = self._add_task_if_not_exists(Task_ServiceDelete( + self._executor, service_id)) + self._dag.add(service_delete_key, connection_deconfigure_key) + + return connection_deconfigure_key + + def compose_from_pathcompreply(self, pathcomp_reply : PathCompReply, is_delete : bool = False) -> None: + t0 = time.time() + include_service = self._service_remove if is_delete else self._service_create + include_connection = self._connection_deconfigure if is_delete else self._connection_configure + + for service in pathcomp_reply.services: + include_service(service.service_id) + self._add_service_to_executor_cache(service) + + for connection in pathcomp_reply.connections: + connection_key = include_connection(connection.connection_id, connection.service_id) + self._add_connection_to_executor_cache(connection) + self._executor.get_service(connection.service_id) + for sub_service_id in connection.sub_service_ids: + _,service_key_done = include_service(sub_service_id) + self._executor.get_service(sub_service_id) + self._dag.add(connection_key, service_key_done) + + t1 = time.time() + LOGGER.info('[compose_from_pathcompreply] elapsed_time: {:f} sec'.format(t1-t0)) + + def compose_from_service(self, service : Service, is_delete : bool = False) -> None: + t0 = time.time() + include_service = self._service_remove if is_delete else self._service_create + include_connection = self._connection_deconfigure if is_delete else self._connection_configure + + explored_items = set() + pending_items_to_explore = queue.Queue() + pending_items_to_explore.put(service) + + while not pending_items_to_explore.empty(): + try: + item = pending_items_to_explore.get(block=False) + except queue.Empty: + break + + if isinstance(item, Service): + str_item_key = grpc_message_to_json_string(item.service_id) + if str_item_key in explored_items: continue + + include_service(item.service_id) + self._add_service_to_executor_cache(item) + connections = self._context_client.ListConnections(item.service_id) + for connection in connections.connections: + self._add_connection_to_executor_cache(connection) + pending_items_to_explore.put(connection) + + explored_items.add(str_item_key) + + elif isinstance(item, ServiceId): + str_item_key = grpc_message_to_json_string(item) + if str_item_key in explored_items: continue + + include_service(item) + self._executor.get_service(item) + connections = self._context_client.ListConnections(item) + for connection in connections.connections: + self._add_connection_to_executor_cache(connection) + pending_items_to_explore.put(connection) + + explored_items.add(str_item_key) + + elif isinstance(item, Connection): + str_item_key = grpc_message_to_json_string(item.connection_id) + if str_item_key in explored_items: continue + + connection_key = include_connection(item.connection_id, item.service_id) + self._add_connection_to_executor_cache(connection) + + self._executor.get_service(item.service_id) + pending_items_to_explore.put(item.service_id) + + for sub_service_id in item.sub_service_ids: + _,service_key_done = include_service(sub_service_id) + self._executor.get_service(sub_service_id) + self._dag.add(service_key_done, connection_key) + pending_items_to_explore.put(sub_service_id) + + explored_items.add(str_item_key) + + else: + MSG = 'Unsupported item {:s}({:s})' + raise Exception(MSG.format(type(item).__name__, grpc_message_to_json_string(item))) + + t1 = time.time() + LOGGER.info('[compose_from_service] elapsed_time: {:f} sec'.format(t1-t0)) + + def execute_all(self, dry_run : bool = False) -> None: + ordered_task_keys = list(self._dag.static_order()) + LOGGER.info('[execute_all] ordered_task_keys={:s}'.format(str(ordered_task_keys))) + + results = [] + for task_key in ordered_task_keys: + task = self._tasks.get(task_key) + succeeded = True if dry_run else task.execute() + results.append(succeeded) + + LOGGER.info('[execute_all] results={:s}'.format(str(results))) + return zip(ordered_task_keys, results) diff --git a/src/service/service/task_scheduler/__init__.py b/src/service/service/task_scheduler/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9d49eb5e732045445c7e63944bf79229da3c3bcd --- /dev/null +++ b/src/service/service/task_scheduler/__init__.py @@ -0,0 +1,51 @@ +# 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. + +# TaskScheduler is initialized with a PathComputation Reply or a Service, and it collects/identifies the sub-services, +# sub-connections, and operations associated to them. It discovers and takes care of the inter-dependencies among them, +# and produces an ordered list of tasks to be executed to implement the desired create/delete operation on the service. +# E.g., a service cannot be deleted if connections supporting that service still exist. If these connections are +# supported by sub-services, the connection needs to be torn down before destroying the services. +# +# Internally, it composes a Directed Acyclic Graph (DAG) of dependencies between tasks. Each task performs a specific +# operation on a connection or service. The DAG composition is based on information extracted from a PathComp reply +# and/or interrogating the Context component. +# +# Example: +# A B C +# *---L3---*---L3---* +# *--L0--* *--L0--* +# - L3 service between A and C, depends on L3 connections A-B and B-C. +# - Each L3 connection is supported by an L0 service and its corresponding L0 connection. +# +# Dependency structure: +# service L3:A-C +# connection L3:A-B +# service L0:A-B +# connection L0:A-B +# connection L3:B-C +# service L0:B-C +# connection L0:B-C +# +# Resolution: +# - service.set(L3:A-C, state=PLANNING) +# - service.set(L0:A-B, state=PLANNING) +# - connection.configure(L0:A-B) +# - service.set(L0:A-B, state=ACTIVE) +# - connection.configure(L3:A-B) +# - service.set(L0:B-C, state=PLANNING) +# - connection.configure(L0:B-C) +# - service.set(L0:B-C, state=ACTIVE) +# - connection.configure(L3:B-C) +# - service.set(L3:A-C, state=ACTIVE) diff --git a/src/service/service/task_scheduler/tasks/Task_ConnectionConfigure.py b/src/service/service/task_scheduler/tasks/Task_ConnectionConfigure.py new file mode 100644 index 0000000000000000000000000000000000000000..5a47005b304836050dd8c0882214dd9cebd5d8b5 --- /dev/null +++ b/src/service/service/task_scheduler/tasks/Task_ConnectionConfigure.py @@ -0,0 +1,59 @@ +# 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 common.method_wrappers.ServiceExceptions import OperationFailedException +from common.proto.context_pb2 import ConnectionId +from common.tools.grpc.Tools import grpc_message_to_json_string +from service.service.service_handler_api.Tools import check_errors_setendpoint +from service.service.task_scheduler.TaskExecutor import TaskExecutor +from service.service.tools.EndpointIdFormatters import endpointids_to_raw +from service.service.tools.ObjectKeys import get_connection_key +from ._Task import _Task + +KEY_TEMPLATE = 'connection({connection_id:s}):configure' + +class Task_ConnectionConfigure(_Task): + def __init__(self, task_executor : TaskExecutor, connection_id : ConnectionId) -> None: + super().__init__(task_executor) + self._connection_id = connection_id + + @property + def connection_id(self) -> ConnectionId: return self._connection_id + + @staticmethod + def build_key(connection_id : ConnectionId) -> str: + str_connection_id = get_connection_key(connection_id) + return KEY_TEMPLATE.format(connection_id=str_connection_id) + + @property + def key(self) -> str: return self.build_key(self._connection_id) + + def execute(self) -> None: + connection = self._task_executor.get_connection(self._connection_id) + service = self._task_executor.get_service(connection.service_id) + + service_handler_settings = {} + service_handler = self._task_executor.get_service_handler(connection, service, **service_handler_settings) + + endpointids_to_set = endpointids_to_raw(connection.path_hops_endpoint_ids) + connection_uuid = connection.connection_id.connection_uuid.uuid + results_setendpoint = service_handler.SetEndpoint(endpointids_to_set, connection_uuid=connection_uuid) + errors = check_errors_setendpoint(endpointids_to_set, results_setendpoint) + if len(errors) > 0: + MSG = 'SetEndpoint for Connection({:s}) from Service({:s})' + str_connection = grpc_message_to_json_string(connection) + str_service = grpc_message_to_json_string(service) + raise OperationFailedException(MSG.format(str_connection, str_service), extra_details=errors) + + self._task_executor.set_connection(connection) diff --git a/src/service/service/task_scheduler/tasks/Task_ConnectionDeconfigure.py b/src/service/service/task_scheduler/tasks/Task_ConnectionDeconfigure.py new file mode 100644 index 0000000000000000000000000000000000000000..5736054febd2fb9e8a36b5a2235ca3f412e0e174 --- /dev/null +++ b/src/service/service/task_scheduler/tasks/Task_ConnectionDeconfigure.py @@ -0,0 +1,59 @@ +# 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 common.method_wrappers.ServiceExceptions import OperationFailedException +from common.proto.context_pb2 import ConnectionId +from common.tools.grpc.Tools import grpc_message_to_json_string +from service.service.service_handler_api.Tools import check_errors_deleteendpoint +from service.service.task_scheduler.TaskExecutor import TaskExecutor +from service.service.tools.EndpointIdFormatters import endpointids_to_raw +from service.service.tools.ObjectKeys import get_connection_key +from ._Task import _Task + +KEY_TEMPLATE = 'connection({connection_id:s}):deconfigure' + +class Task_ConnectionDeconfigure(_Task): + def __init__(self, task_executor : TaskExecutor, connection_id : ConnectionId) -> None: + super().__init__(task_executor) + self._connection_id = connection_id + + @property + def connection_id(self) -> ConnectionId: return self._connection_id + + @staticmethod + def build_key(connection_id : ConnectionId) -> str: + str_connection_id = get_connection_key(connection_id) + return KEY_TEMPLATE.format(connection_id=str_connection_id) + + @property + def key(self) -> str: return self.build_key(self._connection_id) + + def execute(self) -> None: + connection = self._task_executor.get_connection(self._connection_id) + service = self._task_executor.get_service(connection.service_id) + + service_handler_settings = {} + service_handler = self._task_executor.get_service_handler(connection, service, **service_handler_settings) + + endpointids_to_delete = endpointids_to_raw(connection.path_hops_endpoint_ids) + connection_uuid = connection.connection_id.connection_uuid.uuid + results_deleteendpoint = service_handler.DeleteEndpoint(endpointids_to_delete, connection_uuid=connection_uuid) + errors = check_errors_deleteendpoint(endpointids_to_delete, results_deleteendpoint) + if len(errors) > 0: + MSG = 'DeleteEndpoint for Connection({:s}) from Service({:s})' + str_connection = grpc_message_to_json_string(connection) + str_service = grpc_message_to_json_string(service) + raise OperationFailedException(MSG.format(str_connection, str_service), extra_details=errors) + + self._task_executor.delete_connection(self._connection_id) diff --git a/src/service/service/task_scheduler/tasks/Task_ServiceDelete.py b/src/service/service/task_scheduler/tasks/Task_ServiceDelete.py new file mode 100644 index 0000000000000000000000000000000000000000..6a4e11b540cd9b85028d92cf86899ee098056c36 --- /dev/null +++ b/src/service/service/task_scheduler/tasks/Task_ServiceDelete.py @@ -0,0 +1,39 @@ +# 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 common.proto.context_pb2 import ServiceId +from service.service.task_scheduler.TaskExecutor import TaskExecutor +from service.service.tools.ObjectKeys import get_service_key +from ._Task import _Task + +KEY_TEMPLATE = 'service({service_id:s}):delete' + +class Task_ServiceDelete(_Task): + def __init__(self, task_executor : TaskExecutor, service_id : ServiceId) -> None: + super().__init__(task_executor) + self._service_id = service_id + + @property + def service_id(self) -> ServiceId: return self._service_id + + @staticmethod + def build_key(service_id : ServiceId) -> str: + str_service_id = get_service_key(service_id) + return KEY_TEMPLATE.format(service_id=str_service_id) + + @property + def key(self) -> str: return self.build_key(self._service_id) + + def execute(self) -> None: + self._task_executor.delete_service(self._service_id) diff --git a/src/service/service/task_scheduler/tasks/Task_ServiceSetStatus.py b/src/service/service/task_scheduler/tasks/Task_ServiceSetStatus.py new file mode 100644 index 0000000000000000000000000000000000000000..815cb33c3d540755704153b661e889fc2660d268 --- /dev/null +++ b/src/service/service/task_scheduler/tasks/Task_ServiceSetStatus.py @@ -0,0 +1,46 @@ +# 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 common.proto.context_pb2 import ServiceId, ServiceStatusEnum +from service.service.task_scheduler.TaskExecutor import TaskExecutor +from service.service.tools.ObjectKeys import get_service_key +from ._Task import _Task + +KEY_TEMPLATE = 'service({service_id:s}):set_status({new_status:s})' + +class Task_ServiceSetStatus(_Task): + def __init__(self, task_executor : TaskExecutor, service_id : ServiceId, new_status : ServiceStatusEnum) -> None: + super().__init__(task_executor) + self._service_id = service_id + self._new_status = new_status + + @property + def service_id(self) -> ServiceId: return self._service_id + + @property + def new_status(self) -> ServiceStatusEnum: return self._new_status + + @staticmethod + def build_key(service_id : ServiceId, new_status : ServiceStatusEnum) -> str: + str_service_id = get_service_key(service_id) + str_new_status = ServiceStatusEnum.Name(new_status) + return KEY_TEMPLATE.format(service_id=str_service_id, new_status=str_new_status) + + @property + def key(self) -> str: return self.build_key(self._service_id, self._new_status) + + def execute(self) -> None: + service = self._task_executor.get_service(self._service_id) + service.service_status.service_status = self._new_status + self._task_executor.set_service(service) diff --git a/src/service/service/task_scheduler/tasks/_Task.py b/src/service/service/task_scheduler/tasks/_Task.py new file mode 100644 index 0000000000000000000000000000000000000000..c2dbcdf659b05ab082eb76aa1fe8f4b46394ed83 --- /dev/null +++ b/src/service/service/task_scheduler/tasks/_Task.py @@ -0,0 +1,30 @@ +# 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 service.service.task_scheduler.TaskExecutor import TaskExecutor + +class _Task: + def __init__(self, task_executor : TaskExecutor) -> None: + self._task_executor = task_executor + + @staticmethod + def build_key() -> str: + raise NotImplementedError('Task:build_key() not implemented') + + @property + def key(self) -> str: + raise NotImplementedError('Task:key() not implemented') + + def execute(self) -> bool: + raise NotImplementedError('Task:execute() not implemented') diff --git a/src/service/service/task_scheduler/tasks/__init__.py b/src/service/service/task_scheduler/tasks/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/service/service/task_scheduler/tasks/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/service/service/tools/ContextGetters.py b/src/service/service/tools/ContextGetters.py new file mode 100644 index 0000000000000000000000000000000000000000..9b1d6224d1e4201cbc0720e7ce818a86e5ae2042 --- /dev/null +++ b/src/service/service/tools/ContextGetters.py @@ -0,0 +1,42 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import grpc +from typing import Optional +from common.proto.context_pb2 import Connection, ConnectionId, Device, DeviceId, Service, ServiceId +from context.client.ContextClient import ContextClient + +def get_connection(context_client : ContextClient, connection_id : ConnectionId) -> Optional[Connection]: + try: + connection : Connection = context_client.GetConnection(connection_id) + return connection + except grpc.RpcError as e: + if e.code() != grpc.StatusCode.NOT_FOUND: raise # pylint: disable=no-member + return None + +def get_device(context_client : ContextClient, device_id : DeviceId) -> Optional[Device]: + try: + device : Device = context_client.GetDevice(device_id) + return device + except grpc.RpcError as e: + if e.code() != grpc.StatusCode.NOT_FOUND: raise # pylint: disable=no-member + return None + +def get_service(context_client : ContextClient, service_id : ServiceId) -> Optional[Service]: + try: + service : Service = context_client.GetService(service_id) + return service + except grpc.RpcError as e: + if e.code() != grpc.StatusCode.NOT_FOUND: raise # pylint: disable=no-member + return None diff --git a/src/service/service/tools/EndpointIdFormatters.py b/src/service/service/tools/EndpointIdFormatters.py new file mode 100644 index 0000000000000000000000000000000000000000..ff1d5081671109d6c09cd46166d50585317789ec --- /dev/null +++ b/src/service/service/tools/EndpointIdFormatters.py @@ -0,0 +1,27 @@ +# 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 typing import List, Optional, Tuple +from common.proto.context_pb2 import EndPointId + +def endpointids_to_raw(traversed_endpoint_ids : List[EndPointId]) -> List[Tuple[str, str, Optional[str]]]: + raw_endpoint_ids : List[Tuple[str, str, Optional[str]]] = [] + for endpoint_id in traversed_endpoint_ids: + device_uuid = endpoint_id.device_id.device_uuid.uuid + endpoint_uuid = endpoint_id.endpoint_uuid.uuid + topology_uuid = endpoint_id.topology_id.topology_uuid.uuid + if len(topology_uuid) == 0: topology_uuid = None + endpoint_id_tuple = device_uuid, endpoint_uuid, topology_uuid + raw_endpoint_ids.append(endpoint_id_tuple) + return raw_endpoint_ids diff --git a/src/service/service/tools/ObjectKeys.py b/src/service/service/tools/ObjectKeys.py new file mode 100644 index 0000000000000000000000000000000000000000..14c4cdf3ad661df0aa8f22599a294fe50db4a1a9 --- /dev/null +++ b/src/service/service/tools/ObjectKeys.py @@ -0,0 +1,26 @@ +# 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 common.proto.context_pb2 import ConnectionId, DeviceId, ServiceId + +def get_connection_key(connection_id : ConnectionId) -> str: + return connection_id.connection_uuid.uuid + +def get_device_key(device_id : DeviceId) -> str: + return device_id.device_uuid.uuid + +def get_service_key(service_id : ServiceId) -> str: + context_uuid = service_id.context_id.context_uuid.uuid + service_uuid = service_id.service_uuid.uuid + return '{:s}/{:s}'.format(context_uuid, service_uuid) diff --git a/src/service/service/tools/__init__.py b/src/service/service/tools/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/service/service/tools/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/service/tests/CommonObjects.py b/src/service/tests/CommonObjects.py index 0ad6695dff56247eaad59700e4e908313b955857..4cd233349ae4f0e7b39b5597fdbd6ff9d00e5189 100644 --- a/src/service/tests/CommonObjects.py +++ b/src/service/tests/CommonObjects.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,18 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.proto.kpi_sample_types_pb2 import KpiSampleType from common.tools.object_factory.Context import json_context, json_context_id from common.tools.object_factory.Topology import json_topology, json_topology_id -from context.proto.kpi_sample_types_pb2 import KpiSampleType # ----- Context -------------------------------------------------------------------------------------------------------- -CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_UUID) -CONTEXT = json_context(DEFAULT_CONTEXT_UUID) +CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) +CONTEXT = json_context(DEFAULT_CONTEXT_NAME) # ----- Topology ------------------------------------------------------------------------------------------------------- -TOPOLOGY_ID = json_topology_id(DEFAULT_TOPOLOGY_UUID, context_id=CONTEXT_ID) -TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_UUID, context_id=CONTEXT_ID) +TOPOLOGY_ID = json_topology_id(DEFAULT_TOPOLOGY_NAME, context_id=CONTEXT_ID) +TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_NAME, context_id=CONTEXT_ID) # ----- Monitoring Samples --------------------------------------------------------------------------------------------- PACKET_PORT_SAMPLE_TYPES = [ diff --git a/src/service/tests/MockService_Dependencies.py b/src/service/tests/MockService_Dependencies.py new file mode 100644 index 0000000000000000000000000000000000000000..eb3059d5a28f3686861a1fad3de03f97d502545f --- /dev/null +++ b/src/service/tests/MockService_Dependencies.py @@ -0,0 +1,49 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +from typing import Union +from common.Constants import ServiceNameEnum +from common.Settings import ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name +from common.proto.context_pb2_grpc import add_ContextServiceServicer_to_server +from common.proto.device_pb2_grpc import add_DeviceServiceServicer_to_server +from common.tests.MockServicerImpl_Context import MockServicerImpl_Context +from common.tests.MockServicerImpl_Device import MockServicerImpl_Device +from common.tools.service.GenericGrpcService import GenericGrpcService + +LOCAL_HOST = '127.0.0.1' + +SERVICE_CONTEXT = ServiceNameEnum.CONTEXT +SERVICE_DEVICE = ServiceNameEnum.DEVICE + +class MockService_Dependencies(GenericGrpcService): + # Mock Service implementing Context and Device to simplify unitary tests of Device + + def __init__(self, bind_port: Union[str, int]) -> None: + super().__init__(bind_port, LOCAL_HOST, enable_health_servicer=False, cls_name='MockService') + + # pylint: disable=attribute-defined-outside-init + def install_servicers(self): + self.context_servicer = MockServicerImpl_Context() + add_ContextServiceServicer_to_server(self.context_servicer, self.server) + + self.device_servicer = MockServicerImpl_Device() + add_DeviceServiceServicer_to_server(self.device_servicer, self.server) + + def configure_env_vars(self): + os.environ[get_env_var_name(SERVICE_CONTEXT, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) + + os.environ[get_env_var_name(SERVICE_DEVICE, ENVVAR_SUFIX_SERVICE_HOST )] = str(self.bind_address) + os.environ[get_env_var_name(SERVICE_DEVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(self.bind_port) diff --git a/src/service/tests/PrepareTestScenario.py b/src/service/tests/PrepareTestScenario.py new file mode 100644 index 0000000000000000000000000000000000000000..e4609ec416803312926422aca16cb02a6785a789 --- /dev/null +++ b/src/service/tests/PrepareTestScenario.py @@ -0,0 +1,68 @@ +# 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 pytest, os +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_service_port_grpc) +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from service.client.ServiceClient import ServiceClient +from service.service.ServiceService import ServiceService +from service.service.service_handler_api.ServiceHandlerFactory import ServiceHandlerFactory +from service.service.service_handlers import SERVICE_HANDLERS +from service.tests.MockService_Dependencies import MockService_Dependencies + +LOCAL_HOST = '127.0.0.1' +MOCKSERVICE_PORT = 10000 +SERVICE_SERVICE_PORT = MOCKSERVICE_PORT + get_service_port_grpc(ServiceNameEnum.SERVICE) # avoid privileged ports +os.environ[get_env_var_name(ServiceNameEnum.SERVICE, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.SERVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(SERVICE_SERVICE_PORT) + +@pytest.fixture(scope='session') +def mock_service(): + _service = MockService_Dependencies(MOCKSERVICE_PORT) + _service.configure_env_vars() + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def context_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name + _client = ContextClient() + yield _client + _client.close() + +@pytest.fixture(scope='session') +def device_client(mock_service : MockService_Dependencies): # pylint: disable=redefined-outer-name + _client = DeviceClient() + yield _client + _client.close() + +@pytest.fixture(scope='session') +def service_service( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient): # pylint: disable=redefined-outer-name + + _service_handler_factory = ServiceHandlerFactory(SERVICE_HANDLERS) + _service = ServiceService(_service_handler_factory) + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def service_client(service_service : ServiceService): # pylint: disable=redefined-outer-name + _client = ServiceClient() + yield _client + _client.close() diff --git a/src/service/tests/ServiceHandler_L3NM_EMU.py b/src/service/tests/ServiceHandler_L3NM_EMU.py index c6d4ae2291f79aae44c5a817596f3d07ca2525f7..3df27b439626dad652e443cca4195ce36f4ac86f 100644 --- a/src/service/tests/ServiceHandler_L3NM_EMU.py +++ b/src/service/tests/ServiceHandler_L3NM_EMU.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ from typing import Dict, List, Tuple from common.tools.object_factory.ConfigRule import json_config_rule_set -from common.tools.object_factory.Constraint import json_constraint +from common.tools.object_factory.Constraint import json_constraint_custom from common.tools.object_factory.Device import ( json_device_emulated_packet_router_disabled, json_device_emulated_tapi_disabled, json_device_id) from common.tools.object_factory.EndPoint import json_endpoint, json_endpoint_id @@ -101,19 +101,21 @@ SERVICE_R1_R3_UUID = 'SVC:{:s}/{:s}-{:s}/{:s}'.format( DEVICE_R3_UUID, ENDPOINT_ID_R3_EP100['endpoint_uuid']['uuid']) SERVICE_R1_R3_ENDPOINT_IDS = [ENDPOINT_ID_R1_EP100, ENDPOINT_ID_R3_EP100] SERVICE_R1_R3_CONSTRAINTS = [ - json_constraint('latency_ms', 15.2), - json_constraint('jitter_us', 1.2), + json_constraint_custom('latency_ms', 15.2), + json_constraint_custom('jitter_us', 1.2), ] SERVICE_R1_R3_CONFIG_RULES = [ json_config_rule_set( - 'settings', - {'route_distinguisher': '60001:801', 'mtu': 1512, 'address_families': ['IPV4']}), + '/settings', + {'mtu': 1512, 'address_families': ['IPV4'], 'bgp_as': 65000, 'bgp_route_target': '65000:333'}), json_config_rule_set( - 'device[{:s}]/endpoint[{:s}]/settings'.format(DEVICE_R1_UUID, ENDPOINT_ID_R1_EP100['endpoint_uuid']['uuid']), - {'router_id': '10.0.0.1', 'sub_interface_index': 1}), + '/device[{:s}]/endpoint[{:s}]/settings'.format(DEVICE_R1_UUID, ENDPOINT_ID_R1_EP100['endpoint_uuid']['uuid']), + {'router_id': '10.10.10.1', 'route_distinguisher': '65000:123', 'sub_interface_index': 400, 'vlan_id': 400, + 'address_ip': '3.3.2.1', 'address_prefix': 24}), json_config_rule_set( - 'device[{:s}]/endpoint[{:s}]/settings'.format(DEVICE_R3_UUID, ENDPOINT_ID_R3_EP100['endpoint_uuid']['uuid']), - {'router_id': '10.0.0.3', 'sub_interface_index': 1}), + '/device[{:s}]/endpoint[{:s}]/settings'.format(DEVICE_R3_UUID, ENDPOINT_ID_R3_EP100['endpoint_uuid']['uuid']), + {'router_id': '20.20.20.1', 'route_distinguisher': '65000:321', 'sub_interface_index': 400, 'vlan_id': 500, + 'address_ip': '3.3.1.1', 'address_prefix': 24}), ] SERVICE_R1_R3_ID = json_service_id(SERVICE_R1_R3_UUID, context_id=CONTEXT_ID) SERVICE_R1_R3_DESCRIPTOR = json_service_l3nm_planned(SERVICE_R1_R3_UUID) diff --git a/src/service/tests/ServiceHandler_L3NM_OC.py b/src/service/tests/ServiceHandler_L3NM_OC.py index c67323485c50d4c17efb0b7da6036b5f111bcd22..a8f1e315a136838cdea4e2c7c4c9e444be250a4b 100644 --- a/src/service/tests/ServiceHandler_L3NM_OC.py +++ b/src/service/tests/ServiceHandler_L3NM_OC.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ import uuid from typing import Dict, List, Tuple from common.tools.object_factory.ConfigRule import json_config_rule_set -from common.tools.object_factory.Constraint import json_constraint +from common.tools.object_factory.Constraint import json_constraint_custom from common.tools.object_factory.Device import ( json_device_connect_rules, json_device_emulated_packet_router_disabled, json_device_emulated_tapi_disabled, json_device_id) @@ -28,13 +28,13 @@ SERVICE_HANDLER_NAME = 'l3nm_openconfig' def json_endpoint_ids(device_id : Dict, endpoint_descriptors : List[Tuple[str, str]]): return [ - json_endpoint_id(device_id, ep_uuid, topology_id=TOPOLOGY_ID) + json_endpoint_id(device_id, ep_uuid) for ep_uuid, _ in endpoint_descriptors ] def json_endpoints(device_id : Dict, endpoint_descriptors : List[Tuple[str, str]]): return [ - json_endpoint(device_id, ep_uuid, ep_type, topology_id=TOPOLOGY_ID, kpi_sample_types=PACKET_PORT_SAMPLE_TYPES) + json_endpoint(device_id, ep_uuid, ep_type, kpi_sample_types=PACKET_PORT_SAMPLE_TYPES) for ep_uuid, ep_type in endpoint_descriptors ] @@ -102,7 +102,6 @@ LINK_R1_O1_UUID = '{:s}/{:s}-{:s}/{:s}'.format( LINK_R1_O1_ID = json_link_id(LINK_R1_O1_UUID) LINK_R1_O1 = json_link(LINK_R1_O1_UUID, [ENDPOINT_ID_R1_EP1, ENDPOINT_ID_O1_EP1]) - LINK_R2_O1_UUID = '{:s}/{:s}-{:s}/{:s}'.format( DEVICE_R2_UUID, ENDPOINT_ID_R2_EP1['endpoint_uuid']['uuid'], DEVICE_O1_UUID, ENDPOINT_ID_O1_EP2['endpoint_uuid']['uuid']) @@ -116,19 +115,21 @@ SERVICE_R1_R2_UUID = 'SVC:{:s}/{:s}-{:s}/{:s}'.format( DEVICE_R2_UUID, ENDPOINT_ID_R2_EP100['endpoint_uuid']['uuid']) SERVICE_R1_R2_ENDPOINT_IDS = [ENDPOINT_ID_R1_EP100, ENDPOINT_ID_R2_EP100] SERVICE_R1_R2_CONSTRAINTS = [ - json_constraint('latency_ms', 15.2), - json_constraint('jitter_us', 1.2), + json_constraint_custom('latency_ms', 15.2), + json_constraint_custom('jitter_us', 1.2), ] SERVICE_R1_R2_CONFIG_RULES = [ json_config_rule_set( - 'settings', - {'route_distinguisher': '60001:801', 'mtu': 1512, 'address_families': ['IPV4']}), + '/settings', + {'mtu': 1512, 'address_families': ['IPV4'], 'bgp_as': 65000, 'bgp_route_target': '65000:333'}), json_config_rule_set( - 'device[{:s}]/endpoint[{:s}]/settings'.format(DEVICE_R1_UUID, ENDPOINT_ID_R1_EP100['endpoint_uuid']['uuid']), - {'router_id': '10.0.0.1', 'sub_interface_index': 1}), + '/device[{:s}]/endpoint[{:s}]/settings'.format(DEVICE_R1_UUID, ENDPOINT_ID_R1_EP100['endpoint_uuid']['uuid']), + {'router_id': '10.10.10.1', 'route_distinguisher': '65000:123', 'sub_interface_index': 400, 'vlan_id': 400, + 'address_ip': '3.3.2.1', 'address_prefix': 24}), json_config_rule_set( - 'device[{:s}]/endpoint[{:s}]/settings'.format(DEVICE_R2_UUID, ENDPOINT_ID_R2_EP100['endpoint_uuid']['uuid']), - {'router_id': '10.0.0.3', 'sub_interface_index': 1}), + '/device[{:s}]/endpoint[{:s}]/settings'.format(DEVICE_R2_UUID, ENDPOINT_ID_R2_EP100['endpoint_uuid']['uuid']), + {'router_id': '20.20.20.1', 'route_distinguisher': '65000:321', 'sub_interface_index': 400, 'vlan_id': 500, + 'address_ip': '3.3.1.1', 'address_prefix': 24}), ] SERVICE_R1_R2_ID = json_service_id(SERVICE_R1_R2_UUID, context_id=CONTEXT_ID) SERVICE_R1_R2_DESCRIPTOR = json_service_l3nm_planned(SERVICE_R1_R2_UUID) diff --git a/src/service/tests/ServiceHandlersToTest.py b/src/service/tests/ServiceHandlersToTest.py index 43f2a2eb2e720eea5b9f690e374ec3b5830eac1d..c50a0b45774f15497578a9c5b365e1e331d6d95e 100644 --- a/src/service/tests/ServiceHandlersToTest.py +++ b/src/service/tests/ServiceHandlersToTest.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/service/tests/__init__.py b/src/service/tests/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/service/tests/__init__.py +++ b/src/service/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/service/tests/test_unitary.py b/src/service/tests/test_unitary.py index 812a65c5c4353925dcf0b186a0ebb5401a4ecfa1..f99f9b191083db017486d03d0bc93b0d9152b35f 100644 --- a/src/service/tests/test_unitary.py +++ b/src/service/tests/test_unitary.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,90 +12,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -import copy, grpc, logging, os, pytest -from common.tests.MockService import MockService -from common.tests.MockServicerImpl_Context import MockServicerImpl_Context -from common.tests.MockServicerImpl_Device import MockServicerImpl_Device +import copy, grpc, logging, pytest +from common.proto.context_pb2 import ( + Context, ContextId, Device, DeviceId, Link, LinkId, Service, ServiceId, Topology, TopologyId) from common.tests.PytestGenerateTests import pytest_generate_tests # (required) pylint: disable=unused-import from common.tools.grpc.Tools import grpc_message_to_json_string from context.client.ContextClient import ContextClient -from context.proto.context_pb2 import Context, ContextId, DeviceId, Link, LinkId, Topology, Device, TopologyId -from context.proto.context_pb2_grpc import add_ContextServiceServicer_to_server from device.client.DeviceClient import DeviceClient -from device.proto.device_pb2_grpc import add_DeviceServiceServicer_to_server -from service.Config import ( - GRPC_SERVICE_PORT as SERVICE_GRPC_SERVICE_PORT, GRPC_MAX_WORKERS as SERVICE_GRPC_MAX_WORKERS, - GRPC_GRACE_PERIOD as SERVICE_GRPC_GRACE_PERIOD) from service.client.ServiceClient import ServiceClient -from service.proto.context_pb2 import Service, ServiceId -from service.service.ServiceService import ServiceService -from service.service.service_handler_api.ServiceHandlerFactory import ServiceHandlerFactory -from service.service.service_handlers import SERVICE_HANDLERS +from .PrepareTestScenario import ( # pylint: disable=unused-import + # be careful, order of symbols is important here! + mock_service, service_service, context_client, device_client, service_client) LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.DEBUG) -SERVICE_GRPC_SERVICE_PORT = 10000 + SERVICE_GRPC_SERVICE_PORT # avoid privileged ports - -LOCALHOST = '127.0.0.1' -MOCKSERVER_GRPC_PORT = 10000 - -class MockService_Combined(MockService): - # Mock Server implementing Context and Service to simplify unitary tests of Compute - - def __init__(self, cls_name='MockService_Service'): - super().__init__(LOCALHOST, MOCKSERVER_GRPC_PORT, cls_name=cls_name) - - # pylint: disable=attribute-defined-outside-init - def install_servicers(self): - self.context_servicer = MockServicerImpl_Context() - add_ContextServiceServicer_to_server(self.context_servicer, self.server) - self.device_servicer = MockServicerImpl_Device() - add_DeviceServiceServicer_to_server(self.device_servicer, self.server) - -os.environ['CONTEXTSERVICE_SERVICE_HOST'] = LOCALHOST -os.environ['CONTEXTSERVICE_SERVICE_PORT_GRPC'] = str(MOCKSERVER_GRPC_PORT) -os.environ['DEVICESERVICE_SERVICE_HOST'] = LOCALHOST -os.environ['DEVICESERVICE_SERVICE_PORT_GRPC'] = str(MOCKSERVER_GRPC_PORT) - -@pytest.fixture(scope='session') -def mockservice(): - _service = MockService_Combined() - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def context_client(mockservice : MockService_Combined): # pylint: disable=redefined-outer-name - _client = ContextClient(address=LOCALHOST, port=MOCKSERVER_GRPC_PORT) - yield _client - _client.close() - -@pytest.fixture(scope='session') -def device_client(mockservice : MockService_Combined): # pylint: disable=redefined-outer-name - _client = DeviceClient(address=LOCALHOST, port=MOCKSERVER_GRPC_PORT) - yield _client - _client.close() - -@pytest.fixture(scope='session') -def service_service( - context_client : ContextClient, # pylint: disable=redefined-outer-name - device_client : DeviceClient): # pylint: disable=redefined-outer-name - - _service_handler_factory = ServiceHandlerFactory(SERVICE_HANDLERS) - _service = ServiceService( - context_client, device_client, _service_handler_factory, - port=SERVICE_GRPC_SERVICE_PORT, max_workers=SERVICE_GRPC_MAX_WORKERS, grace_period=SERVICE_GRPC_GRACE_PERIOD) - _service.start() - yield _service - _service.stop() - -@pytest.fixture(scope='session') -def service_client(service_service : ServiceService): # pylint: disable=redefined-outer-name - _client = ServiceClient(address=LOCALHOST, port=SERVICE_GRPC_SERVICE_PORT) - yield _client - _client.close() - try: from .ServiceHandlersToTest import SERVICE_HANDLERS_TO_TEST except ImportError: diff --git a/src/service/tests/test_unitary_task_scheduler.py b/src/service/tests/test_unitary_task_scheduler.py new file mode 100644 index 0000000000000000000000000000000000000000..cd77934f6681b0e50c2ddba4b529e4a662b1b63f --- /dev/null +++ b/src/service/tests/test_unitary_task_scheduler.py @@ -0,0 +1,96 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging +#from common.proto.context_pb2 import Connection, Service +from common.proto.pathcomp_pb2 import PathCompReply +from common.tools.grpc.Tools import grpc_message_to_json_string +from service.service.service_handler_api.ServiceHandlerFactory import ServiceHandlerFactory +from service.service.task_scheduler.TaskScheduler import TasksScheduler +from .PrepareTestScenario import context_client # pylint: disable=unused-import + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +def test_task_scheduler(): + # test: add services and connections that depend on each other + # then, check if they are properly resolved. + # - service MAIN, depends on connection PKT-1, TAPI, and PKT-2 + # - connection PKT-1, depends on nothing + # - connection TAPI, depends on service TAPI-1 and TAPI-2 + # - connection PKT-2, depends on nothing + # - service TAPI-1, depends on connection TAPI-1 + # - service TAPI-2, depends on connection TAPI-2 + + pathcomp_reply = PathCompReply() + + service_main = pathcomp_reply.services.add() + service_main.service_id.context_id.context_uuid.uuid = 'admin' + service_main.service_id.service_uuid.uuid = 'MAIN' + + service_tapi1 = pathcomp_reply.services.add() + service_tapi1.service_id.context_id.context_uuid.uuid = 'admin' + service_tapi1.service_id.service_uuid.uuid = 'TAPI-1' + + service_tapi2 = pathcomp_reply.services.add() + service_tapi2.service_id.context_id.context_uuid.uuid = 'admin' + service_tapi2.service_id.service_uuid.uuid = 'TAPI-2' + + connection_pkt1 = pathcomp_reply.connections.add() + connection_pkt1.connection_id.connection_uuid.uuid = 'PKT-1' + connection_pkt1.service_id.CopyFrom(service_main.service_id) + + connection_tapi = pathcomp_reply.connections.add() + connection_tapi.connection_id.connection_uuid.uuid = 'TAPI' + connection_tapi.service_id.CopyFrom(service_main.service_id) + + connection_pkt2 = pathcomp_reply.connections.add() + connection_pkt2.connection_id.connection_uuid.uuid = 'PKT-2' + connection_pkt2.service_id.CopyFrom(service_main.service_id) + + connection_tapi1 = pathcomp_reply.connections.add() + connection_tapi1.connection_id.connection_uuid.uuid = 'TAPI-1' + connection_tapi1.service_id.CopyFrom(service_tapi1.service_id) + connection_tapi.sub_service_ids.append(service_tapi1.service_id) + + connection_tapi2 = pathcomp_reply.connections.add() + connection_tapi2.connection_id.connection_uuid.uuid = 'TAPI-2' + connection_tapi2.service_id.CopyFrom(service_tapi2.service_id) + connection_tapi.sub_service_ids.append(service_tapi2.service_id) + + LOGGER.info('pathcomp_reply={:s}'.format(grpc_message_to_json_string(pathcomp_reply))) + + service_handler_factory = ServiceHandlerFactory([]) + task_scheduler = TasksScheduler(service_handler_factory) + task_scheduler.compose_from_pathcompreply(pathcomp_reply) + tasks_and_results = list(task_scheduler.execute_all(dry_run=True)) + + LOGGER.info('tasks_and_results={:s}'.format(str(tasks_and_results))) + + CORRECT_ORDERED_TASK_KEYS = [ + 'service(admin/MAIN):set_status(SERVICESTATUS_PLANNED)', + 'service(admin/TAPI-1):set_status(SERVICESTATUS_PLANNED)', + 'service(admin/TAPI-2):set_status(SERVICESTATUS_PLANNED)', + 'connection(PKT-1):configure', + 'connection(PKT-2):configure', + 'connection(TAPI-1):configure', + 'connection(TAPI-2):configure', + 'service(admin/TAPI-1):set_status(SERVICESTATUS_ACTIVE)', + 'service(admin/TAPI-2):set_status(SERVICESTATUS_ACTIVE)', + 'connection(TAPI):configure', + 'service(admin/MAIN):set_status(SERVICESTATUS_ACTIVE)' + ] + + for (task_key,_),correct_key in zip(tasks_and_results, CORRECT_ORDERED_TASK_KEYS): + assert task_key == correct_key diff --git a/src/slice/.gitlab-ci.yml b/src/slice/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..39edd20b325c60c40dafddd4dd220b2615042f60 --- /dev/null +++ b/src/slice/.gitlab-ci.yml @@ -0,0 +1,107 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Build, tag, and push the Docker image to the GitLab Docker registry +build slice: + variables: + IMAGE_NAME: 'slice' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: build + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + script: + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile . + - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + after_script: + - docker images --filter="dangling=true" --quiet | xargs -r docker rmi + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml + +# Apply unit test to the component +unit_test slice: + variables: + IMAGE_NAME: 'slice' # name of the microservice + IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) + stage: unit_test + needs: + - build slice + - unit_test service + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + - if docker network list | grep teraflowbridge; then echo "teraflowbridge is already created"; else docker network create -d bridge teraflowbridge; fi + - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi + script: + - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" + - docker run --name $IMAGE_NAME -d -p 4040:4040 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG + - sleep 5 + - docker ps -a + - docker logs $IMAGE_NAME + - docker exec -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose $IMAGE_NAME/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' + after_script: + - docker rm -f $IMAGE_NAME + - docker network rm teraflowbridge + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - changes: + - src/common/**/*.py + - proto/*.proto + - src/$IMAGE_NAME/**/*.{py,in,yml} + - src/$IMAGE_NAME/Dockerfile + - src/$IMAGE_NAME/tests/*.py + - src/$IMAGE_NAME/tests/Dockerfile + - manifests/${IMAGE_NAME}service.yaml + - .gitlab-ci.yml + artifacts: + when: always + reports: + junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml + +## Deployment of the service in Kubernetes Cluster +#deploy slice: +# variables: +# IMAGE_NAME: 'slice' # name of the microservice +# IMAGE_TAG: 'latest' # tag of the container image (production, development, etc) +# stage: deploy +# needs: +# - unit test slice +# # - integ_test execute +# script: +# - 'sed -i "s/$IMAGE_NAME:.*/$IMAGE_NAME:$IMAGE_TAG/" manifests/${IMAGE_NAME}service.yaml' +# - kubectl version +# - kubectl get all +# - kubectl apply -f "manifests/${IMAGE_NAME}service.yaml" +# - kubectl get all +# # environment: +# # name: test +# # url: https://example.com +# # kubernetes: +# # namespace: test +# rules: +# - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' +# when: manual +# - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' +# when: manual diff --git a/src/slice/Config.py b/src/slice/Config.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/slice/Config.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/slice/Dockerfile b/src/slice/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..4c434e212da441c5a56e58e9a9509195c202355f --- /dev/null +++ b/src/slice/Dockerfile @@ -0,0 +1,72 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM python:3.9-slim + +# Install dependencies +RUN apt-get --yes --quiet --quiet update && \ + apt-get --yes --quiet --quiet install wget g++ && \ + rm -rf /var/lib/apt/lists/* + +# Set Python to show logs as they occur +ENV PYTHONUNBUFFERED=0 + +# Download the gRPC health probe +RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \ + wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ + chmod +x /bin/grpc_health_probe + +# Get generic Python packages +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools + +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components +WORKDIR /var/teraflow +COPY common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt + +# Add common files into working directory +WORKDIR /var/teraflow/common +COPY src/common/. ./ +RUN rm -rf proto + +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p /var/teraflow/common/proto +WORKDIR /var/teraflow/common/proto +RUN touch __init__.py +COPY proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; + +# Create component sub-folders, get specific Python packages +RUN mkdir -p /var/teraflow/slice +WORKDIR /var/teraflow/slice +COPY src/slice/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN python3 -m pip install -r requirements.txt + +# Add component files into working directory +WORKDIR /var/teraflow +COPY src/context/. context/ +COPY src/interdomain/. interdomain/ +COPY src/pathcomp/. pathcomp/ +COPY src/service/. service/ +COPY src/slice/. slice/ + +# Start the service +ENTRYPOINT ["python", "-m", "slice.service"] diff --git a/src/slice/__init__.py b/src/slice/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/slice/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/slice/_docs/ietf-network-slice-service_2022-07-11.yang b/src/slice/_docs/ietf-network-slice-service_2022-07-11.yang new file mode 100644 index 0000000000000000000000000000000000000000..bff228d78f5277fe113d813414c5fd78bf54d98f --- /dev/null +++ b/src/slice/_docs/ietf-network-slice-service_2022-07-11.yang @@ -0,0 +1,1180 @@ +module ietf-network-slice-service { + yang-version 1.1; + namespace + "urn:ietf:params:xml:ns:yang:ietf-network-slice-service"; + prefix ietf-nss; + + import ietf-inet-types { + prefix inet; + reference + "RFC 6991: Common YANG Types."; + } + import ietf-vpn-common { + prefix vpn-common; + reference + "RFC 9181: A Common YANG Data Model for Layer 2 and Layer 3 + VPNs."; + } + import ietf-te-types { + prefix te-types; + reference + "RFC 8776: Common YANG Data Types for Traffic Engineering."; + } + import ietf-te-packet-types { + prefix te-packet-types; + reference + "RFC 8776: Common YANG Data Types for Traffic Engineering."; + } + + organization + "IETF Traffic Engineering Architecture and Signaling (TEAS) + Working Group"; + contact + "WG Web: + WG List: + + Editor: Bo Wu + + Editor: Dhruv Dhody + + Editor: Reza Rokui + + Editor: Tarek Saad + + Author: Liuyan Han + "; + description + "This module defines a model for the IETF Network Slice service. + + Copyright (c) 2022 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Revised BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC XXXX; see the + RFC itself for full legal notices."; + + revision 2022-07-11 { + description + "initial version."; + reference + "RFC XXXX: A Yang Data Model for IETF Network Slice service + operation"; + } + /* Features */ + /* Identities */ + + identity service-tag-type { + description + "Base identity for IETF Network Slice service tag type."; + } + + identity service-tag-customer { + base service-tag-type; + description + "The IETF Network Slice service customer ID tag type."; + } + + identity service-tag-service { + base service-tag-type; + description + "The IETF Network Slice service tag type."; + } + + identity service-tag-opaque { + base service-tag-type; + description + "The IETF Network Slice service opaque tag type."; + } + + identity attachment-circuit-tag-type { + description + "Base identity for the attachment circuit tag type."; + } + + identity attachment-circuit-tag-vlan-id { + base attachment-circuit-tag-type; + description + "The attachment circuit VLAN ID tag type."; + } + + identity attachment-circuit-tag-ip-mask { + base attachment-circuit-tag-type; + description + "The attachment circuit tag IP mask."; + } + + identity service-isolation-type { + description + "Base identity for IETF Network slice service isolation level."; + } + + identity service-isolation-shared { + base service-isolation-type; + description + "Shared resources (e.g. queues) are associated with the + slice service traffic. Hence, the traffic can be impacted + by effects of other services traffic + sharing the same resources."; + } + + identity service-isolation-dedicated { + base service-isolation-type; + description + "Dedicated resources (e.g. queues) are associated with the + Network Slice service traffic. Hence, the service traffic + is isolated from other servceis traffic + sharing the same resources."; + } + + identity service-security-type { + description + "Base identity for for slice service security level."; + } + + identity service-security-authenticate { + base service-security-type; + description + "Indicates the slice service requires authentication."; + } + + identity service-security-integrity { + base service-security-type; + description + "Indicates the slice service requires data integrity."; + } + + identity service-security-encryption { + base service-security-type; + description + "Indicates the slice service requires data encryption."; + } + + identity point-to-point { + base vpn-common:vpn-topology; + description + "Identity for point-to-point IETF Network Slice + service connectivity."; + } + + identity point-to-multipoint { + base vpn-common:vpn-topology; + description + "Identity for point-to-point IETF Network Slice + service connectivity."; + } + + identity multipoint-to-multipoint { + base vpn-common:vpn-topology; + description + "Identity for point-to-point IETF Network Slice + service connectivity."; + } + + identity multipoint-to-point { + base vpn-common:vpn-topology; + description + "Identity for point-to-point IETF Network Slice + service connectivity."; + } + + identity sender-role { + base vpn-common:role; + description + "A SDP is acting as a sender."; + } + + identity receiver-role { + base vpn-common:role; + description + "A SDP is acting as a receiver."; + } + + identity service-slo-metric-type { + description + "Base identity for IETF Network Slice service SLO metric type."; + } + + identity service-slo-one-way-bandwidth { + base service-slo-metric-type; + description + "SLO bandwidth metric. Minimum guaranteed bandwidth between + two SDPs at any time and is measured unidirectionally."; + } + + identity service-slo-two-way-bandwidth { + base service-slo-metric-type; + description + "SLO bandwidth metric. Minimum guaranteed bandwidth between + two SDPs at any time."; + } + + identity service-slo-shared-bandwidth { + base service-slo-metric-type; + description + "The shared SLO bandwidth bound. It is the limit on the + bandwidth that can be shared amongst a group of + connectivity constructs of a slice service."; + } + + identity service-slo-one-way-delay { + base service-slo-metric-type; + description + "SLO one-way-delay is the upper bound of network delay when + transmitting between two SDPs. The metric is defined in + RFC7679."; + } + + identity service-slo-two-way-delay { + base service-slo-metric-type; + description + "SLO two-way delay is the upper bound of network delay when + transmitting between two SDPs. The metric is defined in + RFC2681."; + } + + identity service-slo-one-way-delay-variation { + base service-slo-metric-type; + description + "SLO one-way delay variation is defined by RFC3393, is the + difference in the one-way delay between sequential packets + between two SDPs."; + } + + identity service-slo-two-way-delay-variation { + base service-slo-metric-type; + description + "SLO two-way delay variation is defined by RFC5481, is the + difference in the round-trip delay between sequential packets + between two SDPs."; + } + + identity service-slo-one-way-packet-loss { + base service-slo-metric-type; + description + "SLO loss metric. The ratio of packets dropped to packets + transmitted between two SDPs in one-way + over a period of time as specified in RFC7680."; + } + + identity service-slo-two-way-packet-loss { + base service-slo-metric-type; + description + "SLO loss metric. The ratio of packets dropped to packets + transmitted between two SDPs in two-way + over a period of time as specified in RFC7680."; + } + + identity service-slo-availability { + base service-slo-metric-type; + description + "SLO availability level."; + } + + identity service-match-type { + description + "Base identity for IETF Network Slice service traffic + match type."; + } + + identity service-phy-interface-match { + base service-match-type; + description + "Use the physical interface as match criteria for + slice service traffic."; + } + + identity service-vlan-match { + base service-match-type; + description + "Use the VLAN ID as match criteria for the slice service + traffic."; + } + + identity service-label-match { + base service-match-type; + description + "Use the MPLS label as match criteria for the slice service + traffic."; + } + + identity service-source-ip-match { + base service-match-type; + description + "Use source ip-address in the packet header as match criteria + for the slice service traffic."; + } + + identity service-destination-ip-match { + base service-match-type; + description + "Use destination ip-address in the packet header as + match criteria for the slice service traffic."; + } + + identity service-dscp-match { + base service-match-type; + description + "Use DSCP in the IP packet header as match criteria + for the slice service traffic."; + } + + identity service-any-match { + base service-match-type; + description + "Match all slice service traffic."; + } + + identity peering-protocol-type { + description + "Base identity for SDP peering protocol type."; + } + + identity peering-protocol-bgp { + base peering-protocol-type; + description + "Use BGP as protocol for SDP peering with customer device."; + } + + identity peering-static-routing { + base peering-protocol-type; + description + "Use static routing for SDP peering with customer device."; + } + + identity peering-attribute-type { + description + "Base identity for BGP peering"; + } + + identity remote-as { + base peering-attribute-type; + description + "Identity for remote-as attribute of BGP peering."; + } + + identity neighbor { + base peering-attribute-type; + description + "Identity for neighbor attribute of BGP peering."; + } + + identity local-as { + base peering-attribute-type; + description + "Identity for local-as attribute of BGP peering."; + } + + /* + * Identity for availability-type + */ + + identity availability-type { + description + "Base identity from which specific availability types are + derived."; + } + + identity level-1 { + base availability-type; + description + "level 1: 99.9999%"; + } + + identity level-2 { + base availability-type; + description + "level 2: 99.999%"; + } + + identity level-3 { + base availability-type; + description + "level 3: 99.99%"; + } + + identity level-4 { + base availability-type; + description + "level 4: 99.9%"; + } + + identity level-5 { + base availability-type; + description + "level 5: 99%"; + } + + /* grouping */ + + grouping service-match-criteria { + description + "A grouping for the slice service match definition."; + container service-match-criteria { + description + "Describes the slice service match criteria."; + list match-criterion { + key "index"; + description + "List of the slice service traffic match criteria."; + leaf index { + type uint32; + description + "The entry index."; + } + leaf match-type { + type identityref { + base service-match-type; + } + mandatory true; + description + "Identifies an entry in the list of the slice service + match criteria."; + } + leaf-list value { + type string; + description + "Describes the slice service match criteria, e.g. + IP address, VLAN, etc."; + } + leaf target-connection-group-id { + type leafref { + path + "/ietf-nss:network-slice-services" + + "/ietf-nss:slice-service" + + "/ietf-nss:connection-groups/ietf-nss:connection-group" + + "/ietf-nss:connection-group-id"; + } + mandatory true; + description + "Reference to the slice service connection group."; + } + leaf connection-group-sdp-role { + type identityref { + base vpn-common:role; + } + default "vpn-common:any-to-any-role"; + description + "Indicates the role in the connection group when + a slice service has multiple multipoint-to-multipoint + connection groups, e.g., hub-spoke."; + } + leaf target-connectivity-construct-id { + type leafref { + path + "/ietf-nss:network-slice-services/slice-service" + + "/ietf-nss:connection-groups" + + "/ietf-nss:connection-group[connection-group-id" + + "=current()/../target-connection-group-id]" + + "/ietf-nss:connectivity-construct/ietf-nss:cc-id"; + } + description + "Reference to a Network Slice connection construct."; + } + } + } + } + + grouping service-sles { + description + "Indirectly Measurable Objectives of a slice service."; + leaf-list security { + type identityref { + base service-security-type; + } + description + "The slice service security SLE(s)"; + } + leaf isolation { + type identityref { + base service-isolation-type; + } + default "service-isolation-shared"; + description + "The slice service isolation SLE requirement."; + } + leaf max-occupancy-level { + type uint8 { + range "1..100"; + } + description + "The maximal occupancy level specifies the number of flows to + be admitted."; + } + leaf mtu { + type uint16; + units "bytes"; + description + "The MTU specifies the maximum length in octets of data + packets that can be transmitted by the slice service. + The value needs to be less than or equal to the + minimum MTU value of all 'attachment-circuits' in the SDPs."; + } + container steering-constraints { + description + "Container for the policy of steering constraints + applicable to the slice service."; + container path-constraints { + description + "Container for the policy of path constraints + applicable to the slice service."; + } + container service-function { + description + "Container for the policy of service function + applicable to the slice service."; + } + } + } + + grouping service-metric-bounds { + description + "Slice service metric bounds grouping."; + container metric-bounds { + description + "Slice service metric bounds container."; + list metric-bound { + key "metric-type"; + description + "List of slice service metric bounds."; + leaf metric-type { + type identityref { + base service-slo-metric-type; + } + description + "Identifies an entry in the list of metric type + bounds for the slice service."; + } + leaf metric-unit { + type string; + mandatory true; + description + "The metric unit of the parameter. For example, + s, ms, ns, and so on."; + } + leaf value-description { + type string; + description + "The description of previous value."; + } + leaf bound { + type uint64; + default "0"; + description + "The Bound on the slice service connection metric. + A zero indicate an unbounded upper limit for the + specific metric-type."; + } + } + } + } + + grouping sdp-peering { + description + "A grouping for the slice service SDP peering."; + container sdp-peering { + description + "Describes SDP peering attributes."; + list protocol { + key "protocol-type"; + description + "List of the SDP peering protocol."; + leaf protocol-type { + type identityref { + base peering-protocol-type; + } + description + "Identifies an entry in the list of SDP peering + protocol type."; + } + list attribute { + key "attribute-type"; + description + "list of protocol attributes"; + leaf attribute-type { + type identityref { + base peering-attribute-type; + } + description + "identifies the attribute type"; + } + leaf-list value { + type string; + description + "Describes the value of protocol attribute, e.g. + nexthop address, peer address, etc."; + } + } + } + list opaque { + key "attribute-name"; + description + "List of protocol attributes."; + leaf attribute-name { + type string; + description + "The name of the attribute."; + } + leaf-list value { + type string; + description + "The value(s) of the attribute"; + } + } + } + } + + grouping sdp-attachment-circuits { + description + "Grouping for the SDP attachment circuit definition."; + container attachment-circuits { + description + "List of attachment circuit."; + list attachment-circuit { + key "ac-id"; + description + "The IETF Network Slice service SDP attachment circuit + related parameters."; + leaf ac-id { + type string; + description + "Uniquely identifier a attachment circuit."; + } + leaf ac-description { + type string; + description + "The attachment circuit description."; + } + leaf ac-node-id { + type string; + description + "The attachment circuit node ID in the case of + multi-homing."; + } + leaf ac-tp-id { + type string; + description + "The termination port ID of the attachment circuit."; + } + leaf ac-ip-address { + type inet:ip-address; + description + "The IP address of the attachment circuit."; + } + leaf ac-ip-prefix-length { + type uint8; + description + "The subnet prefix length expressed in bits."; + } + leaf ac-qos-policy-name { + type string; + description + "The name of the QoS policy that is applied to the + attachment circuit. The name can reference a QoS + profile that is pre-provisioned on the device."; + } + leaf mtu { + type uint16; + units "bytes"; + description + "Maximum size in octets of the slice service data packet + that can traverse a SDP."; + } + container ac-tags { + description + "Container for the attachment circuit tags."; + list ac-tags { + key "ac-tag-type"; + description + "The attachment circuit tags list."; + leaf ac-tag-type { + type identityref { + base attachment-circuit-tag-type; + } + description + "The attachment circuit tag type."; + } + leaf-list value { + type string; + description + "The attachment circuit tag value."; + } + } + list ac-tag-opaque { + key "tag-name"; + description + "The attachment circuit tag opaque list."; + leaf tag-name { + type string; + description + "The opaque tags name"; + } + leaf-list value { + type string; + description + "The opaque tags value"; + } + } + } + /* Per ac rate limits */ + uses service-match-criteria; + uses sdp-peering; + uses service-rate-limit; + } + } + } + + grouping sdp-monitoring-metrics { + description + "Grouping for the SDP monitoring metrics."; + container sdp-monitoring { + config false; + description + "Container for SDP monitoring metrics."; + leaf incoming-utilized-bandwidth { + type te-types:te-bandwidth; + description + "Incoming bandwidth utilization at a SDP."; + } + leaf incoming-bw-utilization { + type decimal64 { + fraction-digits 5; + range "0..100"; + } + units "percent"; + mandatory true; + description + "To be used to define the bandwidth utilization + as a percentage of the available bandwidth."; + } + leaf outgoing-utilized-bandwidth { + type te-types:te-bandwidth; + description + "Outoing service bandwidth utilization at a SDP."; + } + leaf outgoing-bw-utilization { + type decimal64 { + fraction-digits 5; + range "0..100"; + } + units "percent"; + mandatory true; + description + "To be used to define the service bandwidth utilization + as a percentage of the available bandwidth."; + } + } + } + + grouping connectivity-construct-monitoring-metrics { + description + "Grouping for connectivity construct monitoring metrics."; + uses te-packet-types:one-way-performance-metrics-packet; + uses te-packet-types:two-way-performance-metrics-packet; + } + + grouping geolocation-container { + description + "A grouping containing a GPS location."; + container location { + description + "A container containing a GPS location."; + leaf altitude { + type int64; + units "millimeter"; + description + "Distance above the sea level."; + } + leaf latitude { + type decimal64 { + fraction-digits 8; + range "-90..90"; + } + description + "Relative position north or south on the Earth's surface."; + } + leaf longitude { + type decimal64 { + fraction-digits 8; + range "-180..180"; + } + description + "Angular distance east or west on the Earth's surface."; + } + } + // gps-location + } + + // geolocation-container + + grouping bw-rate-limits { + description + "Bandwidth rate limits grouping."; + reference + "RFC 7640: Traffic Management Benchmarking"; + leaf cir { + type uint64; + units "bps"; + description + "Committed Information Rate. The maximum number of bits + that a port can receive or send during one-second over an + interface."; + } + leaf cbs { + type uint64; + units "bytes"; + description + "Committed Burst Size. CBS controls the bursty nature + of the traffic. Traffic that does not use the configured + CIR accumulates credits until the credits reach the + configured CBS."; + } + leaf eir { + type uint64; + units "bps"; + description + "Excess Information Rate, i.e., excess frame delivery + allowed not subject to SLA. The traffic rate can be + limited by EIR."; + } + leaf ebs { + type uint64; + units "bytes"; + description + "Excess Burst Size. The bandwidth available for burst + traffic from the EBS is subject to the amount of + bandwidth that is accumulated during periods when + traffic allocated by the EIR policy is not used."; + } + leaf pir { + type uint64; + units "bps"; + description + "Peak Information Rate, i.e., maximum frame delivery + allowed. It is equal to or less than sum of CIR and EIR."; + } + leaf pbs { + type uint64; + units "bytes"; + description + "Peak Burst Size."; + } + } + + grouping service-rate-limit { + description + "The rate limits grouping."; + container incoming-rate-limits { + description + "Container for the asymmetric traffic control."; + uses bw-rate-limits; + } + container outgoing-rate-limits { + description + "The rate-limit imposed on outgoing traffic."; + uses bw-rate-limits; + } + } + + grouping sdp { + description + "Slice service SDP related information"; + leaf sdp-id { + type string; + description + "Unique identifier for the referred slice service SDP."; + } + leaf sdp-description { + type string; + description + "Give more description of the SDP."; + } + uses geolocation-container; + leaf node-id { + type string; + description + "Uniquely identifies an edge node of the SDP."; + } + leaf sdp-ip { + type inet:ip-address; + description + "The IP address of the SDP."; + } + uses service-match-criteria; + uses sdp-peering; + uses sdp-attachment-circuits; + uses service-rate-limit; + /* Per SDP rate limits */ + uses vpn-common:service-status; + uses sdp-monitoring-metrics; + } + + //service-sdp + + grouping connectivity-construct { + description + "Grouping for slice service connectivity construct."; + list connectivity-construct { + key "cc-id"; + description + "List of connectivity constructs."; + leaf cc-id { + type uint32; + description + "The connectivity construct identifier."; + } + choice connectivity-construct-type { + default "p2p"; + description + "Choice for connectivity construct type."; + case p2p { + description + "P2P connectivity construct."; + leaf p2p-sender-sdp { + type leafref { + path "../../../../sdps/sdp/sdp-id"; + } + description + "Reference to a sender SDP."; + } + leaf p2p-receiver-sdp { + type leafref { + path "../../../../sdps/sdp/sdp-id"; + } + description + "Reference to a receiver SDP."; + } + } + case p2mp { + description + "P2MP connectivity construct."; + leaf p2mp-sender-sdp { + type leafref { + path "../../../../sdps/sdp/sdp-id"; + } + description + "Reference to a sender SDP."; + } + leaf-list p2mp-receiver-sdp { + type leafref { + path "../../../../sdps/sdp/sdp-id"; + } + description + "Reference to a receiver SDP."; + } + } + case a2a { + description + "A2A connectivity construct."; + list a2a-sdp { + key "sdp-id"; + description + "List of included A2A SDPs."; + leaf sdp-id { + type leafref { + path "../../../../../sdps/sdp/sdp-id"; + } + description + "Reference to a SDP."; + } + uses service-slo-sle-policy; + } + } + } + uses service-slo-sle-policy; + /* Per connectivity construct service-slo-sle-policy + * overrides the per slice service-slo-sle-policy. + */ + container connectivity-construct-monitoring { + config false; + description + "SLO status per connectivity construct."; + uses connectivity-construct-monitoring-metrics; + } + } + } + + //connectivity-construct + + grouping connection-group { + description + "Grouping for slice service connection group."; + leaf connection-group-id { + type string; + description + "The connection group identifier."; + } + leaf connectivity-type { + type identityref { + base vpn-common:vpn-topology; + } + default "vpn-common:any-to-any"; + description + "Connection group connectivity type."; + } + uses service-slo-sle-policy; + uses connectivity-construct; + /* Per connection group service-slo-sle-policy overrides + * the per slice service-slo-sle-policy. + */ + container connection-group-monitoring { + config false; + description + "SLO status per connection group."; + uses connectivity-construct-monitoring-metrics; + } + } + + //connection-group + + grouping slice-service-template { + description + "Grouping for slice service templates."; + container slo-sle-templates { + description + "Contains a set of slice service templates."; + list slo-sle-template { + key "id"; + leaf id { + type string; + description + "Identification of the Service Level Objective (SLO) + and Service Level Expectation (SLE) template to be used. + Local administration meaning."; + } + leaf template-description { + type string; + description + "Description of the SLO and SLE policy template."; + } + description + "List for SLO and SLE template identifiers."; + } + } + } + + /* Configuration data nodes */ + + grouping service-slo-sle-policy { + description + "Slice service policy grouping."; + choice slo-sle-policy { + description + "Choice for SLO and SLE policy template. + Can be standard template or customized template."; + case standard { + description + "Standard SLO template."; + leaf slo-sle-template { + type leafref { + path "/ietf-nss:network-slice-services" + + "/ietf-nss:slo-sle-templates" + + "/ietf-nss:slo-sle-template/id"; + } + description + "Standard SLO and SLE template to be used."; + } + } + case custom { + description + "Customized SLO and SLE template."; + container service-slo-sle-policy { + description + "Contains the SLO and SLE policy."; + leaf policy-description { + type string; + description + "Description of the SLO and SLE policy."; + } + uses service-metric-bounds; + uses service-sles; + } + } + } + } + + container network-slice-services { + description + "Containes a list of IETF network slice services"; + uses slice-service-template; + list slice-service { + key "service-id"; + description + "A slice service is identified by a service-id."; + leaf service-id { + type string; + description + "A unique slice service identifier."; + } + leaf service-description { + type string; + description + "Textual description of the slice service."; + } + container service-tags { + description + "Container for the list of service tags."; + list tag-type { + key "tag-type"; + description + "The service tag list."; + leaf tag-type { + type identityref { + base service-tag-type; + } + description + "Slice service tag type."; + } + leaf-list value { + type string; + description + "The tag value"; + } + } + list tag-opaque { + key "tag-name"; + description + "The service tag opaquelist."; + leaf tag-name { + type string; + description + "The opaque tag name"; + } + leaf-list value { + type string; + description + "The opaque tag value"; + } + } + } + uses service-slo-sle-policy; + uses vpn-common:service-status; + container sdps { + description + "Slice service SDPs."; + list sdp { + key "sdp-id"; + uses sdp; + description + "List of SDPs in this slice service."; + } + } + container connection-groups { + description + "Contains connections group."; + list connection-group { + key "connection-group-id"; + description + "List of connection groups."; + uses connection-group; + } + } + } + //ietf-network-slice-service list + } +} diff --git a/src/slice/client/SliceClient.py b/src/slice/client/SliceClient.py new file mode 100644 index 0000000000000000000000000000000000000000..a3e5d649032bbf939f9ba6d812b270ca3384cc06 --- /dev/null +++ b/src/slice/client/SliceClient.py @@ -0,0 +1,67 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import grpc, logging +from common.Constants import ServiceNameEnum +from common.Settings import get_service_host, get_service_port_grpc +from common.proto.context_pb2 import Empty, Slice, SliceId +from common.proto.slice_pb2_grpc import SliceServiceStub +from common.tools.client.RetryDecorator import retry, delay_exponential +from common.tools.grpc.Tools import grpc_message_to_json_string + +LOGGER = logging.getLogger(__name__) +MAX_RETRIES = 15 +DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0) +RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect') + +class SliceClient: + def __init__(self, host=None, port=None): + if not host: host = get_service_host(ServiceNameEnum.SLICE) + if not port: port = get_service_port_grpc(ServiceNameEnum.SLICE) + self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) + LOGGER.debug('Creating channel to {:s}...'.format(self.endpoint)) + self.channel = None + self.stub = None + self.connect() + LOGGER.debug('Channel created') + + def connect(self): + self.channel = grpc.insecure_channel(self.endpoint) + self.stub = SliceServiceStub(self.channel) + + def close(self): + if self.channel is not None: self.channel.close() + self.channel = None + self.stub = None + + @RETRY_DECORATOR + def CreateSlice(self, request : Slice) -> SliceId: + LOGGER.debug('CreateSlice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.CreateSlice(request) + LOGGER.debug('CreateSlice result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def UpdateSlice(self, request : Slice) -> SliceId: + LOGGER.debug('UpdateSlice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.UpdateSlice(request) + LOGGER.debug('UpdateSlice result: {:s}'.format(grpc_message_to_json_string(response))) + return response + + @RETRY_DECORATOR + def DeleteSlice(self, request : SliceId) -> Empty: + LOGGER.debug('DeleteSlice request: {:s}'.format(grpc_message_to_json_string(request))) + response = self.stub.DeleteSlice(request) + LOGGER.debug('DeleteSlice result: {:s}'.format(grpc_message_to_json_string(response))) + return response diff --git a/src/slice/client/__init__.py b/src/slice/client/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/slice/client/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/slice/old_code/ConstraintsChecker.py b/src/slice/old_code/ConstraintsChecker.py new file mode 100644 index 0000000000000000000000000000000000000000..a9e244f76a65dbf68f499096f315944db3272b33 --- /dev/null +++ b/src/slice/old_code/ConstraintsChecker.py @@ -0,0 +1,52 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import grpc, logging +from typing import Dict, List, Set, Tuple +from common.Checkers import chk_string +from common.exceptions.ServiceException import ServiceException +from common.proto.context_pb2 import Constraint + +def check_constraint( + logger : logging.Logger, constraint_number : int, parent_name : str, constraint : Constraint, + add_constraints : Dict[str, Dict[str, Set[str]]]) -> Tuple[str, str]: + + try: + constraint_type = chk_string('constraint[#{}].constraint_type'.format(constraint_number), + constraint.constraint_type, + allow_empty=False) + constraint_value = chk_string('constraint[#{}].constraint_value'.format(constraint_number), + constraint.constraint_value, + allow_empty=False) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + if constraint_type in add_constraints: + msg = 'Duplicated ConstraintType({}) in {}.' + msg = msg.format(constraint_type, parent_name) + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, msg) + + add_constraints[constraint_type] = constraint_value + return constraint_type, constraint_value + +def check_constraints(logger : logging.Logger, parent_name : str, constraints): + add_constraints : Dict[str, str] = {} + constraint_tuples : List[Tuple[str, str]] = [] + for constraint_number,constraint in enumerate(constraints): + _parent_name = 'Constraint(#{}) of {}'.format(constraint_number, parent_name) + constraint_type, constraint_value = check_constraint( + logger, constraint_number, _parent_name, constraint, add_constraints) + constraint_tuples.append((constraint_type, constraint_value)) + return constraint_tuples diff --git a/src/slice/old_code/SliceCheckers.py b/src/slice/old_code/SliceCheckers.py new file mode 100644 index 0000000000000000000000000000000000000000..a4412065fad758dc8ca3bdfc19f7b12effde6d67 --- /dev/null +++ b/src/slice/old_code/SliceCheckers.py @@ -0,0 +1,32 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import grpc +from common.database.api.Database import Database +from common.database.api.context.slice.Slice import Slice +from common.exceptions.ServiceException import ServiceException + +def check_slice_exists(database : Database, context_id : str, slice_id : str) -> Slice: + db_context = database.context(context_id).create() + if db_context.slices.contains(slice_id): return db_context.slice(slice_id) + msg = 'Context({})/Slice({}) does not exist in the database.' + msg = msg.format(context_id, slice_id) + raise ServiceException(grpc.StatusCode.NOT_FOUND, msg) + +def check_slice_not_exists(database : Database, context_id : str, slice_id : str): + db_context = database.context(context_id).create() + if not db_context.slices.contains(slice_id): return + msg = 'Context({})/Slice({}) already exists in the database.' + msg = msg.format(context_id, slice_id) + raise ServiceException(grpc.StatusCode.ALREADY_EXISTS, msg) diff --git a/src/slice/old_code/SliceStatus.py b/src/slice/old_code/SliceStatus.py new file mode 100644 index 0000000000000000000000000000000000000000..2104c4dbe8d7a60f5c1ff7489566cd0263949fb9 --- /dev/null +++ b/src/slice/old_code/SliceStatus.py @@ -0,0 +1,45 @@ +# 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 enum import Enum + +class SliceStatus(Enum): + PLANNED = 0 + INIT = 1 + ACTIVE = 2 + DEINIT = 3 + +ANY_TO_ENUM = { + 0: SliceStatus.PLANNED, + 1: SliceStatus.INIT, + 2: SliceStatus.ACTIVE, + 3: SliceStatus.DEINIT, + + '0': SliceStatus.PLANNED, + '1': SliceStatus.INIT, + '2': SliceStatus.ACTIVE, + '3': SliceStatus.DEINIT, + + 'planned': SliceStatus.PLANNED, + 'init': SliceStatus.INIT, + 'active': SliceStatus.ACTIVE, + 'deinit': SliceStatus.DEINIT, +} + +def slicestatus_enum_values(): + return {m.value for m in SliceStatus.__members__.values()} + +def to_slicestatus_enum(int_or_str): + if isinstance(int_or_str, str): int_or_str = int_or_str.lower() + return ANY_TO_ENUM.get(int_or_str) diff --git a/src/slice/old_code/Tools.py b/src/slice/old_code/Tools.py new file mode 100644 index 0000000000000000000000000000000000000000..8260a817711b699b2a0515e360a27ff724960e40 --- /dev/null +++ b/src/slice/old_code/Tools.py @@ -0,0 +1,213 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import grpc, logging +from typing import Dict, List, Set, Tuple +from common.Checkers import chk_options, chk_string +from common.database.api.Database import Database +from common.database.api.context.Constants import DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID +from common.database.api.context.service.Service import Service +from slice.old_code.SliceStatus import SliceStatus, slicestatus_enum_values, to_slicestatus_enum +from common.database.api.context.topology.device.Endpoint import Endpoint +from common.exceptions.ServiceException import ServiceException +from common.proto.slice_pb2 import TransportSlice +from common.tools.service.ConstraintsChecker import check_constraints +from common.tools.service.EndpointIdCheckers import check_endpoint_id +from common.tools.service.DeviceCheckers import check_device_endpoint_exists +from common.tools.service.EnumCheckers import check_enum +from common.tools.service.ServiceCheckers import check_service_exists +from common.tools.service.SliceCheckers import check_slice_exists #, check_slice_not_exists + +# For each method name, define acceptable slice statuses. Empty set means accept all. +ACCEPTED_SLICE_STATUSES : Dict[str, Set[SliceStatus]] = { + 'CreateUpdateSlice': set([SliceStatus.PLANNED, SliceStatus.INIT, SliceStatus.ACTIVE]), + 'DeleteSlice': set([SliceStatus.PLANNED, SliceStatus.DEINIT]), +} + +def _check_slice_exists(method_name : str, database : Database, context_id : str, slice_id : str): + if method_name in ['CreateUpdateSlice']: + # Do nothing; creation implies checking slice does not exist. However, if it exists, we can perform an update. + #check_slice_not_exists(database, context_id, slice_id) + pass + elif method_name in ['DeleteSlice']: + check_slice_exists(database, context_id, slice_id) + else: # pragma: no cover (test requires malforming the code) + msg = 'Unexpected condition [_check_slice_exists(method_name={}, slice_id={})]' + msg = msg.format(str(method_name), str(slice_id)) + raise ServiceException(grpc.StatusCode.UNIMPLEMENTED, msg) + +def _check_slice_endpoints( + logger : logging.Logger, database : Database, context_id : str, slice_id : str, slice_endpoints + ) -> List[Tuple[Endpoint, str]]: + + add_topology_devices_endpoints : Dict[str, Dict[str, Set[str]]] = {} + db_endpoints__port_types : List[Tuple[Endpoint, str]] = [] + for endpoint_number,slice_endpoint in enumerate(slice_endpoints): + parent_name = 'SliceEndpoint(#{}) of Context({})/Slice({})' + parent_name = parent_name.format(endpoint_number, context_id, slice_id) + + ep_topology_id, ep_device_id, ep_port_id = check_endpoint_id( + logger, endpoint_number, parent_name, slice_endpoint.port_id.port_id, add_topology_devices_endpoints, + acceptable_context_ids=set([context_id]), prevent_same_device_multiple_times=False) + + try: + ep_port_type = chk_string('endpoint[#{}].port_type'.format(endpoint_number), + slice_endpoint.port_id.port_type, + allow_empty=False) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + db_endpoint = check_device_endpoint_exists( + database, parent_name, context_id, ep_topology_id, ep_device_id, ep_port_id) + db_endpoints__port_types.append((db_endpoint, ep_port_type)) + return db_endpoints__port_types + +def _check_services( + logger : logging.Logger, database : Database, parent_name : str, context_id : str, slice_service_ids + ) -> List[Service]: + + add_context_services : Dict[str, Set[str]] = {} + db_services : List[Service] = [] + for service_number,service_id in enumerate(slice_service_ids): + # ----- Parse attributes --------------------------------------------------------------------------------------- + try: + service_context_id = chk_string ('services[#{}].contextId.contextUuid.uuid'.format(service_number), + service_id.contextId.contextUuid.uuid, + allow_empty=True) + service_id = chk_string ('services[#{}].cs_id.uuid'.format(service_number), + service_id.cs_id.uuid, + allow_empty=False) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + if len(service_context_id) == 0: service_context_id = context_id + + add_services = add_context_services.setdefault(context_id, dict()) + if service_id in add_services: + msg = 'Duplicated Context({})/Service({}) in {}.' + msg = msg.format(service_context_id, service_id, parent_name) + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, msg) + + db_service = check_service_exists(database, service_context_id, service_id) + db_services.append(db_service) + add_services.add(service_id) + return db_services + +def _check_subslices( + logger : logging.Logger, database : Database, parent_name : str, context_id : str, slice_subslice_ids + ) -> List[Slice]: + + add_context_subslices : Dict[str, Set[str]] = {} + db_subslices : List[Slice] = [] + for subslice_number,subslice_id in enumerate(slice_subslice_ids): + # ----- Parse attributes --------------------------------------------------------------------------------------- + try: + subslice_context_id = chk_string ('subSlicesId[#{}].contextId.contextUuid.uuid'.format(subslice_number), + subslice_id.contextId.contextUuid.uuid, + allow_empty=True) + subslice_id = chk_string ('subSlicesId[#{}].slice_id.uuid'.format(subslice_number), + subslice_id.slice_id.uuid, + allow_empty=False) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + if len(subslice_context_id) == 0: subslice_context_id = context_id + + add_subslices = add_context_subslices.setdefault(context_id, dict()) + if subslice_id in add_subslices: + msg = 'Duplicated Context({})/Slice({}) in {}.' + msg = msg.format(subslice_context_id, subslice_id, parent_name) + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, msg) + + db_subslice = check_slice_exists(database, subslice_context_id, subslice_id) + db_subslices.append(db_subslice) + add_subslices.add(subslice_id) + return db_subslices + +def check_slice_status(method_name : str, value : str) -> SliceStatus: + return check_enum( + 'SliceStatus', method_name, value, to_slicestatus_enum, ACCEPTED_SLICE_STATUSES) + +def check_slice_request( + method_name : str, request : TransportSlice, database : Database, logger : logging.Logger + ): # -> Tuple[str, str, str, OperationalStatus, List[Tuple[Endpoint, str]]]: + + # ----- Parse attributes ------------------------------------------------------------------------------------------- + try: + context_id = chk_string ('slice.slice_id.contextId.contextUuid.uuid', + request.slice_id.contextId.contextUuid.uuid, + allow_empty=True) + slice_id = chk_string ('slice.slice_id.slice_id.uuid', + request.slice_id.slice_id.uuid, + allow_empty=False) + status_context_id = chk_string ('slice.status.slice_id.contextId.contextUuid.uuid', + request.status.slice_id.contextId.contextUuid.uuid, + allow_empty=True) + status_slice_id = chk_string ('slice.status.slice_id.slice_id.uuid', + request.status.slice_id.slice_id.uuid, + allow_empty=True) + slice_status = chk_options('slice.status.status', + request.status.status, + slicestatus_enum_values()) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + if len(context_id) == 0: context_id = DEFAULT_CONTEXT_ID + + if (len(status_context_id) > 0) and (status_context_id != context_id): + msg = ' '.join([ + 'slice.status.slice_id.contextId.contextUuid.uuid({})', + 'is not empty and is different than', + 'slice.slice_id.contextId.contextUuid.uuid({}).', + 'Optionally, leave field empty to use slice.slice_id.contextId.contextUuid.uuid({}), if set,', + 'or, otherwise, the default Context({})' + ]) + msg = msg.format( + status_context_id, context_id, context_id, DEFAULT_CONTEXT_ID) + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, msg) + + if (len(status_slice_id) > 0) and (status_slice_id != slice_id): + msg = ' '.join([ + 'slice.status.slice_id.slice_id.uuid({})', + 'is not empty and is different than', + 'slice.slice_id.slice_id.uuid({}).', + 'Optionally, leave field empty to use slice.slice_id.slice_id.uuid({}).', + ]) + msg = msg.format( + status_slice_id, slice_id, slice_id) + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, msg) + + slice_status = check_slice_status(method_name, slice_status) + + # ----- Check if slice exists in database -------------------------------------------------------------------------- + _check_slice_exists(method_name, database, context_id, slice_id) + + # ----- Parse endpoints and check if they exist in the database as device endpoints -------------------------------- + db_endpoints__port_types = _check_slice_endpoints(logger, database, context_id, slice_id, request.endpoints) + + # ----- Parse constraints ------------------------------------------------------------------------------------------ + parent_name = 'Context({})/Slice({})'.format(context_id, slice_id) + constraint_tuples : List[Tuple[str, str]] = check_constraints(logger, parent_name, request.constraints) + + # ----- Parse Service Ids ------------------------------------------------------------------------------------------ + db_services = _check_services(logger, database, parent_name, context_id, request.services) + + # ----- Parse SubSlice Ids ----------------------------------------------------------------------------------------- + db_subslices = _check_subslices(logger, database, parent_name, context_id, request.subSlicesId) + + return context_id, slice_id, slice_status, db_endpoints__port_types, constraint_tuples, db_services, db_subslices diff --git a/src/slice/old_code/Tools_2.py b/src/slice/old_code/Tools_2.py new file mode 100644 index 0000000000000000000000000000000000000000..fffc9eed3eadc19df361f8fe1521164034b3e140 --- /dev/null +++ b/src/slice/old_code/Tools_2.py @@ -0,0 +1,190 @@ +# 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. + +src/common/tools/service/DeviceCheckers.py + import grpc + from common.database.api.Database import Database + from common.database.api.context.topology.device.Device import Device + from common.database.api.context.topology.device.Endpoint import Endpoint + from common.exceptions.ServiceException import ServiceException + + def check_device_exists(database : Database, context_id : str, topology_id : str, device_id : str) -> Device: + db_context = database.context(context_id).create() + db_topology = db_context.topology(topology_id).create() + if db_topology.devices.contains(device_id): return db_topology.device(device_id) + msg = 'Context({})/Topology({})/Device({}) does not exist in the database.' + msg = msg.format(context_id, topology_id, device_id) + raise ServiceException(grpc.StatusCode.NOT_FOUND, msg) + + +src/common/tools/service/LinkCheckers.py + import grpc + from common.database.api.Database import Database + from common.database.api.context.topology.link.Link import Link + from common.exceptions.ServiceException import ServiceException + + def check_link_exists(database : Database, context_id : str, topology_id : str, link_id : str) -> Link: + db_context = database.context(context_id).create() + db_topology = db_context.topology(topology_id).create() + if db_topology.links.contains(link_id): return db_topology.link(link_id) + msg = 'Context({})/Topology({})/Link({}) does not exist in the database.' + msg = msg.format(context_id, topology_id, link_id) + raise ServiceException(grpc.StatusCode.NOT_FOUND, msg) + + +src/common/tools/service/ServiceCheckers.py + import grpc + from common.database.api.Database import Database + from common.exceptions.ServiceException import ServiceException + + def check_service_exists(database : Database, context_id : str, service_id : str): + if not database.contexts.contains(context_id): + msg = 'Context({}) does not exist in the database.' + msg = msg.format(context_id) + raise ServiceException(grpc.StatusCode.NOT_FOUND, msg) + + db_context = database.context(context_id) + if db_context.services.contains(service_id): + return db_context.service(service_id) + + msg = 'Context({})/Service({}) does not exist in the database.' + msg = msg.format(context_id, service_id) + raise ServiceException(grpc.StatusCode.NOT_FOUND, msg) + + +src/device/service/Tools.py + import grpc, logging + from typing import Dict, List, Set, Tuple + from common.Checkers import chk_options, chk_string + from common.database.api.Database import Database + from common.database.api.context.Constants import DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID + from common.database.api.context.topology.device.Endpoint import Endpoint + from common.database.api.context.topology.device.OperationalStatus import OperationalStatus, \ + operationalstatus_enum_values, to_operationalstatus_enum + from common.exceptions.ServiceException import ServiceException + from common.tools.service.DeviceCheckers import check_device_endpoint_exists + from common.tools.service.EndpointIdCheckers import check_endpoint_id + from common.tools.service.EnumCheckers import check_enum + from common.tools.service.DeviceCheckers import check_device_exists, check_device_not_exists + from device.proto.context_pb2 import Device, DeviceId + + # For each method name, define acceptable device operational statuses. Empty set means accept all. + ACCEPTED_DEVICE_OPERATIONAL_STATUSES : Dict[str, Set[OperationalStatus]] = { + 'AddDevice': set([OperationalStatus.ENABLED, OperationalStatus.DISABLED]), + 'UpdateDevice': set([OperationalStatus.KEEP_STATE, OperationalStatus.ENABLED, OperationalStatus.DISABLED]), + } + + def _check_device_exists(method_name : str, database : Database, device_id : str): + if method_name in ['AddDevice']: + check_device_not_exists(database, DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID, device_id) + elif method_name in ['UpdateDevice', 'DeleteDevice']: + check_device_exists(database, DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID, device_id) + else: # pragma: no cover (test requires malforming the code) + msg = 'Unexpected condition: _check_device_exists(method_name={}, device_id={})' + msg = msg.format(str(method_name), str(device_id)) + raise ServiceException(grpc.StatusCode.UNIMPLEMENTED, msg) + + def _check_device_endpoint_exists_or_get_pointer( + method_name : str, database : Database, parent_name : str, device_id : str, endpoint_id : str) -> Endpoint: + + if method_name in ['AddDevice']: + db_context = database.context(DEFAULT_CONTEXT_ID) + db_topology = db_context.topology(DEFAULT_TOPOLOGY_ID) + db_device = db_topology.device(device_id) + return db_device.endpoint(endpoint_id) + elif method_name in ['UpdateDevice', 'DeleteDevice']: + return check_device_endpoint_exists( + database, parent_name, DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID, device_id, endpoint_id) + else: # pragma: no cover (test requires malforming the code) + msg = 'Unexpected condition: _check_device_endpoint_exists_or_get_pointer(method_name={}, ' \ + 'parent_name={}, device_id={}, endpoint_id={})' + msg = msg.format(str(method_name), str(parent_name), str(device_id), str(endpoint_id)) + raise ServiceException(grpc.StatusCode.UNIMPLEMENTED, msg) + + def check_device_operational_status(method_name : str, value : str) -> OperationalStatus: + return check_enum( + 'OperationalStatus', method_name, value, to_operationalstatus_enum, ACCEPTED_DEVICE_OPERATIONAL_STATUSES) + + def check_device_request( + method_name : str, request : Device, database : Database, logger : logging.Logger + ) -> Tuple[str, str, str, OperationalStatus, List[Tuple[Endpoint, str]]]: + + # ----- Parse attributes ------------------------------------------------------------------------------------------- + try: + device_id = chk_string ('device.device_id.device_id.uuid', + request.device_id.device_id.uuid, + allow_empty=False) + device_type = chk_string ('device.device_type', + request.device_type, + allow_empty=False) + device_config = chk_string ('device.device_config.device_config', + request.device_config.device_config, + allow_empty=True) + device_opstat = chk_options('device.devOperationalStatus', + request.devOperationalStatus, + operationalstatus_enum_values()) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + device_opstat = check_device_operational_status(method_name, device_opstat) + + # ----- Check if device exists in database ------------------------------------------------------------------------- + _check_device_exists(method_name, database, device_id) + + # ----- Parse endpoints and check if they exist in the database as device endpoints -------------------------------- + add_topology_devices_endpoints : Dict[str, Dict[str, Set[str]]] = {} + db_endpoints__port_types : List[Tuple[Endpoint, str]] = [] + for endpoint_number,endpoint in enumerate(request.endpointList): + parent_name = 'Endpoint(#{}) of Context({})/Topology({})/Device({})' + parent_name = parent_name.format(endpoint_number, DEFAULT_CONTEXT_ID, DEFAULT_TOPOLOGY_ID, device_id) + + _, ep_device_id, ep_port_id = check_endpoint_id( + logger, endpoint_number, parent_name, endpoint.port_id, add_topology_devices_endpoints, + predefined_device_id=device_id, acceptable_device_ids=set([device_id]), + prevent_same_device_multiple_times=False) + + try: + ep_port_type = chk_string('endpoint[#{}].port_type'.format(endpoint_number), + endpoint.port_type, + allow_empty=False) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + db_endpoint = _check_device_endpoint_exists_or_get_pointer( + method_name, database, parent_name, ep_device_id, ep_port_id) + db_endpoints__port_types.append((db_endpoint, ep_port_type)) + + return device_id, device_type, device_config, device_opstat, db_endpoints__port_types + + def check_device_id_request( + method_name : str, request : DeviceId, database : Database, logger : logging.Logger) -> str: + + # ----- Parse attributes ------------------------------------------------------------------------------------------- + try: + device_id = chk_string('device_id.device_id.uuid', + request.device_id.uuid, + allow_empty=False) + except Exception as e: + logger.exception('Invalid arguments:') + raise ServiceException(grpc.StatusCode.INVALID_ARGUMENT, str(e)) + + # ----- Check if device exists in database --------------------------------------------------------------------------- + _check_device_exists(method_name, database, device_id) + + return device_id + + +src/service/service/Tools.py diff --git a/src/slice/requirements.in b/src/slice/requirements.in new file mode 100644 index 0000000000000000000000000000000000000000..daef740da4729659fb3117eadff31994acdf5746 --- /dev/null +++ b/src/slice/requirements.in @@ -0,0 +1,16 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +#deepdiff==5.8.* diff --git a/src/slice/service/SliceService.py b/src/slice/service/SliceService.py new file mode 100644 index 0000000000000000000000000000000000000000..4289e5e81a2b0ded58a69368402adfeef6a2e1c0 --- /dev/null +++ b/src/slice/service/SliceService.py @@ -0,0 +1,28 @@ +# 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 common.Constants import ServiceNameEnum +from common.Settings import get_service_port_grpc +from common.proto.slice_pb2_grpc import add_SliceServiceServicer_to_server +from common.tools.service.GenericGrpcService import GenericGrpcService +from slice.service.SliceServiceServicerImpl import SliceServiceServicerImpl + +class SliceService(GenericGrpcService): + def __init__(self, cls_name: str = __name__) -> None: + port = get_service_port_grpc(ServiceNameEnum.SLICE) + super().__init__(port, cls_name=cls_name) + self.slice_servicer = SliceServiceServicerImpl() + + def install_servicers(self): + add_SliceServiceServicer_to_server(self.slice_servicer, self.server) diff --git a/src/slice/service/SliceServiceServicerImpl.py b/src/slice/service/SliceServiceServicerImpl.py new file mode 100644 index 0000000000000000000000000000000000000000..21d820089aad9531834187e129d893e90f3c93a8 --- /dev/null +++ b/src/slice/service/SliceServiceServicerImpl.py @@ -0,0 +1,216 @@ +# 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 typing import Optional +import grpc, json, logging #, deepdiff +from common.proto.context_pb2 import ( + Empty, Service, ServiceId, ServiceStatusEnum, ServiceTypeEnum, Slice, SliceId, SliceStatusEnum) +from common.proto.slice_pb2_grpc import SliceServiceServicer +from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method +from common.tools.context_queries.InterDomain import is_multi_domain +from common.tools.context_queries.Slice import get_slice +from common.tools.grpc.ConfigRules import copy_config_rules +from common.tools.grpc.Constraints import copy_constraints +from common.tools.grpc.EndPointIds import copy_endpoint_ids +from common.tools.grpc.ServiceIds import update_service_ids +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from interdomain.client.InterdomainClient import InterdomainClient +from service.client.ServiceClient import ServiceClient + +LOGGER = logging.getLogger(__name__) + +METRICS_POOL = MetricsPool('Slice', 'RPC') + +class SliceServiceServicerImpl(SliceServiceServicer): + def __init__(self): + LOGGER.debug('Creating Servicer...') + LOGGER.debug('Servicer Created') + + def create_update(self, request : Slice) -> SliceId: + # Set slice status to "SERVICESTATUS_PLANNED" to ensure rest of components are aware the slice is + # being modified. + context_client = ContextClient() + slice_ro : Optional[Service] = get_slice( + context_client, request.slice_id.slice_uuid.uuid, request.slice_id.context_id.context_uuid.uuid, + rw_copy=False) + + slice_rw = Slice() + slice_rw.CopyFrom(request if slice_ro is None else slice_ro) + slice_rw.name = request.name + slice_rw.slice_owner.CopyFrom(request.slice_owner) # pylint: disable=no-member + slice_rw.slice_status.slice_status = SliceStatusEnum.SLICESTATUS_PLANNED # pylint: disable=no-member + + copy_endpoint_ids(request.slice_endpoint_ids, slice_rw.slice_endpoint_ids ) # pylint: disable=no-member + copy_constraints (request.slice_constraints, slice_rw.slice_constraints ) # pylint: disable=no-member + copy_config_rules(request.slice_config.config_rules, slice_rw.slice_config.config_rules) # pylint: disable=no-member + + slice_id_with_uuids = context_client.SetSlice(slice_rw) + + if len(slice_rw.slice_endpoint_ids) < 2: # pylint: disable=no-member + # unable to identify the kind of slice; just update endpoints, constraints and config rules + # update the slice in database, and return + # pylint: disable=no-member + return context_client.SetSlice(slice_rw) + + slice_with_uuids = context_client.GetSlice(slice_id_with_uuids) + + #LOGGER.info('json_current_slice = {:s}'.format(str(json_current_slice))) + #json_updated_slice = grpc_message_to_json(request) + #LOGGER.info('json_updated_slice = {:s}'.format(str(json_updated_slice))) + #changes = deepdiff.DeepDiff(json_current_slice, json_updated_slice) + #LOGGER.info('changes = {:s}'.format(str(changes))) + + if is_multi_domain(context_client, slice_with_uuids.slice_endpoint_ids): + interdomain_client = InterdomainClient() + slice_id = interdomain_client.RequestSlice(slice_with_uuids) + slice_ = context_client.GetSlice(slice_id) + slice_active = Slice() + slice_active.CopyFrom(slice_) + slice_active.slice_status.slice_status = SliceStatusEnum.SLICESTATUS_ACTIVE # pylint: disable=no-member + context_client.SetSlice(slice_active) + return slice_id + + # Local domain slice + service_id = ServiceId() + # pylint: disable=no-member + context_uuid = service_id.context_id.context_uuid.uuid = slice_with_uuids.slice_id.context_id.context_uuid.uuid + service_uuid = service_id.service_uuid.uuid = slice_with_uuids.slice_id.slice_uuid.uuid + + service_client = ServiceClient() + try: + _service = context_client.GetService(service_id) + except: # pylint: disable=bare-except + # pylint: disable=no-member + service_request = Service() + service_request.service_id.CopyFrom(service_id) + service_request.service_type = ServiceTypeEnum.SERVICETYPE_UNKNOWN + service_request.service_status.service_status = ServiceStatusEnum.SERVICESTATUS_PLANNED + service_client.CreateService(service_request) + _service = context_client.GetService(service_id) + service_request = Service() + service_request.CopyFrom(_service) + + # pylint: disable=no-member + copy_endpoint_ids(request.slice_endpoint_ids, service_request.service_endpoint_ids) + copy_constraints(request.slice_constraints, service_request.service_constraints) + copy_config_rules(request.slice_config.config_rules, service_request.service_config.config_rules) + + service_request.service_type = ServiceTypeEnum.SERVICETYPE_UNKNOWN + for config_rule in request.slice_config.config_rules: + LOGGER.info('config_rule: {:s}'.format(grpc_message_to_json_string(config_rule))) + config_rule_kind = config_rule.WhichOneof('config_rule') + LOGGER.info('config_rule_kind: {:s}'.format(str(config_rule_kind))) + if config_rule_kind != 'custom': continue + custom = config_rule.custom + resource_key = custom.resource_key + LOGGER.info('resource_key: {:s}'.format(str(resource_key))) + + # TODO: parse resource key with regular expression, e.g.: + # m = re.match('\/device\[[^\]]\]\/endpoint\[[^\]]\]\/settings', s) + if not resource_key.startswith('/device'): continue + if not resource_key.endswith('/settings'): continue + + resource_value = json.loads(custom.resource_value) + LOGGER.info('resource_value: {:s}'.format(str(resource_value))) + + if service_request.service_type == ServiceTypeEnum.SERVICETYPE_UNKNOWN: + if (resource_value.get('address_ip') is not None and \ + resource_value.get('address_prefix') is not None): + service_request.service_type = ServiceTypeEnum.SERVICETYPE_L3NM + LOGGER.info('is L3') + else: + service_request.service_type = ServiceTypeEnum.SERVICETYPE_L2NM + LOGGER.info('is L2') + break + + if service_request.service_type == ServiceTypeEnum.SERVICETYPE_UNKNOWN: + service_request.service_type = ServiceTypeEnum.SERVICETYPE_L2NM + LOGGER.info('assume L2') + + service_client.UpdateService(service_request) + + #copy_endpoint_ids(request.slice_endpoint_ids, slice_with_uuids.slice_endpoint_ids) + #copy_constraints(request.slice_constraints, slice_with_uuids.slice_constraints) + #copy_config_rules(request.slice_config.config_rules, slice_with_uuids.slice_config.config_rules) + + update_service_ids(slice_with_uuids.slice_service_ids, context_uuid, service_uuid) + context_client.SetSlice(slice_with_uuids) + slice_id = slice_with_uuids.slice_id + + slice_ = context_client.GetSlice(slice_id) + slice_active = Slice() + slice_active.CopyFrom(slice_) + slice_active.slice_status.slice_status = SliceStatusEnum.SLICESTATUS_ACTIVE # pylint: disable=no-member + context_client.SetSlice(slice_active) + return slice_id + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def CreateSlice(self, request : Slice, context : grpc.ServicerContext) -> SliceId: + #try: + # slice_ = context_client.GetSlice(request.slice_id) + # slice_id = slice_.slice_id + #except grpc.RpcError: + # slice_id = context_client.SetSlice(request) + #return slice_id + return self.create_update(request) + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def UpdateSlice(self, request : Slice, context : grpc.ServicerContext) -> SliceId: + #slice_id = context_client.SetSlice(request) + #if len(request.slice_endpoint_ids) != 2: return slice_id + # + #domains = set() + #for slice_endpoint_id in request.slice_endpoint_ids: + # device_uuid = slice_endpoint_id.device_id.device_uuid.uuid + # domains.add(device_uuid.split('@')[0]) + # + #is_multi_domain = len(domains) == 2 + #if is_multi_domain: + # interdomain_client = InterdomainClient() + # return interdomain_client.LookUpSlice(request) + #else: + # raise NotImplementedError('Slice should create local services for single domain slice') + return self.create_update(request) + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def DeleteSlice(self, request : SliceId, context : grpc.ServicerContext) -> Empty: + context_client = ContextClient() + try: + _slice = context_client.GetSlice(request) + except: # pylint: disable=bare-except + return Empty() + + if is_multi_domain(context_client, _slice.slice_endpoint_ids): + #interdomain_client = InterdomainClient() + #slice_id = interdomain_client.DeleteSlice(request) + raise NotImplementedError('Delete inter-domain slice') + else: + current_slice = Slice() + current_slice.CopyFrom(_slice) + current_slice.slice_status.slice_status = SliceStatusEnum.SLICESTATUS_DEINIT # pylint: disable=no-member + context_client.SetSlice(current_slice) + + service_client = ServiceClient() + for service_id in _slice.slice_service_ids: + current_slice = Slice() + current_slice.slice_id.CopyFrom(_slice.slice_id) # pylint: disable=no-member + slice_service_id = current_slice.slice_service_ids.add() # pylint: disable=no-member + slice_service_id.CopyFrom(service_id) + context_client.UnsetSlice(current_slice) + + service_client.DeleteService(service_id) + + context_client.RemoveSlice(request) + return Empty() diff --git a/src/slice/service/__init__.py b/src/slice/service/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/slice/service/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/slice/service/__main__.py b/src/slice/service/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..aef1c4b82a540ddb40f35f4af2340ead539a0451 --- /dev/null +++ b/src/slice/service/__main__.py @@ -0,0 +1,67 @@ +# 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, signal, sys, threading +from prometheus_client import start_http_server +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, + wait_for_environment_variables) +from .SliceService import SliceService + +terminate = threading.Event() +LOGGER : logging.Logger = None + +def signal_handler(signal, frame): # pylint: disable=redefined-outer-name + LOGGER.warning('Terminate signal received') + terminate.set() + +def main(): + global LOGGER # pylint: disable=global-statement + + log_level = get_log_level() + logging.basicConfig(level=log_level, format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s") + LOGGER = logging.getLogger(__name__) + + wait_for_environment_variables([ + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + get_env_var_name(ServiceNameEnum.SERVICE, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.SERVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + ]) + + signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGTERM, signal_handler) + + LOGGER.info('Starting...') + + # Start metrics server + metrics_port = get_metrics_port() + start_http_server(metrics_port) + + # Starting slice service + grpc_service = SliceService() + grpc_service.start() + + # Wait for Ctrl+C or termination signal + while not terminate.wait(timeout=0.1): pass + + LOGGER.info('Terminating...') + grpc_service.stop() + + LOGGER.info('Bye') + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/slice/tests/__init__.py b/src/slice/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/slice/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/slice/tests/test_unitary.py b/src/slice/tests/test_unitary.py new file mode 100644 index 0000000000000000000000000000000000000000..a61ccbcd603cc69025b98051d5480570bd4018ff --- /dev/null +++ b/src/slice/tests/test_unitary.py @@ -0,0 +1,49 @@ +# 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, os, pytest +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_service_port_grpc) +from slice.client.SliceClient import SliceClient +from slice.service.SliceService import SliceService + +LOCAL_HOST = '127.0.0.1' +MOCKSERVICE_PORT = 10000 +SLICE_SERVICE_PORT = MOCKSERVICE_PORT + get_service_port_grpc(ServiceNameEnum.SLICE) # avoid privileged ports +os.environ[get_env_var_name(ServiceNameEnum.SLICE, ENVVAR_SUFIX_SERVICE_HOST )] = str(LOCAL_HOST) +os.environ[get_env_var_name(ServiceNameEnum.SLICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC)] = str(SLICE_SERVICE_PORT) + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +@pytest.fixture(scope='session') +def slice_service(): + _service = SliceService() + _service.start() + yield _service + _service.stop() + +@pytest.fixture(scope='session') +def slice_client(slice_service : SliceService): # pylint: disable=redefined-outer-name + _client = SliceClient() + yield _client + _client.close() + +#def test_add_device_wrong_attributes(slice_client : SliceClient): +# # should fail with slice uuid is empty +# with pytest.raises(grpc._channel._InactiveRpcError) as e: +# slice_client.CreateUpdateSlice(TransportSlice()) +# assert e.value.code() == grpc.StatusCode.INVALID_ARGUMENT +# assert e.value.details() == 'slice.slice_id.slice_id.uuid() string is empty.' diff --git a/src/start.sh b/src/start.sh index dc9db79d27d4d1b459092bf2f9a8f43bb5581511..32a016cc07d2602d5e00b7540b03355f539ed61d 100755 --- a/src/start.sh +++ b/src/start.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/start_webui_dev_mode.sh b/src/start_webui_dev_mode.sh index d9e143b4873406b196b1e7f726c5d458b2994f05..fe2587c1a596bb49558fe8f1cd9238727277bbfe 100755 --- a/src/start_webui_dev_mode.sh +++ b/src/start_webui_dev_mode.sh @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,17 +14,23 @@ # for development purposes only -export CONTEXTSERVICE_SERVICE_HOST=`kubectl get service/contextservice -n tf-dev -o jsonpath='{.spec.clusterIP}'` +# K8S_NAMESPACE=${K8S_NAMESPACE:-'tf-dev'} -echo Context IP: $CONTEXTSERVICE_SERVICE_HOST +# export CONTEXTSERVICE_SERVICE_HOST=`kubectl get service/contextservice -n ${K8S_NAMESPACE} -o jsonpath='{.spec.clusterIP}'` -export DEVICESERVICE_SERVICE_HOST=`kubectl get service/deviceservice -n tf-dev -o jsonpath='{.spec.clusterIP}'` +# echo Context IP: $CONTEXTSERVICE_SERVICE_HOST -echo Device IP: $DEVICESERVICE_SERVICE_HOST +# export DEVICESERVICE_SERVICE_HOST=`kubectl get service/deviceservice -n ${K8S_NAMESPACE} -o jsonpath='{.spec.clusterIP}'` + +# echo Device IP: $DEVICESERVICE_SERVICE_HOST + +source tfs_runtime_env_vars.sh export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION='python' export HOST="127.0.0.1" +export HOSTNAME="test" export FLASK_ENV="development" +export LOG_LEVEL="DEBUG" # python3 -m webbrowser http://${HOST}:8004 diff --git a/src/tests/.gitlab-ci.yml b/src/tests/.gitlab-ci.yml index e663b09ec1d79a14f76d37a4ac906e534667ac26..db44b9e4a8d29475a0b6cd620ffd9a6961f8cdc5 100644 --- a/src/tests/.gitlab-ci.yml +++ b/src/tests/.gitlab-ci.yml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,4 +14,5 @@ # include the individual .gitlab-ci.yml of each integration test include: - - local: '/src/tests/ofc22_bootstrap_monitor_l3vpn/.gitlab-ci.yml' + - local: '/src/tests/ofc22/.gitlab-ci.yml' + - local: '/src/tests/oeccpsc22/.gitlab-ci.yml' diff --git a/src/tests/Fixtures.py b/src/tests/Fixtures.py new file mode 100644 index 0000000000000000000000000000000000000000..ecb44a7588d62e14f4295141adb3acc7bbe89532 --- /dev/null +++ b/src/tests/Fixtures.py @@ -0,0 +1,36 @@ +# 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 pytest +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from monitoring.client.MonitoringClient import MonitoringClient + +@pytest.fixture(scope='session') +def context_client(): + _client = ContextClient() + yield _client + _client.close() + +@pytest.fixture(scope='session') +def device_client(): + _client = DeviceClient() + yield _client + _client.close() + +@pytest.fixture(scope='session') +def monitoring_client(): + _client = MonitoringClient() + yield _client + _client.close() diff --git a/src/tests/__init__.py b/src/tests/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/tests/__init__.py +++ b/src/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/tests/benchmark/automation/.gitignore b/src/tests/benchmark/automation/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..0a3f4400d5c88b1af32c7667d69d2fdc12d5424e --- /dev/null +++ b/src/tests/benchmark/automation/.gitignore @@ -0,0 +1,2 @@ +# Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. +descriptors_real.json diff --git a/src/tests/benchmark/automation/README.md b/src/tests/benchmark/automation/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8b5b2a01efc357b5d8eca6a6890b051b4ffac260 --- /dev/null +++ b/src/tests/benchmark/automation/README.md @@ -0,0 +1,17 @@ + +# Grafana k6 load testing tool + +# K6 Installation Instructions on Ubuntu + +sudo gpg --no-default-keyring --keyring /usr/share/keyrings/k6-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69 +echo "deb [signed-by=/usr/share/keyrings/k6-archive-keyring.gpg] https://dl.k6.io/deb stable main" | sudo tee /etc/apt/sources.list.d/k6.list +sudo apt-get update +sudo apt-get install k6 + +Or install k6 via snap: + +sudo apt install snapd +sudo snap install k6 + +# Running K6 +k6 run script.js \ No newline at end of file diff --git a/src/tests/benchmark/automation/ZtpAdd.js b/src/tests/benchmark/automation/ZtpAdd.js new file mode 100644 index 0000000000000000000000000000000000000000..d7740ad32c8b685a31a31c5fc09a7a7cc6ef27a0 --- /dev/null +++ b/src/tests/benchmark/automation/ZtpAdd.js @@ -0,0 +1,71 @@ +/** + * Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import grpc from 'k6/net/grpc'; +import exec from "k6/execution"; +import { check, sleep } from 'k6'; + +const client = new grpc.Client(); +client.load(['../../../../proto'], 'automation.proto'); + +export const data = []; +for (let i = 1; i < 801; i++) { + data.push({ + "devRoleType": "DEV_CONF", + "devRoleId": { + "devId": {"device_uuid": {"uuid": "EMU-" + i}}, + "devRoleId": {"uuid": "EMU-" + i} + } + }); +}; + +export const options = { + scenarios :{ + + "ZtpAdd-scenario": { + executor: "shared-iterations", + vus: 800, + iterations: data.length, + maxDuration: "1h" + } + } +}; + +export default () => { + client.connect('10.1.255.239:5050', { + plaintext: true, + timeout: 10000 + }); + + var item = data[exec.scenario.iterationInInstance]; + const response = client.invoke('automation.AutomationService/ZtpAdd', item); + + check(response, { + 'status is OK': (r) => r && r.status === grpc.StatusOK, + }); + + console.log(JSON.stringify(response.message)); + + client.close(); + sleep(1); +}; + +export function handleSummary(data) { + + return { + 'summary_add_800.json': JSON.stringify(data.metrics.grpc_req_duration.values), //the default data object + }; +} diff --git a/src/tests/benchmark/automation/ZtpDelete.js b/src/tests/benchmark/automation/ZtpDelete.js new file mode 100644 index 0000000000000000000000000000000000000000..b1b7f3a09734d484ef14868cbf93c87dce79f357 --- /dev/null +++ b/src/tests/benchmark/automation/ZtpDelete.js @@ -0,0 +1,71 @@ +/** + * Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import grpc from 'k6/net/grpc'; +import exec from "k6/execution"; +import { check, sleep } from 'k6'; + +const client = new grpc.Client(); +client.load(['../../../../proto'], 'automation.proto'); + +export const data = []; +for (let i = 1; i < 801; i++) { + data.push({ + "devRoleType": "DEV_CONF", + "devRoleId": { + "devId": {"device_uuid": {"uuid": "EMU-" + i}}, + "devRoleId": {"uuid": "EMU-" + i} + } + }); +}; + +export const options = { + scenarios :{ + + "ZtpAdd-scenario": { + executor: "shared-iterations", + vus: 800, + iterations: data.length, + maxDuration: "1h" + } + } +}; + +export default () => { + client.connect('10.1.255.232:5050', { + plaintext: true, + timeout: 10000 + }); + + var item = data[exec.scenario.iterationInInstance]; + const response = client.invoke('automation.AutomationService/ZtpDelete', item); + + check(response, { + 'status is OK': (r) => r && r.status === grpc.StatusOK, + }); + + console.log(JSON.stringify(response.message)); + + client.close(); + sleep(1); +}; + +export function handleSummary(data) { + + return { + 'summary_delete_800.json': JSON.stringify(data.metrics.grpc_req_duration.values), //the default data object + }; +} diff --git a/src/tests/benchmark/automation/ZtpUpdate.js b/src/tests/benchmark/automation/ZtpUpdate.js new file mode 100644 index 0000000000000000000000000000000000000000..c274d22861ae6df52906d57cfb545eb1dc3c94c2 --- /dev/null +++ b/src/tests/benchmark/automation/ZtpUpdate.js @@ -0,0 +1,76 @@ +/** + * Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import grpc from 'k6/net/grpc'; +import exec from "k6/execution"; +import { check, sleep } from 'k6'; + +const client = new grpc.Client(); +client.load(['../../../../proto'], 'automation.proto'); + +export const data = []; +for (let i = 1; i < 801; i++) { + data.push({ + "devRole": { + "devRoleType": "DEV_CONF", + "devRoleId": { + "devId": {"device_uuid": {"uuid": "EMU-"+i}}, + "devRoleId": {"uuid": "1"} + } + }, + "devConfig": { + "config_rules": [] + } + }); +}; + +export const options = { + scenarios :{ + + "ZtpAdd-scenario": { + executor: "shared-iterations", + vus: 800, + iterations: data.length, + maxDuration: "1h" + } + } +}; + +export default () => { + client.connect('10.1.255.250:5050', { + plaintext: true, + timeout: 10000 + }); + + var item = data[exec.scenario.iterationInInstance]; + const response = client.invoke('automation.AutomationService/ZtpUpdate', item); + + check(response, { + 'status is OK': (r) => r && r.status === grpc.StatusOK, + }); + + console.log(JSON.stringify(response.message)); + + client.close(); + sleep(1); +}; + +export function handleSummary(data) { + + return { + 'summaryUpdate801.json': JSON.stringify(data.metrics.grpc_req_duration.values), //the default data object + }; +} diff --git a/src/tests/benchmark/automation/__init__.py b/src/tests/benchmark/automation/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/tests/benchmark/automation/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/tests/benchmark/automation/run_test_01_bootstrap.sh b/src/tests/benchmark/automation/run_test_01_bootstrap.sh new file mode 100755 index 0000000000000000000000000000000000000000..2382521b26cbf6217aacea7c2f9d86fdac1209be --- /dev/null +++ b/src/tests/benchmark/automation/run_test_01_bootstrap.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. + +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 diff --git a/src/tests/benchmark/automation/run_test_02_cleanup.sh b/src/tests/benchmark/automation/run_test_02_cleanup.sh new file mode 100755 index 0000000000000000000000000000000000000000..56965d2007b441ab76ab07777a04c25b38eb8b28 --- /dev/null +++ b/src/tests/benchmark/automation/run_test_02_cleanup.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. + +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 diff --git a/src/tests/benchmark/automation/tests/.gitignore b/src/tests/benchmark/automation/tests/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..76cb708d1b532c9b69166e55f36bcb912fd5e370 --- /dev/null +++ b/src/tests/benchmark/automation/tests/.gitignore @@ -0,0 +1,2 @@ +# Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. +Credentials.py diff --git a/src/tests/benchmark/automation/tests/Fixtures.py b/src/tests/benchmark/automation/tests/Fixtures.py new file mode 100644 index 0000000000000000000000000000000000000000..89dda54cf945d7078cd61c4b94b282f650429309 --- /dev/null +++ b/src/tests/benchmark/automation/tests/Fixtures.py @@ -0,0 +1,28 @@ +# 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 pytest, logging +from common.Settings import get_setting +from tests.tools.mock_osm.Constants import WIM_PASSWORD, WIM_USERNAME +from tests.tools.mock_osm.MockOSM import MockOSM +from .Objects import WIM_MAPPING + +LOGGER = logging.getLogger(__name__) + +@pytest.fixture(scope='session') +def osm_wim(): + wim_url = 'http://{:s}:{:s}'.format( + get_setting('COMPUTESERVICE_SERVICE_HOST'), str(get_setting('COMPUTESERVICE_SERVICE_PORT_HTTP'))) + LOGGER.info('WIM_MAPPING = {:s}'.format(str(WIM_MAPPING))) + return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) diff --git a/src/tests/benchmark/automation/tests/Objects.py b/src/tests/benchmark/automation/tests/Objects.py new file mode 100644 index 0000000000000000000000000000000000000000..8558d1fe7af84f1e312bc44eb458a3624ed694ae --- /dev/null +++ b/src/tests/benchmark/automation/tests/Objects.py @@ -0,0 +1,54 @@ +# 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 typing import Dict, List, Tuple +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Device import ( + json_device_connect_rules, json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, + json_device_emulated_tapi_disabled, json_device_id, json_device_packetrouter_disabled, json_device_tapi_disabled) +from common.tools.object_factory.EndPoint import json_endpoint, json_endpoint_id +from common.tools.object_factory.Link import json_link, json_link_id +from common.tools.object_factory.Topology import json_topology, json_topology_id +from common.proto.kpi_sample_types_pb2 import KpiSampleType + +# ----- Context -------------------------------------------------------------------------------------------------------- +CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) +CONTEXT = json_context(DEFAULT_CONTEXT_NAME) + +# ----- Topology ------------------------------------------------------------------------------------------------------- +TOPOLOGY_ID = json_topology_id(DEFAULT_TOPOLOGY_NAME, context_id=CONTEXT_ID) +TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_NAME, context_id=CONTEXT_ID) + +# ----- Monitoring Samples --------------------------------------------------------------------------------------------- +PACKET_PORT_SAMPLE_TYPES = [ + KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED, + KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED, + KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED, + KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED, +] + +# ----- Devices -------------------------------------------------------------------------------------------------------- +DEVICE_ENDPOINT_DEFS = [('13/0/0', 'optical', []), ('13/1/2', 'copper', PACKET_PORT_SAMPLE_TYPES)] +DEVICE_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_ENDPOINT_DEFS) + +# ----- Object Collections --------------------------------------------------------------------------------------------- +CONTEXTS = [CONTEXT] +TOPOLOGIES = [TOPOLOGY] + +DEVICES = [] +for x in range(1, 1000): + DEVICE_UUID = 'EMU-' + str(x) + DEVICE = json_device_emulated_packet_router_disabled(DEVICE_UUID) + DEVICES.append((DEVICE, DEVICE_CONNECT_RULES)) diff --git a/src/tests/benchmark/automation/tests/__init__.py b/src/tests/benchmark/automation/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/tests/benchmark/automation/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/tests/benchmark/automation/tests/test_functional_bootstrap.py b/src/tests/benchmark/automation/tests/test_functional_bootstrap.py new file mode 100644 index 0000000000000000000000000000000000000000..f61125a8c2bbb9e96785d176b14eabf08e9419a1 --- /dev/null +++ b/src/tests/benchmark/automation/tests/test_functional_bootstrap.py @@ -0,0 +1,110 @@ +# 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.Settings import get_setting +from common.proto.monitoring_pb2 import KpiDescriptorList +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.Link import json_link_id +from common.tools.object_factory.Topology import json_topology_id +from context.client.ContextClient import ContextClient +from monitoring.client.MonitoringClient import MonitoringClient +from context.client.EventsCollector import EventsCollector +from common.proto.context_pb2 import Context, ContextId, Device, Empty, Topology +from device.client.DeviceClient import DeviceClient +from .Objects import CONTEXT_ID, CONTEXTS, DEVICES, TOPOLOGIES +from tests.Fixtures import context_client, device_client, monitoring_client + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + + +def test_scenario_empty(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure database is empty ------------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == 0 + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 + + +def test_prepare_scenario(context_client : ContextClient): # pylint: disable=redefined-outer-name + + # ----- Create Contexts and Topologies ----------------------------------------------------------------------------- + for context in CONTEXTS: + context_uuid = context['context_id']['context_uuid']['uuid'] + LOGGER.info('Adding Context {:s}'.format(context_uuid)) + response = context_client.SetContext(Context(**context)) + assert response.context_uuid.uuid == context_uuid + + for topology in TOPOLOGIES: + context_uuid = topology['topology_id']['context_id']['context_uuid']['uuid'] + topology_uuid = topology['topology_id']['topology_uuid']['uuid'] + LOGGER.info('Adding Topology {:s}/{:s}'.format(context_uuid, topology_uuid)) + response = context_client.SetTopology(Topology(**topology)) + assert response.context_id.context_uuid.uuid == context_uuid + assert response.topology_uuid.uuid == topology_uuid + context_id = json_context_id(context_uuid) + + +def test_scenario_ready(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure scenario is ready ------------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(CONTEXTS) + + response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) + assert len(response.topologies) == len(TOPOLOGIES) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 + + +def test_devices_bootstraping( + context_client : ContextClient, device_client : DeviceClient): # pylint: disable=redefined-outer-name + + # ----- Create Devices and Validate Collected Events --------------------------------------------------------------- + for device, connect_rules in DEVICES: + device_uuid = device['device_id']['device_uuid']['uuid'] + LOGGER.info('Adding Device {:s}'.format(device_uuid)) + + device_with_connect_rules = copy.deepcopy(device) + device_with_connect_rules['device_config']['config_rules'].extend(connect_rules) + response = device_client.AddDevice(Device(**device_with_connect_rules)) + assert response.device_uuid.uuid == device_uuid + + +def test_devices_bootstrapped(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure bevices are created ----------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(CONTEXTS) + + response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) + assert len(response.topologies) == len(TOPOLOGIES) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(DEVICES) + + +def test_links_created(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure links are created ------------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(CONTEXTS) + + response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) + assert len(response.topologies) == len(TOPOLOGIES) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(DEVICES) \ No newline at end of file diff --git a/src/tests/benchmark/automation/tests/test_functional_cleanup.py b/src/tests/benchmark/automation/tests/test_functional_cleanup.py new file mode 100644 index 0000000000000000000000000000000000000000..4b0c52dd4aea4ec7e4adb576c9557d53713ba332 --- /dev/null +++ b/src/tests/benchmark/automation/tests/test_functional_cleanup.py @@ -0,0 +1,68 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging, pytest +from common.Settings import get_setting +from common.tests.EventTools import EVENT_REMOVE, 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.Link import json_link_id +from common.tools.object_factory.Topology import json_topology_id +from context.client.ContextClient import ContextClient +from context.client.EventsCollector import EventsCollector +from common.proto.context_pb2 import ContextId, DeviceId, Empty, LinkId, TopologyId +from device.client.DeviceClient import DeviceClient +from tests.Fixtures import context_client, device_client +from .Objects import CONTEXT_ID, CONTEXTS, DEVICES, TOPOLOGIES + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +def test_scenario_cleanup( + context_client : ContextClient, device_client : DeviceClient): # pylint: disable=redefined-outer-name + + # ----- Delete Devices and Validate Collected Events --------------------------------------------------------------- + for device, _ in DEVICES: + device_id = device['device_id'] + device_uuid = device_id['device_uuid']['uuid'] + LOGGER.info('Deleting Device {:s}'.format(device_uuid)) + device_client.DeleteDevice(DeviceId(**device_id)) + #expected_events.append(('DeviceEvent', EVENT_REMOVE, json_device_id(device_uuid))) + + # ----- Delete Topologies and Validate Collected Events ------------------------------------------------------------ + for topology in TOPOLOGIES: + topology_id = topology['topology_id'] + context_uuid = topology_id['context_id']['context_uuid']['uuid'] + topology_uuid = topology_id['topology_uuid']['uuid'] + LOGGER.info('Deleting Topology {:s}/{:s}'.format(context_uuid, topology_uuid)) + context_client.RemoveTopology(TopologyId(**topology_id)) + context_id = json_context_id(context_uuid) + #expected_events.append(('TopologyEvent', EVENT_REMOVE, json_topology_id(topology_uuid, context_id=context_id))) + + # ----- Delete Contexts and Validate Collected Events -------------------------------------------------------------- + for context in CONTEXTS: + context_id = context['context_id'] + context_uuid = context_id['context_uuid']['uuid'] + LOGGER.info('Deleting Context {:s}'.format(context_uuid)) + context_client.RemoveContext(ContextId(**context_id)) + #expected_events.append(('ContextEvent', EVENT_REMOVE, json_context_id(context_uuid))) + + +def test_scenario_empty_again(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure database is empty again ------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == 0 + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 diff --git a/src/tests/benchmark/policy/.gitignore b/src/tests/benchmark/policy/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..0a3f4400d5c88b1af32c7667d69d2fdc12d5424e --- /dev/null +++ b/src/tests/benchmark/policy/.gitignore @@ -0,0 +1,2 @@ +# Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. +descriptors_real.json diff --git a/src/tests/benchmark/policy/PolicyAddService.js b/src/tests/benchmark/policy/PolicyAddService.js new file mode 100644 index 0000000000000000000000000000000000000000..d765709975d8ed14cb7696b14cdf1a07a2707b3d --- /dev/null +++ b/src/tests/benchmark/policy/PolicyAddService.js @@ -0,0 +1,88 @@ +/** + * Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import grpc from 'k6/net/grpc'; +import exec from "k6/execution"; +import { check, sleep } from 'k6'; + +const client = new grpc.Client(); +client.load(['../proto'], 'policy.proto'); + +export const data = []; +for (let i = 1; i < 2; i++) { + data.push( + { + "serviceId": { + "context_id": { + "context_uuid": {"uuid": "admin"} + }, + "service_uuid": { + "uuid": "6942d780-cfa9-4dea-a946-a8a0b3f7eab2" + } + }, + "policyRuleBasic": { + "policyRuleId": {"uuid": {"uuid": i.toString()}}, + "policyRuleState": {"policyRuleState": "POLICY_UNDEFINED"}, + "priority": 0, + "conditionList": [{"kpiId": {"kpi_id": {"uuid": "1"}}, + "numericalOperator": "POLICYRULE_CONDITION_NUMERICAL_EQUAL", + "kpiValue": {"boolVal": false} + + }], + "actionList": [{}], + "booleanOperator": "POLICYRULE_CONDITION_BOOLEAN_UNDEFINED" + } + } + ); +}; + +export const options = { + scenarios :{ + + "AddPolicy-scenario": { + executor: "shared-iterations", + vus: 1, + iterations: data.length, + maxDuration: "1h" + } + } +}; + +export default () => { + client.connect('10.1.255.198:6060', { + plaintext: true, +// timeout: 10000 + }); + + var item = data[exec.scenario.iterationInInstance]; + const response = client.invoke('policy.PolicyService/PolicyAddService', item); + + check(response, { + 'status is OK': (r) => r && r.status === grpc.StatusOK, + }); + + console.log(JSON.stringify(response.message)); + + client.close(); + sleep(1); +}; + +export function handleSummary(data) { + + return { + 'summary_add_1.json': JSON.stringify(data.metrics.grpc_req_duration.values), //the default data object + }; +} diff --git a/src/tests/benchmark/policy/PolicyDelete.js b/src/tests/benchmark/policy/PolicyDelete.js new file mode 100644 index 0000000000000000000000000000000000000000..6ec85a6a3c30b7b8af258918a49cb8e8e7adeb67 --- /dev/null +++ b/src/tests/benchmark/policy/PolicyDelete.js @@ -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 grpc from 'k6/net/grpc'; +import exec from "k6/execution"; +import { check, sleep } from 'k6'; + +const client = new grpc.Client(); +client.load(['../proto'], 'policy.proto'); + +export const data = []; +for (let i = 1; i < 2; i++) { + data.push( + { + "uuid": {"uuid": i.toString()} + } + ); +}; + +export const options = { + scenarios :{ + + "AddPolicy-scenario": { + executor: "shared-iterations", + vus: 1, + iterations: data.length, + maxDuration: "1h" + } + } +}; + +export default () => { + client.connect('10.1.255.198:6060', { + plaintext: true, +// timeout: 10000 + }); + + var item = data[exec.scenario.iterationInInstance]; + const response = client.invoke('policy.PolicyService/PolicyDelete', item); + + check(response, { + 'status is OK': (r) => r && r.status === grpc.StatusOK, + }); + + console.log(JSON.stringify(response.message)); + + client.close(); + sleep(1); +}; + +export function handleSummary(data) { + + return { + 'summary_delete_1.json': JSON.stringify(data.metrics.grpc_req_duration.values), //the default data object + }; +} diff --git a/src/tests/benchmark/policy/PolicyUpdateService.js b/src/tests/benchmark/policy/PolicyUpdateService.js new file mode 100644 index 0000000000000000000000000000000000000000..ddf7836b595b7021a8ca7b2c7b37c89b653c1999 --- /dev/null +++ b/src/tests/benchmark/policy/PolicyUpdateService.js @@ -0,0 +1,88 @@ +/** + * Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import grpc from 'k6/net/grpc'; +import exec from "k6/execution"; +import { check, sleep } from 'k6'; + +const client = new grpc.Client(); +client.load(['../proto'], 'policy.proto'); + +export const data = []; +for (let i = 1; i < 2; i++) { + data.push( + { + "serviceId": { + "context_id": { + "context_uuid": {"uuid": "admin"} + }, + "service_uuid": { + "uuid": "6942d780-cfa9-4dea-a946-a8a0b3f7eab2" + } + }, + "policyRuleBasic": { + "policyRuleId": {"uuid": {"uuid": i.toString()}}, + "policyRuleState": {"policyRuleState": "POLICY_UNDEFINED"}, + "priority": 0, + "conditionList": [{"kpiId": {"kpi_id": {"uuid": "1"}}, + "numericalOperator": "POLICYRULE_CONDITION_NUMERICAL_EQUAL", + "kpiValue": {"boolVal": false} + + }], + "actionList": [{}], + "booleanOperator": "POLICYRULE_CONDITION_BOOLEAN_UNDEFINED" + } + } + ); +}; + +export const options = { + scenarios :{ + + "AddPolicy-scenario": { + executor: "shared-iterations", + vus: 1, + iterations: data.length, + maxDuration: "1h" + } + } +}; + +export default () => { + client.connect('10.1.255.198:6060', { + plaintext: true, +// timeout: 10000 + }); + + var item = data[exec.scenario.iterationInInstance]; + const response = client.invoke('policy.PolicyService/PolicyUpdateService', item); + + check(response, { + 'status is OK': (r) => r && r.status === grpc.StatusOK, + }); + + console.log(JSON.stringify(response.message)); + + client.close(); + sleep(1); +}; + +export function handleSummary(data) { + + return { + 'summary_add_1.json': JSON.stringify(data.metrics.grpc_req_duration.values), //the default data object + }; +} diff --git a/src/tests/benchmark/policy/README.md b/src/tests/benchmark/policy/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8b5b2a01efc357b5d8eca6a6890b051b4ffac260 --- /dev/null +++ b/src/tests/benchmark/policy/README.md @@ -0,0 +1,17 @@ + +# Grafana k6 load testing tool + +# K6 Installation Instructions on Ubuntu + +sudo gpg --no-default-keyring --keyring /usr/share/keyrings/k6-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69 +echo "deb [signed-by=/usr/share/keyrings/k6-archive-keyring.gpg] https://dl.k6.io/deb stable main" | sudo tee /etc/apt/sources.list.d/k6.list +sudo apt-get update +sudo apt-get install k6 + +Or install k6 via snap: + +sudo apt install snapd +sudo snap install k6 + +# Running K6 +k6 run script.js \ No newline at end of file diff --git a/src/tests/benchmark/policy/__init__.py b/src/tests/benchmark/policy/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/tests/benchmark/policy/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/tests/benchmark/policy/deploy_specs.sh b/src/tests/benchmark/policy/deploy_specs.sh new file mode 100755 index 0000000000000000000000000000000000000000..12a45ef92a538ff48682fe45172a27d77b2800a0 --- /dev/null +++ b/src/tests/benchmark/policy/deploy_specs.sh @@ -0,0 +1,40 @@ +# 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. + +# Set the URL of your local Docker registry where the images will be uploaded to. +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 +# interdomain slice pathcomp dlt +# dbscanserving opticalattackmitigator opticalattackdetector +# l3_attackmitigator l3_centralizedattackdetector l3_distributedattackdetector +export TFS_COMPONENTS="context device automation monitoring pathcomp service slice compute webui" + +# Set the tag you want to use for your images. +export TFS_IMAGE_TAG="dev" + +# Set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE="tfs" + +# Set additional manifest files to be applied after the deployment +export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml" + +# Set the new Grafana admin password +export TFS_GRAFANA_PASSWORD="admin123+" + +# If not already set, disable skip-build flag. +# If TFS_SKIP_BUILD is "YES", the containers are not rebuilt-retagged-repushed and existing ones are used. +export TFS_SKIP_BUILD=${TFS_SKIP_BUILD:-""} diff --git a/src/tests/benchmark/policy/descriptors_emulated.json b/src/tests/benchmark/policy/descriptors_emulated.json new file mode 100644 index 0000000000000000000000000000000000000000..a71d454f41f324cabb48a023d6d840a59245800c --- /dev/null +++ b/src/tests/benchmark/policy/descriptors_emulated.json @@ -0,0 +1,121 @@ +{ + "contexts": [ + { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_ids": [], + "service_ids": [] + } + ], + "topologies": [ + { + "topology_id": {"topology_uuid": {"uuid": "admin"}, "context_id": {"context_uuid": {"uuid": "admin"}}}, + "device_ids": [ + {"device_uuid": {"uuid": "R1-EMU"}}, + {"device_uuid": {"uuid": "R2-EMU"}}, + {"device_uuid": {"uuid": "R3-EMU"}}, + {"device_uuid": {"uuid": "R4-EMU"}}, + {"device_uuid": {"uuid": "O1-OLS"}} + ], + "link_ids": [ + {"link_uuid": {"uuid": "R1-EMU/13/0/0==O1-OLS/aade6001-f00b-5e2f-a357-6a0a9d3de870"}}, + {"link_uuid": {"uuid": "R2-EMU/13/0/0==O1-OLS/eb287d83-f05e-53ec-ab5a-adf6bd2b5418"}}, + {"link_uuid": {"uuid": "R3-EMU/13/0/0==O1-OLS/0ef74f99-1acc-57bd-ab9d-4b958b06c513"}}, + {"link_uuid": {"uuid": "R4-EMU/13/0/0==O1-OLS/50296d99-58cc-5ce7-82f5-fc8ee4eec2ec"}} + ] + } + ], + "devices": [ + { + "device_id": {"device_uuid": {"uuid": "R1-EMU"}}, "device_type": "emu-packet-router", + "device_operational_status": 1, "device_drivers": [0], "device_endpoints": [], + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "13/0/0", "type": "optical", "sample_types": []}, + {"uuid": "13/1/2", "type": "copper", "sample_types": [101, 102, 201, 202]} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R2-EMU"}}, "device_type": "emu-packet-router", + "device_operational_status": 1, "device_drivers": [0], "device_endpoints": [], + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "13/0/0", "type": "optical", "sample_types": []}, + {"uuid": "13/1/2", "type": "copper", "sample_types": [101, 102, 201, 202]} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R3-EMU"}}, "device_type": "emu-packet-router", + "device_operational_status": 1, "device_drivers": [0], "device_endpoints": [], + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "13/0/0", "type": "optical", "sample_types": []}, + {"uuid": "13/1/2", "type": "copper", "sample_types": [101, 102, 201, 202]} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R4-EMU"}}, "device_type": "emu-packet-router", + "device_operational_status": 1, "device_drivers": [0], "device_endpoints": [], + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "13/0/0", "type": "optical", "sample_types": []}, + {"uuid": "13/1/2", "type": "copper", "sample_types": [101, 102, 201, 202]} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "O1-OLS"}}, "device_type": "emu-open-line-system", + "device_operational_status": 1, "device_drivers": [0], "device_endpoints": [], + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "aade6001-f00b-5e2f-a357-6a0a9d3de870", "type": "optical", "sample_types": []}, + {"uuid": "eb287d83-f05e-53ec-ab5a-adf6bd2b5418", "type": "optical", "sample_types": []}, + {"uuid": "0ef74f99-1acc-57bd-ab9d-4b958b06c513", "type": "optical", "sample_types": []}, + {"uuid": "50296d99-58cc-5ce7-82f5-fc8ee4eec2ec", "type": "optical", "sample_types": []} + ]}}} + ]} + } + ], + "links": [ + { + "link_id": {"link_uuid": {"uuid": "R1-EMU/13/0/0==O1-OLS/aade6001-f00b-5e2f-a357-6a0a9d3de870"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1-EMU"}}, "endpoint_uuid": {"uuid": "13/0/0"}}, + {"device_id": {"device_uuid": {"uuid": "O1-OLS"}}, "endpoint_uuid": {"uuid": "aade6001-f00b-5e2f-a357-6a0a9d3de870"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2-EMU/13/0/0==O1-OLS/eb287d83-f05e-53ec-ab5a-adf6bd2b5418"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2-EMU"}}, "endpoint_uuid": {"uuid": "13/0/0"}}, + {"device_id": {"device_uuid": {"uuid": "O1-OLS"}}, "endpoint_uuid": {"uuid": "eb287d83-f05e-53ec-ab5a-adf6bd2b5418"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R3-EMU/13/0/0==O1-OLS/0ef74f99-1acc-57bd-ab9d-4b958b06c513"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3-EMU"}}, "endpoint_uuid": {"uuid": "13/0/0"}}, + {"device_id": {"device_uuid": {"uuid": "O1-OLS"}}, "endpoint_uuid": {"uuid": "0ef74f99-1acc-57bd-ab9d-4b958b06c513"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R4-EMU/13/0/0==O1-OLS/50296d99-58cc-5ce7-82f5-fc8ee4eec2ec"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R4-EMU"}}, "endpoint_uuid": {"uuid": "13/0/0"}}, + {"device_id": {"device_uuid": {"uuid": "O1-OLS"}}, "endpoint_uuid": {"uuid": "50296d99-58cc-5ce7-82f5-fc8ee4eec2ec"}} + ] + } + ] +} \ No newline at end of file diff --git a/src/tests/benchmark/policy/run_test_01_bootstrap.sh b/src/tests/benchmark/policy/run_test_01_bootstrap.sh new file mode 100755 index 0000000000000000000000000000000000000000..a60f962c8ae14c89cccb53ac2fd27f6ffe5c98ea --- /dev/null +++ b/src/tests/benchmark/policy/run_test_01_bootstrap.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. + +source tfs_runtime_env_vars.sh +pytest --verbose --log-level=INFO -o log_cli=true -o log_cli_level=INFO src/tests/benchmark/policy/tests/test_functional_bootstrap.py diff --git a/src/tests/benchmark/policy/run_test_02_create_service.sh b/src/tests/benchmark/policy/run_test_02_create_service.sh new file mode 100755 index 0000000000000000000000000000000000000000..d899a1455cba2fa92418746373a825a383d3e25c --- /dev/null +++ b/src/tests/benchmark/policy/run_test_02_create_service.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. + +source tfs_runtime_env_vars.sh +pytest --verbose --log-level=INFO -o log_cli=true -o log_cli_level=INFO src/tests/benchmark/policy/tests/test_functional_create_service.py diff --git a/src/tests/benchmark/policy/run_test_03_delete_service.sh b/src/tests/benchmark/policy/run_test_03_delete_service.sh new file mode 100755 index 0000000000000000000000000000000000000000..2cfe25effbaa5dd64a1b445fa2063d91f6348440 --- /dev/null +++ b/src/tests/benchmark/policy/run_test_03_delete_service.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. + +source tfs_runtime_env_vars.sh +pytest --verbose --log-level=INFO -o log_cli=true -o log_cli_level=INFO src/tests/benchmark/policy/tests/test_functional_delete_service.py diff --git a/src/tests/benchmark/policy/run_test_04_cleanup.sh b/src/tests/benchmark/policy/run_test_04_cleanup.sh new file mode 100755 index 0000000000000000000000000000000000000000..d93f798cb24f59e06dc9445e373f74d2dad01c74 --- /dev/null +++ b/src/tests/benchmark/policy/run_test_04_cleanup.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. + +source tfs_runtime_env_vars.sh +pytest --verbose --log-level=INFO -o log_cli=true -o log_cli_level=INFO src/tests/benchmark/policy/tests/test_functional_cleanup.py diff --git a/src/tests/benchmark/policy/tests/.gitignore b/src/tests/benchmark/policy/tests/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..76cb708d1b532c9b69166e55f36bcb912fd5e370 --- /dev/null +++ b/src/tests/benchmark/policy/tests/.gitignore @@ -0,0 +1,2 @@ +# Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. +Credentials.py diff --git a/src/tests/benchmark/policy/tests/Fixtures.py b/src/tests/benchmark/policy/tests/Fixtures.py new file mode 100644 index 0000000000000000000000000000000000000000..89dda54cf945d7078cd61c4b94b282f650429309 --- /dev/null +++ b/src/tests/benchmark/policy/tests/Fixtures.py @@ -0,0 +1,28 @@ +# 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 pytest, logging +from common.Settings import get_setting +from tests.tools.mock_osm.Constants import WIM_PASSWORD, WIM_USERNAME +from tests.tools.mock_osm.MockOSM import MockOSM +from .Objects import WIM_MAPPING + +LOGGER = logging.getLogger(__name__) + +@pytest.fixture(scope='session') +def osm_wim(): + wim_url = 'http://{:s}:{:s}'.format( + get_setting('COMPUTESERVICE_SERVICE_HOST'), str(get_setting('COMPUTESERVICE_SERVICE_PORT_HTTP'))) + LOGGER.info('WIM_MAPPING = {:s}'.format(str(WIM_MAPPING))) + return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) diff --git a/src/tests/benchmark/policy/tests/Objects.py b/src/tests/benchmark/policy/tests/Objects.py new file mode 100644 index 0000000000000000000000000000000000000000..887407bf4a472d183002856716a65bf23ea0e586 --- /dev/null +++ b/src/tests/benchmark/policy/tests/Objects.py @@ -0,0 +1,38 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from common.tools.object_factory.Device import json_device_id +from common.tools.object_factory.EndPoint import json_endpoint_id +from tests.tools.mock_osm.Tools import connection_point, wim_mapping + +# ----- WIM Service Settings ------------------------------------------------------------------------------------------- + +WIM_DC1_SITE_ID = '1' +WIM_DC1_DEVICE_ID = json_device_id('R1-EMU') +WIM_DC1_ENDPOINT_ID = json_endpoint_id(WIM_DC1_DEVICE_ID, '13/1/2') + +WIM_DC2_SITE_ID = '2' +WIM_DC2_DEVICE_ID = json_device_id('R3-EMU') +WIM_DC2_ENDPOINT_ID = json_endpoint_id(WIM_DC2_DEVICE_ID, '13/1/2') + +WIM_SEP_DC1, WIM_MAP_DC1 = wim_mapping(WIM_DC1_SITE_ID, WIM_DC1_ENDPOINT_ID) +WIM_SEP_DC2, WIM_MAP_DC2 = wim_mapping(WIM_DC2_SITE_ID, WIM_DC2_ENDPOINT_ID) +WIM_MAPPING = [WIM_MAP_DC1, WIM_MAP_DC2] + +WIM_SRV_VLAN_ID = 300 +WIM_SERVICE_TYPE = 'ELINE' +WIM_SERVICE_CONNECTION_POINTS = [ + connection_point(WIM_SEP_DC1, 'dot1q', WIM_SRV_VLAN_ID), + connection_point(WIM_SEP_DC2, 'dot1q', WIM_SRV_VLAN_ID), +] diff --git a/src/tests/benchmark/policy/tests/__init__.py b/src/tests/benchmark/policy/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/tests/benchmark/policy/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/tests/benchmark/policy/tests/test_functional_bootstrap.py b/src/tests/benchmark/policy/tests/test_functional_bootstrap.py new file mode 100644 index 0000000000000000000000000000000000000000..65c46b4eb5aea8d5762484d1558c14745acf83ed --- /dev/null +++ b/src/tests/benchmark/policy/tests/test_functional_bootstrap.py @@ -0,0 +1,95 @@ +# 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, time +from common.proto.context_pb2 import ContextId, Empty +from common.proto.monitoring_pb2 import KpiDescriptorList +from common.tests.LoadScenario import load_scenario_from_descriptor +from common.tools.grpc.Tools import grpc_message_to_json_string +from common.tools.object_factory.Context import json_context_id +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from monitoring.client.MonitoringClient import MonitoringClient +from tests.Fixtures import context_client, device_client, monitoring_client # pylint: disable=unused-import + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DESCRIPTOR_FILE = 'ofc22/descriptors_emulated.json' + +def test_scenario_bootstrap( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name +) -> None: + # ----- List entities - Ensure database is empty ------------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == 0 + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 + + response = context_client.ListLinks(Empty()) + assert len(response.links) == 0 + + + # ----- Load Scenario ---------------------------------------------------------------------------------------------- + descriptor_loader = load_scenario_from_descriptor( + DESCRIPTOR_FILE, context_client, device_client, None, None) + + + # ----- List entities - Ensure scenario is ready ------------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == descriptor_loader.num_contexts + + for context_uuid, num_topologies in descriptor_loader.num_topologies.items(): + response = context_client.ListTopologies(ContextId(**json_context_id(context_uuid))) + assert len(response.topologies) == num_topologies + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == descriptor_loader.num_devices + + response = context_client.ListLinks(Empty()) + assert len(response.links) == descriptor_loader.num_links + + for context_uuid, _ in descriptor_loader.num_services.items(): + response = context_client.ListServices(ContextId(**json_context_id(context_uuid))) + assert len(response.services) == 0 + +def test_scenario_kpis_created( + context_client : ContextClient, # pylint: disable=redefined-outer-name + monitoring_client: MonitoringClient, # pylint: disable=redefined-outer-name +) -> None: + """ + This test validates that KPIs related to the service/device/endpoint were created + during the service creation process. + """ + response = context_client.ListDevices(Empty()) + kpis_expected = set() + for device in response.devices: + device_uuid = device.device_id.device_uuid.uuid + for endpoint in device.device_endpoints: + endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid + for kpi_sample_type in endpoint.kpi_sample_types: + kpis_expected.add((device_uuid, endpoint_uuid, kpi_sample_type)) + num_kpis_expected = len(kpis_expected) + LOGGER.info('Num KPIs expected: {:d}'.format(num_kpis_expected)) + + num_kpis_created, num_retry = 0, 0 + while (num_kpis_created != num_kpis_expected) and (num_retry < 5): + response: KpiDescriptorList = monitoring_client.GetKpiDescriptorList(Empty()) + num_kpis_created = len(response.kpi_descriptor_list) + LOGGER.info('Num KPIs created: {:d}'.format(num_kpis_created)) + time.sleep(0.5) + num_retry += 1 + assert num_kpis_created == num_kpis_expected diff --git a/src/tests/benchmark/policy/tests/test_functional_cleanup.py b/src/tests/benchmark/policy/tests/test_functional_cleanup.py new file mode 100644 index 0000000000000000000000000000000000000000..e00c5ceeea6c59bf11bd2961802a9a3b805c5d2c --- /dev/null +++ b/src/tests/benchmark/policy/tests/test_functional_cleanup.py @@ -0,0 +1,80 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging +from common.tools.descriptor.Loader import DescriptorLoader +from common.tools.object_factory.Context import json_context_id +from common.proto.context_pb2 import ContextId, DeviceId, Empty, LinkId, TopologyId +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from tests.Fixtures import context_client, device_client # pylint: disable=unused-import + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DESCRIPTOR_FILE = 'ofc22/descriptors_emulated.json' + + +def test_services_removed( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name +) -> None: + # ----- List entities - Ensure service is removed ------------------------------------------------------------------ + with open(DESCRIPTOR_FILE, 'r', encoding='UTF-8') as f: + descriptors = f.read() + + descriptor_loader = DescriptorLoader(descriptors) + + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == descriptor_loader.num_contexts + + for context_uuid, num_topologies in descriptor_loader.num_topologies.items(): + response = context_client.ListTopologies(ContextId(**json_context_id(context_uuid))) + assert len(response.topologies) == num_topologies + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == descriptor_loader.num_devices + + response = context_client.ListLinks(Empty()) + assert len(response.links) == descriptor_loader.num_links + + for context_uuid, _ in descriptor_loader.num_services.items(): + response = context_client.ListServices(ContextId(**json_context_id(context_uuid))) + assert len(response.services) == 0 + + + # ----- Delete Links, Devices, Topologies, Contexts ---------------------------------------------------------------- + for link in descriptor_loader.links: + context_client.RemoveLink(LinkId(**link['link_id'])) + + for device in descriptor_loader.devices: + device_client .DeleteDevice(DeviceId(**device['device_id'])) + + for context_uuid, topology_list in descriptor_loader.topologies.items(): + for topology in topology_list: + context_client.RemoveTopology(TopologyId(**topology['topology_id'])) + + for context in descriptor_loader.contexts: + context_client.RemoveContext(ContextId(**context['context_id'])) + + + # ----- List entities - Ensure database is empty again ------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == 0 + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 + + response = context_client.ListLinks(Empty()) + assert len(response.links) == 0 diff --git a/src/tests/benchmark/policy/tests/test_functional_create_service.py b/src/tests/benchmark/policy/tests/test_functional_create_service.py new file mode 100644 index 0000000000000000000000000000000000000000..919f81979305831b69a82f13fbe4b70bd20ea70f --- /dev/null +++ b/src/tests/benchmark/policy/tests/test_functional_create_service.py @@ -0,0 +1,124 @@ +# 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, random +from common.DeviceTypes import DeviceTypeEnum +from common.proto.context_pb2 import ContextId, Empty +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.tools.descriptor.Loader import DescriptorLoader +from common.tools.grpc.Tools import grpc_message_to_json_string +from common.tools.object_factory.Context import json_context_id +from context.client.ContextClient import ContextClient +from monitoring.client.MonitoringClient import MonitoringClient +from tests.Fixtures import context_client, device_client, monitoring_client # pylint: disable=unused-import +from tests.tools.mock_osm.MockOSM import MockOSM +from .Fixtures import osm_wim # pylint: disable=unused-import +from .Objects import WIM_SERVICE_CONNECTION_POINTS, WIM_SERVICE_TYPE + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DEVTYPE_EMU_PR = DeviceTypeEnum.EMULATED_PACKET_ROUTER.value +DEVTYPE_EMU_OLS = DeviceTypeEnum.EMULATED_OPEN_LINE_SYSTEM.value + +DESCRIPTOR_FILE = 'ofc22/descriptors_emulated.json' + +def test_service_creation(context_client : ContextClient, osm_wim : MockOSM): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure scenario is ready ------------------------------------------------------------------- + with open(DESCRIPTOR_FILE, 'r', encoding='UTF-8') as f: + descriptors = f.read() + + descriptor_loader = DescriptorLoader(descriptors) + + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == descriptor_loader.num_contexts + + for context_uuid, num_topologies in descriptor_loader.num_topologies.items(): + response = context_client.ListTopologies(ContextId(**json_context_id(context_uuid))) + assert len(response.topologies) == num_topologies + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == descriptor_loader.num_devices + + response = context_client.ListLinks(Empty()) + assert len(response.links) == descriptor_loader.num_links + + for context_uuid, num_services in descriptor_loader.num_services.items(): + response = context_client.ListServices(ContextId(**json_context_id(context_uuid))) + assert len(response.services) == 0 + + + # ----- Create Service --------------------------------------------------------------------------------------------- + service_uuid = osm_wim.create_connectivity_service(WIM_SERVICE_TYPE, WIM_SERVICE_CONNECTION_POINTS) + osm_wim.get_connectivity_service_status(service_uuid) + + + # ----- List entities - Ensure service is created ------------------------------------------------------------------ + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == descriptor_loader.num_contexts + + for context_uuid, num_topologies in descriptor_loader.num_topologies.items(): + response = context_client.ListTopologies(ContextId(**json_context_id(context_uuid))) + assert len(response.topologies) == num_topologies + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == descriptor_loader.num_devices + + response = context_client.ListLinks(Empty()) + assert len(response.links) == descriptor_loader.num_links + + for context_uuid, num_services in descriptor_loader.num_services.items(): + response = context_client.ListServices(ContextId(**json_context_id(context_uuid))) + LOGGER.info('Services[{:d}] = {:s}'.format(len(response.services), grpc_message_to_json_string(response))) + assert len(response.services) == 2*num_services # OLS & L3NM => (L3NM + TAPI) + + for service in response.services: + service_id = service.service_id + response = context_client.ListConnections(service_id) + LOGGER.info(' ServiceId[{:s}] => Connections[{:d}] = {:s}'.format( + grpc_message_to_json_string(service_id), len(response.connections), + grpc_message_to_json_string(response))) + assert len(response.connections) == 1 # one connection per service + + +def test_scenario_kpi_values_created( + monitoring_client: MonitoringClient, # pylint: disable=redefined-outer-name +) -> None: + """ + This test validates that KPI values have been inserted into the monitoring database. + We short k KPI descriptors to test. + """ + response = monitoring_client.GetKpiDescriptorList(Empty()) + kpi_descriptors = random.choices(response.kpi_descriptor_list, k=2) + + for kpi_descriptor in kpi_descriptors: + MSG = 'KPI(kpi_uuid={:s}, device_uuid={:s}, endpoint_uuid={:s}, service_uuid={:s}, kpi_sample_type={:s})...' + LOGGER.info(MSG.format( + str(kpi_descriptor.kpi_id.kpi_id.uuid), str(kpi_descriptor.device_id.device_uuid.uuid), + str(kpi_descriptor.endpoint_id.endpoint_uuid.uuid), str(kpi_descriptor.service_id.service_uuid.uuid), + str(KpiSampleType.Name(kpi_descriptor.kpi_sample_type)))) + response = monitoring_client.GetInstantKpi(kpi_descriptor.kpi_id) + kpi_uuid = response.kpi_id.kpi_id.uuid + assert kpi_uuid == kpi_descriptor.kpi_id.kpi_id.uuid + kpi_value_type = response.kpi_value.WhichOneof('value') + if kpi_value_type is None: + MSG = ' KPI({:s}): No instant value found' + LOGGER.warning(MSG.format(str(kpi_uuid))) + else: + kpi_timestamp = response.timestamp.timestamp + assert kpi_timestamp > 0 + assert kpi_value_type == 'floatVal' + kpi_value = getattr(response.kpi_value, kpi_value_type) + MSG = ' KPI({:s}): timestamp={:s} value_type={:s} value={:s}' + LOGGER.info(MSG.format(str(kpi_uuid), str(kpi_timestamp), str(kpi_value_type), str(kpi_value))) diff --git a/src/tests/benchmark/policy/tests/test_functional_delete_service.py b/src/tests/benchmark/policy/tests/test_functional_delete_service.py new file mode 100644 index 0000000000000000000000000000000000000000..6f6ca602980fb05ffafd17f44a5bc64671c4c7b0 --- /dev/null +++ b/src/tests/benchmark/policy/tests/test_functional_delete_service.py @@ -0,0 +1,99 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging +from common.Constants import DEFAULT_CONTEXT_NAME +from common.DeviceTypes import DeviceTypeEnum +from common.proto.context_pb2 import ContextId, Empty, ServiceTypeEnum +from common.tools.descriptor.Loader import DescriptorLoader +from common.tools.object_factory.Context import json_context_id +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from tests.Fixtures import context_client # pylint: disable=unused-import +from tests.tools.mock_osm.MockOSM import MockOSM +from .Fixtures import osm_wim # pylint: disable=unused-import + + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DEVTYPE_EMU_PR = DeviceTypeEnum.EMULATED_PACKET_ROUTER.value +DEVTYPE_EMU_OLS = DeviceTypeEnum.EMULATED_OPEN_LINE_SYSTEM.value + +DESCRIPTOR_FILE = 'ofc22/descriptors_emulated.json' + + +def test_service_removal(context_client : ContextClient, osm_wim : MockOSM): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure service is created ------------------------------------------------------------------ + with open(DESCRIPTOR_FILE, 'r', encoding='UTF-8') as f: + descriptors = f.read() + + descriptor_loader = DescriptorLoader(descriptors) + + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == descriptor_loader.num_contexts + + for context_uuid, num_topologies in descriptor_loader.num_topologies.items(): + response = context_client.ListTopologies(ContextId(**json_context_id(context_uuid))) + assert len(response.topologies) == num_topologies + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == descriptor_loader.num_devices + + response = context_client.ListLinks(Empty()) + assert len(response.links) == descriptor_loader.num_links + + l3nm_service_uuids = set() + response = context_client.ListServices(ContextId(**json_context_id(DEFAULT_CONTEXT_NAME))) + assert len(response.services) == 2 # OLS & L3NM => (L3NM + TAPI) + for service in response.services: + service_id = service.service_id + + if service.service_type == ServiceTypeEnum.SERVICETYPE_L3NM: + service_uuid = service_id.service_uuid.uuid + l3nm_service_uuids.add(service_uuid) + osm_wim.conn_info[service_uuid] = {} + + response = context_client.ListConnections(service_id) + LOGGER.info(' ServiceId[{:s}] => Connections[{:d}] = {:s}'.format( + grpc_message_to_json_string(service_id), len(response.connections), + grpc_message_to_json_string(response))) + assert len(response.connections) == 1 # one connection per service + + # Identify service to delete + assert len(l3nm_service_uuids) == 1 # assume a single L3NM service has been created + l3nm_service_uuid = set(l3nm_service_uuids).pop() + + + # ----- Delete Service --------------------------------------------------------------------------------------------- + osm_wim.delete_connectivity_service(l3nm_service_uuid) + + + # ----- List entities - Ensure service is removed ------------------------------------------------------------------ + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == descriptor_loader.num_contexts + + for context_uuid, num_topologies in descriptor_loader.num_topologies.items(): + response = context_client.ListTopologies(ContextId(**json_context_id(context_uuid))) + assert len(response.topologies) == num_topologies + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == descriptor_loader.num_devices + + response = context_client.ListLinks(Empty()) + assert len(response.links) == descriptor_loader.num_links + + for context_uuid, num_services in descriptor_loader.num_services.items(): + response = context_client.ListServices(ContextId(**json_context_id(context_uuid))) + assert len(response.services) == 0 diff --git a/src/tests/ecoc22/.gitignore b/src/tests/ecoc22/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..0a3f4400d5c88b1af32c7667d69d2fdc12d5424e --- /dev/null +++ b/src/tests/ecoc22/.gitignore @@ -0,0 +1,2 @@ +# Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. +descriptors_real.json diff --git a/src/tests/ecoc22/__init__.py b/src/tests/ecoc22/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/tests/ecoc22/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/tests/ecoc22/deploy_specs.sh b/src/tests/ecoc22/deploy_specs.sh new file mode 100755 index 0000000000000000000000000000000000000000..874774e1ca50830832e842e49b6fff1114cb85d8 --- /dev/null +++ b/src/tests/ecoc22/deploy_specs.sh @@ -0,0 +1,94 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# ----- TeraFlowSDN ------------------------------------------------------------ + +# Set the URL of the internal MicroK8s Docker registry where the images will be uploaded to. +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 load_generator" +export TFS_COMPONENTS="context device automation monitoring pathcomp service slice compute webui" + +# Set the tag you want to use for your images. +export TFS_IMAGE_TAG="dev" + +# Set the name of the Kubernetes namespace to deploy TFS to. +export TFS_K8S_NAMESPACE="tfs" + +# Set additional manifest files to be applied after the deployment +export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml" + +# Set the new Grafana admin password +export TFS_GRAFANA_PASSWORD="admin123+" + +# Disable skip-build flag to rebuild the Docker images. +export TFS_SKIP_BUILD="" + + +# ----- CockroachDB ------------------------------------------------------------ + +# Set the namespace where CockroackDB will be deployed. +export CRDB_NAMESPACE="crdb" + +# Set the database username to be used by Context. +export CRDB_USERNAME="tfs" + +# Set the database user's password to be used by Context. +export CRDB_PASSWORD="tfs123" + +# Set the database name to be used by Context. +export CRDB_DATABASE="tfs" + +# Set CockroachDB installation mode to 'single'. This option is convenient for development and testing. +# See ./deploy/all.sh or ./deploy/crdb.sh for additional details +export CRDB_DEPLOY_MODE="single" + +# Disable flag for dropping database, if exists. +export CRDB_DROP_DATABASE_IF_EXISTS="" + +# Disable flag for re-deploying CockroachDB from scratch. +export CRDB_REDEPLOY="" + + +# ----- NATS ------------------------------------------------------------------- + +# Set the namespace where NATS will be deployed. +export NATS_NAMESPACE="nats" + +# Disable flag for re-deploying NATS from scratch. +export NATS_REDEPLOY="" + + +# ----- QuestDB ---------------------------------------------------------------- + +# If not already set, set the namespace where QuestDB will be deployed. +export QDB_NAMESPACE="qdb" + +# If not already set, set the database username to be used by Monitoring. +export QDB_USERNAME="admin" + +# If not already set, set the database user's password to be used by Monitoring. +export QDB_PASSWORD="quest" + +# If not already set, set the table name to be used by Monitoring. +export QDB_TABLE="tfs_monitoring" + +## If not already set, disable flag for dropping table if exists. +#export QDB_DROP_TABLE_IF_EXISTS="" + +# If not already set, disable flag for re-deploying QuestDB from scratch. +export QDB_REDEPLOY="" diff --git a/src/tests/ecoc22/descriptors_emulated.json b/src/tests/ecoc22/descriptors_emulated.json new file mode 100644 index 0000000000000000000000000000000000000000..f55954d92fbe3cf75b3464286f897c3f931c0c39 --- /dev/null +++ b/src/tests/ecoc22/descriptors_emulated.json @@ -0,0 +1,141 @@ +{ + "contexts": [ + {"context_id": {"context_uuid": {"uuid": "admin"}}} + ], + "topologies": [ + {"topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}}} + ], + "devices": [ + { + "device_id": {"device_uuid": {"uuid": "DC1-GW"}}, "device_type": "emu-datacenter", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper", "uuid": "eth1"}, + {"sample_types": [], "type": "copper", "uuid": "eth2"}, + {"sample_types": [], "type": "copper", "uuid": "int"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "DC2-GW"}}, "device_type": "emu-datacenter", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper", "uuid": "eth1"}, + {"sample_types": [], "type": "copper", "uuid": "eth2"}, + {"sample_types": [], "type": "copper", "uuid": "int"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "CS1-GW1"}}, "device_type": "emu-packet-router", "device_drivers": [1], + "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [101, 102, 201, 202], "type": "copper", "uuid": "10/1"}, + {"sample_types": [101, 102, 201, 202], "type": "copper", "uuid": "1/1"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "CS1-GW2"}}, "device_type": "emu-packet-router", "device_drivers": [1], + "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [101, 102, 201, 202], "type": "copper", "uuid": "10/1"}, + {"sample_types": [101, 102, 201, 202], "type": "copper", "uuid": "1/1"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "CS2-GW1"}}, "device_type": "emu-packet-router", "device_drivers": [1], + "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [101, 102, 201, 202], "type": "copper", "uuid": "10/1"}, + {"sample_types": [101, 102, 201, 202], "type": "copper", "uuid": "1/1"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "CS2-GW2"}}, "device_type": "emu-packet-router", "device_drivers": [1], + "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [101, 102, 201, 202], "type": "copper", "uuid": "10/1"}, + {"sample_types": [101, 102, 201, 202], "type": "copper", "uuid": "1/1"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "OLS"}}, "device_type": "emu-open-line-system", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "optical", "uuid": "aade6001-f00b-5e2f-a357-6a0a9d3de870"}, + {"sample_types": [], "type": "optical", "uuid": "eb287d83-f05e-53ec-ab5a-adf6bd2b5418"}, + {"sample_types": [], "type": "optical", "uuid": "0ef74f99-1acc-57bd-ab9d-4b958b06c513"}, + {"sample_types": [], "type": "optical", "uuid": "50296d99-58cc-5ce7-82f5-fc8ee4eec2ec"} + ]}}} + ]} + } + ], + "links": [ + { + "link_id": {"link_uuid": {"uuid": "DC1-GW/eth1==CS1-GW1/10/1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "DC1-GW"}}, "endpoint_uuid": {"uuid": "eth1"}}, + {"device_id": {"device_uuid": {"uuid": "CS1-GW1"}}, "endpoint_uuid": {"uuid": "10/1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "DC1-GW/eth2==CS1-GW2/10/1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "DC1-GW"}}, "endpoint_uuid": {"uuid": "eth2"}}, + {"device_id": {"device_uuid": {"uuid": "CS1-GW2"}}, "endpoint_uuid": {"uuid": "10/1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "DC2-GW/eth1==CS2-GW1/10/1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "DC2-GW"}}, "endpoint_uuid": {"uuid": "eth1"}}, + {"device_id": {"device_uuid": {"uuid": "CS2-GW1"}}, "endpoint_uuid": {"uuid": "10/1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "DC2-GW/eth2==CS2-GW2/10/1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "DC2-GW"}}, "endpoint_uuid": {"uuid": "eth2"}}, + {"device_id": {"device_uuid": {"uuid": "CS2-GW2"}}, "endpoint_uuid": {"uuid": "10/1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "CS1-GW1/1/1==OLS/aade6001-f00b-5e2f-a357-6a0a9d3de870"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "CS1-GW1"}}, "endpoint_uuid": {"uuid": "1/1"}}, + {"device_id": {"device_uuid": {"uuid": "OLS"}}, "endpoint_uuid": {"uuid": "aade6001-f00b-5e2f-a357-6a0a9d3de870"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "CS1-GW2/1/1==OLS/eb287d83-f05e-53ec-ab5a-adf6bd2b5418"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "CS1-GW2"}}, "endpoint_uuid": {"uuid": "1/1"}}, + {"device_id": {"device_uuid": {"uuid": "OLS"}}, "endpoint_uuid": {"uuid": "eb287d83-f05e-53ec-ab5a-adf6bd2b5418"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "CS2-GW1/1/1==OLS/0ef74f99-1acc-57bd-ab9d-4b958b06c513"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "CS2-GW1"}}, "endpoint_uuid": {"uuid": "1/1"}}, + {"device_id": {"device_uuid": {"uuid": "OLS"}}, "endpoint_uuid": {"uuid": "0ef74f99-1acc-57bd-ab9d-4b958b06c513"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "CS2-GW2/1/1==OLS/50296d99-58cc-5ce7-82f5-fc8ee4eec2ec"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "CS2-GW2"}}, "endpoint_uuid": {"uuid": "1/1"}}, + {"device_id": {"device_uuid": {"uuid": "OLS"}}, "endpoint_uuid": {"uuid": "50296d99-58cc-5ce7-82f5-fc8ee4eec2ec"}} + ] + } + ] +} diff --git a/src/tests/ecoc22/other_scenarios/descriptors_emulated-BigNet.json b/src/tests/ecoc22/other_scenarios/descriptors_emulated-BigNet.json new file mode 100644 index 0000000000000000000000000000000000000000..cd038269425755258cea9b0908478d66702ad9cc --- /dev/null +++ b/src/tests/ecoc22/other_scenarios/descriptors_emulated-BigNet.json @@ -0,0 +1,1299 @@ +{ + "contexts": [ + { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "service_ids": [], + "topology_ids": [] + } + ], + "devices": [ + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CE1" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CE2" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CE3" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CE4" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "PE1" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "PE2" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "PE3" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "PE4" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/3\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "BB1" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/3\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "BB2" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/3\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "BB6" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/3\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/4\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/5\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/6\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "BB7" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/3\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "BB3" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/3\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "BB5" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/3\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "BB4" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + } + ], + "links": [ + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CE1" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "PE1" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CE1/1/1==CE1/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CE2" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "PE2" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CE2/1/1==CE2/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CE3" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "PE3" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CE3/1/1==CE3/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CE4" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "PE4" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CE4/1/1==CE4/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "PE1" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB1" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "PE1/2/1==PE1/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "PE1" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB2" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "PE1/2/2==PE1/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "PE2" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB1" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "PE2/2/1==PE2/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "PE2" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB2" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "PE2/2/2==PE2/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "PE3" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB5" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "PE3/2/2==PE3/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "PE3" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB4" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "PE3/2/1==PE3/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "PE4" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB5" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "PE4/2/2==PE4/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "PE4" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB4" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "PE4/2/1==PE4/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB1" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB2" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB1/2/1==BB1/2/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB2" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB3" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB2/2/1==BB2/2/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB3" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB4" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB3/2/1==BB3/2/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB4" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB5" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB4/2/1==BB4/2/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB5" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB6" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB5/2/1==BB5/2/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB6" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB1" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB6/2/1==BB6/2/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB1" + } + }, + "endpoint_uuid": { + "uuid": "2/3" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB7" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB1/2/3==BB1/2/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB2" + } + }, + "endpoint_uuid": { + "uuid": "2/3" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB7" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB2/2/3==BB2/2/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB3" + } + }, + "endpoint_uuid": { + "uuid": "2/3" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB7" + } + }, + "endpoint_uuid": { + "uuid": "2/3" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB3/2/3==BB3/2/3" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB4" + } + }, + "endpoint_uuid": { + "uuid": "2/3" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB7" + } + }, + "endpoint_uuid": { + "uuid": "2/4" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB4/2/3==BB4/2/4" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB5" + } + }, + "endpoint_uuid": { + "uuid": "2/3" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB7" + } + }, + "endpoint_uuid": { + "uuid": "2/5" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB5/2/3==BB5/2/5" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "BB6" + } + }, + "endpoint_uuid": { + "uuid": "2/3" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "BB7" + } + }, + "endpoint_uuid": { + "uuid": "2/6" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "BB6/2/3==BB6/2/6" + } + } + } + ], + "topologies": [ + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ] +} \ No newline at end of file diff --git a/src/tests/ecoc22/other_scenarios/descriptors_emulated-DC_CSGW_TN.json b/src/tests/ecoc22/other_scenarios/descriptors_emulated-DC_CSGW_TN.json new file mode 100644 index 0000000000000000000000000000000000000000..5f40edac2feef134c02a74b08fcad21d917aae07 --- /dev/null +++ b/src/tests/ecoc22/other_scenarios/descriptors_emulated-DC_CSGW_TN.json @@ -0,0 +1,1005 @@ +{ + "contexts": [ + { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "service_ids": [], + "topology_ids": [] + } + ], + "devices": [ + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"eth1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"eth2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"int\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "DC1-GW" + } + }, + "device_operational_status": 1, + "device_type": "emu-datacenter" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"eth1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"eth2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"int\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "DC2-GW" + } + }, + "device_operational_status": 1, + "device_type": "emu-datacenter" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"10/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CS1-GW1" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"10/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CS1-GW2" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"10/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CS2-GW1" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"10/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CS2-GW2" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/3\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "TN-R1" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/3\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "TN-R2" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/3\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "TN-R3" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/3\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "TN-R4" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + } + ], + "links": [ + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "DC1-GW" + } + }, + "endpoint_uuid": { + "uuid": "eth1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW1" + } + }, + "endpoint_uuid": { + "uuid": "10/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "DC1-GW/eth1==CS1-GW1/10/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "DC1-GW" + } + }, + "endpoint_uuid": { + "uuid": "eth2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW2" + } + }, + "endpoint_uuid": { + "uuid": "10/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "DC1-GW/eth2==CS1-GW2/10/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "DC2-GW" + } + }, + "endpoint_uuid": { + "uuid": "eth1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW1" + } + }, + "endpoint_uuid": { + "uuid": "10/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "DC2-GW/eth1==CS2-GW1/10/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "DC2-GW" + } + }, + "endpoint_uuid": { + "uuid": "eth2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW2" + } + }, + "endpoint_uuid": { + "uuid": "10/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "DC2-GW/eth2==CS2-GW2/10/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW1" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R1" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS1-GW1/1/1==TN-R1/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW2" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R2" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS1-GW2/1/1==TN-R2/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW1" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R2" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS1-GW1/1/2==TN-R2/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW2" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R1" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS1-GW2/1/2==TN-R1/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW1" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R3" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS2-GW1/1/1==TN-R3/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW2" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R4" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS2-GW2/1/1==TN-R4/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW1" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R4" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS2-GW1/1/2==TN-R4/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW2" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R3" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS2-GW2/1/2==TN-R3/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "TN-R1" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R2" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "TN-R1/2/1==TN-R2/2/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "TN-R2" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R3" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "TN-R2/2/1==TN-R3/2/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "TN-R3" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R4" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "TN-R3/2/1==TN-R4/2/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "TN-R4" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R1" + } + }, + "endpoint_uuid": { + "uuid": "2/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "TN-R4/2/1==TN-R1/2/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "TN-R1" + } + }, + "endpoint_uuid": { + "uuid": "2/3" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R3" + } + }, + "endpoint_uuid": { + "uuid": "2/3" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "TN-R1/2/3==TN-R3/2/3" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "TN-R2" + } + }, + "endpoint_uuid": { + "uuid": "2/3" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R4" + } + }, + "endpoint_uuid": { + "uuid": "2/3" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "TN-R2/2/3==TN-R4/2/3" + } + } + } + ], + "topologies": [ + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "DC1" + } + } + }, + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "DC2" + } + } + }, + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "CS1" + } + } + }, + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "CS2" + } + } + }, + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "TN" + } + } + } + ] +} \ No newline at end of file diff --git a/src/tests/ecoc22/other_scenarios/descriptors_emulated-DC_CSGW_TN_OLS.json b/src/tests/ecoc22/other_scenarios/descriptors_emulated-DC_CSGW_TN_OLS.json new file mode 100644 index 0000000000000000000000000000000000000000..8d8e6fde3d3c183688fdc6ec7c3e6498c0d6791a --- /dev/null +++ b/src/tests/ecoc22/other_scenarios/descriptors_emulated-DC_CSGW_TN_OLS.json @@ -0,0 +1,985 @@ +{ + "contexts": [ + { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "service_ids": [], + "topology_ids": [] + } + ], + "devices": [ + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"eth1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"eth2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"int\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "DC1-GW" + } + }, + "device_operational_status": 1, + "device_type": "emu-datacenter" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"eth1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"eth2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"int\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "DC2-GW" + } + }, + "device_operational_status": 1, + "device_type": "emu-datacenter" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"10/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CS1-GW1" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"10/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CS1-GW2" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"10/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CS2-GW1" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"10/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "CS2-GW2" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "TN-R1" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "TN-R2" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "TN-R3" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"2/1\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "TN-R4" + } + }, + "device_operational_status": 1, + "device_type": "emu-packet-router" + }, + { + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"a3adcbbcc03f\"}, {\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"9329780033f5\"}, {\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"e8a127ea3ed1\"}, {\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"ef1c58823a49\"}]}" + } + } + ] + }, + "device_drivers": [ + 0 + ], + "device_endpoints": [], + "device_id": { + "device_uuid": { + "uuid": "TN-OLS" + } + }, + "device_operational_status": 1, + "device_type": "emu-open-line-system" + } + ], + "links": [ + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "DC1-GW" + } + }, + "endpoint_uuid": { + "uuid": "eth1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW1" + } + }, + "endpoint_uuid": { + "uuid": "10/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "DC1-GW/eth1==CS1-GW1/10/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "DC1-GW" + } + }, + "endpoint_uuid": { + "uuid": "eth2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW2" + } + }, + "endpoint_uuid": { + "uuid": "10/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "DC1-GW/eth2==CS1-GW2/10/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "DC2-GW" + } + }, + "endpoint_uuid": { + "uuid": "eth1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW1" + } + }, + "endpoint_uuid": { + "uuid": "10/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "DC2-GW/eth1==CS2-GW1/10/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "DC2-GW" + } + }, + "endpoint_uuid": { + "uuid": "eth2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW2" + } + }, + "endpoint_uuid": { + "uuid": "10/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "DC2-GW/eth2==CS2-GW2/10/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW1" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R1" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS1-GW1/1/1==TN-R1/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW2" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R2" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS1-GW2/1/1==TN-R2/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW1" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R2" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS1-GW1/1/2==TN-R2/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS1-GW2" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R1" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS1-GW2/1/2==TN-R1/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW1" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R3" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS2-GW1/1/1==TN-R3/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW2" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R4" + } + }, + "endpoint_uuid": { + "uuid": "1/1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS2-GW2/1/1==TN-R4/1/1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW1" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R4" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS2-GW1/1/2==TN-R4/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "CS2-GW2" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-R3" + } + }, + "endpoint_uuid": { + "uuid": "1/2" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "CS2-GW2/1/2==TN-R3/1/2" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "TN-R1" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-OLS" + } + }, + "endpoint_uuid": { + "uuid": "a3adcbbcc03f" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "TN-R1/2/1==TN-OLS/a3adcbbcc03f" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "TN-R2" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-OLS" + } + }, + "endpoint_uuid": { + "uuid": "9329780033f5" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "TN-R2/2/1==TN-OLS/9329780033f5" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "TN-R3" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-OLS" + } + }, + "endpoint_uuid": { + "uuid": "e8a127ea3ed1" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "TN-R3/2/1==TN-OLS/e8a127ea3ed1" + } + } + }, + { + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "TN-R4" + } + }, + "endpoint_uuid": { + "uuid": "2/1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "TN-OLS" + } + }, + "endpoint_uuid": { + "uuid": "ef1c58823a49" + } + } + ], + "link_id": { + "link_uuid": { + "uuid": "TN-R4/2/1==TN-OLS/ef1c58823a49" + } + } + } + ], + "topologies": [ + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + }, + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "DC1" + } + } + }, + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "DC2" + } + } + }, + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "CS1" + } + } + }, + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "CS2" + } + } + }, + { + "device_ids": [], + "link_ids": [], + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "TN" + } + } + } + ] +} \ No newline at end of file diff --git a/src/tests/ofc22/show_logs_device.sh b/src/tests/ecoc22/redeploy.sh similarity index 78% rename from src/tests/ofc22/show_logs_device.sh rename to src/tests/ecoc22/redeploy.sh index 9d976755a959dd8674a5cfe4fffb7104c27e8521..740546128e31b46ea1c03a17a42a372cc331da87 100755 --- a/src/tests/ofc22/show_logs_device.sh +++ b/src/tests/ecoc22/redeploy.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,5 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -K8S_NAMESPACE="ofc22" -kubectl --namespace $K8S_NAMESPACE logs deployment/deviceservice +source ecoc22/deploy_specs.sh +./deploy/all.sh +source tfs_runtime_env_vars.sh diff --git a/src/tests/ecoc22/run_test_01_bootstrap.sh b/src/tests/ecoc22/run_test_01_bootstrap.sh new file mode 100755 index 0000000000000000000000000000000000000000..1d20cb98b9056153b08cfba4eaa153ad34579241 --- /dev/null +++ b/src/tests/ecoc22/run_test_01_bootstrap.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. + +source tfs_runtime_env_vars.sh +pytest --verbose --log-level=INFO src/tests/ecoc22/tests/test_functional_bootstrap.py diff --git a/src/tests/ecoc22/run_test_02_create_service.sh b/src/tests/ecoc22/run_test_02_create_service.sh new file mode 100755 index 0000000000000000000000000000000000000000..bc8a53fea1d710f2f34f3ecd9a1c32c709957beb --- /dev/null +++ b/src/tests/ecoc22/run_test_02_create_service.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. + +source tfs_runtime_env_vars.sh +pytest --verbose --log-level=INFO src/tests/ecoc22/tests/test_functional_create_service.py diff --git a/src/tests/ecoc22/run_test_03_delete_service.sh b/src/tests/ecoc22/run_test_03_delete_service.sh new file mode 100755 index 0000000000000000000000000000000000000000..4c30511d96c83fde63a01b1c50b6ecd182db06c6 --- /dev/null +++ b/src/tests/ecoc22/run_test_03_delete_service.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. + +source tfs_runtime_env_vars.sh +pytest --verbose --log-level=INFO src/tests/ecoc22/tests/test_functional_delete_service.py diff --git a/src/tests/ecoc22/run_test_04_cleanup.sh b/src/tests/ecoc22/run_test_04_cleanup.sh new file mode 100755 index 0000000000000000000000000000000000000000..fc8c13f61dd799515b0f0e4c1a8933adac20774d --- /dev/null +++ b/src/tests/ecoc22/run_test_04_cleanup.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. + +source tfs_runtime_env_vars.sh +pytest --verbose --log-level=INFO src/tests/ecoc22/tests/test_functional_cleanup.py diff --git a/src/tests/ecoc22/run_tests.sh b/src/tests/ecoc22/run_tests.sh new file mode 100755 index 0000000000000000000000000000000000000000..a97ed9eca7b59ba634d526785bd0aae476469021 --- /dev/null +++ b/src/tests/ecoc22/run_tests.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. + +# Run functional tests +source tfs_runtime_env_vars.sh +pytest --verbose --log-level=INFO src/tests/ecoc22/tests/test_functional_bootstrap.py +pytest --verbose --log-level=INFO src/tests/ecoc22/tests/test_functional_create_service.py +pytest --verbose --log-level=INFO src/tests/ecoc22/tests/test_functional_delete_service.py +pytest --verbose --log-level=INFO src/tests/ecoc22/tests/test_functional_cleanup.py diff --git a/src/tests/ecoc22/tests/.gitignore b/src/tests/ecoc22/tests/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..76cb708d1b532c9b69166e55f36bcb912fd5e370 --- /dev/null +++ b/src/tests/ecoc22/tests/.gitignore @@ -0,0 +1,2 @@ +# Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. +Credentials.py diff --git a/src/tests/ecoc22/tests/Fixtures.py b/src/tests/ecoc22/tests/Fixtures.py new file mode 100644 index 0000000000000000000000000000000000000000..89dda54cf945d7078cd61c4b94b282f650429309 --- /dev/null +++ b/src/tests/ecoc22/tests/Fixtures.py @@ -0,0 +1,28 @@ +# 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 pytest, logging +from common.Settings import get_setting +from tests.tools.mock_osm.Constants import WIM_PASSWORD, WIM_USERNAME +from tests.tools.mock_osm.MockOSM import MockOSM +from .Objects import WIM_MAPPING + +LOGGER = logging.getLogger(__name__) + +@pytest.fixture(scope='session') +def osm_wim(): + wim_url = 'http://{:s}:{:s}'.format( + get_setting('COMPUTESERVICE_SERVICE_HOST'), str(get_setting('COMPUTESERVICE_SERVICE_PORT_HTTP'))) + LOGGER.info('WIM_MAPPING = {:s}'.format(str(WIM_MAPPING))) + return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) diff --git a/src/tests/ecoc22/tests/Objects.py b/src/tests/ecoc22/tests/Objects.py new file mode 100644 index 0000000000000000000000000000000000000000..4fbd5508e7819d9272c47f8e7f81f74c56925de6 --- /dev/null +++ b/src/tests/ecoc22/tests/Objects.py @@ -0,0 +1,51 @@ +# 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 common.tools.object_factory.Device import json_device_id +from common.tools.object_factory.EndPoint import json_endpoint_id +from tests.tools.mock_osm.Tools import connection_point, wim_mapping + +# ----- WIM Service Settings ------------------------------------------------------------------------------------------- +# PRI = primary // BKP = backup + +SITE_ID_DC1 = 'DC1' +DEV_ID_DC1 = json_device_id('DC1-GW') +EP_ID_DC1_PRI = json_endpoint_id(DEV_ID_DC1, 'eth1') +EP_ID_DC1_BKP = json_endpoint_id(DEV_ID_DC1, 'eth2') +DEV_ID_CS1GW1 = json_device_id('CS1-GW1') +DEV_ID_CS1GW2 = json_device_id('CS1-GW2') + +SITE_ID_DC2 = 'DC2' +DEV_ID_DC2 = json_device_id('DC2-GW') +EP_ID_DC2_PRI = json_endpoint_id(DEV_ID_DC2, 'eth1') +EP_ID_DC2_BKP = json_endpoint_id(DEV_ID_DC2, 'eth2') +DEV_ID_CS2GW1 = json_device_id('CS2-GW1') +DEV_ID_CS2GW2 = json_device_id('CS2-GW2') + +WIM_SEP_DC1_PRI, WIM_MAP_DC1_PRI = wim_mapping(SITE_ID_DC1, EP_ID_DC1_PRI, DEV_ID_CS1GW1, priority=10, redundant=['DC1:DC1-GW:eth2']) +WIM_SEP_DC1_BKP, WIM_MAP_DC1_BKP = wim_mapping(SITE_ID_DC1, EP_ID_DC1_BKP, DEV_ID_CS1GW2, priority=20, redundant=['DC1:DC1-GW:eth1']) +WIM_SEP_DC2_PRI, WIM_MAP_DC2_PRI = wim_mapping(SITE_ID_DC2, EP_ID_DC2_PRI, DEV_ID_CS2GW1, priority=10, redundant=['DC2:DC2-GW:eth2']) +WIM_SEP_DC2_BKP, WIM_MAP_DC2_BKP = wim_mapping(SITE_ID_DC2, EP_ID_DC2_BKP, DEV_ID_CS2GW2, priority=20, redundant=['DC2:DC2-GW:eth1']) + +WIM_MAPPING = [ + WIM_MAP_DC1_PRI, WIM_MAP_DC1_BKP, + WIM_MAP_DC2_PRI, WIM_MAP_DC2_BKP, +] + +WIM_SRV_VLAN_ID = 300 +WIM_SERVICE_TYPE = 'ELAN' +WIM_SERVICE_CONNECTION_POINTS = [ + connection_point(WIM_SEP_DC1_PRI, 'dot1q', WIM_SRV_VLAN_ID), + connection_point(WIM_SEP_DC2_PRI, 'dot1q', WIM_SRV_VLAN_ID), +] diff --git a/src/tests/ecoc22/tests/Tools.py b/src/tests/ecoc22/tests/Tools.py new file mode 100644 index 0000000000000000000000000000000000000000..26a3eda7101907f63fc51bc042bd59dee463d7d9 --- /dev/null +++ b/src/tests/ecoc22/tests/Tools.py @@ -0,0 +1,50 @@ +# 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 typing import Dict, List, Tuple +from common.tools.object_factory.EndPoint import json_endpoint, json_endpoint_id +from common.tools.object_factory.Link import json_link, json_link_id + +def json_endpoint_ids(device_id : Dict, endpoint_descriptors : List[Tuple[str, str, List[int]]]): + return [ + json_endpoint_id(device_id, ep_uuid, topology_id=None) + for ep_uuid, _, _ in endpoint_descriptors + ] + +def json_endpoints(device_id : Dict, endpoint_descriptors : List[Tuple[str, str, List[int]]]): + return [ + json_endpoint(device_id, ep_uuid, ep_type, topology_id=None, kpi_sample_types=ep_sample_types) + for ep_uuid, ep_type, ep_sample_types in endpoint_descriptors + ] + +def get_link_uuid(a_endpoint_id : Dict, z_endpoint_id : Dict) -> str: + return '{:s}/{:s}=={:s}/{:s}'.format( + a_endpoint_id['device_id']['device_uuid']['uuid'], a_endpoint_id['endpoint_uuid']['uuid'], + a_endpoint_id['device_id']['device_uuid']['uuid'], z_endpoint_id['endpoint_uuid']['uuid']) + +def link(a_endpoint_id, z_endpoint_id) -> Tuple[str, Dict, Dict]: + link_uuid = get_link_uuid(a_endpoint_id, z_endpoint_id) + link_id = json_link_id(link_uuid) + link_data = json_link(link_uuid, [a_endpoint_id, z_endpoint_id]) + return link_uuid, link_id, link_data + +def compose_service_endpoint_id(endpoint_id): + device_uuid = endpoint_id['device_id']['device_uuid']['uuid'] + endpoint_uuid = endpoint_id['endpoint_uuid']['uuid'] + return ':'.join([device_uuid, endpoint_uuid]) + +def compose_bearer(endpoint_id): + device_uuid = endpoint_id['device_id']['device_uuid']['uuid'] + endpoint_uuid = endpoint_id['endpoint_uuid']['uuid'] + return ':'.join([device_uuid, endpoint_uuid]) diff --git a/src/tests/ecoc22/tests/__init__.py b/src/tests/ecoc22/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/tests/ecoc22/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/tests/ecoc22/tests/old_code/BuildDescriptors.py b/src/tests/ecoc22/tests/old_code/BuildDescriptors.py new file mode 100644 index 0000000000000000000000000000000000000000..b6a26a4a0843d4859799c073e34b33505548d7c7 --- /dev/null +++ b/src/tests/ecoc22/tests/old_code/BuildDescriptors.py @@ -0,0 +1,71 @@ +# 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. + +# Execution: +# $ cd src +# $ python -m tests.ecoc22.tests.BuildDescriptors dc-csgw-tn +# $ python -m tests.ecoc22.tests.BuildDescriptors dc-csgw-tn-ols +# $ python -m tests.ecoc22.tests.BuildDescriptors bignet + +import copy, json, os, sys +from enum import Enum +from typing import Dict, Tuple + +class Scenario(Enum): + BIGNET = 'bignet' + DC_CSGW_TN = 'dc-csgw-tn' + DC_CSGW_TN_OLS = 'dc-csgw-tn-ols' + +scenario = None if len(sys.argv) < 2 else sys.argv[1].lower() + +if scenario == Scenario.BIGNET.value: + from .Objects_BigNet import CONTEXTS, DEVICES, LINKS, TOPOLOGIES + FILENAME = 'tests/ecoc22/descriptors_emulated-BigNet.json' +elif scenario == Scenario.DC_CSGW_TN.value: + os.environ['ADD_CONNECT_RULES_TO_DEVICES'] = 'TRUE' + from .Objects_DC_CSGW_TN import CONTEXTS, DEVICES, LINKS, TOPOLOGIES + FILENAME = 'tests/ecoc22/descriptors_emulated-DC_CSGW_TN.json' +elif scenario == Scenario.DC_CSGW_TN_OLS.value: + os.environ['ADD_CONNECT_RULES_TO_DEVICES'] = 'TRUE' + from .Objects_DC_CSGW_TN_OLS import CONTEXTS, DEVICES, LINKS, TOPOLOGIES + FILENAME = 'tests/ecoc22/descriptors_emulated-DC_CSGW_TN_OLS.json' +else: + scenarios = str([s.value for s in Scenario]) + raise Exception('Unsupported Scenario({:s}), choices are: {:s}'.format(scenario, scenarios)) + +def main(): + with open(FILENAME, 'w', encoding='UTF-8') as f: + devices = [] + for item in DEVICES: + if isinstance(item, Dict): + device = item + elif isinstance(item, Tuple) and len(item) == 2: + device,connect_rules = item + else: + raise Exception('Wrongly formatted item: {:s}'.format(str(item))) + device = copy.deepcopy(device) + if len(item) == 2: + device['device_config']['config_rules'].extend(connect_rules) + devices.append(device) + + f.write(json.dumps({ + 'contexts': CONTEXTS, + 'topologies': TOPOLOGIES, + 'devices': devices, + 'links': LINKS + }, sort_keys=True, indent=4)) + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/tests/ecoc22/tests/old_code/LoadDescriptors.py b/src/tests/ecoc22/tests/old_code/LoadDescriptors.py new file mode 100644 index 0000000000000000000000000000000000000000..5041d854eba9eaf733b163f922716fe9891da5ae --- /dev/null +++ b/src/tests/ecoc22/tests/old_code/LoadDescriptors.py @@ -0,0 +1,38 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import json, logging, sys +from common.Settings import get_setting +from context.client.ContextClient import ContextClient +from common.proto.context_pb2 import Context, Device, Link, Topology +from device.client.DeviceClient import DeviceClient + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +def main(): + context_client = ContextClient() + device_client = DeviceClient() + + with open('tests/ecoc22/descriptors.json', 'r', encoding='UTF-8') as f: + descriptors = json.loads(f.read()) + + for context in descriptors['contexts' ]: context_client.SetContext (Context (**context )) + for topology in descriptors['topologies']: context_client.SetTopology(Topology(**topology)) + for device in descriptors['devices' ]: device_client .AddDevice (Device (**device )) + for link in descriptors['links' ]: context_client.SetLink (Link (**link )) + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/tests/ecoc22/tests/old_code/Objects_BigNet.py b/src/tests/ecoc22/tests/old_code/Objects_BigNet.py new file mode 100644 index 0000000000000000000000000000000000000000..fb96914678e646840400e5270892b82428c428ee --- /dev/null +++ b/src/tests/ecoc22/tests/old_code/Objects_BigNet.py @@ -0,0 +1,302 @@ +# 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 common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Device import ( + json_device_emulated_connect_rules, json_device_emulated_datacenter_disabled, + json_device_emulated_packet_router_disabled, json_device_id) +from common.tools.object_factory.Topology import json_topology, json_topology_id +from .Tools import compose_bearer, compose_service_endpoint_id, json_endpoint_ids, link + +# ----- Context -------------------------------------------------------------------------------------------------------- +CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) +CONTEXT = json_context(DEFAULT_CONTEXT_NAME) + + +# ----- Topology ------------------------------------------------------------------------------------------------------- +TOPOLOGY_ID = json_topology_id(DEFAULT_TOPOLOGY_NAME, context_id=CONTEXT_ID) +TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_NAME, context_id=CONTEXT_ID) + + +# ----- Customer Equipment (CE) Devices -------------------------------------------------------------------------------- +DEVICE_CE1_UUID = 'CE1' +DEVICE_CE1_ENDPOINT_DEFS = [('1/1', 'copper', [])] +DEVICE_CE1_ID = json_device_id(DEVICE_CE1_UUID) +DEVICE_CE1_ENDPOINT_IDS = json_endpoint_ids(DEVICE_CE1_ID, DEVICE_CE1_ENDPOINT_DEFS) +DEVICE_CE1 = json_device_emulated_packet_router_disabled(DEVICE_CE1_UUID) +ENDPOINT_ID_CE1_1_1 = DEVICE_CE1_ENDPOINT_IDS[0] +DEVICE_CE1_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_CE1_ENDPOINT_DEFS) + +DEVICE_CE2_UUID = 'CE2' +DEVICE_CE2_ENDPOINT_DEFS = [('1/1', 'copper', [])] +DEVICE_CE2_ID = json_device_id(DEVICE_CE2_UUID) +DEVICE_CE2_ENDPOINT_IDS = json_endpoint_ids(DEVICE_CE2_ID, DEVICE_CE2_ENDPOINT_DEFS) +DEVICE_CE2 = json_device_emulated_packet_router_disabled(DEVICE_CE2_UUID) +ENDPOINT_ID_CE2_1_1 = DEVICE_CE2_ENDPOINT_IDS[0] +DEVICE_CE2_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_CE2_ENDPOINT_DEFS) + +DEVICE_CE3_UUID = 'CE3' +DEVICE_CE3_ENDPOINT_DEFS = [('1/1', 'copper', [])] +DEVICE_CE3_ID = json_device_id(DEVICE_CE3_UUID) +DEVICE_CE3_ENDPOINT_IDS = json_endpoint_ids(DEVICE_CE3_ID, DEVICE_CE3_ENDPOINT_DEFS) +DEVICE_CE3 = json_device_emulated_packet_router_disabled(DEVICE_CE3_UUID) +ENDPOINT_ID_CE3_1_1 = DEVICE_CE3_ENDPOINT_IDS[0] +DEVICE_CE3_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_CE3_ENDPOINT_DEFS) + +DEVICE_CE4_UUID = 'CE4' +DEVICE_CE4_ENDPOINT_DEFS = [('1/1', 'copper', [])] +DEVICE_CE4_ID = json_device_id(DEVICE_CE4_UUID) +DEVICE_CE4_ENDPOINT_IDS = json_endpoint_ids(DEVICE_CE4_ID, DEVICE_CE4_ENDPOINT_DEFS) +DEVICE_CE4 = json_device_emulated_packet_router_disabled(DEVICE_CE4_UUID) +ENDPOINT_ID_CE4_1_1 = DEVICE_CE4_ENDPOINT_IDS[0] +DEVICE_CE4_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_CE4_ENDPOINT_DEFS) + +# ----- Provider Equipment (PE) Devices -------------------------------------------------------------------------------- +DEVICE_PE1_UUID = 'PE1' +DEVICE_PE1_ENDPOINT_DEFS = [('1/1', 'copper', []), + ('2/1', 'copper', []), ('2/2', 'copper', [])] +DEVICE_PE1_ID = json_device_id(DEVICE_PE1_UUID) +DEVICE_PE1_ENDPOINT_IDS = json_endpoint_ids(DEVICE_PE1_ID, DEVICE_PE1_ENDPOINT_DEFS) +DEVICE_PE1 = json_device_emulated_packet_router_disabled(DEVICE_PE1_UUID) +ENDPOINT_ID_PE1_1_1 = DEVICE_PE1_ENDPOINT_IDS[0] +ENDPOINT_ID_PE1_2_1 = DEVICE_PE1_ENDPOINT_IDS[1] +ENDPOINT_ID_PE1_2_2 = DEVICE_PE1_ENDPOINT_IDS[2] +DEVICE_PE1_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_PE1_ENDPOINT_DEFS) + +DEVICE_PE2_UUID = 'PE2' +DEVICE_PE2_ENDPOINT_DEFS = [('1/1', 'copper', []), + ('2/1', 'copper', []), ('2/2', 'copper', [])] +DEVICE_PE2_ID = json_device_id(DEVICE_PE2_UUID) +DEVICE_PE2_ENDPOINT_IDS = json_endpoint_ids(DEVICE_PE2_ID, DEVICE_PE2_ENDPOINT_DEFS) +DEVICE_PE2 = json_device_emulated_packet_router_disabled(DEVICE_PE2_UUID) +ENDPOINT_ID_PE2_1_1 = DEVICE_PE2_ENDPOINT_IDS[0] +ENDPOINT_ID_PE2_2_1 = DEVICE_PE2_ENDPOINT_IDS[1] +ENDPOINT_ID_PE2_2_2 = DEVICE_PE2_ENDPOINT_IDS[2] +DEVICE_PE2_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_PE2_ENDPOINT_DEFS) + +DEVICE_PE3_UUID = 'PE3' +DEVICE_PE3_ENDPOINT_DEFS = [('1/1', 'copper', []), + ('2/1', 'copper', []), ('2/2', 'copper', [])] +DEVICE_PE3_ID = json_device_id(DEVICE_PE3_UUID) +DEVICE_PE3_ENDPOINT_IDS = json_endpoint_ids(DEVICE_PE3_ID, DEVICE_PE3_ENDPOINT_DEFS) +DEVICE_PE3 = json_device_emulated_packet_router_disabled(DEVICE_PE3_UUID) +ENDPOINT_ID_PE3_1_1 = DEVICE_PE3_ENDPOINT_IDS[0] +ENDPOINT_ID_PE3_2_1 = DEVICE_PE3_ENDPOINT_IDS[1] +ENDPOINT_ID_PE3_2_2 = DEVICE_PE3_ENDPOINT_IDS[2] +DEVICE_PE3_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_PE3_ENDPOINT_DEFS) + +DEVICE_PE4_UUID = 'PE4' +DEVICE_PE4_ENDPOINT_DEFS = [('1/1', 'copper', []), + ('2/1', 'copper', []), ('2/2', 'copper', [])] +DEVICE_PE4_ID = json_device_id(DEVICE_PE4_UUID) +DEVICE_PE4_ENDPOINT_IDS = json_endpoint_ids(DEVICE_PE4_ID, DEVICE_PE4_ENDPOINT_DEFS) +DEVICE_PE4 = json_device_emulated_packet_router_disabled(DEVICE_PE4_UUID) +ENDPOINT_ID_PE4_1_1 = DEVICE_PE4_ENDPOINT_IDS[0] +ENDPOINT_ID_PE4_2_1 = DEVICE_PE4_ENDPOINT_IDS[1] +ENDPOINT_ID_PE4_2_2 = DEVICE_PE4_ENDPOINT_IDS[2] +DEVICE_PE4_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_PE4_ENDPOINT_DEFS) + +# ----- BackBone (BB) Devices ------------------------------------------------------------------------------------------ +DEVICE_BB1_UUID = 'BB1' +DEVICE_BB1_ENDPOINT_DEFS = [('1/1', 'copper', []), ('1/2', 'copper', []), + ('2/1', 'copper', []), ('2/2', 'copper', []), ('2/3', 'copper', [])] +DEVICE_BB1_ID = json_device_id(DEVICE_BB1_UUID) +DEVICE_BB1_ENDPOINT_IDS = json_endpoint_ids(DEVICE_BB1_ID, DEVICE_BB1_ENDPOINT_DEFS) +DEVICE_BB1 = json_device_emulated_packet_router_disabled(DEVICE_BB1_UUID) +ENDPOINT_ID_BB1_1_1 = DEVICE_BB1_ENDPOINT_IDS[0] +ENDPOINT_ID_BB1_1_2 = DEVICE_BB1_ENDPOINT_IDS[1] +ENDPOINT_ID_BB1_2_1 = DEVICE_BB1_ENDPOINT_IDS[2] +ENDPOINT_ID_BB1_2_2 = DEVICE_BB1_ENDPOINT_IDS[3] +ENDPOINT_ID_BB1_2_3 = DEVICE_BB1_ENDPOINT_IDS[4] +DEVICE_BB1_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_BB1_ENDPOINT_DEFS) + +DEVICE_BB2_UUID = 'BB2' +DEVICE_BB2_ENDPOINT_DEFS = [('1/1', 'copper', []), ('1/2', 'copper', []), + ('2/1', 'copper', []), ('2/2', 'copper', []), ('2/3', 'copper', [])] +DEVICE_BB2_ID = json_device_id(DEVICE_BB2_UUID) +DEVICE_BB2_ENDPOINT_IDS = json_endpoint_ids(DEVICE_BB2_ID, DEVICE_BB2_ENDPOINT_DEFS) +DEVICE_BB2 = json_device_emulated_packet_router_disabled(DEVICE_BB2_UUID) +ENDPOINT_ID_BB2_1_1 = DEVICE_BB2_ENDPOINT_IDS[0] +ENDPOINT_ID_BB2_1_2 = DEVICE_BB2_ENDPOINT_IDS[1] +ENDPOINT_ID_BB2_2_1 = DEVICE_BB2_ENDPOINT_IDS[2] +ENDPOINT_ID_BB2_2_2 = DEVICE_BB2_ENDPOINT_IDS[3] +ENDPOINT_ID_BB2_2_3 = DEVICE_BB2_ENDPOINT_IDS[4] +DEVICE_BB2_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_BB2_ENDPOINT_DEFS) + +DEVICE_BB3_UUID = 'BB3' +DEVICE_BB3_ENDPOINT_DEFS = [('2/1', 'copper', []), ('2/2', 'copper', []), ('2/3', 'copper', [])] +DEVICE_BB3_ID = json_device_id(DEVICE_BB3_UUID) +DEVICE_BB3_ENDPOINT_IDS = json_endpoint_ids(DEVICE_BB3_ID, DEVICE_BB3_ENDPOINT_DEFS) +DEVICE_BB3 = json_device_emulated_packet_router_disabled(DEVICE_BB3_UUID) +ENDPOINT_ID_BB3_2_1 = DEVICE_BB3_ENDPOINT_IDS[0] +ENDPOINT_ID_BB3_2_2 = DEVICE_BB3_ENDPOINT_IDS[1] +ENDPOINT_ID_BB3_2_3 = DEVICE_BB3_ENDPOINT_IDS[2] +DEVICE_BB3_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_BB3_ENDPOINT_DEFS) + +DEVICE_BB4_UUID = 'BB4' +DEVICE_BB4_ENDPOINT_DEFS = [('1/1', 'copper', []), ('1/2', 'copper', []), + ('2/1', 'copper', []), ('2/2', 'copper', []), ('2/3', 'copper', [])] +DEVICE_BB4_ID = json_device_id(DEVICE_BB4_UUID) +DEVICE_BB4_ENDPOINT_IDS = json_endpoint_ids(DEVICE_BB4_ID, DEVICE_BB4_ENDPOINT_DEFS) +DEVICE_BB4 = json_device_emulated_packet_router_disabled(DEVICE_BB4_UUID) +ENDPOINT_ID_BB4_1_1 = DEVICE_BB4_ENDPOINT_IDS[0] +ENDPOINT_ID_BB4_1_2 = DEVICE_BB4_ENDPOINT_IDS[1] +ENDPOINT_ID_BB4_2_1 = DEVICE_BB4_ENDPOINT_IDS[2] +ENDPOINT_ID_BB4_2_2 = DEVICE_BB4_ENDPOINT_IDS[3] +ENDPOINT_ID_BB4_2_3 = DEVICE_BB4_ENDPOINT_IDS[4] +DEVICE_BB4_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_BB4_ENDPOINT_DEFS) + +DEVICE_BB5_UUID = 'BB5' +DEVICE_BB5_ENDPOINT_DEFS = [('1/1', 'copper', []), ('1/2', 'copper', []), + ('2/1', 'copper', []), ('2/2', 'copper', []), ('2/3', 'copper', [])] +DEVICE_BB5_ID = json_device_id(DEVICE_BB5_UUID) +DEVICE_BB5_ENDPOINT_IDS = json_endpoint_ids(DEVICE_BB5_ID, DEVICE_BB5_ENDPOINT_DEFS) +DEVICE_BB5 = json_device_emulated_packet_router_disabled(DEVICE_BB5_UUID) +ENDPOINT_ID_BB5_1_1 = DEVICE_BB5_ENDPOINT_IDS[0] +ENDPOINT_ID_BB5_1_2 = DEVICE_BB5_ENDPOINT_IDS[1] +ENDPOINT_ID_BB5_2_1 = DEVICE_BB5_ENDPOINT_IDS[2] +ENDPOINT_ID_BB5_2_2 = DEVICE_BB5_ENDPOINT_IDS[3] +ENDPOINT_ID_BB5_2_3 = DEVICE_BB5_ENDPOINT_IDS[4] +DEVICE_BB5_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_BB5_ENDPOINT_DEFS) + +DEVICE_BB6_UUID = 'BB6' +DEVICE_BB6_ENDPOINT_DEFS = [('2/1', 'copper', []), ('2/2', 'copper', []), ('2/3', 'copper', [])] +DEVICE_BB6_ID = json_device_id(DEVICE_BB6_UUID) +DEVICE_BB6_ENDPOINT_IDS = json_endpoint_ids(DEVICE_BB6_ID, DEVICE_BB6_ENDPOINT_DEFS) +DEVICE_BB6 = json_device_emulated_packet_router_disabled(DEVICE_BB6_UUID) +ENDPOINT_ID_BB6_2_1 = DEVICE_BB6_ENDPOINT_IDS[0] +ENDPOINT_ID_BB6_2_2 = DEVICE_BB6_ENDPOINT_IDS[1] +ENDPOINT_ID_BB6_2_3 = DEVICE_BB6_ENDPOINT_IDS[2] +DEVICE_BB6_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_BB6_ENDPOINT_DEFS) + +DEVICE_BB7_UUID = 'BB7' +DEVICE_BB7_ENDPOINT_DEFS = [('2/1', 'copper', []), ('2/2', 'copper', []), ('2/3', 'copper', []), ('2/4', 'copper', []), + ('2/5', 'copper', []), ('2/6', 'copper', [])] +DEVICE_BB7_ID = json_device_id(DEVICE_BB7_UUID) +DEVICE_BB7_ENDPOINT_IDS = json_endpoint_ids(DEVICE_BB7_ID, DEVICE_BB7_ENDPOINT_DEFS) +DEVICE_BB7 = json_device_emulated_packet_router_disabled(DEVICE_BB7_UUID) +ENDPOINT_ID_BB7_2_1 = DEVICE_BB7_ENDPOINT_IDS[0] +ENDPOINT_ID_BB7_2_2 = DEVICE_BB7_ENDPOINT_IDS[1] +ENDPOINT_ID_BB7_2_3 = DEVICE_BB7_ENDPOINT_IDS[2] +ENDPOINT_ID_BB7_2_4 = DEVICE_BB7_ENDPOINT_IDS[3] +ENDPOINT_ID_BB7_2_5 = DEVICE_BB7_ENDPOINT_IDS[4] +ENDPOINT_ID_BB7_2_6 = DEVICE_BB7_ENDPOINT_IDS[5] +DEVICE_BB7_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_BB7_ENDPOINT_DEFS) + + +# ----- Links ---------------------------------------------------------------------------------------------------------- +LINK_CE1_PE1_UUID, LINK_CE1_PE1_ID, LINK_CE1_PE1 = link(ENDPOINT_ID_CE1_1_1, ENDPOINT_ID_PE1_1_1) +LINK_CE2_PE2_UUID, LINK_CE2_PE2_ID, LINK_CE2_PE2 = link(ENDPOINT_ID_CE2_1_1, ENDPOINT_ID_PE2_1_1) +LINK_CE3_PE3_UUID, LINK_CE3_PE3_ID, LINK_CE3_PE3 = link(ENDPOINT_ID_CE3_1_1, ENDPOINT_ID_PE3_1_1) +LINK_CE4_PE4_UUID, LINK_CE4_PE4_ID, LINK_CE4_PE4 = link(ENDPOINT_ID_CE4_1_1, ENDPOINT_ID_PE4_1_1) + +LINK_PE1_BB1_UUID, LINK_PE1_BB1_ID, LINK_PE1_BB1 = link(ENDPOINT_ID_PE1_2_1, ENDPOINT_ID_BB1_1_1) +LINK_PE1_BB2_UUID, LINK_PE1_BB2_ID, LINK_PE1_BB2 = link(ENDPOINT_ID_PE1_2_2, ENDPOINT_ID_BB2_1_1) +LINK_PE2_BB1_UUID, LINK_PE2_BB1_ID, LINK_PE2_BB1 = link(ENDPOINT_ID_PE2_2_1, ENDPOINT_ID_BB1_1_2) +LINK_PE2_BB2_UUID, LINK_PE2_BB2_ID, LINK_PE2_BB2 = link(ENDPOINT_ID_PE2_2_2, ENDPOINT_ID_BB2_1_2) + +LINK_PE3_BB4_UUID, LINK_PE3_BB4_ID, LINK_PE3_BB4 = link(ENDPOINT_ID_PE3_2_1, ENDPOINT_ID_BB4_1_1) +LINK_PE3_BB5_UUID, LINK_PE3_BB5_ID, LINK_PE3_BB5 = link(ENDPOINT_ID_PE3_2_2, ENDPOINT_ID_BB5_1_1) +LINK_PE4_BB4_UUID, LINK_PE4_BB4_ID, LINK_PE4_BB4 = link(ENDPOINT_ID_PE4_2_1, ENDPOINT_ID_BB4_1_2) +LINK_PE4_BB5_UUID, LINK_PE4_BB5_ID, LINK_PE4_BB5 = link(ENDPOINT_ID_PE4_2_2, ENDPOINT_ID_BB5_1_2) + +LINK_BB1_BB2_UUID, LINK_BB1_BB2_ID, LINK_BB1_BB2 = link(ENDPOINT_ID_BB1_2_1, ENDPOINT_ID_BB2_2_2) +LINK_BB2_BB3_UUID, LINK_BB2_BB3_ID, LINK_BB2_BB3 = link(ENDPOINT_ID_BB2_2_1, ENDPOINT_ID_BB3_2_2) +LINK_BB3_BB4_UUID, LINK_BB3_BB4_ID, LINK_BB3_BB4 = link(ENDPOINT_ID_BB3_2_1, ENDPOINT_ID_BB4_2_2) +LINK_BB4_BB5_UUID, LINK_BB4_BB5_ID, LINK_BB4_BB5 = link(ENDPOINT_ID_BB4_2_1, ENDPOINT_ID_BB5_2_2) +LINK_BB5_BB6_UUID, LINK_BB5_BB6_ID, LINK_BB5_BB6 = link(ENDPOINT_ID_BB5_2_1, ENDPOINT_ID_BB6_2_2) +LINK_BB6_BB1_UUID, LINK_BB6_BB1_ID, LINK_BB6_BB1 = link(ENDPOINT_ID_BB6_2_1, ENDPOINT_ID_BB1_2_2) + +LINK_BB1_BB7_UUID, LINK_BB1_BB7_ID, LINK_BB1_BB7 = link(ENDPOINT_ID_BB1_2_3, ENDPOINT_ID_BB7_2_1) +LINK_BB2_BB7_UUID, LINK_BB2_BB7_ID, LINK_BB2_BB7 = link(ENDPOINT_ID_BB2_2_3, ENDPOINT_ID_BB7_2_2) +LINK_BB3_BB7_UUID, LINK_BB3_BB7_ID, LINK_BB3_BB7 = link(ENDPOINT_ID_BB3_2_3, ENDPOINT_ID_BB7_2_3) +LINK_BB4_BB7_UUID, LINK_BB4_BB7_ID, LINK_BB4_BB7 = link(ENDPOINT_ID_BB4_2_3, ENDPOINT_ID_BB7_2_4) +LINK_BB5_BB7_UUID, LINK_BB5_BB7_ID, LINK_BB5_BB7 = link(ENDPOINT_ID_BB5_2_3, ENDPOINT_ID_BB7_2_5) +LINK_BB6_BB7_UUID, LINK_BB6_BB7_ID, LINK_BB6_BB7 = link(ENDPOINT_ID_BB6_2_3, ENDPOINT_ID_BB7_2_6) + + +# ----- WIM Service Settings ------------------------------------------------------------------------------------------- +WIM_USERNAME = 'admin' +WIM_PASSWORD = 'admin' + +def mapping(site_id, ce_endpoint_id, pe_device_id, priority=None, redundant=[]): + ce_device_uuid = ce_endpoint_id['device_id']['device_uuid']['uuid'] + ce_endpoint_uuid = ce_endpoint_id['endpoint_uuid']['uuid'] + pe_device_uuid = pe_device_id['device_uuid']['uuid'] + service_endpoint_id = '{:s}-{:s}-{:s}'.format(site_id, ce_device_uuid, ce_endpoint_uuid) + bearer = '{:s}-{:s}'.format(ce_device_uuid, pe_device_uuid) + _mapping = { + 'service_endpoint_id': service_endpoint_id, + 'datacenter_id': site_id, 'device_id': ce_device_uuid, 'device_interface_id': ce_endpoint_uuid, + 'service_mapping_info': { + 'site-id': site_id, + 'bearer': {'bearer-reference': bearer}, + } + } + if priority is not None: _mapping['service_mapping_info']['priority'] = priority + if len(redundant) > 0: _mapping['service_mapping_info']['redundant'] = redundant + return service_endpoint_id, _mapping + +WIM_SEP_DC1_PRI, WIM_MAP_DC1_PRI = mapping('DC1', ENDPOINT_ID_CE1_1_1, DEVICE_PE1_ID, priority=10, redundant=['DC1-CE2-1/1']) +WIM_SEP_DC1_SEC, WIM_MAP_DC1_SEC = mapping('DC1', ENDPOINT_ID_CE2_1_1, DEVICE_PE2_ID, priority=20) +WIM_SEP_DC2_PRI, WIM_MAP_DC2_PRI = mapping('DC2', ENDPOINT_ID_CE3_1_1, DEVICE_PE3_ID, priority=10, redundant=['DC2-CE4-1/1']) +WIM_SEP_DC2_SEC, WIM_MAP_DC2_SEC = mapping('DC2', ENDPOINT_ID_CE4_1_1, DEVICE_PE4_ID, priority=20) + +WIM_MAPPING = [WIM_MAP_DC1_PRI, WIM_MAP_DC1_SEC, WIM_MAP_DC2_PRI, WIM_MAP_DC2_SEC] + +WIM_SRV_VLAN_ID = 300 +WIM_SERVICE_TYPE = 'ELAN' +WIM_SERVICE_CONNECTION_POINTS = [ + {'service_endpoint_id': WIM_SEP_DC1_PRI, + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': WIM_SRV_VLAN_ID}}, + {'service_endpoint_id': WIM_SEP_DC2_PRI, + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': WIM_SRV_VLAN_ID}}, +] + + +# ----- Object Collections --------------------------------------------------------------------------------------------- + +CONTEXTS = [CONTEXT] +TOPOLOGIES = [TOPOLOGY] + +DEVICES = [ + (DEVICE_CE1, DEVICE_CE1_CONNECT_RULES), + (DEVICE_CE2, DEVICE_CE2_CONNECT_RULES), + (DEVICE_CE3, DEVICE_CE3_CONNECT_RULES), + (DEVICE_CE4, DEVICE_CE4_CONNECT_RULES), + + (DEVICE_PE1, DEVICE_PE1_CONNECT_RULES), + (DEVICE_PE2, DEVICE_PE2_CONNECT_RULES), + (DEVICE_PE3, DEVICE_PE3_CONNECT_RULES), + (DEVICE_PE4, DEVICE_PE4_CONNECT_RULES), + + (DEVICE_BB1, DEVICE_BB1_CONNECT_RULES), + (DEVICE_BB2, DEVICE_BB2_CONNECT_RULES), + (DEVICE_BB6, DEVICE_BB6_CONNECT_RULES), + (DEVICE_BB7, DEVICE_BB7_CONNECT_RULES), + (DEVICE_BB3, DEVICE_BB3_CONNECT_RULES), + (DEVICE_BB5, DEVICE_BB5_CONNECT_RULES), + (DEVICE_BB4, DEVICE_BB4_CONNECT_RULES), +] + +LINKS = [ + LINK_CE1_PE1, LINK_CE2_PE2, LINK_CE3_PE3, LINK_CE4_PE4, + LINK_PE1_BB1, LINK_PE1_BB2, LINK_PE2_BB1, LINK_PE2_BB2, + LINK_PE3_BB5, LINK_PE3_BB4, LINK_PE4_BB5, LINK_PE4_BB4, + LINK_BB1_BB2, LINK_BB2_BB3, LINK_BB3_BB4, LINK_BB4_BB5, LINK_BB5_BB6, LINK_BB6_BB1, + LINK_BB1_BB7, LINK_BB2_BB7, LINK_BB3_BB7, LINK_BB4_BB7, LINK_BB5_BB7, LINK_BB6_BB7, +] diff --git a/src/tests/ecoc22/tests/old_code/Objects_DC_CSGW_OLS.py b/src/tests/ecoc22/tests/old_code/Objects_DC_CSGW_OLS.py new file mode 100644 index 0000000000000000000000000000000000000000..522c25d6b272247093edb72cdbfa0ba515ed8cf8 --- /dev/null +++ b/src/tests/ecoc22/tests/old_code/Objects_DC_CSGW_OLS.py @@ -0,0 +1,210 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os, uuid +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Device import ( + json_device_emulated_connect_rules, json_device_emulated_datacenter_disabled, + json_device_emulated_packet_router_disabled, json_device_emulated_tapi_disabled, json_device_id) +from common.tools.object_factory.EndPoint import json_endpoints +from common.tools.object_factory.Link import get_link_uuid, json_link, json_link_id +from common.tools.object_factory.Service import get_service_uuid, json_service_l3nm_planned +from common.tools.object_factory.Topology import json_topology, json_topology_id + +# if true, Device component is present and will infeer the endpoints from connect-rules +# if false, Device component is not present and device objects must contain preconfigured endpoints +ADD_CONNECT_RULES_TO_DEVICES = os.environ.get('ADD_CONNECT_RULES_TO_DEVICES', 'True') +ADD_CONNECT_RULES_TO_DEVICES = ADD_CONNECT_RULES_TO_DEVICES.upper() in {'T', 'TRUE', '1', 'Y', 'YES'} + +def compose_router(device_uuid, endpoint_uuids, topology_id=None): + device_id = json_device_id(device_uuid) + r_endpoints = [(endpoint_uuid, 'copper', []) for endpoint_uuid in endpoint_uuids] + config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] + endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) + j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints + device = json_device_emulated_packet_router_disabled(device_uuid, config_rules=config_rules, endpoints=j_endpoints) + return device_id, endpoints, device + +def compose_ols(device_uuid, endpoint_uuids, topology_id=None): + device_id = json_device_id(device_uuid) + r_endpoints = [(endpoint_uuid, 'optical', []) for endpoint_uuid in endpoint_uuids] + config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] + endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) + j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints + device = json_device_emulated_tapi_disabled(device_uuid, config_rules=config_rules, endpoints=j_endpoints) + return device_id, endpoints, device + +def compose_datacenter(device_uuid, endpoint_uuids, topology_id=None): + device_id = json_device_id(device_uuid) + r_endpoints = [(endpoint_uuid, 'copper', []) for endpoint_uuid in endpoint_uuids] + config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] + endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) + j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints + device = json_device_emulated_datacenter_disabled(device_uuid, config_rules=config_rules, endpoints=j_endpoints) + return device_id, endpoints, device + +def compose_link(endpoint_a, endpoint_z): + link_uuid = get_link_uuid(endpoint_a['endpoint_id'], endpoint_z['endpoint_id']) + link_id = json_link_id(link_uuid) + link = json_link(link_uuid, [endpoint_a['endpoint_id'], endpoint_z['endpoint_id']]) + return link_id, link + +def compose_service(endpoint_a, endpoint_z, constraints=[]): + service_uuid = get_service_uuid(endpoint_a['endpoint_id'], endpoint_z['endpoint_id']) + endpoint_ids = [endpoint_a['endpoint_id'], endpoint_z['endpoint_id']] + service = json_service_l3nm_planned(service_uuid, endpoint_ids=endpoint_ids, constraints=constraints) + return service + +# ----- Context -------------------------------------------------------------------------------------------------------- +CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) +CONTEXT = json_context(DEFAULT_CONTEXT_NAME) + +# ----- Domains -------------------------------------------------------------------------------------------------------- +# Overall network topology +TOPO_ADMIN_UUID = DEFAULT_TOPOLOGY_NAME +TOPO_ADMIN_ID = json_topology_id(TOPO_ADMIN_UUID, context_id=CONTEXT_ID) +TOPO_ADMIN = json_topology(TOPO_ADMIN_UUID, context_id=CONTEXT_ID) + +# DataCenter #1 Network +TOPO_DC1_UUID = 'DC1' +TOPO_DC1_ID = json_topology_id(TOPO_DC1_UUID, context_id=CONTEXT_ID) +TOPO_DC1 = json_topology(TOPO_DC1_UUID, context_id=CONTEXT_ID) + +# DataCenter #2 Network +TOPO_DC2_UUID = 'DC2' +TOPO_DC2_ID = json_topology_id(TOPO_DC2_UUID, context_id=CONTEXT_ID) +TOPO_DC2 = json_topology(TOPO_DC2_UUID, context_id=CONTEXT_ID) + +# CellSite #1 Network +TOPO_CS1_UUID = 'CS1' +TOPO_CS1_ID = json_topology_id(TOPO_CS1_UUID, context_id=CONTEXT_ID) +TOPO_CS1 = json_topology(TOPO_CS1_UUID, context_id=CONTEXT_ID) + +# CellSite #2 Network +TOPO_CS2_UUID = 'CS2' +TOPO_CS2_ID = json_topology_id(TOPO_CS2_UUID, context_id=CONTEXT_ID) +TOPO_CS2 = json_topology(TOPO_CS2_UUID, context_id=CONTEXT_ID) + +# Transport Network Network +TOPO_TN_UUID = 'TN' +TOPO_TN_ID = json_topology_id(TOPO_TN_UUID, context_id=CONTEXT_ID) +TOPO_TN = json_topology(TOPO_TN_UUID, context_id=CONTEXT_ID) + + +# ----- Devices -------------------------------------------------------------------------------------------------------- +# DataCenters +DEV_DC1GW_ID, DEV_DC1GW_EPS, DEV_DC1GW = compose_datacenter('DC1-GW', ['eth1', 'eth2', 'int']) +DEV_DC2GW_ID, DEV_DC2GW_EPS, DEV_DC2GW = compose_datacenter('DC2-GW', ['eth1', 'eth2', 'int']) + +# CellSites +DEV_CS1GW1_ID, DEV_CS1GW1_EPS, DEV_CS1GW1 = compose_router('CS1-GW1', ['10/1', '1/1']) +DEV_CS1GW2_ID, DEV_CS1GW2_EPS, DEV_CS1GW2 = compose_router('CS1-GW2', ['10/1', '1/1']) +DEV_CS2GW1_ID, DEV_CS2GW1_EPS, DEV_CS2GW1 = compose_router('CS2-GW1', ['10/1', '1/1']) +DEV_CS2GW2_ID, DEV_CS2GW2_EPS, DEV_CS2GW2 = compose_router('CS2-GW2', ['10/1', '1/1']) + +# Transport Network +#tols_ep_uuids = [str(uuid.uuid4()).split('-')[-1] for _ in range(4)] +tols_ep_uuids = ['afd8ffbb5403', '04b84e213e83', '3169ae676ac6', '93506f786270'] +DEV_TOLS_ID, DEV_TOLS_EPS, DEV_TOLS = compose_ols('TN-OLS', tols_ep_uuids) + + +# ----- Links ---------------------------------------------------------------------------------------------------------- +# InterDomain DC-CSGW +LINK_DC1GW_CS1GW1_ID, LINK_DC1GW_CS1GW1 = compose_link(DEV_DC1GW_EPS[0], DEV_CS1GW1_EPS[0]) +LINK_DC1GW_CS1GW2_ID, LINK_DC1GW_CS1GW2 = compose_link(DEV_DC1GW_EPS[1], DEV_CS1GW2_EPS[0]) +LINK_DC2GW_CS2GW1_ID, LINK_DC2GW_CS2GW1 = compose_link(DEV_DC2GW_EPS[0], DEV_CS2GW1_EPS[0]) +LINK_DC2GW_CS2GW2_ID, LINK_DC2GW_CS2GW2 = compose_link(DEV_DC2GW_EPS[1], DEV_CS2GW2_EPS[0]) + +# InterDomain CSGW-TN +LINK_CS1GW1_TOLS_ID, LINK_CS1GW1_TOLS = compose_link(DEV_CS1GW1_EPS[1], DEV_TOLS_EPS[0]) +LINK_CS1GW2_TOLS_ID, LINK_CS1GW2_TOLS = compose_link(DEV_CS1GW2_EPS[1], DEV_TOLS_EPS[1]) +LINK_CS2GW1_TOLS_ID, LINK_CS2GW1_TOLS = compose_link(DEV_CS2GW1_EPS[1], DEV_TOLS_EPS[2]) +LINK_CS2GW2_TOLS_ID, LINK_CS2GW2_TOLS = compose_link(DEV_CS2GW2_EPS[1], DEV_TOLS_EPS[3]) + + +# ----- WIM Service Settings ------------------------------------------------------------------------------------------- +WIM_USERNAME = 'admin' +WIM_PASSWORD = 'admin' + +def mapping(site_id, ce_endpoint_id, pe_device_id, priority=None, redundant=[]): + ce_endpoint_id = ce_endpoint_id['endpoint_id'] + ce_device_uuid = ce_endpoint_id['device_id']['device_uuid']['uuid'] + ce_endpoint_uuid = ce_endpoint_id['endpoint_uuid']['uuid'] + pe_device_uuid = pe_device_id['device_uuid']['uuid'] + service_endpoint_id = '{:s}:{:s}:{:s}'.format(site_id, ce_device_uuid, ce_endpoint_uuid) + bearer = '{:s}:{:s}'.format(ce_device_uuid, pe_device_uuid) + _mapping = { + 'service_endpoint_id': service_endpoint_id, + 'datacenter_id': site_id, 'device_id': ce_device_uuid, 'device_interface_id': ce_endpoint_uuid, + 'service_mapping_info': { + 'site-id': site_id, + 'bearer': {'bearer-reference': bearer}, + } + } + if priority is not None: _mapping['service_mapping_info']['priority'] = priority + if len(redundant) > 0: _mapping['service_mapping_info']['redundant'] = redundant + return service_endpoint_id, _mapping + +WIM_SEP_DC1_PRI, WIM_MAP_DC1_PRI = mapping('DC1', DEV_DC1GW_EPS[0], DEV_CS1GW1_ID, priority=10, redundant=['DC1:DC1-GW:eth2']) +WIM_SEP_DC1_SEC, WIM_MAP_DC1_SEC = mapping('DC1', DEV_DC1GW_EPS[1], DEV_CS1GW2_ID, priority=20, redundant=['DC1:DC1-GW:eth1']) +WIM_SEP_DC2_PRI, WIM_MAP_DC2_PRI = mapping('DC2', DEV_DC2GW_EPS[0], DEV_CS2GW1_ID, priority=10, redundant=['DC2:DC2-GW:eth2']) +WIM_SEP_DC2_SEC, WIM_MAP_DC2_SEC = mapping('DC2', DEV_DC2GW_EPS[1], DEV_CS2GW2_ID, priority=20, redundant=['DC2:DC2-GW:eth1']) + +WIM_MAPPING = [WIM_MAP_DC1_PRI, WIM_MAP_DC1_SEC, WIM_MAP_DC2_PRI, WIM_MAP_DC2_SEC] + +WIM_SRV_VLAN_ID = 300 +WIM_SERVICE_TYPE = 'ELAN' +WIM_SERVICE_CONNECTION_POINTS = [ + {'service_endpoint_id': WIM_SEP_DC1_PRI, + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': WIM_SRV_VLAN_ID}}, + {'service_endpoint_id': WIM_SEP_DC2_PRI, + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': WIM_SRV_VLAN_ID}}, +] + + +# ----- Containers ----------------------------------------------------------------------------------------------------- +CONTEXTS = [ CONTEXT ] +TOPOLOGIES = [ TOPO_ADMIN, TOPO_DC1, TOPO_DC2, TOPO_CS1, TOPO_CS2, TOPO_TN ] +DEVICES = [ DEV_DC1GW, DEV_DC2GW, + DEV_CS1GW1, DEV_CS1GW2, DEV_CS2GW1, DEV_CS2GW2, + DEV_TOLS, + ] +LINKS = [ LINK_DC1GW_CS1GW1, LINK_DC1GW_CS1GW2, LINK_DC2GW_CS2GW1, LINK_DC2GW_CS2GW2, + LINK_CS1GW1_TOLS, LINK_CS1GW2_TOLS, LINK_CS2GW1_TOLS, LINK_CS2GW2_TOLS, + ] + +OBJECTS_PER_TOPOLOGY = [ + (TOPO_ADMIN_ID, + [DEV_DC1GW_ID, DEV_DC2GW_ID, DEV_CS1GW1_ID, DEV_CS1GW2_ID, DEV_CS2GW1_ID, DEV_CS2GW2_ID, DEV_TOLS_ID], + [LINK_DC1GW_CS1GW1_ID, LINK_DC1GW_CS1GW2_ID, LINK_DC2GW_CS2GW1_ID, LINK_DC2GW_CS2GW2_ID], + ), + (TOPO_DC1_ID, + [DEV_DC1GW_ID], + []), + (TOPO_DC2_ID, + [DEV_DC2GW_ID], + []), + (TOPO_CS1_ID, + [DEV_CS1GW1_ID, DEV_CS1GW2_ID], + []), + (TOPO_CS2_ID, + [DEV_CS2GW1_ID, DEV_CS2GW2_ID], + []), + (TOPO_TN_ID, + [DEV_TOLS_ID], + []), +] diff --git a/src/tests/ecoc22/tests/old_code/Objects_DC_CSGW_TN.py b/src/tests/ecoc22/tests/old_code/Objects_DC_CSGW_TN.py new file mode 100644 index 0000000000000000000000000000000000000000..c02f5d0c880f4bf570b7d14278c4bcbb1cffe72d --- /dev/null +++ b/src/tests/ecoc22/tests/old_code/Objects_DC_CSGW_TN.py @@ -0,0 +1,227 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Device import ( + json_device_emulated_connect_rules, json_device_emulated_datacenter_disabled, + json_device_emulated_packet_router_disabled, json_device_id) +from common.tools.object_factory.EndPoint import json_endpoints +from common.tools.object_factory.Link import get_link_uuid, json_link, json_link_id +from common.tools.object_factory.Service import get_service_uuid, json_service_l3nm_planned +from common.tools.object_factory.Topology import json_topology, json_topology_id + +# if true, Device component is present and will infeer the endpoints from connect-rules +# if false, Device component is not present and device objects must contain preconfigured endpoints +ADD_CONNECT_RULES_TO_DEVICES = os.environ.get('ADD_CONNECT_RULES_TO_DEVICES', 'True') +ADD_CONNECT_RULES_TO_DEVICES = ADD_CONNECT_RULES_TO_DEVICES.upper() in {'T', 'TRUE', '1', 'Y', 'YES'} + +def compose_router(device_uuid, endpoint_uuids, topology_id=None): + device_id = json_device_id(device_uuid) + r_endpoints = [(endpoint_uuid, 'copper', []) for endpoint_uuid in endpoint_uuids] + config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] + endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) + j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints + device = json_device_emulated_packet_router_disabled(device_uuid, config_rules=config_rules, endpoints=j_endpoints) + return device_id, endpoints, device + +def compose_datacenter(device_uuid, endpoint_uuids, topology_id=None): + device_id = json_device_id(device_uuid) + r_endpoints = [(endpoint_uuid, 'copper', []) for endpoint_uuid in endpoint_uuids] + config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] + endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) + j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints + device = json_device_emulated_datacenter_disabled(device_uuid, config_rules=config_rules, endpoints=j_endpoints) + return device_id, endpoints, device + +def compose_link(endpoint_a, endpoint_z): + link_uuid = get_link_uuid(endpoint_a['endpoint_id'], endpoint_z['endpoint_id']) + link_id = json_link_id(link_uuid) + link = json_link(link_uuid, [endpoint_a['endpoint_id'], endpoint_z['endpoint_id']]) + return link_id, link + +def compose_service(endpoint_a, endpoint_z, constraints=[]): + service_uuid = get_service_uuid(endpoint_a['endpoint_id'], endpoint_z['endpoint_id']) + endpoint_ids = [endpoint_a['endpoint_id'], endpoint_z['endpoint_id']] + service = json_service_l3nm_planned(service_uuid, endpoint_ids=endpoint_ids, constraints=constraints) + return service + +# ----- Context -------------------------------------------------------------------------------------------------------- +CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) +CONTEXT = json_context(DEFAULT_CONTEXT_NAME) + +# ----- Domains -------------------------------------------------------------------------------------------------------- +# Overall network topology +TOPO_ADMIN_UUID = DEFAULT_TOPOLOGY_NAME +TOPO_ADMIN_ID = json_topology_id(TOPO_ADMIN_UUID, context_id=CONTEXT_ID) +TOPO_ADMIN = json_topology(TOPO_ADMIN_UUID, context_id=CONTEXT_ID) + +# DataCenter #1 Network +TOPO_DC1_UUID = 'DC1' +TOPO_DC1_ID = json_topology_id(TOPO_DC1_UUID, context_id=CONTEXT_ID) +TOPO_DC1 = json_topology(TOPO_DC1_UUID, context_id=CONTEXT_ID) + +# DataCenter #2 Network +TOPO_DC2_UUID = 'DC2' +TOPO_DC2_ID = json_topology_id(TOPO_DC2_UUID, context_id=CONTEXT_ID) +TOPO_DC2 = json_topology(TOPO_DC2_UUID, context_id=CONTEXT_ID) + +# CellSite #1 Network +TOPO_CS1_UUID = 'CS1' +TOPO_CS1_ID = json_topology_id(TOPO_CS1_UUID, context_id=CONTEXT_ID) +TOPO_CS1 = json_topology(TOPO_CS1_UUID, context_id=CONTEXT_ID) + +# CellSite #2 Network +TOPO_CS2_UUID = 'CS2' +TOPO_CS2_ID = json_topology_id(TOPO_CS2_UUID, context_id=CONTEXT_ID) +TOPO_CS2 = json_topology(TOPO_CS2_UUID, context_id=CONTEXT_ID) + +# Transport Network Network +TOPO_TN_UUID = 'TN' +TOPO_TN_ID = json_topology_id(TOPO_TN_UUID, context_id=CONTEXT_ID) +TOPO_TN = json_topology(TOPO_TN_UUID, context_id=CONTEXT_ID) + + +# ----- Devices -------------------------------------------------------------------------------------------------------- +# DataCenters +DEV_DC1GW_ID, DEV_DC1GW_EPS, DEV_DC1GW = compose_datacenter('DC1-GW', ['eth1', 'eth2', 'int']) +DEV_DC2GW_ID, DEV_DC2GW_EPS, DEV_DC2GW = compose_datacenter('DC2-GW', ['eth1', 'eth2', 'int']) + +# CellSites +DEV_CS1GW1_ID, DEV_CS1GW1_EPS, DEV_CS1GW1 = compose_router('CS1-GW1', ['10/1', '1/1', '1/2']) +DEV_CS1GW2_ID, DEV_CS1GW2_EPS, DEV_CS1GW2 = compose_router('CS1-GW2', ['10/1', '1/1', '1/2']) +DEV_CS2GW1_ID, DEV_CS2GW1_EPS, DEV_CS2GW1 = compose_router('CS2-GW1', ['10/1', '1/1', '1/2']) +DEV_CS2GW2_ID, DEV_CS2GW2_EPS, DEV_CS2GW2 = compose_router('CS2-GW2', ['10/1', '1/1', '1/2']) + +# Transport Network +DEV_TNR1_ID, DEV_TNR1_EPS, DEV_TNR1 = compose_router('TN-R1', ['1/1', '1/2', '2/1', '2/2', '2/3']) +DEV_TNR2_ID, DEV_TNR2_EPS, DEV_TNR2 = compose_router('TN-R2', ['1/1', '1/2', '2/1', '2/2', '2/3']) +DEV_TNR3_ID, DEV_TNR3_EPS, DEV_TNR3 = compose_router('TN-R3', ['1/1', '1/2', '2/1', '2/2', '2/3']) +DEV_TNR4_ID, DEV_TNR4_EPS, DEV_TNR4 = compose_router('TN-R4', ['1/1', '1/2', '2/1', '2/2', '2/3']) + + +# ----- Links ---------------------------------------------------------------------------------------------------------- +# InterDomain DC-CSGW +LINK_DC1GW_CS1GW1_ID, LINK_DC1GW_CS1GW1 = compose_link(DEV_DC1GW_EPS[0], DEV_CS1GW1_EPS[0]) +LINK_DC1GW_CS1GW2_ID, LINK_DC1GW_CS1GW2 = compose_link(DEV_DC1GW_EPS[1], DEV_CS1GW2_EPS[0]) +LINK_DC2GW_CS2GW1_ID, LINK_DC2GW_CS2GW1 = compose_link(DEV_DC2GW_EPS[0], DEV_CS2GW1_EPS[0]) +LINK_DC2GW_CS2GW2_ID, LINK_DC2GW_CS2GW2 = compose_link(DEV_DC2GW_EPS[1], DEV_CS2GW2_EPS[0]) + +# InterDomain CSGW-TN +LINK_CS1GW1_TNR1_ID, LINK_CS1GW1_TNR1 = compose_link(DEV_CS1GW1_EPS[1], DEV_TNR1_EPS[0]) +LINK_CS1GW2_TNR2_ID, LINK_CS1GW2_TNR2 = compose_link(DEV_CS1GW2_EPS[1], DEV_TNR2_EPS[0]) +LINK_CS1GW1_TNR2_ID, LINK_CS1GW1_TNR2 = compose_link(DEV_CS1GW1_EPS[2], DEV_TNR2_EPS[1]) +LINK_CS1GW2_TNR1_ID, LINK_CS1GW2_TNR1 = compose_link(DEV_CS1GW2_EPS[2], DEV_TNR1_EPS[1]) +LINK_CS2GW1_TNR3_ID, LINK_CS2GW1_TNR3 = compose_link(DEV_CS2GW1_EPS[1], DEV_TNR3_EPS[0]) +LINK_CS2GW2_TNR4_ID, LINK_CS2GW2_TNR4 = compose_link(DEV_CS2GW2_EPS[1], DEV_TNR4_EPS[0]) +LINK_CS2GW1_TNR4_ID, LINK_CS2GW1_TNR4 = compose_link(DEV_CS2GW1_EPS[2], DEV_TNR4_EPS[1]) +LINK_CS2GW2_TNR3_ID, LINK_CS2GW2_TNR3 = compose_link(DEV_CS2GW2_EPS[2], DEV_TNR3_EPS[1]) + +# IntraDomain TN +LINK_TNR1_TNR2_ID, LINK_TNR1_TNR2 = compose_link(DEV_TNR1_EPS[2], DEV_TNR2_EPS[3]) +LINK_TNR2_TNR3_ID, LINK_TNR2_TNR3 = compose_link(DEV_TNR2_EPS[2], DEV_TNR3_EPS[3]) +LINK_TNR3_TNR4_ID, LINK_TNR3_TNR4 = compose_link(DEV_TNR3_EPS[2], DEV_TNR4_EPS[3]) +LINK_TNR4_TNR1_ID, LINK_TNR4_TNR1 = compose_link(DEV_TNR4_EPS[2], DEV_TNR1_EPS[3]) +LINK_TNR1_TNR3_ID, LINK_TNR1_TNR3 = compose_link(DEV_TNR1_EPS[4], DEV_TNR3_EPS[4]) +LINK_TNR2_TNR4_ID, LINK_TNR2_TNR4 = compose_link(DEV_TNR2_EPS[4], DEV_TNR4_EPS[4]) + + +# ----- WIM Service Settings ------------------------------------------------------------------------------------------- +WIM_USERNAME = 'admin' +WIM_PASSWORD = 'admin' + +def mapping(site_id, ce_endpoint_id, pe_device_id, priority=None, redundant=[]): + ce_endpoint_id = ce_endpoint_id['endpoint_id'] + ce_device_uuid = ce_endpoint_id['device_id']['device_uuid']['uuid'] + ce_endpoint_uuid = ce_endpoint_id['endpoint_uuid']['uuid'] + pe_device_uuid = pe_device_id['device_uuid']['uuid'] + service_endpoint_id = '{:s}:{:s}:{:s}'.format(site_id, ce_device_uuid, ce_endpoint_uuid) + bearer = '{:s}:{:s}'.format(ce_device_uuid, pe_device_uuid) + _mapping = { + 'service_endpoint_id': service_endpoint_id, + 'datacenter_id': site_id, 'device_id': ce_device_uuid, 'device_interface_id': ce_endpoint_uuid, + 'service_mapping_info': { + 'site-id': site_id, + 'bearer': {'bearer-reference': bearer}, + } + } + if priority is not None: _mapping['service_mapping_info']['priority'] = priority + if len(redundant) > 0: _mapping['service_mapping_info']['redundant'] = redundant + return service_endpoint_id, _mapping + +WIM_SEP_DC1_PRI, WIM_MAP_DC1_PRI = mapping('DC1', DEV_DC1GW_EPS[0], DEV_CS1GW1_ID, priority=10, redundant=['DC1:DC1-GW:eth2']) +WIM_SEP_DC1_SEC, WIM_MAP_DC1_SEC = mapping('DC1', DEV_DC1GW_EPS[1], DEV_CS1GW2_ID, priority=20, redundant=['DC1:DC1-GW:eth1']) +WIM_SEP_DC2_PRI, WIM_MAP_DC2_PRI = mapping('DC2', DEV_DC2GW_EPS[0], DEV_CS2GW1_ID, priority=10, redundant=['DC2:DC2-GW:eth2']) +WIM_SEP_DC2_SEC, WIM_MAP_DC2_SEC = mapping('DC2', DEV_DC2GW_EPS[1], DEV_CS2GW2_ID, priority=20, redundant=['DC2:DC2-GW:eth1']) + +WIM_MAPPING = [WIM_MAP_DC1_PRI, WIM_MAP_DC1_SEC, WIM_MAP_DC2_PRI, WIM_MAP_DC2_SEC] + +WIM_SRV_VLAN_ID = 300 +WIM_SERVICE_TYPE = 'ELAN' +WIM_SERVICE_CONNECTION_POINTS = [ + {'service_endpoint_id': WIM_SEP_DC1_PRI, + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': WIM_SRV_VLAN_ID}}, + {'service_endpoint_id': WIM_SEP_DC2_PRI, + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': WIM_SRV_VLAN_ID}}, +] + + +# ----- Containers ----------------------------------------------------------------------------------------------------- +CONTEXTS = [ CONTEXT ] +TOPOLOGIES = [ TOPO_ADMIN, TOPO_DC1, TOPO_DC2, TOPO_CS1, TOPO_CS2, TOPO_TN ] +DEVICES = [ DEV_DC1GW, DEV_DC2GW, + DEV_CS1GW1, DEV_CS1GW2, DEV_CS2GW1, DEV_CS2GW2, + DEV_TNR1, DEV_TNR2, DEV_TNR3, DEV_TNR4, + ] +LINKS = [ LINK_DC1GW_CS1GW1, LINK_DC1GW_CS1GW2, LINK_DC2GW_CS2GW1, LINK_DC2GW_CS2GW2, + LINK_CS1GW1_TNR1, LINK_CS1GW2_TNR2, LINK_CS1GW1_TNR2, LINK_CS1GW2_TNR1, + LINK_CS2GW1_TNR3, LINK_CS2GW2_TNR4, LINK_CS2GW1_TNR4, LINK_CS2GW2_TNR3, + LINK_TNR1_TNR2, LINK_TNR2_TNR3, LINK_TNR3_TNR4, LINK_TNR4_TNR1, LINK_TNR1_TNR3, LINK_TNR2_TNR4, + ] + +OBJECTS_PER_TOPOLOGY = [ + (TOPO_ADMIN_ID, + [ DEV_DC1GW_ID, DEV_DC2GW_ID, + DEV_CS1GW1_ID, DEV_CS1GW2_ID, DEV_CS2GW1_ID, DEV_CS2GW2_ID, + DEV_TNR1_ID, DEV_TNR2_ID, DEV_TNR3_ID, DEV_TNR4_ID, + ], + [ LINK_DC1GW_CS1GW1_ID, LINK_DC1GW_CS1GW2_ID, LINK_DC2GW_CS2GW1_ID, LINK_DC2GW_CS2GW2_ID, + LINK_CS1GW1_TNR1_ID, LINK_CS1GW2_TNR2_ID, LINK_CS1GW1_TNR2_ID, LINK_CS1GW2_TNR1_ID, + LINK_CS2GW1_TNR3_ID, LINK_CS2GW2_TNR4_ID, LINK_CS2GW1_TNR4_ID, LINK_CS2GW2_TNR3_ID, + LINK_TNR1_TNR2_ID, LINK_TNR2_TNR3_ID, LINK_TNR3_TNR4_ID, LINK_TNR4_TNR1_ID, LINK_TNR1_TNR3_ID, + LINK_TNR2_TNR4_ID, + ], + ), + (TOPO_DC1_ID, + [DEV_DC1GW_ID], + []), + (TOPO_DC2_ID, + [DEV_DC2GW_ID], + []), + (TOPO_CS1_ID, + [DEV_CS1GW1_ID, DEV_CS1GW2_ID], + []), + (TOPO_CS2_ID, + [DEV_CS2GW1_ID, DEV_CS2GW2_ID], + []), + (TOPO_TN_ID, + [ DEV_TNR1_ID, DEV_TNR2_ID, DEV_TNR3_ID, DEV_TNR4_ID, + ], + [ LINK_TNR1_TNR2_ID, LINK_TNR2_TNR3_ID, LINK_TNR3_TNR4_ID, LINK_TNR4_TNR1_ID, LINK_TNR1_TNR3_ID, + LINK_TNR2_TNR4_ID, + ]), +] diff --git a/src/tests/ecoc22/tests/old_code/Objects_DC_CSGW_TN_OLS.py b/src/tests/ecoc22/tests/old_code/Objects_DC_CSGW_TN_OLS.py new file mode 100644 index 0000000000000000000000000000000000000000..6c34ec01d4c9b466aa81d306078a0ab242a334ad --- /dev/null +++ b/src/tests/ecoc22/tests/old_code/Objects_DC_CSGW_TN_OLS.py @@ -0,0 +1,239 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os, uuid +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Device import ( + json_device_emulated_connect_rules, json_device_emulated_datacenter_disabled, + json_device_emulated_packet_router_disabled, json_device_emulated_tapi_disabled, json_device_id) +from common.tools.object_factory.EndPoint import json_endpoints +from common.tools.object_factory.Link import get_link_uuid, json_link, json_link_id +from common.tools.object_factory.Service import get_service_uuid, json_service_l3nm_planned +from common.tools.object_factory.Topology import json_topology, json_topology_id + +# if true, Device component is present and will infeer the endpoints from connect-rules +# if false, Device component is not present and device objects must contain preconfigured endpoints +ADD_CONNECT_RULES_TO_DEVICES = os.environ.get('ADD_CONNECT_RULES_TO_DEVICES', 'True') +ADD_CONNECT_RULES_TO_DEVICES = ADD_CONNECT_RULES_TO_DEVICES.upper() in {'T', 'TRUE', '1', 'Y', 'YES'} + +def compose_router(device_uuid, endpoint_uuids, topology_id=None): + device_id = json_device_id(device_uuid) + r_endpoints = [(endpoint_uuid, 'copper', []) for endpoint_uuid in endpoint_uuids] + config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] + endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) + j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints + device = json_device_emulated_packet_router_disabled(device_uuid, config_rules=config_rules, endpoints=j_endpoints) + return device_id, endpoints, device + +def compose_ols(device_uuid, endpoint_uuids, topology_id=None): + device_id = json_device_id(device_uuid) + r_endpoints = [(endpoint_uuid, 'optical', []) for endpoint_uuid in endpoint_uuids] + config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] + endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) + j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints + device = json_device_emulated_tapi_disabled(device_uuid, config_rules=config_rules, endpoints=j_endpoints) + return device_id, endpoints, device + +def compose_datacenter(device_uuid, endpoint_uuids, topology_id=None): + device_id = json_device_id(device_uuid) + r_endpoints = [(endpoint_uuid, 'copper', []) for endpoint_uuid in endpoint_uuids] + config_rules = json_device_emulated_connect_rules(r_endpoints) if ADD_CONNECT_RULES_TO_DEVICES else [] + endpoints = json_endpoints(device_id, r_endpoints, topology_id=topology_id) + j_endpoints = [] if ADD_CONNECT_RULES_TO_DEVICES else endpoints + device = json_device_emulated_datacenter_disabled(device_uuid, config_rules=config_rules, endpoints=j_endpoints) + return device_id, endpoints, device + +def compose_link(endpoint_a, endpoint_z): + link_uuid = get_link_uuid(endpoint_a['endpoint_id'], endpoint_z['endpoint_id']) + link_id = json_link_id(link_uuid) + link = json_link(link_uuid, [endpoint_a['endpoint_id'], endpoint_z['endpoint_id']]) + return link_id, link + +def compose_service(endpoint_a, endpoint_z, constraints=[]): + service_uuid = get_service_uuid(endpoint_a['endpoint_id'], endpoint_z['endpoint_id']) + endpoint_ids = [endpoint_a['endpoint_id'], endpoint_z['endpoint_id']] + service = json_service_l3nm_planned(service_uuid, endpoint_ids=endpoint_ids, constraints=constraints) + return service + +# ----- Context -------------------------------------------------------------------------------------------------------- +CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) +CONTEXT = json_context(DEFAULT_CONTEXT_NAME) + +# ----- Domains -------------------------------------------------------------------------------------------------------- +# Overall network topology +TOPO_ADMIN_UUID = DEFAULT_TOPOLOGY_NAME +TOPO_ADMIN_ID = json_topology_id(TOPO_ADMIN_UUID, context_id=CONTEXT_ID) +TOPO_ADMIN = json_topology(TOPO_ADMIN_UUID, context_id=CONTEXT_ID) + +# DataCenter #1 Network +TOPO_DC1_UUID = 'DC1' +TOPO_DC1_ID = json_topology_id(TOPO_DC1_UUID, context_id=CONTEXT_ID) +TOPO_DC1 = json_topology(TOPO_DC1_UUID, context_id=CONTEXT_ID) + +# DataCenter #2 Network +TOPO_DC2_UUID = 'DC2' +TOPO_DC2_ID = json_topology_id(TOPO_DC2_UUID, context_id=CONTEXT_ID) +TOPO_DC2 = json_topology(TOPO_DC2_UUID, context_id=CONTEXT_ID) + +# CellSite #1 Network +TOPO_CS1_UUID = 'CS1' +TOPO_CS1_ID = json_topology_id(TOPO_CS1_UUID, context_id=CONTEXT_ID) +TOPO_CS1 = json_topology(TOPO_CS1_UUID, context_id=CONTEXT_ID) + +# CellSite #2 Network +TOPO_CS2_UUID = 'CS2' +TOPO_CS2_ID = json_topology_id(TOPO_CS2_UUID, context_id=CONTEXT_ID) +TOPO_CS2 = json_topology(TOPO_CS2_UUID, context_id=CONTEXT_ID) + +# Transport Network Network +TOPO_TN_UUID = 'TN' +TOPO_TN_ID = json_topology_id(TOPO_TN_UUID, context_id=CONTEXT_ID) +TOPO_TN = json_topology(TOPO_TN_UUID, context_id=CONTEXT_ID) + + +# ----- Devices -------------------------------------------------------------------------------------------------------- +# DataCenters +DEV_DC1GW_ID, DEV_DC1GW_EPS, DEV_DC1GW = compose_datacenter('DC1-GW', ['eth1', 'eth2', 'int']) +DEV_DC2GW_ID, DEV_DC2GW_EPS, DEV_DC2GW = compose_datacenter('DC2-GW', ['eth1', 'eth2', 'int']) + +# CellSites +DEV_CS1GW1_ID, DEV_CS1GW1_EPS, DEV_CS1GW1 = compose_router('CS1-GW1', ['10/1', '1/1', '1/2']) +DEV_CS1GW2_ID, DEV_CS1GW2_EPS, DEV_CS1GW2 = compose_router('CS1-GW2', ['10/1', '1/1', '1/2']) +DEV_CS2GW1_ID, DEV_CS2GW1_EPS, DEV_CS2GW1 = compose_router('CS2-GW1', ['10/1', '1/1', '1/2']) +DEV_CS2GW2_ID, DEV_CS2GW2_EPS, DEV_CS2GW2 = compose_router('CS2-GW2', ['10/1', '1/1', '1/2']) + +# Transport Network +DEV_TNR1_ID, DEV_TNR1_EPS, DEV_TNR1 = compose_router('TN-R1', ['1/1', '1/2', '2/1']) +DEV_TNR2_ID, DEV_TNR2_EPS, DEV_TNR2 = compose_router('TN-R2', ['1/1', '1/2', '2/1']) +DEV_TNR3_ID, DEV_TNR3_EPS, DEV_TNR3 = compose_router('TN-R3', ['1/1', '1/2', '2/1']) +DEV_TNR4_ID, DEV_TNR4_EPS, DEV_TNR4 = compose_router('TN-R4', ['1/1', '1/2', '2/1']) + +#tols_ep_uuids = [str(uuid.uuid4()).split('-')[-1] for _ in range(4)] +tols_ep_uuids = ['afd8ffbb5403', '04b84e213e83', '3169ae676ac6', '93506f786270'] +DEV_TOLS_ID, DEV_TOLS_EPS, DEV_TOLS = compose_ols('TN-OLS', tols_ep_uuids) + + +# ----- Links ---------------------------------------------------------------------------------------------------------- +# InterDomain DC-CSGW +LINK_DC1GW_CS1GW1_ID, LINK_DC1GW_CS1GW1 = compose_link(DEV_DC1GW_EPS[0], DEV_CS1GW1_EPS[0]) +LINK_DC1GW_CS1GW2_ID, LINK_DC1GW_CS1GW2 = compose_link(DEV_DC1GW_EPS[1], DEV_CS1GW2_EPS[0]) +LINK_DC2GW_CS2GW1_ID, LINK_DC2GW_CS2GW1 = compose_link(DEV_DC2GW_EPS[0], DEV_CS2GW1_EPS[0]) +LINK_DC2GW_CS2GW2_ID, LINK_DC2GW_CS2GW2 = compose_link(DEV_DC2GW_EPS[1], DEV_CS2GW2_EPS[0]) + +# InterDomain CSGW-TN +LINK_CS1GW1_TNR1_ID, LINK_CS1GW1_TNR1 = compose_link(DEV_CS1GW1_EPS[1], DEV_TNR1_EPS[0]) +LINK_CS1GW2_TNR2_ID, LINK_CS1GW2_TNR2 = compose_link(DEV_CS1GW2_EPS[1], DEV_TNR2_EPS[0]) +LINK_CS1GW1_TNR2_ID, LINK_CS1GW1_TNR2 = compose_link(DEV_CS1GW1_EPS[2], DEV_TNR2_EPS[1]) +LINK_CS1GW2_TNR1_ID, LINK_CS1GW2_TNR1 = compose_link(DEV_CS1GW2_EPS[2], DEV_TNR1_EPS[1]) +LINK_CS2GW1_TNR3_ID, LINK_CS2GW1_TNR3 = compose_link(DEV_CS2GW1_EPS[1], DEV_TNR3_EPS[0]) +LINK_CS2GW2_TNR4_ID, LINK_CS2GW2_TNR4 = compose_link(DEV_CS2GW2_EPS[1], DEV_TNR4_EPS[0]) +LINK_CS2GW1_TNR4_ID, LINK_CS2GW1_TNR4 = compose_link(DEV_CS2GW1_EPS[2], DEV_TNR4_EPS[1]) +LINK_CS2GW2_TNR3_ID, LINK_CS2GW2_TNR3 = compose_link(DEV_CS2GW2_EPS[2], DEV_TNR3_EPS[1]) + +# IntraDomain TN +LINK_TNR1_TOLS_ID, LINK_TNR1_TOLS = compose_link(DEV_TNR1_EPS[2], DEV_TOLS_EPS[0]) +LINK_TNR2_TOLS_ID, LINK_TNR2_TOLS = compose_link(DEV_TNR2_EPS[2], DEV_TOLS_EPS[1]) +LINK_TNR3_TOLS_ID, LINK_TNR3_TOLS = compose_link(DEV_TNR3_EPS[2], DEV_TOLS_EPS[2]) +LINK_TNR4_TOLS_ID, LINK_TNR4_TOLS = compose_link(DEV_TNR4_EPS[2], DEV_TOLS_EPS[3]) + + +# ----- WIM Service Settings ------------------------------------------------------------------------------------------- +WIM_USERNAME = 'admin' +WIM_PASSWORD = 'admin' + +def mapping(site_id, ce_endpoint_id, pe_device_id, priority=None, redundant=[]): + ce_endpoint_id = ce_endpoint_id['endpoint_id'] + ce_device_uuid = ce_endpoint_id['device_id']['device_uuid']['uuid'] + ce_endpoint_uuid = ce_endpoint_id['endpoint_uuid']['uuid'] + pe_device_uuid = pe_device_id['device_uuid']['uuid'] + service_endpoint_id = '{:s}:{:s}:{:s}'.format(site_id, ce_device_uuid, ce_endpoint_uuid) + bearer = '{:s}:{:s}'.format(ce_device_uuid, pe_device_uuid) + _mapping = { + 'service_endpoint_id': service_endpoint_id, + 'datacenter_id': site_id, 'device_id': ce_device_uuid, 'device_interface_id': ce_endpoint_uuid, + 'service_mapping_info': { + 'site-id': site_id, + 'bearer': {'bearer-reference': bearer}, + } + } + if priority is not None: _mapping['service_mapping_info']['priority'] = priority + if len(redundant) > 0: _mapping['service_mapping_info']['redundant'] = redundant + return service_endpoint_id, _mapping + +WIM_SEP_DC1_PRI, WIM_MAP_DC1_PRI = mapping('DC1', DEV_DC1GW_EPS[0], DEV_CS1GW1_ID, priority=10, redundant=['DC1:DC1-GW:eth2']) +WIM_SEP_DC1_SEC, WIM_MAP_DC1_SEC = mapping('DC1', DEV_DC1GW_EPS[1], DEV_CS1GW2_ID, priority=20, redundant=['DC1:DC1-GW:eth1']) +WIM_SEP_DC2_PRI, WIM_MAP_DC2_PRI = mapping('DC2', DEV_DC2GW_EPS[0], DEV_CS2GW1_ID, priority=10, redundant=['DC2:DC2-GW:eth2']) +WIM_SEP_DC2_SEC, WIM_MAP_DC2_SEC = mapping('DC2', DEV_DC2GW_EPS[1], DEV_CS2GW2_ID, priority=20, redundant=['DC2:DC2-GW:eth1']) + +WIM_MAPPING = [WIM_MAP_DC1_PRI, WIM_MAP_DC1_SEC, WIM_MAP_DC2_PRI, WIM_MAP_DC2_SEC] + +WIM_SRV_VLAN_ID = 300 +WIM_SERVICE_TYPE = 'ELAN' +WIM_SERVICE_CONNECTION_POINTS = [ + {'service_endpoint_id': WIM_SEP_DC1_PRI, + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': WIM_SRV_VLAN_ID}}, + {'service_endpoint_id': WIM_SEP_DC2_PRI, + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': WIM_SRV_VLAN_ID}}, +] + + +# ----- Containers ----------------------------------------------------------------------------------------------------- +CONTEXTS = [ CONTEXT ] +TOPOLOGIES = [ TOPO_ADMIN, TOPO_DC1, TOPO_DC2, TOPO_CS1, TOPO_CS2, TOPO_TN ] +DEVICES = [ DEV_DC1GW, DEV_DC2GW, + DEV_CS1GW1, DEV_CS1GW2, DEV_CS2GW1, DEV_CS2GW2, + DEV_TNR1, DEV_TNR2, DEV_TNR3, DEV_TNR4, + DEV_TOLS, + ] +LINKS = [ LINK_DC1GW_CS1GW1, LINK_DC1GW_CS1GW2, LINK_DC2GW_CS2GW1, LINK_DC2GW_CS2GW2, + LINK_CS1GW1_TNR1, LINK_CS1GW2_TNR2, LINK_CS1GW1_TNR2, LINK_CS1GW2_TNR1, + LINK_CS2GW1_TNR3, LINK_CS2GW2_TNR4, LINK_CS2GW1_TNR4, LINK_CS2GW2_TNR3, + LINK_TNR1_TOLS, LINK_TNR2_TOLS, LINK_TNR3_TOLS, LINK_TNR4_TOLS, + ] + +OBJECTS_PER_TOPOLOGY = [ + (TOPO_ADMIN_ID, + [ DEV_DC1GW_ID, DEV_DC2GW_ID, + DEV_CS1GW1_ID, DEV_CS1GW2_ID, DEV_CS2GW1_ID, DEV_CS2GW2_ID, + DEV_TNR1_ID, DEV_TNR2_ID, DEV_TNR3_ID, DEV_TNR4_ID, + DEV_TOLS_ID, + ], + [ LINK_DC1GW_CS1GW1_ID, LINK_DC1GW_CS1GW2_ID, LINK_DC2GW_CS2GW1_ID, LINK_DC2GW_CS2GW2_ID, + LINK_CS1GW1_TNR1_ID, LINK_CS1GW2_TNR2_ID, LINK_CS1GW1_TNR2_ID, LINK_CS1GW2_TNR1_ID, + LINK_CS2GW1_TNR3_ID, LINK_CS2GW2_TNR4_ID, LINK_CS2GW1_TNR4_ID, LINK_CS2GW2_TNR3_ID, + LINK_TNR1_TOLS_ID, LINK_TNR2_TOLS_ID, LINK_TNR3_TOLS_ID, LINK_TNR4_TOLS_ID, + ], + ), + (TOPO_DC1_ID, + [DEV_DC1GW_ID], + []), + (TOPO_DC2_ID, + [DEV_DC2GW_ID], + []), + (TOPO_CS1_ID, + [DEV_CS1GW1_ID, DEV_CS1GW2_ID], + []), + (TOPO_CS2_ID, + [DEV_CS2GW1_ID, DEV_CS2GW2_ID], + []), + (TOPO_TN_ID, + [ DEV_TNR1_ID, DEV_TNR2_ID, DEV_TNR3_ID, DEV_TNR4_ID, + DEV_TOLS_ID, + ], + [ LINK_TNR1_TOLS_ID, LINK_TNR2_TOLS_ID, LINK_TNR3_TOLS_ID, LINK_TNR4_TOLS_ID, + ]), +] diff --git a/src/tests/ecoc22/tests/test_functional_bootstrap.py b/src/tests/ecoc22/tests/test_functional_bootstrap.py new file mode 100644 index 0000000000000000000000000000000000000000..3b7b5009c0dbe9d95b4ee8e2cdbe33d39008a7a1 --- /dev/null +++ b/src/tests/ecoc22/tests/test_functional_bootstrap.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 logging +from common.Constants import DEFAULT_CONTEXT_NAME +from common.proto.context_pb2 import ContextId, Empty +from common.tests.LoadScenario import load_scenario_from_descriptor +from common.tools.object_factory.Context import json_context_id +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from tests.Fixtures import context_client, device_client # pylint: disable=unused-import + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DESCRIPTOR_FILE = 'ecoc22/descriptors_emulated.json' +ADMIN_CONTEXT_ID = ContextId(**json_context_id(DEFAULT_CONTEXT_NAME)) + +def test_scenario_bootstrap( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name +) -> None: + # ----- List entities - Ensure database is empty ------------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == 0 + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 + + response = context_client.ListLinks(Empty()) + assert len(response.links) == 0 + + + # ----- Load Scenario ---------------------------------------------------------------------------------------------- + descriptor_loader = load_scenario_from_descriptor( + DESCRIPTOR_FILE, context_client, device_client, None, None) + + + # ----- List entities - Ensure scenario is ready ------------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == descriptor_loader.num_contexts + + for context_uuid, num_topologies in descriptor_loader.num_topologies.items(): + response = context_client.ListTopologies(ContextId(**json_context_id(context_uuid))) + assert len(response.topologies) == num_topologies + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == descriptor_loader.num_devices + + response = context_client.ListLinks(Empty()) + assert len(response.links) == descriptor_loader.num_links + + for context_uuid, _ in descriptor_loader.num_services.items(): + response = context_client.ListServices(ContextId(**json_context_id(context_uuid))) + assert len(response.services) == 0 + + for context_uuid, _ in descriptor_loader.num_slices.items(): + response = context_client.ListSlices(ContextId(**json_context_id(context_uuid))) + assert len(response.slices) == 0 + + # This scenario assumes no services are created beforehand + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.service_ids) == 0 + assert len(response.slice_ids) == 0 diff --git a/src/tests/ecoc22/tests/test_functional_cleanup.py b/src/tests/ecoc22/tests/test_functional_cleanup.py new file mode 100644 index 0000000000000000000000000000000000000000..3e8b5ea65fe8249102ba17b9d4ce3f2cf2296dda --- /dev/null +++ b/src/tests/ecoc22/tests/test_functional_cleanup.py @@ -0,0 +1,90 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging +from common.Constants import DEFAULT_CONTEXT_NAME +from common.proto.context_pb2 import ContextId, DeviceId, Empty, LinkId, TopologyId +from common.tools.descriptor.Loader import DescriptorLoader +from common.tools.object_factory.Context import json_context_id +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from tests.Fixtures import context_client, device_client # pylint: disable=unused-import + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DESCRIPTOR_FILE = 'ecoc22/descriptors_emulated.json' +ADMIN_CONTEXT_ID = ContextId(**json_context_id(DEFAULT_CONTEXT_NAME)) + +def test_services_removed( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name +) -> None: + # ----- List entities - Ensure service is removed ------------------------------------------------------------------ + with open(DESCRIPTOR_FILE, 'r', encoding='UTF-8') as f: + descriptors = f.read() + + descriptor_loader = DescriptorLoader(descriptors) + + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == descriptor_loader.num_contexts + + for context_uuid, num_topologies in descriptor_loader.num_topologies.items(): + response = context_client.ListTopologies(ContextId(**json_context_id(context_uuid))) + assert len(response.topologies) == num_topologies + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == descriptor_loader.num_devices + + response = context_client.ListLinks(Empty()) + assert len(response.links) == descriptor_loader.num_links + + for context_uuid, _ in descriptor_loader.num_services.items(): + response = context_client.ListServices(ContextId(**json_context_id(context_uuid))) + assert len(response.services) == 0 + + for context_uuid, _ in descriptor_loader.num_slices.items(): + response = context_client.ListSlices(ContextId(**json_context_id(context_uuid))) + assert len(response.slices) == 0 + + # This scenario assumes no services are created beforehand + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.service_ids) == 0 + assert len(response.slice_ids) == 0 + + + # ----- Delete Links, Devices, Topologies, Contexts ---------------------------------------------------------------- + for link in descriptor_loader.links: + context_client.RemoveLink(LinkId(**link['link_id'])) + + for device in descriptor_loader.devices: + device_client .DeleteDevice(DeviceId(**device['device_id'])) + + for context_uuid, topology_list in descriptor_loader.topologies.items(): + for topology in topology_list: + context_client.RemoveTopology(TopologyId(**topology['topology_id'])) + + for context in descriptor_loader.contexts: + context_client.RemoveContext(ContextId(**context['context_id'])) + + + # ----- List entities - Ensure database is empty again ------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == 0 + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 + + response = context_client.ListLinks(Empty()) + assert len(response.links) == 0 diff --git a/src/tests/ecoc22/tests/test_functional_create_service.py b/src/tests/ecoc22/tests/test_functional_create_service.py new file mode 100644 index 0000000000000000000000000000000000000000..6dd4eb827c0fbafdf0bce81c7702af5fd5fe007b --- /dev/null +++ b/src/tests/ecoc22/tests/test_functional_create_service.py @@ -0,0 +1,102 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging +from common.Constants import DEFAULT_CONTEXT_NAME +from common.proto.context_pb2 import ContextId, Empty, ServiceTypeEnum +from common.tools.descriptor.Loader import DescriptorLoader +from common.tools.grpc.Tools import grpc_message_to_json_string +from common.tools.object_factory.Context import json_context_id +from context.client.ContextClient import ContextClient +from tests.Fixtures import context_client # pylint: disable=unused-import +from tests.tools.mock_osm.MockOSM import MockOSM +from .Fixtures import osm_wim # pylint: disable=unused-import +from .Objects import WIM_SERVICE_CONNECTION_POINTS, WIM_SERVICE_TYPE + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DESCRIPTOR_FILE = 'ecoc22/descriptors_emulated.json' +ADMIN_CONTEXT_ID = ContextId(**json_context_id(DEFAULT_CONTEXT_NAME)) + +def test_service_creation(context_client : ContextClient, osm_wim : MockOSM): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure scenario is ready ------------------------------------------------------------------- + with open(DESCRIPTOR_FILE, 'r', encoding='UTF-8') as f: + descriptors = f.read() + + descriptor_loader = DescriptorLoader(descriptors) + + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == descriptor_loader.num_contexts + + for context_uuid, num_topologies in descriptor_loader.num_topologies.items(): + response = context_client.ListTopologies(ContextId(**json_context_id(context_uuid))) + assert len(response.topologies) == num_topologies + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == descriptor_loader.num_devices + + response = context_client.ListLinks(Empty()) + assert len(response.links) == descriptor_loader.num_links + + for context_uuid, num_services in descriptor_loader.num_services.items(): + response = context_client.ListServices(ContextId(**json_context_id(context_uuid))) + assert len(response.services) == num_services + + for context_uuid, num_slices in descriptor_loader.num_slices.items(): + response = context_client.ListSlices(ContextId(**json_context_id(context_uuid))) + assert len(response.slices) == num_slices + + # This scenario assumes no services are created beforehand + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.service_ids) == 0 + assert len(response.slice_ids) == 0 + + + # ----- Create Service --------------------------------------------------------------------------------------------- + service_uuid = osm_wim.create_connectivity_service(WIM_SERVICE_TYPE, WIM_SERVICE_CONNECTION_POINTS) + osm_wim.get_connectivity_service_status(service_uuid) + + + # ----- List entities - Ensure service is created ------------------------------------------------------------------ + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == descriptor_loader.num_contexts + + for context_uuid, num_topologies in descriptor_loader.num_topologies.items(): + response = context_client.ListTopologies(ContextId(**json_context_id(context_uuid))) + assert len(response.topologies) == num_topologies + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == descriptor_loader.num_devices + + response = context_client.ListLinks(Empty()) + assert len(response.links) == descriptor_loader.num_links + + response = context_client.ListServices(ADMIN_CONTEXT_ID) + LOGGER.info('Services[{:d}] = {:s}'.format(len(response.services), grpc_message_to_json_string(response))) + assert len(response.services) == 3 # 1xL2NM + 2xTAPI + + for service in response.services: + service_id = service.service_id + response = context_client.ListConnections(service_id) + LOGGER.info(' ServiceId[{:s}] => Connections[{:d}] = {:s}'.format( + grpc_message_to_json_string(service_id), len(response.connections), grpc_message_to_json_string(response))) + + if service.service_type == ServiceTypeEnum.SERVICETYPE_L2NM: + assert len(response.connections) == 2 # 2 connections per service (primary + backup) + elif service.service_type == ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE: + assert len(response.connections) == 1 # 1 connection per service + else: + str_service = grpc_message_to_json_string(service) + raise Exception('Unexpected ServiceType: {:s}'.format(str_service)) diff --git a/src/tests/ecoc22/tests/test_functional_delete_service.py b/src/tests/ecoc22/tests/test_functional_delete_service.py new file mode 100644 index 0000000000000000000000000000000000000000..5cfdc34733d8ddc6927b52131a187fb097b36d9d --- /dev/null +++ b/src/tests/ecoc22/tests/test_functional_delete_service.py @@ -0,0 +1,111 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging +from common.Constants import DEFAULT_CONTEXT_NAME +from common.proto.context_pb2 import ContextId, Empty, ServiceTypeEnum +from common.tools.descriptor.Loader import DescriptorLoader +from common.tools.object_factory.Context import json_context_id +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from tests.Fixtures import context_client # pylint: disable=unused-import +from tests.tools.mock_osm.MockOSM import MockOSM +from .Fixtures import osm_wim # pylint: disable=unused-import + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DESCRIPTOR_FILE = 'ecoc22/descriptors_emulated.json' +ADMIN_CONTEXT_ID = ContextId(**json_context_id(DEFAULT_CONTEXT_NAME)) + +def test_service_removal(context_client : ContextClient, osm_wim : MockOSM): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure service is created ------------------------------------------------------------------ + with open(DESCRIPTOR_FILE, 'r', encoding='UTF-8') as f: + descriptors = f.read() + + descriptor_loader = DescriptorLoader(descriptors) + + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == descriptor_loader.num_contexts + + for context_uuid, num_topologies in descriptor_loader.num_topologies.items(): + response = context_client.ListTopologies(ContextId(**json_context_id(context_uuid))) + assert len(response.topologies) == num_topologies + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == descriptor_loader.num_devices + + response = context_client.ListLinks(Empty()) + assert len(response.links) == descriptor_loader.num_links + + service_uuids = set() + response = context_client.ListServices(ADMIN_CONTEXT_ID) + LOGGER.info('Services[{:d}] = {:s}'.format(len(response.services), grpc_message_to_json_string(response))) + assert len(response.services) == 3 # 1xL2NM + 2xTAPI + + for service in response.services: + service_id = service.service_id + + if service.service_type == ServiceTypeEnum.SERVICETYPE_L2NM: + service_uuid = service_id.service_uuid.uuid + service_uuids.add(service_uuid) + osm_wim.conn_info[service_uuid] = {} + + response = context_client.ListConnections(service_id) + LOGGER.info(' ServiceId[{:s}] => Connections[{:d}] = {:s}'.format( + grpc_message_to_json_string(service_id), len(response.connections), grpc_message_to_json_string(response))) + + if service.service_type == ServiceTypeEnum.SERVICETYPE_L2NM: + assert len(response.connections) == 2 # 2 connections per service (primary + backup) + elif service.service_type == ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE: + assert len(response.connections) == 1 # 1 connection per service + else: + str_service = grpc_message_to_json_string(service) + raise Exception('Unexpected ServiceType: {:s}'.format(str_service)) + + # Identify service to delete + assert len(service_uuids) == 1 # assume a single L2NM service has been created + service_uuid = set(service_uuids).pop() + + + # ----- Delete Service --------------------------------------------------------------------------------------------- + osm_wim.delete_connectivity_service(service_uuid) + + + # ----- List entities - Ensure service is removed ------------------------------------------------------------------ + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == descriptor_loader.num_contexts + + for context_uuid, num_topologies in descriptor_loader.num_topologies.items(): + response = context_client.ListTopologies(ContextId(**json_context_id(context_uuid))) + assert len(response.topologies) == num_topologies + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == descriptor_loader.num_devices + + response = context_client.ListLinks(Empty()) + assert len(response.links) == descriptor_loader.num_links + + for context_uuid, num_services in descriptor_loader.num_services.items(): + response = context_client.ListServices(ContextId(**json_context_id(context_uuid))) + assert len(response.services) == num_services + + for context_uuid, num_slices in descriptor_loader.num_slices.items(): + response = context_client.ListSlices(ContextId(**json_context_id(context_uuid))) + assert len(response.slices) == num_slices + + # This scenario assumes no services are created beforehand + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.service_ids) == 0 + assert len(response.slice_ids) == 0 diff --git a/src/tests/nfvsdn22 b/src/tests/nfvsdn22 new file mode 120000 index 0000000000000000000000000000000000000000..e8122da56327bf631c751cbe38ce6b37d3dc7378 --- /dev/null +++ b/src/tests/nfvsdn22 @@ -0,0 +1 @@ +./scenario2 \ No newline at end of file diff --git a/src/tests/oeccpsc22/README.md b/src/tests/oeccpsc22/README.md new file mode 100644 index 0000000000000000000000000000000000000000..42e0228a52bdf9dfc21bc0358b78fb98677ed458 --- /dev/null +++ b/src/tests/oeccpsc22/README.md @@ -0,0 +1,8 @@ +# OECC/PSC'22 Paper - Interdomain slices +This functional test reproduces the experiment in paper "... paper title ..." presented at OECC/PSC'22 conference +[OECC/PSC'22](... demo link ...). + +## Functional test folder +This functional test can be found in folder `./src/tests/oeccpsc22/`. A convenience alias `./oeccpsc22/` pointing to that folder has been defined. + +# TO BE WRITTEN diff --git a/src/tests/oeccpsc22/__init__.py b/src/tests/oeccpsc22/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/tests/oeccpsc22/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/tests/oeccpsc22/deploy_in_kubernetes.sh b/src/tests/oeccpsc22/deploy_in_kubernetes.sh new file mode 100755 index 0000000000000000000000000000000000000000..53b6e76a8bb32310945b29c57946435d98a0b8d3 --- /dev/null +++ b/src/tests/oeccpsc22/deploy_in_kubernetes.sh @@ -0,0 +1,159 @@ +#!/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. + + +# OECC/PSC 22 deployment settings +export REGISTRY_IMAGE="" +export COMPONENTS="context device monitoring service slice interdomain compute" # webui +export IMAGE_TAG="oeccpsc22" +export K8S_HOSTNAME="kubernetes-master" +#export GRAFANA_PASSWORD="admin123+" + +# Constants +GITLAB_REPO_URL="labs.etsi.org:5050/tfs/controller" +TMP_FOLDER="./tmp" + +# Create a tmp folder for files modified during the deployment +TMP_MANIFESTS_FOLDER="$TMP_FOLDER/manifests" +mkdir -p $TMP_MANIFESTS_FOLDER +TMP_LOGS_FOLDER="$TMP_FOLDER/logs" +mkdir -p $TMP_LOGS_FOLDER + +export K8S_NAMESPACE_1="oeccpsc22-1" +export K8S_NAMESPACE_2="oeccpsc22-2" + +export EXTRA_MANIFESTS_1="./oeccpsc22/expose_services_teraflow_1.yaml" +export EXTRA_MANIFESTS_2="./oeccpsc22/expose_services_teraflow_2.yaml" + +echo "Deleting and Creating new namespaces..." +kubectl delete namespace $K8S_NAMESPACE_1 $K8S_NAMESPACE_2 +kubectl create namespace $K8S_NAMESPACE_1 +kubectl create namespace $K8S_NAMESPACE_2 +printf "\n" + +echo "Creating secrets for InfluxDB..." +#TODO: make sure to change this when having a production deployment +kubectl create secret generic influxdb-secrets --namespace=$K8S_NAMESPACE_1 --from-literal=INFLUXDB_DB="monitoring" --from-literal=INFLUXDB_ADMIN_USER="teraflow" --from-literal=INFLUXDB_ADMIN_PASSWORD="teraflow" --from-literal=INFLUXDB_HTTP_AUTH_ENABLED="True" +kubectl create secret generic monitoring-secrets --namespace=$K8S_NAMESPACE_1 --from-literal=INFLUXDB_DATABASE="monitoring" --from-literal=INFLUXDB_USER="teraflow" --from-literal=INFLUXDB_PASSWORD="teraflow" --from-literal=INFLUXDB_HOSTNAME="localhost" + +kubectl create secret generic influxdb-secrets --namespace=$K8S_NAMESPACE_2 --from-literal=INFLUXDB_DB="monitoring" --from-literal=INFLUXDB_ADMIN_USER="teraflow" --from-literal=INFLUXDB_ADMIN_PASSWORD="teraflow" --from-literal=INFLUXDB_HTTP_AUTH_ENABLED="True" +kubectl create secret generic monitoring-secrets --namespace=$K8S_NAMESPACE_2 --from-literal=INFLUXDB_DATABASE="monitoring" --from-literal=INFLUXDB_USER="teraflow" --from-literal=INFLUXDB_PASSWORD="teraflow" --from-literal=INFLUXDB_HOSTNAME="localhost" +printf "\n" + +echo "Pulling/Updating Docker images..." +docker pull redis:6.2 +docker pull influxdb:1.8 +docker pull grafana/grafana:8.2.6 +printf "\n" + +echo "Deploying components..." +for COMPONENT in $COMPONENTS; do + echo "Processing '$COMPONENT' component..." + IMAGE_NAME="$COMPONENT:$IMAGE_TAG" + IMAGE_URL="$REGISTRY_IMAGE/$IMAGE_NAME" + + echo " Building Docker image..." + BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log" + + if [ "$COMPONENT" == "automation" ] || [ "$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" + fi + + if [ -n "$REGISTRY_IMAGE" ]; then + echo "Pushing Docker image to '$REGISTRY_IMAGE'..." + + TAG_LOG="$TMP_LOGS_FOLDER/tag_${COMPONENT}.log" + docker tag "$IMAGE_NAME" "$IMAGE_URL" > "$TAG_LOG" + + PUSH_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}.log" + docker push "$IMAGE_URL" > "$PUSH_LOG" + fi + + echo " Adapting '$COMPONENT' manifest file..." + MANIFEST="$TMP_MANIFESTS_FOLDER/${COMPONENT}service.yaml" + cp ./manifests/"${COMPONENT}"service.yaml "$MANIFEST" + VERSION=$(grep -i "${GITLAB_REPO_URL}/${COMPONENT}:" "$MANIFEST" | cut -d ":" -f3) + + if [ -n "$REGISTRY_IMAGE" ]; then + + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT:${VERSION}#image: $IMAGE_URL#g" "$MANIFEST" + sed -E -i "s#imagePullPolicy: .*#imagePullPolicy: Always#g" "$MANIFEST" + + else + sed -E -i "s#image: $GITLAB_REPO_URL/$COMPONENT:${VERSION}#image: $IMAGE_NAME#g" "$MANIFEST" + sed -E -i "s#imagePullPolicy: .*#imagePullPolicy: Never#g" "$MANIFEST" + fi + + echo " Deploying '$COMPONENT' component to Kubernetes $K8S_NAMESPACE_1..." + DEPLOY_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}_1.log" + kubectl --namespace $K8S_NAMESPACE_1 apply -f "$MANIFEST" > "$DEPLOY_LOG" + kubectl --namespace $K8S_NAMESPACE_1 scale deployment --replicas=0 ${COMPONENT}service >> "$DEPLOY_LOG" + kubectl --namespace $K8S_NAMESPACE_1 scale deployment --replicas=1 ${COMPONENT}service >> "$DEPLOY_LOG" + + echo " Deploying '$COMPONENT' component to Kubernetes $K8S_NAMESPACE_2..." + DEPLOY_LOG="$TMP_LOGS_FOLDER/push_${COMPONENT}_2.log" + kubectl --namespace $K8S_NAMESPACE_2 apply -f "$MANIFEST" > "$DEPLOY_LOG" + kubectl --namespace $K8S_NAMESPACE_2 scale deployment --replicas=0 ${COMPONENT}service >> "$DEPLOY_LOG" + kubectl --namespace $K8S_NAMESPACE_2 scale deployment --replicas=1 ${COMPONENT}service >> "$DEPLOY_LOG" + + printf "\n" +done + +echo "Deploying extra manifests to Kubernetes $K8S_NAMESPACE_1..." +for EXTRA_MANIFEST in $EXTRA_MANIFESTS_1; do + echo "Processing manifest '$EXTRA_MANIFEST'..." + kubectl --namespace $K8S_NAMESPACE_1 apply -f $EXTRA_MANIFEST + printf "\n" +done + +echo "Deploying extra manifests to Kubernetes $K8S_NAMESPACE_2..." +for EXTRA_MANIFEST in $EXTRA_MANIFESTS_2; do + echo "Processing manifest '$EXTRA_MANIFEST'..." + kubectl --namespace $K8S_NAMESPACE_2 apply -f $EXTRA_MANIFEST + printf "\n" +done + +# By now, leave this control here. Some component dependencies are not well handled +for COMPONENT in $COMPONENTS; do + echo "Waiting for '$COMPONENT' component in Kubernetes $K8S_NAMESPACE_1..." + kubectl wait --namespace $K8S_NAMESPACE_1 --for='condition=available' --timeout=300s deployment/${COMPONENT}service + printf "\n" + + echo "Waiting for '$COMPONENT' component in Kubernetes $K8S_NAMESPACE_2..." + kubectl wait --namespace $K8S_NAMESPACE_2 --for='condition=available' --timeout=300s deployment/${COMPONENT}service + printf "\n" +done + +if [[ "$COMPONENTS" == *"webui"* ]]; then + echo "Configuring WebUI DataStores and Dashboards..." + ./configure_dashboards.sh + printf "\n\n" +fi + +echo "Removing dangling docker images..." +docker images --filter="dangling=true" --quiet | xargs -r docker rmi +printf "\n" + +echo "Reporting Deployment in Kubernetes $K8S_NAMESPACE_1..." +kubectl --namespace $K8S_NAMESPACE_1 get all +printf "\n" + +echo "Reporting Deployment in Kubernetes $K8S_NAMESPACE_2..." +kubectl --namespace $K8S_NAMESPACE_2 get all +printf "\n" + +echo "Done!" diff --git a/src/tests/oeccpsc22/dump_logs.sh b/src/tests/oeccpsc22/dump_logs.sh new file mode 100755 index 0000000000000000000000000000000000000000..a2180f6dff3f35cc7d0e9e2011179a6d8b933ea1 --- /dev/null +++ b/src/tests/oeccpsc22/dump_logs.sh @@ -0,0 +1,32 @@ +#!/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. + +mkdir -p tmp/exec_logs/ + +kubectl --namespace oeccpsc22-1 logs deployment/computeservice -c server > tmp/exec_logs/d1_compute.log +kubectl --namespace oeccpsc22-1 logs deployment/contextservice -c server > tmp/exec_logs/d1_context.log +kubectl --namespace oeccpsc22-1 logs deployment/deviceservice -c server > tmp/exec_logs/d1_device.log +kubectl --namespace oeccpsc22-1 logs deployment/interdomainservice -c server > tmp/exec_logs/d1_interdomain.log +kubectl --namespace oeccpsc22-1 logs deployment/monitoringservice -c server > tmp/exec_logs/d1_monitoring.log +kubectl --namespace oeccpsc22-1 logs deployment/serviceservice -c server > tmp/exec_logs/d1_service.log +kubectl --namespace oeccpsc22-1 logs deployment/sliceservice -c server > tmp/exec_logs/d1_slice.log + +kubectl --namespace oeccpsc22-2 logs deployment/computeservice -c server > tmp/exec_logs/d2_compute.log +kubectl --namespace oeccpsc22-2 logs deployment/contextservice -c server > tmp/exec_logs/d2_context.log +kubectl --namespace oeccpsc22-2 logs deployment/deviceservice -c server > tmp/exec_logs/d2_device.log +kubectl --namespace oeccpsc22-2 logs deployment/interdomainservice -c server > tmp/exec_logs/d2_interdomain.log +kubectl --namespace oeccpsc22-2 logs deployment/monitoringservice -c server > tmp/exec_logs/d2_monitoring.log +kubectl --namespace oeccpsc22-2 logs deployment/serviceservice -c server > tmp/exec_logs/d2_service.log +kubectl --namespace oeccpsc22-2 logs deployment/sliceservice -c server > tmp/exec_logs/d2_slice.log diff --git a/src/tests/ofc22/expose_services.yaml b/src/tests/oeccpsc22/expose_services_teraflow_1.yaml similarity index 80% rename from src/tests/ofc22/expose_services.yaml rename to src/tests/oeccpsc22/expose_services_teraflow_1.yaml index d514383615e7b9dca20f22dbb6ef3438457953cc..d956db1a781147467efd1c4724e0734b579d8f5d 100644 --- a/src/tests/ofc22/expose_services.yaml +++ b/src/tests/oeccpsc22/expose_services_teraflow_1.yaml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,6 +12,17 @@ # See the License for the specific language governing permissions and # limitations under the License. +apiVersion: v1 +kind: Service +metadata: + name: remote-teraflow +spec: + type: ExternalName + externalName: interdomainservice.oeccpsc22-2.svc.cluster.local + ports: + - name: grpc + protocol: TCP + port: 10010 --- apiVersion: v1 kind: Service @@ -28,17 +39,17 @@ spec: protocol: TCP port: 1010 targetPort: 1010 - nodePort: 30101 + nodePort: 30111 + - name: rest + protocol: TCP + port: 8080 + targetPort: 8080 + nodePort: 30001 - name: redis protocol: TCP port: 6379 targetPort: 6379 - nodePort: 30637 - - name: http - protocol: TCP - port: 8080 - targetPort: 8080 - nodePort: 31808 + nodePort: 30631 --- apiVersion: v1 kind: Service @@ -55,24 +66,7 @@ spec: protocol: TCP port: 2020 targetPort: 2020 - nodePort: 30202 ---- -apiVersion: v1 -kind: Service -metadata: - name: monitoringservice-public - labels: - app: monitoringservice -spec: - type: NodePort - selector: - app: monitoringservice - ports: - - name: influx - protocol: TCP - port: 8086 - targetPort: 8086 - nodePort: 30886 + nodePort: 30221 --- apiVersion: v1 kind: Service @@ -87,7 +81,7 @@ spec: protocol: TCP port: 8080 targetPort: 8080 - nodePort: 30808 + nodePort: 30881 --- apiVersion: v1 kind: Service @@ -104,9 +98,9 @@ spec: protocol: TCP port: 8004 targetPort: 8004 - nodePort: 30800 + nodePort: 30801 - name: grafana protocol: TCP port: 3000 targetPort: 3000 - nodePort: 30300 + nodePort: 30301 diff --git a/src/tests/oeccpsc22/expose_services_teraflow_2.yaml b/src/tests/oeccpsc22/expose_services_teraflow_2.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d8acb96533f8886afc0fd5c802d3616277676e33 --- /dev/null +++ b/src/tests/oeccpsc22/expose_services_teraflow_2.yaml @@ -0,0 +1,106 @@ +# 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: + name: remote-teraflow +spec: + type: ExternalName + externalName: interdomainservice.oeccpsc22-1.svc.cluster.local + ports: + - name: grpc + protocol: TCP + port: 10010 +--- +apiVersion: v1 +kind: Service +metadata: + name: contextservice-public + labels: + app: contextservice +spec: + type: NodePort + selector: + app: contextservice + ports: + - name: grpc + protocol: TCP + port: 1010 + targetPort: 1010 + nodePort: 30112 + - name: rest + protocol: TCP + port: 8080 + targetPort: 8080 + nodePort: 30002 + - name: redis + protocol: TCP + port: 6379 + targetPort: 6379 + nodePort: 30632 +--- +apiVersion: v1 +kind: Service +metadata: + name: deviceservice-public + labels: + app: deviceservice +spec: + type: NodePort + selector: + app: deviceservice + ports: + - name: grpc + protocol: TCP + port: 2020 + targetPort: 2020 + nodePort: 30222 +--- +apiVersion: v1 +kind: Service +metadata: + name: computeservice-public +spec: + type: NodePort + selector: + app: computeservice + ports: + - name: http + protocol: TCP + port: 8080 + targetPort: 8080 + nodePort: 30882 +--- +apiVersion: v1 +kind: Service +metadata: + name: webuiservice-public + labels: + app: webuiservice +spec: + type: NodePort + selector: + app: webuiservice + ports: + - name: http + protocol: TCP + port: 8004 + targetPort: 8004 + nodePort: 30802 + - name: grafana + protocol: TCP + port: 3000 + targetPort: 3000 + nodePort: 30302 diff --git a/src/tests/oeccpsc22/run_test_01_bootstrap.sh b/src/tests/oeccpsc22/run_test_01_bootstrap.sh new file mode 100755 index 0000000000000000000000000000000000000000..23a569d4de537c8a0279930ba83186b59770050e --- /dev/null +++ b/src/tests/oeccpsc22/run_test_01_bootstrap.sh @@ -0,0 +1,60 @@ +#!/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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc +COVERAGEFILE=$PROJECTDIR/coverage/.coverage + +# Configure the correct folder on the .coveragerc file +cat $PROJECTDIR/coverage/.coveragerc.template | sed s+~/teraflow/controller+$PROJECTDIR+g > $RCFILE + +# Destroy old coverage file +rm -f $COVERAGEFILE + +# Set the name of the Kubernetes namespace and hostname to use. +K8S_NAMESPACE_D1="oeccpsc22-1" +K8S_NAMESPACE_D2="oeccpsc22-2" +# K8S_HOSTNAME="kubernetes-master" +# dynamically gets the name of the K8s master node +K8S_HOSTNAME=`kubectl get nodes --selector=node-role.kubernetes.io/master | tr -s " " | cut -f1 -d" " | sed -n '2 p'` + +# Flush Context database +kubectl --namespace $K8S_NAMESPACE_D1 exec -it deployment/contextservice --container redis -- redis-cli FLUSHALL +kubectl --namespace $K8S_NAMESPACE_D2 exec -it deployment/contextservice --container redis -- redis-cli FLUSHALL + +export D1_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D1_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D1_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +export D2_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D2_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D2_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +# Useful flags for pytest: +#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG + +# Run functional test and analyze coverage of code at same time + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + tests/oeccpsc22/tests/test_functional_bootstrap.py diff --git a/src/tests/oeccpsc22/run_test_02_create_interdomain_slice.sh b/src/tests/oeccpsc22/run_test_02_create_interdomain_slice.sh new file mode 100755 index 0000000000000000000000000000000000000000..e438a2915f4924a41b765f2f449e3704727653b7 --- /dev/null +++ b/src/tests/oeccpsc22/run_test_02_create_interdomain_slice.sh @@ -0,0 +1,49 @@ +#!/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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc +COVERAGEFILE=$PROJECTDIR/coverage/.coverage + +# Set the name of the Kubernetes namespace and hostname to use. +K8S_NAMESPACE_D1="oeccpsc22-1" +K8S_NAMESPACE_D2="oeccpsc22-2" +# dynamically gets the name of the K8s master node +K8S_HOSTNAME=`kubectl get nodes --selector=node-role.kubernetes.io/master | tr -s " " | cut -f1 -d" " | sed -n '2 p'` + +export D1_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D1_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D1_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +export D2_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D2_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D2_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +# Useful flags for pytest: +#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG + +# Run functional test and analyze coverage of code at same time + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + tests/oeccpsc22/tests/test_functional_create_interdomain_slice.py diff --git a/src/tests/oeccpsc22/run_test_03_delete_interdomain_slice.sh b/src/tests/oeccpsc22/run_test_03_delete_interdomain_slice.sh new file mode 100755 index 0000000000000000000000000000000000000000..6816ac815fc65f5863608f7303c3d356d12fb52c --- /dev/null +++ b/src/tests/oeccpsc22/run_test_03_delete_interdomain_slice.sh @@ -0,0 +1,49 @@ +#!/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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc +COVERAGEFILE=$PROJECTDIR/coverage/.coverage + +# Set the name of the Kubernetes namespace and hostname to use. +K8S_NAMESPACE_D1="oeccpsc22-1" +K8S_NAMESPACE_D2="oeccpsc22-2" +# dynamically gets the name of the K8s master node +K8S_HOSTNAME=`kubectl get nodes --selector=node-role.kubernetes.io/master | tr -s " " | cut -f1 -d" " | sed -n '2 p'` + +export D1_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D1_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D1_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +export D2_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D2_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D2_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +# Useful flags for pytest: +#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG + +# Run functional test and analyze coverage of code at same time + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + tests/oeccpsc22/tests/test_functional_delete_interdomain_slice.py diff --git a/src/tests/oeccpsc22/run_test_04_cleanup.sh b/src/tests/oeccpsc22/run_test_04_cleanup.sh new file mode 100755 index 0000000000000000000000000000000000000000..763c5b67eb00f2c4220b286c37c566b96bf3e386 --- /dev/null +++ b/src/tests/oeccpsc22/run_test_04_cleanup.sh @@ -0,0 +1,49 @@ +#!/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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc +COVERAGEFILE=$PROJECTDIR/coverage/.coverage + +# Set the name of the Kubernetes namespace and hostname to use. +K8S_NAMESPACE_D1="oeccpsc22-1" +K8S_NAMESPACE_D2="oeccpsc22-2" +# dynamically gets the name of the K8s master node +K8S_HOSTNAME=`kubectl get nodes --selector=node-role.kubernetes.io/master | tr -s " " | cut -f1 -d" " | sed -n '2 p'` + +export D1_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D1_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D1_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D1_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D1 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +export D2_CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') +export D2_DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') +export D2_COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') +export D2_COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE_D2 -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') + +# Useful flags for pytest: +#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG + +# Run functional test and analyze coverage of code at same time + +coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ + tests/oeccpsc22/tests/test_functional_cleanup.py diff --git a/src/tests/oeccpsc22/show_deploy.sh b/src/tests/oeccpsc22/show_deploy.sh new file mode 100755 index 0000000000000000000000000000000000000000..d5e9346e51cb5bf6ffa442c0b3f9356176efff5c --- /dev/null +++ b/src/tests/oeccpsc22/show_deploy.sh @@ -0,0 +1,26 @@ +#!/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. + +# Deploy TeraFlow instance 1 +printf "TeraFlow Instance 1:\n--------------------\n" +export K8S_NAMESPACE="oeccpsc22-1" +kubectl --namespace $K8S_NAMESPACE get all + +printf "\n\n" + +# Deploy TeraFlow instance 2 +printf "TeraFlow Instance 2:\n--------------------\n" +export K8S_NAMESPACE="oeccpsc22-2" +kubectl --namespace $K8S_NAMESPACE get all diff --git a/src/tests/oeccpsc22/tests/.gitignore b/src/tests/oeccpsc22/tests/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..76cb708d1b532c9b69166e55f36bcb912fd5e370 --- /dev/null +++ b/src/tests/oeccpsc22/tests/.gitignore @@ -0,0 +1,2 @@ +# Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. +Credentials.py diff --git a/src/tests/oeccpsc22/tests/Objects_Domain_1.py b/src/tests/oeccpsc22/tests/Objects_Domain_1.py new file mode 100644 index 0000000000000000000000000000000000000000..2f35aa76eea8f7adfc89011cbc4822daecbd1d14 --- /dev/null +++ b/src/tests/oeccpsc22/tests/Objects_Domain_1.py @@ -0,0 +1,133 @@ +# 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 common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Device import ( + json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, json_device_id) +from common.tools.object_factory.Link import json_link, json_link_id +from common.tools.object_factory.Topology import json_topology, json_topology_id +from .Tools import get_link_uuid, json_endpoint_ids + +# ----- Context -------------------------------------------------------------------------------------------------------- +D1_CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) +D1_CONTEXT = json_context(DEFAULT_CONTEXT_NAME) + +# ----- Topology ------------------------------------------------------------------------------------------------------- +D1_TOPOLOGY_ID = json_topology_id(DEFAULT_TOPOLOGY_NAME, context_id=D1_CONTEXT_ID) +D1_TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_NAME, context_id=D1_CONTEXT_ID) + +# ----- Devices -------------------------------------------------------------------------------------------------------- +# Assume all devices have the same architecture of endpoints +D1_DEVICE_ENDPOINT_DEFS = [ + # Trunk ports + ('1/1', '25Gbps', []), ('1/2', '25Gbps', []), ('1/3', '25Gbps', []), ('1/4', '25Gbps', []), + # Inter-domain ports + ('2/1', '100Gbps', []), ('2/2', '100Gbps', []), + # Access ports + ('3/1', '10Gbps', []), ('3/2', '10Gbps', []), ('3/3', '10Gbps', []), ('3/4', '10Gbps', []), + ('3/5', '10Gbps', []), ('3/6', '10Gbps', []), ('3/7', '10Gbps', []), ('3/8', '10Gbps', []), +] + +D1_DEVICE_D1R1_UUID = 'R1@D1' +D1_DEVICE_D1R1_ID = json_device_id(D1_DEVICE_D1R1_UUID) +D1_DEVICE_D1R1 = json_device_emulated_packet_router_disabled(D1_DEVICE_D1R1_UUID) +D1_DEVICE_D1R1_CONNECT_RULES = json_device_emulated_connect_rules(D1_DEVICE_ENDPOINT_DEFS) + +D1_DEVICE_D1R2_UUID = 'R2@D1' +D1_DEVICE_D1R2_ID = json_device_id(D1_DEVICE_D1R2_UUID) +D1_DEVICE_D1R2 = json_device_emulated_packet_router_disabled(D1_DEVICE_D1R2_UUID) +D1_DEVICE_D1R2_CONNECT_RULES = json_device_emulated_connect_rules(D1_DEVICE_ENDPOINT_DEFS) + +D1_DEVICE_D1R3_UUID = 'R3@D1' +D1_DEVICE_D1R3_ID = json_device_id(D1_DEVICE_D1R3_UUID) +D1_DEVICE_D1R3 = json_device_emulated_packet_router_disabled(D1_DEVICE_D1R3_UUID) +D1_DEVICE_D1R3_CONNECT_RULES = json_device_emulated_connect_rules(D1_DEVICE_ENDPOINT_DEFS) + +D1_DEVICE_D1R4_UUID = 'R4@D1' +D1_DEVICE_D1R4_ID = json_device_id(D1_DEVICE_D1R4_UUID) +D1_DEVICE_D1R4 = json_device_emulated_packet_router_disabled(D1_DEVICE_D1R4_UUID) +D1_DEVICE_D1R4_CONNECT_RULES = json_device_emulated_connect_rules(D1_DEVICE_ENDPOINT_DEFS) + +# Virtual devices on remote domains +D1_DEVICE_D2R1_UUID = 'R1@D2' +D1_DEVICE_D2R1_ID = json_device_id(D1_DEVICE_D2R1_UUID) +D1_DEVICE_D2R1 = json_device_emulated_packet_router_disabled(D1_DEVICE_D2R1_UUID) +D1_DEVICE_D2R1_CONNECT_RULES = json_device_emulated_connect_rules(D1_DEVICE_ENDPOINT_DEFS) + +D1_DEVICE_D2R4_UUID = 'R4@D2' +D1_DEVICE_D2R4_ID = json_device_id(D1_DEVICE_D2R4_UUID) +D1_DEVICE_D2R4 = json_device_emulated_packet_router_disabled(D1_DEVICE_D2R4_UUID) +D1_DEVICE_D2R4_CONNECT_RULES = json_device_emulated_connect_rules(D1_DEVICE_ENDPOINT_DEFS) + +D1_ENDPOINT_IDS = {} +D1_ENDPOINT_IDS.update(json_endpoint_ids(D1_DEVICE_D1R1_ID, D1_DEVICE_ENDPOINT_DEFS)) +D1_ENDPOINT_IDS.update(json_endpoint_ids(D1_DEVICE_D1R2_ID, D1_DEVICE_ENDPOINT_DEFS)) +D1_ENDPOINT_IDS.update(json_endpoint_ids(D1_DEVICE_D1R3_ID, D1_DEVICE_ENDPOINT_DEFS)) +D1_ENDPOINT_IDS.update(json_endpoint_ids(D1_DEVICE_D1R4_ID, D1_DEVICE_ENDPOINT_DEFS)) +D1_ENDPOINT_IDS.update(json_endpoint_ids(D1_DEVICE_D2R1_ID, D1_DEVICE_ENDPOINT_DEFS)) +D1_ENDPOINT_IDS.update(json_endpoint_ids(D1_DEVICE_D2R4_ID, D1_DEVICE_ENDPOINT_DEFS)) + + +# ----- Links ---------------------------------------------------------------------------------------------------------- +# Intra-domain links +D1_LINK_D1R1_D1R2_UUID = get_link_uuid( + D1_ENDPOINT_IDS[D1_DEVICE_D1R1_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R2_UUID]['1/1']) +D1_LINK_D1R1_D1R2_ID = json_link_id(D1_LINK_D1R1_D1R2_UUID) +D1_LINK_D1R1_D1R2 = json_link(D1_LINK_D1R1_D1R2_UUID, [ + D1_ENDPOINT_IDS[D1_DEVICE_D1R1_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R2_UUID]['1/1']]) + +D1_LINK_D1R2_D1R3_UUID = get_link_uuid( + D1_ENDPOINT_IDS[D1_DEVICE_D1R2_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R3_UUID]['1/1']) +D1_LINK_D1R2_D1R3_ID = json_link_id(D1_LINK_D1R2_D1R3_UUID) +D1_LINK_D1R2_D1R3 = json_link(D1_LINK_D1R2_D1R3_UUID, [ + D1_ENDPOINT_IDS[D1_DEVICE_D1R2_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R3_UUID]['1/1']]) + +D1_LINK_D1R3_D1R4_UUID = get_link_uuid( + D1_ENDPOINT_IDS[D1_DEVICE_D1R3_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R4_UUID]['1/1']) +D1_LINK_D1R3_D1R4_ID = json_link_id(D1_LINK_D1R3_D1R4_UUID) +D1_LINK_D1R3_D1R4 = json_link(D1_LINK_D1R3_D1R4_UUID, [ + D1_ENDPOINT_IDS[D1_DEVICE_D1R3_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R4_UUID]['1/1']]) + +D1_LINK_D1R4_D1R1_UUID = get_link_uuid( + D1_ENDPOINT_IDS[D1_DEVICE_D1R4_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R1_UUID]['1/1']) +D1_LINK_D1R4_D1R1_ID = json_link_id(D1_LINK_D1R4_D1R1_UUID) +D1_LINK_D1R4_D1R1 = json_link(D1_LINK_D1R4_D1R1_UUID, [ + D1_ENDPOINT_IDS[D1_DEVICE_D1R4_UUID]['1/2'], D1_ENDPOINT_IDS[D1_DEVICE_D1R1_UUID]['1/1']]) + +# Inter-domain links +D1_LINK_D1R4_D2R1_UUID = get_link_uuid( + D1_ENDPOINT_IDS[D1_DEVICE_D1R4_UUID]['2/1'], D1_ENDPOINT_IDS[D1_DEVICE_D2R1_UUID]['2/1']) +D1_LINK_D1R4_D2R1_ID = json_link_id(D1_LINK_D1R4_D2R1_UUID) +D1_LINK_D1R4_D2R1 = json_link(D1_LINK_D1R4_D2R1_UUID, [ + D1_ENDPOINT_IDS[D1_DEVICE_D1R4_UUID]['2/1'], D1_ENDPOINT_IDS[D1_DEVICE_D2R1_UUID]['2/1']]) + +# ----- Object Collections --------------------------------------------------------------------------------------------- + +D1_CONTEXTS = [D1_CONTEXT] +D1_TOPOLOGIES = [D1_TOPOLOGY] + +D1_DEVICES = [ + (D1_DEVICE_D1R1, D1_DEVICE_D1R1_CONNECT_RULES), + (D1_DEVICE_D1R2, D1_DEVICE_D1R2_CONNECT_RULES), + (D1_DEVICE_D1R3, D1_DEVICE_D1R3_CONNECT_RULES), + (D1_DEVICE_D1R4, D1_DEVICE_D1R4_CONNECT_RULES), + (D1_DEVICE_D2R1, D1_DEVICE_D2R1_CONNECT_RULES), + (D1_DEVICE_D2R4, D1_DEVICE_D2R4_CONNECT_RULES), +] + +D1_LINKS = [ + D1_LINK_D1R1_D1R2, D1_LINK_D1R2_D1R3, D1_LINK_D1R3_D1R4, D1_LINK_D1R4_D1R1, + D1_LINK_D1R4_D2R1, +] diff --git a/src/tests/oeccpsc22/tests/Objects_Domain_2.py b/src/tests/oeccpsc22/tests/Objects_Domain_2.py new file mode 100644 index 0000000000000000000000000000000000000000..0e5065c3b6ec3e1d44a16f0ee8231aca28e2c2d1 --- /dev/null +++ b/src/tests/oeccpsc22/tests/Objects_Domain_2.py @@ -0,0 +1,133 @@ +# 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 common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Device import ( + json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, json_device_id) +from common.tools.object_factory.Link import json_link, json_link_id +from common.tools.object_factory.Topology import json_topology, json_topology_id +from .Tools import get_link_uuid, json_endpoint_ids + +# ----- Context -------------------------------------------------------------------------------------------------------- +D2_CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) +D2_CONTEXT = json_context(DEFAULT_CONTEXT_NAME) + +# ----- Topology ------------------------------------------------------------------------------------------------------- +D2_TOPOLOGY_ID = json_topology_id(DEFAULT_TOPOLOGY_NAME, context_id=D2_CONTEXT_ID) +D2_TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_NAME, context_id=D2_CONTEXT_ID) + +# ----- Devices -------------------------------------------------------------------------------------------------------- +# Assume all devices have the same architecture of endpoints +D2_DEVICE_ENDPOINT_DEFS = [ + # Trunk ports + ('1/1', '25Gbps', []), ('1/2', '25Gbps', []), ('1/3', '25Gbps', []), ('1/4', '25Gbps', []), + # Inter-domain ports + ('2/1', '100Gbps', []), ('2/2', '100Gbps', []), + # Access ports + ('3/1', '10Gbps', []), ('3/2', '10Gbps', []), ('3/3', '10Gbps', []), ('3/4', '10Gbps', []), + ('3/5', '10Gbps', []), ('3/6', '10Gbps', []), ('3/7', '10Gbps', []), ('3/8', '10Gbps', []), +] + +D2_DEVICE_D2R1_UUID = 'R1@D2' +D2_DEVICE_D2R1_ID = json_device_id(D2_DEVICE_D2R1_UUID) +D2_DEVICE_D2R1 = json_device_emulated_packet_router_disabled(D2_DEVICE_D2R1_UUID) +D2_DEVICE_D2R1_CONNECT_RULES = json_device_emulated_connect_rules(D2_DEVICE_ENDPOINT_DEFS) + +D2_DEVICE_D2R2_UUID = 'R2@D2' +D2_DEVICE_D2R2_ID = json_device_id(D2_DEVICE_D2R2_UUID) +D2_DEVICE_D2R2 = json_device_emulated_packet_router_disabled(D2_DEVICE_D2R2_UUID) +D2_DEVICE_D2R2_CONNECT_RULES = json_device_emulated_connect_rules(D2_DEVICE_ENDPOINT_DEFS) + +D2_DEVICE_D2R3_UUID = 'R3@D2' +D2_DEVICE_D2R3_ID = json_device_id(D2_DEVICE_D2R3_UUID) +D2_DEVICE_D2R3 = json_device_emulated_packet_router_disabled(D2_DEVICE_D2R3_UUID) +D2_DEVICE_D2R3_CONNECT_RULES = json_device_emulated_connect_rules(D2_DEVICE_ENDPOINT_DEFS) + +D2_DEVICE_D2R4_UUID = 'R4@D2' +D2_DEVICE_D2R4_ID = json_device_id(D2_DEVICE_D2R4_UUID) +D2_DEVICE_D2R4 = json_device_emulated_packet_router_disabled(D2_DEVICE_D2R4_UUID) +D2_DEVICE_D2R4_CONNECT_RULES = json_device_emulated_connect_rules(D2_DEVICE_ENDPOINT_DEFS) + +# Virtual devices on remote domains +D2_DEVICE_D1R1_UUID = 'R1@D1' +D2_DEVICE_D1R1_ID = json_device_id(D2_DEVICE_D1R1_UUID) +D2_DEVICE_D1R1 = json_device_emulated_packet_router_disabled(D2_DEVICE_D1R1_UUID) +D2_DEVICE_D1R1_CONNECT_RULES = json_device_emulated_connect_rules(D2_DEVICE_ENDPOINT_DEFS) + +D2_DEVICE_D1R4_UUID = 'R4@D1' +D2_DEVICE_D1R4_ID = json_device_id(D2_DEVICE_D1R4_UUID) +D2_DEVICE_D1R4 = json_device_emulated_packet_router_disabled(D2_DEVICE_D1R4_UUID) +D2_DEVICE_D1R4_CONNECT_RULES = json_device_emulated_connect_rules(D2_DEVICE_ENDPOINT_DEFS) + +D2_ENDPOINT_IDS = {} +D2_ENDPOINT_IDS.update(json_endpoint_ids(D2_DEVICE_D2R1_ID, D2_DEVICE_ENDPOINT_DEFS)) +D2_ENDPOINT_IDS.update(json_endpoint_ids(D2_DEVICE_D2R2_ID, D2_DEVICE_ENDPOINT_DEFS)) +D2_ENDPOINT_IDS.update(json_endpoint_ids(D2_DEVICE_D2R3_ID, D2_DEVICE_ENDPOINT_DEFS)) +D2_ENDPOINT_IDS.update(json_endpoint_ids(D2_DEVICE_D2R4_ID, D2_DEVICE_ENDPOINT_DEFS)) +D2_ENDPOINT_IDS.update(json_endpoint_ids(D2_DEVICE_D1R1_ID, D2_DEVICE_ENDPOINT_DEFS)) +D2_ENDPOINT_IDS.update(json_endpoint_ids(D2_DEVICE_D1R4_ID, D2_DEVICE_ENDPOINT_DEFS)) + + +# ----- Links ---------------------------------------------------------------------------------------------------------- +# Intra-domain links +D2_LINK_D2R1_D2R2_UUID = get_link_uuid( + D2_ENDPOINT_IDS[D2_DEVICE_D2R1_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R2_UUID]['1/1']) +D2_LINK_D2R1_D2R2_ID = json_link_id(D2_LINK_D2R1_D2R2_UUID) +D2_LINK_D2R1_D2R2 = json_link(D2_LINK_D2R1_D2R2_UUID, [ + D2_ENDPOINT_IDS[D2_DEVICE_D2R1_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R2_UUID]['1/1']]) + +D2_LINK_D2R2_D2R3_UUID = get_link_uuid( + D2_ENDPOINT_IDS[D2_DEVICE_D2R2_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R3_UUID]['1/1']) +D2_LINK_D2R2_D2R3_ID = json_link_id(D2_LINK_D2R2_D2R3_UUID) +D2_LINK_D2R2_D2R3 = json_link(D2_LINK_D2R2_D2R3_UUID, [ + D2_ENDPOINT_IDS[D2_DEVICE_D2R2_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R3_UUID]['1/1']]) + +D2_LINK_D2R3_D2R4_UUID = get_link_uuid( + D2_ENDPOINT_IDS[D2_DEVICE_D2R3_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['1/1']) +D2_LINK_D2R3_D2R4_ID = json_link_id(D2_LINK_D2R3_D2R4_UUID) +D2_LINK_D2R3_D2R4 = json_link(D2_LINK_D2R3_D2R4_UUID, [ + D2_ENDPOINT_IDS[D2_DEVICE_D2R3_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['1/1']]) + +D2_LINK_D2R4_D2R1_UUID = get_link_uuid( + D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R1_UUID]['1/1']) +D2_LINK_D2R4_D2R1_ID = json_link_id(D2_LINK_D2R4_D2R1_UUID) +D2_LINK_D2R4_D2R1 = json_link(D2_LINK_D2R4_D2R1_UUID, [ + D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['1/2'], D2_ENDPOINT_IDS[D2_DEVICE_D2R1_UUID]['1/1']]) + +# Inter-domain links +D2_LINK_D2R4_D1R1_UUID = get_link_uuid( + D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['2/1'], D2_ENDPOINT_IDS[D2_DEVICE_D1R1_UUID]['2/1']) +D2_LINK_D2R4_D1R1_ID = json_link_id(D2_LINK_D2R4_D1R1_UUID) +D2_LINK_D2R4_D1R1 = json_link(D2_LINK_D2R4_D1R1_UUID, [ + D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['2/1'], D2_ENDPOINT_IDS[D2_DEVICE_D1R1_UUID]['2/1']]) + +# ----- Object Collections --------------------------------------------------------------------------------------------- + +D2_CONTEXTS = [D2_CONTEXT] +D2_TOPOLOGIES = [D2_TOPOLOGY] + +D2_DEVICES = [ + (D2_DEVICE_D2R1, D2_DEVICE_D2R1_CONNECT_RULES), + (D2_DEVICE_D2R2, D2_DEVICE_D2R2_CONNECT_RULES), + (D2_DEVICE_D2R3, D2_DEVICE_D2R3_CONNECT_RULES), + (D2_DEVICE_D2R4, D2_DEVICE_D2R4_CONNECT_RULES), + (D2_DEVICE_D1R1, D2_DEVICE_D1R1_CONNECT_RULES), + (D2_DEVICE_D1R4, D2_DEVICE_D1R4_CONNECT_RULES), +] + +D2_LINKS = [ + D2_LINK_D2R1_D2R2, D2_LINK_D2R2_D2R3, D2_LINK_D2R3_D2R4, D2_LINK_D2R4_D2R1, + D2_LINK_D2R4_D1R1, +] diff --git a/src/tests/oeccpsc22/tests/Objects_Service.py b/src/tests/oeccpsc22/tests/Objects_Service.py new file mode 100644 index 0000000000000000000000000000000000000000..3cbe7725cf12e8b7535a048465646441269cec00 --- /dev/null +++ b/src/tests/oeccpsc22/tests/Objects_Service.py @@ -0,0 +1,51 @@ +# 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 .Objects_Domain_1 import D1_DEVICE_D1R1_UUID, D1_ENDPOINT_IDS +from .Objects_Domain_2 import D2_DEVICE_D2R4_UUID, D2_ENDPOINT_IDS +from .Tools import compose_bearer, compose_service_endpoint_id + +# ----- WIM Service Settings ------------------------------------------------------------------------------------------- +WIM_SEP_D1R1_ID = compose_service_endpoint_id(D1_ENDPOINT_IDS[D1_DEVICE_D1R1_UUID]['3/1']) +WIM_SEP_D1R1_ROUTER_ID = '10.10.10.1' +WIM_SEP_D1R1_ROUTER_DIST = '65000:111' +WIM_SEP_D1R1_SITE_ID = '1' +WIM_SEP_D1R1_BEARER = compose_bearer(D1_ENDPOINT_IDS[D1_DEVICE_D1R1_UUID]['3/1']) +WIM_SRV_D1R1_VLAN_ID = 400 + +WIM_SEP_D2R4_ID = compose_service_endpoint_id(D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['3/3']) +WIM_SEP_D2R4_ROUTER_ID = '20.20.20.1' +WIM_SEP_D2R4_ROUTER_DIST = '65000:222' +WIM_SEP_D2R4_SITE_ID = '2' +WIM_SEP_D2R4_BEARER = compose_bearer(D2_ENDPOINT_IDS[D2_DEVICE_D2R4_UUID]['3/3']) +WIM_SRV_D2R4_VLAN_ID = 500 + +WIM_USERNAME = 'admin' +WIM_PASSWORD = 'admin' + +WIM_MAPPING = [ + {'device-id': D1_DEVICE_D1R1_UUID, 'service_endpoint_id': WIM_SEP_D1R1_ID, + 'service_mapping_info': {'bearer': {'bearer-reference': WIM_SEP_D1R1_BEARER}, 'site-id': WIM_SEP_D1R1_SITE_ID}}, + {'device-id': D2_DEVICE_D2R4_UUID, 'service_endpoint_id': WIM_SEP_D2R4_ID, + 'service_mapping_info': {'bearer': {'bearer-reference': WIM_SEP_D2R4_BEARER}, 'site-id': WIM_SEP_D2R4_SITE_ID}}, +] +WIM_SERVICE_TYPE = 'ELAN' +WIM_SERVICE_CONNECTION_POINTS = [ + {'service_endpoint_id': WIM_SEP_D1R1_ID, + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': WIM_SRV_D1R1_VLAN_ID}}, + {'service_endpoint_id': WIM_SEP_D2R4_ID, + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': WIM_SRV_D2R4_VLAN_ID}}, +] diff --git a/src/tests/oeccpsc22/tests/Tools.py b/src/tests/oeccpsc22/tests/Tools.py new file mode 100644 index 0000000000000000000000000000000000000000..30333b6f47b31bda76626545b78aaa3c96bff7c0 --- /dev/null +++ b/src/tests/oeccpsc22/tests/Tools.py @@ -0,0 +1,39 @@ +# 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 typing import Dict, List, Tuple +from common.tools.object_factory.EndPoint import json_endpoint_id + +def json_endpoint_ids(device_id : Dict, endpoint_descriptors : List[Tuple[str, str, List[int]]]): + return { + device_id['device_uuid']['uuid']: { + ep_uuid: json_endpoint_id(device_id, ep_uuid, topology_id=None) + for ep_uuid, _, _ in endpoint_descriptors + } + } + +def get_link_uuid(a_endpoint_id : Dict, z_endpoint_id : Dict) -> str: + return '{:s}/{:s}=={:s}/{:s}'.format( + a_endpoint_id['device_id']['device_uuid']['uuid'], a_endpoint_id['endpoint_uuid']['uuid'], + z_endpoint_id['device_id']['device_uuid']['uuid'], z_endpoint_id['endpoint_uuid']['uuid']) + +def compose_service_endpoint_id(endpoint_id): + device_uuid = endpoint_id['device_id']['device_uuid']['uuid'] + endpoint_uuid = endpoint_id['endpoint_uuid']['uuid'] + return ':'.join([device_uuid, endpoint_uuid]) + +def compose_bearer(endpoint_id): + device_uuid = endpoint_id['device_id']['device_uuid']['uuid'] + endpoint_uuid = endpoint_id['endpoint_uuid']['uuid'] + return ':'.join([device_uuid, endpoint_uuid]) diff --git a/src/tests/oeccpsc22/tests/__init__.py b/src/tests/oeccpsc22/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/tests/oeccpsc22/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/tests/oeccpsc22/tests/test_functional_bootstrap.py b/src/tests/oeccpsc22/tests/test_functional_bootstrap.py new file mode 100644 index 0000000000000000000000000000000000000000..921b4a4e99389fae126bc91517981217fd7d0017 --- /dev/null +++ b/src/tests/oeccpsc22/tests/test_functional_bootstrap.py @@ -0,0 +1,213 @@ +# 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.Settings import get_setting +from context.client.ContextClient import ContextClient +from context.proto.context_pb2 import Context, ContextId, Device, Empty, Link, Topology +from device.client.DeviceClient import DeviceClient +from .Objects_Domain_1 import D1_CONTEXT_ID, D1_CONTEXTS, D1_DEVICES, D1_LINKS, D1_TOPOLOGIES +from .Objects_Domain_2 import D2_CONTEXT_ID, D2_CONTEXTS, D2_DEVICES, D2_LINKS, D2_TOPOLOGIES + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +@pytest.fixture(scope='session') +def d1_context_client(): + _client = ContextClient( + get_setting('D1_CONTEXTSERVICE_SERVICE_HOST'), get_setting('D1_CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + +@pytest.fixture(scope='session') +def d1_device_client(): + _client = DeviceClient( + get_setting('D1_DEVICESERVICE_SERVICE_HOST'), get_setting('D1_DEVICESERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + +@pytest.fixture(scope='session') +def d2_context_client(): + _client = ContextClient( + get_setting('D2_CONTEXTSERVICE_SERVICE_HOST'), get_setting('D2_CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + +@pytest.fixture(scope='session') +def d2_device_client(): + _client = DeviceClient( + get_setting('D2_DEVICESERVICE_SERVICE_HOST'), get_setting('D2_DEVICESERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +def test_scenario_empty( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == 0 + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 + + response = context_client.ListLinks(Empty()) + assert len(response.links) == 0 + + # ----- List entities - Ensure database is empty ------------------------------------------------------------------- + per_domain(d1_context_client) + per_domain(d2_context_client) + + +def test_prepare_scenario( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, context_client): + for context in contexts: + context_uuid = context['context_id']['context_uuid']['uuid'] + LOGGER.info('Adding Context {:s}'.format(context_uuid)) + response = context_client.SetContext(Context(**context)) + assert response.context_uuid.uuid == context_uuid + + for topology in topologies: + context_uuid = topology['topology_id']['context_id']['context_uuid']['uuid'] + topology_uuid = topology['topology_id']['topology_uuid']['uuid'] + LOGGER.info('Adding Topology {:s}/{:s}'.format(context_uuid, topology_uuid)) + response = context_client.SetTopology(Topology(**topology)) + assert response.context_id.context_uuid.uuid == context_uuid + assert response.topology_uuid.uuid == topology_uuid + + # ----- Create Contexts and Topologies ----------------------------------------------------------------------------- + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, d2_context_client) + + +def test_scenario_ready( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, context_id, context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(contexts) + + response = context_client.ListTopologies(ContextId(**context_id)) + assert len(response.topologies) == len(topologies) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 + + response = context_client.ListLinks(Empty()) + assert len(response.links) == 0 + + response = context_client.ListSlices(ContextId(**context_id)) + assert len(response.slices) == 0 + + response = context_client.ListServices(ContextId(**context_id)) + assert len(response.services) == 0 + + # ----- List entities - Ensure scenario is ready ------------------------------------------------------------------- + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, D1_CONTEXT_ID, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, D2_CONTEXT_ID, d2_context_client) + + +def test_devices_bootstraping( + d1_device_client : DeviceClient, # pylint: disable=redefined-outer-name + d2_device_client : DeviceClient): # pylint: disable=redefined-outer-name + + def per_domain(devices, device_client): + for device, connect_rules in devices: + device_uuid = device['device_id']['device_uuid']['uuid'] + LOGGER.info('Adding Device {:s}'.format(device_uuid)) + device_with_connect_rules = copy.deepcopy(device) + device_with_connect_rules['device_config']['config_rules'].extend(connect_rules) + response = device_client.AddDevice(Device(**device_with_connect_rules)) + assert response.device_uuid.uuid == device_uuid + + # ----- Create Devices and Validate Collected Events --------------------------------------------------------------- + per_domain(D1_DEVICES, d1_device_client) + per_domain(D2_DEVICES, d2_device_client) + + +def test_devices_bootstrapped( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, devices, context_id, context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(contexts) + + response = context_client.ListTopologies(ContextId(**context_id)) + assert len(response.topologies) == len(topologies) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(devices) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == 0 + + response = context_client.ListSlices(ContextId(**context_id)) + assert len(response.slices) == 0 + + response = context_client.ListServices(ContextId(**context_id)) + assert len(response.services) == 0 + + # ----- List entities - Ensure bevices are created ----------------------------------------------------------------- + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, D1_DEVICES, D1_CONTEXT_ID, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, D2_DEVICES, D2_CONTEXT_ID, d2_context_client) + + +def test_links_creation( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(links, context_client): + for link in links: + link_uuid = link['link_id']['link_uuid']['uuid'] + LOGGER.info('Adding Link {:s}'.format(link_uuid)) + response = context_client.SetLink(Link(**link)) + assert response.link_uuid.uuid == link_uuid + + # ----- Create Links and Validate Collected Events ----------------------------------------------------------------- + per_domain(D1_LINKS, d1_context_client) + per_domain(D2_LINKS, d2_context_client) + + +def test_links_created( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, devices, links, context_id, context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(contexts) + + response = context_client.ListTopologies(ContextId(**context_id)) + assert len(response.topologies) == len(topologies) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(devices) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(links) + + response = context_client.ListSlices(ContextId(**context_id)) + assert len(response.slices) == 0 + + response = context_client.ListServices(ContextId(**context_id)) + assert len(response.services) == 0 + + # ----- List entities - Ensure links are created ------------------------------------------------------------------- + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, D1_DEVICES, D1_LINKS, D1_CONTEXT_ID, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, D2_DEVICES, D2_LINKS, D2_CONTEXT_ID, d2_context_client) diff --git a/src/tests/oeccpsc22/tests/test_functional_cleanup.py b/src/tests/oeccpsc22/tests/test_functional_cleanup.py new file mode 100644 index 0000000000000000000000000000000000000000..7d2c37779c899ab25a8d9954ed94df572432d402 --- /dev/null +++ b/src/tests/oeccpsc22/tests/test_functional_cleanup.py @@ -0,0 +1,123 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging, pytest +from common.Settings import get_setting +from common.tests.EventTools import EVENT_REMOVE, 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.Link import json_link_id +from common.tools.object_factory.Topology import json_topology_id +from context.client.ContextClient import ContextClient +from context.client.EventsCollector import EventsCollector +from context.proto.context_pb2 import ContextId, DeviceId, Empty, LinkId, TopologyId +from device.client.DeviceClient import DeviceClient +from .Objects import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + + +@pytest.fixture(scope='session') +def context_client(): + _client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def device_client(): + _client = DeviceClient(get_setting('DEVICESERVICE_SERVICE_HOST'), get_setting('DEVICESERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +def test_services_removed(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure service is removed ------------------------------------------------------------------ + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(CONTEXTS) + + response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) + assert len(response.topologies) == len(TOPOLOGIES) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(DEVICES) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(LINKS) + + response = context_client.ListServices(ContextId(**CONTEXT_ID)) + assert len(response.services) == 0 + + +def test_scenario_cleanup( + context_client : ContextClient, device_client : DeviceClient): # pylint: disable=redefined-outer-name + + # ----- Start the EventsCollector ---------------------------------------------------------------------------------- + events_collector = EventsCollector(context_client) + events_collector.start() + + expected_events = [] + + # ----- Delete Links and Validate Collected Events ----------------------------------------------------------------- + for link in LINKS: + link_id = link['link_id'] + link_uuid = link_id['link_uuid']['uuid'] + LOGGER.info('Deleting Link {:s}'.format(link_uuid)) + context_client.RemoveLink(LinkId(**link_id)) + expected_events.append(('LinkEvent', EVENT_REMOVE, json_link_id(link_uuid))) + + # ----- Delete Devices and Validate Collected Events --------------------------------------------------------------- + for device, _ in DEVICES: + device_id = device['device_id'] + device_uuid = device_id['device_uuid']['uuid'] + LOGGER.info('Deleting Device {:s}'.format(device_uuid)) + device_client.DeleteDevice(DeviceId(**device_id)) + expected_events.append(('DeviceEvent', EVENT_REMOVE, json_device_id(device_uuid))) + + # ----- Delete Topologies and Validate Collected Events ------------------------------------------------------------ + for topology in TOPOLOGIES: + topology_id = topology['topology_id'] + context_uuid = topology_id['context_id']['context_uuid']['uuid'] + topology_uuid = topology_id['topology_uuid']['uuid'] + LOGGER.info('Deleting Topology {:s}/{:s}'.format(context_uuid, topology_uuid)) + context_client.RemoveTopology(TopologyId(**topology_id)) + context_id = json_context_id(context_uuid) + expected_events.append(('TopologyEvent', EVENT_REMOVE, json_topology_id(topology_uuid, context_id=context_id))) + + # ----- Delete Contexts and Validate Collected Events -------------------------------------------------------------- + for context in CONTEXTS: + context_id = context['context_id'] + context_uuid = context_id['context_uuid']['uuid'] + LOGGER.info('Deleting Context {:s}'.format(context_uuid)) + context_client.RemoveContext(ContextId(**context_id)) + expected_events.append(('ContextEvent', EVENT_REMOVE, json_context_id(context_uuid))) + + # ----- Validate Collected Events ---------------------------------------------------------------------------------- + check_events(events_collector, expected_events) + + # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- + events_collector.stop() + + +def test_scenario_empty_again(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure database is empty again ------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == 0 + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 + + response = context_client.ListLinks(Empty()) + assert len(response.links) == 0 diff --git a/src/tests/oeccpsc22/tests/test_functional_create_interdomain_slice.py b/src/tests/oeccpsc22/tests/test_functional_create_interdomain_slice.py new file mode 100644 index 0000000000000000000000000000000000000000..8c568cc78480bdae7ffd7b96eab839ae00c29432 --- /dev/null +++ b/src/tests/oeccpsc22/tests/test_functional_create_interdomain_slice.py @@ -0,0 +1,129 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging, pytest +from common.DeviceTypes import DeviceTypeEnum +from common.Settings import get_setting +from common.tools.grpc.Tools import grpc_message_to_json_string +from compute.tests.mock_osm.MockOSM import MockOSM +from context.client.ContextClient import ContextClient +from context.proto.context_pb2 import ContextId, Empty +from .Objects_Domain_1 import D1_CONTEXT_ID, D1_CONTEXTS, D1_DEVICES, D1_LINKS, D1_TOPOLOGIES +from .Objects_Domain_2 import D2_CONTEXT_ID, D2_CONTEXTS, D2_DEVICES, D2_LINKS, D2_TOPOLOGIES +from .Objects_Service import WIM_MAPPING, WIM_PASSWORD, WIM_SERVICE_CONNECTION_POINTS, WIM_SERVICE_TYPE, WIM_USERNAME + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DEVTYPE_EMU_PR = DeviceTypeEnum.EMULATED_PACKET_ROUTER.value +DEVTYPE_EMU_OLS = DeviceTypeEnum.EMULATED_OPEN_LINE_SYSTEM.value + + +@pytest.fixture(scope='session') +def d1_context_client(): + _client = ContextClient( + get_setting('D1_CONTEXTSERVICE_SERVICE_HOST'), get_setting('D1_CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def d2_context_client(): + _client = ContextClient( + get_setting('D2_CONTEXTSERVICE_SERVICE_HOST'), get_setting('D2_CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def d1_osm_wim(): + wim_url = 'http://{:s}:{:s}'.format( + get_setting('D1_COMPUTESERVICE_SERVICE_HOST'), str(get_setting('D1_COMPUTESERVICE_SERVICE_PORT_HTTP'))) + return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) + + +def test_scenario_is_correct( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, devices, links, context_id, context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(contexts) + + response = context_client.ListTopologies(ContextId(**context_id)) + assert len(response.topologies) == len(topologies) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(devices) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(links) + + response = context_client.ListSlices(ContextId(**context_id)) + assert len(response.slices) == 0 + + response = context_client.ListServices(ContextId(**context_id)) + assert len(response.services) == 0 + + # ----- List entities - Ensure scenario is up ---------------------------------------------------------------------- + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, D1_DEVICES, D1_LINKS, D1_CONTEXT_ID, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, D2_DEVICES, D2_LINKS, D2_CONTEXT_ID, d2_context_client) + + +def test_interdomain_slice_creation( + d1_osm_wim : MockOSM): # pylint: disable=redefined-outer-name + + # ----- Create Inter-domain Slice ---------------------------------------------------------------------------------- + service_uuid = d1_osm_wim.create_connectivity_service(WIM_SERVICE_TYPE, WIM_SERVICE_CONNECTION_POINTS) + d1_osm_wim.get_connectivity_service_status(service_uuid) + + +def test_scenario_interdomain_slice_created( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, devices, links, context_id, context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(contexts) + + response = context_client.ListTopologies(ContextId(**context_id)) + assert len(response.topologies) == len(topologies) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(devices) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(links) + + # TODO: implement validation of number of slices according to the domain they belong + #response = context_client.ListSlices(ContextId(**context_id)) + #LOGGER.info('Slices[{:d}] = {:s}'.format(len(response.slices), grpc_message_to_json_string(response))) + #assert len(response.slices) == (2 if D1 else 1) + # TODO: implement validation that slices are correct + + response = context_client.ListServices(ContextId(**context_id)) + LOGGER.info('Services[{:d}] = {:s}'.format(len(response.services), grpc_message_to_json_string(response))) + assert len(response.services) == 1 # L3NM + # TODO: improve validation of services created + for service in response.services: + service_id = service.service_id + response = context_client.ListConnections(service_id) + LOGGER.info(' ServiceId[{:s}] => Connections[{:d}] = {:s}'.format( + grpc_message_to_json_string(service_id), len(response.connections), + grpc_message_to_json_string(response))) + assert len(response.connections) == 1 # one connection per service + + # ----- List entities - Ensure service is created ------------------------------------------------------------------ + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, D1_DEVICES, D1_LINKS, D1_CONTEXT_ID, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, D2_DEVICES, D2_LINKS, D2_CONTEXT_ID, d2_context_client) diff --git a/src/tests/oeccpsc22/tests/test_functional_delete_interdomain_slice.py b/src/tests/oeccpsc22/tests/test_functional_delete_interdomain_slice.py new file mode 100644 index 0000000000000000000000000000000000000000..929267f78bd6a230cb919ed97fdc4277996b7e61 --- /dev/null +++ b/src/tests/oeccpsc22/tests/test_functional_delete_interdomain_slice.py @@ -0,0 +1,144 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging, pytest +from common.DeviceTypes import DeviceTypeEnum +from common.Settings import get_setting +from common.tools.grpc.Tools import grpc_message_to_json_string +from compute.tests.mock_osm.MockOSM import MockOSM +from context.client.ContextClient import ContextClient +from context.proto.context_pb2 import ContextId, Empty +from .Objects_Domain_1 import D1_CONTEXT_ID, D1_CONTEXTS, D1_DEVICES, D1_LINKS, D1_TOPOLOGIES +from .Objects_Domain_2 import D2_CONTEXT_ID, D2_CONTEXTS, D2_DEVICES, D2_LINKS, D2_TOPOLOGIES +from .Objects_Service import WIM_MAPPING, WIM_PASSWORD, WIM_USERNAME + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DEVTYPE_EMU_PR = DeviceTypeEnum.EMULATED_PACKET_ROUTER.value +DEVTYPE_EMU_OLS = DeviceTypeEnum.EMULATED_OPEN_LINE_SYSTEM.value + + +@pytest.fixture(scope='session') +def d1_context_client(): + _client = ContextClient( + get_setting('D1_CONTEXTSERVICE_SERVICE_HOST'), get_setting('D1_CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def d2_context_client(): + _client = ContextClient( + get_setting('D2_CONTEXTSERVICE_SERVICE_HOST'), get_setting('D2_CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def d1_osm_wim(): + wim_url = 'http://{:s}:{:s}'.format( + get_setting('D1_COMPUTESERVICE_SERVICE_HOST'), str(get_setting('D1_COMPUTESERVICE_SERVICE_PORT_HTTP'))) + return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) + + +def test_interdomain_slice_created( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, devices, links, context_id, context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(contexts) + + response = context_client.ListTopologies(ContextId(**context_id)) + assert len(response.topologies) == len(topologies) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(devices) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(links) + + # TODO: implement validation of number of slices according to the domain they belong + #response = context_client.ListSlices(ContextId(**context_id)) + #LOGGER.info('Slices[{:d}] = {:s}'.format(len(response.slices), grpc_message_to_json_string(response))) + #assert len(response.slices) == (2 if D1 else 1) + # TODO: implement validation that slices are correct + + response = context_client.ListServices(ContextId(**context_id)) + LOGGER.info('Services[{:d}] = {:s}'.format(len(response.services), grpc_message_to_json_string(response))) + assert len(response.services) == 1 # L3NM + # TODO: improve validation of services created + for service in response.services: + service_id = service.service_id + response = context_client.ListConnections(service_id) + LOGGER.info(' ServiceId[{:s}] => Connections[{:d}] = {:s}'.format( + grpc_message_to_json_string(service_id), len(response.connections), + grpc_message_to_json_string(response))) + assert len(response.connections) == 1 # one connection per service + + # ----- List entities - Ensure Inter-domain slice is created ------------------------------------------------------- + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, D1_DEVICES, D1_LINKS, D1_CONTEXT_ID, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, D2_DEVICES, D2_LINKS, D2_CONTEXT_ID, d2_context_client) + + +def test_interdomain_slice_removal( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d1_osm_wim : MockOSM): # pylint: disable=redefined-outer-name + + # ----- Remove Inter-domain Slice ---------------------------------------------------------------------------------- + # TODO: implement retrieval of inter-domain slice to be deleted + #response = d1_context_client.ListSliceIds(ContextId(**D1_CONTEXT_ID)) + #LOGGER.info('SliceIds[{:d}] = {:s}'.format(len(response.slice_ids), grpc_message_to_json_string(response))) + #assert len(response.service_ids) == 2 # L3NM + TAPI + #service_uuids = set() + #for service_id in response.service_ids: + # service_uuid = service_id.service_uuid.uuid + # if service_uuid.endswith(':optical'): continue + # service_uuids.add(service_uuid) + # osm_wim.conn_info[service_uuid] = {} + + # TODO: implement removal of service + #assert len(service_uuids) == 1 # assume a single service has been created + #service_uuid = set(service_uuids).pop() + #osm_wim.delete_connectivity_service(service_uuid) + pass + + +def test_interdomain_slice_removed( + d1_context_client : ContextClient, # pylint: disable=redefined-outer-name + d2_context_client : ContextClient): # pylint: disable=redefined-outer-name + + def per_domain(contexts, topologies, devices, links, context_id, context_client): + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(contexts) + + response = context_client.ListTopologies(ContextId(**context_id)) + assert len(response.topologies) == len(topologies) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(devices) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(links) + + response = context_client.ListSlices(ContextId(**context_id)) + assert len(response.slices) == 0 + + response = context_client.ListServices(ContextId(**context_id)) + assert len(response.services) == 0 + + # ----- List entities - Ensure services removed -------------------------------------------------------------------- + per_domain(D1_CONTEXTS, D1_TOPOLOGIES, D1_DEVICES, D1_LINKS, D1_CONTEXT_ID, d1_context_client) + per_domain(D2_CONTEXTS, D2_TOPOLOGIES, D2_DEVICES, D2_LINKS, D2_CONTEXT_ID, d2_context_client) diff --git a/src/tests/ofc22/.gitignore b/src/tests/ofc22/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..0a3f4400d5c88b1af32c7667d69d2fdc12d5424e --- /dev/null +++ b/src/tests/ofc22/.gitignore @@ -0,0 +1,2 @@ +# Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. +descriptors_real.json diff --git a/src/tests/ofc22/README.md b/src/tests/ofc22/README.md deleted file mode 100644 index 07fd4f72f494638744e7bc35eb207157bbb8cc1d..0000000000000000000000000000000000000000 --- a/src/tests/ofc22/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# OFC'22 Demo - Bootstrap devices, Monitor device Endpoints, Manage L3VPN Services -This functional test reproduces the live demonstration "Demonstration of Zero-touch Device and L3-VPN Service -Management Using the TeraFlow Cloud-native SDN Controller" carried out at -[OFC'22](https://www.ofcconference.org/en-us/home/program-speakers/demo/). - -## Functional test folder -This functional test can be found in folder `./src/tests/ofc22/`. A convenience alias `./ofc22/` pointing to that folder has been defined. - -## Execute with real devices -This functional test is designed to operate both with real and emulated devices. -By default, emulated devices are used; however, if you have access to real devices, you can create/modify the files `./ofc22/tests/Objects.py` and `./ofc22/tests/Credentials.py` to point to your devices, and map to your network topology. -Note that the default scenario assumes devices R2 and R4 are always emulated, while devices R1, R3, and O1 can be configured as emulated or real devices. - -__Important:__ The OpenConfigDriver, the P4Driver, and the TrandportApiDriver have to be considered as experimental. The configuration and monitoring capabilities they support are limited or partially implemented. Use them with care. - -## Deployment -To run this functional test, it is assumed you have deployed a Kubernetes-based environment as described in [Wiki: Installing Kubernetes on your Linux machine](https://gitlab.com/teraflow-h2020/controller/-/wikis/Installing-Kubernetes-on-your-Linux-machine). - -After installing Kubernetes, you can run it to deploy the appropriate components. Feel free to adapt it your particular case following the instructions described in [Wiki: Deploying a TeraFlow OS test instance](https://gitlab.com/teraflow-h2020/controller/-/wikis/Deploying-a-TeraFlow-OS-test-instance). - -__Important:__ -- The `./ofc22/deploy_in_kubernetes.sh` assumes you have installed the appropriate development dependencies using the `install_development_dependencies.sh` script. -- Before running the scripts in this folder, remember to update the environment variable K8S_HOSTNAME to point to the Kubernetes node you will be using as described in [Wiki: Deploying a TeraFlow OS test instance](https://gitlab.com/teraflow-h2020/controller/-/wikis/Deploying-a-TeraFlow-OS-test-instance). - -For your convenience, the configuration s sript `./ofc22/deploy_in_kubernetes.sh` has been already defined. The script will take some minutes to download the dependencies, build the micro-services, deploy them, and leave them ready for operation. The deployment will finish with a report of the items that have been created. - -## Access to the WebUI and Dashboard -When the deployment completes, you can connect to the TeraFlow OS WebUI and Dashboards as described in [Wiki: Using the WebUI](https://gitlab.com/teraflow-h2020/controller/-/wikis/Using-the-WebUI), or directly navigating to `http://[your-node-ip]:30800` for the WebUI and `http://[your-node-ip]:30300` for the Grafana Dashboard. - -Notes: -- the default credentials for the Grafana Dashboiard is user/pass: `admin`/`admin123+`. -- in Grafana, you can find the "L3-Monitorng" in the "Starred dashboards" section. - -## Test execution -To execute this functional test, four main steps needs to be carried out: -1. Device bootstrapping -2. L3VPN Service creation -3. L3VPN Service removal -4. Cleanup - -Upon the execution of each test progresses, a report will be generated indicating PASSED / FAILED / SKIPPED. If there is some error during the execution, you should see a detailed report on the error. See the troubleshooting section in that case. - -Feel free to check the logs of the different components using the appropriate `ofc22/show_logs_[component].sh` scripts after you execute each step. - -### 1. Device bootstrapping - -This step configures some basic entities (Context and Topology), the devices, and the links in the topology. The expected results are: -- The devices to be incorporated into the Topology. -- The devices to be pre-configured and initialized as ENABLED by the Automation component. -- The monitoring for the device ports (named as endpoints in TeraFlow OS) to be activated and data collection to automatically start. -- The links to be added to the topology. - -To run this step, execute the following script: -`./ofc22/run_test_01_bootstrap.sh` - -When the script finishes, check in the Grafana L3-Monitoring Dashboard and you should see the monitoring data being plotted and updated every 5 seconds (by default). Given that there is no service configured, you should see a 0-valued flat plot. - -In the WebUI, select the "admin" Context. In the "Devices" tab you should see that 5 different emulated devices have been created and activated: 4 packet routers, and 1 optical line system controller. Besides, in the "Services" tab you should see that there is no service created. Note here that the emulated devices produce synthetic randomly-generated data and do not care about the services configured. - -### 2. L3VPN Service creation - -This step configures a new service emulating the request an OSM WIM would make by means of a Mock OSM instance. - -To run this step, execute the following script: -`./ofc22/run_test_02_create_service.sh` - -When the script finishes, check the WebUI "Services" tab. You should see that two services have been created, one for the optical layer and another for the packet layer. Besides, you can check the "Devices" tab to see the configuration rules that have been configured in each device. In the Grafana Dashboard, given that there is now a service configured, you should see the plots with the monitored data for the device. By default, device R1-INF is selected. - -### 3. L3VPN Service removal - -This step deconfigures the previously created services emulating the request an OSM WIM would make by means of a Mock OSM instance. - -To run this step, execute the following script: -`./ofc22/run_test_03_delete_service.sh` - -When the script finishes, check the WebUI "Services" tab. You should see that the two services have been removed. Besides, in the "Devices" tab you can see that the appropriate configuration rules have been deconfigured. In the Grafana Dashboard, given that there is no service configured, you should see a 0-valued flat plot again. - -### 4. Cleanup - -This last step just performs a cleanup of the scenario removing all the TeraFlow OS entities for completeness. - -To run this step, execute the following script: -`./ofc22/run_test_04_cleanup.sh` - -When the script finishes, check the WebUI "Devices" tab, you should see that the devices have been removed. Besides, in the "Services" tab you can see that the "admin" Context has no services given that that context has been removed. - -## Troubleshooting - -Different scripts are provided to help in troubleshooting issues in the execution of the test. These scripts are: -- `./ofc22/show_deployment.sh`: this script reports the items belonging to this deployment. Use it to validate that all the pods, deployments and replica sets are ready and have a state of "running"; and the services are deployed and have appropriate IP addresses and ports. -- `ofc22/show_logs_automation.sh`: this script reports the logs for the automation component. -- `ofc22/show_logs_compute.sh`: this script reports the logs for the compute component. -- `ofc22/show_logs_context.sh`: this script reports the logs for the context component. -- `ofc22/show_logs_device.sh`: this script reports the logs for the device component. -- `ofc22/show_logs_monitoring.sh`: this script reports the logs for the monitoring component. -- `ofc22/show_logs_service.sh`: this script reports the logs for the service component. -- `ofc22/show_logs_webui.sh`: this script reports the logs for the webui component. diff --git a/src/tests/ofc22/__init__.py b/src/tests/ofc22/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/tests/ofc22/__init__.py +++ b/src/tests/ofc22/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/tests/ofc22/deploy_specs.sh b/src/tests/ofc22/deploy_specs.sh new file mode 100755 index 0000000000000000000000000000000000000000..874774e1ca50830832e842e49b6fff1114cb85d8 --- /dev/null +++ b/src/tests/ofc22/deploy_specs.sh @@ -0,0 +1,94 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# ----- TeraFlowSDN ------------------------------------------------------------ + +# Set the URL of the internal MicroK8s Docker registry where the images will be uploaded to. +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 load_generator" +export TFS_COMPONENTS="context device automation monitoring pathcomp service slice compute webui" + +# Set the tag you want to use for your images. +export TFS_IMAGE_TAG="dev" + +# Set the name of the Kubernetes namespace to deploy TFS to. +export TFS_K8S_NAMESPACE="tfs" + +# Set additional manifest files to be applied after the deployment +export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml" + +# Set the new Grafana admin password +export TFS_GRAFANA_PASSWORD="admin123+" + +# Disable skip-build flag to rebuild the Docker images. +export TFS_SKIP_BUILD="" + + +# ----- CockroachDB ------------------------------------------------------------ + +# Set the namespace where CockroackDB will be deployed. +export CRDB_NAMESPACE="crdb" + +# Set the database username to be used by Context. +export CRDB_USERNAME="tfs" + +# Set the database user's password to be used by Context. +export CRDB_PASSWORD="tfs123" + +# Set the database name to be used by Context. +export CRDB_DATABASE="tfs" + +# Set CockroachDB installation mode to 'single'. This option is convenient for development and testing. +# See ./deploy/all.sh or ./deploy/crdb.sh for additional details +export CRDB_DEPLOY_MODE="single" + +# Disable flag for dropping database, if exists. +export CRDB_DROP_DATABASE_IF_EXISTS="" + +# Disable flag for re-deploying CockroachDB from scratch. +export CRDB_REDEPLOY="" + + +# ----- NATS ------------------------------------------------------------------- + +# Set the namespace where NATS will be deployed. +export NATS_NAMESPACE="nats" + +# Disable flag for re-deploying NATS from scratch. +export NATS_REDEPLOY="" + + +# ----- QuestDB ---------------------------------------------------------------- + +# If not already set, set the namespace where QuestDB will be deployed. +export QDB_NAMESPACE="qdb" + +# If not already set, set the database username to be used by Monitoring. +export QDB_USERNAME="admin" + +# If not already set, set the database user's password to be used by Monitoring. +export QDB_PASSWORD="quest" + +# If not already set, set the table name to be used by Monitoring. +export QDB_TABLE="tfs_monitoring" + +## If not already set, disable flag for dropping table if exists. +#export QDB_DROP_TABLE_IF_EXISTS="" + +# If not already set, disable flag for re-deploying QuestDB from scratch. +export QDB_REDEPLOY="" diff --git a/src/tests/ofc22/descriptors_emulated.json b/src/tests/ofc22/descriptors_emulated.json new file mode 100644 index 0000000000000000000000000000000000000000..aa76edecd116ee7336fc1a2621d2bc3ae95080ce --- /dev/null +++ b/src/tests/ofc22/descriptors_emulated.json @@ -0,0 +1,102 @@ +{ + "contexts": [ + {"context_id": {"context_uuid": {"uuid": "admin"}}} + ], + "topologies": [ + {"topology_id": {"topology_uuid": {"uuid": "admin"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} + ], + "devices": [ + { + "device_id": {"device_uuid": {"uuid": "R1-EMU"}}, "device_type": "emu-packet-router", + "device_operational_status": 1, "device_drivers": [0], "device_endpoints": [], + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "13/0/0", "type": "optical", "sample_types": []}, + {"uuid": "13/1/2", "type": "copper", "sample_types": [101, 102, 201, 202]} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R2-EMU"}}, "device_type": "emu-packet-router", + "device_operational_status": 1, "device_drivers": [0], "device_endpoints": [], + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "13/0/0", "type": "optical", "sample_types": []}, + {"uuid": "13/1/2", "type": "copper", "sample_types": [101, 102, 201, 202]} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R3-EMU"}}, "device_type": "emu-packet-router", + "device_operational_status": 1, "device_drivers": [0], "device_endpoints": [], + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "13/0/0", "type": "optical", "sample_types": []}, + {"uuid": "13/1/2", "type": "copper", "sample_types": [101, 102, 201, 202]} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R4-EMU"}}, "device_type": "emu-packet-router", + "device_operational_status": 1, "device_drivers": [0], "device_endpoints": [], + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "13/0/0", "type": "optical", "sample_types": []}, + {"uuid": "13/1/2", "type": "copper", "sample_types": [101, 102, 201, 202]} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "O1-OLS"}}, "device_type": "emu-open-line-system", + "device_operational_status": 1, "device_drivers": [0], "device_endpoints": [], + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "aade6001-f00b-5e2f-a357-6a0a9d3de870", "type": "optical", "sample_types": []}, + {"uuid": "eb287d83-f05e-53ec-ab5a-adf6bd2b5418", "type": "optical", "sample_types": []}, + {"uuid": "0ef74f99-1acc-57bd-ab9d-4b958b06c513", "type": "optical", "sample_types": []}, + {"uuid": "50296d99-58cc-5ce7-82f5-fc8ee4eec2ec", "type": "optical", "sample_types": []} + ]}}} + ]} + } + ], + "links": [ + { + "link_id": {"link_uuid": {"uuid": "R1-EMU/13/0/0==O1-OLS/aade6001-f00b-5e2f-a357-6a0a9d3de870"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1-EMU"}}, "endpoint_uuid": {"uuid": "13/0/0"}}, + {"device_id": {"device_uuid": {"uuid": "O1-OLS"}}, "endpoint_uuid": {"uuid": "aade6001-f00b-5e2f-a357-6a0a9d3de870"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2-EMU/13/0/0==O1-OLS/eb287d83-f05e-53ec-ab5a-adf6bd2b5418"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2-EMU"}}, "endpoint_uuid": {"uuid": "13/0/0"}}, + {"device_id": {"device_uuid": {"uuid": "O1-OLS"}}, "endpoint_uuid": {"uuid": "eb287d83-f05e-53ec-ab5a-adf6bd2b5418"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R3-EMU/13/0/0==O1-OLS/0ef74f99-1acc-57bd-ab9d-4b958b06c513"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3-EMU"}}, "endpoint_uuid": {"uuid": "13/0/0"}}, + {"device_id": {"device_uuid": {"uuid": "O1-OLS"}}, "endpoint_uuid": {"uuid": "0ef74f99-1acc-57bd-ab9d-4b958b06c513"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R4-EMU/13/0/0==O1-OLS/50296d99-58cc-5ce7-82f5-fc8ee4eec2ec"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R4-EMU"}}, "endpoint_uuid": {"uuid": "13/0/0"}}, + {"device_id": {"device_uuid": {"uuid": "O1-OLS"}}, "endpoint_uuid": {"uuid": "50296d99-58cc-5ce7-82f5-fc8ee4eec2ec"}} + ] + } + ] +} \ No newline at end of file diff --git a/src/tests/ofc22/descriptors_emulated_xr.json b/src/tests/ofc22/descriptors_emulated_xr.json new file mode 100644 index 0000000000000000000000000000000000000000..d6a2f023422902bfc3d216771092f6081d8cf6b5 --- /dev/null +++ b/src/tests/ofc22/descriptors_emulated_xr.json @@ -0,0 +1,119 @@ +{ + "contexts": [ + { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_ids": [], + "service_ids": [] + } + ], + "topologies": [ + { + "topology_id": {"topology_uuid": {"uuid": "admin"}, "context_id": {"context_uuid": {"uuid": "admin"}}}, + "device_ids": [ + {"device_uuid": {"uuid": "R1-EMU"}}, + {"device_uuid": {"uuid": "R2-EMU"}}, + {"device_uuid": {"uuid": "R3-EMU"}}, + {"device_uuid": {"uuid": "R4-EMU"}}, + {"device_uuid": {"uuid": "X1-XR-CONSTELLATION"}} + ], + "link_ids": [ + {"link_uuid": {"uuid": "R1-EMU/13/0/0==XR HUB 1|XR-T4"}}, + {"link_uuid": {"uuid": "R2-EMU/13/0/0==XR HUB 1|XR-T3"}}, + {"link_uuid": {"uuid": "R3-EMU/13/0/0==XR1-XR LEAF 1|XR-T1"}}, + {"link_uuid": {"uuid": "R4-EMU/13/0/0==XR LEAF 2|XR-T1"}} + ] + } + ], + "devices": [ + { + "device_id": {"device_uuid": {"uuid": "R1-EMU"}}, + "device_type": "emu-packet-router", + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"13/0/0\"}, {\"sample_types\": [101, 102, 201, 202], \"type\": \"copper\", \"uuid\": \"13/1/2\"}]}"}} + ]}, + "device_operational_status": 1, + "device_drivers": [0], + "device_endpoints": [] + }, + { + "device_id": {"device_uuid": {"uuid": "R2-EMU"}}, + "device_type": "emu-packet-router", + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"13/0/0\"}, {\"sample_types\": [101, 102, 201, 202], \"type\": \"copper\", \"uuid\": \"13/1/2\"}]}"}} + ]}, + "device_operational_status": 1, + "device_drivers": [0], + "device_endpoints": [] + }, + { + "device_id": {"device_uuid": {"uuid": "R3-EMU"}}, + "device_type": "emu-packet-router", + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"13/0/0\"}, {\"sample_types\": [101, 102, 201, 202], \"type\": \"copper\", \"uuid\": \"13/1/2\"}]}"}} + ]}, + "device_operational_status": 1, + "device_drivers": [0], + "device_endpoints": [] + }, + { + "device_id": {"device_uuid": {"uuid": "R4-EMU"}}, + "device_type": "emu-packet-router", + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"13/0/0\"}, {\"sample_types\": [101, 102, 201, 202], \"type\": \"copper\", \"uuid\": \"13/1/2\"}]}"}} + ]}, + "device_operational_status": 1, + "device_drivers": [0], + "device_endpoints": [] + }, + { + "device_id": {"device_uuid": {"uuid": "X1-XR-CONSTELLATION"}}, + "device_type": "xr-constellation", + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "172.19.219.44"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "443"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": "{\"username\": \"xr-user-1\", \"password\": \"xr-user-1\", \"hub_module_name\": \"XR HUB 1\", \"consistency-mode\": \"lifecycle\"}"}} + ]}, + "device_operational_status": 1, + "device_drivers": [6], + "device_endpoints": [] + } + ], + "links": [ + { + "link_id": {"link_uuid": {"uuid": "R1-EMU/13/0/0==XR HUB 1|XR-T4"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1-EMU"}}, "endpoint_uuid": {"uuid": "13/0/0"}}, + {"device_id": {"device_uuid": {"uuid": "X1-XR-CONSTELLATION"}}, "endpoint_uuid": {"uuid": "XR HUB 1|XR-T4"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2-EMU/13/0/0==XR HUB 1|XR-T3"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2-EMU"}}, "endpoint_uuid": {"uuid": "13/0/0"}}, + {"device_id": {"device_uuid": {"uuid": "X1-XR-CONSTELLATION"}}, "endpoint_uuid": {"uuid": "XR HUB 1|XR-T3"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R3-EMU/13/0/0==XR1-XR LEAF 1|XR-T1"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3-EMU"}}, "endpoint_uuid": {"uuid": "13/0/0"}}, + {"device_id": {"device_uuid": {"uuid": "X1-XR-CONSTELLATION"}}, "endpoint_uuid": {"uuid": "XR LEAF 1|XR-T1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R4-EMU/13/0/0==XR LEAF 2|XR-T1"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R4-EMU"}}, "endpoint_uuid": {"uuid": "13/0/0"}}, + {"device_id": {"device_uuid": {"uuid": "X1-XR-CONSTELLATION"}}, "endpoint_uuid": {"uuid": "XR LEAF 2|XR-T1"}} + ] + } + ] +} diff --git a/src/tests/ofc22/show_logs_service.sh b/src/tests/ofc22/redeploy.sh similarity index 77% rename from src/tests/ofc22/show_logs_service.sh rename to src/tests/ofc22/redeploy.sh index 2589a3cfe16f4383904c342366f3efc01c42d470..e4e24aa8031bb43479db8d6fe5a548e1f958440b 100755 --- a/src/tests/ofc22/show_logs_service.sh +++ b/src/tests/ofc22/redeploy.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,5 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -K8S_NAMESPACE="ofc22" -kubectl --namespace $K8S_NAMESPACE logs deployment/serviceservice +source ofc22/deploy_specs.sh +./deploy/all.sh +source tfs_runtime_env_vars.sh diff --git a/src/tests/ofc22/run_test_01_bootstrap.sh b/src/tests/ofc22/run_test_01_bootstrap.sh index 042e0a0a2f08b59074da2a6e185fc00f37b482c0..cf57eb977755c85eca32da9b042205e966f42a5f 100755 --- a/src/tests/ofc22/run_test_01_bootstrap.sh +++ b/src/tests/ofc22/run_test_01_bootstrap.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,37 +13,5 @@ # See the License for the specific language governing permissions and # limitations under the License. - -PROJECTDIR=`pwd` - -cd $PROJECTDIR/src -RCFILE=$PROJECTDIR/coverage/.coveragerc -COVERAGEFILE=$PROJECTDIR/coverage/.coverage - -# Configure the correct folder on the .coveragerc file -cat $PROJECTDIR/coverage/.coveragerc.template | sed s+~/teraflow/controller+$PROJECTDIR+g > $RCFILE - -# Destroy old coverage file -rm -f $COVERAGEFILE - -# Set the name of the Kubernetes namespace and hostname to use. -K8S_NAMESPACE="ofc22" -K8S_HOSTNAME="kubernetes-master" - -# Flush Context database -kubectl --namespace $K8S_NAMESPACE exec -it deployment/contextservice --container redis -- redis-cli FLUSHALL - -export CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') -export CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') -export DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') -export DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') -export COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') -export COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') - -# Useful flags for pytest: -#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG - -# Run functional test and analyze coverage of code at same time - -coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ - tests/ofc22/tests/test_functional_bootstrap.py +source tfs_runtime_env_vars.sh +pytest --verbose --log-level=INFO src/tests/ofc22/tests/test_functional_bootstrap.py diff --git a/src/tests/ofc22/run_test_02_create_service.sh b/src/tests/ofc22/run_test_02_create_service.sh index b212b687c2fd5be42239e3012d91d01b963c9c7f..7a86e1a3879f0376d5bb725c8ebafeb97ffc0423 100755 --- a/src/tests/ofc22/run_test_02_create_service.sh +++ b/src/tests/ofc22/run_test_02_create_service.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,28 +13,5 @@ # See the License for the specific language governing permissions and # limitations under the License. - -PROJECTDIR=`pwd` - -cd $PROJECTDIR/src -RCFILE=$PROJECTDIR/coverage/.coveragerc -COVERAGEFILE=$PROJECTDIR/coverage/.coverage - -# Set the name of the Kubernetes namespace and hostname to use. -K8S_NAMESPACE="ofc22" -K8S_HOSTNAME="kubernetes-master" - -export CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') -export CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') -export DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') -export DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') -export COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') -export COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') - -# Useful flags for pytest: -#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG - -# Run functional test and analyze coverage of code at same time - -coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ - tests/ofc22/tests/test_functional_create_service.py +source tfs_runtime_env_vars.sh +pytest --verbose --log-level=INFO src/tests/ofc22/tests/test_functional_create_service.py diff --git a/src/tests/ofc22/run_test_03_delete_service.sh b/src/tests/ofc22/run_test_03_delete_service.sh index d0c3127ad7d2384285dde46c6fadefb4f6f8bdc6..9981f9e3a4e0eb7185bd6fc569465d754ce319bb 100755 --- a/src/tests/ofc22/run_test_03_delete_service.sh +++ b/src/tests/ofc22/run_test_03_delete_service.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,28 +13,5 @@ # See the License for the specific language governing permissions and # limitations under the License. - -PROJECTDIR=`pwd` - -cd $PROJECTDIR/src -RCFILE=$PROJECTDIR/coverage/.coveragerc -COVERAGEFILE=$PROJECTDIR/coverage/.coverage - -# Set the name of the Kubernetes namespace and hostname to use. -K8S_NAMESPACE="ofc22" -K8S_HOSTNAME="kubernetes-master" - -export CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') -export CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') -export DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') -export DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') -export COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') -export COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') - -# Useful flags for pytest: -#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG - -# Run functional test and analyze coverage of code at same time - -coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ - tests/ofc22/tests/test_functional_delete_service.py +source tfs_runtime_env_vars.sh +pytest --verbose --log-level=INFO src/tests/ofc22/tests/test_functional_delete_service.py diff --git a/src/tests/ofc22/run_test_04_cleanup.sh b/src/tests/ofc22/run_test_04_cleanup.sh index c31774523dd9937f82e17a7c90fbf41c7b3594f4..b08edee18b2ffe7ac601683bc40c54db1d867330 100755 --- a/src/tests/ofc22/run_test_04_cleanup.sh +++ b/src/tests/ofc22/run_test_04_cleanup.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,28 +13,5 @@ # See the License for the specific language governing permissions and # limitations under the License. - -PROJECTDIR=`pwd` - -cd $PROJECTDIR/src -RCFILE=$PROJECTDIR/coverage/.coveragerc -COVERAGEFILE=$PROJECTDIR/coverage/.coverage - -# Set the name of the Kubernetes namespace and hostname to use. -K8S_NAMESPACE="ofc22" -K8S_HOSTNAME="kubernetes-master" - -export CONTEXTSERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') -export CONTEXTSERVICE_SERVICE_PORT_GRPC=$(kubectl get service contextservice-public --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==1010)].nodePort}') -export DEVICESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') -export DEVICESERVICE_SERVICE_PORT_GRPC=$(kubectl get service deviceservice-public --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==2020)].nodePort}') -export COMPUTESERVICE_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') -export COMPUTESERVICE_SERVICE_PORT_HTTP=$(kubectl get service computeservice-public --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==8080)].nodePort}') - -# Useful flags for pytest: -#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG - -# Run functional test and analyze coverage of code at same time - -coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ - tests/ofc22/tests/test_functional_cleanup.py +source tfs_runtime_env_vars.sh +pytest --verbose --log-level=INFO src/tests/ofc22/tests/test_functional_cleanup.py diff --git a/scripts/run_tests_in_kubernetes.sh b/src/tests/ofc22/run_tests.sh similarity index 54% rename from scripts/run_tests_in_kubernetes.sh rename to src/tests/ofc22/run_tests.sh index fc0e1425731bf333a88eca6b65a3fc12122c7768..fe87a2c548d7c5631aca356b7b95771fa1832b94 100755 --- a/scripts/run_tests_in_kubernetes.sh +++ b/src/tests/ofc22/run_tests.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,12 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. - -IMAGE_NAME='integration_tester' -IMAGE_TAG='latest' -CI_REGISTRY_IMAGE='registry.gitlab.com/teraflow-h2020/controller' - -kubectl delete pod $(echo $IMAGE_NAME | sed -r 's/[^a-zA-Z0-9\.\-]/-/g') --wait=true --ignore-not-found=true -kubectl get all -kubectl run $(echo $IMAGE_NAME | sed -r 's/[^a-zA-Z0-9\.\-]/-/g') --image "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" --restart=Never --rm -i -kubectl get all +# Run functional tests +source tfs_runtime_env_vars.sh +pytest --verbose --log-level=INFO src/tests/ofc22/tests/test_functional_bootstrap.py +pytest --verbose --log-level=INFO src/tests/ofc22/tests/test_functional_create_service.py +pytest --verbose --log-level=INFO src/tests/ofc22/tests/test_functional_delete_service.py +pytest --verbose --log-level=INFO src/tests/ofc22/tests/test_functional_cleanup.py diff --git a/src/tests/ofc22/show_logs_monitoring.sh b/src/tests/ofc22/show_logs_monitoring.sh deleted file mode 100755 index 3dd7522fa57eca242225d29571956923075e14d8..0000000000000000000000000000000000000000 --- a/src/tests/ofc22/show_logs_monitoring.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -K8S_NAMESPACE="ofc22" -kubectl --namespace $K8S_NAMESPACE logs deployment/monitoringservice -c server diff --git a/src/tests/ofc22/show_logs_webui.sh b/src/tests/ofc22/show_logs_webui.sh deleted file mode 100755 index ecf4f3f6fc22dd71eef2a6db2b5ac18f54ccca35..0000000000000000000000000000000000000000 --- a/src/tests/ofc22/show_logs_webui.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# 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. - -K8S_NAMESPACE="ofc22" -kubectl --namespace $K8S_NAMESPACE logs deployment/webuiservice -c server diff --git a/src/tests/ofc22/tests/Fixtures.py b/src/tests/ofc22/tests/Fixtures.py new file mode 100644 index 0000000000000000000000000000000000000000..89dda54cf945d7078cd61c4b94b282f650429309 --- /dev/null +++ b/src/tests/ofc22/tests/Fixtures.py @@ -0,0 +1,28 @@ +# 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 pytest, logging +from common.Settings import get_setting +from tests.tools.mock_osm.Constants import WIM_PASSWORD, WIM_USERNAME +from tests.tools.mock_osm.MockOSM import MockOSM +from .Objects import WIM_MAPPING + +LOGGER = logging.getLogger(__name__) + +@pytest.fixture(scope='session') +def osm_wim(): + wim_url = 'http://{:s}:{:s}'.format( + get_setting('COMPUTESERVICE_SERVICE_HOST'), str(get_setting('COMPUTESERVICE_SERVICE_PORT_HTTP'))) + LOGGER.info('WIM_MAPPING = {:s}'.format(str(WIM_MAPPING))) + return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) diff --git a/src/tests/ofc22/tests/Objects.py b/src/tests/ofc22/tests/Objects.py index 6205b5e4ada67749f8230e99badca048a2372c2b..2d2d88419ecad1ca03caff09ef8bb8c44b931a70 100644 --- a/src/tests/ofc22/tests/Objects.py +++ b/src/tests/ofc22/tests/Objects.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,221 +12,31 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Dict, List, Tuple -from common.Constants import DEFAULT_CONTEXT_UUID, DEFAULT_TOPOLOGY_UUID -from common.tools.object_factory.Context import json_context, json_context_id -from common.tools.object_factory.Device import ( - json_device_connect_rules, json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, - json_device_emulated_tapi_disabled, json_device_id, json_device_packetrouter_disabled, json_device_tapi_disabled) -from common.tools.object_factory.EndPoint import json_endpoint, json_endpoint_id -from common.tools.object_factory.Link import json_link, json_link_id -from common.tools.object_factory.Topology import json_topology, json_topology_id -from context.proto.kpi_sample_types_pb2 import KpiSampleType - -# ----- Context -------------------------------------------------------------------------------------------------------- -CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_UUID) -CONTEXT = json_context(DEFAULT_CONTEXT_UUID) - -# ----- Topology ------------------------------------------------------------------------------------------------------- -TOPOLOGY_ID = json_topology_id(DEFAULT_TOPOLOGY_UUID, context_id=CONTEXT_ID) -TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_UUID, context_id=CONTEXT_ID) - -# ----- Monitoring Samples --------------------------------------------------------------------------------------------- -PACKET_PORT_SAMPLE_TYPES = [ - KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED, - KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED, - KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED, - KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED, -] - -# ----- Device Credentials and Settings -------------------------------------------------------------------------------- -try: - from .Credentials import DEVICE_R1_ADDRESS, DEVICE_R1_PORT, DEVICE_R1_USERNAME, DEVICE_R1_PASSWORD - from .Credentials import DEVICE_R3_ADDRESS, DEVICE_R3_PORT, DEVICE_R3_USERNAME, DEVICE_R3_PASSWORD - from .Credentials import DEVICE_O1_ADDRESS, DEVICE_O1_PORT - USE_REAL_DEVICES = True # Use real devices -except ImportError: - USE_REAL_DEVICES = False # Use emulated devices - - DEVICE_R1_ADDRESS = '0.0.0.0' - DEVICE_R1_PORT = 830 - DEVICE_R1_USERNAME = 'admin' - DEVICE_R1_PASSWORD = 'admin' - - DEVICE_R3_ADDRESS = '0.0.0.0' - DEVICE_R3_PORT = 830 - DEVICE_R3_USERNAME = 'admin' - DEVICE_R3_PASSWORD = 'admin' - - DEVICE_O1_ADDRESS = '0.0.0.0' - DEVICE_O1_PORT = 4900 - -#USE_REAL_DEVICES = False # Uncomment to force to use emulated devices - -def json_endpoint_ids(device_id : Dict, endpoint_descriptors : List[Tuple[str, str, List[int]]]): - return [ - json_endpoint_id(device_id, ep_uuid, topology_id=None) - for ep_uuid, _, _ in endpoint_descriptors - ] - -def json_endpoints(device_id : Dict, endpoint_descriptors : List[Tuple[str, str, List[int]]]): - return [ - json_endpoint(device_id, ep_uuid, ep_type, topology_id=None, kpi_sample_types=ep_sample_types) - for ep_uuid, ep_type, ep_sample_types in endpoint_descriptors - ] - -def get_link_uuid(a_device_id : Dict, a_endpoint_id : Dict, z_device_id : Dict, z_endpoint_id : Dict) -> str: - return '{:s}/{:s}=={:s}/{:s}'.format( - a_device_id['device_uuid']['uuid'], a_endpoint_id['endpoint_uuid']['uuid'], - z_device_id['device_uuid']['uuid'], z_endpoint_id['endpoint_uuid']['uuid']) - - -# ----- Devices -------------------------------------------------------------------------------------------------------- -if not USE_REAL_DEVICES: - json_device_packetrouter_disabled = json_device_emulated_packet_router_disabled - json_device_tapi_disabled = json_device_emulated_tapi_disabled - -DEVICE_R1_UUID = 'R1-INF' -DEVICE_R1_TIMEOUT = 120 -DEVICE_R1_ENDPOINT_DEFS = [('13/0/0', 'optical', []), ('13/1/2', 'copper', PACKET_PORT_SAMPLE_TYPES)] -DEVICE_R1_ID = json_device_id(DEVICE_R1_UUID) -#DEVICE_R1_ENDPOINTS = json_endpoints(DEVICE_R1_ID, DEVICE_R1_ENDPOINT_DEFS) -DEVICE_R1_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R1_ID, DEVICE_R1_ENDPOINT_DEFS) -DEVICE_R1 = json_device_packetrouter_disabled(DEVICE_R1_UUID) -ENDPOINT_ID_R1_13_0_0 = DEVICE_R1_ENDPOINT_IDS[0] -ENDPOINT_ID_R1_13_1_2 = DEVICE_R1_ENDPOINT_IDS[1] -DEVICE_R1_CONNECT_RULES = json_device_connect_rules(DEVICE_R1_ADDRESS, DEVICE_R1_PORT, { - 'username': DEVICE_R1_USERNAME, - 'password': DEVICE_R1_PASSWORD, - 'timeout' : DEVICE_R1_TIMEOUT, -}) if USE_REAL_DEVICES else json_device_emulated_connect_rules(DEVICE_R1_ENDPOINT_DEFS) - - -DEVICE_R2_UUID = 'R2-EMU' -DEVICE_R2_ENDPOINT_DEFS = [('13/0/0', 'optical', []), ('13/1/2', 'copper', PACKET_PORT_SAMPLE_TYPES)] -DEVICE_R2_ID = json_device_id(DEVICE_R2_UUID) -#DEVICE_R2_ENDPOINTS = json_endpoints(DEVICE_R2_ID, DEVICE_R2_ENDPOINT_DEFS) -DEVICE_R2_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R2_ID, DEVICE_R2_ENDPOINT_DEFS) -DEVICE_R2 = json_device_emulated_packet_router_disabled(DEVICE_R2_UUID) -ENDPOINT_ID_R2_13_0_0 = DEVICE_R2_ENDPOINT_IDS[0] -ENDPOINT_ID_R2_13_1_2 = DEVICE_R2_ENDPOINT_IDS[1] -DEVICE_R2_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_R2_ENDPOINT_DEFS) - - -DEVICE_R3_UUID = 'R3-INF' -DEVICE_R3_TIMEOUT = 120 -DEVICE_R3_ENDPOINT_DEFS = [('13/0/0', 'optical', []), ('13/1/2', 'copper', PACKET_PORT_SAMPLE_TYPES)] -DEVICE_R3_ID = json_device_id(DEVICE_R3_UUID) -#DEVICE_R3_ENDPOINTS = json_endpoints(DEVICE_R3_ID, DEVICE_R3_ENDPOINT_DEFS) -DEVICE_R3_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R3_ID, DEVICE_R3_ENDPOINT_DEFS) -DEVICE_R3 = json_device_packetrouter_disabled(DEVICE_R3_UUID) -ENDPOINT_ID_R3_13_0_0 = DEVICE_R3_ENDPOINT_IDS[0] -ENDPOINT_ID_R3_13_1_2 = DEVICE_R3_ENDPOINT_IDS[1] -DEVICE_R3_CONNECT_RULES = json_device_connect_rules(DEVICE_R3_ADDRESS, DEVICE_R3_PORT, { - 'username': DEVICE_R3_USERNAME, - 'password': DEVICE_R3_PASSWORD, - 'timeout' : DEVICE_R3_TIMEOUT, -}) if USE_REAL_DEVICES else json_device_emulated_connect_rules(DEVICE_R3_ENDPOINT_DEFS) - - -DEVICE_R4_UUID = 'R4-EMU' -DEVICE_R4_ENDPOINT_DEFS = [('13/0/0', 'optical', []), ('13/1/2', 'copper', PACKET_PORT_SAMPLE_TYPES)] -DEVICE_R4_ID = json_device_id(DEVICE_R4_UUID) -#DEVICE_R4_ENDPOINTS = json_endpoints(DEVICE_R4_ID, DEVICE_R4_ENDPOINT_DEFS) -DEVICE_R4_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R4_ID, DEVICE_R4_ENDPOINT_DEFS) -DEVICE_R4 = json_device_emulated_packet_router_disabled(DEVICE_R4_UUID) -ENDPOINT_ID_R4_13_0_0 = DEVICE_R4_ENDPOINT_IDS[0] -ENDPOINT_ID_R4_13_1_2 = DEVICE_R4_ENDPOINT_IDS[1] -DEVICE_R4_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_R4_ENDPOINT_DEFS) - - -DEVICE_O1_UUID = 'O1-OLS' -DEVICE_O1_TIMEOUT = 120 -DEVICE_O1_ENDPOINT_DEFS = [ - ('aade6001-f00b-5e2f-a357-6a0a9d3de870', 'optical', []), # node_1_port_13 - ('eb287d83-f05e-53ec-ab5a-adf6bd2b5418', 'optical', []), # node_2_port_13 - ('0ef74f99-1acc-57bd-ab9d-4b958b06c513', 'optical', []), # node_3_port_13 - ('50296d99-58cc-5ce7-82f5-fc8ee4eec2ec', 'optical', []), # node_4_port_13 -] -DEVICE_O1_ID = json_device_id(DEVICE_O1_UUID) -DEVICE_O1 = json_device_tapi_disabled(DEVICE_O1_UUID) -#DEVICE_O1_ENDPOINTS = json_endpoints(DEVICE_O1_ID, DEVICE_O1_ENDPOINT_DEFS) -DEVICE_O1_ENDPOINT_IDS = json_endpoint_ids(DEVICE_O1_ID, DEVICE_O1_ENDPOINT_DEFS) -ENDPOINT_ID_O1_EP1 = DEVICE_O1_ENDPOINT_IDS[0] -ENDPOINT_ID_O1_EP2 = DEVICE_O1_ENDPOINT_IDS[1] -ENDPOINT_ID_O1_EP3 = DEVICE_O1_ENDPOINT_IDS[2] -ENDPOINT_ID_O1_EP4 = DEVICE_O1_ENDPOINT_IDS[3] -DEVICE_O1_CONNECT_RULES = json_device_connect_rules(DEVICE_O1_ADDRESS, DEVICE_O1_PORT, { - 'timeout' : DEVICE_O1_TIMEOUT, -}) if USE_REAL_DEVICES else json_device_emulated_connect_rules(DEVICE_O1_ENDPOINT_DEFS) - - -# ----- Links ---------------------------------------------------------------------------------------------------------- -LINK_R1_O1_UUID = get_link_uuid(DEVICE_R1_ID, ENDPOINT_ID_R1_13_0_0, DEVICE_O1_ID, ENDPOINT_ID_O1_EP1) -LINK_R1_O1_ID = json_link_id(LINK_R1_O1_UUID) -LINK_R1_O1 = json_link(LINK_R1_O1_UUID, [ENDPOINT_ID_R1_13_0_0, ENDPOINT_ID_O1_EP1]) - -LINK_R2_O1_UUID = get_link_uuid(DEVICE_R2_ID, ENDPOINT_ID_R2_13_0_0, DEVICE_O1_ID, ENDPOINT_ID_O1_EP2) -LINK_R2_O1_ID = json_link_id(LINK_R2_O1_UUID) -LINK_R2_O1 = json_link(LINK_R2_O1_UUID, [ENDPOINT_ID_R2_13_0_0, ENDPOINT_ID_O1_EP2]) - -LINK_R3_O1_UUID = get_link_uuid(DEVICE_R3_ID, ENDPOINT_ID_R3_13_0_0, DEVICE_O1_ID, ENDPOINT_ID_O1_EP3) -LINK_R3_O1_ID = json_link_id(LINK_R3_O1_UUID) -LINK_R3_O1 = json_link(LINK_R3_O1_UUID, [ENDPOINT_ID_R3_13_0_0, ENDPOINT_ID_O1_EP3]) - -LINK_R4_O1_UUID = get_link_uuid(DEVICE_R4_ID, ENDPOINT_ID_R4_13_0_0, DEVICE_O1_ID, ENDPOINT_ID_O1_EP4) -LINK_R4_O1_ID = json_link_id(LINK_R4_O1_UUID) -LINK_R4_O1 = json_link(LINK_R4_O1_UUID, [ENDPOINT_ID_R4_13_0_0, ENDPOINT_ID_O1_EP4]) - +from common.tools.object_factory.Device import json_device_id +from common.tools.object_factory.EndPoint import json_endpoint_id +from tests.tools.mock_osm.Tools import connection_point, wim_mapping # ----- WIM Service Settings ------------------------------------------------------------------------------------------- -def endpoint_id__to__sep_id(endpoint_id): - device_uuid = endpoint_id['device_id']['device_uuid']['uuid'] - endpoint_uuid = endpoint_id['endpoint_uuid']['uuid'] - return '{:s}:{:s}'.format(device_uuid, endpoint_uuid) - -WIM_SEP_R1_ID = endpoint_id__to__sep_id(ENDPOINT_ID_R1_13_1_2) -WIM_SEP_R1_IP = '10.0.0.1' -WIM_SEP_R1_SITE_ID = '1' -WIM_SEP_R1_BEARER = '{:s}:{:s}'.format(WIM_SEP_R1_ID, WIM_SEP_R1_IP) +SITE_ID_DC1 = '1' +DEV_ID_DC1 = json_device_id('R1-EMU') +EP_ID_DC1 = json_endpoint_id(DEV_ID_DC1, '13/1/2') -WIM_SEP_R3_ID = endpoint_id__to__sep_id(ENDPOINT_ID_R3_13_1_2) -WIM_SEP_R3_IP = '10.0.0.2' -WIM_SEP_R3_SITE_ID = '2' -WIM_SEP_R3_BEARER = '{:s}:{:s}'.format(WIM_SEP_R3_ID, WIM_SEP_R3_IP) +SITE_ID_DC2 = '2' +DEV_ID_DC2 = json_device_id('R3-EMU') +EP_ID_DC2 = json_endpoint_id(DEV_ID_DC2, '13/1/2') -WIM_USERNAME = 'admin' -WIM_PASSWORD = 'admin' +WIM_SEP_DC1, WIM_MAP_DC1 = wim_mapping(SITE_ID_DC1, EP_ID_DC1) +WIM_SEP_DC2, WIM_MAP_DC2 = wim_mapping(SITE_ID_DC2, EP_ID_DC2) WIM_MAPPING = [ - {'device-id': DEVICE_R1_UUID, 'service_endpoint_id': WIM_SEP_R1_ID, - 'service_mapping_info': {'bearer': {'bearer-reference': WIM_SEP_R1_BEARER}, 'site-id': WIM_SEP_R1_SITE_ID}}, - {'device-id': DEVICE_R3_UUID, 'service_endpoint_id': WIM_SEP_R3_ID, - 'service_mapping_info': {'bearer': {'bearer-reference': WIM_SEP_R3_BEARER}, 'site-id': WIM_SEP_R3_SITE_ID}}, + WIM_MAP_DC1, + WIM_MAP_DC2, ] + +WIM_SRV_VLAN_ID = 300 WIM_SERVICE_TYPE = 'ELINE' -WIM_SERVICE_VLAN_ID = 1234 WIM_SERVICE_CONNECTION_POINTS = [ - {'service_endpoint_id': WIM_SEP_R1_ID, - 'service_endpoint_encapsulation_type': 'dot1q', - 'service_endpoint_encapsulation_info': {'vlan': WIM_SERVICE_VLAN_ID}}, - {'service_endpoint_id': WIM_SEP_R3_ID, - 'service_endpoint_encapsulation_type': 'dot1q', - 'service_endpoint_encapsulation_info': {'vlan': WIM_SERVICE_VLAN_ID}}, + connection_point(WIM_SEP_DC1, 'dot1q', WIM_SRV_VLAN_ID), + connection_point(WIM_SEP_DC2, 'dot1q', WIM_SRV_VLAN_ID), ] - -# ----- Object Collections --------------------------------------------------------------------------------------------- - -CONTEXTS = [CONTEXT] -TOPOLOGIES = [TOPOLOGY] - -DEVICES = [ - (DEVICE_R1, DEVICE_R1_CONNECT_RULES), - (DEVICE_R2, DEVICE_R2_CONNECT_RULES), - (DEVICE_R3, DEVICE_R3_CONNECT_RULES), - (DEVICE_R4, DEVICE_R4_CONNECT_RULES), - (DEVICE_O1, DEVICE_O1_CONNECT_RULES), -] - -LINKS = [LINK_R1_O1, LINK_R2_O1, LINK_R3_O1, LINK_R4_O1] diff --git a/src/tests/ofc22/tests/ObjectsXr.py b/src/tests/ofc22/tests/ObjectsXr.py new file mode 100644 index 0000000000000000000000000000000000000000..9871a50b8181b53cfbb767be76a1a0978eaf1d27 --- /dev/null +++ b/src/tests/ofc22/tests/ObjectsXr.py @@ -0,0 +1,238 @@ +# 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 typing import Dict, List, Tuple +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Device import ( + json_device_connect_rules, json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, + json_device_emulated_tapi_disabled, json_device_id, json_device_packetrouter_disabled, json_device_tapi_disabled) +from common.tools.object_factory.EndPoint import json_endpoint, json_endpoint_id +from common.tools.object_factory.Link import json_link, json_link_id +from common.tools.object_factory.Topology import json_topology, json_topology_id +from common.proto.kpi_sample_types_pb2 import KpiSampleType + +# ----- Context -------------------------------------------------------------------------------------------------------- +CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) +CONTEXT = json_context(DEFAULT_CONTEXT_NAME) + +# ----- Topology ------------------------------------------------------------------------------------------------------- +TOPOLOGY_ID = json_topology_id(DEFAULT_TOPOLOGY_NAME, context_id=CONTEXT_ID) +TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_NAME, context_id=CONTEXT_ID) + +# ----- Monitoring Samples --------------------------------------------------------------------------------------------- +PACKET_PORT_SAMPLE_TYPES = [ + KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED, + KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED, + KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED, + KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED, +] + +# ----- Device Credentials and Settings -------------------------------------------------------------------------------- +try: + from .Credentials import DEVICE_R1_ADDRESS, DEVICE_R1_PORT, DEVICE_R1_USERNAME, DEVICE_R1_PASSWORD + from .Credentials import DEVICE_R3_ADDRESS, DEVICE_R3_PORT, DEVICE_R3_USERNAME, DEVICE_R3_PASSWORD + #from .Credentials import DEVICE_O1_ADDRESS, DEVICE_O1_PORT + USE_REAL_DEVICES = True # Use real devices +except ImportError: + USE_REAL_DEVICES = False # Use emulated devices + + DEVICE_R1_ADDRESS = '0.0.0.0' + DEVICE_R1_PORT = 830 + DEVICE_R1_USERNAME = 'admin' + DEVICE_R1_PASSWORD = 'admin' + + DEVICE_R3_ADDRESS = '0.0.0.0' + DEVICE_R3_PORT = 830 + DEVICE_R3_USERNAME = 'admin' + DEVICE_R3_PASSWORD = 'admin' + +DEVICE_X1_ADDRESS = '172.19.219.44' +DEVICE_X1_PORT = 443 + +#USE_REAL_DEVICES = False # Uncomment to force to use emulated devices + +def json_endpoint_ids(device_id : Dict, endpoint_descriptors : List[Tuple[str, str, List[int]]]): + return [ + json_endpoint_id(device_id, ep_uuid, topology_id=None) + for ep_uuid, _, _ in endpoint_descriptors + ] + +def json_endpoints(device_id : Dict, endpoint_descriptors : List[Tuple[str, str, List[int]]]): + return [ + json_endpoint(device_id, ep_uuid, ep_type, topology_id=None, kpi_sample_types=ep_sample_types) + for ep_uuid, ep_type, ep_sample_types in endpoint_descriptors + ] + +def get_link_uuid(a_device_id : Dict, a_endpoint_id : Dict, z_device_id : Dict, z_endpoint_id : Dict) -> str: + return '{:s}/{:s}=={:s}/{:s}'.format( + a_device_id['device_uuid']['uuid'], a_endpoint_id['endpoint_uuid']['uuid'], + z_device_id['device_uuid']['uuid'], z_endpoint_id['endpoint_uuid']['uuid']) + + +# ----- Devices -------------------------------------------------------------------------------------------------------- +if not USE_REAL_DEVICES: + json_device_packetrouter_disabled = json_device_emulated_packet_router_disabled + json_device_tapi_disabled = json_device_emulated_tapi_disabled + +DEVICE_R1_UUID = 'R1-EMU' +DEVICE_R1_TIMEOUT = 120 +DEVICE_R1_ENDPOINT_DEFS = [('13/0/0', 'optical', []), ('13/1/2', 'copper', PACKET_PORT_SAMPLE_TYPES)] +DEVICE_R1_ID = json_device_id(DEVICE_R1_UUID) +#DEVICE_R1_ENDPOINTS = json_endpoints(DEVICE_R1_ID, DEVICE_R1_ENDPOINT_DEFS) +DEVICE_R1_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R1_ID, DEVICE_R1_ENDPOINT_DEFS) +DEVICE_R1 = json_device_packetrouter_disabled(DEVICE_R1_UUID) +ENDPOINT_ID_R1_13_0_0 = DEVICE_R1_ENDPOINT_IDS[0] +ENDPOINT_ID_R1_13_1_2 = DEVICE_R1_ENDPOINT_IDS[1] +DEVICE_R1_CONNECT_RULES = json_device_connect_rules(DEVICE_R1_ADDRESS, DEVICE_R1_PORT, { + 'username': DEVICE_R1_USERNAME, + 'password': DEVICE_R1_PASSWORD, + 'timeout' : DEVICE_R1_TIMEOUT, +}) if USE_REAL_DEVICES else json_device_emulated_connect_rules(DEVICE_R1_ENDPOINT_DEFS) + + +DEVICE_R2_UUID = 'R2-EMU' +DEVICE_R2_ENDPOINT_DEFS = [('13/0/0', 'optical', []), ('13/1/2', 'copper', PACKET_PORT_SAMPLE_TYPES)] +DEVICE_R2_ID = json_device_id(DEVICE_R2_UUID) +#DEVICE_R2_ENDPOINTS = json_endpoints(DEVICE_R2_ID, DEVICE_R2_ENDPOINT_DEFS) +DEVICE_R2_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R2_ID, DEVICE_R2_ENDPOINT_DEFS) +DEVICE_R2 = json_device_emulated_packet_router_disabled(DEVICE_R2_UUID) +ENDPOINT_ID_R2_13_0_0 = DEVICE_R2_ENDPOINT_IDS[0] +ENDPOINT_ID_R2_13_1_2 = DEVICE_R2_ENDPOINT_IDS[1] +DEVICE_R2_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_R2_ENDPOINT_DEFS) + + +DEVICE_R3_UUID = 'R3-EMU' +DEVICE_R3_TIMEOUT = 120 +DEVICE_R3_ENDPOINT_DEFS = [('13/0/0', 'optical', []), ('13/1/2', 'copper', PACKET_PORT_SAMPLE_TYPES)] +DEVICE_R3_ID = json_device_id(DEVICE_R3_UUID) +#DEVICE_R3_ENDPOINTS = json_endpoints(DEVICE_R3_ID, DEVICE_R3_ENDPOINT_DEFS) +DEVICE_R3_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R3_ID, DEVICE_R3_ENDPOINT_DEFS) +DEVICE_R3 = json_device_packetrouter_disabled(DEVICE_R3_UUID) +ENDPOINT_ID_R3_13_0_0 = DEVICE_R3_ENDPOINT_IDS[0] +ENDPOINT_ID_R3_13_1_2 = DEVICE_R3_ENDPOINT_IDS[1] +DEVICE_R3_CONNECT_RULES = json_device_connect_rules(DEVICE_R3_ADDRESS, DEVICE_R3_PORT, { + 'username': DEVICE_R3_USERNAME, + 'password': DEVICE_R3_PASSWORD, + 'timeout' : DEVICE_R3_TIMEOUT, +}) if USE_REAL_DEVICES else json_device_emulated_connect_rules(DEVICE_R3_ENDPOINT_DEFS) + + +DEVICE_R4_UUID = 'R4-EMU' +DEVICE_R4_ENDPOINT_DEFS = [('13/0/0', 'optical', []), ('13/1/2', 'copper', PACKET_PORT_SAMPLE_TYPES)] +DEVICE_R4_ID = json_device_id(DEVICE_R4_UUID) +#DEVICE_R4_ENDPOINTS = json_endpoints(DEVICE_R4_ID, DEVICE_R4_ENDPOINT_DEFS) +DEVICE_R4_ENDPOINT_IDS = json_endpoint_ids(DEVICE_R4_ID, DEVICE_R4_ENDPOINT_DEFS) +DEVICE_R4 = json_device_emulated_packet_router_disabled(DEVICE_R4_UUID) +ENDPOINT_ID_R4_13_0_0 = DEVICE_R4_ENDPOINT_IDS[0] +ENDPOINT_ID_R4_13_1_2 = DEVICE_R4_ENDPOINT_IDS[1] +DEVICE_R4_CONNECT_RULES = json_device_emulated_connect_rules(DEVICE_R4_ENDPOINT_DEFS) + + +DEVICE_X1_UUID = 'X1-XR-CONSTELLATION' +DEVICE_X1_TIMEOUT = 120 +DEVICE_X1_ENDPOINT_DEFS = [ + ('XR HUB 1|XR-T1', 'optical', []), + ('XR HUB 1|XR-T2', 'optical', []), + ('XR HUB 1|XR-T3', 'optical', []), + ('XR HUB 1|XR-T4', 'optical', []), + ('XR LEAF 1|XR-T1', 'optical', []), + ('XR LEAF 2|XR-T1', 'optical', []), +] +DEVICE_X1_ID = json_device_id(DEVICE_X1_UUID) +DEVICE_X1 = json_device_tapi_disabled(DEVICE_X1_UUID) +DEVICE_X1_ENDPOINT_IDS = json_endpoint_ids(DEVICE_X1_ID, DEVICE_X1_ENDPOINT_DEFS) +# These match JSON, hence indexes are what theyt are +ENDPOINT_ID_X1_EP1 = DEVICE_X1_ENDPOINT_IDS[3] +ENDPOINT_ID_X1_EP2 = DEVICE_X1_ENDPOINT_IDS[2] +ENDPOINT_ID_X1_EP3 = DEVICE_X1_ENDPOINT_IDS[4] +ENDPOINT_ID_X1_EP4 = DEVICE_X1_ENDPOINT_IDS[5] +DEVICE_X1_CONNECT_RULES = json_device_connect_rules(DEVICE_X1_ADDRESS, DEVICE_X1_PORT, { + 'timeout' : DEVICE_X1_TIMEOUT, + "username": "xr-user-1", + "password": "xr-user-1", + "hub_module_name": "XR HUB 1" +}) +# Always using real device (CM, whether CM has emulated backend is another story) +#if USE_REAL_DEVICES else json_device_emulated_connect_rules(DEVICE_X1_ENDPOINT_DEFS) + + +# ----- Links ---------------------------------------------------------------------------------------------------------- +LINK_R1_X1_UUID = get_link_uuid(DEVICE_R1_ID, ENDPOINT_ID_R1_13_0_0, DEVICE_X1_ID, ENDPOINT_ID_X1_EP1) +LINK_R1_X1_ID = json_link_id(LINK_R1_X1_UUID) +LINK_R1_X1 = json_link(LINK_R1_X1_UUID, [ENDPOINT_ID_R1_13_0_0, ENDPOINT_ID_X1_EP1]) + +LINK_R2_X1_UUID = get_link_uuid(DEVICE_R2_ID, ENDPOINT_ID_R2_13_0_0, DEVICE_X1_ID, ENDPOINT_ID_X1_EP2) +LINK_R2_X1_ID = json_link_id(LINK_R2_X1_UUID) +LINK_R2_X1 = json_link(LINK_R2_X1_UUID, [ENDPOINT_ID_R2_13_0_0, ENDPOINT_ID_X1_EP2]) + +LINK_R3_X1_UUID = get_link_uuid(DEVICE_R3_ID, ENDPOINT_ID_R3_13_0_0, DEVICE_X1_ID, ENDPOINT_ID_X1_EP3) +LINK_R3_X1_ID = json_link_id(LINK_R3_X1_UUID) +LINK_R3_X1 = json_link(LINK_R3_X1_UUID, [ENDPOINT_ID_R3_13_0_0, ENDPOINT_ID_X1_EP3]) + +LINK_R4_X1_UUID = get_link_uuid(DEVICE_R4_ID, ENDPOINT_ID_R4_13_0_0, DEVICE_X1_ID, ENDPOINT_ID_X1_EP4) +LINK_R4_X1_ID = json_link_id(LINK_R4_X1_UUID) +LINK_R4_X1 = json_link(LINK_R4_X1_UUID, [ENDPOINT_ID_R4_13_0_0, ENDPOINT_ID_X1_EP4]) + + +# ----- WIM Service Settings ------------------------------------------------------------------------------------------- + +def compose_service_endpoint_id(endpoint_id): + device_uuid = endpoint_id['device_id']['device_uuid']['uuid'] + endpoint_uuid = endpoint_id['endpoint_uuid']['uuid'] + return ':'.join([device_uuid, endpoint_uuid]) + +WIM_SEP_R1_ID = compose_service_endpoint_id(ENDPOINT_ID_R1_13_1_2) +WIM_SEP_R1_SITE_ID = '1' +WIM_SEP_R1_BEARER = WIM_SEP_R1_ID +WIM_SRV_R1_VLAN_ID = 400 + +WIM_SEP_R3_ID = compose_service_endpoint_id(ENDPOINT_ID_R3_13_1_2) +WIM_SEP_R3_SITE_ID = '2' +WIM_SEP_R3_BEARER = WIM_SEP_R3_ID +WIM_SRV_R3_VLAN_ID = 500 + +WIM_USERNAME = 'admin' +WIM_PASSWORD = 'admin' + +WIM_MAPPING = [ + {'device-id': DEVICE_R1_UUID, 'service_endpoint_id': WIM_SEP_R1_ID, + 'service_mapping_info': {'bearer': {'bearer-reference': WIM_SEP_R1_BEARER}, 'site-id': WIM_SEP_R1_SITE_ID}}, + {'device-id': DEVICE_R3_UUID, 'service_endpoint_id': WIM_SEP_R3_ID, + 'service_mapping_info': {'bearer': {'bearer-reference': WIM_SEP_R3_BEARER}, 'site-id': WIM_SEP_R3_SITE_ID}}, +] +WIM_SERVICE_TYPE = 'ELINE' +WIM_SERVICE_CONNECTION_POINTS = [ + {'service_endpoint_id': WIM_SEP_R1_ID, + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': WIM_SRV_R1_VLAN_ID}}, + {'service_endpoint_id': WIM_SEP_R3_ID, + 'service_endpoint_encapsulation_type': 'dot1q', + 'service_endpoint_encapsulation_info': {'vlan': WIM_SRV_R3_VLAN_ID}}, +] + +# ----- Object Collections --------------------------------------------------------------------------------------------- + +CONTEXTS = [CONTEXT] +TOPOLOGIES = [TOPOLOGY] + +DEVICES = [ + (DEVICE_R1, DEVICE_R1_CONNECT_RULES), + (DEVICE_R2, DEVICE_R2_CONNECT_RULES), + (DEVICE_R3, DEVICE_R3_CONNECT_RULES), + (DEVICE_R4, DEVICE_R4_CONNECT_RULES), + (DEVICE_X1, DEVICE_X1_CONNECT_RULES), +] + +LINKS = [LINK_R1_X1, LINK_R2_X1, LINK_R3_X1, LINK_R4_X1] diff --git a/src/tests/ofc22/tests/__init__.py b/src/tests/ofc22/tests/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/tests/ofc22/tests/__init__.py +++ b/src/tests/ofc22/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/tests/ofc22/tests/test_functional_bootstrap.py b/src/tests/ofc22/tests/test_functional_bootstrap.py index 334d7894babedfed2ffb30e4682a1d56e4261cb9..ad2d5703a931c933a9ab4e7162dd1985e5a33d9d 100644 --- a/src/tests/ofc22/tests/test_functional_bootstrap.py +++ b/src/tests/ofc22/tests/test_functional_bootstrap.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,39 +12,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -import copy, logging, pytest -from common.Settings import get_setting -from common.tests.EventTools import EVENT_CREATE, EVENT_UPDATE, check_events +import logging, time +from common.Constants import DEFAULT_CONTEXT_NAME +from common.proto.context_pb2 import ContextId, Empty +from common.proto.monitoring_pb2 import KpiDescriptorList +from common.tests.LoadScenario import load_scenario_from_descriptor 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.Link import json_link_id -from common.tools.object_factory.Topology import json_topology_id from context.client.ContextClient import ContextClient -from context.client.EventsCollector import EventsCollector -from context.proto.context_pb2 import Context, ContextId, Device, Empty, Link, Topology from device.client.DeviceClient import DeviceClient -from .Objects import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES - +from monitoring.client.MonitoringClient import MonitoringClient +from tests.Fixtures import context_client, device_client, monitoring_client # pylint: disable=unused-import LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.DEBUG) +DESCRIPTOR_FILE = 'ofc22/descriptors_emulated.json' +ADMIN_CONTEXT_ID = ContextId(**json_context_id(DEFAULT_CONTEXT_NAME)) -@pytest.fixture(scope='session') -def context_client(): - _client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) - yield _client - _client.close() - - -@pytest.fixture(scope='session') -def device_client(): - _client = DeviceClient(get_setting('DEVICESERVICE_SERVICE_HOST'), get_setting('DEVICESERVICE_SERVICE_PORT_GRPC')) - yield _client - _client.close() - - -def test_scenario_empty(context_client : ContextClient): # pylint: disable=redefined-outer-name +def test_scenario_bootstrap( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name +) -> None: # ----- List entities - Ensure database is empty ------------------------------------------------------------------- response = context_client.ListContexts(Empty()) assert len(response.contexts) == 0 @@ -56,149 +44,63 @@ def test_scenario_empty(context_client : ContextClient): # pylint: disable=rede assert len(response.links) == 0 -def test_prepare_scenario(context_client : ContextClient): # pylint: disable=redefined-outer-name - - # ----- Start the EventsCollector ---------------------------------------------------------------------------------- - events_collector = EventsCollector(context_client) - events_collector.start() - - expected_events = [] + # ----- Load Scenario ---------------------------------------------------------------------------------------------- + descriptor_loader = load_scenario_from_descriptor( + DESCRIPTOR_FILE, context_client, device_client, None, None) - # ----- Create Contexts and Topologies ----------------------------------------------------------------------------- - for context in CONTEXTS: - context_uuid = context['context_id']['context_uuid']['uuid'] - LOGGER.info('Adding Context {:s}'.format(context_uuid)) - response = context_client.SetContext(Context(**context)) - assert response.context_uuid.uuid == context_uuid - expected_events.append(('ContextEvent', EVENT_CREATE, json_context_id(context_uuid))) - for topology in TOPOLOGIES: - context_uuid = topology['topology_id']['context_id']['context_uuid']['uuid'] - topology_uuid = topology['topology_id']['topology_uuid']['uuid'] - LOGGER.info('Adding Topology {:s}/{:s}'.format(context_uuid, topology_uuid)) - response = context_client.SetTopology(Topology(**topology)) - assert response.context_id.context_uuid.uuid == context_uuid - assert response.topology_uuid.uuid == topology_uuid - context_id = json_context_id(context_uuid) - expected_events.append(('TopologyEvent', EVENT_CREATE, json_topology_id(topology_uuid, context_id=context_id))) - - # ----- Validate Collected Events ---------------------------------------------------------------------------------- - check_events(events_collector, expected_events) - - # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- - events_collector.stop() - - -def test_scenario_ready(context_client : ContextClient): # pylint: disable=redefined-outer-name # ----- List entities - Ensure scenario is ready ------------------------------------------------------------------- response = context_client.ListContexts(Empty()) - assert len(response.contexts) == len(CONTEXTS) + assert len(response.contexts) == descriptor_loader.num_contexts - response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) - assert len(response.topologies) == len(TOPOLOGIES) + for context_uuid, num_topologies in descriptor_loader.num_topologies.items(): + response = context_client.ListTopologies(ContextId(**json_context_id(context_uuid))) + assert len(response.topologies) == num_topologies response = context_client.ListDevices(Empty()) - assert len(response.devices) == 0 + assert len(response.devices) == descriptor_loader.num_devices response = context_client.ListLinks(Empty()) - assert len(response.links) == 0 - - response = context_client.ListServices(ContextId(**CONTEXT_ID)) - assert len(response.services) == 0 - - -def test_devices_bootstraping( - context_client : ContextClient, device_client : DeviceClient): # pylint: disable=redefined-outer-name - - # ----- Start the EventsCollector ---------------------------------------------------------------------------------- - events_collector = EventsCollector(context_client, log_events_received=True) - events_collector.start() - - expected_events = [] - - # ----- Create Devices and Validate Collected Events --------------------------------------------------------------- - for device, connect_rules in DEVICES: - device_uuid = device['device_id']['device_uuid']['uuid'] - LOGGER.info('Adding Device {:s}'.format(device_uuid)) - - device_with_connect_rules = copy.deepcopy(device) - device_with_connect_rules['device_config']['config_rules'].extend(connect_rules) - response = device_client.AddDevice(Device(**device_with_connect_rules)) - assert response.device_uuid.uuid == device_uuid - - expected_events.extend([ - # Device creation, update for automation to start the device - ('DeviceEvent', EVENT_CREATE, json_device_id(device_uuid)), - #('DeviceEvent', EVENT_UPDATE, json_device_id(device_uuid)), - ]) - - #response = context_client.GetDevice(response) - #for endpoint in response.device_endpoints: - # for _ in endpoint.kpi_sample_types: - # # Monitoring configures monitoring for endpoint - # expected_events.append(('DeviceEvent', EVENT_UPDATE, json_device_id(device_uuid))) - - # ----- Validate Collected Events ---------------------------------------------------------------------------------- - check_events(events_collector, expected_events) - - # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- - events_collector.stop() - - -def test_devices_bootstrapped(context_client : ContextClient): # pylint: disable=redefined-outer-name - # ----- List entities - Ensure bevices are created ----------------------------------------------------------------- - response = context_client.ListContexts(Empty()) - assert len(response.contexts) == len(CONTEXTS) - - response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) - assert len(response.topologies) == len(TOPOLOGIES) - - response = context_client.ListDevices(Empty()) - assert len(response.devices) == len(DEVICES) - - response = context_client.ListLinks(Empty()) - assert len(response.links) == 0 - - response = context_client.ListServices(ContextId(**CONTEXT_ID)) - assert len(response.services) == 0 - - -def test_links_creation(context_client : ContextClient): # pylint: disable=redefined-outer-name - - # ----- Start the EventsCollector ---------------------------------------------------------------------------------- - events_collector = EventsCollector(context_client) - events_collector.start() - - expected_events = [] - - # ----- Create Links and Validate Collected Events ----------------------------------------------------------------- - for link in LINKS: - link_uuid = link['link_id']['link_uuid']['uuid'] - LOGGER.info('Adding Link {:s}'.format(link_uuid)) - response = context_client.SetLink(Link(**link)) - assert response.link_uuid.uuid == link_uuid - expected_events.append(('LinkEvent', EVENT_CREATE, json_link_id(link_uuid))) - - # ----- Validate Collected Events ---------------------------------------------------------------------------------- - check_events(events_collector, expected_events) - - # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- - events_collector.stop() - - -def test_links_created(context_client : ContextClient): # pylint: disable=redefined-outer-name - # ----- List entities - Ensure links are created ------------------------------------------------------------------- - response = context_client.ListContexts(Empty()) - assert len(response.contexts) == len(CONTEXTS) - - response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) - assert len(response.topologies) == len(TOPOLOGIES) - + assert len(response.links) == descriptor_loader.num_links + + for context_uuid, _ in descriptor_loader.num_services.items(): + response = context_client.ListServices(ContextId(**json_context_id(context_uuid))) + assert len(response.services) == 0 + + for context_uuid, _ in descriptor_loader.num_slices.items(): + response = context_client.ListSlices(ContextId(**json_context_id(context_uuid))) + assert len(response.slices) == 0 + + # This scenario assumes no services are created beforehand + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.service_ids) == 0 + assert len(response.slice_ids) == 0 + + +def test_scenario_kpis_created( + context_client : ContextClient, # pylint: disable=redefined-outer-name + monitoring_client: MonitoringClient, # pylint: disable=redefined-outer-name +) -> None: + """ + This test validates that KPIs related to the service/device/endpoint were created + during the service creation process. + """ response = context_client.ListDevices(Empty()) - assert len(response.devices) == len(DEVICES) - - response = context_client.ListLinks(Empty()) - assert len(response.links) == len(LINKS) - - response = context_client.ListServices(ContextId(**CONTEXT_ID)) - assert len(response.services) == 0 + kpis_expected = set() + for device in response.devices: + device_uuid = device.device_id.device_uuid.uuid + for endpoint in device.device_endpoints: + endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid + for kpi_sample_type in endpoint.kpi_sample_types: + kpis_expected.add((device_uuid, endpoint_uuid, kpi_sample_type)) + num_kpis_expected = len(kpis_expected) + LOGGER.info('Num KPIs expected: {:d}'.format(num_kpis_expected)) + + num_kpis_created, num_retry = 0, 0 + while (num_kpis_created != num_kpis_expected) and (num_retry < 5): + response: KpiDescriptorList = monitoring_client.GetKpiDescriptorList(Empty()) + num_kpis_created = len(response.kpi_descriptor_list) + LOGGER.info('Num KPIs created: {:d}'.format(num_kpis_created)) + time.sleep(0.5) + num_retry += 1 + assert num_kpis_created == num_kpis_expected diff --git a/src/tests/ofc22/tests/test_functional_cleanup.py b/src/tests/ofc22/tests/test_functional_cleanup.py index eb78a585079e3ee757a836433bf23423a3ad899d..d38b653b226639d5c8c831872a64ea1f9140ef8f 100644 --- a/src/tests/ofc22/tests/test_functional_cleanup.py +++ b/src/tests/ofc22/tests/test_functional_cleanup.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,106 +12,73 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging, pytest -from common.Settings import get_setting -from common.tests.EventTools import EVENT_REMOVE, check_events +import logging +from common.Constants import DEFAULT_CONTEXT_NAME +from common.proto.context_pb2 import ContextId, DeviceId, Empty, LinkId, TopologyId +from common.tools.descriptor.Loader import DescriptorLoader 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.Link import json_link_id -from common.tools.object_factory.Topology import json_topology_id from context.client.ContextClient import ContextClient -from context.client.EventsCollector import EventsCollector -from context.proto.context_pb2 import ContextId, DeviceId, Empty, LinkId, TopologyId from device.client.DeviceClient import DeviceClient -from .Objects import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES +from tests.Fixtures import context_client, device_client # pylint: disable=unused-import LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.DEBUG) +DESCRIPTOR_FILE = 'ofc22/descriptors_emulated.json' +ADMIN_CONTEXT_ID = ContextId(**json_context_id(DEFAULT_CONTEXT_NAME)) -@pytest.fixture(scope='session') -def context_client(): - _client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) - yield _client - _client.close() - - -@pytest.fixture(scope='session') -def device_client(): - _client = DeviceClient(get_setting('DEVICESERVICE_SERVICE_HOST'), get_setting('DEVICESERVICE_SERVICE_PORT_GRPC')) - yield _client - _client.close() +def test_services_removed( + context_client : ContextClient, # pylint: disable=redefined-outer-name + device_client : DeviceClient, # pylint: disable=redefined-outer-name +) -> None: + # ----- List entities - Ensure service is removed ------------------------------------------------------------------ + with open(DESCRIPTOR_FILE, 'r', encoding='UTF-8') as f: + descriptors = f.read() + descriptor_loader = DescriptorLoader(descriptors) -def test_services_removed(context_client : ContextClient): # pylint: disable=redefined-outer-name - # ----- List entities - Ensure service is removed ------------------------------------------------------------------ response = context_client.ListContexts(Empty()) - assert len(response.contexts) == len(CONTEXTS) + assert len(response.contexts) == descriptor_loader.num_contexts - response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) - assert len(response.topologies) == len(TOPOLOGIES) + for context_uuid, num_topologies in descriptor_loader.num_topologies.items(): + response = context_client.ListTopologies(ContextId(**json_context_id(context_uuid))) + assert len(response.topologies) == num_topologies response = context_client.ListDevices(Empty()) - assert len(response.devices) == len(DEVICES) + assert len(response.devices) == descriptor_loader.num_devices response = context_client.ListLinks(Empty()) - assert len(response.links) == len(LINKS) - - response = context_client.ListServices(ContextId(**CONTEXT_ID)) - assert len(response.services) == 0 - - -def test_scenario_cleanup( - context_client : ContextClient, device_client : DeviceClient): # pylint: disable=redefined-outer-name - - # ----- Start the EventsCollector ---------------------------------------------------------------------------------- - events_collector = EventsCollector(context_client) - events_collector.start() - - expected_events = [] - - # ----- Delete Links and Validate Collected Events ----------------------------------------------------------------- - for link in LINKS: - link_id = link['link_id'] - link_uuid = link_id['link_uuid']['uuid'] - LOGGER.info('Deleting Link {:s}'.format(link_uuid)) - context_client.RemoveLink(LinkId(**link_id)) - expected_events.append(('LinkEvent', EVENT_REMOVE, json_link_id(link_uuid))) - - # ----- Delete Devices and Validate Collected Events --------------------------------------------------------------- - for device, _ in DEVICES: - device_id = device['device_id'] - device_uuid = device_id['device_uuid']['uuid'] - LOGGER.info('Deleting Device {:s}'.format(device_uuid)) - device_client.DeleteDevice(DeviceId(**device_id)) - expected_events.append(('DeviceEvent', EVENT_REMOVE, json_device_id(device_uuid))) - - # ----- Delete Topologies and Validate Collected Events ------------------------------------------------------------ - for topology in TOPOLOGIES: - topology_id = topology['topology_id'] - context_uuid = topology_id['context_id']['context_uuid']['uuid'] - topology_uuid = topology_id['topology_uuid']['uuid'] - LOGGER.info('Deleting Topology {:s}/{:s}'.format(context_uuid, topology_uuid)) - context_client.RemoveTopology(TopologyId(**topology_id)) - context_id = json_context_id(context_uuid) - expected_events.append(('TopologyEvent', EVENT_REMOVE, json_topology_id(topology_uuid, context_id=context_id))) - - # ----- Delete Contexts and Validate Collected Events -------------------------------------------------------------- - for context in CONTEXTS: - context_id = context['context_id'] - context_uuid = context_id['context_uuid']['uuid'] - LOGGER.info('Deleting Context {:s}'.format(context_uuid)) - context_client.RemoveContext(ContextId(**context_id)) - expected_events.append(('ContextEvent', EVENT_REMOVE, json_context_id(context_uuid))) - - # ----- Validate Collected Events ---------------------------------------------------------------------------------- - check_events(events_collector, expected_events) - - # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- - events_collector.stop() - - -def test_scenario_empty_again(context_client : ContextClient): # pylint: disable=redefined-outer-name + assert len(response.links) == descriptor_loader.num_links + + for context_uuid, _ in descriptor_loader.num_services.items(): + response = context_client.ListServices(ContextId(**json_context_id(context_uuid))) + assert len(response.services) == 0 + + for context_uuid, _ in descriptor_loader.num_slices.items(): + response = context_client.ListSlices(ContextId(**json_context_id(context_uuid))) + assert len(response.slices) == 0 + + # This scenario assumes no services are created beforehand + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.service_ids) == 0 + assert len(response.slice_ids) == 0 + + + # ----- Delete Links, Devices, Topologies, Contexts ---------------------------------------------------------------- + for link in descriptor_loader.links: + context_client.RemoveLink(LinkId(**link['link_id'])) + + for device in descriptor_loader.devices: + device_client .DeleteDevice(DeviceId(**device['device_id'])) + + for context_uuid, topology_list in descriptor_loader.topologies.items(): + for topology in topology_list: + context_client.RemoveTopology(TopologyId(**topology['topology_id'])) + + for context in descriptor_loader.contexts: + context_client.RemoveContext(ContextId(**context['context_id'])) + + # ----- List entities - Ensure database is empty again ------------------------------------------------------------- response = context_client.ListContexts(Empty()) assert len(response.contexts) == 0 diff --git a/src/tests/ofc22/tests/test_functional_create_service.py b/src/tests/ofc22/tests/test_functional_create_service.py index f3389fdbfce4e9262ffddbad876bb86f9b300551..92e0a74f9d291ea49422580fbdfad2c354aeeee2 100644 --- a/src/tests/ofc22/tests/test_functional_create_service.py +++ b/src/tests/ofc22/tests/test_functional_create_service.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,118 +12,126 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging, pytest -from common.DeviceTypes import DeviceTypeEnum -from common.Settings import get_setting -from common.tests.EventTools import EVENT_CREATE, EVENT_UPDATE, check_events -from common.tools.object_factory.Connection import json_connection_id -from common.tools.object_factory.Device import json_device_id -from common.tools.object_factory.Service import json_service_id +import logging, random +from common.Constants import DEFAULT_CONTEXT_NAME +from common.proto.context_pb2 import ContextId, Empty, ServiceTypeEnum +from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.tools.descriptor.Loader import DescriptorLoader from common.tools.grpc.Tools import grpc_message_to_json_string -from compute.tests.mock_osm.MockOSM import MockOSM +from common.tools.object_factory.Context import json_context_id from context.client.ContextClient import ContextClient -from context.client.EventsCollector import EventsCollector -from context.proto.context_pb2 import ContextId, Empty -from .Objects import ( - CONTEXT_ID, CONTEXTS, DEVICE_O1_UUID, DEVICE_R1_UUID, DEVICE_R3_UUID, DEVICES, LINKS, TOPOLOGIES, - WIM_MAPPING, WIM_PASSWORD, WIM_SERVICE_CONNECTION_POINTS, WIM_SERVICE_TYPE, WIM_USERNAME) +from monitoring.client.MonitoringClient import MonitoringClient +from tests.Fixtures import context_client, device_client, monitoring_client # pylint: disable=unused-import +from tests.tools.mock_osm.MockOSM import MockOSM +from .Fixtures import osm_wim # pylint: disable=unused-import +from .Objects import WIM_SERVICE_CONNECTION_POINTS, WIM_SERVICE_TYPE LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.DEBUG) -DEVTYPE_EMU_PR = DeviceTypeEnum.EMULATED_PACKET_ROUTER.value -DEVTYPE_EMU_OLS = DeviceTypeEnum.EMULATED_OPTICAL_LINE_SYSTEM.value +DESCRIPTOR_FILE = 'ofc22/descriptors_emulated.json' +ADMIN_CONTEXT_ID = ContextId(**json_context_id(DEFAULT_CONTEXT_NAME)) +def test_service_creation(context_client : ContextClient, osm_wim : MockOSM): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure scenario is ready ------------------------------------------------------------------- + with open(DESCRIPTOR_FILE, 'r', encoding='UTF-8') as f: + descriptors = f.read() -@pytest.fixture(scope='session') -def context_client(): - _client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) - yield _client - _client.close() - - -@pytest.fixture(scope='session') -def osm_wim(): - wim_url = 'http://{:s}:{:s}'.format( - get_setting('COMPUTESERVICE_SERVICE_HOST'), str(get_setting('COMPUTESERVICE_SERVICE_PORT_HTTP'))) - return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) - + descriptor_loader = DescriptorLoader(descriptors) -def test_scenario_is_correct(context_client : ContextClient): # pylint: disable=redefined-outer-name - # ----- List entities - Ensure links are created ------------------------------------------------------------------- response = context_client.ListContexts(Empty()) - assert len(response.contexts) == len(CONTEXTS) + assert len(response.contexts) == descriptor_loader.num_contexts - response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) - assert len(response.topologies) == len(TOPOLOGIES) + for context_uuid, num_topologies in descriptor_loader.num_topologies.items(): + response = context_client.ListTopologies(ContextId(**json_context_id(context_uuid))) + assert len(response.topologies) == num_topologies response = context_client.ListDevices(Empty()) - assert len(response.devices) == len(DEVICES) + assert len(response.devices) == descriptor_loader.num_devices response = context_client.ListLinks(Empty()) - assert len(response.links) == len(LINKS) + assert len(response.links) == descriptor_loader.num_links - response = context_client.ListServices(ContextId(**CONTEXT_ID)) - assert len(response.services) == 0 + for context_uuid, num_services in descriptor_loader.num_services.items(): + response = context_client.ListServices(ContextId(**json_context_id(context_uuid))) + assert len(response.services) == num_services + for context_uuid, num_slices in descriptor_loader.num_slices.items(): + response = context_client.ListSlices(ContextId(**json_context_id(context_uuid))) + assert len(response.slices) == num_slices + + # This scenario assumes no services are created beforehand + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.service_ids) == 0 + assert len(response.slice_ids) == 0 -def test_service_creation(context_client : ContextClient, osm_wim : MockOSM): # pylint: disable=redefined-outer-name - # ----- Start the EventsCollector ---------------------------------------------------------------------------------- - events_collector = EventsCollector(context_client, log_events_received=True) - events_collector.start() # ----- Create Service --------------------------------------------------------------------------------------------- service_uuid = osm_wim.create_connectivity_service(WIM_SERVICE_TYPE, WIM_SERVICE_CONNECTION_POINTS) osm_wim.get_connectivity_service_status(service_uuid) - # ----- Validate collected events ---------------------------------------------------------------------------------- - - packet_connection_uuid = '{:s}:{:s}'.format(service_uuid, DEVTYPE_EMU_PR) - optical_connection_uuid = '{:s}:optical:{:s}'.format(service_uuid, DEVTYPE_EMU_OLS) - optical_service_uuid = '{:s}:optical'.format(service_uuid) - expected_events = [ - # Create packet service and add first endpoint - ('ServiceEvent', EVENT_CREATE, json_service_id(service_uuid, context_id=CONTEXT_ID)), - ('ServiceEvent', EVENT_UPDATE, json_service_id(service_uuid, context_id=CONTEXT_ID)), - - # Configure OLS controller, create optical service, create optical connection - ('DeviceEvent', EVENT_UPDATE, json_device_id(DEVICE_O1_UUID)), - ('ServiceEvent', EVENT_CREATE, json_service_id(optical_service_uuid, context_id=CONTEXT_ID)), - ('ConnectionEvent', EVENT_CREATE, json_connection_id(optical_connection_uuid)), - - # Configure endpoint packet devices, add second endpoint to service, create connection - ('DeviceEvent', EVENT_UPDATE, json_device_id(DEVICE_R1_UUID)), - ('DeviceEvent', EVENT_UPDATE, json_device_id(DEVICE_R3_UUID)), - ('ServiceEvent', EVENT_UPDATE, json_service_id(service_uuid, context_id=CONTEXT_ID)), - ('ConnectionEvent', EVENT_CREATE, json_connection_id(packet_connection_uuid)), - ] - check_events(events_collector, expected_events) - - # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- - events_collector.stop() - - -def test_scenario_service_created(context_client : ContextClient): # pylint: disable=redefined-outer-name # ----- List entities - Ensure service is created ------------------------------------------------------------------ response = context_client.ListContexts(Empty()) - assert len(response.contexts) == len(CONTEXTS) + assert len(response.contexts) == descriptor_loader.num_contexts - response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) - assert len(response.topologies) == len(TOPOLOGIES) + for context_uuid, num_topologies in descriptor_loader.num_topologies.items(): + response = context_client.ListTopologies(ContextId(**json_context_id(context_uuid))) + assert len(response.topologies) == num_topologies response = context_client.ListDevices(Empty()) - assert len(response.devices) == len(DEVICES) + assert len(response.devices) == descriptor_loader.num_devices response = context_client.ListLinks(Empty()) - assert len(response.links) == len(LINKS) + assert len(response.links) == descriptor_loader.num_links - response = context_client.ListServices(ContextId(**CONTEXT_ID)) + response = context_client.ListServices(ADMIN_CONTEXT_ID) LOGGER.info('Services[{:d}] = {:s}'.format(len(response.services), grpc_message_to_json_string(response))) - assert len(response.services) == 2 # L3NM + TAPI + assert len(response.services) == 2 # OLS & L3NM => (L3NM + TAPI) + for service in response.services: service_id = service.service_id response = context_client.ListConnections(service_id) LOGGER.info(' ServiceId[{:s}] => Connections[{:d}] = {:s}'.format( grpc_message_to_json_string(service_id), len(response.connections), grpc_message_to_json_string(response))) - assert len(response.connections) == 1 # one connection per service + + if service.service_type == ServiceTypeEnum.SERVICETYPE_L3NM: + assert len(response.connections) == 1 # 1 connection per service + elif service.service_type == ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE: + assert len(response.connections) == 1 # 1 connection per service + else: + str_service = grpc_message_to_json_string(service) + raise Exception('Unexpected ServiceType: {:s}'.format(str_service)) + + + +def test_scenario_kpi_values_created( + monitoring_client: MonitoringClient, # pylint: disable=redefined-outer-name +) -> None: + """ + This test validates that KPI values have been inserted into the monitoring database. + We short k KPI descriptors to test. + """ + response = monitoring_client.GetKpiDescriptorList(Empty()) + kpi_descriptors = random.choices(response.kpi_descriptor_list, k=2) + + for kpi_descriptor in kpi_descriptors: + MSG = 'KPI(kpi_uuid={:s}, device_uuid={:s}, endpoint_uuid={:s}, service_uuid={:s}, kpi_sample_type={:s})...' + LOGGER.info(MSG.format( + str(kpi_descriptor.kpi_id.kpi_id.uuid), str(kpi_descriptor.device_id.device_uuid.uuid), + str(kpi_descriptor.endpoint_id.endpoint_uuid.uuid), str(kpi_descriptor.service_id.service_uuid.uuid), + str(KpiSampleType.Name(kpi_descriptor.kpi_sample_type)))) + response = monitoring_client.GetInstantKpi(kpi_descriptor.kpi_id) + kpi_uuid = response.kpi_id.kpi_id.uuid + assert kpi_uuid == kpi_descriptor.kpi_id.kpi_id.uuid + kpi_value_type = response.kpi_value.WhichOneof('value') + if kpi_value_type is None: + MSG = ' KPI({:s}): No instant value found' + LOGGER.warning(MSG.format(str(kpi_uuid))) + else: + kpi_timestamp = response.timestamp.timestamp + assert kpi_timestamp > 0 + assert kpi_value_type == 'floatVal' + kpi_value = getattr(response.kpi_value, kpi_value_type) + MSG = ' KPI({:s}): timestamp={:s} value_type={:s} value={:s}' + LOGGER.info(MSG.format(str(kpi_uuid), str(kpi_timestamp), str(kpi_value_type), str(kpi_value))) diff --git a/src/tests/ofc22/tests/test_functional_create_service_xr.py b/src/tests/ofc22/tests/test_functional_create_service_xr.py new file mode 100644 index 0000000000000000000000000000000000000000..435098589d0e56dd9d1c6baaec1a0ce23dda3354 --- /dev/null +++ b/src/tests/ofc22/tests/test_functional_create_service_xr.py @@ -0,0 +1,129 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging, pytest +from common.DeviceTypes import DeviceTypeEnum +from common.Settings import get_setting +from common.tests.EventTools import EVENT_CREATE, EVENT_UPDATE, check_events +from common.tools.object_factory.Connection import json_connection_id +from common.tools.object_factory.Device import json_device_id +from common.tools.object_factory.Service import json_service_id +from common.tools.grpc.Tools import grpc_message_to_json_string +from tests.tools.mock_osm.MockOSM import MockOSM +from context.client.ContextClient import ContextClient +from context.client.EventsCollector import EventsCollector +from common.proto.context_pb2 import ContextId, Empty +from .ObjectsXr import ( + CONTEXT_ID, CONTEXTS, DEVICE_X1_UUID, DEVICE_R1_UUID, DEVICE_R3_UUID, DEVICES, LINKS, TOPOLOGIES, + WIM_MAPPING, WIM_PASSWORD, WIM_SERVICE_CONNECTION_POINTS, WIM_SERVICE_TYPE, WIM_USERNAME) + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DEVTYPE_EMU_PR = DeviceTypeEnum.EMULATED_PACKET_ROUTER.value +DEVTYPE_XR_CONSTELLATION = DeviceTypeEnum.XR_CONSTELLATION.value + + +@pytest.fixture(scope='session') +def context_client(): + _client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def osm_wim(): + wim_url = 'http://{:s}:{:s}'.format( + get_setting('COMPUTESERVICE_SERVICE_HOST'), str(get_setting('COMPUTESERVICE_SERVICE_PORT_HTTP'))) + return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) + + +def test_scenario_is_correct(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure links are created ------------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(CONTEXTS) + + response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) + assert len(response.topologies) == len(TOPOLOGIES) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(DEVICES) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(LINKS) + + response = context_client.ListServices(ContextId(**CONTEXT_ID)) + assert len(response.services) == 0 + + +def test_service_creation(context_client : ContextClient, osm_wim : MockOSM): # pylint: disable=redefined-outer-name + # ----- Start the EventsCollector ---------------------------------------------------------------------------------- + # events_collector = EventsCollector(context_client, log_events_received=True) + # events_collector.start() + + # ----- Create Service --------------------------------------------------------------------------------------------- + service_uuid = osm_wim.create_connectivity_service(WIM_SERVICE_TYPE, WIM_SERVICE_CONNECTION_POINTS) + osm_wim.get_connectivity_service_status(service_uuid) + + # ----- Validate collected events ---------------------------------------------------------------------------------- + + # packet_connection_uuid = '{:s}:{:s}'.format(service_uuid, DEVTYPE_EMU_PR) + # optical_connection_uuid = '{:s}:optical:{:s}'.format(service_uuid, DEVTYPE_XR_CONSTELLATION) + # optical_service_uuid = '{:s}:optical'.format(service_uuid) + + # expected_events = [ + # # Create packet service and add first endpoint + # ('ServiceEvent', EVENT_CREATE, json_service_id(service_uuid, context_id=CONTEXT_ID)), + # ('ServiceEvent', EVENT_UPDATE, json_service_id(service_uuid, context_id=CONTEXT_ID)), + + # # Configure OLS controller, create optical service, create optical connection + # ('DeviceEvent', EVENT_UPDATE, json_device_id(DEVICE_X1_UUID)), + # ('ServiceEvent', EVENT_CREATE, json_service_id(optical_service_uuid, context_id=CONTEXT_ID)), + # ('ConnectionEvent', EVENT_CREATE, json_connection_id(optical_connection_uuid)), + + # # Configure endpoint packet devices, add second endpoint to service, create connection + # ('DeviceEvent', EVENT_UPDATE, json_device_id(DEVICE_R1_UUID)), + # ('DeviceEvent', EVENT_UPDATE, json_device_id(DEVICE_R3_UUID)), + # ('ServiceEvent', EVENT_UPDATE, json_service_id(service_uuid, context_id=CONTEXT_ID)), + # ('ConnectionEvent', EVENT_CREATE, json_connection_id(packet_connection_uuid)), + # ] + # check_events(events_collector, expected_events) + + # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- + # events_collector.stop() + + +def test_scenario_service_created(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure service is created ------------------------------------------------------------------ + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(CONTEXTS) + + response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) + assert len(response.topologies) == len(TOPOLOGIES) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(DEVICES) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(LINKS) + + response = context_client.ListServices(ContextId(**CONTEXT_ID)) + LOGGER.info('Services[{:d}] = {:s}'.format(len(response.services), grpc_message_to_json_string(response))) + assert len(response.services) == 2 # L3NM + TAPI + for service in response.services: + service_id = service.service_id + response = context_client.ListConnections(service_id) + LOGGER.info(' ServiceId[{:s}] => Connections[{:d}] = {:s}'.format( + grpc_message_to_json_string(service_id), len(response.connections), grpc_message_to_json_string(response))) + assert len(response.connections) == 1 # one connection per service diff --git a/src/tests/ofc22/tests/test_functional_delete_service.py b/src/tests/ofc22/tests/test_functional_delete_service.py index 51e91a5967e1696fa2fdfe7dd06d2efb46642248..1811f219acf13b5cc17daf39f1931a6f630f997b 100644 --- a/src/tests/ofc22/tests/test_functional_delete_service.py +++ b/src/tests/ofc22/tests/test_functional_delete_service.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,123 +12,100 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging, pytest -from common.DeviceTypes import DeviceTypeEnum -from common.Settings import get_setting -from common.tests.EventTools import EVENT_REMOVE, EVENT_UPDATE, check_events -from common.tools.object_factory.Connection import json_connection_id -from common.tools.object_factory.Device import json_device_id -from common.tools.object_factory.Service import json_service_id +import logging +from common.Constants import DEFAULT_CONTEXT_NAME +from common.proto.context_pb2 import ContextId, Empty, ServiceTypeEnum +from common.tools.descriptor.Loader import DescriptorLoader +from common.tools.object_factory.Context import json_context_id from common.tools.grpc.Tools import grpc_message_to_json_string -from compute.tests.mock_osm.MockOSM import MockOSM from context.client.ContextClient import ContextClient -from context.client.EventsCollector import EventsCollector -from context.proto.context_pb2 import ContextId, Empty -from .Objects import ( - CONTEXT_ID, CONTEXTS, DEVICE_O1_UUID, DEVICE_R1_UUID, DEVICE_R3_UUID, DEVICES, LINKS, TOPOLOGIES, WIM_MAPPING, - WIM_PASSWORD, WIM_USERNAME) - +from tests.Fixtures import context_client # pylint: disable=unused-import +from tests.tools.mock_osm.MockOSM import MockOSM +from .Fixtures import osm_wim # pylint: disable=unused-import LOGGER = logging.getLogger(__name__) LOGGER.setLevel(logging.DEBUG) -DEVTYPE_EMU_PR = DeviceTypeEnum.EMULATED_PACKET_ROUTER.value -DEVTYPE_EMU_OLS = DeviceTypeEnum.EMULATED_OPTICAL_LINE_SYSTEM.value - - -@pytest.fixture(scope='session') -def context_client(): - _client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) - yield _client - _client.close() +DESCRIPTOR_FILE = 'ofc22/descriptors_emulated.json' +ADMIN_CONTEXT_ID = ContextId(**json_context_id(DEFAULT_CONTEXT_NAME)) +def test_service_removal(context_client : ContextClient, osm_wim : MockOSM): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure service is created ------------------------------------------------------------------ + with open(DESCRIPTOR_FILE, 'r', encoding='UTF-8') as f: + descriptors = f.read() -@pytest.fixture(scope='session') -def osm_wim(): - wim_url = 'http://{:s}:{:s}'.format( - get_setting('COMPUTESERVICE_SERVICE_HOST'), str(get_setting('COMPUTESERVICE_SERVICE_PORT_HTTP'))) - return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) - + descriptor_loader = DescriptorLoader(descriptors) -def test_scenario_is_correct(context_client : ContextClient): # pylint: disable=redefined-outer-name - # ----- List entities - Ensure service is created ------------------------------------------------------------------ response = context_client.ListContexts(Empty()) - assert len(response.contexts) == len(CONTEXTS) + assert len(response.contexts) == descriptor_loader.num_contexts - response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) - assert len(response.topologies) == len(TOPOLOGIES) + for context_uuid, num_topologies in descriptor_loader.num_topologies.items(): + response = context_client.ListTopologies(ContextId(**json_context_id(context_uuid))) + assert len(response.topologies) == num_topologies response = context_client.ListDevices(Empty()) - assert len(response.devices) == len(DEVICES) + assert len(response.devices) == descriptor_loader.num_devices response = context_client.ListLinks(Empty()) - assert len(response.links) == len(LINKS) + assert len(response.links) == descriptor_loader.num_links - response = context_client.ListServices(ContextId(**CONTEXT_ID)) + service_uuids = set() + response = context_client.ListServices(ADMIN_CONTEXT_ID) LOGGER.info('Services[{:d}] = {:s}'.format(len(response.services), grpc_message_to_json_string(response))) - assert len(response.services) == 2 # L3NM + TAPI + assert len(response.services) == 2 # OLS & L3NM => (L3NM + TAPI) + for service in response.services: service_id = service.service_id + + if service.service_type == ServiceTypeEnum.SERVICETYPE_L3NM: + service_uuid = service_id.service_uuid.uuid + service_uuids.add(service_uuid) + osm_wim.conn_info[service_uuid] = {} + response = context_client.ListConnections(service_id) LOGGER.info(' ServiceId[{:s}] => Connections[{:d}] = {:s}'.format( grpc_message_to_json_string(service_id), len(response.connections), grpc_message_to_json_string(response))) - assert len(response.connections) == 1 # one connection per service + if service.service_type == ServiceTypeEnum.SERVICETYPE_L3NM: + assert len(response.connections) == 1 # 1 connection per service + elif service.service_type == ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE: + assert len(response.connections) == 1 # 1 connection per service + else: + str_service = grpc_message_to_json_string(service) + raise Exception('Unexpected ServiceType: {:s}'.format(str_service)) -def test_service_removal(context_client : ContextClient, osm_wim : MockOSM): # pylint: disable=redefined-outer-name - # ----- Start the EventsCollector ---------------------------------------------------------------------------------- - events_collector = EventsCollector(context_client, log_events_received=True) - events_collector.start() - - # ----- Delete Service --------------------------------------------------------------------------------------------- - response = context_client.ListServiceIds(ContextId(**CONTEXT_ID)) - LOGGER.info('Services[{:d}] = {:s}'.format(len(response.service_ids), grpc_message_to_json_string(response))) - assert len(response.service_ids) == 2 # L3NM + TAPI - service_uuids = set() - for service_id in response.service_ids: - service_uuid = service_id.service_uuid.uuid - if service_uuid.endswith(':optical'): continue - service_uuids.add(service_uuid) - osm_wim.conn_info[service_uuid] = {} - - assert len(service_uuids) == 1 # assume a single service has been created + # Identify service to delete + assert len(service_uuids) == 1 # assume a single L3NM service has been created service_uuid = set(service_uuids).pop() - osm_wim.delete_connectivity_service(service_uuid) - - # ----- Validate collected events ---------------------------------------------------------------------------------- - packet_connection_uuid = '{:s}:{:s}'.format(service_uuid, DEVTYPE_EMU_PR) - optical_connection_uuid = '{:s}:optical:{:s}'.format(service_uuid, DEVTYPE_EMU_OLS) - optical_service_uuid = '{:s}:optical'.format(service_uuid) - expected_events = [ - ('ConnectionEvent', EVENT_REMOVE, json_connection_id(packet_connection_uuid)), - ('DeviceEvent', EVENT_UPDATE, json_device_id(DEVICE_R1_UUID)), - ('DeviceEvent', EVENT_UPDATE, json_device_id(DEVICE_R3_UUID)), - ('ServiceEvent', EVENT_REMOVE, json_service_id(service_uuid, context_id=CONTEXT_ID)), - ('ConnectionEvent', EVENT_REMOVE, json_connection_id(optical_connection_uuid)), - ('DeviceEvent', EVENT_UPDATE, json_device_id(DEVICE_O1_UUID)), - ('ServiceEvent', EVENT_REMOVE, json_service_id(optical_service_uuid, context_id=CONTEXT_ID)), - ] - check_events(events_collector, expected_events) - - # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- - events_collector.stop() + # ----- Delete Service --------------------------------------------------------------------------------------------- + osm_wim.delete_connectivity_service(service_uuid) -def test_services_removed(context_client : ContextClient): # pylint: disable=redefined-outer-name # ----- List entities - Ensure service is removed ------------------------------------------------------------------ response = context_client.ListContexts(Empty()) - assert len(response.contexts) == len(CONTEXTS) + assert len(response.contexts) == descriptor_loader.num_contexts - response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) - assert len(response.topologies) == len(TOPOLOGIES) + for context_uuid, num_topologies in descriptor_loader.num_topologies.items(): + response = context_client.ListTopologies(ContextId(**json_context_id(context_uuid))) + assert len(response.topologies) == num_topologies response = context_client.ListDevices(Empty()) - assert len(response.devices) == len(DEVICES) + assert len(response.devices) == descriptor_loader.num_devices response = context_client.ListLinks(Empty()) - assert len(response.links) == len(LINKS) + assert len(response.links) == descriptor_loader.num_links + + for context_uuid, num_services in descriptor_loader.num_services.items(): + response = context_client.ListServices(ContextId(**json_context_id(context_uuid))) + assert len(response.services) == num_services + + for context_uuid, num_slices in descriptor_loader.num_slices.items(): + response = context_client.ListSlices(ContextId(**json_context_id(context_uuid))) + assert len(response.slices) == num_slices - response = context_client.ListServices(ContextId(**CONTEXT_ID)) - assert len(response.services) == 0 + # This scenario assumes no services are created beforehand + response = context_client.GetContext(ADMIN_CONTEXT_ID) + assert len(response.service_ids) == 0 + assert len(response.slice_ids) == 0 diff --git a/src/tests/ofc22/tests/test_functional_delete_service_xr.py b/src/tests/ofc22/tests/test_functional_delete_service_xr.py new file mode 100644 index 0000000000000000000000000000000000000000..6de788ebd91c25b576b44f95f60fe0340cd64881 --- /dev/null +++ b/src/tests/ofc22/tests/test_functional_delete_service_xr.py @@ -0,0 +1,133 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging, pytest +from common.DeviceTypes import DeviceTypeEnum +from common.Settings import get_setting +from common.tests.EventTools import EVENT_REMOVE, EVENT_UPDATE, check_events +from common.tools.object_factory.Connection import json_connection_id +from common.tools.object_factory.Device import json_device_id +from common.tools.object_factory.Service import json_service_id +from common.tools.grpc.Tools import grpc_message_to_json_string +from tests.tools.mock_osm.MockOSM import MockOSM +from context.client.ContextClient import ContextClient +from context.client.EventsCollector import EventsCollector +from common.proto.context_pb2 import ContextId, Empty, ServiceTypeEnum +from .ObjectsXr import ( + CONTEXT_ID, CONTEXTS, DEVICE_X1_UUID, DEVICE_R1_UUID, DEVICE_R3_UUID, DEVICES, LINKS, TOPOLOGIES, WIM_MAPPING, + WIM_PASSWORD, WIM_USERNAME) + + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +DEVTYPE_EMU_PR = DeviceTypeEnum.EMULATED_PACKET_ROUTER.value +DEVTYPE_XR_CONSTELLATION = DeviceTypeEnum.XR_CONSTELLATION.value + +@pytest.fixture(scope='session') +def context_client(): + _client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def osm_wim(): + wim_url = 'http://{:s}:{:s}'.format( + get_setting('COMPUTESERVICE_SERVICE_HOST'), str(get_setting('COMPUTESERVICE_SERVICE_PORT_HTTP'))) + return MockOSM(wim_url, WIM_MAPPING, WIM_USERNAME, WIM_PASSWORD) + + +def test_scenario_is_correct(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure service is created ------------------------------------------------------------------ + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(CONTEXTS) + + response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) + assert len(response.topologies) == len(TOPOLOGIES) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(DEVICES) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(LINKS) + + response = context_client.ListServices(ContextId(**CONTEXT_ID)) + LOGGER.info('Services[{:d}] = {:s}'.format(len(response.services), grpc_message_to_json_string(response))) + assert len(response.services) == 2 # L3NM + TAPI + for service in response.services: + service_id = service.service_id + response = context_client.ListConnections(service_id) + LOGGER.info(' ServiceId[{:s}] => Connections[{:d}] = {:s}'.format( + grpc_message_to_json_string(service_id), len(response.connections), grpc_message_to_json_string(response))) + assert len(response.connections) == 1 # one connection per service + + +def test_service_removal(context_client : ContextClient, osm_wim : MockOSM): # pylint: disable=redefined-outer-name + # ----- Start the EventsCollector ---------------------------------------------------------------------------------- + events_collector = EventsCollector(context_client, log_events_received=True) + events_collector.start() + + # ----- Delete Service --------------------------------------------------------------------------------------------- + response = context_client.ListServices(ContextId(**CONTEXT_ID)) + LOGGER.info('Services[{:d}] = {:s}'.format(len(response.services), grpc_message_to_json_string(response))) + assert len(response.services) == 2 # L3NM + TAPI + service_uuids = set() + for service in response.services: + if service.service_type != ServiceTypeEnum.SERVICETYPE_L3NM: continue + service_uuid = service.service_id.service_uuid.uuid + service_uuids.add(service_uuid) + osm_wim.conn_info[service_uuid] = {} + + assert len(service_uuids) == 1 # assume a single service has been created + service_uuid = set(service_uuids).pop() + + osm_wim.delete_connectivity_service(service_uuid) + + # ----- Validate collected events ---------------------------------------------------------------------------------- + # packet_connection_uuid = '{:s}:{:s}'.format(service_uuid, DEVTYPE_EMU_PR) + # optical_connection_uuid = '{:s}:optical:{:s}'.format(service_uuid, DEVTYPE_XR_CONSTELLATION) + # optical_service_uuid = '{:s}:optical'.format(service_uuid) + + # expected_events = [ + # ('ConnectionEvent', EVENT_REMOVE, json_connection_id(packet_connection_uuid)), + # ('DeviceEvent', EVENT_UPDATE, json_device_id(DEVICE_R1_UUID)), + # ('DeviceEvent', EVENT_UPDATE, json_device_id(DEVICE_R3_UUID)), + # ('ServiceEvent', EVENT_REMOVE, json_service_id(service_uuid, context_id=CONTEXT_ID)), + # ('ConnectionEvent', EVENT_REMOVE, json_connection_id(optical_connection_uuid)), + # ('DeviceEvent', EVENT_UPDATE, json_device_id(DEVICE_X1_UUID)), + # ('ServiceEvent', EVENT_REMOVE, json_service_id(optical_service_uuid, context_id=CONTEXT_ID)), + # ] + # check_events(events_collector, expected_events) + + # ----- Stop the EventsCollector ----------------------------------------------------------------------------------- + # events_collector.stop() + + +def test_services_removed(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure service is removed ------------------------------------------------------------------ + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(CONTEXTS) + + response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) + assert len(response.topologies) == len(TOPOLOGIES) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(DEVICES) + + response = context_client.ListLinks(Empty()) + assert len(response.links) == len(LINKS) + + response = context_client.ListServices(ContextId(**CONTEXT_ID)) + assert len(response.services) == 0 diff --git a/src/tests/p4/__init__.py b/src/tests/p4/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/tests/p4/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/tests/p4/deploy_specs.sh b/src/tests/p4/deploy_specs.sh new file mode 100755 index 0000000000000000000000000000000000000000..b988123d5564684bd1bfcb776bab7f187fc628ca --- /dev/null +++ b/src/tests/p4/deploy_specs.sh @@ -0,0 +1,31 @@ +# 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. + +# Set the URL of your local Docker registry where the images will be uploaded to. +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" + +# Set the tag you want to use for your images. +export TFS_IMAGE_TAG="dev" + +# Set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE="tfs" + +# Set additional manifest files to be applied after the deployment +export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml" + +# Set the neew Grafana admin password +export TFS_GRAFANA_PASSWORD="admin123+" diff --git a/src/tests/p4/mininet/1switch1path.py b/src/tests/p4/mininet/1switch1path.py new file mode 100644 index 0000000000000000000000000000000000000000..466fb6a06e5b9ba8598614511c95ac4271d609e8 --- /dev/null +++ b/src/tests/p4/mininet/1switch1path.py @@ -0,0 +1,99 @@ +#!/usr/bin/python + +# 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. + +import argparse + +from mininet.cli import CLI +from mininet.log import setLogLevel +from mininet.net import Mininet +from mininet.node import Host +from mininet.topo import Topo +from stratum import StratumBmv2Switch + +CPU_PORT = 255 + +class IPv4Host(Host): + """Host that can be configured with an IPv4 gateway (default route). + """ + + def config(self, mac=None, ip=None, defaultRoute=None, lo='up', gw=None, + **_params): + super(IPv4Host, self).config(mac, ip, defaultRoute, lo, **_params) + self.cmd('ip -4 addr flush dev %s' % self.defaultIntf()) + self.cmd('ip -6 addr flush dev %s' % self.defaultIntf()) + self.cmd('ip -4 link set up %s' % self.defaultIntf()) + self.cmd('ip -4 addr add %s dev %s' % (ip, self.defaultIntf())) + if gw: + self.cmd('ip -4 route add default via %s' % gw) + # Disable offload + for attr in ["rx", "tx", "sg"]: + cmd = "/sbin/ethtool --offload %s %s off" % ( + self.defaultIntf(), attr) + self.cmd(cmd) + + def updateIP(): + return ip.split('/')[0] + + self.defaultIntf().updateIP = updateIP + +class TutorialTopo(Topo): + """Basic Server-Client topology with IPv4 hosts""" + + def __init__(self, *args, **kwargs): + Topo.__init__(self, *args, **kwargs) + + # Spines + # gRPC port 50001 + switch1 = self.addSwitch('switch1', cls=StratumBmv2Switch, cpuport=CPU_PORT) + + # IPv4 hosts attached to switch 1 + client = self.addHost('client', cls=IPv4Host, mac="aa:bb:cc:dd:ee:11", + ip='10.0.0.1/24', gw='10.0.0.100') +# client.sendCmd('arp -s 10.0.0.2 aa:bb:cc:dd:ee:22') +# client.setARP('10.0.0.2', 'aa:bb:cc:dd:ee:22') + server = self.addHost('server', cls=IPv4Host, mac="aa:bb:cc:dd:ee:22", + ip='10.0.0.2/24', gw='10.0.0.100') +# server.sendCmd('arp -s 10.0.0.1 aa:bb:cc:dd:ee:11') +# server.setARP('10.0.0.1', 'aa:bb:cc:dd:ee:11') + self.addLink(client, switch1) # port 1 + self.addLink(server, switch1) # port 2 + + +def main(): + net = Mininet(topo=TutorialTopo(), controller=None) + net.start() + client = net.hosts[0] + server = net.hosts[1] + client.setARP('10.0.0.2', 'aa:bb:cc:dd:ee:22') + server.setARP('10.0.0.1', 'aa:bb:cc:dd:ee:11') + CLI(net) + net.stop() + print '#' * 80 + print 'ATTENTION: Mininet was stopped! Perhaps accidentally?' + print 'No worries, it will restart automatically in a few seconds...' + print 'To access again the Mininet CLI, use `make mn-cli`' + print 'To detach from the CLI (without stopping), press Ctrl-D' + print 'To permanently quit Mininet, use `make stop`' + print '#' * 80 + + +if __name__ == "__main__": + parser = argparse.ArgumentParser( + description='Mininet topology script for 2x2 fabric with stratum_bmv2 and IPv4 hosts') + args = parser.parse_args() + setLogLevel('info') + + main() diff --git a/src/tests/p4/mininet/2switch1path.py b/src/tests/p4/mininet/2switch1path.py new file mode 100644 index 0000000000000000000000000000000000000000..91db70052a95dea9b53d24dabb25b0feaa9935cf --- /dev/null +++ b/src/tests/p4/mininet/2switch1path.py @@ -0,0 +1,99 @@ +#!/usr/bin/python + +# 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. + +import argparse + +from mininet.cli import CLI +from mininet.log import setLogLevel +from mininet.net import Mininet +from mininet.node import Host +from mininet.topo import Topo +from stratum import StratumBmv2Switch + +CPU_PORT = 255 + +class IPv4Host(Host): + """Host that can be configured with an IPv4 gateway (default route). + """ + + def config(self, mac=None, ip=None, defaultRoute=None, lo='up', gw=None, + **_params): + super(IPv4Host, self).config(mac, ip, defaultRoute, lo, **_params) + self.cmd('ip -4 addr flush dev %s' % self.defaultIntf()) + self.cmd('ip -6 addr flush dev %s' % self.defaultIntf()) + self.cmd('ip -4 link set up %s' % self.defaultIntf()) + self.cmd('ip -4 addr add %s dev %s' % (ip, self.defaultIntf())) + if gw: + self.cmd('ip -4 route add default via %s' % gw) + # Disable offload + for attr in ["rx", "tx", "sg"]: + cmd = "/sbin/ethtool --offload %s %s off" % ( + self.defaultIntf(), attr) + self.cmd(cmd) + + def updateIP(): + return ip.split('/')[0] + + self.defaultIntf().updateIP = updateIP + +class TutorialTopo(Topo): + """Basic Server-Client topology with IPv4 hosts""" + + def __init__(self, *args, **kwargs): + Topo.__init__(self, *args, **kwargs) + + # Spines + # gRPC port 50001 + switch1 = self.addSwitch('switch1', cls=StratumBmv2Switch, cpuport=CPU_PORT) + # gRPC port 50002 + switch2 = self.addSwitch('switch2', cls=StratumBmv2Switch, cpuport=CPU_PORT) + + # IPv4 hosts attached to switch 1 + client = self.addHost('client', cls=IPv4Host, mac="aa:bb:cc:dd:ee:11", + ip='10.0.0.1/24', gw='10.0.0.100') + server = self.addHost('server', cls=IPv4Host, mac="aa:bb:cc:dd:ee:22", + ip='10.0.0.2/24', gw='10.0.0.100') + self.addLink(client, switch1) # switch1: port 1 + self.addLink(switch1, switch2) # switch1: port 2 == switch2: port 1 + self.addLink(switch2, server) # switch2: port 2 + +def main(): + net = Mininet(topo=TutorialTopo(), controller=None) + net.start() + + client = net.hosts[0] + client.setARP('10.0.0.2', 'aa:bb:cc:dd:ee:22') + server = net.hosts[1] + server.setARP('10.0.0.1', 'aa:bb:cc:dd:ee:11') + + CLI(net) + net.stop() + print '#' * 80 + print 'ATTENTION: Mininet was stopped! Perhaps accidentally?' + print 'No worries, it will restart automatically in a few seconds...' + print 'To access again the Mininet CLI, use `make mn-cli`' + print 'To detach from the CLI (without stopping), press Ctrl-D' + print 'To permanently quit Mininet, use `make stop`' + print '#' * 80 + + +if __name__ == "__main__": + parser = argparse.ArgumentParser( + description='Mininet topology script for 2x2 fabric with stratum_bmv2 and IPv4 hosts') + args = parser.parse_args() + setLogLevel('info') + + main() diff --git a/src/tests/p4/mininet/4switch2path.py b/src/tests/p4/mininet/4switch2path.py new file mode 100644 index 0000000000000000000000000000000000000000..d8ad04b0193a2b9b610a4d5f828891e575d8efe8 --- /dev/null +++ b/src/tests/p4/mininet/4switch2path.py @@ -0,0 +1,110 @@ +#!/usr/bin/python + +# 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. + +import argparse + +from mininet.cli import CLI +from mininet.log import setLogLevel +from mininet.net import Mininet +from mininet.node import Host +from mininet.topo import Topo +from stratum import StratumBmv2Switch + +CPU_PORT = 255 + +class IPv4Host(Host): + """Host that can be configured with an IPv4 gateway (default route). + """ + + def config(self, mac=None, ip=None, defaultRoute=None, lo='up', gw=None, + **_params): + super(IPv4Host, self).config(mac, ip, defaultRoute, lo, **_params) + self.cmd('ip -4 addr flush dev %s' % self.defaultIntf()) + self.cmd('ip -6 addr flush dev %s' % self.defaultIntf()) + self.cmd('ip -4 link set up %s' % self.defaultIntf()) + self.cmd('ip -4 addr add %s dev %s' % (ip, self.defaultIntf())) + if gw: + self.cmd('ip -4 route add default via %s' % gw) + # Disable offload + for attr in ["rx", "tx", "sg"]: + cmd = "/sbin/ethtool --offload %s %s off" % ( + self.defaultIntf(), attr) + self.cmd(cmd) + + def updateIP(): + return ip.split('/')[0] + + self.defaultIntf().updateIP = updateIP + +class TutorialTopo(Topo): + """Basic Server-Client topology with IPv4 hosts""" + + def __init__(self, *args, **kwargs): + Topo.__init__(self, *args, **kwargs) + + # Switches + # gRPC port 50001 + switch1 = self.addSwitch('switch1', cls=StratumBmv2Switch, cpuport=CPU_PORT) + # gRPC port 50002 + switch2 = self.addSwitch('switch2', cls=StratumBmv2Switch, cpuport=CPU_PORT) + # gRPC port 50003 + switch3 = self.addSwitch('switch3', cls=StratumBmv2Switch, cpuport=CPU_PORT) + # gRPC port 50004 + switch4 = self.addSwitch('switch4', cls=StratumBmv2Switch, cpuport=CPU_PORT) + + # Hosts + client = self.addHost('client', cls=IPv4Host, mac="aa:bb:cc:dd:ee:11", + ip='10.0.0.1/24', gw='10.0.0.100') + server = self.addHost('server', cls=IPv4Host, mac="aa:bb:cc:dd:ee:22", + ip='10.0.0.2/24', gw='10.0.0.100') + + # Switch links + self.addLink(switch1, switch2) # Switch1:port 1, Switch2:port 1 + self.addLink(switch1, switch3) # Switch1:port 2, Switch3:port 1 + self.addLink(switch2, switch4) # Switch2:port 2, Switch4:port 1 + self.addLink(switch3, switch4) # Switch3:port 2, Switch4:port 2 + + # Host links + self.addLink(client, switch1) # Switch 1: port 3 + self.addLink(server, switch4) # Switch 4: port 3 + +def main(): + net = Mininet(topo=TutorialTopo(), controller=None) + net.start() + + client = net.hosts[0] + client.setARP('10.0.0.2', 'aa:bb:cc:dd:ee:22') + server = net.hosts[1] + server.setARP('10.0.0.1', 'aa:bb:cc:dd:ee:11') + + CLI(net) + net.stop() + print '#' * 80 + print 'ATTENTION: Mininet was stopped! Perhaps accidentally?' + print 'No worries, it will restart automatically in a few seconds...' + print 'To access again the Mininet CLI, use `make mn-cli`' + print 'To detach from the CLI (without stopping), press Ctrl-D' + print 'To permanently quit Mininet, use `make stop`' + print '#' * 80 + + +if __name__ == "__main__": + parser = argparse.ArgumentParser( + description='Mininet topology script for 2x2 fabric with stratum_bmv2 and IPv4 hosts') + args = parser.parse_args() + setLogLevel('info') + + main() diff --git a/src/tests/p4/mininet/6switch2path.py b/src/tests/p4/mininet/6switch2path.py new file mode 100644 index 0000000000000000000000000000000000000000..8efb4b017f8c71e55884db8dd5f805820bb65fd6 --- /dev/null +++ b/src/tests/p4/mininet/6switch2path.py @@ -0,0 +1,118 @@ +#!/usr/bin/python + +# 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. + +import argparse + +from mininet.cli import CLI +from mininet.log import setLogLevel +from mininet.net import Mininet +from mininet.node import Host +from mininet.topo import Topo +from stratum import StratumBmv2Switch + +CPU_PORT = 255 + +class IPv4Host(Host): + """Host that can be configured with an IPv4 gateway (default route). + """ + + def config(self, mac=None, ip=None, defaultRoute=None, lo='up', gw=None, + **_params): + super(IPv4Host, self).config(mac, ip, defaultRoute, lo, **_params) + self.cmd('ip -4 addr flush dev %s' % self.defaultIntf()) + self.cmd('ip -6 addr flush dev %s' % self.defaultIntf()) + self.cmd('ip -4 link set up %s' % self.defaultIntf()) + self.cmd('ip -4 addr add %s dev %s' % (ip, self.defaultIntf())) + if gw: + self.cmd('ip -4 route add default via %s' % gw) + # Disable offload + for attr in ["rx", "tx", "sg"]: + cmd = "/sbin/ethtool --offload %s %s off" % ( + self.defaultIntf(), attr) + self.cmd(cmd) + + def updateIP(): + return ip.split('/')[0] + + self.defaultIntf().updateIP = updateIP + +class TutorialTopo(Topo): + """Basic Server-Client topology with IPv4 hosts""" + + def __init__(self, *args, **kwargs): + Topo.__init__(self, *args, **kwargs) + + # Switches + # gRPC port 50001 + switch1 = self.addSwitch('switch1', cls=StratumBmv2Switch, cpuport=CPU_PORT) + # gRPC port 50002 + switch2 = self.addSwitch('switch2', cls=StratumBmv2Switch, cpuport=CPU_PORT) + # gRPC port 50003 + switch3 = self.addSwitch('switch3', cls=StratumBmv2Switch, cpuport=CPU_PORT) + # gRPC port 50004 + switch4 = self.addSwitch('switch4', cls=StratumBmv2Switch, cpuport=CPU_PORT) + # gRPC port 50005 + switch5 = self.addSwitch('switch5', cls=StratumBmv2Switch, cpuport=CPU_PORT) + # gRPC port 50006 + switch6 = self.addSwitch('switch6', cls=StratumBmv2Switch, cpuport=CPU_PORT) + + # Hosts + client = self.addHost('client', cls=IPv4Host, mac="aa:bb:cc:dd:ee:11", + ip='10.0.0.1/24', gw='10.0.0.100') + server = self.addHost('server', cls=IPv4Host, mac="aa:bb:cc:dd:ee:22", + ip='10.0.0.2/24', gw='10.0.0.100') + + # Switch links + self.addLink(switch1, switch2) # Switch1:port 1, Switch2:port 1 + self.addLink(switch1, switch3) # Switch1:port 2, Switch3:port 1 + + self.addLink(switch2, switch4) # Switch2:port 2, Switch4:port 1 + self.addLink(switch3, switch5) # Switch3:port 2, Switch5:port 1 + + self.addLink(switch4, switch6) # Switch4:port 2, Switch6:port 1 + self.addLink(switch5, switch6) # Switch5:port 2, Switch6:port 2 + + # Host links + self.addLink(client, switch1) # Switch1: port 3 + self.addLink(server, switch6) # Switch6: port 3 + +def main(): + net = Mininet(topo=TutorialTopo(), controller=None) + net.start() + + client = net.hosts[0] + client.setARP('10.0.0.2', 'aa:bb:cc:dd:ee:22') + server = net.hosts[1] + server.setARP('10.0.0.1', 'aa:bb:cc:dd:ee:11') + + CLI(net) + net.stop() + print '#' * 80 + print 'ATTENTION: Mininet was stopped! Perhaps accidentally?' + print 'No worries, it will restart automatically in a few seconds...' + print 'To access again the Mininet CLI, use `make mn-cli`' + print 'To detach from the CLI (without stopping), press Ctrl-D' + print 'To permanently quit Mininet, use `make stop`' + print '#' * 80 + + +if __name__ == "__main__": + parser = argparse.ArgumentParser( + description='Mininet topology script for 2x2 fabric with stratum_bmv2 and IPv4 hosts') + args = parser.parse_args() + setLogLevel('info') + + main() diff --git a/src/tests/p4/p4/bmv2.json b/src/tests/p4/p4/bmv2.json new file mode 100644 index 0000000000000000000000000000000000000000..f001eb52e90e875c4152f4d7820664402ac856c3 --- /dev/null +++ b/src/tests/p4/p4/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/p4/p4/main.p4 b/src/tests/p4/p4/main.p4 new file mode 100644 index 0000000000000000000000000000000000000000..843eb0d580e362e74b25c768b1b01e750138637a --- /dev/null +++ b/src/tests/p4/p4/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 +#include + +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/p4/p4/p4info.txt b/src/tests/p4/p4/p4info.txt new file mode 100644 index 0000000000000000000000000000000000000000..0b58e740864b72e6ca87582431cd7bd57894d0dd --- /dev/null +++ b/src/tests/p4/p4/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/p4/run_test_01_bootstrap.sh b/src/tests/p4/run_test_01_bootstrap.sh new file mode 100755 index 0000000000000000000000000000000000000000..c08b95b7e3e0fd9237e3a61a461099c323ae728f --- /dev/null +++ b/src/tests/p4/run_test_01_bootstrap.sh @@ -0,0 +1,22 @@ +#!/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. + +# make sure to source the following scripts: +# - my_deploy.sh +# - tfs_runtime_env_vars.sh + +source tfs_runtime_env_vars.sh +python -m pytest --verbose src/tests/p4/tests/test_functional_bootstrap.py + diff --git a/src/tests/p4/run_test_02_create_service.sh b/src/tests/p4/run_test_02_create_service.sh new file mode 100755 index 0000000000000000000000000000000000000000..a972b66c0e1ea3190c71feef930c1043a5dcb281 --- /dev/null +++ b/src/tests/p4/run_test_02_create_service.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. + +source tfs_runtime_env_vars.sh +python -m pytest --verbose src/tests/p4/tests/test_functional_create_service.py diff --git a/src/tests/p4/run_test_03_delete_service.sh b/src/tests/p4/run_test_03_delete_service.sh new file mode 100755 index 0000000000000000000000000000000000000000..4b4dfbfaa538a23c1d49448147da0025c7608bc4 --- /dev/null +++ b/src/tests/p4/run_test_03_delete_service.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. + +source tfs_runtime_env_vars.sh +python -m pytest --verbose src/tests/p4/tests/test_functional_delete_service.py diff --git a/src/tests/p4/run_test_04_cleanup.sh b/src/tests/p4/run_test_04_cleanup.sh new file mode 100755 index 0000000000000000000000000000000000000000..b1f2735c2e024dfa23a1b311415ad74aea2f7b37 --- /dev/null +++ b/src/tests/p4/run_test_04_cleanup.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. + +source tfs_runtime_env_vars.sh +python -m pytest --verbose src/tests/p4/tests/test_functional_cleanup.py diff --git a/src/tests/p4/setup.sh b/src/tests/p4/setup.sh new file mode 100755 index 0000000000000000000000000000000000000000..78e7f7372d911623cd541495ab15ad3cd548c3ef --- /dev/null +++ b/src/tests/p4/setup.sh @@ -0,0 +1,22 @@ +#! /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. + + +export POD_NAME=$(kubectl get pods -n=tfs | grep device | awk '{print $1}') + +kubectl exec ${POD_NAME} -n=tfs -- mkdir /root/p4 + +kubectl cp src/tests/p4/p4/p4info.txt tfs/${POD_NAME}:/root/p4 +kubectl cp src/tests/p4/p4/bmv2.json tfs/${POD_NAME}:/root/p4 diff --git a/src/tests/p4/tests/.gitignore b/src/tests/p4/tests/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..76cb708d1b532c9b69166e55f36bcb912fd5e370 --- /dev/null +++ b/src/tests/p4/tests/.gitignore @@ -0,0 +1,2 @@ +# Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. +Credentials.py diff --git a/src/tests/p4/tests/BuildDescriptors.py b/src/tests/p4/tests/BuildDescriptors.py new file mode 100644 index 0000000000000000000000000000000000000000..98b78863318a7ad682fc5f970d44d02240b45a26 --- /dev/null +++ b/src/tests/p4/tests/BuildDescriptors.py @@ -0,0 +1,35 @@ +# 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, json, sys +from .Objects import CONTEXTS, DEVICES, LINKS, TOPOLOGIES + +def main(): + with open('tests/ofc22/descriptors_emulated.json', 'w', encoding='UTF-8') as f: + devices = [] + for device,connect_rules in DEVICES: + device = copy.deepcopy(device) + device['device_config']['config_rules'].extend(connect_rules) + devices.append(device) + + f.write(json.dumps({ + 'contexts': CONTEXTS, + 'topologies': TOPOLOGIES, + 'devices': devices, + 'links': LINKS + })) + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/tests/p4/tests/LoadDescriptors.py b/src/tests/p4/tests/LoadDescriptors.py new file mode 100644 index 0000000000000000000000000000000000000000..b232935f4675d718d55e67fe3a76012a39398dda --- /dev/null +++ b/src/tests/p4/tests/LoadDescriptors.py @@ -0,0 +1,40 @@ +# 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, logging, sys +from common.Settings import get_setting +from context.client.ContextClient import ContextClient +from common.proto.context_pb2 import Context, Device, Link, Topology +from device.client.DeviceClient import DeviceClient + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +def main(): + context_client = ContextClient( + get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + device_client = DeviceClient( + get_setting('DEVICESERVICE_SERVICE_HOST'), get_setting('DEVICESERVICE_SERVICE_PORT_GRPC')) + + with open('tests/ofc22/descriptors.json', 'r', encoding='UTF-8') as f: + descriptors = json.loads(f.read()) + + for context in descriptors['contexts' ]: context_client.SetContext (Context (**context )) + for topology in descriptors['topologies']: context_client.SetTopology(Topology(**topology)) + for device in descriptors['devices' ]: device_client .AddDevice (Device (**device )) + for link in descriptors['links' ]: context_client.SetLink (Link (**link )) + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/tests/p4/tests/Objects.py b/src/tests/p4/tests/Objects.py new file mode 100644 index 0000000000000000000000000000000000000000..29f01cd61aca58712cb0bc27b7f80c04b2f37d52 --- /dev/null +++ b/src/tests/p4/tests/Objects.py @@ -0,0 +1,345 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +from typing import Dict, List, Tuple +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.tools.object_factory.Context import json_context, json_context_id +from common.tools.object_factory.Device import ( + json_device_connect_rules, json_device_emulated_connect_rules, json_device_emulated_packet_router_disabled, + json_device_connect_rules, json_device_id, json_device_p4_disabled, + json_device_emulated_tapi_disabled, json_device_id, json_device_packetrouter_disabled, json_device_tapi_disabled) +from common.tools.object_factory.Service import ( + get_service_uuid, json_service_l3nm_planned,json_service_p4_planned) +from common.tools.object_factory.ConfigRule import ( + json_config_rule_set, json_config_rule_delete) +from common.tools.object_factory.EndPoint import json_endpoint, json_endpoint_ids, json_endpoints, json_endpoint_id +from common.tools.object_factory.Link import get_link_uuid, json_link, json_link_id +from common.tools.object_factory.Topology import json_topology, json_topology_id +from common.proto.kpi_sample_types_pb2 import KpiSampleType + +# ----- Context -------------------------------------------------------------------------------------------------------- +CONTEXT_ID = json_context_id(DEFAULT_CONTEXT_NAME) +CONTEXT = json_context(DEFAULT_CONTEXT_NAME) + +# ----- Topology ------------------------------------------------------------------------------------------------------- +TOPOLOGY_ID = json_topology_id(DEFAULT_TOPOLOGY_NAME, context_id=CONTEXT_ID) +TOPOLOGY = json_topology(DEFAULT_TOPOLOGY_NAME, context_id=CONTEXT_ID) + +# ----- Monitoring Samples --------------------------------------------------------------------------------------------- +PACKET_PORT_SAMPLE_TYPES = [ + KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED, + KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED, + KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED, + KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED, +] + +# ----- Device Credentials and Settings -------------------------------------------------------------------------------- + + +# ----- Devices -------------------------------------------------------------------------------------------------------- + +CUR_PATH = os.path.dirname(os.path.abspath(__file__)) + +DEVICE_SW1_UUID = 'SW1' +DEVICE_SW1_TIMEOUT = 60 +DEVICE_SW1_ID = json_device_id(DEVICE_SW1_UUID) +DEVICE_SW1 = json_device_p4_disabled(DEVICE_SW1_UUID) + +DEVICE_SW1_DPID = 1 +DEVICE_SW1_NAME = DEVICE_SW1_UUID +DEVICE_SW1_IP_ADDR = '10.0.2.10' +DEVICE_SW1_PORT = '50001' +DEVICE_SW1_VENDOR = 'Open Networking Foundation' +DEVICE_SW1_HW_VER = 'BMv2 simple_switch' +DEVICE_SW1_SW_VER = 'Stratum' + +DEVICE_SW1_BIN_PATH = '/root/p4/bmv2.json' +DEVICE_SW1_INFO_PATH = '/root/p4/p4info.txt' + +DEVICE_SW1_ENDPOINT_DEFS = [('1', 'port', []), ('2', 'port', []), ('3', 'port', [])] +DEVICE_SW1_ENDPOINTS = json_endpoints(DEVICE_SW1_ID, DEVICE_SW1_ENDPOINT_DEFS) +DEVICE_SW1_ENDPOINT_IDS = json_endpoint_ids(DEVICE_SW1_ID, DEVICE_SW1_ENDPOINT_DEFS) +ENDPOINT_ID_SW1_1 = DEVICE_SW1_ENDPOINTS[0]['endpoint_id'] +ENDPOINT_ID_SW1_2 = DEVICE_SW1_ENDPOINTS[1]['endpoint_id'] +ENDPOINT_ID_SW1_3 = DEVICE_SW1_ENDPOINTS[2]['endpoint_id'] + +DEVICE_SW1_CONNECT_RULES = json_device_connect_rules( + DEVICE_SW1_IP_ADDR, + DEVICE_SW1_PORT, + { + 'id': DEVICE_SW1_DPID, + 'name': DEVICE_SW1_NAME, + 'vendor': DEVICE_SW1_VENDOR, + 'hw_ver': DEVICE_SW1_HW_VER, + 'sw_ver': DEVICE_SW1_SW_VER, + 'timeout': DEVICE_SW1_TIMEOUT, + 'p4bin': DEVICE_SW1_BIN_PATH, + 'p4info': DEVICE_SW1_INFO_PATH + } +) + +DEVICE_SW2_UUID = 'SW2' +DEVICE_SW2_TIMEOUT = 60 +DEVICE_SW2_ID = json_device_id(DEVICE_SW2_UUID) +DEVICE_SW2 = json_device_p4_disabled(DEVICE_SW2_UUID) + +DEVICE_SW2_DPID = 1 +DEVICE_SW2_NAME = DEVICE_SW2_UUID +DEVICE_SW2_IP_ADDR = '10.0.2.10' +DEVICE_SW2_PORT = '50002' +DEVICE_SW2_VENDOR = 'Open Networking Foundation' +DEVICE_SW2_HW_VER = 'BMv2 simple_switch' +DEVICE_SW2_SW_VER = 'Stratum' + +DEVICE_SW2_BIN_PATH = '/root/p4/bmv2.json' +DEVICE_SW2_INFO_PATH = '/root/p4/p4info.txt' + +DEVICE_SW2_ENDPOINT_DEFS = [('1', 'port', []), ('2', 'port', [])] +DEVICE_SW2_ENDPOINTS = json_endpoints(DEVICE_SW2_ID, DEVICE_SW2_ENDPOINT_DEFS) +DEVICE_SW2_ENDPOINT_IDS = json_endpoint_ids(DEVICE_SW2_ID, DEVICE_SW2_ENDPOINT_DEFS) +ENDPOINT_ID_SW2_1 = DEVICE_SW2_ENDPOINTS[0]['endpoint_id'] +ENDPOINT_ID_SW2_2 = DEVICE_SW2_ENDPOINTS[1]['endpoint_id'] + +DEVICE_SW2_CONNECT_RULES = json_device_connect_rules( + DEVICE_SW2_IP_ADDR, + DEVICE_SW2_PORT, + { + 'id': DEVICE_SW2_DPID, + 'name': DEVICE_SW2_NAME, + 'vendor': DEVICE_SW2_VENDOR, + 'hw_ver': DEVICE_SW2_HW_VER, + 'sw_ver': DEVICE_SW2_SW_VER, + 'timeout': DEVICE_SW2_TIMEOUT, + 'p4bin': DEVICE_SW2_BIN_PATH, + 'p4info': DEVICE_SW2_INFO_PATH + } +) + +DEVICE_SW3_UUID = 'SW3' +DEVICE_SW3_TIMEOUT = 60 +DEVICE_SW3_ID = json_device_id(DEVICE_SW3_UUID) +DEVICE_SW3 = json_device_p4_disabled(DEVICE_SW3_UUID) + +DEVICE_SW3_DPID = 1 +DEVICE_SW3_NAME = DEVICE_SW3_UUID +DEVICE_SW3_IP_ADDR = '10.0.2.10' +DEVICE_SW3_PORT = '50003' +DEVICE_SW3_VENDOR = 'Open Networking Foundation' +DEVICE_SW3_HW_VER = 'BMv2 simple_switch' +DEVICE_SW3_SW_VER = 'Stratum' + +DEVICE_SW3_BIN_PATH = '/root/p4/bmv2.json' +DEVICE_SW3_INFO_PATH = '/root/p4/p4info.txt' + +DEVICE_SW3_ENDPOINT_DEFS = [('1', 'port', []), ('2', 'port', [])] +DEVICE_SW3_ENDPOINTS = json_endpoints(DEVICE_SW3_ID, DEVICE_SW3_ENDPOINT_DEFS) +DEVICE_SW3_ENDPOINT_IDS = json_endpoint_ids(DEVICE_SW3_ID, DEVICE_SW3_ENDPOINT_DEFS) +ENDPOINT_ID_SW3_1 = DEVICE_SW3_ENDPOINTS[0]['endpoint_id'] +ENDPOINT_ID_SW3_2 = DEVICE_SW3_ENDPOINTS[1]['endpoint_id'] + +DEVICE_SW3_CONNECT_RULES = json_device_connect_rules( + DEVICE_SW3_IP_ADDR, + DEVICE_SW3_PORT, + { + 'id': DEVICE_SW3_DPID, + 'name': DEVICE_SW3_NAME, + 'vendor': DEVICE_SW3_VENDOR, + 'hw_ver': DEVICE_SW3_HW_VER, + 'sw_ver': DEVICE_SW3_SW_VER, + 'timeout': DEVICE_SW3_TIMEOUT, + 'p4bin': DEVICE_SW3_BIN_PATH, + 'p4info': DEVICE_SW3_INFO_PATH + } +) + +DEVICE_SW4_UUID = 'SW4' +DEVICE_SW4_TIMEOUT = 60 +DEVICE_SW4_ID = json_device_id(DEVICE_SW4_UUID) +DEVICE_SW4 = json_device_p4_disabled(DEVICE_SW4_UUID) + +DEVICE_SW4_DPID = 1 +DEVICE_SW4_NAME = DEVICE_SW4_UUID +DEVICE_SW4_IP_ADDR = '10.0.2.10' +DEVICE_SW4_PORT = '50004' +DEVICE_SW4_VENDOR = 'Open Networking Foundation' +DEVICE_SW4_HW_VER = 'BMv2 simple_switch' +DEVICE_SW4_SW_VER = 'Stratum' + +DEVICE_SW4_BIN_PATH = '/root/p4/bmv2.json' +DEVICE_SW4_INFO_PATH = '/root/p4/p4info.txt' + +DEVICE_SW4_ENDPOINT_DEFS = [('1', 'port', []), ('2', 'port', [])] +DEVICE_SW4_ENDPOINTS = json_endpoints(DEVICE_SW4_ID, DEVICE_SW4_ENDPOINT_DEFS) +DEVICE_SW4_ENDPOINT_IDS = json_endpoint_ids(DEVICE_SW4_ID, DEVICE_SW4_ENDPOINT_DEFS) +ENDPOINT_ID_SW4_1 = DEVICE_SW4_ENDPOINTS[0]['endpoint_id'] +ENDPOINT_ID_SW4_2 = DEVICE_SW4_ENDPOINTS[1]['endpoint_id'] + +DEVICE_SW4_CONNECT_RULES = json_device_connect_rules( + DEVICE_SW4_IP_ADDR, + DEVICE_SW4_PORT, + { + 'id': DEVICE_SW4_DPID, + 'name': DEVICE_SW4_NAME, + 'vendor': DEVICE_SW4_VENDOR, + 'hw_ver': DEVICE_SW4_HW_VER, + 'sw_ver': DEVICE_SW4_SW_VER, + 'timeout': DEVICE_SW4_TIMEOUT, + 'p4bin': DEVICE_SW4_BIN_PATH, + 'p4info': DEVICE_SW4_INFO_PATH + } +) + +DEVICE_SW5_UUID = 'SW5' +DEVICE_SW5_TIMEOUT = 60 +DEVICE_SW5_ID = json_device_id(DEVICE_SW5_UUID) +DEVICE_SW5 = json_device_p4_disabled(DEVICE_SW5_UUID) + +DEVICE_SW5_DPID = 1 +DEVICE_SW5_NAME = DEVICE_SW5_UUID +DEVICE_SW5_IP_ADDR = '10.0.2.10' +DEVICE_SW5_PORT = '50005' +DEVICE_SW5_VENDOR = 'Open Networking Foundation' +DEVICE_SW5_HW_VER = 'BMv2 simple_switch' +DEVICE_SW5_SW_VER = 'Stratum' + +DEVICE_SW5_BIN_PATH = '/root/p4/bmv2.json' +DEVICE_SW5_INFO_PATH = '/root/p4/p4info.txt' + +DEVICE_SW5_ENDPOINT_DEFS = [('1', 'port', []), ('2', 'port', [])] +DEVICE_SW5_ENDPOINTS = json_endpoints(DEVICE_SW5_ID, DEVICE_SW5_ENDPOINT_DEFS) +DEVICE_SW5_ENDPOINT_IDS = json_endpoint_ids(DEVICE_SW5_ID, DEVICE_SW5_ENDPOINT_DEFS) +ENDPOINT_ID_SW5_1 = DEVICE_SW5_ENDPOINTS[0]['endpoint_id'] +ENDPOINT_ID_SW5_2 = DEVICE_SW5_ENDPOINTS[1]['endpoint_id'] + +DEVICE_SW5_CONNECT_RULES = json_device_connect_rules( + DEVICE_SW5_IP_ADDR, + DEVICE_SW5_PORT, + { + 'id': DEVICE_SW5_DPID, + 'name': DEVICE_SW5_NAME, + 'vendor': DEVICE_SW5_VENDOR, + 'hw_ver': DEVICE_SW5_HW_VER, + 'sw_ver': DEVICE_SW5_SW_VER, + 'timeout': DEVICE_SW5_TIMEOUT, + 'p4bin': DEVICE_SW5_BIN_PATH, + 'p4info': DEVICE_SW5_INFO_PATH + } +) + +DEVICE_SW6_UUID = 'SW6' +DEVICE_SW6_TIMEOUT = 60 +DEVICE_SW6_ID = json_device_id(DEVICE_SW6_UUID) +DEVICE_SW6 = json_device_p4_disabled(DEVICE_SW6_UUID) + +DEVICE_SW6_DPID = 1 +DEVICE_SW6_NAME = DEVICE_SW6_UUID +DEVICE_SW6_IP_ADDR = '10.0.2.10' +DEVICE_SW6_PORT = '50006' +DEVICE_SW6_VENDOR = 'Open Networking Foundation' +DEVICE_SW6_HW_VER = 'BMv2 simple_switch' +DEVICE_SW6_SW_VER = 'Stratum' + +DEVICE_SW6_BIN_PATH = '/root/p4/bmv2.json' +DEVICE_SW6_INFO_PATH = '/root/p4/p4info.txt' + +DEVICE_SW6_ENDPOINT_DEFS = [('1', 'port', []), ('2', 'port', []), ('3', 'port', [])] +DEVICE_SW6_ENDPOINTS = json_endpoints(DEVICE_SW6_ID, DEVICE_SW6_ENDPOINT_DEFS) +DEVICE_SW6_ENDPOINT_IDS = json_endpoint_ids(DEVICE_SW6_ID, DEVICE_SW6_ENDPOINT_DEFS) +ENDPOINT_ID_SW6_1 = DEVICE_SW6_ENDPOINTS[0]['endpoint_id'] +ENDPOINT_ID_SW6_2 = DEVICE_SW6_ENDPOINTS[1]['endpoint_id'] +ENDPOINT_ID_SW6_3 = DEVICE_SW6_ENDPOINTS[2]['endpoint_id'] + +DEVICE_SW6_CONNECT_RULES = json_device_connect_rules( + DEVICE_SW6_IP_ADDR, + DEVICE_SW6_PORT, + { + 'id': DEVICE_SW6_DPID, + 'name': DEVICE_SW6_NAME, + 'vendor': DEVICE_SW6_VENDOR, + 'hw_ver': DEVICE_SW6_HW_VER, + 'sw_ver': DEVICE_SW6_SW_VER, + 'timeout': DEVICE_SW6_TIMEOUT, + 'p4bin': DEVICE_SW6_BIN_PATH, + 'p4info': DEVICE_SW6_INFO_PATH + } +) + +# ----- Links ---------------------------------------------------------------------------------------------------------- +LINK_SW1_SW2_UUID = get_link_uuid(ENDPOINT_ID_SW1_1, ENDPOINT_ID_SW2_1) +LINK_SW1_SW2_ID = json_link_id(LINK_SW1_SW2_UUID) +LINK_SW1_SW2 = json_link(LINK_SW1_SW2_UUID, [ENDPOINT_ID_SW1_1, ENDPOINT_ID_SW2_1]) + +LINK_SW1_SW3_UUID = get_link_uuid(ENDPOINT_ID_SW1_2, ENDPOINT_ID_SW3_1) +LINK_SW1_SW3_ID = json_link_id(LINK_SW1_SW3_UUID) +LINK_SW1_SW3 = json_link(LINK_SW1_SW3_UUID, [ENDPOINT_ID_SW1_2, ENDPOINT_ID_SW3_1]) + +LINK_SW2_SW4_UUID = get_link_uuid(ENDPOINT_ID_SW2_2, ENDPOINT_ID_SW4_1) +LINK_SW2_SW4_ID = json_link_id(LINK_SW2_SW4_UUID) +LINK_SW2_SW4 = json_link(LINK_SW2_SW4_UUID, [ENDPOINT_ID_SW2_2, ENDPOINT_ID_SW4_1]) + +LINK_SW3_SW5_UUID = get_link_uuid(ENDPOINT_ID_SW3_2, ENDPOINT_ID_SW5_1) +LINK_SW3_SW5_ID = json_link_id(LINK_SW3_SW5_UUID) +LINK_SW3_SW5 = json_link(LINK_SW3_SW5_UUID, [ENDPOINT_ID_SW3_2, ENDPOINT_ID_SW5_1]) + +LINK_SW4_SW6_UUID = get_link_uuid(ENDPOINT_ID_SW4_2, ENDPOINT_ID_SW6_1) +LINK_SW4_SW6_ID = json_link_id(LINK_SW4_SW6_UUID) +LINK_SW4_SW6 = json_link(LINK_SW4_SW6_UUID, [ENDPOINT_ID_SW4_2, ENDPOINT_ID_SW6_1]) + +LINK_SW5_SW6_UUID = get_link_uuid(ENDPOINT_ID_SW5_2, ENDPOINT_ID_SW6_2) +LINK_SW5_SW6_ID = json_link_id(LINK_SW5_SW6_UUID) +LINK_SW5_SW6 = json_link(LINK_SW5_SW6_UUID, [ENDPOINT_ID_SW5_2, ENDPOINT_ID_SW6_2]) + +# ----- Service ---------------------------------------------------------------------------------------------------------- + +#SERVICE_SW1_UUID = get_service_uuid(ENDPOINT_ID_SW1_1, ENDPOINT_ID_SW1_2) +#SERVICE_SW1 = json_service_p4_planned(SERVICE_SW1_UUID) + +#SERVICE_SW2_UUID = get_service_uuid(ENDPOINT_ID_SW2_1, ENDPOINT_ID_SW2_2) +#SERVICE_SW2 = json_service_p4_planned(SERVICE_SW2_UUID) + +SERVICE_SW1_SW6_UUID = get_service_uuid(ENDPOINT_ID_SW1_3, ENDPOINT_ID_SW6_3) +SERVICE_SW1_SW6 = json_service_p4_planned(SERVICE_SW1_SW6_UUID) +SERVICE_SW1_SW6_ENDPOINT_IDS = [DEVICE_SW1_ENDPOINT_IDS[2], DEVICE_SW6_ENDPOINT_IDS[2]] + +# ----- Object Collections --------------------------------------------------------------------------------------------- + +CONTEXTS = [CONTEXT] +TOPOLOGIES = [TOPOLOGY] + +DEVICES = [ + (DEVICE_SW1, DEVICE_SW1_CONNECT_RULES, DEVICE_SW1_ENDPOINTS), + (DEVICE_SW2, DEVICE_SW2_CONNECT_RULES, DEVICE_SW2_ENDPOINTS), + (DEVICE_SW3, DEVICE_SW3_CONNECT_RULES, DEVICE_SW3_ENDPOINTS), + (DEVICE_SW4, DEVICE_SW4_CONNECT_RULES, DEVICE_SW4_ENDPOINTS), + (DEVICE_SW5, DEVICE_SW5_CONNECT_RULES, DEVICE_SW5_ENDPOINTS), + (DEVICE_SW6, DEVICE_SW6_CONNECT_RULES, DEVICE_SW6_ENDPOINTS), +] + +LINKS = [ + LINK_SW1_SW2, + LINK_SW1_SW3, + + LINK_SW2_SW4, + LINK_SW3_SW5, + + LINK_SW4_SW6, + LINK_SW5_SW6 + ] + +#SERVICES = [(SERVICE_SW1, DEVICE_SW1_ENDPOINT_IDS), (SERVICE_SW2, DEVICE_SW2_ENDPOINT_IDS)] + +#SERVICE_SW1_SW2_ENDPOINT_IDS = DEVICE_SW1_ENDPOINT_IDS + DEVICE_SW2_ENDPOINT_IDS + +SERVICES = [(SERVICE_SW1_SW6, SERVICE_SW1_SW6_ENDPOINT_IDS)] \ No newline at end of file diff --git a/src/tests/p4/tests/__init__.py b/src/tests/p4/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/tests/p4/tests/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/tests/p4/tests/test_functional_bootstrap.py b/src/tests/p4/tests/test_functional_bootstrap.py new file mode 100644 index 0000000000000000000000000000000000000000..11b24adf137f0b06d1176b440a7fd93b5ad24e80 --- /dev/null +++ b/src/tests/p4/tests/test_functional_bootstrap.py @@ -0,0 +1,107 @@ +# 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.Settings import get_setting +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.Link import json_link_id +from common.tools.object_factory.Topology import json_topology_id +from context.client.ContextClient import ContextClient +from context.client.EventsCollector import EventsCollector +from common.proto.context_pb2 import ConfigActionEnum, Context, ContextId, Device, Empty, Link, Topology, DeviceOperationalStatusEnum +from device.client.DeviceClient import DeviceClient +from .Objects import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +@pytest.fixture(scope='session') +def context_client(): + _client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def device_client(): + _client = DeviceClient(get_setting('DEVICESERVICE_SERVICE_HOST'), get_setting('DEVICESERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + +def test_prepare_scenario(context_client : ContextClient): # pylint: disable=redefined-outer-name + + # ----- Create Contexts and Topologies ----------------------------------------------------------------------------- + for context in CONTEXTS: + context_uuid = context['context_id']['context_uuid']['uuid'] + LOGGER.info('Adding Context {:s}'.format(context_uuid)) + response = context_client.SetContext(Context(**context)) + assert response.context_uuid.uuid == context_uuid + + for topology in TOPOLOGIES: + context_uuid = topology['topology_id']['context_id']['context_uuid']['uuid'] + topology_uuid = topology['topology_id']['topology_uuid']['uuid'] + LOGGER.info('Adding Topology {:s}/{:s}'.format(context_uuid, topology_uuid)) + response = context_client.SetTopology(Topology(**topology)) + assert response.context_id.context_uuid.uuid == context_uuid + assert response.topology_uuid.uuid == topology_uuid + context_id = json_context_id(context_uuid) + + +def test_scenario_ready(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure scenario is ready ------------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(CONTEXTS) + + response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) + assert len(response.topologies) == len(TOPOLOGIES) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 + +def test_devices_bootstraping( + context_client : ContextClient, device_client : DeviceClient): # pylint: disable=redefined-outer-name + + # ----- Create Devices --------------------------------------------------------------- + for device, connect_rules, endpoints, in DEVICES: + device_uuid = device['device_id']['device_uuid']['uuid'] + LOGGER.info('Adding Device {:s}'.format(device_uuid)) + + device_p4_with_connect_rules = copy.deepcopy(device) + device_p4_with_connect_rules['device_config']['config_rules'].extend(connect_rules) + response = device_client.AddDevice(Device(**device_p4_with_connect_rules)) + assert response.device_uuid.uuid == device_uuid + + device_p4_with_endpoints = copy.deepcopy(device) + device_p4_with_endpoints['device_endpoints'].extend(endpoints) + device_client.ConfigureDevice(Device(**device_p4_with_endpoints)) + + for link in LINKS: + link_uuid = link['link_id']['link_uuid']['uuid'] + LOGGER.info('Adding Link {:s}'.format(link_uuid)) + response = context_client.SetLink(Link(**link)) + assert response.link_uuid.uuid == link_uuid + context_client.SetLink(Link(**link)) + +def test_devices_bootstrapped(context_client : ContextClient): # pylint: disable=redefined-outer-name + # ----- List entities - Ensure bevices are created ----------------------------------------------------------------- + response = context_client.ListContexts(Empty()) + assert len(response.contexts) == len(CONTEXTS) + + response = context_client.ListTopologies(ContextId(**CONTEXT_ID)) + assert len(response.topologies) == len(TOPOLOGIES) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == len(DEVICES) diff --git a/src/tests/p4/tests/test_functional_cleanup.py b/src/tests/p4/tests/test_functional_cleanup.py new file mode 100644 index 0000000000000000000000000000000000000000..852f2a655dd5ba6cc80902a09d3b118b34d8da47 --- /dev/null +++ b/src/tests/p4/tests/test_functional_cleanup.py @@ -0,0 +1,83 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import copy, logging, pytest +from common.Settings import get_setting +from common.tests.EventTools import EVENT_REMOVE, 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.Link import json_link_id +from common.tools.object_factory.Topology import json_topology_id +from context.client.ContextClient import ContextClient +from context.client.EventsCollector import EventsCollector +from common.proto.context_pb2 import ConfigActionEnum, ContextId, Device, DeviceId, Empty, Link, LinkId, TopologyId, DeviceOperationalStatusEnum +from device.client.DeviceClient import DeviceClient +from .Objects import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + + +@pytest.fixture(scope='session') +def context_client(): + _client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def device_client(): + _client = DeviceClient(get_setting('DEVICESERVICE_SERVICE_HOST'), get_setting('DEVICESERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + +def test_scenario_cleanup( + context_client : ContextClient, device_client : DeviceClient): # pylint: disable=redefined-outer-name + + for link in LINKS: + link_uuid = link['link_id']['link_uuid']['uuid'] + LOGGER.info('Removing Link {:s}'.format(link_uuid)) + link_id = link['link_id'] + context_client.RemoveLink(LinkId(**link_id)) + + # ----- Delete Devices and Validate Collected Events --------------------------------------------------------------- + for device, _, _ in DEVICES: + + device_id = device['device_id'] + device_uuid = device_id['device_uuid']['uuid'] + LOGGER.info('Deleting Device {:s}'.format(device_uuid)) + device_client.DeleteDevice(DeviceId(**device_id)) + #expected_events.append(('DeviceEvent', EVENT_REMOVE, json_device_id(device_uuid))) + + response = context_client.ListDevices(Empty()) + assert len(response.devices) == 0 + + + # ----- Delete Topologies and Validate Collected Events ------------------------------------------------------------ + for topology in TOPOLOGIES: + topology_id = topology['topology_id'] + context_uuid = topology_id['context_id']['context_uuid']['uuid'] + topology_uuid = topology_id['topology_uuid']['uuid'] + LOGGER.info('Deleting Topology {:s}/{:s}'.format(context_uuid, topology_uuid)) + context_client.RemoveTopology(TopologyId(**topology_id)) + context_id = json_context_id(context_uuid) + #expected_events.append(('TopologyEvent', EVENT_REMOVE, json_topology_id(topology_uuid, context_id=context_id))) + + # ----- Delete Contexts and Validate Collected Events -------------------------------------------------------------- + for context in CONTEXTS: + context_id = context['context_id'] + context_uuid = context_id['context_uuid']['uuid'] + LOGGER.info('Deleting Context {:s}'.format(context_uuid)) + context_client.RemoveContext(ContextId(**context_id)) + #expected_events.append(('ContextEvent', EVENT_REMOVE, json_context_id(context_uuid))) diff --git a/src/tests/p4/tests/test_functional_create_service.py b/src/tests/p4/tests/test_functional_create_service.py new file mode 100644 index 0000000000000000000000000000000000000000..f160d3c6fbe4d560f821d0d70e90a2b3e44e4e8b --- /dev/null +++ b/src/tests/p4/tests/test_functional_create_service.py @@ -0,0 +1,93 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import copy, logging, pytest +from common.Settings import get_setting +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.ContextClient import ContextClient +from context.client.EventsCollector import EventsCollector +from common.proto.context_pb2 import Context, ContextId, Device, Empty, Link, Topology, Service, ServiceId +from device.client.DeviceClient import DeviceClient +from service.client.ServiceClient import ServiceClient +from tests.p4.tests.Objects import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES, SERVICES +from common.proto.context_pb2 import ConfigActionEnum, Device, DeviceId,\ + DeviceOperationalStatusEnum + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + +@pytest.fixture(scope='session') +def context_client(): + _client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def device_client(): + _client = DeviceClient(get_setting('DEVICESERVICE_SERVICE_HOST'), get_setting('DEVICESERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + +@pytest.fixture(scope='session') +def service_client(): + _client = ServiceClient(get_setting('SERVICESERVICE_SERVICE_HOST'), get_setting('SERVICESERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + +def test_rules_entry( + context_client : ContextClient, device_client : DeviceClient, service_client : ServiceClient): # pylint: disable=redefined-outer-name + + + + for device, _, __ in DEVICES: + # Enable device + device_p4_with_operational_status = copy.deepcopy(device) + device_p4_with_operational_status['device_operational_status'] = \ + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED + device_client.ConfigureDevice(Device(**device_p4_with_operational_status)) + + # ----- Create Services --------------------------------------------------------------- + for service, endpoints in SERVICES: + # Insert Service (table entries) + service_uuid = service['service_id']['service_uuid']['uuid'] + print('Creating Service {:s}'.format(service_uuid)) + service_p4 = copy.deepcopy(service) + service_client.CreateService(Service(**service_p4)) + service_p4['service_endpoint_ids'].extend(endpoints) + service_client.UpdateService(Service(**service_p4)) + + + +""" +con_cl = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) +dev_cl = DeviceClient(get_setting('DEVICESERVICE_SERVICE_HOST'), get_setting('DEVICESERVICE_SERVICE_PORT_GRPC')) +srv_cl = ServiceClient(get_setting('SERVICESERVICE_SERVICE_HOST'), get_setting('SERVICESERVICE_SERVICE_PORT_GRPC')) + +for service, endpoints in SERVICES: + service_uuid = service['service_id']['service_uuid']['uuid'] + print('Creating Service {:s}'.format(service_uuid)) + service_p4 = copy.deepcopy(service) + srv_cl.CreateService(Service(**service_p4)) + #service_data = con_cl.GetService(ServiceId(**json_service_id('svc1'))) + #print('service_data = {:s}'.format(grpc_message_to_json_string(service_data))) + service_p4 = copy.deepcopy(service) + service_p4['service_endpoint_ids'].extend(endpoints) + srv_cl.UpdateService(Service(**service_p4)) +""" \ No newline at end of file diff --git a/src/tests/p4/tests/test_functional_delete_service.py b/src/tests/p4/tests/test_functional_delete_service.py new file mode 100644 index 0000000000000000000000000000000000000000..4d637cf88d840a20f38855beb7839e2b704016d4 --- /dev/null +++ b/src/tests/p4/tests/test_functional_delete_service.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 copy, logging, pytest +from common.Settings import get_setting +from common.tests.EventTools import EVENT_REMOVE, 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.ContextClient import ContextClient +from context.client.EventsCollector import EventsCollector +from common.proto.context_pb2 import ConfigActionEnum, ContextId, Device, DeviceId, Empty, LinkId, TopologyId, Service, ServiceId, DeviceOperationalStatusEnum +from device.client.DeviceClient import DeviceClient +from service.client.ServiceClient import ServiceClient +from .Objects import CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES, SERVICES + +LOGGER = logging.getLogger(__name__) +LOGGER.setLevel(logging.DEBUG) + + +@pytest.fixture(scope='session') +def context_client(): + _client = ContextClient(get_setting('CONTEXTSERVICE_SERVICE_HOST'), get_setting('CONTEXTSERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + + +@pytest.fixture(scope='session') +def device_client(): + _client = DeviceClient(get_setting('DEVICESERVICE_SERVICE_HOST'), get_setting('DEVICESERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + +@pytest.fixture(scope='session') +def service_client(): + _client = ServiceClient(get_setting('SERVICESERVICE_SERVICE_HOST'), get_setting('SERVICESERVICE_SERVICE_PORT_GRPC')) + yield _client + _client.close() + +def test_rules_delete( + context_client : ContextClient, device_client : DeviceClient, service_client : ServiceClient): # pylint: disable=redefined-outer-name + + # ----- Create Services --------------------------------------------------------------- + for service, endpoints in SERVICES: + # Delete Service (table entries) + service_uuid = service['service_id']['service_uuid']['uuid'] + print('Deleting Service {:s}'.format(service_uuid)) + service_p4 = copy.deepcopy(service) + response = service_client.DeleteService(ServiceId(**json_service_id(service_uuid, CONTEXT_ID))) + + # ----- Disable Devices --------------------------------------------------------------- + for device, _, _ in DEVICES: + device_p4_with_operational_status = copy.deepcopy(device) + device_p4_with_operational_status['device_operational_status'] = \ + DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED + device_client.ConfigureDevice(Device(**device_p4_with_operational_status)) diff --git a/src/tests/scenario1/README.md b/src/tests/scenario1/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4b5eff322d82bd22b9969b456e9d5797751b7f87 --- /dev/null +++ b/src/tests/scenario1/README.md @@ -0,0 +1 @@ +# Scenario 1 - ... diff --git a/src/tests/scenario2/.gitignore b/src/tests/scenario2/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..0a3f4400d5c88b1af32c7667d69d2fdc12d5424e --- /dev/null +++ b/src/tests/scenario2/.gitignore @@ -0,0 +1,2 @@ +# Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. +descriptors_real.json diff --git a/src/tests/scenario2/MultiIngressController.txt b/src/tests/scenario2/MultiIngressController.txt new file mode 100644 index 0000000000000000000000000000000000000000..b2d6d322465cb1d776b043e5de4dd474d2f0d9c6 --- /dev/null +++ b/src/tests/scenario2/MultiIngressController.txt @@ -0,0 +1,35 @@ +# Ref: https://kubernetes.github.io/ingress-nginx/user-guide/multiple-ingress/ +# Ref: https://fabianlee.org/2021/07/29/kubernetes-microk8s-with-multiple-metallb-endpoints-and-nginx-ingress-controllers/ + +# Check node limits +kubectl describe nodes + +# Create secondary ingress controllers +kubectl apply -f nfvsdn22/nginx-ingress-controller-dom1.yaml +kubectl apply -f nfvsdn22/nginx-ingress-controller-dom2.yaml +kubectl apply -f nfvsdn22/nginx-ingress-controller-dom3.yaml +kubectl apply -f nfvsdn22/nginx-ingress-controller-dom4.yaml + +# Delete secondary ingress controllers +kubectl delete -f nfvsdn22/nginx-ingress-controller-dom1.yaml +kubectl delete -f nfvsdn22/nginx-ingress-controller-dom2.yaml +kubectl delete -f nfvsdn22/nginx-ingress-controller-dom3.yaml +kubectl delete -f nfvsdn22/nginx-ingress-controller-dom4.yaml + +source nfvsdn22/deploy_specs_dom1.sh +./deploy.sh + +source nfvsdn22/deploy_specs_dom2.sh +./deploy.sh + +source nfvsdn22/deploy_specs_dom3.sh +./deploy.sh + +source nfvsdn22/deploy_specs_dom4.sh +./deploy.sh + +# Manually deploy ingresses for domains +kubectl --namespace tfs-dom1 apply -f nfvsdn22/tfs-ingress-dom1.yaml +kubectl --namespace tfs-dom2 apply -f nfvsdn22/tfs-ingress-dom2.yaml +kubectl --namespace tfs-dom3 apply -f nfvsdn22/tfs-ingress-dom3.yaml +kubectl --namespace tfs-dom4 apply -f nfvsdn22/tfs-ingress-dom4.yaml diff --git a/src/tests/scenario2/README.md b/src/tests/scenario2/README.md new file mode 100644 index 0000000000000000000000000000000000000000..923324c58eb52624be67c51fa0304bffc836e920 --- /dev/null +++ b/src/tests/scenario2/README.md @@ -0,0 +1 @@ +# Scenario 2 - ... diff --git a/src/tests/scenario2/Scenario.md b/src/tests/scenario2/Scenario.md new file mode 100644 index 0000000000000000000000000000000000000000..8dad4691ade669522b5c82a5e4ed07e5d0279492 --- /dev/null +++ b/src/tests/scenario2/Scenario.md @@ -0,0 +1,47 @@ +# Scenario: + +- 4 TFS instances + + - domain D1 (source for e-2-e service) + 5 routers + 1 DC + R1@D1/2 <--> R2@D1/1 + R2@D1/3 <--> R3@D1/2 + R2@D1/5 <--> R5@D1/2 + R3@D1/4 <--> R4@D1/3 + R4@D1/5 <--> R5@D1/4 + R5@D1/1 <--> R1@D1/5 + R1@D1/100 <--> DCGW@D1/eth1 + + - domain D2 (transit for e-2-e service) + 6 routers + R1@D2/2 <--> R2@D2/1 + R1@D2/6 <--> R6@D2/1 + R1@D2/5 <--> R5@D2/1 + R2@D2/3 <--> R3@D2/2 + R2@D2/4 <--> R4@D2/2 + R2@D2/5 <--> R5@D2/2 + R2@D2/6 <--> R6@D2/2 + R3@D2/6 <--> R6@D2/3 + R4@D2/5 <--> R5@D2/4 + + - domain D3 (transit for e-2-e service) + 4 routers + R1@D3/2 <--> R2@D3/1 + R2@D3/3 <--> R3@D3/2 + R3@D3/4 <--> R4@D3/3 + R4@D3/1 <--> R1@D3/4 + R2@D3/4 <--> R4@D3/2 + + - domain D4 (end for e-2-e service) + 3 routers + R1@D4/2 <--> R2@D4/1 + R1@D4/3 <--> R3@D4/1 + R2@D4/3 <--> R3@D4/2 + R3@D4/100 <--> DCGW@D4/eth1 + + - interdomain links + R4@D1/10 <--> R1@D2/10 + R5@D1/10 <--> R1@D3/10 + R4@D2/10 <--> R2@D4/10 + R5@D2/10 <--> R2@D3/10 + R3@D3/10 <--> R1@D4/10 diff --git a/src/tests/scenario2/__init__.py b/src/tests/scenario2/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/tests/scenario2/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/tests/scenario2/delete_all.sh b/src/tests/scenario2/delete_all.sh new file mode 100755 index 0000000000000000000000000000000000000000..6a838d98553870242985ed6858145a2d998dfbdc --- /dev/null +++ b/src/tests/scenario2/delete_all.sh @@ -0,0 +1,24 @@ +#!/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. + + +# Delete old namespaces +kubectl delete namespace tfs-dom1 tfs-dom2 tfs-dom3 tfs-dom4 tfs-bchain + +# Delete secondary ingress controllers +kubectl delete -f nfvsdn22/nginx-ingress-controller-dom1.yaml +kubectl delete -f nfvsdn22/nginx-ingress-controller-dom2.yaml +kubectl delete -f nfvsdn22/nginx-ingress-controller-dom3.yaml +kubectl delete -f nfvsdn22/nginx-ingress-controller-dom4.yaml diff --git a/src/tests/scenario2/deploy_all.sh b/src/tests/scenario2/deploy_all.sh new file mode 100755 index 0000000000000000000000000000000000000000..19ea0e6db16af66c716927074112da6f18e83b01 --- /dev/null +++ b/src/tests/scenario2/deploy_all.sh @@ -0,0 +1,56 @@ +#!/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. + + +# Delete old namespaces +kubectl delete namespace tfs-dom1 tfs-dom2 tfs-dom3 tfs-dom4 + +# Delete secondary ingress controllers +kubectl delete -f nfvsdn22/nginx-ingress-controller-dom1.yaml +kubectl delete -f nfvsdn22/nginx-ingress-controller-dom2.yaml +kubectl delete -f nfvsdn22/nginx-ingress-controller-dom3.yaml +kubectl delete -f nfvsdn22/nginx-ingress-controller-dom4.yaml + +# Delete MockBlockchain +#kubectl delete namespace tfs-bchain + +# Create secondary ingress controllers +kubectl apply -f nfvsdn22/nginx-ingress-controller-dom1.yaml +kubectl apply -f nfvsdn22/nginx-ingress-controller-dom2.yaml +kubectl apply -f nfvsdn22/nginx-ingress-controller-dom3.yaml +kubectl apply -f nfvsdn22/nginx-ingress-controller-dom4.yaml + +# Create MockBlockchain +#./deploy_mock_blockchain.sh + +# Deploy TFS for Domain 1 +source nfvsdn22/deploy_specs_dom1.sh +./deploy.sh +mv tfs_runtime_env_vars.sh tfs_runtime_env_vars_dom1.sh + +# Deploy TFS for Domain 2 +source nfvsdn22/deploy_specs_dom2.sh +./deploy.sh +mv tfs_runtime_env_vars.sh tfs_runtime_env_vars_dom2.sh + +# Deploy TFS for Domain 3 +source nfvsdn22/deploy_specs_dom3.sh +./deploy.sh +mv tfs_runtime_env_vars.sh tfs_runtime_env_vars_dom3.sh + +# Deploy TFS for Domain 4 +source nfvsdn22/deploy_specs_dom4.sh +./deploy.sh +mv tfs_runtime_env_vars.sh tfs_runtime_env_vars_dom4.sh diff --git a/src/tests/scenario2/deploy_specs_dom1.sh b/src/tests/scenario2/deploy_specs_dom1.sh new file mode 100755 index 0000000000000000000000000000000000000000..cfe8a3bf63d875b4c579e36ff6a904e0f4b62e02 --- /dev/null +++ b/src/tests/scenario2/deploy_specs_dom1.sh @@ -0,0 +1,35 @@ +# 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. + +# Set the URL of your local Docker registry where the images will be uploaded to. +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 pathcomp service slice dlt interdomain webui" + +# Set the tag you want to use for your images. +export TFS_IMAGE_TAG="dev" + +# Set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE="tfs-dom1" + +# Set additional manifest files to be applied after the deployment +export TFS_EXTRA_MANIFESTS="nfvsdn22/tfs-ingress-dom1.yaml" + +# Set the neew Grafana admin password +export TFS_GRAFANA_PASSWORD="admin123+" + +# If not already set, disable skip-build flag. +# If TFS_SKIP_BUILD is "YES", the containers are not rebuilt-retagged-repushed and existing ones are used. +export TFS_SKIP_BUILD="NO" diff --git a/src/tests/scenario2/deploy_specs_dom2.sh b/src/tests/scenario2/deploy_specs_dom2.sh new file mode 100755 index 0000000000000000000000000000000000000000..7034c22cdcdc93b6c6fc0e5227e0ef38bda95a55 --- /dev/null +++ b/src/tests/scenario2/deploy_specs_dom2.sh @@ -0,0 +1,35 @@ +# 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. + +# Set the URL of your local Docker registry where the images will be uploaded to. +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 pathcomp service slice dlt interdomain webui" + +# Set the tag you want to use for your images. +export TFS_IMAGE_TAG="dev" + +# Set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE="tfs-dom2" + +# Set additional manifest files to be applied after the deployment +export TFS_EXTRA_MANIFESTS="nfvsdn22/tfs-ingress-dom2.yaml" + +# Set the neew Grafana admin password +export TFS_GRAFANA_PASSWORD="admin123+" + +# If not already set, disable skip-build flag. +# If TFS_SKIP_BUILD is "YES", the containers are not rebuilt-retagged-repushed and existing ones are used. +export TFS_SKIP_BUILD="YES" diff --git a/src/tests/scenario2/deploy_specs_dom3.sh b/src/tests/scenario2/deploy_specs_dom3.sh new file mode 100755 index 0000000000000000000000000000000000000000..044301418405ba20dfaf00cd58f9a1a15e7e62a7 --- /dev/null +++ b/src/tests/scenario2/deploy_specs_dom3.sh @@ -0,0 +1,35 @@ +# 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. + +# Set the URL of your local Docker registry where the images will be uploaded to. +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 pathcomp service slice dlt interdomain webui" + +# Set the tag you want to use for your images. +export TFS_IMAGE_TAG="dev" + +# Set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE="tfs-dom3" + +# Set additional manifest files to be applied after the deployment +export TFS_EXTRA_MANIFESTS="nfvsdn22/tfs-ingress-dom3.yaml" + +# Set the neew Grafana admin password +export TFS_GRAFANA_PASSWORD="admin123+" + +# If not already set, disable skip-build flag. +# If TFS_SKIP_BUILD is "YES", the containers are not rebuilt-retagged-repushed and existing ones are used. +export TFS_SKIP_BUILD="YES" diff --git a/src/tests/scenario2/deploy_specs_dom4.sh b/src/tests/scenario2/deploy_specs_dom4.sh new file mode 100755 index 0000000000000000000000000000000000000000..9e26ace470c81b0bdccfa83bf4eb7369970c981b --- /dev/null +++ b/src/tests/scenario2/deploy_specs_dom4.sh @@ -0,0 +1,35 @@ +# 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. + +# Set the URL of your local Docker registry where the images will be uploaded to. +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 pathcomp service slice dlt interdomain webui" + +# Set the tag you want to use for your images. +export TFS_IMAGE_TAG="dev" + +# Set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE="tfs-dom4" + +# Set additional manifest files to be applied after the deployment +export TFS_EXTRA_MANIFESTS="nfvsdn22/tfs-ingress-dom4.yaml" + +# Set the neew Grafana admin password +export TFS_GRAFANA_PASSWORD="admin123+" + +# If not already set, disable skip-build flag. +# If TFS_SKIP_BUILD is "YES", the containers are not rebuilt-retagged-repushed and existing ones are used. +export TFS_SKIP_BUILD="YES" diff --git a/src/tests/scenario2/descriptors/domain1.json b/src/tests/scenario2/descriptors/domain1.json new file mode 100644 index 0000000000000000000000000000000000000000..043b3955f017631203a437cf853c3617cddf93c8 --- /dev/null +++ b/src/tests/scenario2/descriptors/domain1.json @@ -0,0 +1,148 @@ +{ + "contexts": [ + { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_ids": [ + {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D1"}} + ], "service_ids": [] + } + ], + "topologies": [ + { + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D1"}}, + "device_ids": [ + {"device_uuid": {"uuid": "DC1"}}, + {"device_uuid": {"uuid": "R1@D1"}}, + {"device_uuid": {"uuid": "R2@D1"}}, + {"device_uuid": {"uuid": "R3@D1"}}, + {"device_uuid": {"uuid": "R4@D1"}}, + {"device_uuid": {"uuid": "R5@D1"}} + ], "link_ids": [ + {"link_uuid": {"uuid": "DC1/D1==R1@D1/DC1"}}, + {"link_uuid": {"uuid": "R1@D1/2==R2@D1/1"}}, + {"link_uuid": {"uuid": "R2@D1/3==R3@D1/2"}}, + {"link_uuid": {"uuid": "R2@D1/5==R5@D1/2"}}, + {"link_uuid": {"uuid": "R3@D1/4==R4@D1/3"}}, + {"link_uuid": {"uuid": "R4@D1/5==R5@D1/4"}}, + {"link_uuid": {"uuid": "R5@D1/1==R1@D1/5"}} + ] + } + ], + "devices": [ + { + "device_id": {"device_uuid": {"uuid": "DC1"}}, "device_type": "emu-datacenter", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper/border", "uuid": "D1"}, + {"sample_types": [], "type": "copper/internal", "uuid": "int"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R1@D1"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "5"}, + {"sample_types": [], "type": "copper/border", "uuid": "DC1"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R2@D1"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper/internal", "uuid": "1"}, + {"sample_types": [], "type": "copper/internal", "uuid": "3"}, + {"sample_types": [], "type": "copper/internal", "uuid": "5"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R3@D1"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "4"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R4@D1"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper/internal", "uuid": "3"}, + {"sample_types": [], "type": "copper/internal", "uuid": "5"}, + {"sample_types": [], "type": "copper/border", "uuid": "D2"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R5@D1"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper/internal", "uuid": "1"}, + {"sample_types": [], "type": "copper/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "4"}, + {"sample_types": [], "type": "copper/border", "uuid": "D3"} + ]}}} + ]} + } + ], + "links": [ + { + "link_id": {"link_uuid": {"uuid": "DC1/D1==R1@D1/DC1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "DC1"}}, "endpoint_uuid": {"uuid": "D1"}}, + {"device_id": {"device_uuid": {"uuid": "R1@D1"}}, "endpoint_uuid": {"uuid": "DC1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R1@D1/2==R2@D1/1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1@D1"}}, "endpoint_uuid": {"uuid": "2"}}, + {"device_id": {"device_uuid": {"uuid": "R2@D1"}}, "endpoint_uuid": {"uuid": "1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2@D1/3==R3@D1/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D1"}}, "endpoint_uuid": {"uuid": "3"}}, + {"device_id": {"device_uuid": {"uuid": "R3@D1"}}, "endpoint_uuid": {"uuid": "2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2@D1/5==R5@D1/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D1"}}, "endpoint_uuid": {"uuid": "5"}}, + {"device_id": {"device_uuid": {"uuid": "R5@D1"}}, "endpoint_uuid": {"uuid": "2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R3@D1/4==R4@D1/3"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3@D1"}}, "endpoint_uuid": {"uuid": "4"}}, + {"device_id": {"device_uuid": {"uuid": "R4@D1"}}, "endpoint_uuid": {"uuid": "3"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R4@D1/5==R5@D1/4"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R4@D1"}}, "endpoint_uuid": {"uuid": "5"}}, + {"device_id": {"device_uuid": {"uuid": "R5@D1"}}, "endpoint_uuid": {"uuid": "4"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R5@D1/1==R1@D1/5"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R5@D1"}}, "endpoint_uuid": {"uuid": "1"}}, + {"device_id": {"device_uuid": {"uuid": "R1@D1"}}, "endpoint_uuid": {"uuid": "5"}} + ] + } + ] +} diff --git a/src/tests/scenario2/descriptors/domain2.json b/src/tests/scenario2/descriptors/domain2.json new file mode 100644 index 0000000000000000000000000000000000000000..81d397abfd3571b1177a06172188b00eed2f3afc --- /dev/null +++ b/src/tests/scenario2/descriptors/domain2.json @@ -0,0 +1,166 @@ +{ + "contexts": [ + { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_ids": [ + {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D2"}} + ], "service_ids": [] + } + ], + "topologies": [ + { + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D2"}}, + "device_ids": [ + {"device_uuid": {"uuid": "R1@D2"}}, + {"device_uuid": {"uuid": "R2@D2"}}, + {"device_uuid": {"uuid": "R3@D2"}}, + {"device_uuid": {"uuid": "R4@D2"}}, + {"device_uuid": {"uuid": "R5@D2"}}, + {"device_uuid": {"uuid": "R6@D2"}} + ], "link_ids": [ + {"link_uuid": {"uuid": "R1@D2/2==R2@D2/1"}}, + {"link_uuid": {"uuid": "R1@D2/6==R6@D2/1"}}, + {"link_uuid": {"uuid": "R1@D2/5==R5@D2/1"}}, + {"link_uuid": {"uuid": "R2@D2/3==R3@D2/2"}}, + {"link_uuid": {"uuid": "R2@D2/4==R4@D2/2"}}, + {"link_uuid": {"uuid": "R2@D2/5==R5@D2/2"}}, + {"link_uuid": {"uuid": "R2@D2/6==R6@D2/2"}}, + {"link_uuid": {"uuid": "R3@D2/6==R6@D2/3"}}, + {"link_uuid": {"uuid": "R4@D2/5==R5@D2/4"}} + ] + } + ], + "devices": [ + { + "device_id": {"device_uuid": {"uuid": "R1@D2"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "5"}, + {"sample_types": [], "type": "copper/internal", "uuid": "6"}, + {"sample_types": [], "type": "copper/border", "uuid": "D1"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R2@D2"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper/internal", "uuid": "1"}, + {"sample_types": [], "type": "copper/internal", "uuid": "3"}, + {"sample_types": [], "type": "copper/internal", "uuid": "4"}, + {"sample_types": [], "type": "copper/internal", "uuid": "5"}, + {"sample_types": [], "type": "copper/internal", "uuid": "6"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R3@D2"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "6"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R4@D2"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "5"}, + {"sample_types": [], "type": "copper/border", "uuid": "D4"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R5@D2"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper/internal", "uuid": "1"}, + {"sample_types": [], "type": "copper/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "4"}, + {"sample_types": [], "type": "copper/border", "uuid": "D3"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R6@D2"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper/internal", "uuid": "1"}, + {"sample_types": [], "type": "copper/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "3"} + ]}}} + ]} + } + ], + "links": [ + { + "link_id": {"link_uuid": {"uuid": "R1@D2/2==R2@D2/1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1@D2"}}, "endpoint_uuid": {"uuid": "2"}}, + {"device_id": {"device_uuid": {"uuid": "R2@D2"}}, "endpoint_uuid": {"uuid": "1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R1@D2/6==R6@D2/1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1@D2"}}, "endpoint_uuid": {"uuid": "6"}}, + {"device_id": {"device_uuid": {"uuid": "R6@D2"}}, "endpoint_uuid": {"uuid": "1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R1@D2/5==R5@D2/1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1@D2"}}, "endpoint_uuid": {"uuid": "5"}}, + {"device_id": {"device_uuid": {"uuid": "R5@D2"}}, "endpoint_uuid": {"uuid": "1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2@D2/3==R3@D2/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D2"}}, "endpoint_uuid": {"uuid": "3"}}, + {"device_id": {"device_uuid": {"uuid": "R3@D2"}}, "endpoint_uuid": {"uuid": "2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2@D2/4==R4@D2/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D2"}}, "endpoint_uuid": {"uuid": "4"}}, + {"device_id": {"device_uuid": {"uuid": "R4@D2"}}, "endpoint_uuid": {"uuid": "2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2@D2/5==R5@D2/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D2"}}, "endpoint_uuid": {"uuid": "5"}}, + {"device_id": {"device_uuid": {"uuid": "R5@D2"}}, "endpoint_uuid": {"uuid": "2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2@D2/6==R6@D2/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D2"}}, "endpoint_uuid": {"uuid": "6"}}, + {"device_id": {"device_uuid": {"uuid": "R6@D2"}}, "endpoint_uuid": {"uuid": "2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R3@D2/6==R6@D2/3"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3@D2"}}, "endpoint_uuid": {"uuid": "6"}}, + {"device_id": {"device_uuid": {"uuid": "R6@D2"}}, "endpoint_uuid": {"uuid": "3"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R4@D2/5==R5@D2/4"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R4@D2"}}, "endpoint_uuid": {"uuid": "5"}}, + {"device_id": {"device_uuid": {"uuid": "R5@D2"}}, "endpoint_uuid": {"uuid": "4"}} + ] + } + ] +} diff --git a/src/tests/scenario2/descriptors/domain3.json b/src/tests/scenario2/descriptors/domain3.json new file mode 100644 index 0000000000000000000000000000000000000000..3a8e47d30dcef471b388f46d4ba5df5df4716256 --- /dev/null +++ b/src/tests/scenario2/descriptors/domain3.json @@ -0,0 +1,110 @@ +{ + "contexts": [ + { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_ids": [ + {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D3"}} + ], "service_ids": [] + } + ], + "topologies": [ + { + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D3"}}, + "device_ids": [ + {"device_uuid": {"uuid": "R1@D3"}}, + {"device_uuid": {"uuid": "R2@D3"}}, + {"device_uuid": {"uuid": "R3@D3"}}, + {"device_uuid": {"uuid": "R4@D3"}} + ], "link_ids": [ + {"link_uuid": {"uuid": "R1@D3/2==R2@D3/1"}}, + {"link_uuid": {"uuid": "R2@D3/3==R3@D3/2"}}, + {"link_uuid": {"uuid": "R3@D3/4==R4@D3/3"}}, + {"link_uuid": {"uuid": "R4@D3/1==R1@D3/4"}}, + {"link_uuid": {"uuid": "R2@D3/4==R4@D3/2"}} + ] + } + ], + "devices": [ + { + "device_id": {"device_uuid": {"uuid": "R1@D3"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "4"}, + {"sample_types": [], "type": "copper/border", "uuid": "D1"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R2@D3"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper/internal", "uuid": "1"}, + {"sample_types": [], "type": "copper/internal", "uuid": "3"}, + {"sample_types": [], "type": "copper/internal", "uuid": "4"}, + {"sample_types": [], "type": "copper/border", "uuid": "D2"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R3@D3"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "4"}, + {"sample_types": [], "type": "copper/border", "uuid": "D4"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R4@D3"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper/internal", "uuid": "1"}, + {"sample_types": [], "type": "copper/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "3"} + ]}}} + ]} + } + ], + "links": [ + { + "link_id": {"link_uuid": {"uuid": "R1@D3/2==R2@D3/1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1@D3"}}, "endpoint_uuid": {"uuid": "2"}}, + {"device_id": {"device_uuid": {"uuid": "R2@D3"}}, "endpoint_uuid": {"uuid": "1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2@D3/3==R3@D3/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D3"}}, "endpoint_uuid": {"uuid": "3"}}, + {"device_id": {"device_uuid": {"uuid": "R3@D3"}}, "endpoint_uuid": {"uuid": "2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R3@D3/4==R4@D3/3"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3@D3"}}, "endpoint_uuid": {"uuid": "4"}}, + {"device_id": {"device_uuid": {"uuid": "R4@D3"}}, "endpoint_uuid": {"uuid": "3"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R4@D3/1==R1@D3/4"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R4@D3"}}, "endpoint_uuid": {"uuid": "1"}}, + {"device_id": {"device_uuid": {"uuid": "R1@D3"}}, "endpoint_uuid": {"uuid": "4"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2@D3/4==R4@D3/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D3"}}, "endpoint_uuid": {"uuid": "4"}}, + {"device_id": {"device_uuid": {"uuid": "R4@D3"}}, "endpoint_uuid": {"uuid": "2"}} + ] + } + ] +} diff --git a/src/tests/scenario2/descriptors/domain4.json b/src/tests/scenario2/descriptors/domain4.json new file mode 100644 index 0000000000000000000000000000000000000000..d9e2d049ad2417beb96b8f3434ed9e94febb4808 --- /dev/null +++ b/src/tests/scenario2/descriptors/domain4.json @@ -0,0 +1,101 @@ +{ + "contexts": [ + { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_ids": [ + {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D4"}} + ], "service_ids": [] + } + ], + "topologies": [ + { + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D4"}}, + "device_ids": [ + {"device_uuid": {"uuid": "DC2"}}, + {"device_uuid": {"uuid": "R1@D4"}}, + {"device_uuid": {"uuid": "R2@D4"}}, + {"device_uuid": {"uuid": "R3@D4"}} + ], "link_ids": [ + {"link_uuid": {"uuid": "R3@D4/DC2==DC2/D4"}}, + {"link_uuid": {"uuid": "R1@D4/2==R2@D4/1"}}, + {"link_uuid": {"uuid": "R1@D4/3==R3@D4/1"}}, + {"link_uuid": {"uuid": "R2@D4/3==R3@D4/2"}} + ] + } + ], + "devices": [ + { + "device_id": {"device_uuid": {"uuid": "DC2"}}, "device_type": "emu-datacenter", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper/border", "uuid": "D4"}, + {"sample_types": [], "type": "copper/internal", "uuid": "int"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R1@D4"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "3"}, + {"sample_types": [], "type": "copper/border", "uuid": "D3"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R2@D4"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper/internal", "uuid": "1"}, + {"sample_types": [], "type": "copper/internal", "uuid": "3"}, + {"sample_types": [], "type": "copper/border", "uuid": "D2"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R3@D4"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper/internal", "uuid": "1"}, + {"sample_types": [], "type": "copper/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/border", "uuid": "DC2"} + ]}}} + ]} + } + ], + "links": [ + { + "link_id": {"link_uuid": {"uuid": "R3@D4/DC2==DC2/D4"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "DC2"}}, "endpoint_uuid": {"uuid": "D4"}}, + {"device_id": {"device_uuid": {"uuid": "R3@D4"}}, "endpoint_uuid": {"uuid": "DC2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R1@D4/2==R2@D4/1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1@D4"}}, "endpoint_uuid": {"uuid": "2"}}, + {"device_id": {"device_uuid": {"uuid": "R2@D4"}}, "endpoint_uuid": {"uuid": "1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R1@D4/3==R3@D4/1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1@D4"}}, "endpoint_uuid": {"uuid": "3"}}, + {"device_id": {"device_uuid": {"uuid": "R3@D4"}}, "endpoint_uuid": {"uuid": "1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2@D4/3==R3@D4/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D4"}}, "endpoint_uuid": {"uuid": "3"}}, + {"device_id": {"device_uuid": {"uuid": "R3@D4"}}, "endpoint_uuid": {"uuid": "2"}} + ] + } + ] +} diff --git a/src/tests/scenario2/descriptors/idc-slice.json b/src/tests/scenario2/descriptors/idc-slice.json new file mode 100644 index 0000000000000000000000000000000000000000..634209284c00cc8602db2bf91e6088ca120710df --- /dev/null +++ b/src/tests/scenario2/descriptors/idc-slice.json @@ -0,0 +1,20 @@ +{ + "slices":[ + { + "slice_id":{"context_id":{"context_uuid":{"uuid":"admin"}},"slice_uuid":{"uuid":"idc-slice"}}, + "slice_endpoint_ids":[ + {"device_id":{"device_uuid":{"uuid":"DC1"}},"endpoint_uuid":{"uuid":"int"}}, + {"device_id":{"device_uuid":{"uuid":"DC2"}},"endpoint_uuid":{"uuid":"int"}} + ], + "slice_status":{"slice_status":1}, + "slice_service_ids":[], + "slice_subslice_ids":[], + "slice_constraints":[], + "slice_config":{"config_rules":[ + {"action":1,"custom":{"resource_key":"/settings","resource_value":"{}"}}, + {"action":1,"custom":{"resource_key":"/device[DC1]/endpoint[int]/settings","resource_value":"{}"}}, + {"action":1,"custom":{"resource_key":"/device[DC2]/endpoint[int]/settings","resource_value":"{}"}} + ]} + } + ] +} diff --git a/src/tests/scenario2/dump_logs.sh b/src/tests/scenario2/dump_logs.sh new file mode 100755 index 0000000000000000000000000000000000000000..7b1dc9d17aabcf8866b76ed1acdb367eee0e3b51 --- /dev/null +++ b/src/tests/scenario2/dump_logs.sh @@ -0,0 +1,76 @@ +#!/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. + + +rm -rf tmp/exec + +echo "Collecting logs for MockBlockChain..." +mkdir -p tmp/exec/mbc +kubectl --namespace tfs-bchain logs deployments/mock-blockchain server > tmp/exec/mbc/mock-blockchain.log +printf "\n" + +echo "Collecting logs for Domain 1..." +mkdir -p tmp/exec/dom1 +kubectl --namespace tfs-dom1 logs deployments/contextservice server > tmp/exec/dom1/context.log +kubectl --namespace tfs-dom1 logs deployments/deviceservice server > tmp/exec/dom1/device.log +kubectl --namespace tfs-dom1 logs deployments/serviceservice server > tmp/exec/dom1/service.log +kubectl --namespace tfs-dom1 logs deployments/pathcompservice frontend > tmp/exec/dom1/pathcomp-frontend.log +kubectl --namespace tfs-dom1 logs deployments/pathcompservice backend > tmp/exec/dom1/pathcomp-backend.log +kubectl --namespace tfs-dom1 logs deployments/sliceservice server > tmp/exec/dom1/slice.log +kubectl --namespace tfs-dom1 logs deployments/interdomainservice server > tmp/exec/dom1/interdomain.log +kubectl --namespace tfs-dom1 logs deployments/dltservice connector > tmp/exec/dom1/dlt-connector.log +kubectl --namespace tfs-dom1 logs deployments/dltservice gateway > tmp/exec/dom1/dlt-gateway.log +printf "\n" + +echo "Collecting logs for Domain 2..." +mkdir -p tmp/exec/dom2 +kubectl --namespace tfs-dom2 logs deployments/contextservice server > tmp/exec/dom2/context.log +kubectl --namespace tfs-dom2 logs deployments/deviceservice server > tmp/exec/dom2/device.log +kubectl --namespace tfs-dom2 logs deployments/serviceservice server > tmp/exec/dom2/service.log +kubectl --namespace tfs-dom2 logs deployments/pathcompservice frontend > tmp/exec/dom2/pathcomp-frontend.log +kubectl --namespace tfs-dom2 logs deployments/pathcompservice backend > tmp/exec/dom2/pathcomp-backend.log +kubectl --namespace tfs-dom2 logs deployments/sliceservice server > tmp/exec/dom2/slice.log +kubectl --namespace tfs-dom2 logs deployments/interdomainservice server > tmp/exec/dom2/interdomain.log +kubectl --namespace tfs-dom2 logs deployments/dltservice connector > tmp/exec/dom2/dlt-connector.log +kubectl --namespace tfs-dom2 logs deployments/dltservice gateway > tmp/exec/dom2/dlt-gateway.log +printf "\n" + +echo "Collecting logs for Domain 3..." +mkdir -p tmp/exec/dom3 +kubectl --namespace tfs-dom3 logs deployments/contextservice server > tmp/exec/dom3/context.log +kubectl --namespace tfs-dom3 logs deployments/deviceservice server > tmp/exec/dom3/device.log +kubectl --namespace tfs-dom3 logs deployments/serviceservice server > tmp/exec/dom3/service.log +kubectl --namespace tfs-dom3 logs deployments/pathcompservice frontend > tmp/exec/dom3/pathcomp-frontend.log +kubectl --namespace tfs-dom3 logs deployments/pathcompservice backend > tmp/exec/dom3/pathcomp-backend.log +kubectl --namespace tfs-dom3 logs deployments/sliceservice server > tmp/exec/dom3/slice.log +kubectl --namespace tfs-dom3 logs deployments/interdomainservice server > tmp/exec/dom3/interdomain.log +kubectl --namespace tfs-dom3 logs deployments/dltservice connector > tmp/exec/dom3/dlt-connector.log +kubectl --namespace tfs-dom3 logs deployments/dltservice gateway > tmp/exec/dom3/dlt-gateway.log +printf "\n" + +echo "Collecting logs for Domain 4..." +mkdir -p tmp/exec/dom4 +kubectl --namespace tfs-dom4 logs deployments/contextservice server > tmp/exec/dom4/context.log +kubectl --namespace tfs-dom4 logs deployments/deviceservice server > tmp/exec/dom4/device.log +kubectl --namespace tfs-dom4 logs deployments/serviceservice server > tmp/exec/dom4/service.log +kubectl --namespace tfs-dom4 logs deployments/pathcompservice frontend > tmp/exec/dom4/pathcomp-frontend.log +kubectl --namespace tfs-dom4 logs deployments/pathcompservice backend > tmp/exec/dom4/pathcomp-backend.log +kubectl --namespace tfs-dom4 logs deployments/sliceservice server > tmp/exec/dom4/slice.log +kubectl --namespace tfs-dom4 logs deployments/interdomainservice server > tmp/exec/dom4/interdomain.log +kubectl --namespace tfs-dom4 logs deployments/dltservice connector > tmp/exec/dom4/dlt-connector.log +kubectl --namespace tfs-dom4 logs deployments/dltservice gateway > tmp/exec/dom4/dlt-gateway.log +printf "\n" + +echo "Done!" diff --git a/src/tests/scenario2/fast_redeploy.sh b/src/tests/scenario2/fast_redeploy.sh new file mode 100755 index 0000000000000000000000000000000000000000..87eef3651e2be7a31068c7f418dd7bf815c2e471 --- /dev/null +++ b/src/tests/scenario2/fast_redeploy.sh @@ -0,0 +1,123 @@ +#!/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. + + +kubectl delete namespace tfs-dom1 tfs-dom2 tfs-dom3 tfs-dom4 + +echo "Deploying tfs-dom1 ..." +kubectl delete -f nfvsdn22/nginx-ingress-controller-dom1.yaml > ./tmp/logs/deploy-tfs-dom1.log +kubectl create namespace tfs-dom1 > ./tmp/logs/deploy-tfs-dom1.log +kubectl apply -f nfvsdn22/nginx-ingress-controller-dom1.yaml > ./tmp/logs/deploy-tfs-dom1.log +kubectl --namespace tfs-dom1 apply -f ./tmp/manifests/contextservice.yaml > ./tmp/logs/deploy-tfs-dom1.log +kubectl --namespace tfs-dom1 apply -f ./tmp/manifests/deviceservice.yaml > ./tmp/logs/deploy-tfs-dom1.log +kubectl --namespace tfs-dom1 apply -f ./tmp/manifests/pathcompservice.yaml > ./tmp/logs/deploy-tfs-dom1.log +kubectl --namespace tfs-dom1 apply -f ./tmp/manifests/serviceservice.yaml > ./tmp/logs/deploy-tfs-dom1.log +kubectl --namespace tfs-dom1 apply -f ./tmp/manifests/sliceservice.yaml > ./tmp/logs/deploy-tfs-dom1.log +kubectl --namespace tfs-dom1 apply -f ./tmp/manifests/dltservice.yaml > ./tmp/logs/deploy-tfs-dom1.log +kubectl --namespace tfs-dom1 apply -f ./tmp/manifests/interdomainservice.yaml > ./tmp/logs/deploy-tfs-dom1.log +kubectl --namespace tfs-dom1 apply -f ./tmp/manifests/webuiservice.yaml > ./tmp/logs/deploy-tfs-dom1.log +kubectl --namespace tfs-dom1 apply -f nfvsdn22/tfs-ingress-dom1.yaml > ./tmp/logs/deploy-tfs-dom1.log +printf "\n" + +echo "Deploying tfs-dom2 ..." +kubectl delete -f nfvsdn22/nginx-ingress-controller-dom2.yaml > ./tmp/logs/deploy-tfs-dom2.log +kubectl create namespace tfs-dom2 > ./tmp/logs/deploy-tfs-dom2.log +kubectl apply -f nfvsdn22/nginx-ingress-controller-dom2.yaml > ./tmp/logs/deploy-tfs-dom2.log +kubectl --namespace tfs-dom2 apply -f ./tmp/manifests/contextservice.yaml > ./tmp/logs/deploy-tfs-dom2.log +kubectl --namespace tfs-dom2 apply -f ./tmp/manifests/deviceservice.yaml > ./tmp/logs/deploy-tfs-dom2.log +kubectl --namespace tfs-dom2 apply -f ./tmp/manifests/pathcompservice.yaml > ./tmp/logs/deploy-tfs-dom2.log +kubectl --namespace tfs-dom2 apply -f ./tmp/manifests/serviceservice.yaml > ./tmp/logs/deploy-tfs-dom2.log +kubectl --namespace tfs-dom2 apply -f ./tmp/manifests/sliceservice.yaml > ./tmp/logs/deploy-tfs-dom2.log +kubectl --namespace tfs-dom2 apply -f ./tmp/manifests/dltservice.yaml > ./tmp/logs/deploy-tfs-dom2.log +kubectl --namespace tfs-dom2 apply -f ./tmp/manifests/interdomainservice.yaml > ./tmp/logs/deploy-tfs-dom2.log +kubectl --namespace tfs-dom2 apply -f ./tmp/manifests/webuiservice.yaml > ./tmp/logs/deploy-tfs-dom2.log +kubectl --namespace tfs-dom2 apply -f nfvsdn22/tfs-ingress-dom2.yaml > ./tmp/logs/deploy-tfs-dom2.log +printf "\n" + +echo "Deploying tfs-dom3 ..." +kubectl delete -f nfvsdn22/nginx-ingress-controller-dom3.yaml > ./tmp/logs/deploy-tfs-dom3.log +kubectl create namespace tfs-dom3 > ./tmp/logs/deploy-tfs-dom3.log +kubectl apply -f nfvsdn22/nginx-ingress-controller-dom3.yaml > ./tmp/logs/deploy-tfs-dom3.log +kubectl --namespace tfs-dom3 apply -f ./tmp/manifests/contextservice.yaml > ./tmp/logs/deploy-tfs-dom3.log +kubectl --namespace tfs-dom3 apply -f ./tmp/manifests/deviceservice.yaml > ./tmp/logs/deploy-tfs-dom3.log +kubectl --namespace tfs-dom3 apply -f ./tmp/manifests/pathcompservice.yaml > ./tmp/logs/deploy-tfs-dom3.log +kubectl --namespace tfs-dom3 apply -f ./tmp/manifests/serviceservice.yaml > ./tmp/logs/deploy-tfs-dom3.log +kubectl --namespace tfs-dom3 apply -f ./tmp/manifests/sliceservice.yaml > ./tmp/logs/deploy-tfs-dom3.log +kubectl --namespace tfs-dom3 apply -f ./tmp/manifests/dltservice.yaml > ./tmp/logs/deploy-tfs-dom3.log +kubectl --namespace tfs-dom3 apply -f ./tmp/manifests/interdomainservice.yaml > ./tmp/logs/deploy-tfs-dom3.log +kubectl --namespace tfs-dom3 apply -f ./tmp/manifests/webuiservice.yaml > ./tmp/logs/deploy-tfs-dom3.log +kubectl --namespace tfs-dom3 apply -f nfvsdn22/tfs-ingress-dom3.yaml > ./tmp/logs/deploy-tfs-dom3.log +printf "\n" + +echo "Deploying tfs-dom4 ..." +kubectl delete -f nfvsdn22/nginx-ingress-controller-dom4.yaml > ./tmp/logs/deploy-tfs-dom4.log +kubectl create namespace tfs-dom4 > ./tmp/logs/deploy-tfs-dom4.log +kubectl apply -f nfvsdn22/nginx-ingress-controller-dom4.yaml > ./tmp/logs/deploy-tfs-dom4.log +kubectl --namespace tfs-dom4 apply -f ./tmp/manifests/contextservice.yaml > ./tmp/logs/deploy-tfs-dom4.log +kubectl --namespace tfs-dom4 apply -f ./tmp/manifests/deviceservice.yaml > ./tmp/logs/deploy-tfs-dom4.log +kubectl --namespace tfs-dom4 apply -f ./tmp/manifests/pathcompservice.yaml > ./tmp/logs/deploy-tfs-dom4.log +kubectl --namespace tfs-dom4 apply -f ./tmp/manifests/serviceservice.yaml > ./tmp/logs/deploy-tfs-dom4.log +kubectl --namespace tfs-dom4 apply -f ./tmp/manifests/sliceservice.yaml > ./tmp/logs/deploy-tfs-dom4.log +kubectl --namespace tfs-dom4 apply -f ./tmp/manifests/dltservice.yaml > ./tmp/logs/deploy-tfs-dom4.log +kubectl --namespace tfs-dom4 apply -f ./tmp/manifests/interdomainservice.yaml > ./tmp/logs/deploy-tfs-dom4.log +kubectl --namespace tfs-dom4 apply -f ./tmp/manifests/webuiservice.yaml > ./tmp/logs/deploy-tfs-dom4.log +kubectl --namespace tfs-dom4 apply -f nfvsdn22/tfs-ingress-dom4.yaml > ./tmp/logs/deploy-tfs-dom4.log +printf "\n" + +echo "Waiting tfs-dom1 ..." +kubectl wait --namespace tfs-dom1 --for='condition=available' --timeout=300s deployment/contextservice +kubectl wait --namespace tfs-dom1 --for='condition=available' --timeout=300s deployment/deviceservice +kubectl wait --namespace tfs-dom1 --for='condition=available' --timeout=300s deployment/pathcompservice +kubectl wait --namespace tfs-dom1 --for='condition=available' --timeout=300s deployment/serviceservice +kubectl wait --namespace tfs-dom1 --for='condition=available' --timeout=300s deployment/sliceservice +kubectl wait --namespace tfs-dom1 --for='condition=available' --timeout=300s deployment/dltservice +kubectl wait --namespace tfs-dom1 --for='condition=available' --timeout=300s deployment/interdomainservice +kubectl wait --namespace tfs-dom1 --for='condition=available' --timeout=300s deployment/webuiservice +printf "\n" + +echo "Waiting tfs-dom2 ..." +kubectl wait --namespace tfs-dom2 --for='condition=available' --timeout=300s deployment/contextservice +kubectl wait --namespace tfs-dom2 --for='condition=available' --timeout=300s deployment/deviceservice +kubectl wait --namespace tfs-dom2 --for='condition=available' --timeout=300s deployment/pathcompservice +kubectl wait --namespace tfs-dom2 --for='condition=available' --timeout=300s deployment/serviceservice +kubectl wait --namespace tfs-dom2 --for='condition=available' --timeout=300s deployment/sliceservice +kubectl wait --namespace tfs-dom2 --for='condition=available' --timeout=300s deployment/dltservice +kubectl wait --namespace tfs-dom2 --for='condition=available' --timeout=300s deployment/interdomainservice +kubectl wait --namespace tfs-dom2 --for='condition=available' --timeout=300s deployment/webuiservice +printf "\n" + +echo "Waiting tfs-dom3 ..." +kubectl wait --namespace tfs-dom3 --for='condition=available' --timeout=300s deployment/contextservice +kubectl wait --namespace tfs-dom3 --for='condition=available' --timeout=300s deployment/deviceservice +kubectl wait --namespace tfs-dom3 --for='condition=available' --timeout=300s deployment/pathcompservice +kubectl wait --namespace tfs-dom3 --for='condition=available' --timeout=300s deployment/serviceservice +kubectl wait --namespace tfs-dom3 --for='condition=available' --timeout=300s deployment/sliceservice +kubectl wait --namespace tfs-dom3 --for='condition=available' --timeout=300s deployment/dltservice +kubectl wait --namespace tfs-dom3 --for='condition=available' --timeout=300s deployment/interdomainservice +kubectl wait --namespace tfs-dom3 --for='condition=available' --timeout=300s deployment/webuiservice +printf "\n" + +echo "Waiting tfs-dom4 ..." +kubectl wait --namespace tfs-dom4 --for='condition=available' --timeout=300s deployment/contextservice +kubectl wait --namespace tfs-dom4 --for='condition=available' --timeout=300s deployment/deviceservice +kubectl wait --namespace tfs-dom4 --for='condition=available' --timeout=300s deployment/pathcompservice +kubectl wait --namespace tfs-dom4 --for='condition=available' --timeout=300s deployment/serviceservice +kubectl wait --namespace tfs-dom4 --for='condition=available' --timeout=300s deployment/sliceservice +kubectl wait --namespace tfs-dom4 --for='condition=available' --timeout=300s deployment/dltservice +kubectl wait --namespace tfs-dom4 --for='condition=available' --timeout=300s deployment/interdomainservice +kubectl wait --namespace tfs-dom4 --for='condition=available' --timeout=300s deployment/webuiservice +printf "\n" + +echo "Done!" diff --git a/src/tests/scenario2/nginx-ingress-controller-dom1.yaml b/src/tests/scenario2/nginx-ingress-controller-dom1.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1815bfbaa481ef269c513f8b55d949127f10bc30 --- /dev/null +++ b/src/tests/scenario2/nginx-ingress-controller-dom1.yaml @@ -0,0 +1,134 @@ +# 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: ConfigMap +metadata: + name: nginx-load-balancer-microk8s-conf-dom1 + namespace: ingress +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-ingress-udp-microk8s-conf-dom1 + namespace: ingress +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-ingress-tcp-microk8s-conf-dom1 + namespace: ingress +--- +apiVersion: networking.k8s.io/v1 +kind: IngressClass +metadata: + name: tfs-ingress-class-dom1 + annotations: + ingressclass.kubernetes.io/is-default-class: "false" +spec: + controller: tfs.etsi.org/controller-class-dom1 +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: nginx-ingress-microk8s-controller-dom1 + namespace: ingress + labels: + microk8s-application: nginx-ingress-microk8s-dom1 +spec: + selector: + matchLabels: + name: nginx-ingress-microk8s-dom1 + updateStrategy: + rollingUpdate: + maxSurge: 0 + maxUnavailable: 1 + type: RollingUpdate + template: + metadata: + labels: + name: nginx-ingress-microk8s-dom1 + spec: + terminationGracePeriodSeconds: 60 + restartPolicy: Always + serviceAccountName: nginx-ingress-microk8s-serviceaccount + containers: + - image: k8s.gcr.io/ingress-nginx/controller:v1.2.0 + imagePullPolicy: IfNotPresent + name: nginx-ingress-microk8s + livenessProbe: + httpGet: + path: /healthz + port: 10254 + scheme: HTTP + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /healthz + port: 10254 + scheme: HTTP + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + timeoutSeconds: 5 + lifecycle: + preStop: + exec: + command: + - /wait-shutdown + securityContext: + capabilities: + add: + - NET_BIND_SERVICE + drop: + - ALL + runAsUser: 101 # www-data + env: + - name: POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + ports: + - name: http + containerPort: 80 + hostPort: 8001 + protocol: TCP + - name: https + containerPort: 443 + hostPort: 4431 + protocol: TCP + - name: health + containerPort: 10254 + hostPort: 12541 + protocol: TCP + args: + - /nginx-ingress-controller + - --configmap=$(POD_NAMESPACE)/nginx-load-balancer-microk8s-conf-dom1 + - --tcp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-tcp-microk8s-conf-dom1 + - --udp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-udp-microk8s-conf-dom1 + - --election-id=ingress-controller-leader-dom1 + - --controller-class=tfs.etsi.org/controller-class-dom1 + - --ingress-class=tfs-ingress-class-dom1 + - ' ' + - --publish-status-address=127.0.0.1 diff --git a/src/tests/scenario2/nginx-ingress-controller-dom2.yaml b/src/tests/scenario2/nginx-ingress-controller-dom2.yaml new file mode 100644 index 0000000000000000000000000000000000000000..dede032850092733aa9b3136f20ecf078b2ce05a --- /dev/null +++ b/src/tests/scenario2/nginx-ingress-controller-dom2.yaml @@ -0,0 +1,134 @@ +# 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: ConfigMap +metadata: + name: nginx-load-balancer-microk8s-conf-dom2 + namespace: ingress +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-ingress-udp-microk8s-conf-dom2 + namespace: ingress +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-ingress-tcp-microk8s-conf-dom2 + namespace: ingress +--- +apiVersion: networking.k8s.io/v1 +kind: IngressClass +metadata: + name: tfs-ingress-class-dom2 + annotations: + ingressclass.kubernetes.io/is-default-class: "false" +spec: + controller: tfs.etsi.org/controller-class-dom2 +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: nginx-ingress-microk8s-controller-dom2 + namespace: ingress + labels: + microk8s-application: nginx-ingress-microk8s-dom2 +spec: + selector: + matchLabels: + name: nginx-ingress-microk8s-dom2 + updateStrategy: + rollingUpdate: + maxSurge: 0 + maxUnavailable: 1 + type: RollingUpdate + template: + metadata: + labels: + name: nginx-ingress-microk8s-dom2 + spec: + terminationGracePeriodSeconds: 60 + restartPolicy: Always + serviceAccountName: nginx-ingress-microk8s-serviceaccount + containers: + - image: k8s.gcr.io/ingress-nginx/controller:v1.2.0 + imagePullPolicy: IfNotPresent + name: nginx-ingress-microk8s + livenessProbe: + httpGet: + path: /healthz + port: 10254 + scheme: HTTP + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /healthz + port: 10254 + scheme: HTTP + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + timeoutSeconds: 5 + lifecycle: + preStop: + exec: + command: + - /wait-shutdown + securityContext: + capabilities: + add: + - NET_BIND_SERVICE + drop: + - ALL + runAsUser: 101 # www-data + env: + - name: POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + ports: + - name: http + containerPort: 80 + hostPort: 8002 + protocol: TCP + - name: https + containerPort: 443 + hostPort: 4432 + protocol: TCP + - name: health + containerPort: 10254 + hostPort: 12542 + protocol: TCP + args: + - /nginx-ingress-controller + - --configmap=$(POD_NAMESPACE)/nginx-load-balancer-microk8s-conf-dom2 + - --tcp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-tcp-microk8s-conf-dom2 + - --udp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-udp-microk8s-conf-dom2 + - --election-id=ingress-controller-leader-dom2 + - --controller-class=tfs.etsi.org/controller-class-dom2 + - --ingress-class=tfs-ingress-class-dom2 + - ' ' + - --publish-status-address=127.0.0.1 diff --git a/src/tests/scenario2/nginx-ingress-controller-dom3.yaml b/src/tests/scenario2/nginx-ingress-controller-dom3.yaml new file mode 100644 index 0000000000000000000000000000000000000000..10896ddd0aa335db947a9b072b722e57729253b0 --- /dev/null +++ b/src/tests/scenario2/nginx-ingress-controller-dom3.yaml @@ -0,0 +1,134 @@ +# 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: ConfigMap +metadata: + name: nginx-load-balancer-microk8s-conf-dom3 + namespace: ingress +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-ingress-udp-microk8s-conf-dom3 + namespace: ingress +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-ingress-tcp-microk8s-conf-dom3 + namespace: ingress +--- +apiVersion: networking.k8s.io/v1 +kind: IngressClass +metadata: + name: tfs-ingress-class-dom3 + annotations: + ingressclass.kubernetes.io/is-default-class: "false" +spec: + controller: tfs.etsi.org/controller-class-dom3 +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: nginx-ingress-microk8s-controller-dom3 + namespace: ingress + labels: + microk8s-application: nginx-ingress-microk8s-dom3 +spec: + selector: + matchLabels: + name: nginx-ingress-microk8s-dom3 + updateStrategy: + rollingUpdate: + maxSurge: 0 + maxUnavailable: 1 + type: RollingUpdate + template: + metadata: + labels: + name: nginx-ingress-microk8s-dom3 + spec: + terminationGracePeriodSeconds: 60 + restartPolicy: Always + serviceAccountName: nginx-ingress-microk8s-serviceaccount + containers: + - image: k8s.gcr.io/ingress-nginx/controller:v1.2.0 + imagePullPolicy: IfNotPresent + name: nginx-ingress-microk8s + livenessProbe: + httpGet: + path: /healthz + port: 10254 + scheme: HTTP + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /healthz + port: 10254 + scheme: HTTP + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + timeoutSeconds: 5 + lifecycle: + preStop: + exec: + command: + - /wait-shutdown + securityContext: + capabilities: + add: + - NET_BIND_SERVICE + drop: + - ALL + runAsUser: 101 # www-data + env: + - name: POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + ports: + - name: http + containerPort: 80 + hostPort: 8003 + protocol: TCP + - name: https + containerPort: 443 + hostPort: 4433 + protocol: TCP + - name: health + containerPort: 10254 + hostPort: 12543 + protocol: TCP + args: + - /nginx-ingress-controller + - --configmap=$(POD_NAMESPACE)/nginx-load-balancer-microk8s-conf-dom3 + - --tcp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-tcp-microk8s-conf-dom3 + - --udp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-udp-microk8s-conf-dom3 + - --election-id=ingress-controller-leader-dom3 + - --controller-class=tfs.etsi.org/controller-class-dom3 + - --ingress-class=tfs-ingress-class-dom3 + - ' ' + - --publish-status-address=127.0.0.1 diff --git a/src/tests/scenario2/nginx-ingress-controller-dom4.yaml b/src/tests/scenario2/nginx-ingress-controller-dom4.yaml new file mode 100644 index 0000000000000000000000000000000000000000..07df5b1638803f0ec2bb23758c14d4fc6fdf6103 --- /dev/null +++ b/src/tests/scenario2/nginx-ingress-controller-dom4.yaml @@ -0,0 +1,134 @@ +# 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: ConfigMap +metadata: + name: nginx-load-balancer-microk8s-conf-dom4 + namespace: ingress +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-ingress-udp-microk8s-conf-dom4 + namespace: ingress +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-ingress-tcp-microk8s-conf-dom4 + namespace: ingress +--- +apiVersion: networking.k8s.io/v1 +kind: IngressClass +metadata: + name: tfs-ingress-class-dom4 + annotations: + ingressclass.kubernetes.io/is-default-class: "false" +spec: + controller: tfs.etsi.org/controller-class-dom4 +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: nginx-ingress-microk8s-controller-dom4 + namespace: ingress + labels: + microk8s-application: nginx-ingress-microk8s-dom4 +spec: + selector: + matchLabels: + name: nginx-ingress-microk8s-dom4 + updateStrategy: + rollingUpdate: + maxSurge: 0 + maxUnavailable: 1 + type: RollingUpdate + template: + metadata: + labels: + name: nginx-ingress-microk8s-dom4 + spec: + terminationGracePeriodSeconds: 60 + restartPolicy: Always + serviceAccountName: nginx-ingress-microk8s-serviceaccount + containers: + - image: k8s.gcr.io/ingress-nginx/controller:v1.2.0 + imagePullPolicy: IfNotPresent + name: nginx-ingress-microk8s + livenessProbe: + httpGet: + path: /healthz + port: 10254 + scheme: HTTP + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /healthz + port: 10254 + scheme: HTTP + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + timeoutSeconds: 5 + lifecycle: + preStop: + exec: + command: + - /wait-shutdown + securityContext: + capabilities: + add: + - NET_BIND_SERVICE + drop: + - ALL + runAsUser: 101 # www-data + env: + - name: POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + ports: + - name: http + containerPort: 80 + hostPort: 8004 + protocol: TCP + - name: https + containerPort: 443 + hostPort: 4434 + protocol: TCP + - name: health + containerPort: 10254 + hostPort: 12544 + protocol: TCP + args: + - /nginx-ingress-controller + - --configmap=$(POD_NAMESPACE)/nginx-load-balancer-microk8s-conf-dom4 + - --tcp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-tcp-microk8s-conf-dom4 + - --udp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-udp-microk8s-conf-dom4 + - --election-id=ingress-controller-leader-dom4 + - --controller-class=tfs.etsi.org/controller-class-dom4 + - --ingress-class=tfs-ingress-class-dom4 + - ' ' + - --publish-status-address=127.0.0.1 diff --git a/src/tests/scenario2/reset.sh b/src/tests/scenario2/reset.sh new file mode 100755 index 0000000000000000000000000000000000000000..5f4a3b8e5b8a58d8f2acf7c60cde1e77c2e1873a --- /dev/null +++ b/src/tests/scenario2/reset.sh @@ -0,0 +1,23 @@ +#!/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. + + +kubectl --namespace tfs-dom1 scale --replicas=0 \ + deployment/contextservice deployment/deviceservice deployment/pathcompservice deployment/serviceservice \ + deployment/sliceservice deployment/dltservice deployment/interdomainservice deployment/webuiservice + +kubectl --namespace tfs-dom1 scale --replicas=1 \ + deployment/contextservice deployment/deviceservice deployment/pathcompservice deployment/serviceservice \ + deployment/sliceservice deployment/dltservice deployment/interdomainservice deployment/webuiservice diff --git a/src/tests/scenario2/show_deploy.sh b/src/tests/scenario2/show_deploy.sh new file mode 100755 index 0000000000000000000000000000000000000000..2aa8de873cf22e75be830c713fc379df9df154a4 --- /dev/null +++ b/src/tests/scenario2/show_deploy.sh @@ -0,0 +1,26 @@ +#!/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. + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +echo "Deployment Resources:" +kubectl --namespace tfs-dom1 get all +printf "\n" + +echo "Deployment Ingress:" +kubectl --namespace tfs-dom1 get ingress +printf "\n" diff --git a/src/tests/scenario2/tfs-ingress-dom1.yaml b/src/tests/scenario2/tfs-ingress-dom1.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c638377ee5469d861b22908af0e2b7c1d5d0abf6 --- /dev/null +++ b/src/tests/scenario2/tfs-ingress-dom1.yaml @@ -0,0 +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. + +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: tfs-ingress-dom1 + annotations: + nginx.ingress.kubernetes.io/rewrite-target: /$2 +spec: + ingressClassName: tfs-ingress-class-dom1 + rules: + - http: + paths: + - path: /webui(/|$)(.*) + pathType: Prefix + backend: + service: + name: webuiservice + port: + number: 8004 + - path: /grafana(/|$)(.*) + pathType: Prefix + backend: + service: + name: webuiservice + port: + number: 3000 + - path: /context(/|$)(.*) + pathType: Prefix + backend: + service: + name: contextservice + port: + number: 8080 + - path: /()(restconf/.*) + pathType: Prefix + backend: + service: + name: computeservice + port: + number: 8080 diff --git a/src/tests/scenario2/tfs-ingress-dom2.yaml b/src/tests/scenario2/tfs-ingress-dom2.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d07b73ee2a94d6ed54b4b5658c595e1ce635bddb --- /dev/null +++ b/src/tests/scenario2/tfs-ingress-dom2.yaml @@ -0,0 +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. + +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: tfs-ingress-dom2 + annotations: + nginx.ingress.kubernetes.io/rewrite-target: /$2 +spec: + ingressClassName: tfs-ingress-class-dom2 + rules: + - http: + paths: + - path: /webui(/|$)(.*) + pathType: Prefix + backend: + service: + name: webuiservice + port: + number: 8004 + - path: /grafana(/|$)(.*) + pathType: Prefix + backend: + service: + name: webuiservice + port: + number: 3000 + - path: /context(/|$)(.*) + pathType: Prefix + backend: + service: + name: contextservice + port: + number: 8080 + - path: /()(restconf/.*) + pathType: Prefix + backend: + service: + name: computeservice + port: + number: 8080 diff --git a/src/tests/scenario2/tfs-ingress-dom3.yaml b/src/tests/scenario2/tfs-ingress-dom3.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1c28c0eba275f3ce605c3824e0f2281081d28d7f --- /dev/null +++ b/src/tests/scenario2/tfs-ingress-dom3.yaml @@ -0,0 +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. + +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: tfs-ingress-dom3 + annotations: + nginx.ingress.kubernetes.io/rewrite-target: /$2 +spec: + ingressClassName: tfs-ingress-class-dom3 + rules: + - http: + paths: + - path: /webui(/|$)(.*) + pathType: Prefix + backend: + service: + name: webuiservice + port: + number: 8004 + - path: /grafana(/|$)(.*) + pathType: Prefix + backend: + service: + name: webuiservice + port: + number: 3000 + - path: /context(/|$)(.*) + pathType: Prefix + backend: + service: + name: contextservice + port: + number: 8080 + - path: /()(restconf/.*) + pathType: Prefix + backend: + service: + name: computeservice + port: + number: 8080 diff --git a/src/tests/scenario2/tfs-ingress-dom4.yaml b/src/tests/scenario2/tfs-ingress-dom4.yaml new file mode 100644 index 0000000000000000000000000000000000000000..48718d775583e83e55ee3ab3a3b794ce8f0c43ef --- /dev/null +++ b/src/tests/scenario2/tfs-ingress-dom4.yaml @@ -0,0 +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. + +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: tfs-ingress-dom4 + annotations: + nginx.ingress.kubernetes.io/rewrite-target: /$2 +spec: + ingressClassName: tfs-ingress-class-dom4 + rules: + - http: + paths: + - path: /webui(/|$)(.*) + pathType: Prefix + backend: + service: + name: webuiservice + port: + number: 8004 + - path: /grafana(/|$)(.*) + pathType: Prefix + backend: + service: + name: webuiservice + port: + number: 3000 + - path: /context(/|$)(.*) + pathType: Prefix + backend: + service: + name: contextservice + port: + number: 8080 + - path: /()(restconf/.*) + pathType: Prefix + backend: + service: + name: computeservice + port: + number: 8080 diff --git a/src/tests/scenario3/README.md b/src/tests/scenario3/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a89d71f74b4ac35fa78aa5619019c8afad79410d --- /dev/null +++ b/src/tests/scenario3/README.md @@ -0,0 +1 @@ +# Scenario 3 - ... diff --git a/src/tests/tools/__init__.py b/src/tests/tools/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/tests/tools/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/tests/tools/load_scenario/README.md b/src/tests/tools/load_scenario/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3845cbf01dda4385c431a3b52d381360e6dc5e9f --- /dev/null +++ b/src/tests/tools/load_scenario/README.md @@ -0,0 +1,17 @@ +# Tool: Load Scenario: + +Simple tool to populate ETSI TeraFlowSDN controller with same descriptors that can be loaded through the WebUI. + +## Example: + +Deploy TeraFlowSDN controller with your specific settings: +```(bash) +cd ~/tfs-ctrl +source my_deploy.sh +./deploy.sh +``` + +Populate TeraFlowSDN controller with your descriptor file: +```(bash) +./src/tests/tools/load_scenario/run.sh src/tests/tools/load_scenario/example_descriptors.json +``` diff --git a/src/tests/tools/load_scenario/__init__.py b/src/tests/tools/load_scenario/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/tests/tools/load_scenario/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/tests/tools/load_scenario/__main__.py b/src/tests/tools/load_scenario/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..3559f778d7cf850c3bbb4f2d516f45f18423d28c --- /dev/null +++ b/src/tests/tools/load_scenario/__main__.py @@ -0,0 +1,37 @@ +# 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, sys +from common.tests.LoadScenario import load_scenario_from_descriptor +from context.client.ContextClient import ContextClient +from device.client.DeviceClient import DeviceClient +from service.client.ServiceClient import ServiceClient +from slice.client.SliceClient import SliceClient + +logging.basicConfig(level=logging.INFO) +LOGGER = logging.getLogger(__name__) + +def main(): + context_client = ContextClient() + device_client = DeviceClient() + service_client = ServiceClient() + slice_client = SliceClient() + + LOGGER.info('Loading scenario...') + load_scenario_from_descriptor(sys.argv[1], context_client, device_client, service_client, slice_client) + LOGGER.info('Done!') + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/tests/tools/load_scenario/example_descriptors.json b/src/tests/tools/load_scenario/example_descriptors.json new file mode 100644 index 0000000000000000000000000000000000000000..5fb0c086749cab3343277c28a902b3db48651320 --- /dev/null +++ b/src/tests/tools/load_scenario/example_descriptors.json @@ -0,0 +1,229 @@ +{ + "contexts": [ + { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_ids": [], "service_ids": [] + } + ], + "topologies": [ + { + "topology_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_uuid": {"uuid": "admin"} + }, + "device_ids": [ + {"device_uuid": {"uuid": "R1"}}, + {"device_uuid": {"uuid": "R2"}}, + {"device_uuid": {"uuid": "R3"}}, + {"device_uuid": {"uuid": "R4"}}, + {"device_uuid": {"uuid": "R5"}}, + {"device_uuid": {"uuid": "R6"}}, + {"device_uuid": {"uuid": "R7"}} + ], + "link_ids": [ + {"link_uuid": {"uuid": "R1==R2"}}, + {"link_uuid": {"uuid": "R2==R3"}}, + {"link_uuid": {"uuid": "R3==R4"}}, + {"link_uuid": {"uuid": "R4==R5"}}, + {"link_uuid": {"uuid": "R5==R6"}}, + {"link_uuid": {"uuid": "R6==R1"}}, + {"link_uuid": {"uuid": "R1==R7"}}, + {"link_uuid": {"uuid": "R3==R7"}}, + {"link_uuid": {"uuid": "R5==R7"}} + ] + } + ], + "devices": [ + { + "device_id": {"device_uuid": {"uuid": "R1"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper", "uuid": "1/1"}, + {"sample_types": [], "type": "copper", "uuid": "1/2"}, + {"sample_types": [], "type": "copper", "uuid": "1/3"}, + {"sample_types": [], "type": "copper", "uuid": "1/4"}, + {"sample_types": [], "type": "copper", "uuid": "1/5"}, + {"sample_types": [], "type": "copper", "uuid": "1/6"}, + {"sample_types": [], "type": "copper", "uuid": "2/1"}, + {"sample_types": [], "type": "copper", "uuid": "2/2"}, + {"sample_types": [], "type": "copper", "uuid": "2/3"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R2"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper", "uuid": "1/1"}, + {"sample_types": [], "type": "copper", "uuid": "1/2"}, + {"sample_types": [], "type": "copper", "uuid": "1/3"}, + {"sample_types": [], "type": "copper", "uuid": "1/4"}, + {"sample_types": [], "type": "copper", "uuid": "1/5"}, + {"sample_types": [], "type": "copper", "uuid": "1/6"}, + {"sample_types": [], "type": "copper", "uuid": "2/1"}, + {"sample_types": [], "type": "copper", "uuid": "2/2"}, + {"sample_types": [], "type": "copper", "uuid": "2/3"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R3"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper", "uuid": "1/1"}, + {"sample_types": [], "type": "copper", "uuid": "1/2"}, + {"sample_types": [], "type": "copper", "uuid": "1/3"}, + {"sample_types": [], "type": "copper", "uuid": "1/4"}, + {"sample_types": [], "type": "copper", "uuid": "1/5"}, + {"sample_types": [], "type": "copper", "uuid": "1/6"}, + {"sample_types": [], "type": "copper", "uuid": "2/1"}, + {"sample_types": [], "type": "copper", "uuid": "2/2"}, + {"sample_types": [], "type": "copper", "uuid": "2/3"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R4"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper", "uuid": "1/1"}, + {"sample_types": [], "type": "copper", "uuid": "1/2"}, + {"sample_types": [], "type": "copper", "uuid": "1/3"}, + {"sample_types": [], "type": "copper", "uuid": "1/4"}, + {"sample_types": [], "type": "copper", "uuid": "1/5"}, + {"sample_types": [], "type": "copper", "uuid": "1/6"}, + {"sample_types": [], "type": "copper", "uuid": "2/1"}, + {"sample_types": [], "type": "copper", "uuid": "2/2"}, + {"sample_types": [], "type": "copper", "uuid": "2/3"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R5"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper", "uuid": "1/1"}, + {"sample_types": [], "type": "copper", "uuid": "1/2"}, + {"sample_types": [], "type": "copper", "uuid": "1/3"}, + {"sample_types": [], "type": "copper", "uuid": "1/4"}, + {"sample_types": [], "type": "copper", "uuid": "1/5"}, + {"sample_types": [], "type": "copper", "uuid": "1/6"}, + {"sample_types": [], "type": "copper", "uuid": "2/1"}, + {"sample_types": [], "type": "copper", "uuid": "2/2"}, + {"sample_types": [], "type": "copper", "uuid": "2/3"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R6"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper", "uuid": "1/1"}, + {"sample_types": [], "type": "copper", "uuid": "1/2"}, + {"sample_types": [], "type": "copper", "uuid": "1/3"}, + {"sample_types": [], "type": "copper", "uuid": "1/4"}, + {"sample_types": [], "type": "copper", "uuid": "1/5"}, + {"sample_types": [], "type": "copper", "uuid": "1/6"}, + {"sample_types": [], "type": "copper", "uuid": "2/1"}, + {"sample_types": [], "type": "copper", "uuid": "2/2"}, + {"sample_types": [], "type": "copper", "uuid": "2/3"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R7"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"sample_types": [], "type": "copper", "uuid": "1/1"}, + {"sample_types": [], "type": "copper", "uuid": "1/2"}, + {"sample_types": [], "type": "copper", "uuid": "1/3"}, + {"sample_types": [], "type": "copper", "uuid": "2/1"}, + {"sample_types": [], "type": "copper", "uuid": "2/2"}, + {"sample_types": [], "type": "copper", "uuid": "2/3"}, + {"sample_types": [], "type": "copper", "uuid": "2/4"}, + {"sample_types": [], "type": "copper", "uuid": "2/5"}, + {"sample_types": [], "type": "copper", "uuid": "2/6"} + ]}}} + ]} + } + ], + "links": [ + { + "link_id": {"link_uuid": {"uuid": "R1==R2"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1"}}, "endpoint_uuid": {"uuid": "2/1"}}, + {"device_id": {"device_uuid": {"uuid": "R2"}}, "endpoint_uuid": {"uuid": "2/2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2==R3"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2"}}, "endpoint_uuid": {"uuid": "2/1"}}, + {"device_id": {"device_uuid": {"uuid": "R3"}}, "endpoint_uuid": {"uuid": "2/2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R3==R4"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3"}}, "endpoint_uuid": {"uuid": "2/1"}}, + {"device_id": {"device_uuid": {"uuid": "R4"}}, "endpoint_uuid": {"uuid": "2/2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R4==R5"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R4"}}, "endpoint_uuid": {"uuid": "2/1"}}, + {"device_id": {"device_uuid": {"uuid": "R5"}}, "endpoint_uuid": {"uuid": "2/2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R5==R6"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R5"}}, "endpoint_uuid": {"uuid": "2/1"}}, + {"device_id": {"device_uuid": {"uuid": "R6"}}, "endpoint_uuid": {"uuid": "2/2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R6==R1"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R6"}}, "endpoint_uuid": {"uuid": "2/1"}}, + {"device_id": {"device_uuid": {"uuid": "R1"}}, "endpoint_uuid": {"uuid": "2/2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R1==R7"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1"}}, "endpoint_uuid": {"uuid": "2/3"}}, + {"device_id": {"device_uuid": {"uuid": "R7"}}, "endpoint_uuid": {"uuid": "2/1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R3==R7"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3"}}, "endpoint_uuid": {"uuid": "2/3"}}, + {"device_id": {"device_uuid": {"uuid": "R7"}}, "endpoint_uuid": {"uuid": "2/3"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R5==R7"}}, + "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R5"}}, "endpoint_uuid": {"uuid": "2/3"}}, + {"device_id": {"device_uuid": {"uuid": "R7"}}, "endpoint_uuid": {"uuid": "2/5"}} + ] + } + ] +} \ No newline at end of file diff --git a/src/tests/ofc22/show_logs_compute.sh b/src/tests/tools/load_scenario/run.sh similarity index 77% rename from src/tests/ofc22/show_logs_compute.sh rename to src/tests/tools/load_scenario/run.sh index cafde447ace44cc71fc75d27af2a50100f155681..98ebc6c1790ae256c592408ff731e347ec8ebb0e 100755 --- a/src/tests/ofc22/show_logs_compute.sh +++ b/src/tests/tools/load_scenario/run.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,5 +13,5 @@ # See the License for the specific language governing permissions and # limitations under the License. -K8S_NAMESPACE="ofc22" -kubectl --namespace $K8S_NAMESPACE logs deployment/computeservice +source tfs_runtime_env_vars.sh +python -m tests.tools.load_scenario $1 diff --git a/src/tests/tools/mock_osm/Constants.py b/src/tests/tools/mock_osm/Constants.py new file mode 100644 index 0000000000000000000000000000000000000000..8d4145e89274927069a56830c2ed7bef92ced08c --- /dev/null +++ b/src/tests/tools/mock_osm/Constants.py @@ -0,0 +1,16 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +WIM_USERNAME = 'admin' +WIM_PASSWORD = 'admin' diff --git a/src/tests/tools/mock_osm/MockOSM.py b/src/tests/tools/mock_osm/MockOSM.py new file mode 100644 index 0000000000000000000000000000000000000000..338db0e19becc8a9dd277beec7f3b4ceb2e765a3 --- /dev/null +++ b/src/tests/tools/mock_osm/MockOSM.py @@ -0,0 +1,62 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging +from .WimconnectorIETFL2VPN import WimconnectorIETFL2VPN + +LOGGER = logging.getLogger(__name__) + +class MockOSM: + def __init__(self, url, mapping, username, password): + wim = {'wim_url': url} + wim_account = {'user': username, 'password': password} + config = {'mapping_not_needed': False, 'service_endpoint_mapping': mapping} + self.wim = WimconnectorIETFL2VPN(wim, wim_account, config=config) + self.conn_info = {} # internal database emulating OSM storage provided to WIM Connectors + + def create_connectivity_service(self, service_type, connection_points): + LOGGER.info('[create_connectivity_service] service_type={:s}'.format(str(service_type))) + LOGGER.info('[create_connectivity_service] connection_points={:s}'.format(str(connection_points))) + self.wim.check_credentials() + result = self.wim.create_connectivity_service(service_type, connection_points) + LOGGER.info('[create_connectivity_service] result={:s}'.format(str(result))) + service_uuid, conn_info = result + self.conn_info[service_uuid] = conn_info + return service_uuid + + def get_connectivity_service_status(self, service_uuid): + LOGGER.info('[get_connectivity_service] service_uuid={:s}'.format(str(service_uuid))) + conn_info = self.conn_info.get(service_uuid) + if conn_info is None: raise Exception('ServiceId({:s}) not found'.format(str(service_uuid))) + LOGGER.info('[get_connectivity_service] conn_info={:s}'.format(str(conn_info))) + self.wim.check_credentials() + result = self.wim.get_connectivity_service_status(service_uuid, conn_info=conn_info) + LOGGER.info('[get_connectivity_service] result={:s}'.format(str(result))) + return result + + def edit_connectivity_service(self, service_uuid, connection_points): + LOGGER.info('[edit_connectivity_service] service_uuid={:s}'.format(str(service_uuid))) + LOGGER.info('[edit_connectivity_service] connection_points={:s}'.format(str(connection_points))) + conn_info = self.conn_info.get(service_uuid) + if conn_info is None: raise Exception('ServiceId({:s}) not found'.format(str(service_uuid))) + LOGGER.info('[edit_connectivity_service] conn_info={:s}'.format(str(conn_info))) + self.wim.edit_connectivity_service(service_uuid, conn_info=conn_info, connection_points=connection_points) + + def delete_connectivity_service(self, service_uuid): + LOGGER.info('[delete_connectivity_service] service_uuid={:s}'.format(str(service_uuid))) + conn_info = self.conn_info.get(service_uuid) + if conn_info is None: raise Exception('ServiceId({:s}) not found'.format(str(service_uuid))) + LOGGER.info('[delete_connectivity_service] conn_info={:s}'.format(str(conn_info))) + self.wim.check_credentials() + self.wim.delete_connectivity_service(service_uuid, conn_info=conn_info) diff --git a/src/tests/tools/mock_osm/Tools.py b/src/tests/tools/mock_osm/Tools.py new file mode 100644 index 0000000000000000000000000000000000000000..45dfa23c984e175c01efa77371e94454b98ea94e --- /dev/null +++ b/src/tests/tools/mock_osm/Tools.py @@ -0,0 +1,48 @@ +# 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 typing import Dict, Optional + +def compose_service_endpoint_id(site_id : str, endpoint_id : Dict): + device_uuid = endpoint_id['device_id']['device_uuid']['uuid'] + endpoint_uuid = endpoint_id['endpoint_uuid']['uuid'] + return ':'.join([site_id, device_uuid, endpoint_uuid]) + +def wim_mapping(site_id, ce_endpoint_id, pe_device_id : Optional[Dict] = None, priority=None, redundant=[]): + ce_device_uuid = ce_endpoint_id['device_id']['device_uuid']['uuid'] + ce_endpoint_uuid = ce_endpoint_id['endpoint_uuid']['uuid'] + service_endpoint_id = compose_service_endpoint_id(site_id, ce_endpoint_id) + if pe_device_id is None: + bearer = '{:s}:{:s}'.format(ce_device_uuid, ce_endpoint_uuid) + else: + pe_device_uuid = pe_device_id['device_uuid']['uuid'] + bearer = '{:s}:{:s}'.format(ce_device_uuid, pe_device_uuid) + mapping = { + 'service_endpoint_id': service_endpoint_id, + 'datacenter_id': site_id, 'device_id': ce_device_uuid, 'device_interface_id': ce_endpoint_uuid, + 'service_mapping_info': { + 'site-id': site_id, + 'bearer': {'bearer-reference': bearer}, + } + } + if priority is not None: mapping['service_mapping_info']['priority'] = priority + if len(redundant) > 0: mapping['service_mapping_info']['redundant'] = redundant + return service_endpoint_id, mapping + +def connection_point(service_endpoint_id : str, encapsulation_type : str, vlan_id : int): + return { + 'service_endpoint_id': service_endpoint_id, + 'service_endpoint_encapsulation_type': encapsulation_type, + 'service_endpoint_encapsulation_info': {'vlan': vlan_id} + } diff --git a/src/tests/tools/mock_osm/WimconnectorIETFL2VPN.py b/src/tests/tools/mock_osm/WimconnectorIETFL2VPN.py new file mode 100644 index 0000000000000000000000000000000000000000..aa4ca045f41ffdc69d2ebf2fcd9b5db99ce45dbe --- /dev/null +++ b/src/tests/tools/mock_osm/WimconnectorIETFL2VPN.py @@ -0,0 +1,543 @@ +# -*- coding: utf-8 -*- +## +# Copyright 2018 Telefonica +# All Rights Reserved. +# +# Contributors: Oscar Gonzalez de Dios, Manuel Lopez Bravo, Guillermo Pajares Martin +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This work has been performed in the context of the Metro-Haul project - +# funded by the European Commission under Grant number 761727 through the +# Horizon 2020 program. +## +"""The SDN/WIM connector is responsible for establishing wide area network +connectivity. + +This SDN/WIM connector implements the standard IETF RFC 8466 "A YANG Data + Model for Layer 2 Virtual Private Network (L2VPN) Service Delivery" + +It receives the endpoints and the necessary details to request +the Layer 2 service. +""" +import requests +import uuid +import logging +import copy +#from osm_ro_plugin.sdnconn import SdnConnectorBase, SdnConnectorError +from .sdnconn import SdnConnectorBase, SdnConnectorError + +"""Check layer where we move it""" + + +class WimconnectorIETFL2VPN(SdnConnectorBase): + def __init__(self, wim, wim_account, config=None, logger=None): + """IETF L2VPN WIM connector + + Arguments: (To be completed) + wim (dict): WIM record, as stored in the database + wim_account (dict): WIM account record, as stored in the database + """ + self.logger = logging.getLogger("ro.sdn.ietfl2vpn") + super().__init__(wim, wim_account, config, logger) + self.headers = {"Content-Type": "application/json"} + self.mappings = { + m["service_endpoint_id"]: m for m in self.service_endpoint_mapping + } + self.user = wim_account.get("user") + self.passwd = wim_account.get("password") # replace "passwordd" -> "password" + + if self.user and self.passwd is not None: + self.auth = (self.user, self.passwd) + else: + self.auth = None + + self.logger.info("IETFL2VPN Connector Initialized.") + + def check_credentials(self): + endpoint = "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/vpn-services".format( + self.wim["wim_url"] + ) + + try: + response = requests.get(endpoint, auth=self.auth) + http_code = response.status_code + except requests.exceptions.RequestException as e: + raise SdnConnectorError(e.response, http_code=503) + + if http_code != 200: + raise SdnConnectorError("Failed while authenticating", http_code=http_code) + + self.logger.info("Credentials checked") + + def get_connectivity_service_status(self, service_uuid, conn_info=None): + """Monitor the status of the connectivity service stablished + + Arguments: + service_uuid: Connectivity service unique identifier + + Returns: + Examples:: + {'sdn_status': 'ACTIVE'} + {'sdn_status': 'INACTIVE'} + {'sdn_status': 'DOWN'} + {'sdn_status': 'ERROR'} + """ + try: + self.logger.info("Sending get connectivity service stuatus") + servicepoint = "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/vpn-services/vpn-service={}/".format( + self.wim["wim_url"], service_uuid + ) + response = requests.get(servicepoint, auth=self.auth) + self.logger.warning('response.status_code={:s}'.format(str(response.status_code))) + if response.status_code != requests.codes.ok: + raise SdnConnectorError( + "Unable to obtain connectivity servcice status", + http_code=response.status_code, + ) + + service_status = {"sdn_status": "ACTIVE"} + + return service_status + except requests.exceptions.ConnectionError: + raise SdnConnectorError("Request Timeout", http_code=408) + + def search_mapp(self, connection_point): + id = connection_point["service_endpoint_id"] + if id not in self.mappings: + raise SdnConnectorError("Endpoint {} not located".format(str(id))) + else: + return self.mappings[id] + + def create_connectivity_service(self, service_type, connection_points, **kwargs): + """Stablish WAN connectivity between the endpoints + + Arguments: + service_type (str): ``ELINE`` (L2), ``ELAN`` (L2), ``ETREE`` (L2), + ``L3``. + connection_points (list): each point corresponds to + an entry point from the DC to the transport network. One + connection point serves to identify the specific access and + some other service parameters, such as encapsulation type. + Represented by a dict as follows:: + + { + "service_endpoint_id": ..., (str[uuid]) + "service_endpoint_encapsulation_type": ..., + (enum: none, dot1q, ...) + "service_endpoint_encapsulation_info": { + ... (dict) + "vlan": ..., (int, present if encapsulation is dot1q) + "vni": ... (int, present if encapsulation is vxlan), + "peers": [(ipv4_1), (ipv4_2)] + (present if encapsulation is vxlan) + } + } + + The service endpoint ID should be previously informed to the WIM + engine in the RO when the WIM port mapping is registered. + + Keyword Arguments: + bandwidth (int): value in kilobytes + latency (int): value in milliseconds + + Other QoS might be passed as keyword arguments. + + Returns: + tuple: ``(service_id, conn_info)`` containing: + - *service_uuid* (str): UUID of the established connectivity + service + - *conn_info* (dict or None): Information to be stored at the + database (or ``None``). This information will be provided to + the :meth:`~.edit_connectivity_service` and :obj:`~.delete`. + **MUST** be JSON/YAML-serializable (plain data structures). + + Raises: + SdnConnectorException: In case of error. + """ + SETTINGS = { # min_endpoints, max_endpoints, vpn_service_type + 'ELINE': (2, 2, 'vpws'), # Virtual Private Wire Service + 'ELAN' : (2, None, 'vpls'), # Virtual Private LAN Service + } + settings = SETTINGS.get(service_type) + if settings is None: raise NotImplementedError('Unsupported service_type({:s})'.format(str(service_type))) + min_endpoints, max_endpoints, vpn_service_type = settings + + if max_endpoints is not None and len(connection_points) > max_endpoints: + msg = "Connections between more than {:d} endpoints are not supported for service_type {:s}" + raise SdnConnectorError(msg.format(max_endpoints, service_type)) + + if min_endpoints is not None and len(connection_points) < min_endpoints: + msg = "Connections must be of at least {:d} endpoints for service_type {:s}" + raise SdnConnectorError(msg.format(min_endpoints, service_type)) + + """First step, create the vpn service""" + uuid_l2vpn = str(uuid.uuid4()) + vpn_service = {} + vpn_service["vpn-id"] = uuid_l2vpn + vpn_service["vpn-svc-type"] = vpn_service_type + vpn_service["svc-topo"] = "any-to-any" + vpn_service["customer-name"] = "osm" + vpn_service_list = [] + vpn_service_list.append(vpn_service) + vpn_service_l = {"ietf-l2vpn-svc:vpn-service": vpn_service_list} + response_service_creation = None + conn_info = [] + self.logger.info("Sending vpn-service :{}".format(vpn_service_l)) + + try: + endpoint_service_creation = ( + "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/vpn-services".format( + self.wim["wim_url"] + ) + ) + response_service_creation = requests.post( + endpoint_service_creation, + headers=self.headers, + json=vpn_service_l, + auth=self.auth, + ) + except requests.exceptions.ConnectionError: + raise SdnConnectorError( + "Request to create service Timeout", http_code=408 + ) + + if response_service_creation.status_code == 409: + raise SdnConnectorError( + "Service already exists", + http_code=response_service_creation.status_code, + ) + elif response_service_creation.status_code != requests.codes.created: + raise SdnConnectorError( + "Request to create service not accepted", + http_code=response_service_creation.status_code, + ) + + self.logger.info('connection_points = {:s}'.format(str(connection_points))) + + # Check if protected paths are requested + extended_connection_points = [] + for connection_point in connection_points: + extended_connection_points.append(connection_point) + + connection_point_wan_info = self.search_mapp(connection_point) + service_mapping_info = connection_point_wan_info.get('service_mapping_info', {}) + redundant_service_endpoint_ids = service_mapping_info.get('redundant') + + if redundant_service_endpoint_ids is None: continue + if len(redundant_service_endpoint_ids) == 0: continue + + for redundant_service_endpoint_id in redundant_service_endpoint_ids: + redundant_connection_point = copy.deepcopy(connection_point) + redundant_connection_point['service_endpoint_id'] = redundant_service_endpoint_id + extended_connection_points.append(redundant_connection_point) + + self.logger.info('extended_connection_points = {:s}'.format(str(extended_connection_points))) + + """Second step, create the connections and vpn attachments""" + for connection_point in extended_connection_points: + connection_point_wan_info = self.search_mapp(connection_point) + site_network_access = {} + connection = {} + + if connection_point["service_endpoint_encapsulation_type"] != "none": + if ( + connection_point["service_endpoint_encapsulation_type"] + == "dot1q" + ): + """The connection is a VLAN""" + connection["encapsulation-type"] = "dot1q-vlan-tagged" + tagged = {} + tagged_interf = {} + service_endpoint_encapsulation_info = connection_point[ + "service_endpoint_encapsulation_info" + ] + + if service_endpoint_encapsulation_info["vlan"] is None: + raise SdnConnectorError("VLAN must be provided") + + tagged_interf["cvlan-id"] = service_endpoint_encapsulation_info[ + "vlan" + ] + tagged["dot1q-vlan-tagged"] = tagged_interf + connection["tagged-interface"] = tagged + else: + raise NotImplementedError("Encapsulation type not implemented") + + site_network_access["connection"] = connection + self.logger.info("Sending connection:{}".format(connection)) + vpn_attach = {} + vpn_attach["vpn-id"] = uuid_l2vpn + vpn_attach["site-role"] = vpn_service["svc-topo"] + "-role" + site_network_access["vpn-attachment"] = vpn_attach + self.logger.info("Sending vpn-attachement :{}".format(vpn_attach)) + uuid_sna = str(uuid.uuid4()) + site_network_access["network-access-id"] = uuid_sna + site_network_access["bearer"] = connection_point_wan_info[ + "service_mapping_info" + ]["bearer"] + + access_priority = connection_point_wan_info["service_mapping_info"].get("priority") + if access_priority is not None: + availability = {} + availability["access-priority"] = access_priority + availability["single-active"] = [None] + site_network_access["availability"] = availability + + constraint = {} + constraint['constraint-type'] = 'end-to-end-diverse' + constraint['target'] = {'all-other-accesses': [None]} + + access_diversity = {} + access_diversity['constraints'] = {'constraint': []} + access_diversity['constraints']['constraint'].append(constraint) + site_network_access["access-diversity"] = access_diversity + + site_network_accesses = {} + site_network_access_list = [] + site_network_access_list.append(site_network_access) + site_network_accesses[ + "ietf-l2vpn-svc:site-network-access" + ] = site_network_access_list + conn_info_d = {} + conn_info_d["site"] = connection_point_wan_info["service_mapping_info"][ + "site-id" + ] + conn_info_d["site-network-access-id"] = site_network_access[ + "network-access-id" + ] + conn_info_d["mapping"] = None + conn_info.append(conn_info_d) + + try: + endpoint_site_network_access_creation = ( + "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/" + "sites/site={}/site-network-accesses/".format( + self.wim["wim_url"], + connection_point_wan_info["service_mapping_info"][ + "site-id" + ], + ) + ) + response_endpoint_site_network_access_creation = requests.post( + endpoint_site_network_access_creation, + headers=self.headers, + json=site_network_accesses, + auth=self.auth, + ) + + if ( + response_endpoint_site_network_access_creation.status_code + == 409 + ): + self.delete_connectivity_service(vpn_service["vpn-id"]) + + raise SdnConnectorError( + "Site_Network_Access with ID '{}' already exists".format( + site_network_access["network-access-id"] + ), + http_code=response_endpoint_site_network_access_creation.status_code, + ) + elif ( + response_endpoint_site_network_access_creation.status_code + == 400 + ): + self.delete_connectivity_service(vpn_service["vpn-id"]) + + raise SdnConnectorError( + "Site {} does not exist".format( + connection_point_wan_info["service_mapping_info"][ + "site-id" + ] + ), + http_code=response_endpoint_site_network_access_creation.status_code, + ) + elif ( + response_endpoint_site_network_access_creation.status_code + != requests.codes.created + and response_endpoint_site_network_access_creation.status_code + != requests.codes.no_content + ): + self.delete_connectivity_service(vpn_service["vpn-id"]) + + raise SdnConnectorError( + "Request not accepted", + http_code=response_endpoint_site_network_access_creation.status_code, + ) + except requests.exceptions.ConnectionError: + self.delete_connectivity_service(vpn_service["vpn-id"]) + + raise SdnConnectorError("Request Timeout", http_code=408) + + return uuid_l2vpn, conn_info + + def delete_connectivity_service(self, service_uuid, conn_info=None): + """Disconnect multi-site endpoints previously connected + + This method should receive as the first argument the UUID generated by + the ``create_connectivity_service`` + """ + try: + self.logger.info("Sending delete") + servicepoint = "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/vpn-services/vpn-service={}/".format( + self.wim["wim_url"], service_uuid + ) + response = requests.delete(servicepoint, auth=self.auth) + + if response.status_code != requests.codes.no_content: + raise SdnConnectorError( + "Error in the request", http_code=response.status_code + ) + except requests.exceptions.ConnectionError: + raise SdnConnectorError("Request Timeout", http_code=408) + + def edit_connectivity_service( + self, service_uuid, conn_info=None, connection_points=None, **kwargs + ): + """Change an existing connectivity service, see + ``create_connectivity_service``""" + # sites = {"sites": {}} + # site_list = [] + vpn_service = {} + vpn_service["svc-topo"] = "any-to-any" + counter = 0 + + for connection_point in connection_points: + site_network_access = {} + connection_point_wan_info = self.search_mapp(connection_point) + params_site = {} + params_site["site-id"] = connection_point_wan_info["service_mapping_info"][ + "site-id" + ] + params_site["site-vpn-flavor"] = "site-vpn-flavor-single" + device_site = {} + device_site["device-id"] = connection_point_wan_info["device-id"] + params_site["devices"] = device_site + # network_access = {} + connection = {} + + if connection_point["service_endpoint_encapsulation_type"] != "none": + if connection_point["service_endpoint_encapsulation_type"] == "dot1q": + """The connection is a VLAN""" + connection["encapsulation-type"] = "dot1q-vlan-tagged" + tagged = {} + tagged_interf = {} + service_endpoint_encapsulation_info = connection_point[ + "service_endpoint_encapsulation_info" + ] + + if service_endpoint_encapsulation_info["vlan"] is None: + raise SdnConnectorError("VLAN must be provided") + + tagged_interf["cvlan-id"] = service_endpoint_encapsulation_info[ + "vlan" + ] + tagged["dot1q-vlan-tagged"] = tagged_interf + connection["tagged-interface"] = tagged + else: + raise NotImplementedError("Encapsulation type not implemented") + + site_network_access["connection"] = connection + vpn_attach = {} + vpn_attach["vpn-id"] = service_uuid + vpn_attach["site-role"] = vpn_service["svc-topo"] + "-role" + site_network_access["vpn-attachment"] = vpn_attach + uuid_sna = conn_info[counter]["site-network-access-id"] + site_network_access["network-access-id"] = uuid_sna + site_network_access["bearer"] = connection_point_wan_info[ + "service_mapping_info" + ]["bearer"] + site_network_accesses = {} + site_network_access_list = [] + site_network_access_list.append(site_network_access) + site_network_accesses[ + "ietf-l2vpn-svc:site-network-access" + ] = site_network_access_list + + try: + endpoint_site_network_access_edit = ( + "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/" + "sites/site={}/site-network-accesses/".format( + self.wim["wim_url"], + connection_point_wan_info["service_mapping_info"]["site-id"], + ) + ) + response_endpoint_site_network_access_creation = requests.put( + endpoint_site_network_access_edit, + headers=self.headers, + json=site_network_accesses, + auth=self.auth, + ) + + if response_endpoint_site_network_access_creation.status_code == 400: + raise SdnConnectorError( + "Service does not exist", + http_code=response_endpoint_site_network_access_creation.status_code, + ) + elif ( + response_endpoint_site_network_access_creation.status_code != 201 + and response_endpoint_site_network_access_creation.status_code + != 204 + ): + raise SdnConnectorError( + "Request no accepted", + http_code=response_endpoint_site_network_access_creation.status_code, + ) + except requests.exceptions.ConnectionError: + raise SdnConnectorError("Request Timeout", http_code=408) + + counter += 1 + + return None + + def clear_all_connectivity_services(self): + """Delete all WAN Links corresponding to a WIM""" + try: + self.logger.info("Sending clear all connectivity services") + servicepoint = ( + "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/vpn-services".format( + self.wim["wim_url"] + ) + ) + response = requests.delete(servicepoint, auth=self.auth) + + if response.status_code != requests.codes.no_content: + raise SdnConnectorError( + "Unable to clear all connectivity services", + http_code=response.status_code, + ) + except requests.exceptions.ConnectionError: + raise SdnConnectorError("Request Timeout", http_code=408) + + def get_all_active_connectivity_services(self): + """Provide information about all active connections provisioned by a + WIM + """ + try: + self.logger.info("Sending get all connectivity services") + servicepoint = ( + "{}/restconf/data/ietf-l2vpn-svc:l2vpn-svc/vpn-services".format( + self.wim["wim_url"] + ) + ) + response = requests.get(servicepoint, auth=self.auth) + + if response.status_code != requests.codes.ok: + raise SdnConnectorError( + "Unable to get all connectivity services", + http_code=response.status_code, + ) + + return response + except requests.exceptions.ConnectionError: + raise SdnConnectorError("Request Timeout", http_code=408) diff --git a/src/tests/tools/mock_osm/__init__.py b/src/tests/tools/mock_osm/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/tests/tools/mock_osm/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/tests/tools/mock_osm/acknowledgements.txt b/src/tests/tools/mock_osm/acknowledgements.txt new file mode 100644 index 0000000000000000000000000000000000000000..b7ce926dd006d9bc8afaffbed212d90fb05adbef --- /dev/null +++ b/src/tests/tools/mock_osm/acknowledgements.txt @@ -0,0 +1,3 @@ +MockOSM is based on source code taken from: +https://osm.etsi.org/gitlab/osm/ro/-/blob/master/RO-plugin/osm_ro_plugin/sdnconn.py +https://osm.etsi.org/gitlab/osm/ro/-/blob/master/RO-SDN-ietfl2vpn/osm_rosdn_ietfl2vpn/wimconn_ietfl2vpn.py diff --git a/src/tests/tools/mock_osm/sdnconn.py b/src/tests/tools/mock_osm/sdnconn.py new file mode 100644 index 0000000000000000000000000000000000000000..a1849c9ef3e1a1260ff42bbadabc99f91a6435d7 --- /dev/null +++ b/src/tests/tools/mock_osm/sdnconn.py @@ -0,0 +1,242 @@ +# -*- coding: utf-8 -*- +## +# Copyright 2018 University of Bristol - High Performance Networks Research +# Group +# All Rights Reserved. +# +# Contributors: Anderson Bravalheri, Dimitrios Gkounis, Abubakar Siddique +# Muqaddas, Navdeep Uniyal, Reza Nejabati and Dimitra Simeonidou +# +# 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. +# +# For those usages not covered by the Apache License, Version 2.0 please +# contact with: +# +# Neither the name of the University of Bristol nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# This work has been performed in the context of DCMS UK 5G Testbeds +# & Trials Programme and in the framework of the Metro-Haul project - +# funded by the European Commission under Grant number 761727 through the +# Horizon 2020 and 5G-PPP programmes. +## +"""The SDN connector is responsible for establishing both wide area network connectivity (WIM) +and intranet SDN connectivity. + +It receives information from ports to be connected . +""" + +import logging +from http import HTTPStatus + + +class SdnConnectorError(Exception): + """Base Exception for all connector related errors + provide the parameter 'http_code' (int) with the error code: + Bad_Request = 400 + Unauthorized = 401 (e.g. credentials are not valid) + Not_Found = 404 (e.g. try to edit or delete a non existing connectivity service) + Forbidden = 403 + Method_Not_Allowed = 405 + Not_Acceptable = 406 + Request_Timeout = 408 (e.g timeout reaching server, or cannot reach the server) + Conflict = 409 + Service_Unavailable = 503 + Internal_Server_Error = 500 + """ + + def __init__(self, message, http_code=HTTPStatus.INTERNAL_SERVER_ERROR.value): + Exception.__init__(self, message) + self.http_code = http_code + + +class SdnConnectorBase(object): + """Abstract base class for all the SDN connectors + + Arguments: + wim (dict): WIM record, as stored in the database + wim_account (dict): WIM account record, as stored in the database + config + The arguments of the constructor are converted to object attributes. + An extra property, ``service_endpoint_mapping`` is created from ``config``. + """ + + def __init__(self, wim, wim_account, config=None, logger=None): + """ + :param wim: (dict). Contains among others 'wim_url' + :param wim_account: (dict). Contains among others 'uuid' (internal id), 'name', + 'sdn' (True if is intended for SDN-assist or False if intended for WIM), 'user', 'password'. + :param config: (dict or None): Particular information of plugin. These keys if present have a common meaning: + 'mapping_not_needed': (bool) False by default or if missing, indicates that mapping is not needed. + 'service_endpoint_mapping': (list) provides the internal endpoint mapping. The meaning is: + KEY meaning for WIM meaning for SDN assist + -------- -------- -------- + device_id pop_switch_dpid compute_id + device_interface_id pop_switch_port compute_pci_address + service_endpoint_id wan_service_endpoint_id SDN_service_endpoint_id + service_mapping_info wan_service_mapping_info SDN_service_mapping_info + contains extra information if needed. Text in Yaml format + switch_dpid wan_switch_dpid SDN_switch_dpid + switch_port wan_switch_port SDN_switch_port + datacenter_id vim_account vim_account + id: (internal, do not use) + wim_id: (internal, do not use) + :param logger (logging.Logger): optional logger object. If none is passed 'openmano.sdn.sdnconn' is used. + """ + self.logger = logger or logging.getLogger("ro.sdn") + self.wim = wim + self.wim_account = wim_account + self.config = config or {} + self.service_endpoint_mapping = self.config.get("service_endpoint_mapping", []) + + def check_credentials(self): + """Check if the connector itself can access the SDN/WIM with the provided url (wim.wim_url), + user (wim_account.user), and password (wim_account.password) + + Raises: + SdnConnectorError: Issues regarding authorization, access to + external URLs, etc are detected. + """ + raise NotImplementedError + + def get_connectivity_service_status(self, service_uuid, conn_info=None): + """Monitor the status of the connectivity service established + + Arguments: + service_uuid (str): UUID of the connectivity service + conn_info (dict or None): Information returned by the connector + during the service creation/edition and subsequently stored in + the database. + + Returns: + dict: JSON/YAML-serializable dict that contains a mandatory key + ``sdn_status`` associated with one of the following values:: + + {'sdn_status': 'ACTIVE'} + # The service is up and running. + + {'sdn_status': 'INACTIVE'} + # The service was created, but the connector + # cannot determine yet if connectivity exists + # (ideally, the caller needs to wait and check again). + + {'sdn_status': 'DOWN'} + # Connection was previously established, + # but an error/failure was detected. + + {'sdn_status': 'ERROR'} + # An error occurred when trying to create the service/ + # establish the connectivity. + + {'sdn_status': 'BUILD'} + # Still trying to create the service, the caller + # needs to wait and check again. + + Additionally ``error_msg``(**str**) and ``sdn_info``(**dict**) + keys can be used to provide additional status explanation or + new information available for the connectivity service. + """ + raise NotImplementedError + + def create_connectivity_service(self, service_type, connection_points, **kwargs): + """ + Establish SDN/WAN connectivity between the endpoints + :param service_type: (str): ``ELINE`` (L2), ``ELAN`` (L2), ``ETREE`` (L2), ``L3``. + :param connection_points: (list): each point corresponds to + an entry point to be connected. For WIM: from the DC to the transport network. + For SDN: Compute/PCI to the transport network. One + connection point serves to identify the specific access and + some other service parameters, such as encapsulation type. + Each item of the list is a dict with: + "service_endpoint_id": (str)(uuid) Same meaning that for 'service_endpoint_mapping' (see __init__) + In case the config attribute mapping_not_needed is True, this value is not relevant. In this case + it will contain the string "device_id:device_interface_id" + "service_endpoint_encapsulation_type": None, "dot1q", ... + "service_endpoint_encapsulation_info": (dict) with: + "vlan": ..., (int, present if encapsulation is dot1q) + "vni": ... (int, present if encapsulation is vxlan), + "peers": [(ipv4_1), (ipv4_2)] (present if encapsulation is vxlan) + "mac": ... + "device_id": ..., same meaning that for 'service_endpoint_mapping' (see __init__) + "device_interface_id": same meaning that for 'service_endpoint_mapping' (see __init__) + "switch_dpid": ..., present if mapping has been found for this device_id,device_interface_id + "swith_port": ... present if mapping has been found for this device_id,device_interface_id + "service_mapping_info": present if mapping has been found for this device_id,device_interface_id + :param kwargs: For future versions: + bandwidth (int): value in kilobytes + latency (int): value in milliseconds + Other QoS might be passed as keyword arguments. + :return: tuple: ``(service_id, conn_info)`` containing: + - *service_uuid* (str): UUID of the established connectivity service + - *conn_info* (dict or None): Information to be stored at the database (or ``None``). + This information will be provided to the :meth:`~.edit_connectivity_service` and :obj:`~.delete`. + **MUST** be JSON/YAML-serializable (plain data structures). + :raises: SdnConnectorException: In case of error. Nothing should be created in this case. + Provide the parameter http_code + """ + raise NotImplementedError + + def delete_connectivity_service(self, service_uuid, conn_info=None): + """ + Disconnect multi-site endpoints previously connected + + :param service_uuid: The one returned by create_connectivity_service + :param conn_info: The one returned by last call to 'create_connectivity_service' or 'edit_connectivity_service' + if they do not return None + :return: None + :raises: SdnConnectorException: In case of error. The parameter http_code must be filled + """ + raise NotImplementedError + + def edit_connectivity_service( + self, service_uuid, conn_info=None, connection_points=None, **kwargs + ): + """Change an existing connectivity service. + + This method's arguments and return value follow the same convention as + :meth:`~.create_connectivity_service`. + + :param service_uuid: UUID of the connectivity service. + :param conn_info: (dict or None): Information previously returned by last call to create_connectivity_service + or edit_connectivity_service + :param connection_points: (list): If provided, the old list of connection points will be replaced. + :param kwargs: Same meaning that create_connectivity_service + :return: dict or None: Information to be updated and stored at the database. + When ``None`` is returned, no information should be changed. + When an empty dict is returned, the database record will be deleted. + **MUST** be JSON/YAML-serializable (plain data structures). + Raises: + SdnConnectorException: In case of error. + """ + + def clear_all_connectivity_services(self): + """Delete all WAN Links in a WIM. + + This method is intended for debugging only, and should delete all the + connections controlled by the WIM/SDN, not only the connections that + a specific RO is aware of. + + Raises: + SdnConnectorException: In case of error. + """ + raise NotImplementedError + + def get_all_active_connectivity_services(self): + """Provide information about all active connections provisioned by a + WIM. + + Raises: + SdnConnectorException: In case of error. + """ + raise NotImplementedError diff --git a/src/tests/tools/mock_sdn_ctrl/MockMWSdnCtrl.py b/src/tests/tools/mock_sdn_ctrl/MockMWSdnCtrl.py new file mode 100644 index 0000000000000000000000000000000000000000..63be214b671c2ee9b222d92e6f964a4203b8a587 --- /dev/null +++ b/src/tests/tools/mock_sdn_ctrl/MockMWSdnCtrl.py @@ -0,0 +1,130 @@ +# 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. + +# Mock MicroWave SDN controller +# ----------------------------- +# REST server implementing minimal support for: +# - IETF YANG data model for Network Topology +# Ref: https://www.rfc-editor.org/rfc/rfc8345.html +# - IETF YANG data model for Transport Network Client Signals +# Ref: https://www.ietf.org/archive/id/draft-ietf-ccamp-client-signal-yang-07.html + + +# Ref: https://blog.miguelgrinberg.com/post/running-your-flask-application-over-https +# Ref: https://blog.miguelgrinberg.com/post/designing-a-restful-api-using-flask-restful + +import functools, logging, sys, time +from flask import Flask, abort, request +from flask.json import jsonify +from flask_restful import Api, Resource + +BIND_ADDRESS = '0.0.0.0' +BIND_PORT = 8443 +BASE_URL = '/nmswebs/restconf/data' +STR_ENDPOINT = 'https://{:s}:{:s}{:s}'.format(str(BIND_ADDRESS), str(BIND_PORT), str(BASE_URL)) +LOG_LEVEL = logging.DEBUG + +NETWORK_NODES = [ + {'node-id': '172.18.0.1', 'ietf-network-topology:termination-point': [ + {'tp-id': '172.18.0.1:1', 'ietf-te-topology:te': {'name': 'ethernet'}}, + {'tp-id': '172.18.0.1:2', 'ietf-te-topology:te': {'name': 'antena' }}, + ]}, + {'node-id': '172.18.0.2', 'ietf-network-topology:termination-point': [ + {'tp-id': '172.18.0.2:1', 'ietf-te-topology:te': {'name': 'ethernet'}}, + {'tp-id': '172.18.0.2:2', 'ietf-te-topology:te': {'name': 'antena' }}, + ]}, + {'node-id': '172.18.0.3', 'ietf-network-topology:termination-point': [ + {'tp-id': '172.18.0.3:1', 'ietf-te-topology:te': {'name': 'ethernet'}}, + {'tp-id': '172.18.0.3:2', 'ietf-te-topology:te': {'name': 'antena' }}, + ]}, + {'node-id': '172.18.0.4', 'ietf-network-topology:termination-point': [ + {'tp-id': '172.18.0.4:1', 'ietf-te-topology:te': {'name': 'ethernet'}}, + {'tp-id': '172.18.0.4:2', 'ietf-te-topology:te': {'name': 'antena' }}, + ]} +] +NETWORK_LINKS = [ + { + 'source' : {'source-node': '172.18.0.1', 'source-tp': '172.18.0.1:2'}, + 'destination': {'dest-node' : '172.18.0.2', 'dest-tp' : '172.18.0.2:2'}, + }, + { + 'source' : {'source-node': '172.18.0.3', 'source-tp': '172.18.0.3:2'}, + 'destination': {'dest-node' : '172.18.0.4', 'dest-tp' : '172.18.0.4:2'}, + } +] +NETWORK_SERVICES = {} + + +logging.basicConfig(level=LOG_LEVEL, format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s") +LOGGER = logging.getLogger(__name__) + +logging.getLogger('werkzeug').setLevel(logging.WARNING) + +def log_request(logger : logging.Logger, response): + timestamp = time.strftime('[%Y-%b-%d %H:%M]') + logger.info('%s %s %s %s %s', timestamp, request.remote_addr, request.method, request.full_path, response.status) + return response + +class Health(Resource): + def get(self): return jsonify({}) + +class Network(Resource): + def get(self, network_uuid : str): + if network_uuid != 'SIAE-ETH-TOPOLOGY': abort(400) + network = {'node': NETWORK_NODES, 'ietf-network-topology:link': NETWORK_LINKS} + return jsonify({'ietf-network:network': network}) + +class Services(Resource): + def get(self): + services = [service for service in NETWORK_SERVICES.values()] + return jsonify({'ietf-eth-tran-service:etht-svc': {'etht-svc-instances': services}}) + + def post(self): + json_request = request.json + if not json_request: abort(400) + if not isinstance(json_request, dict): abort(400) + if 'etht-svc-instances' not in json_request: abort(400) + json_services = json_request['etht-svc-instances'] + if not isinstance(json_services, list): abort(400) + if len(json_services) != 1: abort(400) + svc_data = json_services[0] + etht_svc_name = svc_data['etht-svc-name'] + NETWORK_SERVICES[etht_svc_name] = svc_data + return jsonify({}), 201 + +class DelServices(Resource): + def delete(self, service_uuid : str): + NETWORK_SERVICES.pop(service_uuid, None) + return jsonify({}), 204 + +def main(): + LOGGER.info('Starting...') + + app = Flask(__name__) + app.after_request(functools.partial(log_request, LOGGER)) + + api = Api(app, prefix=BASE_URL) + api.add_resource(Health, '/ietf-network:networks') + api.add_resource(Network, '/ietf-network:networks/network=') + api.add_resource(Services, '/ietf-eth-tran-service:etht-svc') + api.add_resource(DelServices, '/ietf-eth-tran-service:etht-svc/etht-svc-instances=') + + LOGGER.info('Listening on {:s}...'.format(str(STR_ENDPOINT))) + app.run(debug=True, host=BIND_ADDRESS, port=BIND_PORT, ssl_context='adhoc') + + LOGGER.info('Bye') + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/tests/tools/mock_sdn_ctrl/README.md b/src/tests/tools/mock_sdn_ctrl/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d8a6fe6b279553e54f13792cbf12f15b2b380dc2 --- /dev/null +++ b/src/tests/tools/mock_sdn_ctrl/README.md @@ -0,0 +1,53 @@ +# Mock MicroWave SDN Controller + +This REST server implements very basic support for the following YANG data models: +- IETF YANG data model for Network Topology + - Ref: https://www.rfc-editor.org/rfc/rfc8345.html +- IETF YANG data model for Transport Network Client Signals + - Ref: https://www.ietf.org/archive/id/draft-ietf-ccamp-client-signal-yang-07.html + +The aim of this server is to enable testing the MicroWaveDeviceDriver and the MicroWaveServiceHandler. +Follow the steps below to perform the test: + +## 1. Deploy TeraFlowSDN controller and the scenario +Deploy the test scenario "microwave_deploy.sh": +```bash +source src/tests/tools/microwave_deploy.sh +./deploy.sh +``` + +## 2. Install requirements and run the Mock MicroWave SDN controller +__NOTE__: if you run the Mock MicroWave SDN controller from the PyEnv used for developping on the TeraFlowSDN framework, +all the requirements are already in place. Install them only if you execute it in a separate/standalone environment. + +Install the required dependencies as follows: +```bash +pip install Flask==2.1.3 Flask-RESTful==0.3.9 +``` + +Run the Mock MicroWave SDN Controller as follows: +```bash +python src/tests/tools/mock_sdn_ctrl/MockMWSdnCtrl.py +``` + +## 3. Deploy the test descriptors +Edit the descriptors to meet your environment specifications. +Edit "network_descriptors.json" and change IP address and port of the MicroWave SDN controller of the "MW" device. +- Set value of config rule "_connect/address" to the address of the host where the Mock MicroWave SDN controller is + running (default="192.168.1.1"). +- Set value of config rule "_connect/port" to the port where your Mock MicroWave SDN controller is listening on + (default="8443"). + +Upload the "network_descriptors.json" through the TeraFlowSDN WebUI. +- If not already selected, select context "admin". +- Check that a network topology with 4 routers + 1 microwave radio system are loaded. They should form 2 rings. + +Upload the "service_descriptor.json" through the TeraFlowSDN WebUI. +- Check that 2 services have been created. +- The "mw-svc" should have a connection and be supported by a sub-service. +- The sub-service should also have a connection. +- The R1, R3, and MW devices should have configuration rules established. + +# 4. Delete the microwave service +Find the "mw-svc" on the WebUI, navigate to its details, and delete the service pressing the "Delete Service" button. +The service, sub-service, and device configuration rules should be removed. diff --git a/src/tests/tools/mock_sdn_ctrl/microwave_deploy.sh b/src/tests/tools/mock_sdn_ctrl/microwave_deploy.sh new file mode 100755 index 0000000000000000000000000000000000000000..fb0629dc4ce600f7bea058a7bcfbbd261ac157cb --- /dev/null +++ b/src/tests/tools/mock_sdn_ctrl/microwave_deploy.sh @@ -0,0 +1,36 @@ +# 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. + +# Set the URL of your local Docker registry where the images will be uploaded to. +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 +# interdomain slice pathcomp dlt +# dbscanserving opticalattackmitigator opticalattackdetector +# l3_attackmitigator l3_centralizedattackdetector l3_distributedattackdetector +export TFS_COMPONENTS="context device pathcomp service slice webui" + +# Set the tag you want to use for your images. +export TFS_IMAGE_TAG="dev" + +# Set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE="tfs" + +# Set additional manifest files to be applied after the deployment +export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml" + +# Set the neew Grafana admin password +export TFS_GRAFANA_PASSWORD="admin123+" diff --git a/src/tests/tools/mock_sdn_ctrl/network_descriptors.json b/src/tests/tools/mock_sdn_ctrl/network_descriptors.json new file mode 100644 index 0000000000000000000000000000000000000000..25fa940a49c07fb6708b6e6f303d0661ef1268c7 --- /dev/null +++ b/src/tests/tools/mock_sdn_ctrl/network_descriptors.json @@ -0,0 +1,117 @@ +{ + "contexts": [ + { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_ids": [], + "service_ids": [] + } + ], + "topologies": [ + { + "topology_id": {"topology_uuid": {"uuid": "admin"}, "context_id": {"context_uuid": {"uuid": "admin"}}}, + "device_ids": [], + "link_ids": [] + } + ], + "devices": [ + { + "device_id": {"device_uuid": {"uuid": "R1"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_operational_status": 2, "device_endpoints": [], + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"type": "copper", "uuid": "MW", "sample_types": []}, + {"type": "copper", "uuid": "R2", "sample_types": []}, + {"type": "copper", "uuid": "EXT", "sample_types": []} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R2"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_operational_status": 2, "device_endpoints": [], + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"type": "copper", "uuid": "MW", "sample_types": []}, + {"type": "copper", "uuid": "R1", "sample_types": []}, + {"type": "copper", "uuid": "EXT", "sample_types": []} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R3"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_operational_status": 2, "device_endpoints": [], + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"type": "copper", "uuid": "MW", "sample_types": []}, + {"type": "copper", "uuid": "R4", "sample_types": []}, + {"type": "copper", "uuid": "EXT", "sample_types": []} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R4"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_operational_status": 2, "device_endpoints": [], + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"type": "copper", "uuid": "MW", "sample_types": []}, + {"type": "copper", "uuid": "R3", "sample_types": []}, + {"type": "copper", "uuid": "EXT", "sample_types": []} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "MW"}}, "device_type": "microwave-radio-system", "device_drivers": [4], + "device_operational_status": 2, "device_endpoints": [], + "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "192.168.1.1"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "8443"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"timeout": 120}}} + ]} + } + ], + "links": [ + { + "link_id": {"link_uuid": {"uuid": "R1/R2==R2/R1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1"}}, "endpoint_uuid": {"uuid": "R2"}}, + {"device_id": {"device_uuid": {"uuid": "R2"}}, "endpoint_uuid": {"uuid": "R1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R3/R4==R4/R3"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3"}}, "endpoint_uuid": {"uuid": "R4"}}, + {"device_id": {"device_uuid": {"uuid": "R4"}}, "endpoint_uuid": {"uuid": "R3"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R1/MW==MW/172.18.0.1:1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1"}}, "endpoint_uuid": {"uuid": "MW"}}, + {"device_id": {"device_uuid": {"uuid": "MW"}}, "endpoint_uuid": {"uuid": "172.18.0.1:1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2/MW==MW/172.18.0.2:1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2"}}, "endpoint_uuid": {"uuid": "MW"}}, + {"device_id": {"device_uuid": {"uuid": "MW"}}, "endpoint_uuid": {"uuid": "172.18.0.2:1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R3/MW==MW/172.18.0.3:1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3"}}, "endpoint_uuid": {"uuid": "MW"}}, + {"device_id": {"device_uuid": {"uuid": "MW"}}, "endpoint_uuid": {"uuid": "172.18.0.3:1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R4/MW==MW/172.18.0.4:1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R4"}}, "endpoint_uuid": {"uuid": "MW"}}, + {"device_id": {"device_uuid": {"uuid": "MW"}}, "endpoint_uuid": {"uuid": "172.18.0.4:1"}} + ] + } + ] +} \ No newline at end of file diff --git a/src/tests/tools/mock_sdn_ctrl/service_descriptor.json b/src/tests/tools/mock_sdn_ctrl/service_descriptor.json new file mode 100644 index 0000000000000000000000000000000000000000..a4109bc7b18d2855f97f5bb329d4354a04b31607 --- /dev/null +++ b/src/tests/tools/mock_sdn_ctrl/service_descriptor.json @@ -0,0 +1,25 @@ +{ + "services": [ + { + "service_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "service_uuid": {"uuid": "mw-svc"} + }, + "service_type": 2, + "service_status": {"service_status": 1}, + "service_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1"}}, "endpoint_uuid": {"uuid": "EXT"}}, + {"device_id": {"device_uuid": {"uuid": "R3"}}, "endpoint_uuid": {"uuid": "EXT"}} + ], + "service_constraints": [ + {"custom": {"constraint_type": "bandwidth[gbps]", "constraint_value": "10.0"}}, + {"custom": {"constraint_type": "latency[ms]", "constraint_value": "15.2"}} + ], + "service_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "/settings", "resource_value": { + "vlan_id": 121 + }}} + ]} + } + ] +} diff --git a/src/webui/.gitlab-ci.yml b/src/webui/.gitlab-ci.yml index 65fd7127848224d2afb7c45280a3d15ffbcab6c5..26af10f4e5b3ab23fcd0802ba6df9d2ad3bf7a19 100644 --- a/src/webui/.gitlab-ci.yml +++ b/src/webui/.gitlab-ci.yml @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# build, tag and push the Docker image to the gitlab registry +# Build, tag, and push the Docker image to the GitLab Docker registry build webui: variables: IMAGE_NAME: 'webui' # name of the microservice @@ -21,23 +21,24 @@ build webui: before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile ./src/ + - docker build -t "$IMAGE_NAME:$IMAGE_TAG" -f ./src/$IMAGE_NAME/Dockerfile . - docker tag "$IMAGE_NAME:$IMAGE_TAG" "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - docker push "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" after_script: - docker images --filter="dangling=true" --quiet | xargs -r docker rmi rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: + - src/common/**/*.py + - proto/*.proto - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py - - src/$IMAGE_NAME/tests/Dockerfile - manifests/${IMAGE_NAME}service.yaml - .gitlab-ci.yml -# apply unit test to the webui component +# Apply unit test to the component unit test webui: variables: IMAGE_NAME: 'webui' # name of the microservice @@ -51,19 +52,22 @@ unit test webui: - if docker container ls | grep $IMAGE_NAME; then docker rm -f $IMAGE_NAME; else echo "$IMAGE_NAME image is not in the system"; fi script: - docker pull "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" - - docker run --name $IMAGE_NAME -d -p 8004:8004 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge --rm $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG + - docker run --name $IMAGE_NAME -d -p 8004:8004 -v "$PWD/src/$IMAGE_NAME/tests:/opt/results" --network=teraflowbridge $CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG - sleep 5 - docker ps -a - docker logs $IMAGE_NAME - - docker exec --user root -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=DEBUG --verbose ${IMAGE_NAME}/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml; coverage xml -o /opt/results/${IMAGE_NAME}_coverage.xml; ls -la /opt/results; coverage report --include='${IMAGE_NAME}/*' --show-missing" + - docker exec --user root -i $IMAGE_NAME bash -c "coverage run -m pytest --log-level=INFO --verbose ${IMAGE_NAME}/tests/test_unitary.py --junitxml=/opt/results/${IMAGE_NAME}_report.xml" + - docker exec --user root -i $IMAGE_NAME bash -c "coverage report --include='${IMAGE_NAME}/*' --show-missing" coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/' after_script: - docker rm -f $IMAGE_NAME - docker network rm teraflowbridge rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - changes: + - src/common/**/*.py + - proto/*.proto - src/$IMAGE_NAME/**/*.{py,in,yml} - src/$IMAGE_NAME/Dockerfile - src/$IMAGE_NAME/tests/*.py @@ -74,9 +78,8 @@ unit test webui: when: always reports: junit: src/$IMAGE_NAME/tests/${IMAGE_NAME}_report.xml - cobertura: src/$IMAGE_NAME/tests/${IMAGE_NAME}_coverage.xml -# Deployment of the webui service in Kubernetes Cluster +# Deployment of the service in Kubernetes Cluster deploy webui: variables: IMAGE_NAME: 'webui' # name of the microservice @@ -100,4 +103,4 @@ deploy webui: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH)' when: manual - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "develop"' - when: manual \ No newline at end of file + when: manual diff --git a/src/webui/Config.py b/src/webui/Config.py index f6fc9125f90e7a78a606129af3b7f55964174ab3..9f104e8d3e6d943dc0fec7f7791d9f30c6407ded 100644 --- a/src/webui/Config.py +++ b/src/webui/Config.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,26 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -import logging - -# General settings -LOG_LEVEL = logging.DEBUG - -# gRPC settings -WEBUI_SERVICE_PORT = 8004 - -# Prometheus settings -METRICS_PORT = 9192 - +HOST = '0.0.0.0' # accepts connections coming from any address +DEBUG = False SECRET_KEY = '>s&}24@{]]#k3&^5$f3#?6?h3{W@[}/7z}2pa]>{3&5%RP<)[(' - -HOST = '0.0.0.0' # accepts connections coming from any ADDRESS - -DEBUG=False - -CONTEXT_SERVICE_ADDRESS = os.environ.get('CONTEXTSERVICE_SERVICE_HOST', 'contextservice') -CONTEXT_SERVICE_PORT = int(os.environ.get('CONTEXTSERVICE_SERVICE_PORT_GRPC', 1010)) - -DEVICE_SERVICE_ADDRESS = os.environ.get('DEVICESERVICE_SERVICE_HOST', 'deviceservice') -DEVICE_SERVICE_PORT = int(os.environ.get('DEVICESERVICE_SERVICE_PORT_GRPC', 2020)) +MAX_CONTENT_LENGTH = 1024*1024 diff --git a/src/webui/Dockerfile b/src/webui/Dockerfile index 734abf5b5d214976a9c68d3d4c393b08b4787dda..7c718890fcf3f07b32f66eca2ecab41f2eb30fbb 100644 --- a/src/webui/Dockerfile +++ b/src/webui/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM python:3-slim +FROM python:3.9-slim # Ref: https://pythonspeed.com/articles/activate-virtualenv-dockerfile/ # Install dependencies -RUN apt-get --yes --quiet --quiet update && \ - apt-get --yes --quiet --quiet install wget g++ && \ - rm -rf /var/lib/apt/lists/* +# RUN apt-get --yes --quiet --quiet update && \ +# apt-get --yes --quiet --quiet install wget g++ && \ +# rm -rf /var/lib/apt/lists/* # Set Python to show logs as they occur ENV PYTHONUNBUFFERED=0 @@ -30,7 +30,7 @@ ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION='python' # wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ # chmod +x /bin/grpc_health_probe -# creating a user for security reasons +# Creating a user for security reasons RUN groupadd -r webui && useradd --no-log-init -r -m -g webui webui USER webui @@ -42,19 +42,48 @@ WORKDIR /home/webui/teraflow ENV VIRTUAL_ENV=/home/webui/venv RUN python3 -m venv ${VIRTUAL_ENV} ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" -COPY --chown=webui:webui webui/requirements.in /home/webui/teraflow/webui/requirements.in -RUN pip install --upgrade "pip<22" setuptools wheel pip-tools && pip-compile --output-file=webui/requirements.txt webui/requirements.in -RUN pip install -r webui/requirements.txt + +# Get generic Python packages +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --upgrade setuptools wheel +RUN python3 -m pip install --upgrade pip-tools + +# Get common Python packages +# Note: this step enables sharing the previous Docker build steps among all the Python components +COPY --chown=webui:webui common_requirements.in common_requirements.in +RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in +RUN python3 -m pip install -r common_requirements.txt + +# Add common files into working directory +COPY --chown=webui:webui src/common/. common/ +RUN rm -rf common/proto + +# Create proto sub-folder, copy .proto files, and generate Python code +RUN mkdir -p common/proto +WORKDIR /home/webui/teraflow/common/proto +RUN touch __init__.py +COPY --chown=webui:webui proto/*.proto ./ +RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto +RUN rm *.proto +RUN find . -type f -exec sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' {} \; +WORKDIR /home/webui/teraflow + +COPY --chown=webui:webui src/webui/requirements.in requirements.in +RUN pip-compile --quiet --output-file=requirements.txt requirements.in +RUN pip install -r requirements.txt # Add files into working directory -COPY --chown=webui:webui common/. common -COPY --chown=webui:webui context/__init__.py context/__init__.py -COPY --chown=webui:webui context/proto/. context/proto -COPY --chown=webui:webui context/client/. context/client -COPY --chown=webui:webui device/__init__.py device/__init__.py -COPY --chown=webui:webui device/proto/. device/proto -COPY --chown=webui:webui device/client/. device/client -COPY --chown=webui:webui webui/. webui - -# Start webui service +COPY --chown=webui:webui src/context/__init__.py context/__init__.py +COPY --chown=webui:webui src/context/client/. context/client/ +COPY --chown=webui:webui src/device/__init__.py device/__init__.py +COPY --chown=webui:webui src/device/client/. device/client/ +COPY --chown=webui:webui src/load_generator/__init__.py load_generator/__init__.py +COPY --chown=webui:webui src/load_generator/client/. load_generator/client/ +COPY --chown=webui:webui src/service/__init__.py service/__init__.py +COPY --chown=webui:webui src/service/client/. service/client/ +COPY --chown=webui:webui src/slice/__init__.py slice/__init__.py +COPY --chown=webui:webui src/slice/client/. slice/client/ +COPY --chown=webui:webui src/webui/. webui/ + +# Start the service ENTRYPOINT ["python", "-m", "webui.service"] diff --git a/src/webui/__init__.py b/src/webui/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/webui/__init__.py +++ b/src/webui/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/webui/genproto.sh b/src/webui/genproto.sh deleted file mode 100755 index 18a0d4f921c3bca9b838a47e06ddb02e344e957c..0000000000000000000000000000000000000000 --- a/src/webui/genproto.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -eu -# -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -#!/bin/bash -e - -# Make folder containing the script the root folder for its execution -cd $(dirname $0) - -rm -rf proto/*.py -rm -rf proto/__pycache__ -touch proto/__init__.py - -# building protos of services used -# python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto compute.proto -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto context.proto -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto device.proto -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto service.proto -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto monitoring.proto -python -m grpc_tools.protoc -I../../proto --python_out=proto --grpc_python_out=proto kpi_sample_types.proto - -# rm proto/compute_pb2_grpc.py -rm proto/context_pb2_grpc.py -rm proto/device_pb2_grpc.py -rm proto/service_pb2_grpc.py -rm proto/monitoring_pb2_grpc.py -rm proto/kpi_sample_types_pb2_grpc.py - -# sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/compute_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/context_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/device_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/service_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/monitoring_pb2.py -sed -i -E 's/(import\ .*)_pb2/from . \1_pb2/g' proto/kpi_sample_types_pb2.py diff --git a/src/webui/grafana_backup_dashboard.json b/src/webui/grafana_backup_dashboard.json new file mode 100644 index 0000000000000000000000000000000000000000..58a856a6c50de422b1f6bde1e2799d53762db916 --- /dev/null +++ b/src/webui/grafana_backup_dashboard.json @@ -0,0 +1,320 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- 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, + "gnetId": null, + "graphTooltip": 0, + "id": 1, + "iteration": 1664282779131, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": null, + "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": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": ".* PACKETS_.*" + }, + "properties": [ + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "unit", + "value": "pps" + }, + { + "id": "custom.axisLabel", + "value": "Packets / sec" + }, + { + "id": "custom.axisSoftMin", + "value": 0 + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".* BYTES_.*" + }, + "properties": [ + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "unit", + "value": "Bps" + }, + { + "id": "custom.axisLabel", + "value": "Bytes / sec" + }, + { + "id": "custom.axisSoftMin", + "value": 0 + } + ] + } + ] + }, + "gridPos": { + "h": 19, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "legend": { + "calcs": [ + "first", + "min", + "mean", + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "format": "time_series", + "group": [], + "hide": false, + "metricColumn": "kpi_value", + "rawQuery": false, + "rawSql": "SELECT\n timestamp AS \"time\",\n kpi_value AS metric,\n kpi_value AS \"kpi_value\"\nFROM monitoring\nWHERE\n $__timeFilter(timestamp) AND\n device_id = $device_id AND\n endpoint_id = $endpoint_id\nORDER BY 1,2", + "refId": "A", + "select": [ + [ + { + "params": [ + "kpi_value" + ], + "type": "column" + }, + { + "params": [ + "avg" + ], + "type": "aggregate" + }, + { + "params": [ + "kpi_value" + ], + "type": "alias" + } + ] + ], + "table": "monitoring", + "timeColumn": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "name": "", + "params": [ + "device_id", + "=", + "$device_id" + ], + "type": "expression" + }, + { + "name": "", + "params": [ + "endpoint_id", + "=", + "$endpoint_id" + ], + "type": "expression" + } + ] + } + ], + "title": "L3 Monitoring Packets/Bytes Received/Sent", + "transformations": [], + "type": "timeseries" + } + ], + "refresh": "", + "schemaVersion": 32, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "selected": true, + "text": [ + "R1-EMU" + ], + "value": [ + "R1-EMU" + ] + }, + "datasource": null, + "definition": "SELECT DISTINCT device_id FROM monitoring;", + "description": null, + "error": null, + "hide": 0, + "includeAll": true, + "label": "Device", + "multi": true, + "name": "device_id", + "options": [], + "query": "SELECT DISTINCT device_id FROM monitoring;", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "allValue": null, + "current": { + "selected": true, + "text": [ + "13/1/2" + ], + "value": [ + "13/1/2" + ] + }, + "datasource": null, + "definition": "SELECT DISTINCT endpoint_id FROM monitoring WHERE device_id IN (${device_id})", + "description": null, + "error": null, + "hide": 0, + "includeAll": true, + "label": "EndPoint", + "multi": true, + "name": "endpoint_id", + "options": [], + "query": "SELECT DISTINCT endpoint_id FROM monitoring WHERE device_id IN (${device_id})", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "allValue": null, + "current": { + "selected": true, + "text": [ + "All" + ], + "value": [ + "$__all" + ] + }, + "datasource": null, + "definition": "SELECT DISTINCT kpi_sample_type FROM monitoring;", + "description": null, + "error": null, + "hide": 0, + "includeAll": true, + "label": "Kpi Sample Type", + "multi": true, + "name": "kpi_sample_type", + "options": [], + "query": "SELECT DISTINCT kpi_sample_type FROM monitoring;", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "L3 Monitoring", + "uid": "tf-l3-monit", + "version": 3 + } \ No newline at end of file diff --git a/src/webui/grafana_dashboard.json b/src/webui/grafana_dashboard.json index c9092aca558104b08fa51402c56bcf70caea95ef..49148825a973aecca5901ffac2249fed6057f4d0 100644 --- a/src/webui/grafana_dashboard.json +++ b/src/webui/grafana_dashboard.json @@ -24,7 +24,7 @@ "fiscalYearStartMonth": 0, "gnetId": null, "graphTooltip": 0, - "iteration": 1643919736138, + "iteration": 1646406031197, "links": [], "liveNow": false, "panels": [ @@ -53,7 +53,7 @@ "scaleDistribution": { "type": "linear" }, - "showPoints": "always", + "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", @@ -91,11 +91,15 @@ }, { "id": "unit", - "value": "short" + "value": "pps" }, { "id": "custom.axisLabel", - "value": "Packets" + "value": "Packets / sec" + }, + { + "id": "custom.axisSoftMin", + "value": 0 } ] }, @@ -111,11 +115,15 @@ }, { "id": "unit", - "value": "decbytes" + "value": "Bps" }, { "id": "custom.axisLabel", - "value": "Bytes" + "value": "Bytes / sec" + }, + { + "id": "custom.axisSoftMin", + "value": 0 } ] } @@ -185,19 +193,19 @@ "tags": [ { "key": "device_id", - "operator": "=~", + "operator": "=", "value": "/^$device_id$/" }, { "condition": "AND", "key": "endpoint_id", - "operator": "=~", + "operator": "=", "value": "/^$endpoint_id$/" }, { "condition": "AND", "key": "kpi_sample_type", - "operator": "=~", + "operator": "=", "value": "/^$kpi_sample_type$/" } ] @@ -219,14 +227,16 @@ "current": { "selected": true, "text": [ - "R1-INF" + "R1-EMU", + "R3-EMU" ], "value": [ - "R1-INF" + "R1-EMU", + "R3-EMU" ] }, "datasource": null, - "definition": "SHOW TAG VALUES FROM samples WITH KEY=\"device_id\"", + "definition": "SELECT DISTINCT device_id FROM monitoring;", "description": null, "error": null, "hide": 0, @@ -235,7 +245,7 @@ "multi": true, "name": "device_id", "options": [], - "query": "SHOW TAG VALUES FROM samples WITH KEY=\"device_id\"", + "query": "SELECT DISTINCT device_id FROM monitoring;", "refresh": 2, "regex": "", "skipUrlSync": false, @@ -247,14 +257,14 @@ "current": { "selected": true, "text": [ - "EP100" + "13/1/2" ], "value": [ - "EP100" + "13/1/2" ] }, "datasource": null, - "definition": "SHOW TAG VALUES FROM samples WITH KEY=\"endpoint_id\" WHERE \"device_id\"=~/^$device_id$/", + "definition": "SELECT DISTINCT endpoint_id FROM monitoring WHERE device_id IN (${device_id})", "description": null, "error": null, "hide": 0, @@ -263,7 +273,7 @@ "multi": true, "name": "endpoint_id", "options": [], - "query": "SHOW TAG VALUES FROM samples WITH KEY=\"endpoint_id\" WHERE \"device_id\"=~/^$device_id$/", + "query": "SELECT DISTINCT endpoint_id FROM monitoring WHERE device_id IN (${device_id})", "refresh": 2, "regex": "", "skipUrlSync": false, @@ -282,7 +292,7 @@ ] }, "datasource": null, - "definition": "SHOW TAG VALUES FROM samples WITH KEY=\"kpi_sample_type\"", + "definition": "SELECT DISTINCT kpi_sample_type FROM monitoring;", "description": null, "error": null, "hide": 0, @@ -291,7 +301,7 @@ "multi": true, "name": "kpi_sample_type", "options": [], - "query": "SHOW TAG VALUES FROM samples WITH KEY=\"kpi_sample_type\"", + "query": "SELECT DISTINCT kpi_sample_type FROM monitoring;", "refresh": 2, "regex": "", "skipUrlSync": false, @@ -301,7 +311,7 @@ ] }, "time": { - "from": "now-5m", + "from": "now-15m", "to": "now" }, "timepicker": {}, diff --git a/src/webui/grafana_dashboard_psql.json b/src/webui/grafana_dashboard_psql.json new file mode 100644 index 0000000000000000000000000000000000000000..ec89c1647cc1086140b0bbd35354546c405ce910 --- /dev/null +++ b/src/webui/grafana_dashboard_psql.json @@ -0,0 +1,315 @@ +{"overwrite": true, "folderId": 0, "dashboard": + { + "id": null, + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "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, + "iteration": 1675103296430, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "postgres", + "uid": "questdb" + }, + "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": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": ".*PACKETS_.*" + }, + "properties": [ + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "unit", + "value": "pps" + }, + { + "id": "custom.axisLabel", + "value": "Packets / sec" + }, + { + "id": "custom.axisSoftMin", + "value": 0 + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*BYTES_.*" + }, + "properties": [ + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "unit", + "value": "Bps" + }, + { + "id": "custom.axisLabel", + "value": "Bytes / sec" + }, + { + "id": "custom.axisSoftMin", + "value": 0 + } + ] + } + ] + }, + "gridPos": { + "h": 19, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "legend": { + "calcs": [ + "first", + "min", + "mean", + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right" + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "postgres", + "uid": "questdb" + }, + "format": "time_series", + "group": [], + "hide": false, + "metricColumn": "kpi_value", + "rawQuery": true, + "rawSql": "SELECT\r\n $__time(timestamp), kpi_value AS metric, device_name, endpoint_name, kpi_sample_type\r\nFROM\r\n tfs_monitoring\r\nWHERE\r\n $__timeFilter(timestamp) AND device_name IN (${device_name}) AND endpoint_name IN (${endpoint_name}) AND kpi_sample_type IN (${kpi_sample_type})\r\nGROUP BY\r\n device_name, endpoint_name, kpi_sample_type\r\nORDER BY\r\n timestamp", + "refId": "A", + "select": [ + [ + { + "params": [ + "kpi_value" + ], + "type": "column" + } + ] + ], + "table": "monitoring", + "timeColumn": "timestamp", + "where": [ + { + "name": "", + "params": [ + "device_id", + "IN", + "$device_id" + ], + "type": "expression" + } + ] + } + ], + "title": "L3 Monitoring Packets/Bytes Received/Sent", + "transformations": [ + { + "id": "renameByRegex", + "options": { + "regex": "metric {device_name=\\\"([^\\\"]+)\\\", endpoint_name=\\\"([^\\\"]+)\\\", kpi_sample_type=\\\"([^\\\"]+)\\\"}", + "renamePattern": "$3 ($1 : $2)" + } + } + ], + "type": "timeseries" + } + ], + "refresh": "5s", + "schemaVersion": 36, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": true, + "text": [ + "All" + ], + "value": [ + "$__all" + ] + }, + "datasource": { + "type": "postgres", + "uid": "questdb" + }, + "definition": "SELECT DISTINCT device_name FROM tfs_monitoring;", + "hide": 0, + "includeAll": true, + "label": "Device", + "multi": true, + "name": "device_name", + "options": [], + "query": "SELECT DISTINCT device_name FROM tfs_monitoring;", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": true, + "text": [ + "All" + ], + "value": [ + "$__all" + ] + }, + "datasource": { + "type": "postgres", + "uid": "questdb" + }, + "definition": "SELECT DISTINCT endpoint_name FROM tfs_monitoring WHERE device_name IN (${device_name})", + "hide": 0, + "includeAll": true, + "label": "EndPoint", + "multi": true, + "name": "endpoint_name", + "options": [], + "query": "SELECT DISTINCT endpoint_name FROM tfs_monitoring WHERE device_name IN (${device_name})", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": true, + "text": [ + "All" + ], + "value": [ + "$__all" + ] + }, + "datasource": { + "type": "postgres", + "uid": "questdb" + }, + "definition": "SELECT DISTINCT kpi_sample_type FROM tfs_monitoring;", + "hide": 0, + "includeAll": true, + "label": "Kpi Sample Type", + "multi": true, + "name": "kpi_sample_type", + "options": [], + "query": "SELECT DISTINCT kpi_sample_type FROM tfs_monitoring;", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": {}, + "timezone": "utc", + "title": "L3 Monitoring", + "uid": "tf-l3-monit", + "version": 6, + "weekStart": "" + } +} diff --git a/src/webui/proto/__init__.py b/src/webui/proto/__init__.py deleted file mode 100644 index 70a33251242c51f49140e596b8208a19dd5245f7..0000000000000000000000000000000000000000 --- a/src/webui/proto/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - diff --git a/src/webui/proto/context_pb2.py b/src/webui/proto/context_pb2.py deleted file mode 100644 index 68602b16f264ceac9acc3ef6669b09d5984e72c2..0000000000000000000000000000000000000000 --- a/src/webui/proto/context_pb2.py +++ /dev/null @@ -1,2662 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: context.proto -"""Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import kpi_sample_types_pb2 as kpi__sample__types__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='context.proto', - package='context', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rcontext.proto\x12\x07\x63ontext\x1a\x16kpi_sample_types.proto\"\x07\n\x05\x45mpty\"\x14\n\x04Uuid\x12\x0c\n\x04uuid\x18\x01 \x01(\t\"F\n\x05\x45vent\x12\x11\n\ttimestamp\x18\x01 \x01(\x01\x12*\n\nevent_type\x18\x02 \x01(\x0e\x32\x16.context.EventTypeEnum\"0\n\tContextId\x12#\n\x0c\x63ontext_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xb6\x01\n\x07\x43ontext\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12)\n\x0ctopology_ids\x18\x02 \x03(\x0b\x32\x13.context.TopologyId\x12\'\n\x0bservice_ids\x18\x03 \x03(\x0b\x32\x12.context.ServiceId\x12/\n\ncontroller\x18\x04 \x01(\x0b\x32\x1b.context.TeraFlowController\"8\n\rContextIdList\x12\'\n\x0b\x63ontext_ids\x18\x01 \x03(\x0b\x32\x12.context.ContextId\"1\n\x0b\x43ontextList\x12\"\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32\x10.context.Context\"U\n\x0c\x43ontextEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\ncontext_id\x18\x02 \x01(\x0b\x32\x12.context.ContextId\"Z\n\nTopologyId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12$\n\rtopology_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"~\n\x08Topology\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12%\n\ndevice_ids\x18\x02 \x03(\x0b\x32\x11.context.DeviceId\x12!\n\x08link_ids\x18\x03 \x03(\x0b\x32\x0f.context.LinkId\";\n\x0eTopologyIdList\x12)\n\x0ctopology_ids\x18\x01 \x03(\x0b\x32\x13.context.TopologyId\"5\n\x0cTopologyList\x12%\n\ntopologies\x18\x01 \x03(\x0b\x32\x11.context.Topology\"X\n\rTopologyEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12(\n\x0btopology_id\x18\x02 \x01(\x0b\x32\x13.context.TopologyId\".\n\x08\x44\x65viceId\x12\"\n\x0b\x64\x65vice_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\x9a\x02\n\x06\x44\x65vice\x12$\n\tdevice_id\x18\x01 \x01(\x0b\x32\x11.context.DeviceId\x12\x13\n\x0b\x64\x65vice_type\x18\x02 \x01(\t\x12,\n\rdevice_config\x18\x03 \x01(\x0b\x32\x15.context.DeviceConfig\x12G\n\x19\x64\x65vice_operational_status\x18\x04 \x01(\x0e\x32$.context.DeviceOperationalStatusEnum\x12\x31\n\x0e\x64\x65vice_drivers\x18\x05 \x03(\x0e\x32\x19.context.DeviceDriverEnum\x12+\n\x10\x64\x65vice_endpoints\x18\x06 \x03(\x0b\x32\x11.context.EndPoint\"9\n\x0c\x44\x65viceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"5\n\x0c\x44\x65viceIdList\x12%\n\ndevice_ids\x18\x01 \x03(\x0b\x32\x11.context.DeviceId\".\n\nDeviceList\x12 \n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x0f.context.Device\"R\n\x0b\x44\x65viceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"*\n\x06LinkId\x12 \n\tlink_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"X\n\x04Link\x12 \n\x07link_id\x18\x01 \x01(\x0b\x32\x0f.context.LinkId\x12.\n\x11link_endpoint_ids\x18\x02 \x03(\x0b\x32\x13.context.EndPointId\"/\n\nLinkIdList\x12!\n\x08link_ids\x18\x01 \x03(\x0b\x32\x0f.context.LinkId\"(\n\x08LinkList\x12\x1c\n\x05links\x18\x01 \x03(\x0b\x32\r.context.Link\"L\n\tLinkEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12 \n\x07link_id\x18\x02 \x01(\x0b\x32\x0f.context.LinkId\"X\n\tServiceId\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12#\n\x0cservice_uuid\x18\x02 \x01(\x0b\x32\r.context.Uuid\"\xa6\x02\n\x07Service\x12&\n\nservice_id\x18\x01 \x01(\x0b\x32\x12.context.ServiceId\x12.\n\x0cservice_type\x18\x02 \x01(\x0e\x32\x18.context.ServiceTypeEnum\x12\x31\n\x14service_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12\x30\n\x13service_constraints\x18\x04 \x03(\x0b\x32\x13.context.Constraint\x12.\n\x0eservice_status\x18\x05 \x01(\x0b\x32\x16.context.ServiceStatus\x12.\n\x0eservice_config\x18\x06 \x01(\x0b\x32\x16.context.ServiceConfig\"C\n\rServiceStatus\x12\x32\n\x0eservice_status\x18\x01 \x01(\x0e\x32\x1a.context.ServiceStatusEnum\":\n\rServiceConfig\x12)\n\x0c\x63onfig_rules\x18\x01 \x03(\x0b\x32\x13.context.ConfigRule\"8\n\rServiceIdList\x12\'\n\x0bservice_ids\x18\x01 \x03(\x0b\x32\x12.context.ServiceId\"1\n\x0bServiceList\x12\"\n\x08services\x18\x01 \x03(\x0b\x32\x10.context.Service\"U\n\x0cServiceEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\"6\n\x0c\x43onnectionId\x12&\n\x0f\x63onnection_uuid\x18\x01 \x01(\x0b\x32\r.context.Uuid\"\xc4\x01\n\nConnection\x12,\n\rconnection_id\x18\x01 \x01(\x0b\x32\x15.context.ConnectionId\x12&\n\nservice_id\x18\x02 \x01(\x0b\x32\x12.context.ServiceId\x12\x33\n\x16path_hops_endpoint_ids\x18\x03 \x03(\x0b\x32\x13.context.EndPointId\x12+\n\x0fsub_service_ids\x18\x04 \x03(\x0b\x32\x12.context.ServiceId\"A\n\x10\x43onnectionIdList\x12-\n\x0e\x63onnection_ids\x18\x01 \x03(\x0b\x32\x15.context.ConnectionId\":\n\x0e\x43onnectionList\x12(\n\x0b\x63onnections\x18\x01 \x03(\x0b\x32\x13.context.Connection\"^\n\x0f\x43onnectionEvent\x12\x1d\n\x05\x65vent\x18\x01 \x01(\x0b\x32\x0e.context.Event\x12,\n\rconnection_id\x18\x02 \x01(\x0b\x32\x15.context.ConnectionId\"\x82\x01\n\nEndPointId\x12(\n\x0btopology_id\x18\x01 \x01(\x0b\x32\x13.context.TopologyId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\x12$\n\rendpoint_uuid\x18\x03 \x01(\x0b\x32\r.context.Uuid\"\x86\x01\n\x08\x45ndPoint\x12(\n\x0b\x65ndpoint_id\x18\x01 \x01(\x0b\x32\x13.context.EndPointId\x12\x15\n\rendpoint_type\x18\x02 \x01(\t\x12\x39\n\x10kpi_sample_types\x18\x03 \x03(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\"e\n\nConfigRule\x12)\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\x19.context.ConfigActionEnum\x12\x14\n\x0cresource_key\x18\x02 \x01(\t\x12\x16\n\x0eresource_value\x18\x03 \x01(\t\"?\n\nConstraint\x12\x17\n\x0f\x63onstraint_type\x18\x01 \x01(\t\x12\x18\n\x10\x63onstraint_value\x18\x02 \x01(\t\"^\n\x12TeraFlowController\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x12\n\nip_address\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"U\n\x14\x41uthenticationResult\x12&\n\ncontext_id\x18\x01 \x01(\x0b\x32\x12.context.ContextId\x12\x15\n\rauthenticated\x18\x02 \x01(\x08*j\n\rEventTypeEnum\x12\x17\n\x13\x45VENTTYPE_UNDEFINED\x10\x00\x12\x14\n\x10\x45VENTTYPE_CREATE\x10\x01\x12\x14\n\x10\x45VENTTYPE_UPDATE\x10\x02\x12\x14\n\x10\x45VENTTYPE_REMOVE\x10\x03*\xc5\x01\n\x10\x44\x65viceDriverEnum\x12\x1a\n\x16\x44\x45VICEDRIVER_UNDEFINED\x10\x00\x12\x1b\n\x17\x44\x45VICEDRIVER_OPENCONFIG\x10\x01\x12\x1e\n\x1a\x44\x45VICEDRIVER_TRANSPORT_API\x10\x02\x12\x13\n\x0f\x44\x45VICEDRIVER_P4\x10\x03\x12&\n\"DEVICEDRIVER_IETF_NETWORK_TOPOLOGY\x10\x04\x12\x1b\n\x17\x44\x45VICEDRIVER_ONF_TR_352\x10\x05*\x8f\x01\n\x1b\x44\x65viceOperationalStatusEnum\x12%\n!DEVICEOPERATIONALSTATUS_UNDEFINED\x10\x00\x12$\n DEVICEOPERATIONALSTATUS_DISABLED\x10\x01\x12#\n\x1f\x44\x45VICEOPERATIONALSTATUS_ENABLED\x10\x02*\x81\x01\n\x0fServiceTypeEnum\x12\x17\n\x13SERVICETYPE_UNKNOWN\x10\x00\x12\x14\n\x10SERVICETYPE_L3NM\x10\x01\x12\x14\n\x10SERVICETYPE_L2NM\x10\x02\x12)\n%SERVICETYPE_TAPI_CONNECTIVITY_SERVICE\x10\x03*\x88\x01\n\x11ServiceStatusEnum\x12\x1b\n\x17SERVICESTATUS_UNDEFINED\x10\x00\x12\x19\n\x15SERVICESTATUS_PLANNED\x10\x01\x12\x18\n\x14SERVICESTATUS_ACTIVE\x10\x02\x12!\n\x1dSERVICESTATUS_PENDING_REMOVAL\x10\x03*]\n\x10\x43onfigActionEnum\x12\x1a\n\x16\x43ONFIGACTION_UNDEFINED\x10\x00\x12\x14\n\x10\x43ONFIGACTION_SET\x10\x01\x12\x17\n\x13\x43ONFIGACTION_DELETE\x10\x02\x32\xad\x10\n\x0e\x43ontextService\x12:\n\x0eListContextIds\x12\x0e.context.Empty\x1a\x16.context.ContextIdList\"\x00\x12\x36\n\x0cListContexts\x12\x0e.context.Empty\x1a\x14.context.ContextList\"\x00\x12\x34\n\nGetContext\x12\x12.context.ContextId\x1a\x10.context.Context\"\x00\x12\x34\n\nSetContext\x12\x10.context.Context\x1a\x12.context.ContextId\"\x00\x12\x35\n\rRemoveContext\x12\x12.context.ContextId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetContextEvents\x12\x0e.context.Empty\x1a\x15.context.ContextEvent\"\x00\x30\x01\x12@\n\x0fListTopologyIds\x12\x12.context.ContextId\x1a\x17.context.TopologyIdList\"\x00\x12=\n\x0eListTopologies\x12\x12.context.ContextId\x1a\x15.context.TopologyList\"\x00\x12\x37\n\x0bGetTopology\x12\x13.context.TopologyId\x1a\x11.context.Topology\"\x00\x12\x37\n\x0bSetTopology\x12\x11.context.Topology\x1a\x13.context.TopologyId\"\x00\x12\x37\n\x0eRemoveTopology\x12\x13.context.TopologyId\x1a\x0e.context.Empty\"\x00\x12?\n\x11GetTopologyEvents\x12\x0e.context.Empty\x1a\x16.context.TopologyEvent\"\x00\x30\x01\x12\x38\n\rListDeviceIds\x12\x0e.context.Empty\x1a\x15.context.DeviceIdList\"\x00\x12\x34\n\x0bListDevices\x12\x0e.context.Empty\x1a\x13.context.DeviceList\"\x00\x12\x31\n\tGetDevice\x12\x11.context.DeviceId\x1a\x0f.context.Device\"\x00\x12\x31\n\tSetDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0cRemoveDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12;\n\x0fGetDeviceEvents\x12\x0e.context.Empty\x1a\x14.context.DeviceEvent\"\x00\x30\x01\x12\x34\n\x0bListLinkIds\x12\x0e.context.Empty\x1a\x13.context.LinkIdList\"\x00\x12\x30\n\tListLinks\x12\x0e.context.Empty\x1a\x11.context.LinkList\"\x00\x12+\n\x07GetLink\x12\x0f.context.LinkId\x1a\r.context.Link\"\x00\x12+\n\x07SetLink\x12\r.context.Link\x1a\x0f.context.LinkId\"\x00\x12/\n\nRemoveLink\x12\x0f.context.LinkId\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetLinkEvents\x12\x0e.context.Empty\x1a\x12.context.LinkEvent\"\x00\x30\x01\x12>\n\x0eListServiceIds\x12\x12.context.ContextId\x1a\x16.context.ServiceIdList\"\x00\x12:\n\x0cListServices\x12\x12.context.ContextId\x1a\x14.context.ServiceList\"\x00\x12\x34\n\nGetService\x12\x12.context.ServiceId\x1a\x10.context.Service\"\x00\x12\x34\n\nSetService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rRemoveService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12=\n\x10GetServiceEvents\x12\x0e.context.Empty\x1a\x15.context.ServiceEvent\"\x00\x30\x01\x12\x44\n\x11ListConnectionIds\x12\x12.context.ServiceId\x1a\x19.context.ConnectionIdList\"\x00\x12@\n\x0fListConnections\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x12=\n\rGetConnection\x12\x15.context.ConnectionId\x1a\x13.context.Connection\"\x00\x12=\n\rSetConnection\x12\x13.context.Connection\x1a\x15.context.ConnectionId\"\x00\x12;\n\x10RemoveConnection\x12\x15.context.ConnectionId\x1a\x0e.context.Empty\"\x00\x12\x43\n\x13GetConnectionEvents\x12\x0e.context.Empty\x1a\x18.context.ConnectionEvent\"\x00\x30\x01\x62\x06proto3' - , - dependencies=[kpi__sample__types__pb2.DESCRIPTOR,]) - -_EVENTTYPEENUM = _descriptor.EnumDescriptor( - name='EventTypeEnum', - full_name='context.EventTypeEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_CREATE', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_UPDATE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EVENTTYPE_REMOVE', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3703, - serialized_end=3809, -) -_sym_db.RegisterEnumDescriptor(_EVENTTYPEENUM) - -EventTypeEnum = enum_type_wrapper.EnumTypeWrapper(_EVENTTYPEENUM) -_DEVICEDRIVERENUM = _descriptor.EnumDescriptor( - name='DeviceDriverEnum', - full_name='context.DeviceDriverEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_OPENCONFIG', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_TRANSPORT_API', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_P4', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_IETF_NETWORK_TOPOLOGY', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEDRIVER_ONF_TR_352', index=5, number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=3812, - serialized_end=4009, -) -_sym_db.RegisterEnumDescriptor(_DEVICEDRIVERENUM) - -DeviceDriverEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEDRIVERENUM) -_DEVICEOPERATIONALSTATUSENUM = _descriptor.EnumDescriptor( - name='DeviceOperationalStatusEnum', - full_name='context.DeviceOperationalStatusEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_DISABLED', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='DEVICEOPERATIONALSTATUS_ENABLED', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4012, - serialized_end=4155, -) -_sym_db.RegisterEnumDescriptor(_DEVICEOPERATIONALSTATUSENUM) - -DeviceOperationalStatusEnum = enum_type_wrapper.EnumTypeWrapper(_DEVICEOPERATIONALSTATUSENUM) -_SERVICETYPEENUM = _descriptor.EnumDescriptor( - name='ServiceTypeEnum', - full_name='context.ServiceTypeEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_L3NM', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_L2NM', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICETYPE_TAPI_CONNECTIVITY_SERVICE', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4158, - serialized_end=4287, -) -_sym_db.RegisterEnumDescriptor(_SERVICETYPEENUM) - -ServiceTypeEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICETYPEENUM) -_SERVICESTATUSENUM = _descriptor.EnumDescriptor( - name='ServiceStatusEnum', - full_name='context.ServiceStatusEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_PLANNED', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_ACTIVE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='SERVICESTATUS_PENDING_REMOVAL', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4290, - serialized_end=4426, -) -_sym_db.RegisterEnumDescriptor(_SERVICESTATUSENUM) - -ServiceStatusEnum = enum_type_wrapper.EnumTypeWrapper(_SERVICESTATUSENUM) -_CONFIGACTIONENUM = _descriptor.EnumDescriptor( - name='ConfigActionEnum', - full_name='context.ConfigActionEnum', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_UNDEFINED', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_SET', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CONFIGACTION_DELETE', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4428, - serialized_end=4521, -) -_sym_db.RegisterEnumDescriptor(_CONFIGACTIONENUM) - -ConfigActionEnum = enum_type_wrapper.EnumTypeWrapper(_CONFIGACTIONENUM) -EVENTTYPE_UNDEFINED = 0 -EVENTTYPE_CREATE = 1 -EVENTTYPE_UPDATE = 2 -EVENTTYPE_REMOVE = 3 -DEVICEDRIVER_UNDEFINED = 0 -DEVICEDRIVER_OPENCONFIG = 1 -DEVICEDRIVER_TRANSPORT_API = 2 -DEVICEDRIVER_P4 = 3 -DEVICEDRIVER_IETF_NETWORK_TOPOLOGY = 4 -DEVICEDRIVER_ONF_TR_352 = 5 -DEVICEOPERATIONALSTATUS_UNDEFINED = 0 -DEVICEOPERATIONALSTATUS_DISABLED = 1 -DEVICEOPERATIONALSTATUS_ENABLED = 2 -SERVICETYPE_UNKNOWN = 0 -SERVICETYPE_L3NM = 1 -SERVICETYPE_L2NM = 2 -SERVICETYPE_TAPI_CONNECTIVITY_SERVICE = 3 -SERVICESTATUS_UNDEFINED = 0 -SERVICESTATUS_PLANNED = 1 -SERVICESTATUS_ACTIVE = 2 -SERVICESTATUS_PENDING_REMOVAL = 3 -CONFIGACTION_UNDEFINED = 0 -CONFIGACTION_SET = 1 -CONFIGACTION_DELETE = 2 - - - -_EMPTY = _descriptor.Descriptor( - name='Empty', - full_name='context.Empty', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=50, - serialized_end=57, -) - - -_UUID = _descriptor.Descriptor( - name='Uuid', - full_name='context.Uuid', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='uuid', full_name='context.Uuid.uuid', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=59, - serialized_end=79, -) - - -_EVENT = _descriptor.Descriptor( - name='Event', - full_name='context.Event', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='timestamp', full_name='context.Event.timestamp', index=0, - number=1, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='event_type', full_name='context.Event.event_type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=81, - serialized_end=151, -) - - -_CONTEXTID = _descriptor.Descriptor( - name='ContextId', - full_name='context.ContextId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_uuid', full_name='context.ContextId.context_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=153, - serialized_end=201, -) - - -_CONTEXT = _descriptor.Descriptor( - name='Context', - full_name='context.Context', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.Context.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_ids', full_name='context.Context.topology_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_ids', full_name='context.Context.service_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='controller', full_name='context.Context.controller', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=204, - serialized_end=386, -) - - -_CONTEXTIDLIST = _descriptor.Descriptor( - name='ContextIdList', - full_name='context.ContextIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_ids', full_name='context.ContextIdList.context_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=388, - serialized_end=444, -) - - -_CONTEXTLIST = _descriptor.Descriptor( - name='ContextList', - full_name='context.ContextList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='contexts', full_name='context.ContextList.contexts', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=446, - serialized_end=495, -) - - -_CONTEXTEVENT = _descriptor.Descriptor( - name='ContextEvent', - full_name='context.ContextEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.ContextEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='context_id', full_name='context.ContextEvent.context_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=497, - serialized_end=582, -) - - -_TOPOLOGYID = _descriptor.Descriptor( - name='TopologyId', - full_name='context.TopologyId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.TopologyId.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_uuid', full_name='context.TopologyId.topology_uuid', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=584, - serialized_end=674, -) - - -_TOPOLOGY = _descriptor.Descriptor( - name='Topology', - full_name='context.Topology', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.Topology.topology_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_ids', full_name='context.Topology.device_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_ids', full_name='context.Topology.link_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=676, - serialized_end=802, -) - - -_TOPOLOGYIDLIST = _descriptor.Descriptor( - name='TopologyIdList', - full_name='context.TopologyIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_ids', full_name='context.TopologyIdList.topology_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=804, - serialized_end=863, -) - - -_TOPOLOGYLIST = _descriptor.Descriptor( - name='TopologyList', - full_name='context.TopologyList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topologies', full_name='context.TopologyList.topologies', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=865, - serialized_end=918, -) - - -_TOPOLOGYEVENT = _descriptor.Descriptor( - name='TopologyEvent', - full_name='context.TopologyEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.TopologyEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.TopologyEvent.topology_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=920, - serialized_end=1008, -) - - -_DEVICEID = _descriptor.Descriptor( - name='DeviceId', - full_name='context.DeviceId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_uuid', full_name='context.DeviceId.device_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1010, - serialized_end=1056, -) - - -_DEVICE = _descriptor.Descriptor( - name='Device', - full_name='context.Device', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_id', full_name='context.Device.device_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_type', full_name='context.Device.device_type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_config', full_name='context.Device.device_config', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_operational_status', full_name='context.Device.device_operational_status', index=3, - number=4, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_drivers', full_name='context.Device.device_drivers', index=4, - number=5, type=14, cpp_type=8, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_endpoints', full_name='context.Device.device_endpoints', index=5, - number=6, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1059, - serialized_end=1341, -) - - -_DEVICECONFIG = _descriptor.Descriptor( - name='DeviceConfig', - full_name='context.DeviceConfig', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='config_rules', full_name='context.DeviceConfig.config_rules', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1343, - serialized_end=1400, -) - - -_DEVICEIDLIST = _descriptor.Descriptor( - name='DeviceIdList', - full_name='context.DeviceIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_ids', full_name='context.DeviceIdList.device_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1402, - serialized_end=1455, -) - - -_DEVICELIST = _descriptor.Descriptor( - name='DeviceList', - full_name='context.DeviceList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='devices', full_name='context.DeviceList.devices', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1457, - serialized_end=1503, -) - - -_DEVICEEVENT = _descriptor.Descriptor( - name='DeviceEvent', - full_name='context.DeviceEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.DeviceEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='context.DeviceEvent.device_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1505, - serialized_end=1587, -) - - -_LINKID = _descriptor.Descriptor( - name='LinkId', - full_name='context.LinkId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_uuid', full_name='context.LinkId.link_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1589, - serialized_end=1631, -) - - -_LINK = _descriptor.Descriptor( - name='Link', - full_name='context.Link', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_id', full_name='context.Link.link_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_endpoint_ids', full_name='context.Link.link_endpoint_ids', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1633, - serialized_end=1721, -) - - -_LINKIDLIST = _descriptor.Descriptor( - name='LinkIdList', - full_name='context.LinkIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='link_ids', full_name='context.LinkIdList.link_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1723, - serialized_end=1770, -) - - -_LINKLIST = _descriptor.Descriptor( - name='LinkList', - full_name='context.LinkList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='links', full_name='context.LinkList.links', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1772, - serialized_end=1812, -) - - -_LINKEVENT = _descriptor.Descriptor( - name='LinkEvent', - full_name='context.LinkEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.LinkEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='link_id', full_name='context.LinkEvent.link_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1814, - serialized_end=1890, -) - - -_SERVICEID = _descriptor.Descriptor( - name='ServiceId', - full_name='context.ServiceId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.ServiceId.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_uuid', full_name='context.ServiceId.service_uuid', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1892, - serialized_end=1980, -) - - -_SERVICE = _descriptor.Descriptor( - name='Service', - full_name='context.Service', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_id', full_name='context.Service.service_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_type', full_name='context.Service.service_type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_endpoint_ids', full_name='context.Service.service_endpoint_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_constraints', full_name='context.Service.service_constraints', index=3, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_status', full_name='context.Service.service_status', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_config', full_name='context.Service.service_config', index=5, - number=6, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1983, - serialized_end=2277, -) - - -_SERVICESTATUS = _descriptor.Descriptor( - name='ServiceStatus', - full_name='context.ServiceStatus', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_status', full_name='context.ServiceStatus.service_status', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2279, - serialized_end=2346, -) - - -_SERVICECONFIG = _descriptor.Descriptor( - name='ServiceConfig', - full_name='context.ServiceConfig', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='config_rules', full_name='context.ServiceConfig.config_rules', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2348, - serialized_end=2406, -) - - -_SERVICEIDLIST = _descriptor.Descriptor( - name='ServiceIdList', - full_name='context.ServiceIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='service_ids', full_name='context.ServiceIdList.service_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2408, - serialized_end=2464, -) - - -_SERVICELIST = _descriptor.Descriptor( - name='ServiceList', - full_name='context.ServiceList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='services', full_name='context.ServiceList.services', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2466, - serialized_end=2515, -) - - -_SERVICEEVENT = _descriptor.Descriptor( - name='ServiceEvent', - full_name='context.ServiceEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.ServiceEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_id', full_name='context.ServiceEvent.service_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2517, - serialized_end=2602, -) - - -_CONNECTIONID = _descriptor.Descriptor( - name='ConnectionId', - full_name='context.ConnectionId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_uuid', full_name='context.ConnectionId.connection_uuid', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2604, - serialized_end=2658, -) - - -_CONNECTION = _descriptor.Descriptor( - name='Connection', - full_name='context.Connection', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_id', full_name='context.Connection.connection_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_id', full_name='context.Connection.service_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='path_hops_endpoint_ids', full_name='context.Connection.path_hops_endpoint_ids', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sub_service_ids', full_name='context.Connection.sub_service_ids', index=3, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2661, - serialized_end=2857, -) - - -_CONNECTIONIDLIST = _descriptor.Descriptor( - name='ConnectionIdList', - full_name='context.ConnectionIdList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connection_ids', full_name='context.ConnectionIdList.connection_ids', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2859, - serialized_end=2924, -) - - -_CONNECTIONLIST = _descriptor.Descriptor( - name='ConnectionList', - full_name='context.ConnectionList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='connections', full_name='context.ConnectionList.connections', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2926, - serialized_end=2984, -) - - -_CONNECTIONEVENT = _descriptor.Descriptor( - name='ConnectionEvent', - full_name='context.ConnectionEvent', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='event', full_name='context.ConnectionEvent.event', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='connection_id', full_name='context.ConnectionEvent.connection_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2986, - serialized_end=3080, -) - - -_ENDPOINTID = _descriptor.Descriptor( - name='EndPointId', - full_name='context.EndPointId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='topology_id', full_name='context.EndPointId.topology_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='context.EndPointId.device_id', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='endpoint_uuid', full_name='context.EndPointId.endpoint_uuid', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3083, - serialized_end=3213, -) - - -_ENDPOINT = _descriptor.Descriptor( - name='EndPoint', - full_name='context.EndPoint', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='endpoint_id', full_name='context.EndPoint.endpoint_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='endpoint_type', full_name='context.EndPoint.endpoint_type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kpi_sample_types', full_name='context.EndPoint.kpi_sample_types', index=2, - number=3, type=14, cpp_type=8, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3216, - serialized_end=3350, -) - - -_CONFIGRULE = _descriptor.Descriptor( - name='ConfigRule', - full_name='context.ConfigRule', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='action', full_name='context.ConfigRule.action', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='resource_key', full_name='context.ConfigRule.resource_key', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='resource_value', full_name='context.ConfigRule.resource_value', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3352, - serialized_end=3453, -) - - -_CONSTRAINT = _descriptor.Descriptor( - name='Constraint', - full_name='context.Constraint', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='constraint_type', full_name='context.Constraint.constraint_type', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='constraint_value', full_name='context.Constraint.constraint_value', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3455, - serialized_end=3518, -) - - -_TERAFLOWCONTROLLER = _descriptor.Descriptor( - name='TeraFlowController', - full_name='context.TeraFlowController', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.TeraFlowController.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ip_address', full_name='context.TeraFlowController.ip_address', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='port', full_name='context.TeraFlowController.port', index=2, - number=3, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3520, - serialized_end=3614, -) - - -_AUTHENTICATIONRESULT = _descriptor.Descriptor( - name='AuthenticationResult', - full_name='context.AuthenticationResult', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='context_id', full_name='context.AuthenticationResult.context_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='authenticated', full_name='context.AuthenticationResult.authenticated', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3616, - serialized_end=3701, -) - -_EVENT.fields_by_name['event_type'].enum_type = _EVENTTYPEENUM -_CONTEXTID.fields_by_name['context_uuid'].message_type = _UUID -_CONTEXT.fields_by_name['context_id'].message_type = _CONTEXTID -_CONTEXT.fields_by_name['topology_ids'].message_type = _TOPOLOGYID -_CONTEXT.fields_by_name['service_ids'].message_type = _SERVICEID -_CONTEXT.fields_by_name['controller'].message_type = _TERAFLOWCONTROLLER -_CONTEXTIDLIST.fields_by_name['context_ids'].message_type = _CONTEXTID -_CONTEXTLIST.fields_by_name['contexts'].message_type = _CONTEXT -_CONTEXTEVENT.fields_by_name['event'].message_type = _EVENT -_CONTEXTEVENT.fields_by_name['context_id'].message_type = _CONTEXTID -_TOPOLOGYID.fields_by_name['context_id'].message_type = _CONTEXTID -_TOPOLOGYID.fields_by_name['topology_uuid'].message_type = _UUID -_TOPOLOGY.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_TOPOLOGY.fields_by_name['device_ids'].message_type = _DEVICEID -_TOPOLOGY.fields_by_name['link_ids'].message_type = _LINKID -_TOPOLOGYIDLIST.fields_by_name['topology_ids'].message_type = _TOPOLOGYID -_TOPOLOGYLIST.fields_by_name['topologies'].message_type = _TOPOLOGY -_TOPOLOGYEVENT.fields_by_name['event'].message_type = _EVENT -_TOPOLOGYEVENT.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_DEVICEID.fields_by_name['device_uuid'].message_type = _UUID -_DEVICE.fields_by_name['device_id'].message_type = _DEVICEID -_DEVICE.fields_by_name['device_config'].message_type = _DEVICECONFIG -_DEVICE.fields_by_name['device_operational_status'].enum_type = _DEVICEOPERATIONALSTATUSENUM -_DEVICE.fields_by_name['device_drivers'].enum_type = _DEVICEDRIVERENUM -_DEVICE.fields_by_name['device_endpoints'].message_type = _ENDPOINT -_DEVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE -_DEVICEIDLIST.fields_by_name['device_ids'].message_type = _DEVICEID -_DEVICELIST.fields_by_name['devices'].message_type = _DEVICE -_DEVICEEVENT.fields_by_name['event'].message_type = _EVENT -_DEVICEEVENT.fields_by_name['device_id'].message_type = _DEVICEID -_LINKID.fields_by_name['link_uuid'].message_type = _UUID -_LINK.fields_by_name['link_id'].message_type = _LINKID -_LINK.fields_by_name['link_endpoint_ids'].message_type = _ENDPOINTID -_LINKIDLIST.fields_by_name['link_ids'].message_type = _LINKID -_LINKLIST.fields_by_name['links'].message_type = _LINK -_LINKEVENT.fields_by_name['event'].message_type = _EVENT -_LINKEVENT.fields_by_name['link_id'].message_type = _LINKID -_SERVICEID.fields_by_name['context_id'].message_type = _CONTEXTID -_SERVICEID.fields_by_name['service_uuid'].message_type = _UUID -_SERVICE.fields_by_name['service_id'].message_type = _SERVICEID -_SERVICE.fields_by_name['service_type'].enum_type = _SERVICETYPEENUM -_SERVICE.fields_by_name['service_endpoint_ids'].message_type = _ENDPOINTID -_SERVICE.fields_by_name['service_constraints'].message_type = _CONSTRAINT -_SERVICE.fields_by_name['service_status'].message_type = _SERVICESTATUS -_SERVICE.fields_by_name['service_config'].message_type = _SERVICECONFIG -_SERVICESTATUS.fields_by_name['service_status'].enum_type = _SERVICESTATUSENUM -_SERVICECONFIG.fields_by_name['config_rules'].message_type = _CONFIGRULE -_SERVICEIDLIST.fields_by_name['service_ids'].message_type = _SERVICEID -_SERVICELIST.fields_by_name['services'].message_type = _SERVICE -_SERVICEEVENT.fields_by_name['event'].message_type = _EVENT -_SERVICEEVENT.fields_by_name['service_id'].message_type = _SERVICEID -_CONNECTIONID.fields_by_name['connection_uuid'].message_type = _UUID -_CONNECTION.fields_by_name['connection_id'].message_type = _CONNECTIONID -_CONNECTION.fields_by_name['service_id'].message_type = _SERVICEID -_CONNECTION.fields_by_name['path_hops_endpoint_ids'].message_type = _ENDPOINTID -_CONNECTION.fields_by_name['sub_service_ids'].message_type = _SERVICEID -_CONNECTIONIDLIST.fields_by_name['connection_ids'].message_type = _CONNECTIONID -_CONNECTIONLIST.fields_by_name['connections'].message_type = _CONNECTION -_CONNECTIONEVENT.fields_by_name['event'].message_type = _EVENT -_CONNECTIONEVENT.fields_by_name['connection_id'].message_type = _CONNECTIONID -_ENDPOINTID.fields_by_name['topology_id'].message_type = _TOPOLOGYID -_ENDPOINTID.fields_by_name['device_id'].message_type = _DEVICEID -_ENDPOINTID.fields_by_name['endpoint_uuid'].message_type = _UUID -_ENDPOINT.fields_by_name['endpoint_id'].message_type = _ENDPOINTID -_ENDPOINT.fields_by_name['kpi_sample_types'].enum_type = kpi__sample__types__pb2._KPISAMPLETYPE -_CONFIGRULE.fields_by_name['action'].enum_type = _CONFIGACTIONENUM -_TERAFLOWCONTROLLER.fields_by_name['context_id'].message_type = _CONTEXTID -_AUTHENTICATIONRESULT.fields_by_name['context_id'].message_type = _CONTEXTID -DESCRIPTOR.message_types_by_name['Empty'] = _EMPTY -DESCRIPTOR.message_types_by_name['Uuid'] = _UUID -DESCRIPTOR.message_types_by_name['Event'] = _EVENT -DESCRIPTOR.message_types_by_name['ContextId'] = _CONTEXTID -DESCRIPTOR.message_types_by_name['Context'] = _CONTEXT -DESCRIPTOR.message_types_by_name['ContextIdList'] = _CONTEXTIDLIST -DESCRIPTOR.message_types_by_name['ContextList'] = _CONTEXTLIST -DESCRIPTOR.message_types_by_name['ContextEvent'] = _CONTEXTEVENT -DESCRIPTOR.message_types_by_name['TopologyId'] = _TOPOLOGYID -DESCRIPTOR.message_types_by_name['Topology'] = _TOPOLOGY -DESCRIPTOR.message_types_by_name['TopologyIdList'] = _TOPOLOGYIDLIST -DESCRIPTOR.message_types_by_name['TopologyList'] = _TOPOLOGYLIST -DESCRIPTOR.message_types_by_name['TopologyEvent'] = _TOPOLOGYEVENT -DESCRIPTOR.message_types_by_name['DeviceId'] = _DEVICEID -DESCRIPTOR.message_types_by_name['Device'] = _DEVICE -DESCRIPTOR.message_types_by_name['DeviceConfig'] = _DEVICECONFIG -DESCRIPTOR.message_types_by_name['DeviceIdList'] = _DEVICEIDLIST -DESCRIPTOR.message_types_by_name['DeviceList'] = _DEVICELIST -DESCRIPTOR.message_types_by_name['DeviceEvent'] = _DEVICEEVENT -DESCRIPTOR.message_types_by_name['LinkId'] = _LINKID -DESCRIPTOR.message_types_by_name['Link'] = _LINK -DESCRIPTOR.message_types_by_name['LinkIdList'] = _LINKIDLIST -DESCRIPTOR.message_types_by_name['LinkList'] = _LINKLIST -DESCRIPTOR.message_types_by_name['LinkEvent'] = _LINKEVENT -DESCRIPTOR.message_types_by_name['ServiceId'] = _SERVICEID -DESCRIPTOR.message_types_by_name['Service'] = _SERVICE -DESCRIPTOR.message_types_by_name['ServiceStatus'] = _SERVICESTATUS -DESCRIPTOR.message_types_by_name['ServiceConfig'] = _SERVICECONFIG -DESCRIPTOR.message_types_by_name['ServiceIdList'] = _SERVICEIDLIST -DESCRIPTOR.message_types_by_name['ServiceList'] = _SERVICELIST -DESCRIPTOR.message_types_by_name['ServiceEvent'] = _SERVICEEVENT -DESCRIPTOR.message_types_by_name['ConnectionId'] = _CONNECTIONID -DESCRIPTOR.message_types_by_name['Connection'] = _CONNECTION -DESCRIPTOR.message_types_by_name['ConnectionIdList'] = _CONNECTIONIDLIST -DESCRIPTOR.message_types_by_name['ConnectionList'] = _CONNECTIONLIST -DESCRIPTOR.message_types_by_name['ConnectionEvent'] = _CONNECTIONEVENT -DESCRIPTOR.message_types_by_name['EndPointId'] = _ENDPOINTID -DESCRIPTOR.message_types_by_name['EndPoint'] = _ENDPOINT -DESCRIPTOR.message_types_by_name['ConfigRule'] = _CONFIGRULE -DESCRIPTOR.message_types_by_name['Constraint'] = _CONSTRAINT -DESCRIPTOR.message_types_by_name['TeraFlowController'] = _TERAFLOWCONTROLLER -DESCRIPTOR.message_types_by_name['AuthenticationResult'] = _AUTHENTICATIONRESULT -DESCRIPTOR.enum_types_by_name['EventTypeEnum'] = _EVENTTYPEENUM -DESCRIPTOR.enum_types_by_name['DeviceDriverEnum'] = _DEVICEDRIVERENUM -DESCRIPTOR.enum_types_by_name['DeviceOperationalStatusEnum'] = _DEVICEOPERATIONALSTATUSENUM -DESCRIPTOR.enum_types_by_name['ServiceTypeEnum'] = _SERVICETYPEENUM -DESCRIPTOR.enum_types_by_name['ServiceStatusEnum'] = _SERVICESTATUSENUM -DESCRIPTOR.enum_types_by_name['ConfigActionEnum'] = _CONFIGACTIONENUM -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { - 'DESCRIPTOR' : _EMPTY, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Empty) - }) -_sym_db.RegisterMessage(Empty) - -Uuid = _reflection.GeneratedProtocolMessageType('Uuid', (_message.Message,), { - 'DESCRIPTOR' : _UUID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Uuid) - }) -_sym_db.RegisterMessage(Uuid) - -Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), { - 'DESCRIPTOR' : _EVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Event) - }) -_sym_db.RegisterMessage(Event) - -ContextId = _reflection.GeneratedProtocolMessageType('ContextId', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextId) - }) -_sym_db.RegisterMessage(ContextId) - -Context = _reflection.GeneratedProtocolMessageType('Context', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Context) - }) -_sym_db.RegisterMessage(Context) - -ContextIdList = _reflection.GeneratedProtocolMessageType('ContextIdList', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextIdList) - }) -_sym_db.RegisterMessage(ContextIdList) - -ContextList = _reflection.GeneratedProtocolMessageType('ContextList', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextList) - }) -_sym_db.RegisterMessage(ContextList) - -ContextEvent = _reflection.GeneratedProtocolMessageType('ContextEvent', (_message.Message,), { - 'DESCRIPTOR' : _CONTEXTEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ContextEvent) - }) -_sym_db.RegisterMessage(ContextEvent) - -TopologyId = _reflection.GeneratedProtocolMessageType('TopologyId', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyId) - }) -_sym_db.RegisterMessage(TopologyId) - -Topology = _reflection.GeneratedProtocolMessageType('Topology', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGY, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Topology) - }) -_sym_db.RegisterMessage(Topology) - -TopologyIdList = _reflection.GeneratedProtocolMessageType('TopologyIdList', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyIdList) - }) -_sym_db.RegisterMessage(TopologyIdList) - -TopologyList = _reflection.GeneratedProtocolMessageType('TopologyList', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyList) - }) -_sym_db.RegisterMessage(TopologyList) - -TopologyEvent = _reflection.GeneratedProtocolMessageType('TopologyEvent', (_message.Message,), { - 'DESCRIPTOR' : _TOPOLOGYEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TopologyEvent) - }) -_sym_db.RegisterMessage(TopologyEvent) - -DeviceId = _reflection.GeneratedProtocolMessageType('DeviceId', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceId) - }) -_sym_db.RegisterMessage(DeviceId) - -Device = _reflection.GeneratedProtocolMessageType('Device', (_message.Message,), { - 'DESCRIPTOR' : _DEVICE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Device) - }) -_sym_db.RegisterMessage(Device) - -DeviceConfig = _reflection.GeneratedProtocolMessageType('DeviceConfig', (_message.Message,), { - 'DESCRIPTOR' : _DEVICECONFIG, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceConfig) - }) -_sym_db.RegisterMessage(DeviceConfig) - -DeviceIdList = _reflection.GeneratedProtocolMessageType('DeviceIdList', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceIdList) - }) -_sym_db.RegisterMessage(DeviceIdList) - -DeviceList = _reflection.GeneratedProtocolMessageType('DeviceList', (_message.Message,), { - 'DESCRIPTOR' : _DEVICELIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceList) - }) -_sym_db.RegisterMessage(DeviceList) - -DeviceEvent = _reflection.GeneratedProtocolMessageType('DeviceEvent', (_message.Message,), { - 'DESCRIPTOR' : _DEVICEEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.DeviceEvent) - }) -_sym_db.RegisterMessage(DeviceEvent) - -LinkId = _reflection.GeneratedProtocolMessageType('LinkId', (_message.Message,), { - 'DESCRIPTOR' : _LINKID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkId) - }) -_sym_db.RegisterMessage(LinkId) - -Link = _reflection.GeneratedProtocolMessageType('Link', (_message.Message,), { - 'DESCRIPTOR' : _LINK, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Link) - }) -_sym_db.RegisterMessage(Link) - -LinkIdList = _reflection.GeneratedProtocolMessageType('LinkIdList', (_message.Message,), { - 'DESCRIPTOR' : _LINKIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkIdList) - }) -_sym_db.RegisterMessage(LinkIdList) - -LinkList = _reflection.GeneratedProtocolMessageType('LinkList', (_message.Message,), { - 'DESCRIPTOR' : _LINKLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkList) - }) -_sym_db.RegisterMessage(LinkList) - -LinkEvent = _reflection.GeneratedProtocolMessageType('LinkEvent', (_message.Message,), { - 'DESCRIPTOR' : _LINKEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.LinkEvent) - }) -_sym_db.RegisterMessage(LinkEvent) - -ServiceId = _reflection.GeneratedProtocolMessageType('ServiceId', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceId) - }) -_sym_db.RegisterMessage(ServiceId) - -Service = _reflection.GeneratedProtocolMessageType('Service', (_message.Message,), { - 'DESCRIPTOR' : _SERVICE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Service) - }) -_sym_db.RegisterMessage(Service) - -ServiceStatus = _reflection.GeneratedProtocolMessageType('ServiceStatus', (_message.Message,), { - 'DESCRIPTOR' : _SERVICESTATUS, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceStatus) - }) -_sym_db.RegisterMessage(ServiceStatus) - -ServiceConfig = _reflection.GeneratedProtocolMessageType('ServiceConfig', (_message.Message,), { - 'DESCRIPTOR' : _SERVICECONFIG, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceConfig) - }) -_sym_db.RegisterMessage(ServiceConfig) - -ServiceIdList = _reflection.GeneratedProtocolMessageType('ServiceIdList', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceIdList) - }) -_sym_db.RegisterMessage(ServiceIdList) - -ServiceList = _reflection.GeneratedProtocolMessageType('ServiceList', (_message.Message,), { - 'DESCRIPTOR' : _SERVICELIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceList) - }) -_sym_db.RegisterMessage(ServiceList) - -ServiceEvent = _reflection.GeneratedProtocolMessageType('ServiceEvent', (_message.Message,), { - 'DESCRIPTOR' : _SERVICEEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ServiceEvent) - }) -_sym_db.RegisterMessage(ServiceEvent) - -ConnectionId = _reflection.GeneratedProtocolMessageType('ConnectionId', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionId) - }) -_sym_db.RegisterMessage(ConnectionId) - -Connection = _reflection.GeneratedProtocolMessageType('Connection', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTION, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Connection) - }) -_sym_db.RegisterMessage(Connection) - -ConnectionIdList = _reflection.GeneratedProtocolMessageType('ConnectionIdList', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONIDLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionIdList) - }) -_sym_db.RegisterMessage(ConnectionIdList) - -ConnectionList = _reflection.GeneratedProtocolMessageType('ConnectionList', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONLIST, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionList) - }) -_sym_db.RegisterMessage(ConnectionList) - -ConnectionEvent = _reflection.GeneratedProtocolMessageType('ConnectionEvent', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONEVENT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConnectionEvent) - }) -_sym_db.RegisterMessage(ConnectionEvent) - -EndPointId = _reflection.GeneratedProtocolMessageType('EndPointId', (_message.Message,), { - 'DESCRIPTOR' : _ENDPOINTID, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.EndPointId) - }) -_sym_db.RegisterMessage(EndPointId) - -EndPoint = _reflection.GeneratedProtocolMessageType('EndPoint', (_message.Message,), { - 'DESCRIPTOR' : _ENDPOINT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.EndPoint) - }) -_sym_db.RegisterMessage(EndPoint) - -ConfigRule = _reflection.GeneratedProtocolMessageType('ConfigRule', (_message.Message,), { - 'DESCRIPTOR' : _CONFIGRULE, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.ConfigRule) - }) -_sym_db.RegisterMessage(ConfigRule) - -Constraint = _reflection.GeneratedProtocolMessageType('Constraint', (_message.Message,), { - 'DESCRIPTOR' : _CONSTRAINT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.Constraint) - }) -_sym_db.RegisterMessage(Constraint) - -TeraFlowController = _reflection.GeneratedProtocolMessageType('TeraFlowController', (_message.Message,), { - 'DESCRIPTOR' : _TERAFLOWCONTROLLER, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.TeraFlowController) - }) -_sym_db.RegisterMessage(TeraFlowController) - -AuthenticationResult = _reflection.GeneratedProtocolMessageType('AuthenticationResult', (_message.Message,), { - 'DESCRIPTOR' : _AUTHENTICATIONRESULT, - '__module__' : 'context_pb2' - # @@protoc_insertion_point(class_scope:context.AuthenticationResult) - }) -_sym_db.RegisterMessage(AuthenticationResult) - - - -_CONTEXTSERVICE = _descriptor.ServiceDescriptor( - name='ContextService', - full_name='context.ContextService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=4524, - serialized_end=6617, - methods=[ - _descriptor.MethodDescriptor( - name='ListContextIds', - full_name='context.ContextService.ListContextIds', - index=0, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListContexts', - full_name='context.ContextService.ListContexts', - index=1, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetContext', - full_name='context.ContextService.GetContext', - index=2, - containing_service=None, - input_type=_CONTEXTID, - output_type=_CONTEXT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetContext', - full_name='context.ContextService.SetContext', - index=3, - containing_service=None, - input_type=_CONTEXT, - output_type=_CONTEXTID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveContext', - full_name='context.ContextService.RemoveContext', - index=4, - containing_service=None, - input_type=_CONTEXTID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetContextEvents', - full_name='context.ContextService.GetContextEvents', - index=5, - containing_service=None, - input_type=_EMPTY, - output_type=_CONTEXTEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListTopologyIds', - full_name='context.ContextService.ListTopologyIds', - index=6, - containing_service=None, - input_type=_CONTEXTID, - output_type=_TOPOLOGYIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListTopologies', - full_name='context.ContextService.ListTopologies', - index=7, - containing_service=None, - input_type=_CONTEXTID, - output_type=_TOPOLOGYLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetTopology', - full_name='context.ContextService.GetTopology', - index=8, - containing_service=None, - input_type=_TOPOLOGYID, - output_type=_TOPOLOGY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetTopology', - full_name='context.ContextService.SetTopology', - index=9, - containing_service=None, - input_type=_TOPOLOGY, - output_type=_TOPOLOGYID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveTopology', - full_name='context.ContextService.RemoveTopology', - index=10, - containing_service=None, - input_type=_TOPOLOGYID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetTopologyEvents', - full_name='context.ContextService.GetTopologyEvents', - index=11, - containing_service=None, - input_type=_EMPTY, - output_type=_TOPOLOGYEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListDeviceIds', - full_name='context.ContextService.ListDeviceIds', - index=12, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICEIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListDevices', - full_name='context.ContextService.ListDevices', - index=13, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICELIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetDevice', - full_name='context.ContextService.GetDevice', - index=14, - containing_service=None, - input_type=_DEVICEID, - output_type=_DEVICE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetDevice', - full_name='context.ContextService.SetDevice', - index=15, - containing_service=None, - input_type=_DEVICE, - output_type=_DEVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveDevice', - full_name='context.ContextService.RemoveDevice', - index=16, - containing_service=None, - input_type=_DEVICEID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetDeviceEvents', - full_name='context.ContextService.GetDeviceEvents', - index=17, - containing_service=None, - input_type=_EMPTY, - output_type=_DEVICEEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListLinkIds', - full_name='context.ContextService.ListLinkIds', - index=18, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListLinks', - full_name='context.ContextService.ListLinks', - index=19, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetLink', - full_name='context.ContextService.GetLink', - index=20, - containing_service=None, - input_type=_LINKID, - output_type=_LINK, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetLink', - full_name='context.ContextService.SetLink', - index=21, - containing_service=None, - input_type=_LINK, - output_type=_LINKID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveLink', - full_name='context.ContextService.RemoveLink', - index=22, - containing_service=None, - input_type=_LINKID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetLinkEvents', - full_name='context.ContextService.GetLinkEvents', - index=23, - containing_service=None, - input_type=_EMPTY, - output_type=_LINKEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListServiceIds', - full_name='context.ContextService.ListServiceIds', - index=24, - containing_service=None, - input_type=_CONTEXTID, - output_type=_SERVICEIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListServices', - full_name='context.ContextService.ListServices', - index=25, - containing_service=None, - input_type=_CONTEXTID, - output_type=_SERVICELIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetService', - full_name='context.ContextService.GetService', - index=26, - containing_service=None, - input_type=_SERVICEID, - output_type=_SERVICE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetService', - full_name='context.ContextService.SetService', - index=27, - containing_service=None, - input_type=_SERVICE, - output_type=_SERVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveService', - full_name='context.ContextService.RemoveService', - index=28, - containing_service=None, - input_type=_SERVICEID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetServiceEvents', - full_name='context.ContextService.GetServiceEvents', - index=29, - containing_service=None, - input_type=_EMPTY, - output_type=_SERVICEEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListConnectionIds', - full_name='context.ContextService.ListConnectionIds', - index=30, - containing_service=None, - input_type=_SERVICEID, - output_type=_CONNECTIONIDLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ListConnections', - full_name='context.ContextService.ListConnections', - index=31, - containing_service=None, - input_type=_SERVICEID, - output_type=_CONNECTIONLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetConnection', - full_name='context.ContextService.GetConnection', - index=32, - containing_service=None, - input_type=_CONNECTIONID, - output_type=_CONNECTION, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SetConnection', - full_name='context.ContextService.SetConnection', - index=33, - containing_service=None, - input_type=_CONNECTION, - output_type=_CONNECTIONID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='RemoveConnection', - full_name='context.ContextService.RemoveConnection', - index=34, - containing_service=None, - input_type=_CONNECTIONID, - output_type=_EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetConnectionEvents', - full_name='context.ContextService.GetConnectionEvents', - index=35, - containing_service=None, - input_type=_EMPTY, - output_type=_CONNECTIONEVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_CONTEXTSERVICE) - -DESCRIPTOR.services_by_name['ContextService'] = _CONTEXTSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/webui/proto/device_pb2.py b/src/webui/proto/device_pb2.py deleted file mode 100644 index 4d4dbb82567256dd79595884f0ed9c2f13498d31..0000000000000000000000000000000000000000 --- a/src/webui/proto/device_pb2.py +++ /dev/null @@ -1,162 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: device.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import context_pb2 as context__pb2 -from . import monitoring_pb2 as monitoring__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='device.proto', - package='device', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x0c\x64\x65vice.proto\x12\x06\x64\x65vice\x1a\rcontext.proto\x1a\x10monitoring.proto\"\xa4\x01\n\x12MonitoringSettings\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x31\n\x0ekpi_descriptor\x18\x02 \x01(\x0b\x32\x19.monitoring.KpiDescriptor\x12\x1b\n\x13sampling_duration_s\x18\x03 \x01(\x02\x12\x1b\n\x13sampling_interval_s\x18\x04 \x01(\x02\x32\xb2\x02\n\rDeviceService\x12\x31\n\tAddDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x37\n\x0f\x43onfigureDevice\x12\x0f.context.Device\x1a\x11.context.DeviceId\"\x00\x12\x33\n\x0c\x44\x65leteDevice\x12\x11.context.DeviceId\x1a\x0e.context.Empty\"\x00\x12>\n\x10GetInitialConfig\x12\x11.context.DeviceId\x1a\x15.context.DeviceConfig\"\x00\x12@\n\x10MonitorDeviceKpi\x12\x1a.device.MonitoringSettings\x1a\x0e.context.Empty\"\x00\x62\x06proto3' - , - dependencies=[context__pb2.DESCRIPTOR,monitoring__pb2.DESCRIPTOR,]) - - - - -_MONITORINGSETTINGS = _descriptor.Descriptor( - name='MonitoringSettings', - full_name='device.MonitoringSettings', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='device.MonitoringSettings.kpi_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kpi_descriptor', full_name='device.MonitoringSettings.kpi_descriptor', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sampling_duration_s', full_name='device.MonitoringSettings.sampling_duration_s', index=2, - number=3, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sampling_interval_s', full_name='device.MonitoringSettings.sampling_interval_s', index=3, - number=4, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=58, - serialized_end=222, -) - -_MONITORINGSETTINGS.fields_by_name['kpi_id'].message_type = monitoring__pb2._KPIID -_MONITORINGSETTINGS.fields_by_name['kpi_descriptor'].message_type = monitoring__pb2._KPIDESCRIPTOR -DESCRIPTOR.message_types_by_name['MonitoringSettings'] = _MONITORINGSETTINGS -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -MonitoringSettings = _reflection.GeneratedProtocolMessageType('MonitoringSettings', (_message.Message,), { - 'DESCRIPTOR' : _MONITORINGSETTINGS, - '__module__' : 'device_pb2' - # @@protoc_insertion_point(class_scope:device.MonitoringSettings) - }) -_sym_db.RegisterMessage(MonitoringSettings) - - - -_DEVICESERVICE = _descriptor.ServiceDescriptor( - name='DeviceService', - full_name='device.DeviceService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=225, - serialized_end=531, - methods=[ - _descriptor.MethodDescriptor( - name='AddDevice', - full_name='device.DeviceService.AddDevice', - index=0, - containing_service=None, - input_type=context__pb2._DEVICE, - output_type=context__pb2._DEVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='ConfigureDevice', - full_name='device.DeviceService.ConfigureDevice', - index=1, - containing_service=None, - input_type=context__pb2._DEVICE, - output_type=context__pb2._DEVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='DeleteDevice', - full_name='device.DeviceService.DeleteDevice', - index=2, - containing_service=None, - input_type=context__pb2._DEVICEID, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetInitialConfig', - full_name='device.DeviceService.GetInitialConfig', - index=3, - containing_service=None, - input_type=context__pb2._DEVICEID, - output_type=context__pb2._DEVICECONFIG, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='MonitorDeviceKpi', - full_name='device.DeviceService.MonitorDeviceKpi', - index=4, - containing_service=None, - input_type=_MONITORINGSETTINGS, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_DEVICESERVICE) - -DESCRIPTOR.services_by_name['DeviceService'] = _DEVICESERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/webui/proto/kpi_sample_types_pb2.py b/src/webui/proto/kpi_sample_types_pb2.py deleted file mode 100644 index ea7fd2f82757d4c3db02d7e2c7817e2787b0b490..0000000000000000000000000000000000000000 --- a/src/webui/proto/kpi_sample_types_pb2.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: kpi_sample_types.proto -"""Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='kpi_sample_types.proto', - package='kpi_sample_types', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x16kpi_sample_types.proto\x12\x10kpi_sample_types*\xbe\x01\n\rKpiSampleType\x12\x19\n\x15KPISAMPLETYPE_UNKNOWN\x10\x00\x12%\n!KPISAMPLETYPE_PACKETS_TRANSMITTED\x10\x65\x12\"\n\x1eKPISAMPLETYPE_PACKETS_RECEIVED\x10\x66\x12$\n\x1fKPISAMPLETYPE_BYTES_TRANSMITTED\x10\xc9\x01\x12!\n\x1cKPISAMPLETYPE_BYTES_RECEIVED\x10\xca\x01\x62\x06proto3' -) - -_KPISAMPLETYPE = _descriptor.EnumDescriptor( - name='KpiSampleType', - full_name='kpi_sample_types.KpiSampleType', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_UNKNOWN', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_PACKETS_TRANSMITTED', index=1, number=101, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_PACKETS_RECEIVED', index=2, number=102, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_BYTES_TRANSMITTED', index=3, number=201, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KPISAMPLETYPE_BYTES_RECEIVED', index=4, number=202, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=45, - serialized_end=235, -) -_sym_db.RegisterEnumDescriptor(_KPISAMPLETYPE) - -KpiSampleType = enum_type_wrapper.EnumTypeWrapper(_KPISAMPLETYPE) -KPISAMPLETYPE_UNKNOWN = 0 -KPISAMPLETYPE_PACKETS_TRANSMITTED = 101 -KPISAMPLETYPE_PACKETS_RECEIVED = 102 -KPISAMPLETYPE_BYTES_TRANSMITTED = 201 -KPISAMPLETYPE_BYTES_RECEIVED = 202 - - -DESCRIPTOR.enum_types_by_name['KpiSampleType'] = _KPISAMPLETYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - -# @@protoc_insertion_point(module_scope) diff --git a/src/webui/proto/monitoring_pb2.py b/src/webui/proto/monitoring_pb2.py deleted file mode 100644 index b313ebb68f0da37a540898e8c362fd204a799076..0000000000000000000000000000000000000000 --- a/src/webui/proto/monitoring_pb2.py +++ /dev/null @@ -1,452 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: monitoring.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import context_pb2 as context__pb2 -from . import kpi_sample_types_pb2 as kpi__sample__types__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='monitoring.proto', - package='monitoring', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x10monitoring.proto\x12\nmonitoring\x1a\rcontext.proto\x1a\x16kpi_sample_types.proto\"\xda\x01\n\rKpiDescriptor\x12\x17\n\x0fkpi_description\x18\x01 \x01(\t\x12\x38\n\x0fkpi_sample_type\x18\x02 \x01(\x0e\x32\x1f.kpi_sample_types.KpiSampleType\x12$\n\tdevice_id\x18\x03 \x01(\x0b\x32\x11.context.DeviceId\x12(\n\x0b\x65ndpoint_id\x18\x04 \x01(\x0b\x32\x13.context.EndPointId\x12&\n\nservice_id\x18\x05 \x01(\x0b\x32\x12.context.ServiceId\"p\n\x11MonitorKpiRequest\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x1b\n\x13sampling_duration_s\x18\x02 \x01(\x02\x12\x1b\n\x13sampling_interval_s\x18\x03 \x01(\x02\"&\n\x05KpiId\x12\x1d\n\x06kpi_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\"d\n\x03Kpi\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\'\n\tkpi_value\x18\x04 \x01(\x0b\x32\x14.monitoring.KpiValue\"a\n\x08KpiValue\x12\x10\n\x06intVal\x18\x01 \x01(\rH\x00\x12\x12\n\x08\x66loatVal\x18\x02 \x01(\x02H\x00\x12\x13\n\tstringVal\x18\x03 \x01(\tH\x00\x12\x11\n\x07\x62oolVal\x18\x04 \x01(\x08H\x00\x42\x07\n\x05value\",\n\x07KpiList\x12!\n\x08kpi_list\x18\x01 \x03(\x0b\x32\x0f.monitoring.Kpi2\xf3\x02\n\x11MonitoringService\x12;\n\tCreateKpi\x12\x19.monitoring.KpiDescriptor\x1a\x11.monitoring.KpiId\"\x00\x12\x42\n\x10GetKpiDescriptor\x12\x11.monitoring.KpiId\x1a\x19.monitoring.KpiDescriptor\"\x00\x12/\n\nIncludeKpi\x12\x0f.monitoring.Kpi\x1a\x0e.context.Empty\"\x00\x12=\n\nMonitorKpi\x12\x1d.monitoring.MonitorKpiRequest\x1a\x0e.context.Empty\"\x00\x12\x36\n\x0cGetStreamKpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x30\x01\x12\x35\n\rGetInstantKpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x62\x06proto3' - , - dependencies=[context__pb2.DESCRIPTOR,kpi__sample__types__pb2.DESCRIPTOR,]) - - - - -_KPIDESCRIPTOR = _descriptor.Descriptor( - name='KpiDescriptor', - full_name='monitoring.KpiDescriptor', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_description', full_name='monitoring.KpiDescriptor.kpi_description', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kpi_sample_type', full_name='monitoring.KpiDescriptor.kpi_sample_type', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='monitoring.KpiDescriptor.device_id', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='endpoint_id', full_name='monitoring.KpiDescriptor.endpoint_id', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='service_id', full_name='monitoring.KpiDescriptor.service_id', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=72, - serialized_end=290, -) - - -_MONITORKPIREQUEST = _descriptor.Descriptor( - name='MonitorKpiRequest', - full_name='monitoring.MonitorKpiRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='monitoring.MonitorKpiRequest.kpi_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sampling_duration_s', full_name='monitoring.MonitorKpiRequest.sampling_duration_s', index=1, - number=2, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sampling_interval_s', full_name='monitoring.MonitorKpiRequest.sampling_interval_s', index=2, - number=3, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=292, - serialized_end=404, -) - - -_KPIID = _descriptor.Descriptor( - name='KpiId', - full_name='monitoring.KpiId', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='monitoring.KpiId.kpi_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=406, - serialized_end=444, -) - - -_KPI = _descriptor.Descriptor( - name='Kpi', - full_name='monitoring.Kpi', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_id', full_name='monitoring.Kpi.kpi_id', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='timestamp', full_name='monitoring.Kpi.timestamp', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='kpi_value', full_name='monitoring.Kpi.kpi_value', index=2, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=446, - serialized_end=546, -) - - -_KPIVALUE = _descriptor.Descriptor( - name='KpiValue', - full_name='monitoring.KpiValue', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='intVal', full_name='monitoring.KpiValue.intVal', index=0, - number=1, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='floatVal', full_name='monitoring.KpiValue.floatVal', index=1, - number=2, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='stringVal', full_name='monitoring.KpiValue.stringVal', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='boolVal', full_name='monitoring.KpiValue.boolVal', index=3, - number=4, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='value', full_name='monitoring.KpiValue.value', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=548, - serialized_end=645, -) - - -_KPILIST = _descriptor.Descriptor( - name='KpiList', - full_name='monitoring.KpiList', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='kpi_list', full_name='monitoring.KpiList.kpi_list', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=647, - serialized_end=691, -) - -_KPIDESCRIPTOR.fields_by_name['kpi_sample_type'].enum_type = kpi__sample__types__pb2._KPISAMPLETYPE -_KPIDESCRIPTOR.fields_by_name['device_id'].message_type = context__pb2._DEVICEID -_KPIDESCRIPTOR.fields_by_name['endpoint_id'].message_type = context__pb2._ENDPOINTID -_KPIDESCRIPTOR.fields_by_name['service_id'].message_type = context__pb2._SERVICEID -_MONITORKPIREQUEST.fields_by_name['kpi_id'].message_type = _KPIID -_KPIID.fields_by_name['kpi_id'].message_type = context__pb2._UUID -_KPI.fields_by_name['kpi_id'].message_type = _KPIID -_KPI.fields_by_name['kpi_value'].message_type = _KPIVALUE -_KPIVALUE.oneofs_by_name['value'].fields.append( - _KPIVALUE.fields_by_name['intVal']) -_KPIVALUE.fields_by_name['intVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value'] -_KPIVALUE.oneofs_by_name['value'].fields.append( - _KPIVALUE.fields_by_name['floatVal']) -_KPIVALUE.fields_by_name['floatVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value'] -_KPIVALUE.oneofs_by_name['value'].fields.append( - _KPIVALUE.fields_by_name['stringVal']) -_KPIVALUE.fields_by_name['stringVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value'] -_KPIVALUE.oneofs_by_name['value'].fields.append( - _KPIVALUE.fields_by_name['boolVal']) -_KPIVALUE.fields_by_name['boolVal'].containing_oneof = _KPIVALUE.oneofs_by_name['value'] -_KPILIST.fields_by_name['kpi_list'].message_type = _KPI -DESCRIPTOR.message_types_by_name['KpiDescriptor'] = _KPIDESCRIPTOR -DESCRIPTOR.message_types_by_name['MonitorKpiRequest'] = _MONITORKPIREQUEST -DESCRIPTOR.message_types_by_name['KpiId'] = _KPIID -DESCRIPTOR.message_types_by_name['Kpi'] = _KPI -DESCRIPTOR.message_types_by_name['KpiValue'] = _KPIVALUE -DESCRIPTOR.message_types_by_name['KpiList'] = _KPILIST -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -KpiDescriptor = _reflection.GeneratedProtocolMessageType('KpiDescriptor', (_message.Message,), { - 'DESCRIPTOR' : _KPIDESCRIPTOR, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiDescriptor) - }) -_sym_db.RegisterMessage(KpiDescriptor) - -MonitorKpiRequest = _reflection.GeneratedProtocolMessageType('MonitorKpiRequest', (_message.Message,), { - 'DESCRIPTOR' : _MONITORKPIREQUEST, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.MonitorKpiRequest) - }) -_sym_db.RegisterMessage(MonitorKpiRequest) - -KpiId = _reflection.GeneratedProtocolMessageType('KpiId', (_message.Message,), { - 'DESCRIPTOR' : _KPIID, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiId) - }) -_sym_db.RegisterMessage(KpiId) - -Kpi = _reflection.GeneratedProtocolMessageType('Kpi', (_message.Message,), { - 'DESCRIPTOR' : _KPI, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.Kpi) - }) -_sym_db.RegisterMessage(Kpi) - -KpiValue = _reflection.GeneratedProtocolMessageType('KpiValue', (_message.Message,), { - 'DESCRIPTOR' : _KPIVALUE, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiValue) - }) -_sym_db.RegisterMessage(KpiValue) - -KpiList = _reflection.GeneratedProtocolMessageType('KpiList', (_message.Message,), { - 'DESCRIPTOR' : _KPILIST, - '__module__' : 'monitoring_pb2' - # @@protoc_insertion_point(class_scope:monitoring.KpiList) - }) -_sym_db.RegisterMessage(KpiList) - - - -_MONITORINGSERVICE = _descriptor.ServiceDescriptor( - name='MonitoringService', - full_name='monitoring.MonitoringService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=694, - serialized_end=1065, - methods=[ - _descriptor.MethodDescriptor( - name='CreateKpi', - full_name='monitoring.MonitoringService.CreateKpi', - index=0, - containing_service=None, - input_type=_KPIDESCRIPTOR, - output_type=_KPIID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetKpiDescriptor', - full_name='monitoring.MonitoringService.GetKpiDescriptor', - index=1, - containing_service=None, - input_type=_KPIID, - output_type=_KPIDESCRIPTOR, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='IncludeKpi', - full_name='monitoring.MonitoringService.IncludeKpi', - index=2, - containing_service=None, - input_type=_KPI, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='MonitorKpi', - full_name='monitoring.MonitoringService.MonitorKpi', - index=3, - containing_service=None, - input_type=_MONITORKPIREQUEST, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetStreamKpi', - full_name='monitoring.MonitoringService.GetStreamKpi', - index=4, - containing_service=None, - input_type=_KPIID, - output_type=_KPI, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetInstantKpi', - full_name='monitoring.MonitoringService.GetInstantKpi', - index=5, - containing_service=None, - input_type=_KPIID, - output_type=_KPI, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_MONITORINGSERVICE) - -DESCRIPTOR.services_by_name['MonitoringService'] = _MONITORINGSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/webui/proto/service_pb2.py b/src/webui/proto/service_pb2.py deleted file mode 100644 index 7a006915b8be39710a17faab075e382e322d918f..0000000000000000000000000000000000000000 --- a/src/webui/proto/service_pb2.py +++ /dev/null @@ -1,88 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: service.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import context_pb2 as context__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='service.proto', - package='service', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rservice.proto\x12\x07service\x1a\rcontext.proto2\xfd\x01\n\x0eServiceService\x12\x37\n\rCreateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x37\n\rUpdateService\x12\x10.context.Service\x1a\x12.context.ServiceId\"\x00\x12\x35\n\rDeleteService\x12\x12.context.ServiceId\x1a\x0e.context.Empty\"\x00\x12\x42\n\x11GetConnectionList\x12\x12.context.ServiceId\x1a\x17.context.ConnectionList\"\x00\x62\x06proto3' - , - dependencies=[context__pb2.DESCRIPTOR,]) - - - -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - - -_SERVICESERVICE = _descriptor.ServiceDescriptor( - name='ServiceService', - full_name='service.ServiceService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=42, - serialized_end=295, - methods=[ - _descriptor.MethodDescriptor( - name='CreateService', - full_name='service.ServiceService.CreateService', - index=0, - containing_service=None, - input_type=context__pb2._SERVICE, - output_type=context__pb2._SERVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='UpdateService', - full_name='service.ServiceService.UpdateService', - index=1, - containing_service=None, - input_type=context__pb2._SERVICE, - output_type=context__pb2._SERVICEID, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='DeleteService', - full_name='service.ServiceService.DeleteService', - index=2, - containing_service=None, - input_type=context__pb2._SERVICEID, - output_type=context__pb2._EMPTY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='GetConnectionList', - full_name='service.ServiceService.GetConnectionList', - index=3, - containing_service=None, - input_type=context__pb2._SERVICEID, - output_type=context__pb2._CONNECTIONLIST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_SERVICESERVICE) - -DESCRIPTOR.services_by_name['ServiceService'] = _SERVICESERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/src/webui/requirements.in b/src/webui/requirements.in index c57794403c1dee6f1764a877b83805b6d32f12f5..b4a158d394bc2de67af1e0e99e922df08104f736 100644 --- a/src/webui/requirements.in +++ b/src/webui/requirements.in @@ -1,12 +1,19 @@ -Flask==2.0.2 +# 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. + +Flask==2.1.3 Flask-WTF==1.0.0 flask-healthz==0.0.3 flask-unittest==0.1.2 -grpcio==1.43.0 -grpcio-health-checking==1.43.0 -protobuf==3.19.3 -prometheus-client==0.13.0 -pytest==6.2.5 -pytest-benchmark==3.4.1 lorem-text==2.1 -coverage==6.3 diff --git a/src/webui/service/__init__.py b/src/webui/service/__init__.py index 24579b3d756498ec994b7875357d2315ddda260c..d5b40b486dd7772cea29fd7d71db949b2954155c 100644 --- a/src/webui/service/__init__.py +++ b/src/webui/service/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,41 +12,57 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -from flask import Flask, session +import json +from typing import List, Tuple, Union +from flask import Flask, request, session from flask_healthz import healthz, HealthError - -from webui.proto.context_pb2 import Empty -from device.client.DeviceClient import DeviceClient from context.client.ContextClient import ContextClient -from webui.Config import (CONTEXT_SERVICE_ADDRESS, CONTEXT_SERVICE_PORT, - DEVICE_SERVICE_ADDRESS, DEVICE_SERVICE_PORT) - +from device.client.DeviceClient import DeviceClient def get_working_context() -> str: - if 'context_uuid' in session: - return session['context_uuid'] - else: - return 'Not selected' + return session['context_uuid'] if 'context_uuid' in session else '---' +def get_working_topology() -> str: + return session['topology_uuid'] if 'topology_uuid' in session else '---' def liveness(): pass - def readiness(): try: # this component is ready when it is able to connect with the other components it depends on - context_client: ContextClient = ContextClient(CONTEXT_SERVICE_ADDRESS, CONTEXT_SERVICE_PORT) + context_client = ContextClient() context_client.connect() context_client.close() - device_client: DeviceClient = DeviceClient(DEVICE_SERVICE_ADDRESS, DEVICE_SERVICE_PORT) + device_client = DeviceClient() device_client.connect() device_client.close() except Exception as e: - raise HealthError('Can\'t connect with the service: ' + e.details()) + raise HealthError("Can't connect with the service: {:s}".format(str(e))) from e +def json_to_list(json_str : str) -> List[Union[str, Tuple[str, str]]]: + try: + data = json.loads(json_str) + except: # pylint: disable=bare-except + return [('item', str(json_str))] + + if isinstance(data, dict): + return [('kv', (key, value)) for key, value in data.items()] + elif isinstance(data, list): + return [('item', ', '.join(data))] + else: + return [('item', str(data))] -def create_app(use_config=None): +class SetSubAppMiddleware(): + def __init__(self, app, web_app_root): + self.app = app + self.web_app_root = web_app_root + + def __call__(self, environ, start_response): + environ['SCRIPT_NAME'] = self.web_app_root + environ['APPLICATION_ROOT'] = self.web_app_root + return self.app(environ, start_response) + +def create_app(use_config=None, web_app_root=None): app = Flask(__name__) if use_config: app.config.from_mapping(**use_config) @@ -58,15 +74,33 @@ def create_app(use_config=None): app.register_blueprint(healthz, url_prefix='/healthz') - from webui.service.main.routes import main + from webui.service.js.routes import js # pylint: disable=import-outside-toplevel + app.register_blueprint(js) + + from webui.service.main.routes import main # pylint: disable=import-outside-toplevel app.register_blueprint(main) - from webui.service.service.routes import service + from webui.service.load_gen.routes import load_gen # pylint: disable=import-outside-toplevel + app.register_blueprint(load_gen) + + from webui.service.service.routes import service # pylint: disable=import-outside-toplevel app.register_blueprint(service) - from webui.service.device.routes import device + from webui.service.slice.routes import slice # pylint: disable=import-outside-toplevel,redefined-builtin + app.register_blueprint(slice) + + from webui.service.device.routes import device # pylint: disable=import-outside-toplevel app.register_blueprint(device) - app.jinja_env.globals.update(get_working_context=get_working_context) + from webui.service.link.routes import link # pylint: disable=import-outside-toplevel + app.register_blueprint(link) + + app.jinja_env.globals.update({ # pylint: disable=no-member + 'json_to_list' : json_to_list, + 'get_working_context' : get_working_context, + 'get_working_topology': get_working_topology, + }) + if web_app_root is not None: + app.wsgi_app = SetSubAppMiddleware(app.wsgi_app, web_app_root) return app diff --git a/src/webui/service/__main__.py b/src/webui/service/__main__.py index 38bc0f790d7030ef1ed4ede0085a6161db1f8cec..f07056d509552f0d2db92468f9785446f56ce421 100644 --- a/src/webui/service/__main__.py +++ b/src/webui/service/__main__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,32 +12,54 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os, sys, logging +import hashlib, sys, logging from prometheus_client import start_http_server -from common.Settings import wait_for_environment_variables +from common.Constants import ServiceNameEnum +from common.Settings import ( + ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, + get_service_baseurl_http, get_service_port_http, get_setting, wait_for_environment_variables) from webui.service import create_app -from webui.Config import WEBUI_SERVICE_PORT, LOG_LEVEL, METRICS_PORT, HOST, SECRET_KEY, DEBUG +from webui.Config import MAX_CONTENT_LENGTH, HOST, SECRET_KEY, DEBUG -def main(): - service_port = os.environ.get('WEBUISERVICE_SERVICE_PORT', WEBUI_SERVICE_PORT) - log_level = os.environ.get('LOG_LEVEL', LOG_LEVEL ) - metrics_port = os.environ.get('METRICS_PORT', METRICS_PORT ) - host = os.environ.get('HOST', HOST ) - debug = os.environ.get('DEBUG', DEBUG ) +def create_unique_session_cookie_name() -> str: + hostname = get_setting('HOSTNAME') + if hostname is None: return 'session' + hasher = hashlib.blake2b(digest_size=8) + hasher.update(hostname.encode('UTF-8')) + return 'session:{:s}'.format(str(hasher.hexdigest())) +def main(): + log_level = get_log_level() logging.basicConfig(level=log_level) logger = logging.getLogger(__name__) wait_for_environment_variables([ - 'CONTEXTSERVICE_SERVICE_HOST', 'CONTEXTSERVICE_SERVICE_PORT_GRPC', - 'DEVICESERVICE_SERVICE_HOST', 'DEVICESERVICE_SERVICE_PORT_GRPC' + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + get_env_var_name(ServiceNameEnum.DEVICE, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.DEVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + get_env_var_name(ServiceNameEnum.SERVICE, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.SERVICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + get_env_var_name(ServiceNameEnum.SLICE, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.SLICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC), ]) logger.info('Starting...') + metrics_port = get_metrics_port() start_http_server(metrics_port) - app = create_app(use_config={'SECRET_KEY': SECRET_KEY}) + host = get_setting('HOST', default=HOST) + service_port = get_service_port_http(ServiceNameEnum.WEBUI) + web_app_root = get_service_baseurl_http(ServiceNameEnum.WEBUI) + debug = get_setting('DEBUG', default=DEBUG) + if isinstance(debug, str): debug = (debug.upper() in {'T', '1', 'TRUE'}) + + app = create_app(use_config={ + 'SECRET_KEY': SECRET_KEY, + 'MAX_CONTENT_LENGTH': MAX_CONTENT_LENGTH, + 'SESSION_COOKIE_NAME': create_unique_session_cookie_name(), + }, web_app_root=web_app_root) app.run(host=host, port=service_port, debug=debug) logger.info('Bye') diff --git a/src/webui/service/context/__init__.py b/src/webui/service/context/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/webui/service/context/__init__.py +++ b/src/webui/service/context/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/webui/service/context/routes.py b/src/webui/service/context/routes.py index 29910cbc34509f1dc0848359fd7367a07174b6dc..7c45f136db195c1581c7de7e92d4a0df907ad869 100644 --- a/src/webui/service/context/routes.py +++ b/src/webui/service/context/routes.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/webui/service/device/__init__.py b/src/webui/service/device/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/webui/service/device/__init__.py +++ b/src/webui/service/device/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/webui/service/device/forms.py b/src/webui/service/device/forms.py index 7d2ac45e1f95c44804ca54c17343b18101d3b104..e496c4d432c7c9d02227141ea6d618984378c185 100644 --- a/src/webui/service/device/forms.py +++ b/src/webui/service/device/forms.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,42 +14,45 @@ # external imports from flask_wtf import FlaskForm -from wtforms import StringField, SelectField, TextAreaField, SubmitField +from wtforms import StringField, SelectField, TextAreaField, SubmitField, BooleanField, Form from wtforms.validators import DataRequired, Length, NumberRange, Regexp, ValidationError - +from common.proto.context_pb2 import DeviceOperationalStatusEnum from webui.utils.form_validators import key_value_validator -from webui.proto.context_pb2 import (DeviceDriverEnum, DeviceOperationalStatusEnum) class AddDeviceForm(FlaskForm): device_id = StringField('ID', validators=[DataRequired(), Length(min=5)]) - device_type = StringField('Type', - validators=[DataRequired(), Length(min=5)]) - device_config = TextAreaField('Configurations', validators=[key_value_validator()]) + device_type = SelectField('Type', choices = []) operational_status = SelectField('Operational Status', # choices=[(-1, 'Select...'), (0, 'Undefined'), (1, 'Disabled'), (2, 'Enabled')], coerce=int, validators=[NumberRange(min=0)]) - device_drivers = TextAreaField('Drivers', validators=[DataRequired(), Regexp(r'^\d+(,\d+)*$')]) + device_drivers_undefined = BooleanField('UNDEFINED / EMULATED') + device_drivers_openconfig = BooleanField('OPENCONFIG') + 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_xr = BooleanField('XR') + device_config_address = StringField('connect/address',default='127.0.0.1',validators=[DataRequired(), Length(min=5)]) + device_config_port = StringField('connect/port',default='0',validators=[DataRequired(), Length(min=1)]) + device_config_settings = TextAreaField('connect/settings',default='{}',validators=[DataRequired(), Length(min=2)]) submit = SubmitField('Add') def validate_operational_status(form, field): if field.data not in DeviceOperationalStatusEnum.DESCRIPTOR.values_by_number: raise ValidationError('The operational status value selected is incorrect!') - - def validate_device_drivers(form, field): - if ',' not in field.data: - data = str(field.data) + ',' - else: - data = field.data - for value in data.split(','): - value = value.strip() - if len(value) == 0: - continue - try: - value_int = int(value) - except: - raise ValidationError(f'The value "{value}" is not a valid driver identified.') - if value_int not in DeviceDriverEnum.DESCRIPTOR.values_by_number: - values = ', '.join([str(x) for x in DeviceDriverEnum.DESCRIPTOR.values_by_number]) - raise ValidationError(f'The device driver {value_int} is not correct. Allowed values are: {values}.') + +class ConfigForm(FlaskForm): + device_key_config = StringField('Key configuration') + device_value_config = StringField('Value configuration') + submit = SubmitField('Add') + + +class UpdateDeviceForm(FlaskForm): + update_operational_status = SelectField('Operational Status', + choices=[(-1, 'Select...'), (0, 'Undefined'), (1, 'Disabled'), (2, 'Enabled')], + coerce=int, + validators=[NumberRange(min=0)]) + + submit = SubmitField('Update') diff --git a/src/webui/service/device/routes.py b/src/webui/service/device/routes.py index 8a0e1cc0a8448a91b7dcaec1b9cc0d7308c65821..ce3edcfda45859c3e5db83c62fd328ee546762a5 100644 --- a/src/webui/service/device/routes.py +++ b/src/webui/service/device/routes.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,106 +12,138 @@ # See the License for the specific language governing permissions and # limitations under the License. -from flask import render_template, Blueprint, flash, session, redirect -from device.client.DeviceClient import DeviceClient +import json +from flask import current_app, render_template, Blueprint, flash, session, redirect, url_for +from common.proto.context_pb2 import ( + ConfigActionEnum, Device, DeviceDriverEnum, DeviceId, DeviceList, DeviceOperationalStatusEnum, Empty, TopologyId) +from common.tools.object_factory.Context import json_context_id +from common.tools.object_factory.Topology import json_topology_id from context.client.ContextClient import ContextClient -from webui.Config import (CONTEXT_SERVICE_ADDRESS, CONTEXT_SERVICE_PORT, - DEVICE_SERVICE_ADDRESS, DEVICE_SERVICE_PORT) -from webui.proto.context_pb2 import (ContextId, DeviceList, DeviceId, - Device, DeviceDriverEnum, DeviceOperationalStatusEnum, - ConfigActionEnum, ConfigRule, TopologyIdList, TopologyList) +from device.client.DeviceClient import DeviceClient from webui.service.device.forms import AddDeviceForm +from common.DeviceTypes import DeviceTypeEnum +from webui.service.device.forms import ConfigForm +from webui.service.device.forms import UpdateDeviceForm device = Blueprint('device', __name__, url_prefix='/device') -context_client: ContextClient = ContextClient(CONTEXT_SERVICE_ADDRESS, CONTEXT_SERVICE_PORT) -device_client: DeviceClient = DeviceClient(DEVICE_SERVICE_ADDRESS, DEVICE_SERVICE_PORT) +context_client = ContextClient() +device_client = DeviceClient() @device.get('/') def home(): - request: ContextId = ContextId() - request.context_uuid.uuid = session.get('context_uuid', '-') + if 'context_uuid' not in session or 'topology_uuid' not in session: + flash("Please select a context!", "warning") + return redirect(url_for("main.home")) + + context_uuid = session['context_uuid'] + topology_uuid = session['topology_uuid'] + context_client.connect() - response: DeviceList = context_client.ListDevices(request) + json_topo_id = json_topology_id(topology_uuid, context_id=json_context_id(context_uuid)) + grpc_topology = context_client.GetTopology(TopologyId(**json_topo_id)) + topo_device_uuids = {device_id.device_uuid.uuid for device_id in grpc_topology.device_ids} + grpc_devices: DeviceList = context_client.ListDevices(Empty()) context_client.close() - return render_template('device/home.html', devices=response.devices, - dde=DeviceDriverEnum, - dose=DeviceOperationalStatusEnum) + + devices = [ + device for device in grpc_devices.devices + if device.device_id.device_uuid.uuid in topo_device_uuids + ] + + return render_template( + 'device/home.html', devices=devices, dde=DeviceDriverEnum, + dose=DeviceOperationalStatusEnum) @device.route('add', methods=['GET', 'POST']) def add(): form = AddDeviceForm() - request: ContextId = ContextId() - request.context_uuid.uuid = session.get('context_uuid', '-') - context_client.connect() - response: TopologyIdList = context_client.ListTopologyIds(request) - context_client.close() - # listing enum values - form.operational_status.choices = [(-1, 'Select...')] - for key, value in DeviceOperationalStatusEnum.DESCRIPTOR.values_by_name.items(): - form.operational_status.choices.append((DeviceOperationalStatusEnum.Value(key), key.replace('DEVICEOPERATIONALSTATUS_', ''))) - - # device driver ids - device_driver_ids = [] - for key in DeviceDriverEnum.DESCRIPTOR.values_by_name: - device_driver_ids.append(f"{DeviceDriverEnum.Value(key)}={key.replace('DEVICEDRIVER_', '')}") - device_driver_ids = ', '.join(device_driver_ids) + form.operational_status.choices = [] + for key, _ in DeviceOperationalStatusEnum.DESCRIPTOR.values_by_name.items(): + form.operational_status.choices.append( + (DeviceOperationalStatusEnum.Value(key), key.replace('DEVICEOPERATIONALSTATUS_', ''))) + + # items for Device Type field + for device_type in DeviceTypeEnum: + form.device_type.choices.append((device_type.value,device_type.value)) if form.validate_on_submit(): - device: Device = Device() - device.device_id.device_uuid.uuid = form.device_id.data - device.device_type = form.device_type.data - if '\n' not in form.device_config.data: - data = form.device_config.data.strip() + '\n' - else: - data = form.device_config.data.strip() - - for config in data.split('\n'): - if len(config.strip()) > 0: - parts = config.strip().split('=') - config_rule: ConfigRule = ConfigRule() - config_rule.action = ConfigActionEnum.CONFIGACTION_SET - config_rule.resource_key = parts[0].strip() - config_rule.resource_value = parts[1].strip() - device.device_config.config_rules.append(config_rule) - - device.device_operational_status = form.operational_status.data - - if ',' not in form.device_drivers.data: - data = form.device_drivers.data.strip() + ',' + device_obj = Device() + # Device UUID: + device_obj.device_id.device_uuid.uuid = form.device_id.data + + # Device type: + device_obj.device_type = str(form.device_type.data) + + # Device configurations: + config_rule = device_obj.device_config.config_rules.add() + config_rule.action = ConfigActionEnum.CONFIGACTION_SET + config_rule.custom.resource_key = '_connect/address' + config_rule.custom.resource_value = form.device_config_address.data + + config_rule = device_obj.device_config.config_rules.add() + config_rule.action = ConfigActionEnum.CONFIGACTION_SET + config_rule.custom.resource_key = '_connect/port' + config_rule.custom.resource_value = form.device_config_port.data + + config_rule = device_obj.device_config.config_rules.add() + config_rule.action = ConfigActionEnum.CONFIGACTION_SET + config_rule.custom.resource_key = '_connect/settings' + + try: + device_config_settings = json.loads(form.device_config_settings.data) + except: # pylint: disable=bare-except + device_config_settings = form.device_config_settings.data + + if isinstance(device_config_settings, dict): + config_rule.custom.resource_value = json.dumps(device_config_settings) else: - data = form.device_drivers.data.strip() - - for driver in data.split(','): - driver = driver.strip() - if len(driver) == 0: - continue - device.device_drivers.append(int(driver)) + config_rule.custom.resource_value = str(device_config_settings) + + # Device status: + device_obj.device_operational_status = form.operational_status.data + + # Device drivers: + if form.device_drivers_undefined.data: + device_obj.device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_UNDEFINED) + if form.device_drivers_openconfig.data: + device_obj.device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG) + if form.device_drivers_transport_api.data: + device_obj.device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_TRANSPORT_API) + if form.device_drivers_p4.data: + device_obj.device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_P4) + if form.device_drivers_ietf_network_topology.data: + device_obj.device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY) + if form.device_drivers_onf_tr_352.data: + device_obj.device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352) + if form.device_drivers_xr.data: + device_obj.device_drivers.append(DeviceDriverEnum.DEVICEDRIVER_XR) + try: device_client.connect() - response: DeviceId = device_client.AddDevice(device) + response: DeviceId = device_client.AddDevice(device_obj) device_client.close() - flash(f'New device was created with ID "{response.device_uuid.uuid}".', 'success') - return redirect('/device/') + return redirect(url_for('device.home')) except Exception as e: flash(f'Problem adding the device. {e.details()}', 'danger') return render_template('device/add.html', form=form, - submit_text='Add New Device', - device_driver_ids=device_driver_ids) + submit_text='Add New Device') -@device.route('detail/', methods=['GET', 'POST']) +@device.route('detail/', methods=['GET', 'POST']) def detail(device_uuid: str): - request: DeviceId = DeviceId() + request = DeviceId() request.device_uuid.uuid = device_uuid context_client.connect() - response: Device = context_client.GetDevice(request) + response = context_client.GetDevice(request) context_client.close() - return render_template('device/detail.html', device=response) + return render_template('device/detail.html', device=response, + dde=DeviceDriverEnum, + dose=DeviceOperationalStatusEnum) -@device.get('/delete') +@device.get('/delete') def delete(device_uuid): try: @@ -121,15 +153,78 @@ def delete(device_uuid): # response: Device = client.GetDevice(request) # TODO: finalize implementation - request: DeviceId = DeviceId() + request = DeviceId() request.device_uuid.uuid = device_uuid device_client.connect() response = device_client.DeleteDevice(request) - device_client.close() - flash('Device deleted successfully!', 'success') + flash(f'Device "{device_uuid}" deleted successfully!', 'success') except Exception as e: - flash(f'Problem deleting the device. {e.details()}', 'danger') + flash(f'Problem deleting device "{device_uuid}": {e.details()}', 'danger') + current_app.logger.exception(e) + return redirect(url_for('device.home')) + +@device.route('/addconfig', methods=['GET', 'POST']) +def addconfig(device_uuid): + form = ConfigForm() + request = DeviceId() + request.device_uuid.uuid = device_uuid + context_client.connect() + response = context_client.GetDevice(request) + context_client.close() + + if form.validate_on_submit(): + device = Device() + device.CopyFrom(response) + config_rule = device.device_config.config_rules.add() + config_rule.action = ConfigActionEnum.CONFIGACTION_SET + config_rule.custom.resource_key = form.device_key_config.data + config_rule.custom.resource_value = form.device_value_config.data + try: + device_client.connect() + response: DeviceId = device_client.ConfigureDevice(device) + device_client.close() + flash(f'New configuration was created with ID "{response.device_uuid.uuid}".', 'success') + return redirect(url_for('device.home')) + except Exception as e: + flash(f'Problem adding the device. {e.details()}', 'danger') - return redirect('/device/') + return render_template('device/addconfig.html', form=form, submit_text='Add New Configuration') + +@device.route('updateconfig', methods=['GET', 'POST']) +def updateconfig(): + + + return render_template('device/updateconfig.html') + + +@device.route('/update', methods=['GET', 'POST']) +def update(device_uuid): + form = UpdateDeviceForm() + request = DeviceId() + request.device_uuid.uuid = device_uuid + context_client.connect() + response = context_client.GetDevice(request) + context_client.close() + + # listing enum values + form.update_operational_status.choices = [] + for key, value in DeviceOperationalStatusEnum.DESCRIPTOR.values_by_name.items(): + form.update_operational_status.choices.append((DeviceOperationalStatusEnum.Value(key), key.replace('DEVICEOPERATIONALSTATUS_', ''))) + + form.update_operational_status.default = response.device_operational_status + + if form.validate_on_submit(): + device = Device() + device.CopyFrom(response) + device.device_operational_status = form.update_operational_status.data + try: + device_client.connect() + response: DeviceId = device_client.ConfigureDevice(device) + device_client.close() + flash(f'Status of device with ID "{response.device_uuid.uuid}" was updated.', 'success') + return redirect(url_for('device.home')) + except Exception as e: + flash(f'Problem updating the device. {e.details()}', 'danger') + return render_template('device/update.html', device=response, form=form, submit_text='Update Device') diff --git a/src/webui/service/js/__init__.py b/src/webui/service/js/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/webui/service/js/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/common/orm/backend/BackendEnum.py b/src/webui/service/js/routes.py similarity index 62% rename from src/common/orm/backend/BackendEnum.py rename to src/webui/service/js/routes.py index 0297ca7be6c3bd13c2ee7d3cabe75efe23ead51f..68e0af893a9f82197d18ee4d6632c934ff17ef35 100644 --- a/src/common/orm/backend/BackendEnum.py +++ b/src/webui/service/js/routes.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,11 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import Enum +from flask import render_template, Blueprint -class BackendEnum(Enum): - INMEMORY = 'inmemory' - REDIS = 'redis' - #MONGODB = 'mongodb' - #RETHINKDB = 'rethinkdb' - #ETCD = 'etcd' +js = Blueprint('js', __name__, url_prefix='/js') + +@js.get('site.js') +def site_js(): + return render_template('js/site.js') + +@js.get('topology.js') +def topology_js(): + return render_template('js/topology.js') diff --git a/src/webui/service/link/__init__.py b/src/webui/service/link/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..355dcdb04bdddd352966a9567a7a63117666e619 --- /dev/null +++ b/src/webui/service/link/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/webui/service/link/routes.py b/src/webui/service/link/routes.py new file mode 100644 index 0000000000000000000000000000000000000000..9324ad0be6d9e72dfd3413863f0590f6ec595c3b --- /dev/null +++ b/src/webui/service/link/routes.py @@ -0,0 +1,63 @@ +# 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 flask import render_template, Blueprint, flash, session, redirect, url_for +from common.proto.context_pb2 import Empty, LinkId, LinkList, TopologyId +from common.tools.context_queries.EndPoint import get_endpoint_names +from common.tools.object_factory.Context import json_context_id +from common.tools.object_factory.Topology import json_topology_id +from context.client.ContextClient import ContextClient + + +link = Blueprint('link', __name__, url_prefix='/link') +context_client = ContextClient() + +@link.get('/') +def home(): + if 'context_uuid' not in session or 'topology_uuid' not in session: + flash("Please select a context!", "warning") + return redirect(url_for("main.home")) + + context_uuid = session['context_uuid'] + topology_uuid = session['topology_uuid'] + + context_client.connect() + json_topo_id = json_topology_id(topology_uuid, context_id=json_context_id(context_uuid)) + grpc_topology = context_client.GetTopology(TopologyId(**json_topo_id)) + topo_link_uuids = {link_id.link_uuid.uuid for link_id in grpc_topology.link_ids} + grpc_links: LinkList = context_client.ListLinks(Empty()) + + endpoint_ids = [] + links = [] + for link_ in grpc_links.links: + if link_.link_id.link_uuid.uuid not in topo_link_uuids: continue + links.append(link_) + endpoint_ids.extend(link_.link_endpoint_ids) + + device_names, endpoints_data = get_endpoint_names(context_client, endpoint_ids) + context_client.close() + + return render_template('link/home.html', links=links, device_names=device_names, endpoints_data=endpoints_data) + + +@link.route('detail/', methods=('GET', 'POST')) +def detail(link_uuid: str): + request = LinkId() + request.link_uuid.uuid = link_uuid # pylint: disable=no-member + context_client.connect() + response = context_client.GetLink(request) + device_names, endpoints_data = get_endpoint_names(context_client, response.link_endpoint_ids) + context_client.close() + return render_template('link/detail.html',link=response, device_names=device_names, endpoints_data=endpoints_data) diff --git a/src/webui/service/load_gen/__init__.py b/src/webui/service/load_gen/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/webui/service/load_gen/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/webui/service/load_gen/routes.py b/src/webui/service/load_gen/routes.py new file mode 100644 index 0000000000000000000000000000000000000000..3118b6de0e061adac65be178163623cd2d1d8fff --- /dev/null +++ b/src/webui/service/load_gen/routes.py @@ -0,0 +1,45 @@ +# 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 flask import render_template, Blueprint, flash +from common.proto.context_pb2 import Empty +from load_generator.client.LoadGeneratorClient import LoadGeneratorClient + +load_gen = Blueprint('load_gen', __name__, url_prefix='/load_gen') + +@load_gen.route('start', methods=['GET']) +def start(): + load_gen_client = LoadGeneratorClient() + try: + load_gen_client.connect() + load_gen_client.Start(Empty()) + load_gen_client.close() + flash('Load Generator Started.', 'success') + except Exception as e: # pylint: disable=broad-except + flash('Problem starting Load Generator. {:s}'.format(str(e)), 'danger') + + return render_template('main/debug.html') + +@load_gen.route('stop', methods=['GET']) +def stop(): + load_gen_client = LoadGeneratorClient() + try: + load_gen_client.connect() + load_gen_client.Stop(Empty()) + load_gen_client.close() + flash('Load Generator Stoped.', 'success') + except Exception as e: # pylint: disable=broad-except + flash('Problem stopping Load Generator. {:s}'.format(str(e)), 'danger') + + return render_template('main/debug.html') diff --git a/src/webui/service/main/__init__.py b/src/webui/service/main/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/webui/service/main/__init__.py +++ b/src/webui/service/main/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/webui/service/main/forms.py b/src/webui/service/main/forms.py index 0dc80c7a20628921b03fc8fd8d0189a75f1053a4..9d628e072fe271b11c79df9845fa18c532a81407 100644 --- a/src/webui/service/main/forms.py +++ b/src/webui/service/main/forms.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,12 +14,26 @@ # external imports from flask_wtf import FlaskForm -from wtforms import SelectField, SubmitField +from flask_wtf.file import FileAllowed +from wtforms import SelectField, FileField, SubmitField from wtforms.validators import DataRequired, Length -class ContextForm(FlaskForm): - context = SelectField('Context', - choices=[], - validators=[DataRequired(), Length(min=1)]) - submit = SubmitField('Select') +class ContextTopologyForm(FlaskForm): + context_topology = SelectField( + 'Ctx/Topo', + choices=[], + validators=[ + DataRequired(), + Length(min=1) + ]) + submit = SubmitField('Submit') + + +class DescriptorForm(FlaskForm): + descriptors = FileField( + 'Descriptors', + validators=[ + FileAllowed(['json'], 'JSON Descriptors only!') + ]) + submit = SubmitField('Submit') diff --git a/src/webui/service/main/routes.py b/src/webui/service/main/routes.py index 78247b3ca66b41801bf12a7cb3be25e2adf93ad4..38d13aad562f3e55490952db84ef784f87697739 100644 --- a/src/webui/service/main/routes.py +++ b/src/webui/service/main/routes.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,40 +12,165 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging -import sys -from flask import render_template, Blueprint, flash, session -from webui.Config import CONTEXT_SERVICE_ADDRESS, CONTEXT_SERVICE_PORT +import base64, json, logging, re +from flask import jsonify, redirect, render_template, Blueprint, flash, session, url_for, request +from common.proto.context_pb2 import ContextList, Empty, TopologyId, TopologyList +from common.tools.descriptor.Loader import DescriptorLoader, compose_notifications +from common.tools.grpc.Tools import grpc_message_to_json_string +from common.tools.object_factory.Context import json_context_id +from common.tools.object_factory.Topology import json_topology_id from context.client.ContextClient import ContextClient -from webui.proto.context_pb2 import Empty -from webui.service.main.forms import ContextForm +from device.client.DeviceClient import DeviceClient +from service.client.ServiceClient import ServiceClient +from slice.client.SliceClient import SliceClient +from webui.service.main.forms import ContextTopologyForm, DescriptorForm main = Blueprint('main', __name__) -context_client: ContextClient = ContextClient(CONTEXT_SERVICE_ADDRESS, CONTEXT_SERVICE_PORT) +context_client = ContextClient() +device_client = DeviceClient() +service_client = ServiceClient() +slice_client = SliceClient() -logger = logging.getLogger(__name__) +LOGGER = logging.getLogger(__name__) + +def process_descriptors(descriptors): + try: + descriptors_file = request.files[descriptors.name] + descriptors_data = descriptors_file.read() + descriptors = json.loads(descriptors_data) + except Exception as e: # pylint: disable=broad-except + flash(f'Unable to load descriptor file: {str(e)}', 'danger') + return + + descriptor_loader = DescriptorLoader(descriptors) + results = descriptor_loader.process() + for message,level in compose_notifications(results): + if level == 'error': LOGGER.warning('ERROR message={:s}'.format(str(message))) + flash(message, level) @main.route('/', methods=['GET', 'POST']) def home(): - # flash('This is an info message', 'info') - # flash('This is a danger message', 'danger') context_client.connect() - response = context_client.ListContextIds(Empty()) - context_client.close() - context_form: ContextForm = ContextForm() - context_form.context.choices.append(('', 'Select...')) - for context in response.context_ids: - context_form.context.choices.append((context.context_uuid.uuid, context.context_uuid)) - if context_form.validate_on_submit(): - session['context_uuid'] = context_form.context.data - flash(f'The context was successfully set to `{context_form.context.data}`.', 'success') - if 'context_uuid' in session: - context_form.context.data = session['context_uuid'] + device_client.connect() + context_topology_form: ContextTopologyForm = ContextTopologyForm() + context_topology_form.context_topology.choices.append(('', 'Select...')) + + contexts : ContextList = context_client.ListContexts(Empty()) + for context_ in contexts.contexts: + #context_uuid : str = context_.context_id.context_uuid.uuid + context_name : str = context_.name + topologies : TopologyList = context_client.ListTopologies(context_.context_id) + for topology_ in topologies.topologies: + #topology_uuid : str = topology_.topology_id.topology_uuid.uuid + topology_name : str = topology_.name + raw_values = context_name, topology_name + b64_values = [base64.b64encode(v.encode('utf-8')).decode('utf-8') for v in raw_values] + context_topology_uuid = ','.join(b64_values) + context_topology_name = 'Context({:s}):Topology({:s})'.format(context_name, topology_name) + context_topology_entry = (context_topology_uuid, context_topology_name) + context_topology_form.context_topology.choices.append(context_topology_entry) + + if context_topology_form.validate_on_submit(): + context_topology_uuid = context_topology_form.context_topology.data + if len(context_topology_uuid) > 0: + b64_values = context_topology_uuid.split(',') + raw_values = [base64.b64decode(v.encode('utf-8')).decode('utf-8') for v in b64_values] + context_name, topology_name = raw_values + #session.clear() + session['context_topology_uuid'] = context_topology_uuid + session['context_uuid'] = context_name + #session['context_name'] = context_name + session['topology_uuid'] = topology_name + #session['topology_name'] = topology_name + MSG = f'Context({context_name})/Topology({topology_name}) successfully selected.' + flash(MSG, 'success') + return redirect(url_for('main.home')) + + #match = re.match('ctx\[([^\]]+)\]\/topo\[([^\]]+)\]', context_topology_uuid) + #if match is not None: + # session['context_topology_uuid'] = context_topology_uuid = match.group(0) + # session['context_uuid'] = context_uuid = match.group(1) + # session['topology_uuid'] = topology_uuid = match.group(2) + # MSG = f'Context({context_uuid})/Topology({topology_uuid}) successfully selected.' + # flash(MSG, 'success') + # return redirect(url_for('main.home')) + + if 'context_topology_uuid' in session: + context_topology_form.context_topology.data = session['context_topology_uuid'] + + descriptor_form: DescriptorForm = DescriptorForm() + try: + if descriptor_form.validate_on_submit(): + process_descriptors(descriptor_form.descriptors) + return redirect(url_for("main.home")) + except Exception as e: # pylint: disable=broad-except + LOGGER.exception('Descriptor load failed') + flash(f'Descriptor load failed: `{str(e)}`', 'danger') + finally: + context_client.close() + device_client.close() + + return render_template( + 'main/home.html', context_topology_form=context_topology_form, descriptor_form=descriptor_form) + +@main.route('/topology', methods=['GET']) +def topology(): + context_client.connect() + try: + if 'context_uuid' not in session or 'topology_uuid' not in session: + return jsonify({'devices': [], 'links': []}) + + context_uuid = session['context_uuid'] + topology_uuid = session['topology_uuid'] + + json_topo_id = json_topology_id(topology_uuid, context_id=json_context_id(context_uuid)) + grpc_topology = context_client.GetTopology(TopologyId(**json_topo_id)) - return render_template('main/home.html', context_form=context_form) + topo_device_uuids = {device_id.device_uuid.uuid for device_id in grpc_topology.device_ids} + topo_link_uuids = {link_id .link_uuid .uuid for link_id in grpc_topology.link_ids } + response = context_client.ListDevices(Empty()) + devices = [] + for device in response.devices: + if device.device_id.device_uuid.uuid not in topo_device_uuids: continue + devices.append({ + 'id': device.device_id.device_uuid.uuid, + 'name': device.name, + 'type': device.device_type, + }) + + response = context_client.ListLinks(Empty()) + links = [] + for link in response.links: + if link.link_id.link_uuid.uuid not in topo_link_uuids: continue + if len(link.link_endpoint_ids) != 2: + str_link = grpc_message_to_json_string(link) + LOGGER.warning('Unexpected link with len(endpoints) != 2: {:s}'.format(str_link)) + continue + links.append({ + 'id': link.link_id.link_uuid.uuid, + 'name': link.name, + 'source': link.link_endpoint_ids[0].device_id.device_uuid.uuid, + 'target': link.link_endpoint_ids[1].device_id.device_uuid.uuid, + }) + + return jsonify({'devices': devices, 'links': links}) + except: # pylint: disable=bare-except + LOGGER.exception('Error retrieving topology') + return jsonify({'devices': [], 'links': []}) + finally: + context_client.close() @main.get('/about') def about(): return render_template('main/about.html') + +@main.get('/debug') +def debug(): + return render_template('main/debug.html') + +@main.get('/resetsession') +def reset_session(): + session.clear() + return redirect(url_for("main.home")) diff --git a/src/webui/service/service/__init__.py b/src/webui/service/service/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..1549d9811aa5d1c193a44ad45d0d7773236c0612 100644 --- a/src/webui/service/service/__init__.py +++ b/src/webui/service/service/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/src/webui/service/service/routes.py b/src/webui/service/service/routes.py index e41be7c4c526efcb3dae32edf0a355044530ef34..ee9b092ae6828d7e2a82c66b1461c2f90853a803 100644 --- a/src/webui/service/service/routes.py +++ b/src/webui/service/service/routes.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,15 +13,16 @@ # limitations under the License. import grpc -from flask import render_template, Blueprint, flash, session -from webui.Config import CONTEXT_SERVICE_ADDRESS, CONTEXT_SERVICE_PORT +from flask import current_app, redirect, render_template, Blueprint, flash, session, url_for +from common.proto.context_pb2 import ContextId, Service, ServiceId, ServiceTypeEnum, ServiceStatusEnum, Connection +from common.tools.context_queries.EndPoint import get_endpoint_names from context.client.ContextClient import ContextClient -from webui.proto.context_pb2 import ContextId, ServiceList, ServiceTypeEnum, ServiceStatusEnum, ConfigActionEnum - +from service.client.ServiceClient import ServiceClient service = Blueprint('service', __name__, url_prefix='/service') -context_client: ContextClient = ContextClient(CONTEXT_SERVICE_ADDRESS, CONTEXT_SERVICE_PORT) +context_client = ContextClient() +service_client = ServiceClient() @service.get('/') def home(): @@ -29,24 +30,35 @@ def home(): # flash('This is a danger message', 'danger') context_uuid = session.get('context_uuid', '-') - request: ContextId = ContextId() + if context_uuid == "-": + flash("Please select a context!", "warning") + return redirect(url_for("main.home")) + request = ContextId() request.context_uuid.uuid = context_uuid context_client.connect() try: - service_list: ServiceList = context_client.ListServices(request) + service_list = context_client.ListServices(request) # print(service_list) services = service_list.services - context_not_found = False + context_found = True except grpc.RpcError as e: if e.code() != grpc.StatusCode.NOT_FOUND: raise if e.details() != 'Context({:s}) not found'.format(context_uuid): raise services = [] - context_not_found = True + context_found = False + + if context_found: + endpoint_ids = [] + for service_ in services: + endpoint_ids.extend(service_.service_endpoint_ids) + device_names, endpoints_data = get_endpoint_names(context_client, endpoint_ids) + else: + device_names, endpoints_data = [],[] context_client.close() - return render_template('service/home.html', services=services, context_not_found=context_not_found, - ste=ServiceTypeEnum, - sse=ServiceStatusEnum) + return render_template( + 'service/home.html', services=services, device_names=device_names, endpoints_data=endpoints_data, + context_not_found=not context_found, ste=ServiceTypeEnum, sse=ServiceStatusEnum) @service.route('add', methods=['GET', 'POST']) @@ -56,8 +68,55 @@ def add(): return render_template('service/home.html') -@service.get('detail/') +@service.get('/detail') def detail(service_uuid: str): - flash('Detail service route called', 'danger') - raise NotImplementedError() - return render_template('service/home.html') + context_uuid = session.get('context_uuid', '-') + if context_uuid == "-": + flash("Please select a context!", "warning") + return redirect(url_for("main.home")) + + request: ServiceId = ServiceId() + request.service_uuid.uuid = service_uuid + request.context_id.context_uuid.uuid = context_uuid + try: + context_client.connect() + response: Service = context_client.GetService(request) + connections: Connection = context_client.ListConnections(request) + connections = connections.connections + + endpoint_ids = [] + endpoint_ids.extend(response.service_endpoint_ids) + for connection in connections: + endpoint_ids.extend(connection.path_hops_endpoint_ids) + device_names, endpoints_data = get_endpoint_names(context_client, endpoint_ids) + + context_client.close() + except Exception as e: + flash('The system encountered an error and cannot show the details of this service.', 'warning') + current_app.logger.exception(e) + return redirect(url_for('service.home')) + return render_template( + 'service/detail.html', service=response, connections=connections, device_names=device_names, + endpoints_data=endpoints_data, ste=ServiceTypeEnum, sse=ServiceStatusEnum) + + +@service.get('/delete') +def delete(service_uuid: str): + context_uuid = session.get('context_uuid', '-') + if context_uuid == "-": + flash("Please select a context!", "warning") + return redirect(url_for("main.home")) + + try: + request = ServiceId() + request.service_uuid.uuid = service_uuid + request.context_id.context_uuid.uuid = context_uuid + service_client.connect() + response = service_client.DeleteService(request) + service_client.close() + + flash('Service "{:s}" deleted successfully!'.format(service_uuid), 'success') + except Exception as e: + flash('Problem deleting service "{:s}": {:s}'.format(service_uuid, str(e.details())), 'danger') + current_app.logger.exception(e) + return redirect(url_for('service.home')) diff --git a/src/webui/service/slice/__init__.py b/src/webui/service/slice/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1549d9811aa5d1c193a44ad45d0d7773236c0612 --- /dev/null +++ b/src/webui/service/slice/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + diff --git a/src/webui/service/slice/routes.py b/src/webui/service/slice/routes.py new file mode 100644 index 0000000000000000000000000000000000000000..222508418a187bcab18f7d44fccf896c917c6821 --- /dev/null +++ b/src/webui/service/slice/routes.py @@ -0,0 +1,117 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import grpc +from flask import current_app, redirect, render_template, Blueprint, flash, session, url_for +from common.proto.context_pb2 import ContextId, Slice, SliceId, SliceStatusEnum +from common.tools.context_queries.EndPoint import get_endpoint_names +from context.client.ContextClient import ContextClient +from slice.client.SliceClient import SliceClient + +slice = Blueprint('slice', __name__, url_prefix='/slice') + +context_client = ContextClient() +slice_client = SliceClient() + +@slice.get('/') +def home(): + context_uuid = session.get('context_uuid', '-') + if context_uuid == "-": + flash("Please select a context!", "warning") + return redirect(url_for("main.home")) + request = ContextId() + request.context_uuid.uuid = context_uuid + context_client.connect() + try: + slice_list = context_client.ListSlices(request) + slices = slice_list.slices + context_found = True + except grpc.RpcError as e: + if e.code() != grpc.StatusCode.NOT_FOUND: raise + if e.details() != 'Context({:s}) not found'.format(context_uuid): raise + slices = [] + context_found = False + + if context_found: + endpoint_ids = [] + for slice_ in slices: + endpoint_ids.extend(slice_.slice_endpoint_ids) + device_names, endpoints_data = get_endpoint_names(context_client, endpoint_ids) + else: + device_names, endpoints_data = [],[] + + context_client.close() + + return render_template( + 'slice/home.html', slices=slices, device_names=device_names, endpoints_data=endpoints_data, + context_not_found=not context_found, sse=SliceStatusEnum) + + +@slice.route('add', methods=['GET', 'POST']) +def add(): + flash('Add slice route called', 'danger') + raise NotImplementedError() + return render_template('slice/home.html') + + +@slice.get('/detail') +def detail(slice_uuid: str): + context_uuid = session.get('context_uuid', '-') + if context_uuid == "-": + flash("Please select a context!", "warning") + return redirect(url_for("main.home")) + + request: SliceId = SliceId() + request.slice_uuid.uuid = slice_uuid + request.context_id.context_uuid.uuid = context_uuid + req = ContextId() + req.context_uuid.uuid = context_uuid + try: + context_client.connect() + response: Slice = context_client.GetSlice(request) + services = context_client.ListServices(req) + + endpoint_ids = [] + endpoint_ids.extend(response.slice_endpoint_ids) + device_names, endpoints_data = get_endpoint_names(context_client, endpoint_ids) + + context_client.close() + except Exception as e: + flash('The system encountered an error and cannot show the details of this slice.', 'warning') + current_app.logger.exception(e) + return redirect(url_for('slice.home')) + return render_template( + 'slice/detail.html', slice=response, device_names=device_names, endpoints_data=endpoints_data, + sse=SliceStatusEnum, services=services) + +#@slice.get('/delete') +#def delete(slice_uuid: str): +# context_uuid = session.get('context_uuid', '-') +# if context_uuid == "-": +# flash("Please select a context!", "warning") +# return redirect(url_for("main.home")) +# +# try: +# request = SliceId() +# request.slice_uuid.uuid = slice_uuid +# request.context_id.context_uuid.uuid = context_uuid +# slice_client.connect() +# response = slice_client.DeleteSlice(request) +# slice_client.close() +# +# flash('Slice "{:s}" deleted successfully!'.format(slice_uuid), 'success') +# except Exception as e: +# flash('Problem deleting slice "{:s}": {:s}'.format(slice_uuid, str(e.details())), 'danger') +# current_app.logger.exception(e) +# return redirect(url_for('slice.home')) diff --git a/src/webui/service/static/TeraFlow SDN Logo ScreenColour with Slogan.png b/src/webui/service/static/TeraFlow SDN Logo ScreenColour with Slogan.png new file mode 100644 index 0000000000000000000000000000000000000000..218cc713c0a2704f96371fdd2916ef16b44cf667 Binary files /dev/null and b/src/webui/service/static/TeraFlow SDN Logo ScreenColour with Slogan.png differ diff --git a/src/webui/service/static/partners.png b/src/webui/service/static/partners.png index f88680212f68cdb4c17ad0de55b9d22ef9276a23..0c2b89eb9321caf8d1f1d63e0e20fd3e4b6ddeb7 100644 Binary files a/src/webui/service/static/partners.png and b/src/webui/service/static/partners.png differ diff --git a/src/webui/service/static/topology_icons/Acknowledgements.txt b/src/webui/service/static/topology_icons/Acknowledgements.txt new file mode 100644 index 0000000000000000000000000000000000000000..b285d225957b0a4e8c14ac4ae5e078597d2a1b27 --- /dev/null +++ b/src/webui/service/static/topology_icons/Acknowledgements.txt @@ -0,0 +1,26 @@ +Network Topology Icons taken from https://vecta.io/symbols + +https://symbols.getvecta.com/stencil_240/51_cloud.4d0a827676.png => network.png + #modified to be grey instead of white + +https://symbols.getvecta.com/stencil_240/15_atm-switch.1bbf9a7cca.png => packet-switch.png +https://symbols.getvecta.com/stencil_241/45_atm-switch.6a7362c1df.png => emu-packet-switch.png + +https://symbols.getvecta.com/stencil_240/204_router.7b208c1133.png => packet-router.png +https://symbols.getvecta.com/stencil_241/224_router.be30fb87e7.png => emu-packet-router.png + +https://symbols.getvecta.com/stencil_240/269_virtual-layer-switch.ed10fdede6.png => open-line-system.png +https://symbols.getvecta.com/stencil_241/281_virtual-layer-switch.29420aff2f.png => emu-open-line-system.png + +# Temporal icon; to be updated +https://symbols.getvecta.com/stencil_240/269_virtual-layer-switch.ed10fdede6.png => microwave-radio-system.png +https://symbols.getvecta.com/stencil_241/281_virtual-layer-switch.29420aff2f.png => emu-microwave-radio-system.png + +https://symbols.getvecta.com/stencil_240/102_ibm-tower.2cc133f3d0.png => datacenter.png +https://symbols.getvecta.com/stencil_241/133_ibm-tower.995c44696c.png => emu-datacenter.png + +https://symbols.getvecta.com/stencil_240/193_programmable-switch.6d97768882.png => optical-roadm.png +https://symbols.getvecta.com/stencil_241/213_programmable-sw.32d3794d56.png => emu-optical-roadm.png + +https://symbols.getvecta.com/stencil_240/275_wae.c06b769cd7.png => optical-transponder.png +https://symbols.getvecta.com/stencil_241/289_wae.216d930c17.png => emu-optical-transponder.png diff --git a/src/webui/service/static/topology_icons/datacenter.png b/src/webui/service/static/topology_icons/datacenter.png new file mode 100644 index 0000000000000000000000000000000000000000..33818cf87e0f47fb6fd45b45c46f368f62ab78d2 Binary files /dev/null and b/src/webui/service/static/topology_icons/datacenter.png differ diff --git a/src/webui/service/static/topology_icons/emu-datacenter.png b/src/webui/service/static/topology_icons/emu-datacenter.png new file mode 100644 index 0000000000000000000000000000000000000000..ed2cc7376b481815edb48fb6faaa025289cfc3ca Binary files /dev/null and b/src/webui/service/static/topology_icons/emu-datacenter.png differ diff --git a/src/webui/service/static/topology_icons/emu-microwave-radio-system.png b/src/webui/service/static/topology_icons/emu-microwave-radio-system.png new file mode 100644 index 0000000000000000000000000000000000000000..a5c30d679170c6e080dee3cc5239bf7ecaefe743 Binary files /dev/null and b/src/webui/service/static/topology_icons/emu-microwave-radio-system.png differ diff --git a/src/webui/service/static/topology_icons/emu-open-line-system.png b/src/webui/service/static/topology_icons/emu-open-line-system.png new file mode 100644 index 0000000000000000000000000000000000000000..a5c30d679170c6e080dee3cc5239bf7ecaefe743 Binary files /dev/null and b/src/webui/service/static/topology_icons/emu-open-line-system.png differ diff --git a/src/webui/service/static/topology_icons/emu-optical-roadm.png b/src/webui/service/static/topology_icons/emu-optical-roadm.png new file mode 100644 index 0000000000000000000000000000000000000000..d52d71499e3f2b49bdb3f80d8b3c21f9b7350a65 Binary files /dev/null and b/src/webui/service/static/topology_icons/emu-optical-roadm.png differ diff --git a/src/webui/service/static/topology_icons/emu-optical-transponder.png b/src/webui/service/static/topology_icons/emu-optical-transponder.png new file mode 100644 index 0000000000000000000000000000000000000000..43b37859780cff9a99c8890972f457d6ffa97c3d Binary files /dev/null and b/src/webui/service/static/topology_icons/emu-optical-transponder.png differ diff --git a/src/webui/service/static/topology_icons/emu-packet-router.png b/src/webui/service/static/topology_icons/emu-packet-router.png new file mode 100644 index 0000000000000000000000000000000000000000..95fc8b9f35a0cda9440a07ac0df3d0d417cdd0f2 Binary files /dev/null and b/src/webui/service/static/topology_icons/emu-packet-router.png differ diff --git a/src/webui/service/static/topology_icons/emu-packet-switch.png b/src/webui/service/static/topology_icons/emu-packet-switch.png new file mode 100644 index 0000000000000000000000000000000000000000..f9d431cd29b9eebc7eb6ec503ba8ed777082fa21 Binary files /dev/null and b/src/webui/service/static/topology_icons/emu-packet-switch.png differ diff --git a/src/webui/service/static/topology_icons/microwave-radio-system.png b/src/webui/service/static/topology_icons/microwave-radio-system.png new file mode 100644 index 0000000000000000000000000000000000000000..b51f094216755ed9fc5c7a7e8957bab88090c954 Binary files /dev/null and b/src/webui/service/static/topology_icons/microwave-radio-system.png differ diff --git a/src/webui/service/static/topology_icons/network.png b/src/webui/service/static/topology_icons/network.png new file mode 100644 index 0000000000000000000000000000000000000000..1f770f7bb2a31834a191e6c8727f059e1f14bbe1 Binary files /dev/null and b/src/webui/service/static/topology_icons/network.png differ diff --git a/src/webui/service/static/topology_icons/open-line-system.png b/src/webui/service/static/topology_icons/open-line-system.png new file mode 100644 index 0000000000000000000000000000000000000000..b51f094216755ed9fc5c7a7e8957bab88090c954 Binary files /dev/null and b/src/webui/service/static/topology_icons/open-line-system.png differ diff --git a/src/webui/service/static/topology_icons/optical-roadm.png b/src/webui/service/static/topology_icons/optical-roadm.png new file mode 100644 index 0000000000000000000000000000000000000000..2015c839391120f8830d4ca765b1852d9f7bff83 Binary files /dev/null and b/src/webui/service/static/topology_icons/optical-roadm.png differ diff --git a/src/webui/service/static/topology_icons/optical-transponder.png b/src/webui/service/static/topology_icons/optical-transponder.png new file mode 100644 index 0000000000000000000000000000000000000000..cc59281102e6926fe8ff87fc15848485aec177a2 Binary files /dev/null and b/src/webui/service/static/topology_icons/optical-transponder.png differ diff --git a/src/webui/service/static/topology_icons/packet-router.png b/src/webui/service/static/topology_icons/packet-router.png new file mode 100644 index 0000000000000000000000000000000000000000..5d2ad4dabe730f78206afddb21886c6678e88a26 Binary files /dev/null and b/src/webui/service/static/topology_icons/packet-router.png differ diff --git a/src/webui/service/static/topology_icons/packet-switch.png b/src/webui/service/static/topology_icons/packet-switch.png new file mode 100644 index 0000000000000000000000000000000000000000..14f81111f9fbb4236f60f92cac1147365112bc41 Binary files /dev/null and b/src/webui/service/static/topology_icons/packet-switch.png differ diff --git a/src/webui/service/static/topology_icons/xr-constellation.png b/src/webui/service/static/topology_icons/xr-constellation.png new file mode 100644 index 0000000000000000000000000000000000000000..518ca5a60b1d6b9c674783873189566430adccf9 Binary files /dev/null and b/src/webui/service/static/topology_icons/xr-constellation.png differ diff --git a/src/webui/service/templates/base.html b/src/webui/service/templates/base.html index fcc8c0a8de658d50766cff3ab582dfd50e06769b..0aa022f1453eaa33a67212174cf9687a942b10f0 100644 --- a/src/webui/service/templates/base.html +++ b/src/webui/service/templates/base.html @@ -1,137 +1,167 @@ - - - - - - - - - - - - - - - - TeraFlow OFC 2022 Demo - - -

- - - - -
-
-
- {% with messages = get_flashed_messages(with_categories=true) %} - {% if messages %} - {% for category, message in messages %} - - - {% endfor %} - {% endif %} - {% endwith %} +
+
+ {% block content %}{% endblock %} +
-
-
-
- {% block content %}{% endblock %} -
-
-
- -
-
-
-

© 2021-2023

+ + +
+
+
+
+

© 2021-2023

+
+
+
+
+

This project has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement No 101015857.

+
+
+ 5g ppp EU logo +
+
-
-
- - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + \ No newline at end of file diff --git a/src/webui/service/templates/context/home.html b/src/webui/service/templates/context/home.html index 9e1d1cd531c5542efdfbf87dbe9d452cd1956f14..ca02588e92ae350a56d0c5fa07f2ef12ddcb0de0 100644 --- a/src/webui/service/templates/context/home.html +++ b/src/webui/service/templates/context/home.html @@ -1,5 +1,5 @@ + +{% extends 'base.html' %} + +{% block content %} +

Add New Configuration

+
+
+ {{ form.hidden_tag() }} +
+
+ {{ form.device_key_config.label(class="col-sm-2 col-form-label") }} +
+ {% if form.device_key_config.errors %} + {{ form.device_key_config(class="form-control is-invalid") }} +
+ {% for error in form.device_key_config.errors %} + {{ error }} + {% endfor %} +
+ {% else %} + {{ form.device_key_config(class="form-control") }} + {% endif %} +
+
+
+
+ {{ form.device_value_config.label(class="col-sm-2 col-form-label") }} +
+ {% if form.device_value_config.errors %} + {{ form.device_value_config(class="form-control is-invalid") }} +
+ {% for error in form.device_value_config.errors %} + {{ error }} + {% endfor %} +
+ {% else %} + {{ form.device_value_config(class="form-control") }} + {% endif %} +
+
+
+
+ + +
+
+
+{% endblock %} \ No newline at end of file diff --git a/src/webui/service/templates/device/detail.html b/src/webui/service/templates/device/detail.html index a8c635808ce9fb9b7b3a4da4310dc160b962f347..de8bb4a81da5e595f33297070697b528dff26ff4 100644 --- a/src/webui/service/templates/device/detail.html +++ b/src/webui/service/templates/device/detail.html @@ -1,89 +1,161 @@ + 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 %} -

Device {{ device.device_id.device_uuid.uuid }}

+

Device {{ device.name }} ({{ device.device_id.device_uuid.uuid }})

-
-
- -
-
- Update -
-
- - -
+
+
+
- -
- UUID: -
- {{ device.device_id.device_uuid.uuid }} -
+ -
- Type: -
- {{ device.device_type }} -
+
+ +
-
- Configurations: -
-
    - {% for config in device.device_config.config_rules %} -
  • {{ config.resource_key }}: {{ config.resource_value }}
  • +
+ +
+
+
+ UUID: {{ device.device_id.device_uuid.uuid }}
+ Name: {{ device.name }}
+ Type: {{ device.device_type }}
+ Status: {{ dose.Name(device.device_operational_status).replace('DEVICEOPERATIONALSTATUS_', '') }}
+ Drivers: +
    + {% for driver in device.device_drivers %} +
  • {{ dde.Name(driver).replace('DEVICEDRIVER_', '').replace('UNDEFINED', 'EMULATED') }}
  • {% endfor %} -
-
+
-
- Endpoints: -
-
    - {% for endpoint in device.device_endpoints %} -
  • {{ endpoint.endpoint_id.endpoint_uuid.uuid }}: {{ endpoint.endpoint_type }}
  • - {% endfor %} -
-
+
+ + + + + + + + + + {% for endpoint in device.device_endpoints %} + + + + + + {% endfor %} + +
Endpoint UUIDNameType
+ {{ endpoint.endpoint_id.endpoint_uuid.uuid }} + + {{ endpoint.name }} + + {{ endpoint.endpoint_type }} +
+
+
+ +Configurations: - - + + +{% endblock %} \ No newline at end of file diff --git a/src/webui/service/templates/device/updateconfig.html b/src/webui/service/templates/device/updateconfig.html new file mode 100644 index 0000000000000000000000000000000000000000..84df4e51c7477c1faa92894c02495f9e28cfc25f --- /dev/null +++ b/src/webui/service/templates/device/updateconfig.html @@ -0,0 +1,18 @@ + + + +{% extends 'base.html' %} \ No newline at end of file diff --git a/src/webui/service/static/site.js b/src/webui/service/templates/js/site.js similarity index 91% rename from src/webui/service/static/site.js rename to src/webui/service/templates/js/site.js index 1cd015f17cf87a6efe319d8d7090d81889e03062..06e6ff0a3b416d1f1bdc5e197ce2a8dbfccc93aa 100644 --- a/src/webui/service/static/site.js +++ b/src/webui/service/templates/js/site.js @@ -1,5 +1,5 @@ /** - * Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) + * Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/webui/service/templates/js/topology.js b/src/webui/service/templates/js/topology.js new file mode 100644 index 0000000000000000000000000000000000000000..50486d2a6826fedace55f7a62592fa083e7256a6 --- /dev/null +++ b/src/webui/service/templates/js/topology.js @@ -0,0 +1,191 @@ +// 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. + +// Based on: +// https://www.d3-graph-gallery.com/graph/network_basic.html +// https://bl.ocks.org/steveharoz/8c3e2524079a8c440df60c1ab72b5d03 +// https://www.d3indepth.com/zoom-and-pan/ + +// Pan & Zoom does not work; to be reviewed +// +// +// +// +// +// + +// set the dimensions and margins of the graph +const margin = {top: 5, right: 5, bottom: 5, left: 5}; + +const icon_width = 40; +const icon_height = 40; + +width = 1000 - margin.left - margin.right; +height = 600 - margin.top - margin.bottom; + +//function handleZoom(e) { +// console.dir(e); +// d3.select('svg g').attr('transform', e.transform); +//} +//let zoom = d3.zoom().scaleExtent([0.01, 10]).translateExtent([[0, 0], [width, height]]).on('zoom', handleZoom); + +// append the svg object to the body of the page +const svg = d3.select('#topology') + .append('svg') + .attr('width', width + margin.left + margin.right) + .attr('height', height + margin.top + margin.bottom) + //.call(zoom) + .append('g') + .attr('transform', `translate(${margin.left}, ${margin.top})`) + ; + +// svg objects +var link, node; + +// values for all forces +forceProperties = { + center: {x: 0.5, y: 0.5}, + charge: {enabled: true, strength: -500, distanceMin: 10, distanceMax: 2000}, + collide: {enabled: true, strength: 0.7, iterations: 1, radius: 5}, + forceX: {enabled: false, strength: 0.1, x: 0.5}, + forceY: {enabled: false, strength: 0.1, y: 0.5}, + link: {enabled: true, distance: 100, iterations: 1} +} + +/**************** FORCE SIMULATION *****************/ + +var simulation = d3.forceSimulation(); + +// load the data +d3.json("{{ url_for('main.topology') }}", function(data) { + // set the data and properties of link lines and node circles + link = svg.append("g").attr("class", "links").style('stroke', '#aaa') + .selectAll("line") + .data(data.links) + .enter() + .append("line"); + node = svg.append("g").attr("class", "devices").attr('r', 20).style('fill', '#69b3a2') + .selectAll("circle") + .data(data.devices) + .enter() + .append("image") + .attr('xlink:href', function(d) { + return "{{ url_for('static', filename='/topology_icons/') }}" + d.type + ".png"; + }) + .attr('width', icon_width) + .attr('height', icon_height) + .call(d3.drag().on("start", dragstarted).on("drag", dragged).on("end", dragended)); + + // node tooltip + node.append("title").text(function(n) { return n.name; }); + // link tooltip + link.append("title").text(function(l) { return l.name; }); + + // link style + link + .attr("stroke-width", forceProperties.link.enabled ? 2 : 1) + .attr("opacity", forceProperties.link.enabled ? 1 : 0); + + // set up the simulation and event to update locations after each tick + simulation.nodes(data.devices); + + // add forces, associate each with a name, and set their properties + simulation + .force("link", d3.forceLink() + .id(function(d) {return d.id;}) + .distance(forceProperties.link.distance) + .iterations(forceProperties.link.iterations) + .links(forceProperties.link.enabled ? data.links : [])) + .force("charge", d3.forceManyBody() + .strength(forceProperties.charge.strength * forceProperties.charge.enabled) + .distanceMin(forceProperties.charge.distanceMin) + .distanceMax(forceProperties.charge.distanceMax)) + .force("collide", d3.forceCollide() + .strength(forceProperties.collide.strength * forceProperties.collide.enabled) + .radius(forceProperties.collide.radius) + .iterations(forceProperties.collide.iterations)) + .force("center", d3.forceCenter() + .x(width * forceProperties.center.x) + .y(height * forceProperties.center.y)) + .force("forceX", d3.forceX() + .strength(forceProperties.forceX.strength * forceProperties.forceX.enabled) + .x(width * forceProperties.forceX.x)) + .force("forceY", d3.forceY() + .strength(forceProperties.forceY.strength * forceProperties.forceY.enabled) + .y(height * forceProperties.forceY.y)); + + // after each simulation tick, update the display positions + simulation.on("tick", ticked); +}); + +// update the display positions +function ticked() { + link + .attr('x1', function(d) { return d.source.x; }) + .attr('y1', function(d) { return d.source.y; }) + .attr('x2', function(d) { return d.target.x; }) + .attr('y2', function(d) { return d.target.y; }); + + node + .attr('x', function(d) { return d.x-icon_width/2; }) + .attr('y', function(d) { return d.y-icon_height/2; }); +} + +/******************** UI EVENTS ********************/ + +function dragstarted(d) { + if (!d3.event.active) simulation.alphaTarget(0.3).restart(); + d.fx = d.x; + d.fy = d.y; +} + +function dragged(d) { + d.fx = d3.event.x; + d.fy = d3.event.y; +} + +function dragended(d) { + if (!d3.event.active) simulation.alphaTarget(0.0001); + d.fx = null; + d.fy = null; +} + +// update size-related forces +d3.select(window).on("resize", function(){ + width = +svg.node().getBoundingClientRect().width; + height = +svg.node().getBoundingClientRect().height; + simulation.alpha(1).restart(); +}); + +///******************** UI ACTIONS *******************/ +// +//function resetZoom() { +// d3.select('svg').transition().call(zoom.scaleTo, 1.0); +//} +//function zoomIn() { +// d3.select('svg').transition().call(zoom.scaleBy, 2.0); +//} +//function zoomOut() { +// d3.select('svg').transition().call(zoom.scaleBy, 0.5); +//} +// +//function center() { +// d3.select('svg').transition().call(zoom.translateTo, 0.5 * width, 0.5 * height); +//} +//function panLeft() { +// d3.select('svg').transition().call(zoom.translateBy, -50, 0); +//} +//function panRight() { +// d3.select('svg').transition().call(zoom.translateBy, 50, 0); +//} diff --git a/src/webui/service/templates/link/detail.html b/src/webui/service/templates/link/detail.html new file mode 100644 index 0000000000000000000000000000000000000000..acac4a55392c2bf7f6261707ae1627a486affd10 --- /dev/null +++ b/src/webui/service/templates/link/detail.html @@ -0,0 +1,70 @@ + + {% extends 'base.html' %} + + {% block content %} +

Link {{ link.name }} ({{ link.link_id.link_uuid.uuid }})

+
+
+ +
+
+ +
+
+
+ UUID: {{ link.link_id.link_uuid.uuid }}
+ Name: {{ link.name }}
+
+
+ + + + + + + + + + {% for endpoint in link.link_endpoint_ids %} + + + + + + {% endfor %} + +
Endpoint UUIDDeviceEndpoint Type
+ {{ endpoints_data.get(endpoint.endpoint_uuid.uuid, (endpoint.endpoint_uuid.uuid, ''))[0] }} + + + {{ device_names.get(endpoint.device_id.device_uuid.uuid, endpoint.device_id.device_uuid.uuid) }} + + + + + + + {{ endpoints_data.get(endpoint.endpoint_uuid.uuid, ('', '-'))[1] }} +
+
+
+ + {% endblock %} + \ No newline at end of file diff --git a/src/webui/service/templates/link/home.html b/src/webui/service/templates/link/home.html new file mode 100644 index 0000000000000000000000000000000000000000..ca96a59b56eb60254d53ff9520953a08b6043992 --- /dev/null +++ b/src/webui/service/templates/link/home.html @@ -0,0 +1,98 @@ + + + {% extends 'base.html' %} + + {% block content %} +

Links

+ +
+
+ +
+
+ {{ links | length }} links found in context {{ session['context_uuid'] }} +
+ +
+ + + + + + + + + + + + {% if links %} + {% for link in links %} + + + + + + + + + {% endfor %} + {% else %} + + + + {% endif %} + +
UUIDNameEndpoints
+ {{ link.link_id.link_uuid.uuid }} + + {{ link.name }} + + + + + + + + + +
No links found
+ + {% endblock %} \ No newline at end of file diff --git a/src/webui/service/templates/main/about.html b/src/webui/service/templates/main/about.html index 8bb77b63e4fdcb256ef2d162263a9a7df8146454..7f2e5cf09d919742a6931c9734abfa15eb6616ae 100644 --- a/src/webui/service/templates/main/about.html +++ b/src/webui/service/templates/main/about.html @@ -1,5 +1,5 @@ {% endblock %} \ No newline at end of file diff --git a/src/webui/service/templates/main/debug.html b/src/webui/service/templates/main/debug.html new file mode 100644 index 0000000000000000000000000000000000000000..11a868fdff9f5ee1bcbf22936ae0283d4ccc5715 --- /dev/null +++ b/src/webui/service/templates/main/debug.html @@ -0,0 +1,42 @@ + + +{% extends 'base.html' %} + +{% block content %} +

Debug

+ + + +

Load Generator:

+
Start + Stop + +{% endblock %} diff --git a/src/webui/service/templates/main/home.html b/src/webui/service/templates/main/home.html index e7633bbdbfaf69b5982890045d8e16fe2e795dc8..d8bc050f23c0d498cea69f6d6620630981bb75c3 100644 --- a/src/webui/service/templates/main/home.html +++ b/src/webui/service/templates/main/home.html @@ -1,5 +1,5 @@ + +{% extends 'base.html' %} + +{% block content %} +

Service {{ service.name }} ({{ service.service_id.service_uuid.uuid }})

+ +
+
+ +
+ +
+ + +
+
+ +
+
+ Context: {{ service.service_id.context_id.context_uuid.uuid }}
+ UUID: {{ service.service_id.service_uuid.uuid }}
+ Name: {{ service.name }}
+ Type: {{ ste.Name(service.service_type).replace('SERVICETYPE_', '') }}
+ Status: {{ sse.Name(service.service_status.service_status).replace('SERVICESTATUS_', '') }}
+
+
+ + + + + + + + + + {% for endpoint in service.service_endpoint_ids %} + + + + + + {% endfor %} + +
Endpoint UUIDDeviceEndpoint Type
+ {{ endpoints_data.get(endpoint.endpoint_uuid.uuid, (endpoint.endpoint_uuid.uuid, ''))[0] }} + + + {{ device_names.get(endpoint.device_id.device_uuid.uuid, endpoint.device_id.device_uuid.uuid) }} + + + + + + + {{ endpoints_data.get(endpoint.endpoint_uuid.uuid, ('', '-'))[1] }} +
+
+
+Constraints: + + + + + + + + + + {% for constraint in service.service_constraints %} + {% if constraint.WhichOneof('constraint')=='custom' %} + + + + + + {% elif constraint.WhichOneof('constraint')=='endpoint_location' %} + + + + + + {% elif constraint.WhichOneof('constraint')=='endpoint_priority' %} + + + + + + {% elif constraint.WhichOneof('constraint')=='sla_availability' %} + + + + + + {% else %} + + + + + + {% endif %} + {% endfor %} + +
KindTypeValue
Custom{{ constraint.custom.constraint_type }}{{ constraint.custom.constraint_value }}
Endpoint Location + + {{ device_names.get(constraint.endpoint_location.endpoint_id.device_id.device_uuid.uuid, constraint.endpoint_location.endpoint_id.device_id.device_uuid.uuid) }} + + + + + / {{ endpoints_data.get(constraint.endpoint_location.endpoint_id.endpoint_uuid.uuid, (constraint.endpoint_location.endpoint_id.endpoint_uuid.uuid, ''))[0] }} + + {% if constraint.endpoint_location.location.WhichOneof('location')=='region' %} + Region: {{ constraint.endpoint_location.location.region }} + {% elif constraint.endpoint_location.location.WhichOneof('location')=='gps_position' %} + Position (lat/long): + {{ constraint.endpoint_location.location.gps_position.latitude }} / + {{ constraint.endpoint_location.location.gps_position.longitude }} + {% endif %} +
Endpoint Priority + + {{ device_names.get(constraint.endpoint_priority.endpoint_id.device_id.device_uuid.uuid, constraint.endpoint_priority.endpoint_id.device_id.device_uuid.uuid) }} + + + + + / {{ endpoints_data.get(constraint.endpoint_priority.endpoint_id.endpoint_uuid.uuid, (constraint.endpoint_priority.endpoint_id.endpoint_uuid.uuid, ''))[0] }} + {{ constraint.endpoint_priority.priority }}
SLA Availability- + {{ constraint.sla_availability.num_disjoint_paths }} disjoint paths; + {% if constraint.sla_availability.all_active %}all{% else %}single{% endif %}-active +
--{{ constraint }}
+Configurations: + + + + + + + + + {% for config in service.service_config.config_rules %} + {% if config.WhichOneof('config_rule') == 'custom' %} + + + + + {% endif %} + {% endfor %} + +
KeyValue
+ {{ config.custom.resource_key }} + +
    + {% for item_type, item in json_to_list(config.custom.resource_value) %} + {% if item_type == 'kv' %} +
  • {{ item[0] }}: {{ item[1] }}
  • + {% else %} +
  • {{ item }}
  • + {% endif %} + {% endfor %} +
+
+ + + + + + + + + + + + + + {% for connection in connections %} + + + + + {% for endpoint_id in connection.path_hops_endpoint_ids %} + + {% endfor %} + + {% endfor %} + +
Connection IdSub-servicePath
+ {{ connection.connection_id.connection_uuid.uuid }} + + + + + {{ device_names.get(endpoint_id.device_id.device_uuid.uuid, endpoint_id.device_id.device_uuid.uuid) }} + + + + + / {{ endpoints_data.get(endpoint_id.endpoint_uuid.uuid, (endpoint_id.endpoint_uuid.uuid, ''))[0] }} +
+ + + + + +{% endblock %} \ No newline at end of file diff --git a/src/webui/service/templates/service/home.html b/src/webui/service/templates/service/home.html index 8f6a99dc3ab54dacaa9741f70dc6ba08d0714fa6..79b55c962dcdd0af4a380928c180f6c9def75ba7 100644 --- a/src/webui/service/templates/service/home.html +++ b/src/webui/service/templates/service/home.html @@ -1,5 +1,5 @@ - {% else %} -
- Context {{ session['context_uuid'] }} not found. -
- {% endif %}
- + + - - - + @@ -68,42 +61,37 @@ - - - + {% endfor %} {% else %} diff --git a/src/webui/service/templates/slice/detail.html b/src/webui/service/templates/slice/detail.html new file mode 100644 index 0000000000000000000000000000000000000000..390f882d7058b825ecf9d2bce5689585f99b80aa --- /dev/null +++ b/src/webui/service/templates/slice/detail.html @@ -0,0 +1,247 @@ + + +{% extends 'base.html' %} + +{% block content %} +

Slice {{ slice.name }} ({{ slice.slice_id.slice_uuid.uuid }})

+ +
+
+ +
+ + + +
+ +
+
+ Context: {{ slice.slice_id.context_id.context_uuid.uuid }}
+ UUID: {{ slice.slice_id.slice_uuid.uuid }}
+ Name: {{ slice.name }}
+ Owner: {{ slice.slice_owner.owner_uuid.uuid }}
+ Status: {{ sse.Name(slice.slice_status.slice_status).replace('SLICESTATUS_', '') }}
+
+
+
#UUIDName Type End pointsConstraints StatusConfiguration
- {{ ste.Name(service.service_type).replace('SERVICETYPE_', '') }} - -
    - {% for end_point in service.service_endpoint_ids %} -
  • {{ end_point.device_id.device_uuid.uuid }} / {{ end_point.endpoint_uuid.uuid }}
  • - {% endfor %} -
+ {{ service.name }}
-
    - {% for constraint in service.service_constraints %} -
  • {{ constraint.constraint_type }}: {{ constraint.constraint_value }}
  • - {% endfor %} -
+ {{ ste.Name(service.service_type).replace('SERVICETYPE_', '') }}
{{ sse.Name(service.service_status.service_status).replace('SERVICESTATUS_', '') }}
+ + + + + + + + + {% for endpoint in slice.slice_endpoint_ids %} + + + + + + {% endfor %} + +
Endpoint UUIDDeviceEndpoint Type
+ {{ endpoints_data.get(endpoint.endpoint_uuid.uuid, (endpoint.endpoint_uuid.uuid, ''))[0] }} + + + {{ device_names.get(endpoint.device_id.device_uuid.uuid, endpoint.device_id.device_uuid.uuid) }} + + + + + + + {{ endpoints_data.get(endpoint.endpoint_uuid.uuid, ('', '-'))[1] }} +
+
+
+Constraints: + + + + + + + + + + {% for constraint in slice.slice_constraints %} + {% if constraint.WhichOneof('constraint')=='custom' %} + + + + + + {% elif constraint.WhichOneof('constraint')=='endpoint_location' %} + + + + + + {% elif constraint.WhichOneof('constraint')=='endpoint_priority' %} + + + + + + {% elif constraint.WhichOneof('constraint')=='sla_availability' %} + + + + + + {% else %} + + + + + + {% endif %} + {% endfor %} + +
KindTypeValue
Custom{{ constraint.custom.constraint_type }}{{ constraint.custom.constraint_value }}
Endpoint Location + + {{ device_names.get(constraint.endpoint_location.endpoint_id.device_id.device_uuid.uuid, constraint.endpoint_location.endpoint_id.device_id.device_uuid.uuid) }} + + + + + / {{ endpoints_data.get(constraint.endpoint_location.endpoint_id.endpoint_uuid.uuid, (constraint.endpoint_location.endpoint_id.endpoint_uuid.uuid, ''))[0] }} + + {% if constraint.endpoint_location.location.WhichOneof('location')=='region' %} + Region: {{ constraint.endpoint_location.location.region }} + {% elif constraint.endpoint_location.location.WhichOneof('location')=='gps_position' %} + Position (lat/long): + {{ constraint.endpoint_location.location.gps_position.latitude }} / + {{ constraint.endpoint_location.location.gps_position.longitude }} + {% endif %} +
Endpoint Priority + + {{ device_names.get(constraint.endpoint_priority.endpoint_id.device_id.device_uuid.uuid, constraint.endpoint_priority.endpoint_id.device_id.device_uuid.uuid) }} + + + + + / {{ endpoints_data.get(constraint.endpoint_priority.endpoint_id.endpoint_uuid.uuid, (constraint.endpoint_priority.endpoint_id.endpoint_uuid.uuid, ''))[0] }} + {{ constraint.endpoint_priority.priority }}
SLA Availability- + {{ constraint.sla_availability.num_disjoint_paths }} disjoint paths; + {% if constraint.sla_availability.all_active %}all{% else %}single{% endif %}-active +
--{{ constraint }}
+Configurations: + + + + + + + + + {% for config in slice.slice_config.config_rules %} + {% if config.WhichOneof('config_rule') == 'custom' %} + + + + + {% endif %} + {% endfor %} + +
KeyValue
+ {{ config.custom.resource_key }} + +
    + {% for item_type, item in json_to_list(config.custom.resource_value) %} + {% if item_type == 'kv' %} +
  • {{ item[0] }}: {{ item[1] }}
  • + {% else %} +
  • {{ item }}
  • + {% endif %} + {% endfor %} +
+
+
+
+ + + + + + + + {% for service_id in slice.slice_service_ids %} + + + + {% endfor %} + +
Service Id
+ {% if service_id.context_id.context_uuid.uuid == session['context_uuid'] %} + + {{ service_id.context_id.context_uuid.uuid }} / {{ service_id.service_uuid.uuid }} + + + + + + {% else %} + {{ service_id.context_id.context_uuid.uuid }} / {{ service_id.service_uuid.uuid }} + {% endif %} +
+
+
+ + + + + + + + {% for subslice_id in slice.slice_subslice_ids %} + + + + {% endfor %} + +
Sub-slices
+ {% if subslice_id.context_id.context_uuid.uuid == session['context_uuid'] %} + + {{ subslice_id.context_id.context_uuid.uuid }} / {{ subslice_id.slice_uuid.uuid }} + + + + + + {% else %} + {{ subslice_id.context_id.context_uuid.uuid }} / {{ subslice_id.slice_uuid.uuid }} + {% endif %} +
+
+
+{% endblock %} \ No newline at end of file diff --git a/src/webui/service/templates/slice/home.html b/src/webui/service/templates/slice/home.html new file mode 100644 index 0000000000000000000000000000000000000000..df98d5f6c454ae0bb9a8c5acea26893c24c70f4d --- /dev/null +++ b/src/webui/service/templates/slice/home.html @@ -0,0 +1,86 @@ + + +{% extends 'base.html' %} + +{% block content %} +

Slice

+ +
+ +
+ {{ slices | length }} slices found in context {{ session['context_uuid'] }} +
+ +
+ + + + + + + + + + + + + + {% if slices %} + {% for slice in slices %} + + + + + + + + {% endfor %} + {% else %} + + + + + {% endif %} + +
UUIDNameEnd pointsStatus
{{ slice.slice_id.slice_uuid.uuid }}{{ slice.name }} + + + {{ sse.Name(slice.slice_status.slice_status).replace('SLICESTATUS_', '') }} + + + + + + + +
No slices found
+ +{% endblock %} \ No newline at end of file diff --git a/src/webui/tests/__init__.py b/src/webui/tests/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..38d04994fb0fa1951fb465bc127eb72659dc2eaf 100644 --- a/src/webui/tests/__init__.py +++ b/src/webui/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -11,4 +11,3 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - diff --git a/src/webui/tests/test_unitary.py b/src/webui/tests/test_unitary.py index 08c996446c67f76d65105bde3263d46b28d37048..a1e4f9f6fab7ca1bc66a80d7cd8fde41a6a2e289 100644 --- a/src/webui/tests/test_unitary.py +++ b/src/webui/tests/test_unitary.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,16 +19,18 @@ from flask.testing import FlaskClient from flask.app import Flask from flask.helpers import url_for from common.DeviceTypes import DeviceTypeEnum +from common.proto.context_pb2 import ContextIdList, Empty, DeviceId, DeviceList, TopologyIdList # from device.client.DeviceClient import DeviceClient from webui.service import create_app -from webui.proto.context_pb2 import Empty, DeviceId, DeviceList, TopologyIdList class TestWebUI(ClientTestCase): - app = create_app(use_config={'TESTING': True, - 'SERVER_NAME': 'localhost.localdomain', - 'SECRET_KEY': '>s&}24@{]]#k3&^5$f3#?6?h3{W@[}/7z}2pa]>{3&5%RP<)[(', - 'WTF_CSRF_ENABLED': False}) - + app = create_app(use_config={ + 'TESTING': True, + 'SERVER_NAME': 'localhost.localdomain', + 'SECRET_KEY': '>s&}24@{]]#k3&^5$f3#?6?h3{W@[}/7z}2pa]>{3&5%RP<)[(', + 'WTF_CSRF_ENABLED': False, + }) + def setUp(self, client: FlaskClient) -> None: self.mocker_delete_device = mock.patch('webui.service.device.routes.device_client.DeleteDevice') @@ -36,6 +38,11 @@ class TestWebUI(ClientTestCase): self.mocker_delete_device.start() self.addCleanup(self.mocker_delete_device.stop) + self.mocker_list_context_ids = mock.patch('webui.service.device.routes.context_client.ListContextIds') + self.mocker_list_context_ids.return_value = ContextIdList() # returns an empty list + self.mocker_list_context_ids.start() + self.addCleanup(self.mocker_list_context_ids.stop) + self.mocker_list_devices = mock.patch('webui.service.device.routes.context_client.ListDevices') self.mocker_list_devices.return_value = DeviceList() # returns an empty list self.mocker_list_devices.start() @@ -52,19 +59,24 @@ class TestWebUI(ClientTestCase): self.addCleanup(self.mocker_list_topology_ids.stop) return super().setUp(client) - + def tearDown(self, client: FlaskClient) -> None: mock.patch.stopall() return super().tearDown(client) - - def test_routes(self, client): + + def test_routes(self, _) -> None: with self.app.app_context(): url_for('main.home') url_for('service.home') + url_for('slice.home') url_for('device.home') + url_for('link.home') + #url_for('main.debug') url_for('main.about') - - def test_device_add_action_success(self, client): + url_for('js.topology_js') + url_for('js.site_js') + + def test_device_add_action_success(self, client) -> None: with client.session_transaction() as sess: sess['context_uuid'] = 'admin' DEVICE_EMU = { @@ -77,7 +89,7 @@ class TestWebUI(ClientTestCase): } rv = client.post('/device/add', data=DEVICE_EMU, follow_redirects=True) self.assertInResponse(b'success', rv) - + def test_device_delete_action(self, client): with client.session_transaction() as sess: sess['context_uuid'] = 'admin' @@ -86,15 +98,10 @@ class TestWebUI(ClientTestCase): # mocked_list.assert_called() # mocked_delete.assert_called() self.assertInResponse(b'success', rv) - - def test_service_up(self, client): - pass - - -# def test_service_up(client): -# rw = client.get('/') -# assert rw.status_code == 200, 'Service is not up!' + # def test_service_up(self, client): + # rw = client.get('/') + # assert rw.status_code == 200, 'Service is not up!' # def test_home_page(client): # rw = client.get('/') diff --git a/src/webui/utils/__init__.py b/src/webui/utils/__init__.py index 70a33251242c51f49140e596b8208a19dd5245f7..38d04994fb0fa1951fb465bc127eb72659dc2eaf 100644 --- a/src/webui/utils/__init__.py +++ b/src/webui/utils/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -11,4 +11,3 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - diff --git a/src/webui/utils/form_validators.py b/src/webui/utils/form_validators.py index 59c5cf998847be5a5a81419264fbc09afd30f595..9048fc7fa4f672527b1e461c1761356fd3d82002 100644 --- a/src/webui/utils/form_validators.py +++ b/src/webui/utils/form_validators.py @@ -1,4 +1,4 @@ -# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/) +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/update_tfs_runtime_env_vars.sh b/update_tfs_runtime_env_vars.sh new file mode 100755 index 0000000000000000000000000000000000000000..320b2ce0adc79cd8bde8c49ccd8a38f1d998faf3 --- /dev/null +++ b/update_tfs_runtime_env_vars.sh @@ -0,0 +1,67 @@ +#!/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. + + +######################################################################################################################## +# Read deployment settings +######################################################################################################################## + +# If not already set, set the list of components you want to build images for, and deploy. +# By default, only basic components are deployed +export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device monitoring service compute webui"} + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +echo "Deploying components and collecting environment variables..." +ENV_VARS_SCRIPT=tfs_runtime_env_vars.sh +echo "# Environment variables for TeraFlowSDN deployment" > $ENV_VARS_SCRIPT +PYTHONPATH=$(pwd)/src +echo "export PYTHONPATH=${PYTHONPATH}" >> $ENV_VARS_SCRIPT + +for COMPONENT in $TFS_COMPONENTS; do + echo " Collecting env-vars for '$COMPONENT' component..." + + SERVICE_DATA=$(kubectl get service ${COMPONENT}service --namespace $TFS_K8S_NAMESPACE -o json) + if [ -z "${SERVICE_DATA}" ]; then continue; fi + + # Env vars for service's host address + SERVICE_HOST=$(echo ${SERVICE_DATA} | jq -r '.spec.clusterIP') + if [ -z "${SERVICE_HOST}" ]; then continue; fi + ENVVAR_HOST=$(echo "${COMPONENT}service_SERVICE_HOST" | tr '[:lower:]' '[:upper:]') + echo "export ${ENVVAR_HOST}=${SERVICE_HOST}" >> $ENV_VARS_SCRIPT + + # Env vars for service's 'grpc' port (if any) + SERVICE_PORT_GRPC=$(echo ${SERVICE_DATA} | jq -r '.spec.ports[] | select(.name=="grpc") | .port') + if [ -n "${SERVICE_PORT_GRPC}" ]; then + ENVVAR_PORT_GRPC=$(echo "${COMPONENT}service_SERVICE_PORT_GRPC" | tr '[:lower:]' '[:upper:]') + echo "export ${ENVVAR_PORT_GRPC}=${SERVICE_PORT_GRPC}" >> $ENV_VARS_SCRIPT + fi + + # Env vars for service's 'http' port (if any) + SERVICE_PORT_HTTP=$(echo ${SERVICE_DATA} | jq -r '.spec.ports[] | select(.name=="http") | .port') + if [ -n "${SERVICE_PORT_HTTP}" ]; then + ENVVAR_PORT_HTTP=$(echo "${COMPONENT}service_SERVICE_PORT_HTTP" | tr '[:lower:]' '[:upper:]') + echo "export ${ENVVAR_PORT_HTTP}=${SERVICE_PORT_HTTP}" >> $ENV_VARS_SCRIPT + fi + + printf "\n" +done + +echo "Done!"